src/mess/drivers/sacstate.c
| r15924 | r15925 | |
| 4 | 4 | |
| 5 | 5 | 23/02/2009 Skeleton driver. |
| 6 | 6 | |
| 7 | | How to use this is unknown, most commands either give an error (! symbol), |
| 8 | | or cause the cpu to halt. |
| 7 | http://www.digibarn.com/stories/bill-pentz-story/index.html |
| 9 | 8 | |
| 9 | The year is listed as '1972/73'. |
| 10 | |
| 11 | All input to be in lowercase. |
| 12 | The weird characters that show on screen are various escape sequences. |
| 13 | These are different depending on the terminal type chosen. The codes |
| 14 | need to be understood and emulated before this system makes sense. |
| 15 | |
| 16 | Known Monitor commands: (from the disassembly) |
| 17 | ! write buffer to AD000 |
| 18 | * set RAM036 flag |
| 19 | + increment AD000 by 1 |
| 20 | +n increment AD000 by n |
| 21 | - decrement AD000 by 1 |
| 22 | -n decrement AD000 by n |
| 23 | : clear RAM036 flag |
| 24 | = display AD000 |
| 25 | =nnn set AD000 to nnn |
| 26 | @ fill buffer with 026 |
| 27 | |
| 28 | unknown commands: / & d e l r s t u z \ ^ | ~ |
| 29 | |
| 30 | Other input will either result in '!' message, or halt. |
| 31 | |
| 32 | |
| 10 | 33 | ****************************************************************************/ |
| 11 | 34 | |
| 12 | 35 | #include "emu.h" |
| 13 | 36 | #include "cpu/i8008/i8008.h" |
| 14 | 37 | #include "machine/terminal.h" |
| 15 | 38 | |
| 16 | | #define MACHINE_RESET_MEMBER(name) void name::machine_reset() |
| 17 | 39 | |
| 18 | 40 | class sacstate_state : public driver_device |
| 19 | 41 | { |
| r15924 | r15925 | |
| 21 | 43 | sacstate_state(const machine_config &mconfig, device_type type, const char *tag) |
| 22 | 44 | : driver_device(mconfig, type, tag), |
| 23 | 45 | m_maincpu(*this, "maincpu"), |
| 24 | | m_terminal(*this, TERMINAL_TAG), |
| 25 | | m_val(0) |
| 46 | m_terminal(*this, TERMINAL_TAG) |
| 26 | 47 | { } |
| 27 | 48 | |
| 28 | 49 | required_device<cpu_device> m_maincpu; |
| 29 | 50 | required_device<generic_terminal_device> m_terminal; |
| 30 | | DECLARE_READ8_MEMBER(status_r); |
| 31 | | DECLARE_READ8_MEMBER(tty_r); |
| 32 | | DECLARE_READ8_MEMBER(unknown_r); |
| 51 | DECLARE_READ8_MEMBER(port00_r); |
| 52 | DECLARE_READ8_MEMBER(port01_r); |
| 53 | DECLARE_READ8_MEMBER(port04_r); |
| 54 | DECLARE_WRITE8_MEMBER(port08_w); |
| 33 | 55 | DECLARE_WRITE8_MEMBER(kbd_put); |
| 34 | 56 | UINT8 m_term_data; |
| 35 | 57 | UINT8 m_val; |
| 36 | 58 | virtual void machine_reset(); |
| 37 | 59 | }; |
| 38 | 60 | |
| 39 | | READ8_MEMBER( sacstate_state::status_r ) |
| 61 | READ8_MEMBER( sacstate_state::port01_r ) |
| 40 | 62 | { |
| 41 | | UINT8 old_val = m_val; |
| 42 | | if (m_term_data) old_val |= 0x04; // data in |
| 43 | | m_val ^= 0x40; |
| 44 | | return old_val; |
| 63 | UINT8 ret = m_val; |
| 64 | if (m_term_data) |
| 65 | ret |= 0x04; // data in |
| 66 | return ret; |
| 45 | 67 | } |
| 46 | 68 | |
| 47 | | READ8_MEMBER( sacstate_state::tty_r ) |
| 69 | READ8_MEMBER( sacstate_state::port00_r ) |
| 48 | 70 | { |
| 49 | 71 | UINT8 ret = m_term_data; |
| 50 | 72 | m_term_data = 0; |
| 51 | 73 | return ret; |
| 52 | 74 | } |
| 53 | 75 | |
| 54 | | READ8_MEMBER( sacstate_state::unknown_r ) |
| 76 | READ8_MEMBER( sacstate_state::port04_r ) |
| 55 | 77 | { |
| 56 | 78 | logerror("unknown_r\n"); |
| 57 | 79 | return 0; |
| 58 | 80 | } |
| 59 | 81 | |
| 82 | WRITE8_MEMBER( sacstate_state::port08_w ) |
| 83 | { |
| 84 | if (data == 0x40) |
| 85 | m_val = 0x40; |
| 86 | else |
| 87 | if (data == 0x04) |
| 88 | m_val = 0; |
| 89 | } |
| 90 | |
| 60 | 91 | static ADDRESS_MAP_START(sacstate_mem, AS_PROGRAM, 8, sacstate_state) |
| 61 | 92 | ADDRESS_MAP_UNMAP_HIGH |
| 62 | 93 | AM_RANGE(0x000,0x7ff) AM_ROM |
| r15924 | r15925 | |
| 66 | 97 | static ADDRESS_MAP_START(sacstate_io, AS_IO, 8, sacstate_state) |
| 67 | 98 | ADDRESS_MAP_UNMAP_HIGH |
| 68 | 99 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 69 | | AM_RANGE(0x00,0x00) AM_READ(tty_r) |
| 70 | | AM_RANGE(0x01,0x01) AM_READ(status_r) |
| 71 | | AM_RANGE(0x04,0x04) AM_READ(unknown_r) |
| 100 | AM_RANGE(0x00,0x00) AM_READ(port00_r) |
| 101 | AM_RANGE(0x01,0x01) AM_READ(port01_r) |
| 102 | AM_RANGE(0x04,0x04) AM_READ(port04_r) |
| 103 | AM_RANGE(0x08,0x08) AM_WRITE(port08_w) |
| 72 | 104 | AM_RANGE(0x16,0x16) AM_DEVWRITE(TERMINAL_TAG, generic_terminal_device, write) |
| 105 | AM_RANGE(0x17,0x1f) AM_WRITENOP |
| 73 | 106 | ADDRESS_MAP_END |
| 74 | 107 | |
| 75 | 108 | /* Input ports */ |
| 76 | 109 | static INPUT_PORTS_START( sacstate ) |
| 110 | PORT_START("CONFIG") |
| 111 | PORT_CONFNAME( 0x08, 0x08, "Terminal Type") // no idea of actual terminal types |
| 112 | PORT_CONFSETTING( 0x00, "A") |
| 113 | PORT_CONFSETTING( 0x08, "B") |
| 77 | 114 | INPUT_PORTS_END |
| 78 | 115 | |
| 79 | 116 | WRITE8_MEMBER( sacstate_state::kbd_put ) |
| r15924 | r15925 | |
| 86 | 123 | DEVCB_DRIVER_MEMBER(sacstate_state, kbd_put) |
| 87 | 124 | }; |
| 88 | 125 | |
| 89 | | MACHINE_RESET_MEMBER( sacstate_state ) |
| 126 | void sacstate_state::machine_reset() |
| 90 | 127 | { |
| 91 | 128 | m_term_data = 0; |
| 92 | | m_val = 8; // must be 8 or 0 |
| 129 | m_val = ioport("CONFIG")->read(); |
| 93 | 130 | } |
| 94 | 131 | |
| 95 | 132 | static MACHINE_CONFIG_START( sacstate, sacstate_state ) |
| r15924 | r15925 | |
| 117 | 154 | |
| 118 | 155 | /* Driver */ |
| 119 | 156 | |
| 120 | | /* YEAR NAME PARENT COMPAT MACHINE INPUT INIT COMPANY FULLNAME FLAGS */ |
| 121 | | COMP( ????, sacstate, 0, 0, sacstate, sacstate, driver_device, 0, "SacState", "SacState 8008", GAME_NOT_WORKING | GAME_NO_SOUND) |
| 157 | /* YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS */ |
| 158 | COMP( 1973, sacstate, 0, 0, sacstate, sacstate, driver_device, 0, "SacState", "SacState 8008", GAME_NO_SOUND_HW) |