src/mess/drivers/altair.c
| r6544 | r6545 | |
| 9 | 9 | #include "driver.h" |
| 10 | 10 | #include "cpu/i8085/i8085.h" |
| 11 | 11 | #include "machine/terminal.h" |
| 12 | #include "devices/snapquik.h" |
| 12 | 13 | |
| 13 | 14 | static UINT8 term_data; |
| 15 | static UINT8* altair_ram; |
| 14 | 16 | |
| 15 | 17 | static READ8_HANDLER(sio_status_r) |
| 16 | 18 | { |
| r6544 | r6545 | |
| 36 | 38 | terminal_write(devconf,0,data); |
| 37 | 39 | } |
| 38 | 40 | |
| 41 | static READ8_HANDLER(sio_key_status_r) |
| 42 | { |
| 43 | return (term_data!=0) ? 0x40 : 0x01; |
| 44 | } |
| 45 | |
| 39 | 46 | static ADDRESS_MAP_START(altair_mem, ADDRESS_SPACE_PROGRAM, 8) |
| 40 | 47 | ADDRESS_MAP_UNMAP_HIGH |
| 41 | | AM_RANGE( 0x0000, 0xfcff ) AM_RAM |
| 48 | AM_RANGE( 0x0000, 0xfcff ) AM_RAM AM_BASE(&altair_ram) |
| 42 | 49 | AM_RANGE( 0xfd00, 0xfdff ) AM_ROM |
| 43 | 50 | AM_RANGE( 0xff00, 0xffff ) AM_ROM |
| 44 | 51 | ADDRESS_MAP_END |
| 45 | 52 | |
| 46 | 53 | static ADDRESS_MAP_START( altair_io , ADDRESS_SPACE_IO, 8) |
| 47 | 54 | ADDRESS_MAP_UNMAP_HIGH |
| 55 | AM_RANGE( 0x00, 0x00 ) AM_READ(sio_key_status_r) |
| 56 | AM_RANGE( 0x01, 0x01 ) AM_READWRITE(sio_data_r,sio_data_w) |
| 48 | 57 | AM_RANGE( 0x10, 0x10 ) AM_READWRITE(sio_status_r,sio_command_w) |
| 49 | 58 | AM_RANGE( 0x11, 0x11 ) AM_READWRITE(sio_data_r,sio_data_w) |
| 50 | 59 | ADDRESS_MAP_END |
| r6544 | r6545 | |
| 55 | 64 | INPUT_PORTS_END |
| 56 | 65 | |
| 57 | 66 | |
| 67 | QUICKLOAD_LOAD(altair) |
| 68 | { |
| 69 | int quick_length; |
| 70 | int read_; |
| 71 | quick_length = image_length(image); |
| 72 | if (quick_length >= 0xfd00) |
| 73 | return INIT_FAIL; |
| 74 | read_ = image_fread(image, altair_ram, quick_length); |
| 75 | if (read_ != quick_length) |
| 76 | return INIT_FAIL; |
| 77 | |
| 78 | return INIT_PASS; |
| 79 | } |
| 80 | |
| 81 | |
| 58 | 82 | static MACHINE_RESET(altair) |
| 59 | 83 | { |
| 60 | 84 | // Set startup addess done by turn-key |
| 61 | 85 | cpu_set_reg(cputag_get_cpu(machine, "maincpu"), I8085_PC, 0xFD00); |
| 86 | |
| 87 | term_data = 0; |
| 62 | 88 | } |
| 63 | 89 | |
| 64 | 90 | static WRITE8_DEVICE_HANDLER( altair_kbd_put ) |
| r6544 | r6545 | |
| 82 | 108 | /* video hardware */ |
| 83 | 109 | MDRV_IMPORT_FROM( generic_terminal ) |
| 84 | 110 | MDRV_GENERIC_TERMINAL_ADD(TERMINAL_TAG,altair_terminal_intf) |
| 111 | |
| 112 | /* quickload */ |
| 113 | MDRV_QUICKLOAD_ADD("quickload", altair, "bin", 0) |
| 85 | 114 | MACHINE_DRIVER_END |
| 86 | 115 | |
| 87 | 116 | /* ROM definition */ |