src/mess/drivers/zexall.c
| r8672 | r8673 | |
| 1 | 1 | /****************************************************************************** |
| 2 | 2 | * |
| 3 | | * Bare bones 'self contained' zexall test driver |
| 3 | * Self Contained zexall 'Z80 instruction exercizer' test driver |
| 4 | 4 | * By Jonathan Gevaryahu AKA Lord Nightmare |
| 5 | | * Binary supplied by Blargg |
| 6 | | * with help from Kevin 'kevtris' Horton (wrote preloader at 0000-00ff which implements the fffd-ffff serial stuff) |
| 5 | * Zexall originally written by Frank Cringle for ZX Spectrum |
| 6 | * Modularized Spectrum-independent Zexall binary supplied by Blargg |
| 7 | * Serial interface binary/preloader at 0x0000-0x00FF written by Kevin 'kevtris' Horton |
| 7 | 8 | * |
| 8 | 9 | * |
| 9 | 10 | * mem map: |
| 10 | 11 | Ram 0000-FFFF (preloaded with binary) |
| 11 | | Special calls take place for three ram values: |
| 12 | | FFFD - shared ram with output device; z80 reads from here and considers the byte at FFFF read if this value incremented |
| 13 | | FFFE - shared ram with output device; z80 writes an incrementing value to FFFD if there is a byte waiting at FFFF until FFFD is incremented |
| 14 | | FFFF - shared ram with output device; z80 writes data to be sent to output device here |
| 12 | Special calls take place for three ram values (this interface was designed by kevtris): |
| 13 | FFFD - 'ack' - shared ram with output device; z80 reads from here and considers the byte at FFFF read if this value incremented |
| 14 | FFFE - 'req' - shared ram with output device; z80 writes an incrementing value to FFFE to indicate that there is a byte waiting at FFFF and hence requesting the output device on the other end do something about it, until FFFD is incremented by the output device to acknowledge reciept |
| 15 | FFFF - 'data' - shared ram with output device; z80 writes the data to be sent to output device here |
| 15 | 16 | One i/o port is used: |
| 16 | 17 | 0001 - bit 0 controls whether interrupt timer is enabled (1) or not (0), this is a holdover from a project of kevtris' and can be ignored. |
| 17 | 18 | |
| r8672 | r8673 | |
| 20 | 21 | /* Core includes */ |
| 21 | 22 | #include "emu.h" |
| 22 | 23 | #include "cpu/z80/z80.h" |
| 23 | | //#include "dectalk.lh" // hack to avoid screenless system crash |
| 24 | 24 | #include "machine/terminal.h" |
| 25 | 25 | |
| 26 | 26 | /* Defines */ |
| r8672 | r8673 | |
| 30 | 30 | |
| 31 | 31 | static struct |
| 32 | 32 | { |
| 33 | | UINT8 data[8]; // what is this for? to suppress the scalar initializer warning? |
| 34 | | UINT8 out_data; |
| 35 | | UINT8 out_req; |
| 36 | | UINT8 out_req_last; |
| 37 | | UINT8 out_ack; |
| 33 | UINT8 data[8]; // unused; to suppress the scalar initializer warning |
| 34 | UINT8 out_data; // byte written to 0xFFFF |
| 35 | UINT8 out_req; // byte written to 0xFFFE |
| 36 | UINT8 out_req_last; // old value at 0xFFFE before the most recent write |
| 37 | UINT8 out_ack; // byte written to 0xFFFC |
| 38 | 38 | } zexall={ {0}}; |
| 39 | 39 | |
| 40 | 40 | /* Devices */ |
| r8672 | r8673 | |
| 112 | 112 | |
| 113 | 113 | static ADDRESS_MAP_START(z80_io, ADDRESS_SPACE_IO, 8) |
| 114 | 114 | ADDRESS_MAP_UNMAP_HIGH |
| 115 | | AM_RANGE(0x0001, 0x0001) AM_NOP // really a disable/enable for some sort of interrupt timer on kev's hardware, which is completely irrelevant for the test |
| 115 | AM_RANGE(0x0001, 0x0001) AM_NOP // really a disable/enable for some sort of interrupt timer on kev's hardware, which is completely irrelevant for the zexall test |
| 116 | 116 | ADDRESS_MAP_END |
| 117 | 117 | |
| 118 | 118 | |
| r8672 | r8673 | |
| 137 | 137 | |
| 138 | 138 | static MACHINE_DRIVER_START(zexall) |
| 139 | 139 | /* basic machine hardware */ |
| 140 | | MDRV_CPU_ADD("maincpu", Z80, XTAL_3_579545MHz*60) /* Toshiba TMPZ84C00AP @ 3.579545 MHz, verified, xtal is divided by 6 */ |
| 140 | MDRV_CPU_ADD("maincpu", Z80, XTAL_3_579545MHz*10) |
| 141 | 141 | MDRV_CPU_PROGRAM_MAP(z80_mem) |
| 142 | 142 | MDRV_CPU_IO_MAP(z80_io) |
| 143 | 143 | MDRV_QUANTUM_TIME(HZ(60)) |
| 144 | 144 | MDRV_MACHINE_RESET(zexall) |
| 145 | 145 | |
| 146 | 146 | /* video hardware */ |
| 147 | | //MDRV_DEFAULT_LAYOUT(layout_dectalk) // hack to avoid screenless system crash |
| 148 | 147 | MDRV_IMPORT_FROM( generic_terminal ) |
| 149 | 148 | MDRV_GENERIC_TERMINAL_ADD(TERMINAL_TAG,dectalk_terminal_intf) |
| 150 | 149 | |