Previous 15994 Revisions Next

r5953 Sunday 4th October, 2009 at 00:56:44 UTC by Robbbert
[EXIDY] Added SNP support for the 6 games commonly found on the net.
[src/mess/drivers]exidy.c
[src/mess/includes]exidy.h
[src/mess/machine]exidy.c

src/mess/includes/exidy.h
r5952r5953
2222MACHINE_START( exidy );
2323MACHINE_RESET( exidy );
2424Z80BIN_EXECUTE( exidy );
25SNAPSHOT_LOAD( exidy );
2526
2627
2728/*----------- defined in video/exidy.c -----------*/
src/mess/machine/exidy.c
r5952r5953
55*******************************************************************************/
66
77#include "driver.h"
8#include "cpu/z80/z80.h"
89#include "sound/speaker.h"
910#include "sound/wave.h"
1011#include "machine/ctronics.h"
r5952r5953
334335   UINT8 data=0x7f;
335336
336337   /* bit 7 = printer busy
337    0 = printer is not busy */
338   0 = printer is not busy */
338339
339340   data |= centronics_busy_r(printer) << 7;
340341
r5952r5953
390391   }
391392}
392393
394/******************************************************************************
395 Snapshot Handling
396******************************************************************************/
397
398SNAPSHOT_LOAD(exidy)
399{
400   UINT8 *ptr = memory_region(image->machine, "maincpu");
401   const device_config *cpu = cputag_get_cpu(image->machine, "maincpu");
402   const UINT8 header[28];
403
404   /* check size */
405   if (snapshot_size != 0x1001c)
406   {
407      image_seterror(image, IMAGE_ERROR_INVALIDIMAGE, "Snapshot must be 65564 bytes");
408      return INIT_FAIL;
409   }
410
411   /* get the header */
412   image_fread(image, &header, sizeof(header));
413
414   /* write it to ram */
415   image_fread(image, ptr, 0x10000);
416
417   /* patch CPU registers */
418   cpu_set_reg(cpu, Z80_I, header[0]);
419   cpu_set_reg(cpu, Z80_HL2, header[1] | (header[2] << 8));
420   cpu_set_reg(cpu, Z80_DE2, header[3] | (header[4] << 8));
421   cpu_set_reg(cpu, Z80_BC2, header[5] | (header[6] << 8));
422   cpu_set_reg(cpu, Z80_AF2, header[7] | (header[8] << 8));
423   cpu_set_reg(cpu, Z80_HL, header[9] | (header[10] << 8));
424   cpu_set_reg(cpu, Z80_DE, header[11] | (header[12] << 8));
425   cpu_set_reg(cpu, Z80_BC, header[13] | (header[14] << 8));
426   cpu_set_reg(cpu, Z80_IY, header[15] | (header[16] << 8));
427   cpu_set_reg(cpu, Z80_IX, header[17] | (header[18] << 8));
428   cpu_set_reg(cpu, Z80_IFF1, header[19]&2 ? 1 : 0);
429   cpu_set_reg(cpu, Z80_IFF2, header[19]&4 ? 1 : 0);
430   cpu_set_reg(cpu, Z80_R, header[20]);
431   cpu_set_reg(cpu, Z80_AF, header[21] | (header[22] << 8));
432   cpu_set_reg(cpu, REG_GENSP, header[23] | (header[24] << 8));
433   cpu_set_reg(cpu, Z80_IM, header[25]);
434   cpu_set_reg(cpu, REG_GENPC, header[26] | (header[27] << 8));
435
436   return INIT_PASS;
437}
438
393439MACHINE_START( exidy )
394440{
395441//  serial_timer = timer_alloc(machine, exidy_serial_timer_callback, NULL);
src/mess/drivers/exidy.c
r5952r5953
156156static ADDRESS_MAP_START( exidy_mem, ADDRESS_SPACE_PROGRAM, 8)
157157   ADDRESS_MAP_UNMAP_HIGH
158158   AM_RANGE(0x0000, 0x07ff) AM_RAMBANK(1)
159   AM_RANGE(0x0800, 0x7fff) AM_RAM      /* ram 32k machine */
160   AM_RANGE(0x8000, 0xbbff) AM_READWRITE(exidy_read_ff, SMH_NOP)
161   AM_RANGE(0xbc00, 0xbcff) AM_ROM      /* disk bios */
159   AM_RANGE(0x0800, 0xbbff) AM_RAM AM_REGION("maincpu", 0x0800)
160   AM_RANGE(0xbc00, 0xbcff) AM_ROM                  /* disk bios */
162161   AM_RANGE(0xbd00, 0xbdff) AM_READWRITE(exidy_read_ff, SMH_NOP)
163162   AM_RANGE(0xbe00, 0xbe03) AM_DEVREADWRITE("wd179x", wd17xx_r, wd17xx_w)
164163   AM_RANGE(0xbe04, 0xbfff) AM_READWRITE(exidy_read_ff, SMH_NOP)
165   AM_RANGE(0xc000, 0xefff) AM_ROM      /* rom pac and bios */
164   AM_RANGE(0xc000, 0xefff) AM_ROM                  /* rom pac and bios */
166165   AM_RANGE(0xf000, 0xf7ff) AM_RAM AM_REGION("maincpu", 0xf000)      /* screen ram */
167   AM_RANGE(0xf800, 0xfbff) AM_ROM      /* char rom */
168   AM_RANGE(0xfc00, 0xffff) AM_RAM   AM_REGION("maincpu", 0xfc00)   /* programmable chars */
166   AM_RANGE(0xf800, 0xfbff) AM_ROM                  /* char rom */
167   AM_RANGE(0xfc00, 0xffff) AM_RAM   AM_REGION("maincpu", 0xfc00)      /* programmable chars */
169168ADDRESS_MAP_END
170169
171170static ADDRESS_MAP_START( exidyd_mem, ADDRESS_SPACE_PROGRAM, 8)
172171   ADDRESS_MAP_UNMAP_HIGH
173172   AM_RANGE(0x0000, 0x07ff) AM_RAMBANK(1)
174   AM_RANGE(0x0800, 0xbfff) AM_RAM      /* ram 48k cassette-based machine */
175   AM_RANGE(0xc000, 0xefff) AM_ROM      /* rom pac and bios */
173   AM_RANGE(0x0800, 0xbfff) AM_RAM AM_REGION("maincpu", 0x0800)
174   AM_RANGE(0xc000, 0xefff) AM_ROM                  /* rom pac and bios */
176175   AM_RANGE(0xf000, 0xf7ff) AM_RAM AM_REGION("maincpu", 0xf000)      /* screen ram */
177   AM_RANGE(0xf800, 0xfbff) AM_ROM      /* char rom */
178   AM_RANGE(0xfc00, 0xffff) AM_RAM   AM_REGION("maincpu", 0xfc00)   /* programmable chars */
176   AM_RANGE(0xf800, 0xfbff) AM_ROM                  /* char rom */
177   AM_RANGE(0xfc00, 0xffff) AM_RAM   AM_REGION("maincpu", 0xfc00)      /* programmable chars */
179178ADDRESS_MAP_END
180179
181180static ADDRESS_MAP_START( exidy_io, ADDRESS_SPACE_IO, 8)
r5952r5953
392391   MDRV_CENTRONICS_ADD("centronics", standard_centronics)
393392
394393   /* quickload */
394   MDRV_SNAPSHOT_ADD("snapshot", exidy, "snp", 2)
395395   MDRV_Z80BIN_QUICKLOAD_ADD("quickload", exidy, 2)
396396
397397   MDRV_CASSETTE_ADD( "cassette1", exidy_cassette_config )

Previous 15994 Revisions Next


© 1998-2018 The MESS Team