src/mess/drivers/xor100.c
| r6501 | r6502 | |
| 2 | 2 | |
| 3 | 3 | XOR S-100-12 |
| 4 | 4 | |
| 5 | | 12/05/2009 Skeleton driver. |
| 6 | | |
| 7 | | Execution of this monitor rom starts at F800. |
| 8 | | |
| 9 | | I/O sequence: read 0A, discard result |
| 10 | | read 0B, output result to 0B |
| 11 | | send the sequence AA 40 4E 37 to 01, then to 03 (programming a device?) |
| 12 | | L1:read 03 to see if display device is ready |
| 13 | | write ascii character to 02 goto L1 until signon message is displayed |
| 14 | | in same fashion display top of memory (F800) |
| 15 | | display prompt character (*) wait for input |
| 16 | | read 03 to see if a key is being input, if so read 02 and display it |
| 17 | | if illegal input, display ? then display prompt on a new line |
| 18 | | |
| 19 | | To summarise: out 01 and out 03 - program a device |
| 20 | | out 02 - display a character |
| 21 | | in 02 - read character from keyboard |
| 22 | | in 03 - get busy status of display (bit 0) and keyboard (bit 1) High=ready |
| 23 | | |
| 24 | 5 | *****************************************************************************************************/ |
| 25 | 6 | |
| 26 | 7 | /* |
| 27 | 8 | |
| 28 | 9 | TODO: |
| 29 | 10 | |
| 30 | | - terminal |
| 31 | | - keyboard |
| 32 | 11 | - ROM should be mirrored every 2K at boot |
| 33 | 12 | - 2/4 MHz jumper J2 |
| 34 | 13 | - floppy |
| 35 | 14 | - memory expansion |
| 36 | 15 | - COM5016 |
| 37 | | - CTC |
| 16 | - CTC signals |
| 38 | 17 | |
| 39 | 18 | */ |
| 40 | 19 | |
| r6501 | r6502 | |
| 47 | 26 | #include "machine/com8116.h" |
| 48 | 27 | #include "machine/i8255a.h" |
| 49 | 28 | #include "machine/msm8251.h" |
| 29 | #include "machine/terminal.h" |
| 50 | 30 | #include "machine/wd17xx.h" |
| 51 | 31 | #include "machine/z80ctc.h" |
| 52 | 32 | #include "devices/messram.h" |
| r6501 | r6502 | |
| 72 | 52 | |
| 73 | 53 | static READ8_HANDLER( prom_disable_r ) |
| 74 | 54 | { |
| 75 | | memory_install_readwrite8_handler(space, 0x0000, 0xf7ff, 0, 0, SMH_BANK(1), SMH_BANK(2)); |
| 55 | const address_space *program = cputag_get_address_space(space->machine, Z80_TAG, ADDRESS_SPACE_PROGRAM); |
| 56 | |
| 57 | memory_install_readwrite8_handler(program, 0x0000, 0xf7ff, 0, 0, SMH_BANK(1), SMH_BANK(2)); |
| 76 | 58 | memory_set_bank(space->machine, 1, 1); |
| 77 | 59 | |
| 78 | 60 | return 0xff; |
| r6501 | r6502 | |
| 84 | 66 | com8116_stt_w(device, 0, data >> 4); |
| 85 | 67 | } |
| 86 | 68 | |
| 69 | static WRITE8_DEVICE_HANDLER( i8251_b_data_w ) |
| 70 | { |
| 71 | const device_config *terminal = devtag_get_device(device->machine, "terminal"); |
| 72 | |
| 73 | msm8251_data_w(device, 0, data); |
| 74 | terminal_write(terminal, 0, data); |
| 75 | } |
| 76 | |
| 87 | 77 | /* Memory Maps */ |
| 88 | 78 | |
| 89 | 79 | static ADDRESS_MAP_START( xor100_mem, ADDRESS_SPACE_PROGRAM, 8 ) |
| r6501 | r6502 | |
| 97 | 87 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 98 | 88 | AM_RANGE(0x00, 0x00) AM_DEVREADWRITE(I8251_A_TAG, msm8251_data_r, msm8251_data_w) |
| 99 | 89 | AM_RANGE(0x01, 0x01) AM_DEVREADWRITE(I8251_A_TAG, msm8251_status_r, msm8251_control_w) |
| 100 | | AM_RANGE(0x02, 0x02) AM_DEVREADWRITE(I8251_B_TAG, msm8251_data_r, msm8251_data_w) |
| 90 | AM_RANGE(0x02, 0x02) AM_DEVREADWRITE(I8251_B_TAG, msm8251_data_r, i8251_b_data_w) |
| 101 | 91 | AM_RANGE(0x03, 0x03) AM_DEVREADWRITE(I8251_B_TAG, msm8251_status_r, msm8251_control_w) |
| 102 | 92 | AM_RANGE(0x04, 0x07) AM_DEVREADWRITE(I8255A_TAG, i8255a_r, i8255a_w) |
| 103 | 93 | AM_RANGE(0x08, 0x08) AM_WRITE(mmu_w) |
| r6501 | r6502 | |
| 110 | 100 | /* Input Ports */ |
| 111 | 101 | |
| 112 | 102 | static INPUT_PORTS_START( xor100 ) |
| 103 | PORT_INCLUDE(generic_terminal) |
| 104 | |
| 113 | 105 | PORT_START("DSW0") |
| 114 | 106 | PORT_DIPNAME( 0x0f, 0x05, "Serial Port A" ) |
| 115 | 107 | PORT_DIPSETTING( 0x00, "50 baud" ) |
| r6501 | r6502 | |
| 147 | 139 | PORT_DIPSETTING( 0xf0, "19200 baud" ) |
| 148 | 140 | INPUT_PORTS_END |
| 149 | 141 | |
| 150 | | /* Video */ |
| 151 | | |
| 152 | | static VIDEO_START( xor100 ) |
| 153 | | { |
| 154 | | } |
| 155 | | |
| 156 | | static VIDEO_UPDATE( xor100 ) |
| 157 | | { |
| 158 | | return 0; |
| 159 | | } |
| 160 | | |
| 161 | 142 | /* COM5016 Interface */ |
| 162 | 143 | |
| 163 | 144 | static WRITE_LINE_DEVICE_HANDLER( com5016_fr_w ) |
| r6501 | r6502 | |
| 244 | 225 | { |
| 245 | 226 | DEVCB_NULL, |
| 246 | 227 | DEVCB_NULL, |
| 247 | | {FLOPPY_0, FLOPPY_1, NULL, NULL} |
| 228 | { FLOPPY_0, FLOPPY_1, NULL, NULL } |
| 248 | 229 | }; |
| 249 | 230 | |
| 231 | /* Terminal Interface */ |
| 232 | |
| 233 | static WRITE8_DEVICE_HANDLER( xor100_kbd_put ) |
| 234 | { |
| 235 | xor100_state *state = device->machine->driver_data; |
| 236 | |
| 237 | msm8251_receive_character(state->i8251_b, data); |
| 238 | } |
| 239 | |
| 240 | static GENERIC_TERMINAL_INTERFACE( xor100_terminal_intf ) |
| 241 | { |
| 242 | DEVCB_HANDLER(xor100_kbd_put) |
| 243 | }; |
| 244 | |
| 250 | 245 | /* Machine Initialization */ |
| 251 | 246 | |
| 252 | 247 | static MACHINE_START( xor100 ) |
| r6501 | r6502 | |
| 328 | 323 | MDRV_MACHINE_RESET(xor100) |
| 329 | 324 | |
| 330 | 325 | /* video hardware */ |
| 331 | | MDRV_SCREEN_ADD(SCREEN_TAG, RASTER) |
| 332 | | MDRV_SCREEN_REFRESH_RATE(50) |
| 333 | | MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */ |
| 334 | | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) |
| 335 | | MDRV_SCREEN_SIZE(640, 480) |
| 336 | | MDRV_SCREEN_VISIBLE_AREA(0, 640-1, 0, 480-1) |
| 337 | | MDRV_PALETTE_LENGTH(2) |
| 338 | | MDRV_PALETTE_INIT(black_and_white) |
| 326 | MDRV_IMPORT_FROM( generic_terminal ) |
| 339 | 327 | |
| 340 | | MDRV_VIDEO_START(xor100) |
| 341 | | MDRV_VIDEO_UPDATE(xor100) |
| 342 | | |
| 343 | 328 | /* devices */ |
| 344 | 329 | MDRV_MSM8251_ADD(I8251_A_TAG, /*XTAL_8MHz/2,*/ printer_8251_intf) |
| 345 | 330 | MDRV_MSM8251_ADD(I8251_B_TAG, /*XTAL_8MHz/2,*/ terminal_8251_intf) |
| 346 | 331 | MDRV_I8255A_ADD(I8255A_TAG, printer_8255_intf) |
| 347 | 332 | MDRV_Z80CTC_ADD(Z80CTC_TAG, XTAL_8MHz/2, ctc_intf) |
| 348 | 333 | MDRV_COM8116_ADD(COM5016_TAG, 5000000, com5016_intf) // COM5016 |
| 349 | | MDRV_WD179X_ADD(WD1795_TAG, /*XTAL_8MHz/8,*/ wd1795_intf ) // WD1795-02 |
| 334 | MDRV_WD179X_ADD(WD1795_TAG, /*XTAL_8MHz/8,*/ wd1795_intf) // WD1795-02 |
| 350 | 335 | MDRV_FLOPPY_2_DRIVES_ADD(xor100_floppy_config) |
| 351 | | |
| 352 | 336 | MDRV_CASSETTE_ADD(CASSETTE_TAG, xor100_cassette_config) |
| 337 | MDRV_GENERIC_TERMINAL_ADD("terminal", xor100_terminal_intf) |
| 353 | 338 | |
| 354 | 339 | /* internal ram */ |
| 355 | 340 | MDRV_RAM_ADD("messram") |
| r6501 | r6502 | |
| 363 | 348 | ROM_LOAD( "xp 185.8b", 0xf800, 0x0800, CRC(0d0bda8d) SHA1(11c83f7cd7e6a570641b44a2f2cc5737a7dd8ae3) ) |
| 364 | 349 | ROM_END |
| 365 | 350 | |
| 366 | | |
| 367 | 351 | /* System Drivers */ |
| 368 | 352 | |
| 369 | | /* YEAR NAME PARENT COMPAT MACHINE INPUT INIT CONFIG COMPANY FULLNAME FLAGS */ |
| 370 | | COMP( 1982, xor100, 0, 0, xor100, xor100, 0, 0, "Xor Data Science", "XOR S-100-12", GAME_NOT_WORKING ) |
| 353 | /* YEAR NAME PARENT COMPAT MACHINE INPUT INIT CONFIG COMPANY FULLNAME FLAGS */ |
| 354 | COMP( 1982, xor100, 0, 0, xor100, xor100, 0, 0, "Xor Data Science", "XOR S-100-12", 0 ) |