Previous 15994 Revisions Next

r4586 Wednesday 29th April, 2009 at 11:26:05 UTC by Curt Coder
[CRVISION] Added mirroring to memory map, added preliminary cassette interface, moved variables to driver state, added some clones, cleaned up driver.
[SN76496] Imported latest fixes from MAME.
[docs]messnew.txt
[src/emu/sound]sn76496.c sn76496.h
[src/mess]messdriv.c
[src/mess/drivers]crvision.c
[src/mess/includes]crvision.h*

src/emu/sound/sn76496.c
r4585r4586
3232  23/04/2007 : Lord Nightmare
3333  Major update, implement all three different noise generation algorithms and a
3434  set_variant call to discern among them.
35 
36  28/04/2009 : Lord Nightmare
37  Add READY line readback; cleaned up struct a bit. Cleaned up comments.
38  Add more TODOs. Fixed some unsaved savestate related stuff.
3539
36  TODO: Implement a function for setting stereo regs for the game gear.
37        Requires either making the entire core stereo and forcing mono out for all
38        chips except gamegear, or somehow making the core support both output typesf.
40  TODO: * Implement a function for setting stereo regs for the game gear.
41        Requires making the core support both mono and stereo, and have
42        a select register which determines which channels go where.
43      * Implement the TMS9919 and SN94624, which are earlier versions,
44        possibly lacking the /8 clock divider, of the SN76489, and hence
45        would have a max clock of 500Khz and 4 clocks per sample, as
46        opposed to max of 4Mhz and 32 clocks per sample on the SN76489A
47      * Implement the T6W28; has registers in a weird order, needs writes
48        to be 'sanitized' first. Also is stereo, similar to game gear.
49      * Implement the NCR 7496; Is probably 100% compatible with SN76496,
50        but the whitenoise taps could be different. Needs someone with a
51        Tandy 1200 or whatever it was which uses this to run some tests.
52      * Factor out common code so that the SAA1099 can share some code.
3953***************************************************************************/
4054
4155#include "sndintrf.h"
r4585r4586
4458
4559
4660#define MAX_OUTPUT 0x7fff
47
4861#define STEP 0x10000
62#define NOISEMODE (R->Register[6]&4)?1:0
4963
64
5065typedef struct _sn76496_state sn76496_state;
5166struct _sn76496_state
5267{
5368   sound_stream * Channel;
54   int SampleRate;
55   int VolTable[16];   /* volume table         */
69   INT32 VolTable[16];   /* volume table (for 4-bit to db conversion)*/
5670   INT32 Register[8];   /* registers */
5771   INT32 LastRegister;   /* last register written */
58   INT32 Volume[4];   /* volume of voice 0-2 and noise */
59   UINT32 RNG;      /* noise generator      */
60   INT32 NoiseMode;   /* active noise mode */
61   INT32 FeedbackMask;     /* mask for feedback */
62   INT32 WhitenoiseTaps;   /* mask for white noise taps */
63   INT32 WhitenoiseInvert; /* white noise invert flag */
64   INT32 Period[4];
65   INT32 Count[4];
66   INT32 Output[4];
72   INT32 Volume[4];   /* db volume of voice 0-2 and noise */
73   UINT32 RNG;         /* noise generator LFSR*/
74   INT32 FeedbackMask;   /* mask for feedback */
75   INT32 WhitenoiseTaps;   /* mask for white noise taps */
76   INT32 WhitenoiseInvert;   /* white noise invert flag */
77   INT32 Period[4];   /* Length of 1/2 of waveform */
78   INT32 Count[4];      /* Position within the waveform */
79   INT32 Output[4];   /* 1-bit output of each channel, pre-volume */
80   INT32 CyclestoREADY;/* number of cycles until the READY line goes active */
6781};
6882
6983
r4585r4586
8195   return (sn76496_state *)device->token;
8296}
8397
98READ8_DEVICE_HANDLER( sn76496_ready_r )
99{
100   sn76496_state *R = get_safe_token(device);
101   stream_update(R->Channel);
102   return (R->CyclestoREADY? 0 : 1);
103}
84104
85105WRITE8_DEVICE_HANDLER( sn76496_w )
86106{
r4585r4586
91111   /* update the output buffer before changing the registers */
92112   stream_update(R->Channel);
93113
114   /* set number of cycles until READY is active; this is always one 'sample', i.e. it equals the clock divider exactly; until the clock divider is fully supported, we delay until one sample has played */
115   R->CyclestoREADY = 4;
116
94117   if (data & 0x80)
95118   {
96119      r = (data & 0x70) >> 4;
r4585r4586
128151         {
129152                 if ((data & 0x80) == 0) R->Register[r] = (R->Register[r] & 0x3f0) | (data & 0x0f);
130153            n = R->Register[6];
131            R->NoiseMode = (n & 4) ? 1 : 0;
132154            /* N/512,N/1024,N/2048,Tone #3 output */
133155            R->Period[3] = ((n&3) == 3) ? 2 * R->Period[2] : (STEP << (5+(n&3)));
134156                 /* Reset noise shifter */
135            R->RNG = R->FeedbackMask; /* this is correct according to the smspower document */
136            //R->RNG = 0xF35; /* this is not, but sounds better in do run run */
157            R->RNG = R->FeedbackMask;
137158            R->Output[3] = R->RNG & 1;
138159         }
139160         break;
r4585r4586
149170   stream_sample_t *buffer = outputs[0];
150171
151172
152   /* If the volume is 0, increase the counter */
173   /* If the volume is 0, increase the counter; this is more or less
174   a speedup hack for when silence is to be output */
153175   for (i = 0;i < 4;i++)
154176   {
155177      if (R->Volume[i] == 0)
156178      {
157         /* note that I do count += samples, NOT count = samples + 1. You might think */
158         /* it's the same since the volume is 0, but doing the latter could cause */
159         /* interferencies when the program is rapidly modulating the volume. */
179         /* note that I do count += samples, NOT count = samples + 1.
180         You might think it's the same since the volume is 0, but doing
181         the latter could cause interferencies when the program is
182         rapidly modulating the volume. */
160183         if (R->Count[i] <= samples*STEP) R->Count[i] += samples*STEP;
161184      }
162185   }
r4585r4586
166189      int vol[4];
167190      unsigned int out;
168191      int left;
192     
193      /* decrement Cycles to READY by one */
194      if (R->CyclestoREADY >0) R->CyclestoREADY--;
169195
170
171196      /* vol[] keeps track of how long each square wave stays */
172197      /* in the 1 position during the sample period. */
173198      vol[0] = vol[1] = vol[2] = vol[3] = 0;
r4585r4586
176201      {
177202         if (R->Output[i]) vol[i] += R->Count[i];
178203         R->Count[i] -= STEP;
179         /* Period[i] is the half period of the square wave. Here, in each */
180         /* loop I add Period[i] twice, so that at the end of the loop the */
181         /* square wave is in the same status (0 or 1) it was at the start. */
182         /* vol[i] is also incremented by Period[i], since the wave has been 1 */
183         /* exactly half of the time, regardless of the initial position. */
184         /* If we exit the loop in the middle, Output[i] has to be inverted */
185         /* and vol[i] incremented only if the exit status of the square */
186         /* wave is 1. */
204         /* Period[i] is the half period of the square wave. Here, in each
205         loop I add Period[i] twice, so that at the end of the loop the
206         square wave is in the same status (0 or 1) it was at the start.
207         vol[i] is also incremented by Period[i], since the wave has been 1
208         exactly half of the time, regardless of the initial position.
209         If we exit the loop in the middle, Output[i] has to be inverted
210         and vol[i] incremented only if the exit status of the square
211         wave is 1. */
187212         while (R->Count[i] <= 0)
188213         {
189214            R->Count[i] += R->Period[i];
r4585r4586
212237         R->Count[3] -= nextevent;
213238         if (R->Count[3] <= 0)
214239         {
215              if (R->NoiseMode == 1) /* White Noise Mode */
240              if (NOISEMODE == 1) /* White Noise Mode */
216241              {
217242                 if (((R->RNG & R->WhitenoiseTaps) != R->WhitenoiseTaps) && ((R->RNG & R->WhitenoiseTaps) != 0)) /* crappy xor! */
218243               {
r4585r4586
293318
294319   R->Channel = stream_create(device,0,1,sample_rate,R,SN76496Update);
295320
296   R->SampleRate = sample_rate;
297
298321   for (i = 0;i < 4;i++) R->Volume[i] = 0;
299322
300323   R->LastRegister = 0;
r4585r4586
314337   R->FeedbackMask = 0x4000;     /* mask for feedback */
315338   R->WhitenoiseTaps = 0x03;   /* mask for white noise taps */
316339   R->WhitenoiseInvert = 1; /* white noise invert flag */
340   R->CyclestoREADY = 1; /* assume ready is not active immediately on init. is this correct?*/
317341
318342   R->RNG = R->FeedbackMask;
319343   R->Output[3] = R->RNG & 1;
r4585r4586
334358   chip->WhitenoiseTaps = noisetaps;
335359   chip->WhitenoiseInvert = noiseinvert;
336360
361   state_save_register_device_item_array(device, 0, chip->VolTable);
337362   state_save_register_device_item_array(device, 0, chip->Register);
338363   state_save_register_device_item(device, 0, chip->LastRegister);
339364   state_save_register_device_item_array(device, 0, chip->Volume);
340365   state_save_register_device_item(device, 0, chip->RNG);
341   state_save_register_device_item(device, 0, chip->NoiseMode);
366   state_save_register_device_item(device, 0, chip->FeedbackMask);
367   state_save_register_device_item(device, 0, chip->WhitenoiseTaps);
368   state_save_register_device_item(device, 0, chip->WhitenoiseInvert);
342369   state_save_register_device_item_array(device, 0, chip->Period);
343370   state_save_register_device_item_array(device, 0, chip->Count);
344371   state_save_register_device_item_array(device, 0, chip->Output);
372   state_save_register_device_item(device, 0, chip->CyclestoREADY);
345373}
346374
347375
src/emu/sound/sn76496.h
r4585r4586
33#ifndef __SN76496_H__
44#define __SN76496_H__
55
6READ8_DEVICE_HANDLER( sn76496_ready_r );
67WRITE8_DEVICE_HANDLER( sn76496_w );
78
89DEVICE_GET_INFO( sn76496 );
src/mess/includes/crvision.h
r0r4586
1#ifndef __CRVISION__
2#define __CRVISION__
3
4#define SCREEN_TAG   "screen"
5#define M6502_TAG   "u2"
6#define TMS9929_TAG   "u3"
7#define PIA6821_TAG   "u21"
8#define SN76489_TAG   "u22"
9
10typedef struct _crvision_state crvision_state;
11struct _crvision_state
12{
13   /* keyboard state */
14   int keylatch;
15
16   /* devices */
17   const device_config *sn76489;
18};
19
20#endif
src/mess/messdriv.c
r4585r4586
655655   /* VIDEO TECHNOLOGY */
656656   DRIVER( crvision )   /* 1981 creatiVision                        */
657657   DRIVER( fnvision )   /* 1983 FunVision                           */
658   DRIVER( crvisiop )
659   DRIVER( wizzard )
660   DRIVER( rameses )
661   DRIVER( vz2000 )
662   DRIVER( crvisio2 )
658663   DRIVER( laser110 )   /* 1983 Laser 110                           */
659664   DRIVER( las110de )   /* 1983 Sanyo Laser 110 (Germany)               */
660665   DRIVER( laser200 )   /* 1983 Laser 200 (color version of 110)         */
src/mess/drivers/crvision.c
r4585r4586
55   There is also a CreatiVision Mk 2, possibly also known as the Laser 500. This was a proper computer,
66   containing a CreatiVision cartridge slot.
77
8   NOTE:
9
10   If you find that the keys R,D,F,G are not working while using the BASIC cartridge,
11   please remap the Joystick 2 keys to somewhere else. By default they overlap those keys.
12
813    TODO:
914
15   - cassette left (data) / right (audio) separation
1016    - proper emulation of the monstrous keyboard
17   - parallel I/O module
18   - Chopper Rescue 18K cartridge not working
19   - HAPMON cartridge not working
1120
1221*/
1322
1423#include "driver.h"
24#include "includes/crvision.h"
1525#include "cpu/m6502/m6502.h"
1626#include "devices/cartslot.h"
1727#include "devices/cassette.h"
r4585r4586
1929#include "sound/sn76496.h"
2030#include "video/tms9928a.h"
2131
22#define M6502_TAG   "m6502"
23#define SCREEN_TAG   "screen"
32static const device_config *cassette_device_image(running_machine *machine)
33{
34   return devtag_get_device(machine, "cassette");
35}
2436
2537/* Memory Map */
2638
2739static ADDRESS_MAP_START( crvision_map, ADDRESS_SPACE_PROGRAM, 8 )
28   AM_RANGE(0x0000, 0x03ff) AM_RAM AM_MIRROR(0x0c00)
29   AM_RANGE(0x1000, 0x1003) AM_DEVREADWRITE("pia", pia6821_r, pia6821_w)
30   AM_RANGE(0x2000, 0x2000) AM_READ(TMS9928A_vram_r)
31   AM_RANGE(0x2001, 0x2001) AM_READ(TMS9928A_register_r)
32   AM_RANGE(0x3000, 0x3000) AM_WRITE(TMS9928A_vram_w)
33   AM_RANGE(0x3001, 0x3001) AM_WRITE(TMS9928A_register_w)
40   AM_RANGE(0x0000, 0x03ff) AM_MIRROR(0x0c00) AM_RAM
41   AM_RANGE(0x1000, 0x1003) AM_MIRROR(0x0ffc) AM_DEVREADWRITE(PIA6821_TAG, pia6821_r, pia6821_w)
42   AM_RANGE(0x2000, 0x2000) AM_MIRROR(0x0ffe) AM_READ(TMS9928A_vram_r)
43   AM_RANGE(0x2001, 0x2001) AM_MIRROR(0x0ffe) AM_READ(TMS9928A_register_r)
44   AM_RANGE(0x3000, 0x3000) AM_MIRROR(0x0ffe) AM_WRITE(TMS9928A_vram_w)
45   AM_RANGE(0x3001, 0x3001) AM_MIRROR(0x0ffe) AM_WRITE(TMS9928A_register_w)
3446   AM_RANGE(0x4000, 0x7fff) AM_ROMBANK(2)
3547   AM_RANGE(0x8000, 0xbfff) AM_ROMBANK(1)
36   AM_RANGE(0xc000, 0xc7ff) AM_ROM AM_MIRROR(0x3800)
48   AM_RANGE(0xc000, 0xc7ff) AM_MIRROR(0x3800) AM_ROM
3749ADDRESS_MAP_END
3850
3951/* Input Ports */
r4585r4586
229241   crvision_vdp_interrupt
230242};
231243
232static int keylatch;
233
234244static WRITE8_DEVICE_HANDLER( crvision_pia_porta_w )
235245{
236246   /*
237247        Signal  Description
238248
239        PA0     Keyboard raster player 1 output
240        PA1     Keyboard raster player 1 output
241        PA2     Keyboard raster player 2 output
242        PA3     Keyboard raster player 2 output
249        PA0     Keyboard raster player 1 output (joystick)
250        PA1     Keyboard raster player 1 output (hand keys)
251        PA2     Keyboard raster player 2 output (joystick)
252        PA3     Keyboard raster player 2 output (hand keys)
243253        PA4     ?
244254        PA5     ?
245        PA6     ?
246        PA7     ?
255        PA6     Cassette motor
256        PA7     Cassette data in/out
247257    */
248258
249   keylatch = ~data & 0x0f;
259   crvision_state *state = device->machine->driver_data;
260
261   /* keyboard raster */
262   state->keylatch = ~data & 0x0f;
263
264   /* cassette motor */
265   cassette_change_state(cassette_device_image(device->machine), BIT(data, 6) ? CASSETTE_MOTOR_DISABLED : CASSETTE_MOTOR_ENABLED, CASSETTE_MASK_MOTOR);
266
267   /* cassette data output */
268   cassette_output(cassette_device_image(device->machine), BIT(data, 7) ? +1.0 : -1.0);
250269}
251270
252271static UINT8 read_keyboard(running_machine *machine, int pa)
r4585r4586
280299static READ8_DEVICE_HANDLER( crvision_pia_porta_r )
281300{
282301   /*
283        PA0     Keyboard raster player 1 output
284        PA1     Keyboard raster player 1 output
285        PA2     Keyboard raster player 2 output
286        PA3     Keyboard raster player 2 output
302        PA0     Keyboard raster player 1 output (joystick)
303        PA1     Keyboard raster player 1 output (hand keys)
304        PA2     Keyboard raster player 2 output (joystick)
305        PA3     Keyboard raster player 2 output (hand keys)
287306        PA4     ?
288307        PA5     ?
289        PA6     ?
290        PA7     ?
308        PA6     Cassette motor
309        PA7     Cassette data in/out
291310    */
292311
293   return 0xff;
312   UINT8 data = 0x7f;
313
314   if (cassette_input(cassette_device_image(device->machine)) < +0.0) data |= 0x80;
315
316   return data;
294317}
295318
296319static READ8_DEVICE_HANDLER( crvision_pia_portb_r )
r4585r4586
308331        PB7     Keyboard input
309332    */
310333
311   if (keylatch & 0x01)
312   {
313      return read_keyboard(device->machine, 0);
314   }
315   else if (keylatch & 0x02)
316   {
317      return read_keyboard(device->machine, 1);
318   }
319   else if (keylatch & 0x04)
320   {
321      return read_keyboard(device->machine, 2);
322   }
323   else if (keylatch & 0x08)
324   {
325      return read_keyboard(device->machine, 3);
326   }
334   crvision_state *state = device->machine->driver_data;
327335
328   return 0xff;
336   UINT8 data = 0xff;
337
338   if (BIT(state->keylatch, 0)) data &= read_keyboard(device->machine, 0);
339   if (BIT(state->keylatch, 1)) data &= read_keyboard(device->machine, 1);
340   if (BIT(state->keylatch, 2)) data &= read_keyboard(device->machine, 2);
341   if (BIT(state->keylatch, 3)) data &= read_keyboard(device->machine, 3);
342
343   return data;
329344}
330345
331static READ8_DEVICE_HANDLER( crvision_pia_ca1_r )
346static READ_LINE_DEVICE_HANDLER( crvision_pia_ca_r )
332347{
333348   return 1;
334349}
335350
336static READ8_DEVICE_HANDLER( crvision_pia_ca2_r )
351static READ_LINE_DEVICE_HANDLER( crvision_pia_cb1_r )
337352{
338   return 1;
339}
353   crvision_state *state = device->machine->driver_data;
340354
341static int sn76489_ready;
342
343static READ8_DEVICE_HANDLER( crvision_pia_cb1_r )
344{
345   return sn76489_ready;
355   return sn76496_ready_r(state->sn76489, 0);
346356}
347357
348static TIMER_CALLBACK(sn76489_set_ready)
358static WRITE_LINE_DEVICE_HANDLER( crvision_pia_cb2_w )
349359{
350   sn76489_ready = 1;
351360}
352361
353362static WRITE8_DEVICE_HANDLER( crvision_pia_portb_w )
r4585r4586
365374        PB7     SN76489 data output
366375    */
367376
368   const device_config *sn76489 = devtag_get_device(device->machine, "sn76489");
369   sn76496_w(sn76489, 0, data);
377   crvision_state *state = device->machine->driver_data;
370378
371   sn76489_ready = 0;
372
373   // wait 32 cycles of 2 MHz to synchronize CPU and SN76489
374   timer_set(device->machine, ATTOTIME_IN_USEC(16), NULL, 0, sn76489_set_ready);
379   sn76496_w(state->sn76489, 0, data);
375380}
376381
377static WRITE8_DEVICE_HANDLER( crvision_pia_cb2_w )
378{
379   sn76489_ready = data & 0x01;
380}
381
382382static const pia6821_interface crvision_pia_intf =
383383{
384384   DEVCB_HANDLER(crvision_pia_porta_r),   // input A
385385   DEVCB_HANDLER(crvision_pia_portb_r),   // input B
386   DEVCB_HANDLER(crvision_pia_ca1_r),      // input CA1 (+5V)
387   DEVCB_HANDLER(crvision_pia_cb1_r),      // input CB1 (SN76489 pin READY )
388   DEVCB_HANDLER(crvision_pia_ca2_r),      // input CA2 (+5V)
389   DEVCB_NULL,                        // input CB2
386   DEVCB_LINE(crvision_pia_ca_r),         // input CA1 (+5V)
387   DEVCB_LINE(crvision_pia_cb1_r),         // input CB1 (SN76489 pin READY )
388   DEVCB_LINE(crvision_pia_ca_r),         // input CA2 (+5V)
389   DEVCB_LINE(crvision_pia_ca_r),         // input CB2 (+5V)
390390   DEVCB_HANDLER(crvision_pia_porta_w),   // output A
391391   DEVCB_HANDLER(crvision_pia_portb_w),   // output B (SN76489 pins D0-D7)
392392   DEVCB_NULL,                        // output CA2
393   DEVCB_HANDLER(crvision_pia_cb2_w),      // output CB2 (SN76489 pin CE_)
393   DEVCB_LINE(crvision_pia_cb2_w),         // output CB2 (SN76489 pin CE_)
394394   DEVCB_NULL,                        // irq A
395395   DEVCB_NULL                        // irq B
396396};
397397
398static MACHINE_START( crvision )
398static MACHINE_START( creativision )
399399{
400   state_save_register_global(machine, keylatch);
401   state_save_register_global(machine, sn76489_ready);
400   crvision_state *state = machine->driver_data;
402401
402   /* find devices */
403   state->sn76489 = devtag_get_device(machine, SN76489_TAG);
404
405   /* register for state saving */
406   state_save_register_global(machine, state->keylatch);
407}
408
409static MACHINE_START( ntsc )
410{
411   MACHINE_START_CALL(creativision);
412
403413   TMS9928A_configure(&tms9918_intf);
404414}
405415
406static MACHINE_START( fnvision )
416static MACHINE_START( pal )
407417{
408   state_save_register_global(machine, keylatch);
409   state_save_register_global(machine, sn76489_ready);
418   MACHINE_START_CALL(creativision);
410419
411420   TMS9928A_configure(&tms9929_intf);
412421}
413422
414
415423static DEVICE_IMAGE_LOAD( crvision_cart )
416424{
417425   int size = image_length(image);
418426   running_machine *machine = image->machine;
419427   UINT8 *mem = memory_region(machine, M6502_TAG);
428   const address_space *program = cputag_get_address_space(machine, M6502_TAG, ADDRESS_SPACE_PROGRAM);
420429
421430   switch (size)
422431   {
423432   case 0x1000: // 4K
424433      image_fread(image, mem + 0x9000, 0x1000);
425      memory_install_read8_handler(cputag_get_address_space(machine, M6502_TAG, ADDRESS_SPACE_PROGRAM), 0x8000, 0x9fff, 0, 0x2000, SMH_BANK1);
434      memory_install_read8_handler(program, 0x8000, 0x9fff, 0, 0x2000, SMH_BANK1);
426435      break;
427436
428437   case 0x1800: // 6K
429438      image_fread(image, mem + 0x9000, 0x1000);
430439      image_fread(image, mem + 0x8800, 0x0800);
431      memory_install_read8_handler(cputag_get_address_space(machine, M6502_TAG, ADDRESS_SPACE_PROGRAM), 0x8000, 0x9fff, 0, 0x2000, SMH_BANK1);
440      memory_install_read8_handler(program, 0x8000, 0x9fff, 0, 0x2000, SMH_BANK1);
432441      break;
433442
434443   case 0x2000: // 8K
435444      image_fread(image, mem + 0x8000, 0x2000);
436      memory_install_read8_handler(cputag_get_address_space(machine, M6502_TAG, ADDRESS_SPACE_PROGRAM), 0x8000, 0x9fff, 0, 0x2000, SMH_BANK1);
445      memory_install_read8_handler(program, 0x8000, 0x9fff, 0, 0x2000, SMH_BANK1);
437446      break;
438447
439448   case 0x2800: // 10K
440449      image_fread(image, mem + 0x8000, 0x2000);
441450      image_fread(image, mem + 0x5800, 0x0800);
442      memory_install_read8_handler(cputag_get_address_space(machine, M6502_TAG, ADDRESS_SPACE_PROGRAM), 0x8000, 0x9fff, 0, 0x2000, SMH_BANK1);
443      memory_install_read8_handler(cputag_get_address_space(machine, M6502_TAG, ADDRESS_SPACE_PROGRAM), 0x4000, 0x5fff, 0, 0x2000, SMH_BANK2);
451      memory_install_read8_handler(program, 0x8000, 0x9fff, 0, 0x2000, SMH_BANK1);
452      memory_install_read8_handler(program, 0x4000, 0x5fff, 0, 0x2000, SMH_BANK2);
444453      break;
445454
446455   case 0x3000: // 12K
447456      image_fread(image, mem + 0x8000, 0x2000);
448457      image_fread(image, mem + 0x5000, 0x1000);
449      memory_install_read8_handler(cputag_get_address_space(machine, M6502_TAG, ADDRESS_SPACE_PROGRAM), 0x8000, 0x9fff, 0, 0x2000, SMH_BANK1);
450      memory_install_read8_handler(cputag_get_address_space(machine, M6502_TAG, ADDRESS_SPACE_PROGRAM), 0x4000, 0x5fff, 0, 0x2000, SMH_BANK2);
458      memory_install_read8_handler(program, 0x8000, 0x9fff, 0, 0x2000, SMH_BANK1);
459      memory_install_read8_handler(program, 0x4000, 0x5fff, 0, 0x2000, SMH_BANK2);
451460      break;
452461
453462   case 0x4000: // 16K
454463      image_fread(image, mem + 0xa000, 0x2000);
455464      image_fread(image, mem + 0x8000, 0x2000);
456      memory_install_read8_handler(cputag_get_address_space(machine, M6502_TAG, ADDRESS_SPACE_PROGRAM), 0x8000, 0xbfff, 0, 0, SMH_BANK1);
465      memory_install_read8_handler(program, 0x8000, 0xbfff, 0, 0, SMH_BANK1);
457466      break;
458467
459468   case 0x4800: // 18K
460469      image_fread(image, mem + 0xa000, 0x2000);
461470      image_fread(image, mem + 0x8000, 0x2000);
462471      image_fread(image, mem + 0x4800, 0x0800);
463      memory_install_read8_handler(cputag_get_address_space(machine, M6502_TAG, ADDRESS_SPACE_PROGRAM), 0x8000, 0x8fff, 0, 0, SMH_BANK1);
464      memory_install_read8_handler(cputag_get_address_space(machine, M6502_TAG, ADDRESS_SPACE_PROGRAM), 0x4000, 0x4fff, 0, 0x3000, SMH_BANK2);
472      memory_install_read8_handler(program, 0x8000, 0x8fff, 0, 0, SMH_BANK1);
473      memory_install_read8_handler(program, 0x4000, 0x4fff, 0, 0x3000, SMH_BANK2);
465474      break;
466475
467476   default:
r4585r4586
479488
480489/* Machine Driver */
481490
482static MACHINE_DRIVER_START( crvision )
483   // basic machine hardware
484   MDRV_CPU_ADD(M6502_TAG, M6502, 2000000)
491static const cassette_config crvision_cassette_config =
492{
493   cassette_default_formats,
494   NULL,
495   CASSETTE_STOPPED | CASSETTE_MOTOR_DISABLED | CASSETTE_SPEAKER_ENABLED
496};
497
498static MACHINE_DRIVER_START( creativision )
499   MDRV_DRIVER_DATA(crvision_state)
500
501   /* basic machine hardware */
502   MDRV_CPU_ADD(M6502_TAG, M6502, XTAL_2MHz)
485503   MDRV_CPU_PROGRAM_MAP(crvision_map, 0)
486504   MDRV_CPU_VBLANK_INT(SCREEN_TAG, crvision_int)
487505
488   MDRV_MACHINE_START( crvision )
489
490    // video hardware
491   MDRV_IMPORT_FROM(tms9928a)
492   MDRV_SCREEN_MODIFY(SCREEN_TAG)
493   MDRV_SCREEN_REFRESH_RATE(10738635.0/2/342/262)
494   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */
495
496   MDRV_PIA6821_ADD( "pia", crvision_pia_intf )
497
498   // sound hardware
506   /* sound hardware */
499507   MDRV_SPEAKER_STANDARD_MONO("mono")
500   MDRV_SOUND_ADD("sn76489", SN76489, 2000000)
508   MDRV_SOUND_ADD(SN76489_TAG, SN76489, XTAL_2MHz)
501509   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
502510
503   MDRV_CASSETTE_ADD( "cassette", default_cassette_config )
511   /* peripheral hardware */
512   MDRV_PIA6821_ADD(PIA6821_TAG, crvision_pia_intf)
504513
505514   /* cartridge */
506515   MDRV_CARTSLOT_ADD("cart")
507516   MDRV_CARTSLOT_EXTENSION_LIST("bin,rom")
508517   MDRV_CARTSLOT_MANDATORY
509518   MDRV_CARTSLOT_LOAD(crvision_cart)
519
520   /* cassette */
521   MDRV_CASSETTE_ADD("cassette", crvision_cassette_config)
510522MACHINE_DRIVER_END
511523
512static MACHINE_DRIVER_START( fnvision )
513   MDRV_IMPORT_FROM( crvision )
514   MDRV_MACHINE_START( fnvision )
524static MACHINE_DRIVER_START( ntsc )
525   MDRV_IMPORT_FROM(creativision)
526
527   MDRV_MACHINE_START(ntsc)
528
529    /* video hardware */
530   MDRV_IMPORT_FROM(tms9928a)
515531   MDRV_SCREEN_MODIFY(SCREEN_TAG)
516   MDRV_SCREEN_REFRESH_RATE(10738635.0/2/342/313)
532   MDRV_SCREEN_REFRESH_RATE((float)XTAL_10_738635MHz/2/342/262)
533   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */
534MACHINE_DRIVER_END
517535
518   MDRV_CASSETTE_REMOVE( "cassette" )
536static MACHINE_DRIVER_START( pal )
537   MDRV_IMPORT_FROM(creativision)
538
539   MDRV_MACHINE_START(pal)
540
541   /* video hardware */
542   MDRV_IMPORT_FROM(tms9928a)
543   MDRV_SCREEN_MODIFY(SCREEN_TAG)
544   MDRV_SCREEN_REFRESH_RATE((float)XTAL_10_738635MHz/2/342/313)
545   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */
519546MACHINE_DRIVER_END
520547
521548/* ROMs */
522549
523550ROM_START( crvision )
524551    ROM_REGION( 0x10000, M6502_TAG, 0 )
525    ROM_LOAD( "crvision.rom", 0xc000, 0x0800, CRC(c3c590c6) SHA1(5ac620c529e4965efb5560fe824854a44c983757) )
552    ROM_LOAD( "crvision.u20", 0xc000, 0x0800, CRC(c3c590c6) SHA1(5ac620c529e4965efb5560fe824854a44c983757) )
526553ROM_END
527554
528555ROM_START( fnvision )
r4585r4586
530557    ROM_LOAD( "funboot.rom", 0xc000, 0x0800, CRC(05602697) SHA1(c280b20c8074ba9abb4be4338b538361dfae517f) )
531558ROM_END
532559
560#define rom_crvisiop rom_crvision
561#define rom_wizzard rom_crvision
562#define rom_rameses rom_crvision
563#define rom_vz2000 rom_crvision
564#define rom_crvisio2 rom_crvision
565
533566/* System Drivers */
534567
535/*    YEAR  NAME      PARENT    COMPAT  MACHINE     INPUT       INIT    CONFIG      COMPANY             FULLNAME */
536COMP( 1981, crvision, 0,      0,      crvision,   crvision,   0,      0,   "Video Technology", "CreatiVision (NTSC)", GAME_SUPPORTS_SAVE )
537CONS( 1983, fnvision, crvision, 0,      fnvision,   crvision,   0,      0,   "Video Technology", "FunVision Computer Video Games System (PAL)", GAME_SUPPORTS_SAVE )
568/*    YEAR  NAME      PARENT    COMPAT  MACHINE     INPUT       INIT    CONFIG  COMPANY                  FULLNAME */
569COMP( 1982, crvision, 0,      0,      ntsc,      crvision,   0,      0,      "Cheryco",               "CreatiVision (Japan)", GAME_SUPPORTS_SAVE )
570CONS( 1982, crvisiop, crvision, 0,      pal,      crvision,   0,      0,      "Video Technology",         "CreatiVision", GAME_SUPPORTS_SAVE )
571CONS( 1982, fnvision, crvision, 0,      pal,      crvision,   0,      0,      "Video Technology",         "FunVision", GAME_SUPPORTS_SAVE )
572CONS( 1982, wizzard,  crvision, 0,      pal,      crvision,   0,      0,      "Dick Smith Electronics",   "Wizzard (Australia)", GAME_SUPPORTS_SAVE )
573CONS( 1982, rameses,  crvision, 0,      pal,      crvision,   0,      0,      "Hanimex",               "Rameses (Australia)", GAME_SUPPORTS_SAVE )
574CONS( 1983, vz2000,   crvision, 0,      pal,      crvision,   0,      0,      "Dick Smith Electronics",   "VZ 2000 (Australia)", GAME_SUPPORTS_SAVE )
575CONS( 1983, crvisio2, crvision, 0,      pal,      crvision,   0,      0,      "Sanyo Video",            "CreatiVision MK-II (Germany)", GAME_SUPPORTS_SAVE )
docs/messnew.txt
r4585r4586
2222- TRS-80 Model 200 (not working) [Fabio Priuli]
2323- Z1013 (Model with 8x4 and 8x8 keyboard) [Miodrag Milanovic]
2424- Z80 N.E.  [Roberto Lavarone]
25- Dick Smith Wizzard [Curt Coder]
26- Dick Smith VZ 2000 [Curt Coder]
27- Hanimex Rameses [Curt Coder]
28- Sanyo Creativision MK-II [Curt Coder]
2529
2630
2731

Previous 15994 Revisions Next


© 1998-2018 The MESS Team