src/mess/includes/newbrain.h
| r11027 | r11028 | |
| 1 | #pragma once |
| 2 | |
| 1 | 3 | #ifndef __NEWBRAIN__ |
| 2 | 4 | #define __NEWBRAIN__ |
| 3 | 5 | |
| 6 | #define ADDRESS_MAP_MODERN |
| 7 | |
| 8 | #include "emu.h" |
| 9 | #include "cpu/z80/z80.h" |
| 10 | #include "cpu/z80/z80daisy.h" |
| 11 | #include "cpu/cop400/cop400.h" |
| 12 | #include "machine/upd765.h" |
| 13 | #include "machine/6850acia.h" |
| 14 | #include "machine/adc080x.h" |
| 15 | #include "machine/z80ctc.h" |
| 16 | #include "machine/z80sio.h" |
| 17 | #include "imagedev/flopdrv.h" |
| 18 | #include "formats/basicdsk.h" |
| 19 | #include "imagedev/cassette.h" |
| 20 | #include "machine/rescap.h" |
| 21 | #include "machine/ram.h" |
| 22 | |
| 4 | 23 | #define SCREEN_TAG "screen" |
| 5 | 24 | #define Z80_TAG "409" |
| 6 | 25 | #define COP420_TAG "419" |
| r11027 | r11028 | |
| 42 | 61 | { |
| 43 | 62 | public: |
| 44 | 63 | newbrain_state(running_machine &machine, const driver_device_config_base &config) |
| 45 | | : driver_device(machine, config) { } |
| 64 | : driver_device(machine, config), |
| 65 | m_maincpu(*this, Z80_TAG), |
| 66 | m_copcpu(*this, COP420_TAG), |
| 67 | m_cassette1(*this, CASSETTE1_TAG), |
| 68 | m_cassette2(*this, CASSETTE2_TAG) |
| 69 | { } |
| 46 | 70 | |
| 47 | | /* processor state */ |
| 48 | | int pwrup; /* power up */ |
| 49 | | int userint; /* user interrupt */ |
| 50 | | int userint0; /* parallel port interrupt */ |
| 51 | | int clkint; /* clock interrupt */ |
| 52 | | int aciaint; /* ACIA interrupt */ |
| 53 | | int copint; /* COP interrupt */ |
| 54 | | int anint; /* A/DC interrupt */ |
| 55 | | int bee; /* identity */ |
| 56 | | UINT8 enrg1; /* enable register 1 */ |
| 57 | | UINT8 enrg2; /* enable register 2 */ |
| 58 | | int acia_rxd; /* ACIA receive */ |
| 59 | | int acia_txd; /* ACIA transmit */ |
| 71 | required_device<cpu_device> m_maincpu; |
| 72 | required_device<cpu_device> m_copcpu; |
| 73 | required_device<device_t> m_cassette1; |
| 74 | required_device<device_t> m_cassette2; |
| 60 | 75 | |
| 61 | | /* COP420 state */ |
| 62 | | UINT8 cop_bus; /* data bus */ |
| 63 | | int cop_so; /* serial out */ |
| 64 | | int cop_tdo; /* tape data output */ |
| 65 | | int cop_tdi; /* tape data input */ |
| 66 | | int cop_rd; /* memory read */ |
| 67 | | int cop_wr; /* memory write */ |
| 68 | | int cop_access; /* COP access */ |
| 76 | virtual void machine_start(); |
| 77 | virtual void machine_reset(); |
| 69 | 78 | |
| 70 | | /* keyboard state */ |
| 71 | | int keylatch; /* keyboard row */ |
| 72 | | int keydata; /* keyboard column */ |
| 79 | virtual void video_start(); |
| 80 | virtual bool screen_update(screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect); |
| 81 | |
| 82 | DECLARE_WRITE8_MEMBER( enrg1_w ); |
| 83 | DECLARE_WRITE8_MEMBER( a_enrg1_w ); |
| 84 | DECLARE_READ8_MEMBER( ust_r ); |
| 85 | DECLARE_READ8_MEMBER( a_ust_r ); |
| 86 | DECLARE_READ8_MEMBER( user_r ); |
| 87 | DECLARE_WRITE8_MEMBER( user_w ); |
| 88 | DECLARE_READ8_MEMBER( clclk_r ); |
| 89 | DECLARE_WRITE8_MEMBER( clclk_w ); |
| 90 | DECLARE_READ8_MEMBER( clusr_r ); |
| 91 | DECLARE_WRITE8_MEMBER( clusr_w ); |
| 92 | DECLARE_READ8_MEMBER( cop_l_r ); |
| 93 | DECLARE_WRITE8_MEMBER( cop_l_w ); |
| 94 | DECLARE_WRITE8_MEMBER( cop_g_w ); |
| 95 | DECLARE_READ8_MEMBER( cop_g_r ); |
| 96 | DECLARE_WRITE8_MEMBER( cop_d_w ); |
| 97 | DECLARE_READ8_MEMBER( cop_in_r ); |
| 98 | DECLARE_WRITE8_MEMBER( cop_sk_w ); |
| 99 | DECLARE_READ8_MEMBER( cop_si_r ); |
| 100 | DECLARE_WRITE8_MEMBER( cop_so_w ); |
| 101 | DECLARE_READ8_MEMBER( tvl_r ); |
| 102 | DECLARE_WRITE8_MEMBER( tvl_w ); |
| 103 | DECLARE_WRITE8_MEMBER( tvctl_w ); |
| 104 | DECLARE_READ8_MEMBER( cop_r ); |
| 105 | DECLARE_WRITE8_MEMBER( cop_w ); |
| 106 | |
| 107 | void check_interrupt(); |
| 108 | void bankswitch(); |
| 109 | void tvram_w(UINT8 data, int a6); |
| 110 | inline int get_reset_t(); |
| 111 | inline int get_pwrup_t(); |
| 112 | void screen_update(bitmap_t *bitmap, const rectangle *cliprect); |
| 113 | |
| 114 | // processor state |
| 115 | int m_pwrup; // power up |
| 116 | int m_userint; // user interrupt |
| 117 | int m_userint0; // parallel port interrupt |
| 118 | int m_clkint; // clock interrupt |
| 119 | int m_aciaint; // ACIA interrupt |
| 120 | int m_copint; // COP interrupt |
| 121 | int m_anint; // A/DC interrupt |
| 122 | int m_bee; // identity |
| 123 | UINT8 m_enrg1; // enable register 1 |
| 124 | UINT8 m_enrg2; // enable register 2 |
| 125 | int m_acia_rxd; // ACIA receive |
| 126 | int m_acia_txd; // ACIA transmit |
| 73 | 127 | |
| 74 | | /* paging state */ |
| 75 | | int paging; /* paging enabled */ |
| 76 | | int mpm; /* multi paging mode ? */ |
| 77 | | int a16; /* address line 16 */ |
| 78 | | UINT8 pr[16]; /* expansion interface paging register */ |
| 79 | | UINT8 *eim_ram; /* expansion interface RAM */ |
| 128 | // COP420 state |
| 129 | UINT8 m_cop_bus; // data bus |
| 130 | int m_cop_so; // serial out |
| 131 | int m_cop_tdo; // tape data output |
| 132 | int m_cop_tdi; // tape data input |
| 133 | int m_cop_rd; // memory read |
| 134 | int m_cop_wr; // memory write |
| 135 | int m_cop_access; // COP access |
| 80 | 136 | |
| 81 | | /* floppy state */ |
| 82 | | int fdc_int; /* interrupt */ |
| 83 | | int fdc_att; /* attention */ |
| 137 | // keyboard state |
| 138 | int m_keylatch; // keyboard row |
| 139 | int m_keydata; // keyboard column |
| 84 | 140 | |
| 85 | | /* video state */ |
| 86 | | int segment_data[16]; /* VF segment data */ |
| 87 | | int tvcnsl; /* TV console required */ |
| 88 | | int tvctl; /* TV control register */ |
| 89 | | UINT16 tvram; /* TV start address */ |
| 90 | | UINT8 *char_rom; /* character ROM */ |
| 141 | // video state |
| 142 | int m_segment_data[16]; // VF segment data |
| 143 | int m_tvcnsl; // TV console required |
| 144 | int m_tvctl; // TV control register |
| 145 | UINT16 m_tvram; // TV start address |
| 146 | UINT8 *m_char_rom; // character ROM |
| 91 | 147 | |
| 92 | | /* user bus state */ |
| 93 | | UINT8 user; |
| 148 | // user bus state |
| 149 | UINT8 m_user; |
| 94 | 150 | |
| 95 | | /* timers */ |
| 96 | | emu_timer *reset_timer; /* power on reset timer */ |
| 97 | | emu_timer *pwrup_timer; /* power up timer */ |
| 151 | // timers |
| 152 | emu_timer *m_reset_timer; // power on reset timer |
| 153 | emu_timer *m_pwrup_timer; // power up timer |
| 98 | 154 | |
| 99 | | /* devices */ |
| 100 | | device_t *mc6850; |
| 101 | | device_t *z80ctc; |
| 102 | | device_t *upd765; |
| 103 | | device_t *cassette1; |
| 104 | | device_t *cassette2; |
| 105 | | UINT8 copdata; |
| 106 | | int copstate; |
| 107 | | int copbytes; |
| 108 | | int copregint; |
| 155 | // devices |
| 156 | UINT8 m_copdata; |
| 157 | int m_copstate; |
| 158 | int m_copbytes; |
| 159 | int m_copregint; |
| 109 | 160 | }; |
| 110 | 161 | |
| 111 | | /* ---------- defined in video/newbrain.c ---------- */ |
| 162 | class newbrain_eim_state : public newbrain_state |
| 163 | { |
| 164 | public: |
| 165 | newbrain_eim_state(running_machine &machine, const driver_device_config_base &config) |
| 166 | : newbrain_state(machine, config), |
| 167 | m_fdccpu(*this, FDC_Z80_TAG), |
| 168 | m_ctc(*this, Z80CTC_TAG), |
| 169 | m_acia(*this, MC6850_TAG), |
| 170 | m_fdc(*this, UPD765_TAG), |
| 171 | m_floppy(*this, FLOPPY_0) |
| 172 | { } |
| 112 | 173 | |
| 174 | required_device<cpu_device> m_fdccpu; |
| 175 | required_device<device_t> m_ctc; |
| 176 | required_device<device_t> m_acia; |
| 177 | required_device<device_t> m_fdc; |
| 178 | required_device<device_t> m_floppy; |
| 179 | |
| 180 | virtual void machine_start(); |
| 181 | |
| 182 | DECLARE_WRITE8_MEMBER( fdc_auxiliary_w ); |
| 183 | DECLARE_READ8_MEMBER( fdc_control_r ); |
| 184 | DECLARE_READ8_MEMBER( ust2_r ); |
| 185 | DECLARE_WRITE8_MEMBER( enrg2_w ); |
| 186 | DECLARE_WRITE8_MEMBER( pr_w ); |
| 187 | DECLARE_READ8_MEMBER( user_r ); |
| 188 | DECLARE_WRITE8_MEMBER( user_w ); |
| 189 | DECLARE_READ8_MEMBER( anout_r ); |
| 190 | DECLARE_WRITE8_MEMBER( anout_w ); |
| 191 | DECLARE_READ8_MEMBER( anin_r ); |
| 192 | DECLARE_WRITE8_MEMBER( anio_w ); |
| 193 | DECLARE_READ8_MEMBER( st0_r ); |
| 194 | DECLARE_READ8_MEMBER( st1_r ); |
| 195 | DECLARE_READ8_MEMBER( st2_r ); |
| 196 | DECLARE_READ8_MEMBER( usbs_r ); |
| 197 | DECLARE_WRITE8_MEMBER( usbs_w ); |
| 198 | DECLARE_WRITE8_MEMBER( paging_w ); |
| 199 | DECLARE_READ_LINE_MEMBER( acia_rx ); |
| 200 | DECLARE_WRITE_LINE_MEMBER( acia_tx ); |
| 201 | DECLARE_WRITE_LINE_MEMBER( acia_interrupt ); |
| 202 | DECLARE_WRITE_LINE_MEMBER( fdc_interrupt ); |
| 203 | DECLARE_WRITE_LINE_MEMBER( ctc_z0_w ); |
| 204 | DECLARE_WRITE_LINE_MEMBER( ctc_z1_w ); |
| 205 | DECLARE_WRITE_LINE_MEMBER( ctc_z2_w ); |
| 206 | |
| 207 | void bankswitch(); |
| 208 | |
| 209 | // paging state |
| 210 | int m_paging; // paging enabled |
| 211 | int m_mpm; // multi paging mode ? |
| 212 | int m_a16; // address line 16 |
| 213 | UINT8 m_pr[16]; // expansion interface paging register |
| 214 | UINT8 *m_eim_ram; // expansion interface RAM |
| 215 | |
| 216 | // floppy state |
| 217 | int m_fdc_int; // interrupt |
| 218 | int m_fdc_att; // attention |
| 219 | }; |
| 220 | |
| 221 | // ---------- defined in video/newbrain.c ---------- |
| 222 | |
| 113 | 223 | MACHINE_CONFIG_EXTERN( newbrain_video ); |
| 114 | 224 | |
| 115 | 225 | #endif |
src/mess/drivers/newbrain.c
| r11027 | r11028 | |
| 1 | | #include "emu.h" |
| 2 | | #include "cpu/z80/z80.h" |
| 3 | | #include "cpu/z80/z80daisy.h" |
| 4 | | #include "cpu/cop400/cop400.h" |
| 5 | | #include "machine/upd765.h" |
| 6 | | #include "machine/6850acia.h" |
| 7 | | #include "machine/adc080x.h" |
| 8 | | #include "machine/z80ctc.h" |
| 9 | | #include "machine/z80sio.h" |
| 10 | 1 | #include "includes/newbrain.h" |
| 11 | | #include "imagedev/flopdrv.h" |
| 12 | | #include "formats/basicdsk.h" |
| 13 | | #include "imagedev/cassette.h" |
| 14 | | #include "machine/rescap.h" |
| 15 | | #include "machine/ram.h" |
| 16 | | #include "newbrain.lh" |
| 17 | 2 | |
| 18 | 3 | /* |
| 19 | 4 | |
| r11027 | r11028 | |
| 60 | 45 | |
| 61 | 46 | */ |
| 62 | 47 | |
| 63 | | static void check_interrupt(running_machine &machine) |
| 48 | void newbrain_state::check_interrupt() |
| 64 | 49 | { |
| 65 | | newbrain_state *state = machine.driver_data<newbrain_state>(); |
| 50 | int level = (!m_clkint || !m_copint) ? ASSERT_LINE : CLEAR_LINE; |
| 66 | 51 | |
| 67 | | int level = (!state->clkint || !state->copint) ? ASSERT_LINE : CLEAR_LINE; |
| 68 | | |
| 69 | | cputag_set_input_line(machine, Z80_TAG, INPUT_LINE_IRQ0, level); |
| 52 | m_maincpu->set_input_line(INPUT_LINE_IRQ0, level); |
| 70 | 53 | } |
| 71 | 54 | |
| 72 | 55 | /* Bank Switching */ |
| r11027 | r11028 | |
| 81 | 64 | #define memory_install_ram_helper(program, bank, bank_start, bank_end) \ |
| 82 | 65 | program->install_readwrite_bank(bank_start, bank_end, bank); |
| 83 | 66 | |
| 84 | | static void newbrain_eim_bankswitch(running_machine &machine) |
| 67 | void newbrain_eim_state::bankswitch() |
| 85 | 68 | { |
| 86 | | newbrain_state *state = machine.driver_data<newbrain_state>(); |
| 87 | | |
| 88 | | address_space *program = machine.device(Z80_TAG)->memory().space(AS_PROGRAM); |
| 69 | address_space *program = m_maincpu->memory().space(AS_PROGRAM); |
| 89 | 70 | int bank; |
| 90 | 71 | |
| 91 | 72 | for (bank = 1; bank < 9; bank++) |
| 92 | 73 | { |
| 93 | | int page = (state->a16 << 3) | bank; |
| 94 | | UINT8 data = ~state->pr[page]; |
| 74 | int page = (m_a16 << 3) | bank; |
| 75 | UINT8 data = ~m_pr[page]; |
| 95 | 76 | int ch = (data >> 3) & 0x03; |
| 96 | 77 | int eim_bank = data & 0x07; |
| 97 | 78 | |
| r11027 | r11028 | |
| 105 | 86 | case 0: |
| 106 | 87 | /* ROM */ |
| 107 | 88 | memory_install_rom_helper(program, bank_name, bank_start, bank_end); |
| 108 | | memory_configure_bank(machine, bank_name, 0, 1, machine.region("eim")->base() + eim_bank_start, 0); |
| 89 | memory_configure_bank(m_machine, bank_name, 0, 1, m_machine.region("eim")->base() + eim_bank_start, 0); |
| 109 | 90 | break; |
| 110 | 91 | |
| 111 | 92 | case 2: |
| 112 | 93 | /* RAM */ |
| 113 | 94 | memory_install_ram_helper(program, bank_name, bank_start, bank_end); |
| 114 | | memory_configure_bank(machine, bank_name, 0, 1, state->eim_ram + eim_bank_start, 0); |
| 95 | memory_configure_bank(m_machine, bank_name, 0, 1, m_eim_ram + eim_bank_start, 0); |
| 115 | 96 | break; |
| 116 | 97 | |
| 117 | 98 | default: |
| r11027 | r11028 | |
| 121 | 102 | } |
| 122 | 103 | } |
| 123 | 104 | |
| 124 | | static void newbrain_a_bankswitch(running_machine &machine) |
| 105 | void newbrain_state::bankswitch() |
| 125 | 106 | { |
| 126 | | newbrain_state *state = machine.driver_data<newbrain_state>(); |
| 127 | | |
| 128 | | address_space *program = machine.device(Z80_TAG)->memory().space(AS_PROGRAM); |
| 107 | address_space *program = m_maincpu->memory().space(AS_PROGRAM); |
| 129 | 108 | int bank; |
| 130 | 109 | |
| 131 | | if (state->paging) |
| 132 | | { |
| 133 | | /* expansion interface module paging */ |
| 134 | | newbrain_eim_bankswitch(machine); |
| 135 | | return; |
| 136 | | } |
| 137 | | |
| 138 | 110 | for (bank = 1; bank < 9; bank++) |
| 139 | 111 | { |
| 140 | 112 | UINT16 bank_start = (bank - 1) * 0x2000; |
| r11027 | r11028 | |
| 142 | 114 | char bank_name[10]; |
| 143 | 115 | sprintf(bank_name,"bank%d",bank); |
| 144 | 116 | |
| 145 | | if (state->pwrup) |
| 117 | if (m_pwrup) |
| 146 | 118 | { |
| 147 | 119 | /* all banks point to ROM at 0xe000 */ |
| 148 | 120 | memory_install_rom_helper(program, bank_name, bank_start, bank_end); |
| 149 | | memory_configure_bank(machine, bank_name, 0, 1, machine.region(Z80_TAG)->base() + 0xe000, 0); |
| 121 | memory_configure_bank(m_machine, bank_name, 0, 1, m_machine.region(Z80_TAG)->base() + 0xe000, 0); |
| 150 | 122 | } |
| 151 | 123 | else |
| 152 | 124 | { |
| 153 | | memory_configure_bank(machine, bank_name, 0, 1, machine.region(Z80_TAG)->base() + bank_start, 0); |
| 125 | memory_configure_bank(m_machine, bank_name, 0, 1, m_machine.region(Z80_TAG)->base() + bank_start, 0); |
| 154 | 126 | |
| 155 | 127 | if (bank < 5) |
| 156 | 128 | { |
| r11027 | r11028 | |
| 160 | 132 | else if (bank == 5) |
| 161 | 133 | { |
| 162 | 134 | /* 0x8000-0x9fff */ |
| 163 | | if (machine.region("eim")->base()) |
| 135 | if (m_machine.region("eim")->base()) |
| 164 | 136 | { |
| 165 | 137 | /* expansion interface ROM */ |
| 166 | 138 | memory_install_rom_helper(program, bank_name, bank_start, bank_end); |
| 167 | | memory_configure_bank(machine, bank_name, 0, 1, machine.region("eim")->base() + 0x4000, 0); |
| 139 | memory_configure_bank(m_machine, bank_name, 0, 1, m_machine.region("eim")->base() + 0x4000, 0); |
| 168 | 140 | } |
| 169 | 141 | else |
| 170 | 142 | { |
| 171 | 143 | /* mirror of 0xa000-0xbfff */ |
| 172 | | if (machine.region(Z80_TAG)->base()[0xa001] == 0) |
| 144 | if (m_machine.region(Z80_TAG)->base()[0xa001] == 0) |
| 173 | 145 | { |
| 174 | 146 | /* unmapped on the M model */ |
| 175 | 147 | memory_install_unmapped(program, bank_name, bank_start, bank_end); |
| r11027 | r11028 | |
| 180 | 152 | memory_install_rom_helper(program, bank_name, bank_start, bank_end); |
| 181 | 153 | } |
| 182 | 154 | |
| 183 | | memory_configure_bank(machine, bank_name, 0, 1, machine.region(Z80_TAG)->base() + 0xa000, 0); |
| 155 | memory_configure_bank(m_machine, bank_name, 0, 1, m_machine.region(Z80_TAG)->base() + 0xa000, 0); |
| 184 | 156 | } |
| 185 | 157 | } |
| 186 | 158 | else if (bank == 6) |
| 187 | 159 | { |
| 188 | 160 | /* 0xa000-0xbfff */ |
| 189 | | if (machine.region(Z80_TAG)->base()[0xa001] == 0) |
| 161 | if (m_machine.region(Z80_TAG)->base()[0xa001] == 0) |
| 190 | 162 | { |
| 191 | 163 | /* unmapped on the M model */ |
| 192 | 164 | memory_install_unmapped(program, bank_name, bank_start, bank_end); |
| r11027 | r11028 | |
| 204 | 176 | } |
| 205 | 177 | } |
| 206 | 178 | |
| 207 | | memory_set_bank(machine, bank_name, 0); |
| 179 | memory_set_bank(m_machine, bank_name, 0); |
| 208 | 180 | } |
| 209 | 181 | } |
| 210 | 182 | |
| 211 | 183 | /* Enable/Status */ |
| 212 | 184 | |
| 213 | | static WRITE8_HANDLER( enrg1_w ) |
| 185 | WRITE8_MEMBER( newbrain_state::enrg1_w ) |
| 214 | 186 | { |
| 215 | 187 | /* |
| 216 | 188 | |
| r11027 | r11028 | |
| 227 | 199 | |
| 228 | 200 | */ |
| 229 | 201 | |
| 230 | | newbrain_state *state = space->machine().driver_data<newbrain_state>(); |
| 231 | | |
| 232 | | state->enrg1 = data; |
| 202 | m_enrg1 = data; |
| 233 | 203 | } |
| 234 | 204 | |
| 235 | | static WRITE8_HANDLER( a_enrg1_w ) |
| 205 | WRITE8_MEMBER( newbrain_state::a_enrg1_w ) |
| 236 | 206 | { |
| 237 | 207 | /* |
| 238 | 208 | |
| r11027 | r11028 | |
| 249 | 219 | |
| 250 | 220 | */ |
| 251 | 221 | |
| 252 | | newbrain_state *state = space->machine().driver_data<newbrain_state>(); |
| 253 | | |
| 254 | | state->enrg1 = data; |
| 222 | m_enrg1 = data; |
| 255 | 223 | } |
| 256 | 224 | |
| 257 | | #ifdef UNUSED_FUNCTION |
| 258 | | static READ8_HANDLER( ust_r ) |
| 225 | READ8_MEMBER( newbrain_state::ust_r ) |
| 259 | 226 | { |
| 260 | 227 | /* |
| 261 | 228 | |
| r11027 | r11028 | |
| 272 | 239 | |
| 273 | 240 | */ |
| 274 | 241 | |
| 275 | | newbrain_state *state = space->machine().driver_data<newbrain_state>(); |
| 242 | UINT8 data = (m_copint << 7) | (m_aciaint << 6) | (m_clkint << 5) | (m_userint << 4) | 0x04; |
| 276 | 243 | |
| 277 | | UINT8 data = (state->copint << 7) | (state->aciaint << 6) | (state->clkint << 5) | (state->userint << 4) | 0x04; |
| 278 | | |
| 279 | | switch ((state->enrg1 & NEWBRAIN_ENRG1_UST_BIT_0_MASK) >> 6) |
| 244 | switch ((m_enrg1 & NEWBRAIN_ENRG1_UST_BIT_0_MASK) >> 6) |
| 280 | 245 | { |
| 281 | 246 | case 0: |
| 282 | 247 | // excess, 1=24, 0=4 |
| 283 | | if (state->tvctl & NEWBRAIN_VIDEO_32_40) |
| 248 | if (m_tvctl & NEWBRAIN_VIDEO_32_40) |
| 284 | 249 | { |
| 285 | 250 | data |= 0x01; |
| 286 | 251 | } |
| r11027 | r11028 | |
| 288 | 253 | |
| 289 | 254 | case 1: |
| 290 | 255 | // characters per line, 1=40, 0=80 |
| 291 | | if (state->tvctl & NEWBRAIN_VIDEO_80L) |
| 256 | if (m_tvctl & NEWBRAIN_VIDEO_80L) |
| 292 | 257 | { |
| 293 | 258 | data |= 0x01; |
| 294 | 259 | } |
| r11027 | r11028 | |
| 303 | 268 | break; |
| 304 | 269 | } |
| 305 | 270 | |
| 306 | | switch ((state->enrg1 & NEWBRAIN_ENRG1_UST_BIT_1_MASK) >> 4) |
| 271 | switch ((m_enrg1 & NEWBRAIN_ENRG1_UST_BIT_1_MASK) >> 4) |
| 307 | 272 | { |
| 308 | 273 | case 0: |
| 309 | 274 | // PWRUP, if set indicates that power is supplied to Z80 and memory |
| 310 | | if (state->pwrup) |
| 275 | if (m_pwrup) |
| 311 | 276 | { |
| 312 | 277 | data |= 0x02; |
| 313 | 278 | } |
| r11027 | r11028 | |
| 315 | 280 | |
| 316 | 281 | case 1: |
| 317 | 282 | // TVCNSL, if set then processor has video device as primary console output |
| 318 | | if (state->tvcnsl) |
| 283 | if (m_tvcnsl) |
| 319 | 284 | { |
| 320 | 285 | data |= 0x02; |
| 321 | 286 | } |
| r11027 | r11028 | |
| 323 | 288 | |
| 324 | 289 | case 2: |
| 325 | 290 | // _BEE, if set then processor is Model A type |
| 326 | | if (state->bee) |
| 291 | if (m_bee) |
| 327 | 292 | { |
| 328 | 293 | data |= 0x02; |
| 329 | 294 | } |
| r11027 | r11028 | |
| 337 | 302 | |
| 338 | 303 | return data; |
| 339 | 304 | } |
| 340 | | #endif /* UNUSED_FUNCTION */ |
| 341 | 305 | |
| 342 | | static READ8_HANDLER( a_ust_r ) |
| 306 | READ8_MEMBER( newbrain_state::a_ust_r ) |
| 343 | 307 | { |
| 344 | 308 | /* |
| 345 | 309 | |
| r11027 | r11028 | |
| 356 | 320 | |
| 357 | 321 | */ |
| 358 | 322 | |
| 359 | | newbrain_state *state = space->machine().driver_data<newbrain_state>(); |
| 360 | | |
| 361 | | return (state->copint << 7) | (state->clkint << 5) | (state->pwrup << 1) | 0x01; |
| 323 | return (m_copint << 7) | (m_clkint << 5) | (m_pwrup << 1) | 0x01; |
| 362 | 324 | } |
| 363 | 325 | |
| 364 | | static READ8_HANDLER( user_r ) |
| 326 | READ8_MEMBER( newbrain_state::user_r ) |
| 365 | 327 | { |
| 366 | 328 | /* |
| 367 | 329 | |
| r11027 | r11028 | |
| 378 | 340 | |
| 379 | 341 | */ |
| 380 | 342 | |
| 381 | | newbrain_state *state = space->machine().driver_data<newbrain_state>(); |
| 343 | m_user = 0; |
| 382 | 344 | |
| 383 | | state->user = 0; |
| 384 | | |
| 385 | 345 | return 0xff; |
| 386 | 346 | } |
| 387 | 347 | |
| 388 | | static WRITE8_HANDLER( user_w ) |
| 348 | WRITE8_MEMBER( newbrain_state::user_w ) |
| 389 | 349 | { |
| 390 | | newbrain_state *state = space->machine().driver_data<newbrain_state>(); |
| 391 | | |
| 392 | | state->user = data; |
| 350 | m_user = data; |
| 393 | 351 | } |
| 394 | 352 | |
| 395 | 353 | /* Interrupts */ |
| 396 | 354 | |
| 397 | | static READ8_HANDLER( clclk_r ) |
| 355 | READ8_MEMBER( newbrain_state::clclk_r ) |
| 398 | 356 | { |
| 399 | | newbrain_state *state = space->machine().driver_data<newbrain_state>(); |
| 357 | m_clkint = 1; |
| 358 | check_interrupt(); |
| 400 | 359 | |
| 401 | | state->clkint = 1; |
| 402 | | check_interrupt(space->machine()); |
| 403 | | |
| 404 | 360 | return 0xff; |
| 405 | 361 | } |
| 406 | 362 | |
| 407 | | static WRITE8_HANDLER( clclk_w ) |
| 363 | WRITE8_MEMBER( newbrain_state::clclk_w ) |
| 408 | 364 | { |
| 409 | | newbrain_state *state = space->machine().driver_data<newbrain_state>(); |
| 410 | | |
| 411 | | state->clkint = 1; |
| 412 | | check_interrupt(space->machine()); |
| 365 | m_clkint = 1; |
| 366 | check_interrupt(); |
| 413 | 367 | } |
| 414 | 368 | |
| 415 | | static READ8_HANDLER( clusr_r ) |
| 369 | READ8_MEMBER( newbrain_state::clusr_r ) |
| 416 | 370 | { |
| 417 | | newbrain_state *state = space->machine().driver_data<newbrain_state>(); |
| 371 | m_userint = 1; |
| 418 | 372 | |
| 419 | | state->userint = 1; |
| 420 | | |
| 421 | 373 | return 0xff; |
| 422 | 374 | } |
| 423 | 375 | |
| 424 | | static WRITE8_HANDLER( clusr_w ) |
| 376 | WRITE8_MEMBER( newbrain_state::clusr_w ) |
| 425 | 377 | { |
| 426 | | newbrain_state *state = space->machine().driver_data<newbrain_state>(); |
| 427 | | |
| 428 | | state->userint = 1; |
| 378 | m_userint = 1; |
| 429 | 379 | } |
| 430 | 380 | |
| 431 | 381 | /* COP420 */ |
| 432 | 382 | |
| 433 | | static READ8_HANDLER( newbrain_cop_l_r ) |
| 383 | READ8_MEMBER( newbrain_state::cop_l_r ) |
| 434 | 384 | { |
| 435 | 385 | // connected to the Z80 data bus |
| 436 | | |
| 437 | | newbrain_state *state = space->machine().driver_data<newbrain_state>(); |
| 438 | | |
| 439 | | return state->cop_bus; |
| 386 | return m_cop_bus; |
| 440 | 387 | } |
| 441 | 388 | |
| 442 | | static WRITE8_HANDLER( newbrain_cop_l_w ) |
| 389 | WRITE8_MEMBER( newbrain_state::cop_l_w ) |
| 443 | 390 | { |
| 444 | 391 | // connected to the Z80 data bus |
| 445 | | |
| 446 | | newbrain_state *state = space->machine().driver_data<newbrain_state>(); |
| 447 | | |
| 448 | | state->cop_bus = data; |
| 392 | m_cop_bus = data; |
| 449 | 393 | } |
| 450 | 394 | |
| 451 | | static WRITE8_HANDLER( newbrain_cop_g_w ) |
| 395 | WRITE8_MEMBER( newbrain_state::cop_g_w ) |
| 452 | 396 | { |
| 453 | 397 | /* |
| 454 | 398 | |
| r11027 | r11028 | |
| 461 | 405 | |
| 462 | 406 | */ |
| 463 | 407 | |
| 464 | | newbrain_state *state = space->machine().driver_data<newbrain_state>(); |
| 408 | m_copint = BIT(data, 0); |
| 409 | check_interrupt(); |
| 465 | 410 | |
| 466 | | state->copint = BIT(data, 0); |
| 467 | | check_interrupt(space->machine()); |
| 468 | | |
| 469 | 411 | /* tape motor enable */ |
| 470 | 412 | |
| 471 | | cassette_change_state(state->cassette1, BIT(data, 1) ? CASSETTE_MOTOR_DISABLED : CASSETTE_MOTOR_ENABLED, CASSETTE_MASK_MOTOR); |
| 472 | | cassette_change_state(state->cassette2, BIT(data, 3) ? CASSETTE_MOTOR_DISABLED : CASSETTE_MOTOR_ENABLED, CASSETTE_MASK_MOTOR); |
| 413 | cassette_change_state(m_cassette1, BIT(data, 1) ? CASSETTE_MOTOR_DISABLED : CASSETTE_MOTOR_ENABLED, CASSETTE_MASK_MOTOR); |
| 414 | cassette_change_state(m_cassette2, BIT(data, 3) ? CASSETTE_MOTOR_DISABLED : CASSETTE_MOTOR_ENABLED, CASSETTE_MASK_MOTOR); |
| 473 | 415 | } |
| 474 | 416 | |
| 475 | | static READ8_HANDLER( newbrain_cop_g_r ) |
| 417 | READ8_MEMBER( newbrain_state::cop_g_r ) |
| 476 | 418 | { |
| 477 | 419 | /* |
| 478 | 420 | |
| r11027 | r11028 | |
| 485 | 427 | |
| 486 | 428 | */ |
| 487 | 429 | |
| 488 | | newbrain_state *state = space->machine().driver_data<newbrain_state>(); |
| 489 | | |
| 490 | | return (BIT(state->keydata, 3) << 3) | (BIT(state->keydata, 0) << 2) | (BIT(state->keydata, 1) << 1); |
| 430 | return (BIT(m_keydata, 3) << 3) | (BIT(m_keydata, 0) << 2) | (BIT(m_keydata, 1) << 1); |
| 491 | 431 | } |
| 492 | 432 | |
| 493 | | static WRITE8_HANDLER( newbrain_cop_d_w ) |
| 433 | WRITE8_MEMBER( newbrain_state::cop_d_w ) |
| 494 | 434 | { |
| 495 | 435 | /* |
| 496 | | |
| 497 | 436 | bit description |
| 498 | 437 | |
| 499 | 438 | D0 inverted to K4 -> CD4024 pin 2 (reset) |
| r11027 | r11028 | |
| 503 | 442 | |
| 504 | 443 | */ |
| 505 | 444 | |
| 506 | | newbrain_state *state = space->machine().driver_data<newbrain_state>(); |
| 507 | | |
| 508 | 445 | static const char *const keynames[] = { |
| 509 | 446 | "D0", "D1", "D2", "D3", "D4", "D5", "D6", "D7", |
| 510 | 447 | "D8", "D9", "D10", "D11", "D12", "D13", "D14", "D15" |
| r11027 | r11028 | |
| 514 | 451 | |
| 515 | 452 | if (!BIT(data, 0)) |
| 516 | 453 | { |
| 517 | | state->keylatch = 0; |
| 454 | m_keylatch = 0; |
| 518 | 455 | } |
| 519 | 456 | |
| 520 | 457 | /* tape data output */ |
| 521 | 458 | |
| 522 | | state->cop_tdo = BIT(data, 1); |
| 459 | m_cop_tdo = BIT(data, 1); |
| 523 | 460 | |
| 524 | | cassette_output(state->cassette1, state->cop_tdo ? -1.0 : +1.0); |
| 525 | | cassette_output(state->cassette2, state->cop_tdo ? -1.0 : +1.0); |
| 461 | cassette_output(m_cassette1, m_cop_tdo ? -1.0 : +1.0); |
| 462 | cassette_output(m_cassette2, m_cop_tdo ? -1.0 : +1.0); |
| 526 | 463 | |
| 527 | 464 | /* keyboard and display clock */ |
| 528 | 465 | |
| 529 | 466 | if (!BIT(data, 2)) |
| 530 | 467 | { |
| 531 | | state->keylatch++; |
| 468 | m_keylatch++; |
| 532 | 469 | |
| 533 | | if (state->keylatch == 16) |
| 470 | if (m_keylatch == 16) |
| 534 | 471 | { |
| 535 | | state->keylatch = 0; |
| 472 | m_keylatch = 0; |
| 536 | 473 | } |
| 537 | 474 | |
| 538 | | state->keydata = input_port_read(space->machine(), keynames[state->keylatch]); |
| 475 | m_keydata = input_port_read(m_machine, keynames[m_keylatch]); |
| 539 | 476 | |
| 540 | | output_set_digit_value(state->keylatch, state->segment_data[state->keylatch]); |
| 477 | output_set_digit_value(m_keylatch, m_segment_data[m_keylatch]); |
| 541 | 478 | } |
| 542 | 479 | } |
| 543 | 480 | |
| 544 | | static READ8_HANDLER( newbrain_cop_in_r ) |
| 481 | READ8_MEMBER( newbrain_state::cop_in_r ) |
| 545 | 482 | { |
| 546 | 483 | /* |
| 547 | 484 | |
| r11027 | r11028 | |
| 554 | 491 | |
| 555 | 492 | */ |
| 556 | 493 | |
| 557 | | newbrain_state *state = space->machine().driver_data<newbrain_state>(); |
| 558 | | |
| 559 | | return (state->cop_wr << 3) | (state->cop_access << 2) | (state->cop_rd << 1) | BIT(state->keydata, 2); |
| 494 | return (m_cop_wr << 3) | (m_cop_access << 2) | (m_cop_rd << 1) | BIT(m_keydata, 2); |
| 560 | 495 | } |
| 561 | 496 | |
| 562 | | static WRITE8_HANDLER( newbrain_cop_so_w ) |
| 497 | WRITE8_MEMBER( newbrain_state::cop_so_w ) |
| 563 | 498 | { |
| 564 | 499 | // connected to K1 |
| 565 | | |
| 566 | | newbrain_state *state = space->machine().driver_data<newbrain_state>(); |
| 567 | | |
| 568 | | state->cop_so = data; |
| 500 | m_cop_so = data; |
| 569 | 501 | } |
| 570 | 502 | |
| 571 | | static WRITE8_HANDLER( newbrain_cop_sk_w ) |
| 503 | WRITE8_MEMBER( newbrain_state::cop_sk_w ) |
| 572 | 504 | { |
| 573 | 505 | // connected to K2 |
| 574 | | |
| 575 | | newbrain_state *state = space->machine().driver_data<newbrain_state>(); |
| 576 | | |
| 577 | | state->segment_data[state->keylatch] >>= 1; |
| 578 | | state->segment_data[state->keylatch] = (state->cop_so << 15) | (state->segment_data[state->keylatch] & 0x7fff); |
| 506 | m_segment_data[m_keylatch] >>= 1; |
| 507 | m_segment_data[m_keylatch] = (m_cop_so << 15) | (m_segment_data[m_keylatch] & 0x7fff); |
| 579 | 508 | } |
| 580 | 509 | |
| 581 | | static READ8_HANDLER( newbrain_cop_si_r ) |
| 510 | READ8_MEMBER( newbrain_state::cop_si_r ) |
| 582 | 511 | { |
| 583 | 512 | // connected to TDI |
| 513 | m_cop_tdi = ((cassette_input(m_cassette1) > +1.0) || (cassette_input(m_cassette2) > +1.0)) ^ m_cop_tdo; |
| 584 | 514 | |
| 585 | | newbrain_state *state = space->machine().driver_data<newbrain_state>(); |
| 586 | | |
| 587 | | state->cop_tdi = ((cassette_input(state->cassette1) > +1.0) || (cassette_input(state->cassette2) > +1.0)) ^ state->cop_tdo; |
| 588 | | |
| 589 | | return state->cop_tdi; |
| 515 | return m_cop_tdi; |
| 590 | 516 | } |
| 591 | 517 | |
| 592 | 518 | /* Video */ |
| 593 | 519 | |
| 594 | | static void newbrain_tvram_w(running_machine &machine, UINT8 data, int a6) |
| 520 | void newbrain_state::tvram_w(UINT8 data, int a6) |
| 595 | 521 | { |
| 596 | | newbrain_state *state = machine.driver_data<newbrain_state>(); |
| 597 | | |
| 598 | 522 | /* latch video address counter bits A5-A0 */ |
| 599 | | state->tvram = (state->tvctl & NEWBRAIN_VIDEO_80L) ? 0x04 : 0x02; |
| 523 | m_tvram = (m_tvctl & NEWBRAIN_VIDEO_80L) ? 0x04 : 0x02; |
| 600 | 524 | |
| 601 | 525 | /* latch video address counter bit A6 */ |
| 602 | | state->tvram |= a6 << 6; |
| 526 | m_tvram |= a6 << 6; |
| 603 | 527 | |
| 604 | 528 | /* latch data to video address counter bits A14-A7 */ |
| 605 | | state->tvram = (data << 7); |
| 529 | m_tvram = (data << 7); |
| 606 | 530 | } |
| 607 | 531 | |
| 608 | | static READ8_HANDLER( tvl_r ) |
| 532 | READ8_MEMBER( newbrain_state::tvl_r ) |
| 609 | 533 | { |
| 610 | 534 | UINT8 data = 0xff; |
| 611 | 535 | |
| 612 | | newbrain_tvram_w(space->machine(), data, !offset); |
| 536 | tvram_w(data, !offset); |
| 613 | 537 | |
| 614 | 538 | return data; |
| 615 | 539 | } |
| 616 | 540 | |
| 617 | | static WRITE8_HANDLER( tvl_w ) |
| 541 | WRITE8_MEMBER( newbrain_state::tvl_w ) |
| 618 | 542 | { |
| 619 | | newbrain_tvram_w(space->machine(), data, !offset); |
| 543 | tvram_w(data, !offset); |
| 620 | 544 | } |
| 621 | 545 | |
| 622 | | static WRITE8_HANDLER( tvctl_w ) |
| 546 | WRITE8_MEMBER( newbrain_state::tvctl_w ) |
| 623 | 547 | { |
| 624 | 548 | /* |
| 625 | 549 | |
| r11027 | r11028 | |
| 636 | 560 | |
| 637 | 561 | */ |
| 638 | 562 | |
| 639 | | newbrain_state *state = space->machine().driver_data<newbrain_state>(); |
| 640 | | |
| 641 | | state->tvctl = data; |
| 563 | m_tvctl = data; |
| 642 | 564 | } |
| 643 | 565 | |
| 644 | 566 | /* Disc Controller */ |
| 645 | 567 | |
| 646 | | static WRITE8_HANDLER( fdc_auxiliary_w ) |
| 568 | WRITE8_MEMBER( newbrain_eim_state::fdc_auxiliary_w ) |
| 647 | 569 | { |
| 648 | 570 | /* |
| 649 | 571 | |
| r11027 | r11028 | |
| 660 | 582 | |
| 661 | 583 | */ |
| 662 | 584 | |
| 663 | | newbrain_state *state = space->machine().driver_data<newbrain_state>(); |
| 585 | floppy_mon_w(m_floppy, !BIT(data, 0)); |
| 586 | floppy_drive_set_ready_state(m_floppy, 1, 0); |
| 664 | 587 | |
| 665 | | floppy_mon_w(floppy_get_device(space->machine(), 0), !BIT(data, 0)); |
| 666 | | floppy_drive_set_ready_state(floppy_get_device(space->machine(), 0), 1, 0); |
| 588 | upd765_reset_w(m_fdc, BIT(data, 1)); |
| 667 | 589 | |
| 668 | | upd765_reset_w(state->upd765, BIT(data, 1)); |
| 669 | | |
| 670 | | upd765_tc_w(state->upd765, BIT(data, 2)); |
| 590 | upd765_tc_w(m_fdc, BIT(data, 2)); |
| 671 | 591 | } |
| 672 | 592 | |
| 673 | | static READ8_HANDLER( fdc_control_r ) |
| 593 | READ8_MEMBER( newbrain_eim_state::fdc_control_r ) |
| 674 | 594 | { |
| 675 | 595 | /* |
| 676 | 596 | |
| r11027 | r11028 | |
| 687 | 607 | |
| 688 | 608 | */ |
| 689 | 609 | |
| 690 | | newbrain_state *state = space->machine().driver_data<newbrain_state>(); |
| 691 | | |
| 692 | | return (state->fdc_att << 7) | (state->paging << 6) | (state->fdc_int << 5); |
| 610 | return (m_fdc_att << 7) | (m_paging << 6) | (m_fdc_int << 5); |
| 693 | 611 | } |
| 694 | 612 | |
| 695 | | #ifdef UNUSED_FUNCTION |
| 696 | | static READ8_HANDLER( ust2_r ) |
| 613 | READ8_MEMBER( newbrain_eim_state::ust2_r ) |
| 697 | 614 | { |
| 698 | 615 | /* |
| 699 | 616 | |
| r11027 | r11028 | |
| 712 | 629 | |
| 713 | 630 | return 0; |
| 714 | 631 | } |
| 715 | | #endif /* UNUSED_FUNCTION */ |
| 716 | 632 | |
| 717 | 633 | #define NEWBRAIN_COPCMD_NULLCOM 0xd0 |
| 718 | 634 | #define NEWBRAIN_COPCMD_DISPCOM 0xa0 |
| r11027 | r11028 | |
| 743 | 659 | }; |
| 744 | 660 | |
| 745 | 661 | |
| 746 | | static READ8_HANDLER( cop_r ) |
| 662 | READ8_MEMBER( newbrain_state::cop_r ) |
| 747 | 663 | { |
| 748 | | newbrain_state *state = space->machine().driver_data<newbrain_state>(); |
| 664 | m_copint = 1; |
| 665 | check_interrupt(); |
| 749 | 666 | |
| 750 | | state->copint = 1; |
| 751 | | check_interrupt(space->machine()); |
| 752 | | |
| 753 | | return state->copdata; |
| 667 | return m_copdata; |
| 754 | 668 | } |
| 755 | 669 | |
| 756 | | static WRITE8_HANDLER( cop_w ) |
| 670 | WRITE8_MEMBER( newbrain_state::cop_w ) |
| 757 | 671 | { |
| 758 | | newbrain_state *state = space->machine().driver_data<newbrain_state>(); |
| 672 | m_copdata = data; |
| 759 | 673 | |
| 760 | | state->copdata = data; |
| 761 | | |
| 762 | | switch (state->copstate) |
| 674 | switch (m_copstate) |
| 763 | 675 | { |
| 764 | 676 | case NEWBRAIN_COP_STATE_COMMAND: |
| 765 | 677 | logerror("COP command %02x\n", data); |
| r11027 | r11028 | |
| 770 | 682 | break; |
| 771 | 683 | |
| 772 | 684 | case NEWBRAIN_COPCMD_DISPCOM: |
| 773 | | state->copregint = 0; |
| 774 | | state->copbytes = 18; |
| 775 | | state->copstate = NEWBRAIN_COP_STATE_DATA; |
| 685 | m_copregint = 0; |
| 686 | m_copbytes = 18; |
| 687 | m_copstate = NEWBRAIN_COP_STATE_DATA; |
| 776 | 688 | |
| 777 | | state->copdata = NEWBRAIN_COP_NO_DATA; |
| 778 | | state->copint = 0; |
| 779 | | check_interrupt(space->machine()); |
| 689 | m_copdata = NEWBRAIN_COP_NO_DATA; |
| 690 | m_copint = 0; |
| 691 | check_interrupt(); |
| 780 | 692 | |
| 781 | 693 | break; |
| 782 | 694 | |
| 783 | 695 | #if 0 |
| 784 | 696 | case NEWBRAIN_COPCMD_TIMCOM: |
| 785 | | state->copregint = 0; |
| 786 | | state->copbytes = 6; |
| 787 | | state->copstate = NEWBRAIN_COP_STATE_DATA; |
| 697 | m_copregint = 0; |
| 698 | m_copbytes = 6; |
| 699 | m_copstate = NEWBRAIN_COP_STATE_DATA; |
| 788 | 700 | break; |
| 789 | 701 | #endif |
| 790 | 702 | case NEWBRAIN_COPCMD_PDNCOM: |
| 791 | 703 | /* power down */ |
| 792 | | state->copregint = 0; |
| 704 | m_copregint = 0; |
| 793 | 705 | break; |
| 794 | 706 | |
| 795 | 707 | default: |
| 796 | 708 | if (data & NEWBRAIN_COPCMD_TAPECOM) |
| 797 | 709 | { |
| 798 | | state->copregint = 0; |
| 710 | m_copregint = 0; |
| 799 | 711 | } |
| 800 | 712 | } |
| 801 | 713 | break; |
| 802 | 714 | |
| 803 | 715 | case NEWBRAIN_COP_STATE_DATA: |
| 804 | 716 | logerror("COP data %02x\n", data); |
| 805 | | state->copbytes--; |
| 717 | m_copbytes--; |
| 806 | 718 | |
| 807 | | if (state->copbytes == 0) |
| 719 | if (m_copbytes == 0) |
| 808 | 720 | { |
| 809 | | state->copstate = NEWBRAIN_COP_STATE_COMMAND; |
| 810 | | state->copregint = 1; |
| 721 | m_copstate = NEWBRAIN_COP_STATE_COMMAND; |
| 722 | m_copregint = 1; |
| 811 | 723 | } |
| 812 | 724 | |
| 813 | | state->copdata = NEWBRAIN_COP_NO_DATA; |
| 814 | | state->copint = 0; |
| 815 | | check_interrupt(space->machine()); |
| 725 | m_copdata = NEWBRAIN_COP_NO_DATA; |
| 726 | m_copint = 0; |
| 727 | check_interrupt(); |
| 816 | 728 | |
| 817 | 729 | break; |
| 818 | 730 | } |
| r11027 | r11028 | |
| 822 | 734 | { |
| 823 | 735 | newbrain_state *state = timer.machine().driver_data<newbrain_state>(); |
| 824 | 736 | |
| 825 | | if (state->copregint) |
| 737 | if (state->m_copregint) |
| 826 | 738 | { |
| 827 | 739 | logerror("COP REGINT\n"); |
| 828 | | state->copint = 0; |
| 829 | | check_interrupt(timer.machine()); |
| 740 | state->m_copint = 0; |
| 741 | state->check_interrupt(); |
| 830 | 742 | } |
| 831 | 743 | } |
| 832 | 744 | |
| 833 | 745 | /* Expansion Interface Module */ |
| 834 | 746 | |
| 835 | | static WRITE8_HANDLER( ei_enrg2_w ) |
| 747 | WRITE8_MEMBER( newbrain_eim_state::enrg2_w ) |
| 836 | 748 | { |
| 837 | 749 | /* |
| 838 | 750 | |
| r11027 | r11028 | |
| 849 | 761 | |
| 850 | 762 | */ |
| 851 | 763 | |
| 852 | | newbrain_state *state = space->machine().driver_data<newbrain_state>(); |
| 853 | | |
| 854 | | state->enrg2 = data; |
| 764 | m_enrg2 = data; |
| 855 | 765 | } |
| 856 | 766 | |
| 857 | | static WRITE8_HANDLER( ei_pr_w ) |
| 767 | WRITE8_MEMBER( newbrain_eim_state::pr_w ) |
| 858 | 768 | { |
| 859 | 769 | /* |
| 860 | 770 | |
| r11027 | r11028 | |
| 874 | 784 | |
| 875 | 785 | */ |
| 876 | 786 | |
| 877 | | newbrain_state *state = space->machine().driver_data<newbrain_state>(); |
| 878 | | |
| 879 | 787 | int page = (BIT(offset, 12) >> 9) | (BIT(offset, 15) >> 13) | (BIT(offset, 14) >> 13) | (BIT(offset, 13) >> 13); |
| 880 | 788 | int bank = (BIT(offset, 11) >> 3) | (data & 0x7f); |
| 881 | 789 | |
| 882 | | state->pr[page] = bank; |
| 790 | m_pr[page] = bank; |
| 883 | 791 | |
| 884 | | newbrain_a_bankswitch(space->machine()); |
| 792 | bankswitch(); |
| 885 | 793 | } |
| 886 | 794 | |
| 887 | | static READ8_HANDLER( ei_user_r ) |
| 795 | READ8_MEMBER( newbrain_eim_state::user_r ) |
| 888 | 796 | { |
| 889 | | newbrain_state *state = space->machine().driver_data<newbrain_state>(); |
| 797 | m_user = 0xff; |
| 890 | 798 | |
| 891 | | state->user = 0xff; |
| 892 | | |
| 893 | 799 | return 0xff; |
| 894 | 800 | } |
| 895 | 801 | |
| 896 | | static WRITE8_HANDLER( ei_user_w ) |
| 802 | WRITE8_MEMBER( newbrain_eim_state::user_w ) |
| 897 | 803 | { |
| 898 | | newbrain_state *state = space->machine().driver_data<newbrain_state>(); |
| 899 | | |
| 900 | | state->user = data; |
| 804 | m_user = data; |
| 901 | 805 | } |
| 902 | 806 | |
| 903 | | static READ8_HANDLER( ei_anout_r ) |
| 807 | READ8_MEMBER( newbrain_eim_state::anout_r ) |
| 904 | 808 | { |
| 905 | 809 | return 0xff; |
| 906 | 810 | } |
| 907 | 811 | |
| 908 | | static WRITE8_HANDLER( ei_anout_w ) |
| 812 | WRITE8_MEMBER( newbrain_eim_state::anout_w ) |
| 909 | 813 | { |
| 910 | 814 | } |
| 911 | 815 | |
| 912 | | static READ8_HANDLER( ei_anin_r ) |
| 816 | READ8_MEMBER( newbrain_eim_state::anin_r ) |
| 913 | 817 | { |
| 914 | 818 | // int channel = offset & 0x03; |
| 915 | 819 | |
| 916 | 820 | return 0; |
| 917 | 821 | } |
| 918 | 822 | |
| 919 | | static WRITE8_HANDLER( ei_anio_w ) |
| 823 | WRITE8_MEMBER( newbrain_eim_state::anio_w ) |
| 920 | 824 | { |
| 921 | 825 | // int channel = offset & 0x03; |
| 922 | 826 | } |
| 923 | 827 | |
| 924 | | static READ8_HANDLER( ei_st0_r ) |
| 828 | READ8_MEMBER( newbrain_eim_state::st0_r ) |
| 925 | 829 | { |
| 926 | 830 | /* |
| 927 | 831 | |
| r11027 | r11028 | |
| 938 | 842 | |
| 939 | 843 | */ |
| 940 | 844 | |
| 941 | | newbrain_state *state = space->machine().driver_data<newbrain_state>(); |
| 942 | | |
| 943 | | return (state->copint << 7) | (state->aciaint << 6) | (state->clkint << 5) | (state->userint << 4) | (state->userint0 << 3) | (state->pwrup) << 1 | 0x01; |
| 845 | return (m_copint << 7) | (m_aciaint << 6) | (m_clkint << 5) | (m_userint << 4) | (m_userint0 << 3) | (m_pwrup) << 1 | 0x01; |
| 944 | 846 | } |
| 945 | 847 | |
| 946 | | static READ8_HANDLER( ei_st1_r ) |
| 848 | READ8_MEMBER( newbrain_eim_state::st1_r ) |
| 947 | 849 | { |
| 948 | 850 | /* |
| 949 | 851 | |
| r11027 | r11028 | |
| 960 | 862 | |
| 961 | 863 | */ |
| 962 | 864 | |
| 963 | | newbrain_state *state = space->machine().driver_data<newbrain_state>(); |
| 964 | | |
| 965 | | return (state->tvcnsl << 6) | 0x10 | 0x08 | 0x04; |
| 865 | return (m_tvcnsl << 6) | 0x10 | 0x08 | 0x04; |
| 966 | 866 | } |
| 967 | 867 | |
| 968 | | static READ8_HANDLER( ei_st2_r ) |
| 868 | READ8_MEMBER( newbrain_eim_state::st2_r ) |
| 969 | 869 | { |
| 970 | 870 | /* |
| 971 | 871 | |
| r11027 | r11028 | |
| 985 | 885 | return 0; |
| 986 | 886 | } |
| 987 | 887 | |
| 988 | | static READ8_HANDLER( ei_usbs_r ) |
| 888 | READ8_MEMBER( newbrain_eim_state::usbs_r ) |
| 989 | 889 | { |
| 990 | 890 | return 0xff; |
| 991 | 891 | } |
| 992 | 892 | |
| 993 | | static WRITE8_HANDLER( ei_usbs_w ) |
| 893 | WRITE8_MEMBER( newbrain_eim_state::usbs_w ) |
| 994 | 894 | { |
| 995 | 895 | } |
| 996 | 896 | |
| 997 | | static WRITE8_HANDLER( ei_paging_w ) |
| 897 | WRITE8_MEMBER( newbrain_eim_state::paging_w ) |
| 998 | 898 | { |
| 999 | | newbrain_state *state = space->machine().driver_data<newbrain_state>(); |
| 1000 | | |
| 1001 | 899 | if (BIT(offset, 8)) |
| 1002 | 900 | { |
| 1003 | 901 | // expansion interface module |
| r11027 | r11028 | |
| 1017 | 915 | |
| 1018 | 916 | */ |
| 1019 | 917 | |
| 1020 | | state->paging = BIT(data, 0); |
| 1021 | | state->a16 = BIT(data, 2); |
| 1022 | | state->mpm = BIT(data, 3); |
| 918 | m_paging = BIT(data, 0); |
| 919 | m_a16 = BIT(data, 2); |
| 920 | m_mpm = BIT(data, 3); |
| 1023 | 921 | } |
| 1024 | 922 | else if (BIT(offset, 9)) |
| 1025 | 923 | { |
| r11027 | r11028 | |
| 1040 | 938 | |
| 1041 | 939 | */ |
| 1042 | 940 | |
| 1043 | | cputag_set_input_line(space->machine(), FDC_Z80_TAG, INPUT_LINE_RESET, BIT(data, 5) ? HOLD_LINE : CLEAR_LINE); |
| 941 | m_fdccpu->set_input_line(INPUT_LINE_RESET, BIT(data, 5) ? HOLD_LINE : CLEAR_LINE); |
| 1044 | 942 | |
| 1045 | | state->paging = BIT(data, 0); |
| 1046 | | state->a16 = BIT(data, 2); |
| 1047 | | state->mpm = BIT(data, 3); |
| 1048 | | state->fdc_att = BIT(data, 7); |
| 943 | m_paging = BIT(data, 0); |
| 944 | m_a16 = BIT(data, 2); |
| 945 | m_mpm = BIT(data, 3); |
| 946 | m_fdc_att = BIT(data, 7); |
| 1049 | 947 | } |
| 1050 | 948 | else if (BIT(offset, 10)) |
| 1051 | 949 | { |
| r11027 | r11028 | |
| 1059 | 957 | { |
| 1060 | 958 | newbrain_state *state = device->machine().driver_data<newbrain_state>(); |
| 1061 | 959 | |
| 1062 | | state->anint = level; |
| 960 | state->m_anint = level; |
| 1063 | 961 | } |
| 1064 | 962 | |
| 1065 | 963 | static ADC080X_VREF_POSITIVE_READ( newbrain_adc_vref_pos_r ) |
| r11027 | r11028 | |
| 1087 | 985 | |
| 1088 | 986 | /* Memory Maps */ |
| 1089 | 987 | |
| 1090 | | static ADDRESS_MAP_START( newbrain_map, AS_PROGRAM, 8 ) |
| 988 | static ADDRESS_MAP_START( newbrain_map, AS_PROGRAM, 8, newbrain_state ) |
| 1091 | 989 | ADDRESS_MAP_UNMAP_HIGH |
| 1092 | 990 | AM_RANGE(0x0000, 0x1fff) AM_RAMBANK("bank1") |
| 1093 | 991 | AM_RANGE(0x2000, 0x3fff) AM_RAMBANK("bank2") |
| r11027 | r11028 | |
| 1099 | 997 | AM_RANGE(0xe000, 0xffff) AM_RAMBANK("bank8") |
| 1100 | 998 | ADDRESS_MAP_END |
| 1101 | 999 | |
| 1102 | | static ADDRESS_MAP_START( newbrain_ei_io_map, AS_IO, 8 ) |
| 1000 | static ADDRESS_MAP_START( newbrain_ei_io_map, AS_IO, 8, newbrain_eim_state ) |
| 1103 | 1001 | ADDRESS_MAP_UNMAP_HIGH |
| 1104 | | AM_RANGE(0x00, 0x00) AM_MIRROR(0xff00) AM_READWRITE(clusr_r, clusr_w) |
| 1105 | | AM_RANGE(0x01, 0x01) AM_MIRROR(0xff00) AM_WRITE(ei_enrg2_w) |
| 1106 | | AM_RANGE(0x02, 0x02) AM_MIRROR(0xff00) AM_MASK(0xff00) AM_WRITE(ei_pr_w) |
| 1107 | | AM_RANGE(0x03, 0x03) AM_MIRROR(0xff00) AM_READWRITE(ei_user_r, ei_user_w) |
| 1108 | | AM_RANGE(0x04, 0x04) AM_MIRROR(0xff00) AM_READWRITE(clclk_r, clclk_w) |
| 1109 | | AM_RANGE(0x05, 0x05) AM_MIRROR(0xff00) AM_READWRITE(ei_anout_r, ei_anout_w) |
| 1110 | | AM_RANGE(0x06, 0x06) AM_MIRROR(0xff00) AM_READWRITE(cop_r, cop_w) |
| 1111 | | AM_RANGE(0x07, 0x07) AM_MIRROR(0xff00) AM_WRITE(enrg1_w) |
| 1112 | | AM_RANGE(0x08, 0x09) AM_MIRROR(0xff02) AM_READWRITE(tvl_r, tvl_w) |
| 1113 | | AM_RANGE(0x0c, 0x0c) AM_MIRROR(0xff03) AM_WRITE(tvctl_w) |
| 1114 | | AM_RANGE(0x10, 0x13) AM_MIRROR(0xff00) AM_READWRITE(ei_anin_r, ei_anio_w) |
| 1115 | | AM_RANGE(0x14, 0x14) AM_MIRROR(0xff00) AM_READ(ei_st0_r) |
| 1116 | | AM_RANGE(0x15, 0x15) AM_MIRROR(0xff00) AM_READ(ei_st1_r) |
| 1117 | | AM_RANGE(0x16, 0x16) AM_MIRROR(0xff00) AM_READ(ei_st2_r) |
| 1118 | | AM_RANGE(0x17, 0x17) AM_MIRROR(0xff00) AM_READWRITE(ei_usbs_r, ei_usbs_w) |
| 1119 | | AM_RANGE(0x18, 0x18) AM_MIRROR(0xff00) AM_DEVREADWRITE(MC6850_TAG, acia6850_stat_r, acia6850_ctrl_w) |
| 1120 | | AM_RANGE(0x19, 0x19) AM_MIRROR(0xff00) AM_DEVREADWRITE(MC6850_TAG, acia6850_data_r, acia6850_data_w) |
| 1121 | | AM_RANGE(0x1c, 0x1f) AM_MIRROR(0xff00) AM_DEVREADWRITE(Z80CTC_TAG, z80ctc_r, z80ctc_w) |
| 1122 | | AM_RANGE(0xff, 0xff) AM_MIRROR(0xff00) AM_MASK(0xff00) AM_WRITE(ei_paging_w) |
| 1002 | AM_RANGE(0x00, 0x00) AM_MIRROR(0xff00) AM_READWRITE_BASE(newbrain_state, clusr_r, clusr_w) |
| 1003 | AM_RANGE(0x01, 0x01) AM_MIRROR(0xff00) AM_WRITE(enrg2_w) |
| 1004 | AM_RANGE(0x02, 0x02) AM_MIRROR(0xff00) AM_MASK(0xff00) AM_WRITE(pr_w) |
| 1005 | AM_RANGE(0x03, 0x03) AM_MIRROR(0xff00) AM_READWRITE(user_r, user_w) |
| 1006 | AM_RANGE(0x04, 0x04) AM_MIRROR(0xff00) AM_READWRITE_BASE(newbrain_state, clclk_r, clclk_w) |
| 1007 | AM_RANGE(0x05, 0x05) AM_MIRROR(0xff00) AM_READWRITE(anout_r, anout_w) |
| 1008 | AM_RANGE(0x06, 0x06) AM_MIRROR(0xff00) AM_READWRITE_BASE(newbrain_state, cop_r, cop_w) |
| 1009 | AM_RANGE(0x07, 0x07) AM_MIRROR(0xff00) AM_WRITE_BASE(newbrain_state, enrg1_w) |
| 1010 | AM_RANGE(0x08, 0x09) AM_MIRROR(0xff02) AM_READWRITE_BASE(newbrain_state, tvl_r, tvl_w) |
| 1011 | AM_RANGE(0x0c, 0x0c) AM_MIRROR(0xff03) AM_WRITE_BASE(newbrain_state, tvctl_w) |
| 1012 | AM_RANGE(0x10, 0x13) AM_MIRROR(0xff00) AM_READWRITE(anin_r, anio_w) |
| 1013 | AM_RANGE(0x14, 0x14) AM_MIRROR(0xff00) AM_READ(st0_r) |
| 1014 | AM_RANGE(0x15, 0x15) AM_MIRROR(0xff00) AM_READ(st1_r) |
| 1015 | AM_RANGE(0x16, 0x16) AM_MIRROR(0xff00) AM_READ(st2_r) |
| 1016 | AM_RANGE(0x17, 0x17) AM_MIRROR(0xff00) AM_READWRITE(usbs_r, usbs_w) |
| 1017 | AM_RANGE(0x18, 0x18) AM_MIRROR(0xff00) AM_DEVREADWRITE_LEGACY(MC6850_TAG, acia6850_stat_r, acia6850_ctrl_w) |
| 1018 | AM_RANGE(0x19, 0x19) AM_MIRROR(0xff00) AM_DEVREADWRITE_LEGACY(MC6850_TAG, acia6850_data_r, acia6850_data_w) |
| 1019 | AM_RANGE(0x1c, 0x1f) AM_MIRROR(0xff00) AM_DEVREADWRITE_LEGACY(Z80CTC_TAG, z80ctc_r, z80ctc_w) |
| 1020 | AM_RANGE(0xff, 0xff) AM_MIRROR(0xff00) AM_MASK(0xff00) AM_WRITE(paging_w) |
| 1123 | 1021 | ADDRESS_MAP_END |
| 1124 | 1022 | |
| 1125 | | static ADDRESS_MAP_START( newbrain_a_io_map, AS_IO, 8 ) |
| 1023 | static ADDRESS_MAP_START( newbrain_a_io_map, AS_IO, 8, newbrain_state ) |
| 1126 | 1024 | ADDRESS_MAP_UNMAP_HIGH |
| 1127 | 1025 | AM_RANGE(0x00, 0x00) AM_MIRROR(0xffc0) AM_READWRITE(clusr_r, clusr_w) |
| 1128 | 1026 | AM_RANGE(0x03, 0x03) AM_MIRROR(0xffc0) AM_WRITE(user_w) |
| r11027 | r11028 | |
| 1135 | 1033 | AM_RANGE(0x16, 0x16) AM_MIRROR(0xffc0) AM_READ(user_r) |
| 1136 | 1034 | ADDRESS_MAP_END |
| 1137 | 1035 | |
| 1138 | | static ADDRESS_MAP_START( newbrain_cop_io_map, AS_IO, 8 ) |
| 1139 | | AM_RANGE(COP400_PORT_L, COP400_PORT_L) AM_READWRITE(newbrain_cop_l_r, newbrain_cop_l_w) |
| 1140 | | AM_RANGE(COP400_PORT_G, COP400_PORT_G) AM_READWRITE(newbrain_cop_g_r, newbrain_cop_g_w) |
| 1141 | | AM_RANGE(COP400_PORT_D, COP400_PORT_D) AM_WRITE(newbrain_cop_d_w) |
| 1142 | | AM_RANGE(COP400_PORT_IN, COP400_PORT_IN) AM_READ(newbrain_cop_in_r) |
| 1143 | | AM_RANGE(COP400_PORT_SK, COP400_PORT_SK) AM_WRITE(newbrain_cop_sk_w) |
| 1144 | | AM_RANGE(COP400_PORT_SIO, COP400_PORT_SIO) AM_READWRITE(newbrain_cop_si_r, newbrain_cop_so_w) |
| 1036 | static ADDRESS_MAP_START( newbrain_cop_io_map, AS_IO, 8, newbrain_state ) |
| 1037 | AM_RANGE(COP400_PORT_L, COP400_PORT_L) AM_READWRITE(cop_l_r, cop_l_w) |
| 1038 | AM_RANGE(COP400_PORT_G, COP400_PORT_G) AM_READWRITE(cop_g_r, cop_g_w) |
| 1039 | AM_RANGE(COP400_PORT_D, COP400_PORT_D) AM_WRITE(cop_d_w) |
| 1040 | AM_RANGE(COP400_PORT_IN, COP400_PORT_IN) AM_READ(cop_in_r) |
| 1041 | AM_RANGE(COP400_PORT_SK, COP400_PORT_SK) AM_WRITE(cop_sk_w) |
| 1042 | AM_RANGE(COP400_PORT_SIO, COP400_PORT_SIO) AM_READWRITE(cop_si_r, cop_so_w) |
| 1145 | 1043 | AM_RANGE(COP400_PORT_CKO, COP400_PORT_CKO) AM_READNOP |
| 1146 | 1044 | ADDRESS_MAP_END |
| 1147 | 1045 | |
| 1148 | | static ADDRESS_MAP_START( newbrain_fdc_map, AS_PROGRAM, 8 ) |
| 1046 | static ADDRESS_MAP_START( newbrain_fdc_map, AS_PROGRAM, 8, newbrain_eim_state ) |
| 1149 | 1047 | ADDRESS_MAP_UNMAP_HIGH |
| 1150 | 1048 | AM_RANGE(0x0000, 0x1fff) AM_ROM |
| 1151 | 1049 | ADDRESS_MAP_END |
| 1152 | 1050 | |
| 1153 | | static ADDRESS_MAP_START( newbrain_fdc_io_map, AS_IO, 8 ) |
| 1051 | static ADDRESS_MAP_START( newbrain_fdc_io_map, AS_IO, 8, newbrain_eim_state ) |
| 1154 | 1052 | ADDRESS_MAP_UNMAP_HIGH |
| 1155 | 1053 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 1156 | | AM_RANGE(0x00, 0x00) AM_DEVREAD(UPD765_TAG, upd765_status_r) |
| 1157 | | AM_RANGE(0x01, 0x01) AM_DEVREADWRITE(UPD765_TAG, upd765_data_r, upd765_data_w) |
| 1054 | AM_RANGE(0x00, 0x00) AM_DEVREAD_LEGACY(UPD765_TAG, upd765_status_r) |
| 1055 | AM_RANGE(0x01, 0x01) AM_DEVREADWRITE_LEGACY(UPD765_TAG, upd765_data_r, upd765_data_w) |
| 1158 | 1056 | AM_RANGE(0x20, 0x20) AM_WRITE(fdc_auxiliary_w) |
| 1159 | 1057 | AM_RANGE(0x40, 0x40) AM_READ(fdc_control_r) |
| 1160 | 1058 | ADDRESS_MAP_END |
| r11027 | r11028 | |
| 1261 | 1159 | |
| 1262 | 1160 | /* Machine Initialization */ |
| 1263 | 1161 | |
| 1264 | | static READ_LINE_DEVICE_HANDLER( acia_rx ) |
| 1162 | READ_LINE_MEMBER( newbrain_eim_state::acia_rx ) |
| 1265 | 1163 | { |
| 1266 | | newbrain_state *driver_state = device->machine().driver_data<newbrain_state>(); |
| 1267 | | |
| 1268 | | return driver_state->acia_rxd; |
| 1164 | return m_acia_rxd; |
| 1269 | 1165 | } |
| 1270 | 1166 | |
| 1271 | | static WRITE_LINE_DEVICE_HANDLER( acia_tx ) |
| 1167 | WRITE_LINE_MEMBER( newbrain_eim_state::acia_tx ) |
| 1272 | 1168 | { |
| 1273 | | newbrain_state *driver_state = device->machine().driver_data<newbrain_state>(); |
| 1274 | | |
| 1275 | | driver_state->acia_txd = state; |
| 1169 | m_acia_txd = state; |
| 1276 | 1170 | } |
| 1277 | 1171 | |
| 1278 | | static WRITE_LINE_DEVICE_HANDLER( acia_interrupt ) |
| 1172 | WRITE_LINE_MEMBER( newbrain_eim_state::acia_interrupt ) |
| 1279 | 1173 | { |
| 1280 | | newbrain_state *driver_state = device->machine().driver_data<newbrain_state>(); |
| 1281 | | |
| 1282 | | driver_state->aciaint = state; |
| 1174 | m_aciaint = state; |
| 1283 | 1175 | } |
| 1284 | 1176 | |
| 1285 | 1177 | static ACIA6850_INTERFACE( newbrain_acia_intf ) |
| 1286 | 1178 | { |
| 1287 | 1179 | 0, |
| 1288 | 1180 | 0, |
| 1289 | | DEVCB_LINE(acia_rx), |
| 1290 | | DEVCB_LINE(acia_tx), |
| 1181 | DEVCB_DRIVER_LINE_MEMBER(newbrain_eim_state, acia_rx), |
| 1182 | DEVCB_DRIVER_LINE_MEMBER(newbrain_eim_state, acia_tx), |
| 1291 | 1183 | DEVCB_NULL, |
| 1292 | 1184 | DEVCB_NULL, |
| 1293 | 1185 | DEVCB_NULL, |
| 1294 | | DEVCB_LINE(acia_interrupt) |
| 1186 | DEVCB_DRIVER_LINE_MEMBER(newbrain_eim_state, acia_interrupt) |
| 1295 | 1187 | }; |
| 1296 | 1188 | |
| 1297 | | static WRITE_LINE_DEVICE_HANDLER( newbrain_fdc_interrupt ) |
| 1189 | WRITE_LINE_MEMBER( newbrain_eim_state::fdc_interrupt ) |
| 1298 | 1190 | { |
| 1299 | | newbrain_state *driver_state = device->machine().driver_data<newbrain_state>(); |
| 1300 | | |
| 1301 | | driver_state->fdc_int = state; |
| 1191 | m_fdc_int = state; |
| 1302 | 1192 | } |
| 1303 | 1193 | |
| 1304 | 1194 | static const upd765_interface newbrain_upd765_interface = |
| 1305 | 1195 | { |
| 1306 | | DEVCB_LINE(newbrain_fdc_interrupt), |
| 1196 | DEVCB_DRIVER_LINE_MEMBER(newbrain_eim_state, fdc_interrupt), |
| 1307 | 1197 | DEVCB_NULL, |
| 1308 | 1198 | NULL, |
| 1309 | 1199 | UPD765_RDY_PIN_NOT_CONNECTED, |
| 1310 | 1200 | {FLOPPY_0,FLOPPY_1, NULL, NULL} |
| 1311 | 1201 | }; |
| 1312 | 1202 | |
| 1313 | | static WRITE_LINE_DEVICE_HANDLER( ctc_z0_w ) |
| 1203 | WRITE_LINE_MEMBER( newbrain_eim_state::ctc_z0_w ) |
| 1314 | 1204 | { |
| 1315 | | newbrain_state *driver_state = device->machine().driver_data<newbrain_state>(); |
| 1316 | | |
| 1317 | 1205 | /* connected to the ACIA receive clock */ |
| 1318 | | if (state) acia6850_rx_clock_in(driver_state->mc6850); |
| 1206 | if (state) acia6850_rx_clock_in(m_acia); |
| 1319 | 1207 | } |
| 1320 | 1208 | |
| 1321 | | static WRITE_LINE_DEVICE_HANDLER( ctc_z1_w ) |
| 1209 | WRITE_LINE_MEMBER( newbrain_eim_state::ctc_z1_w ) |
| 1322 | 1210 | { |
| 1323 | | newbrain_state *driver_state = device->machine().driver_data<newbrain_state>(); |
| 1324 | | |
| 1325 | 1211 | /* connected to the ACIA transmit clock */ |
| 1326 | | if (state) acia6850_tx_clock_in(driver_state->mc6850); |
| 1212 | if (state) acia6850_tx_clock_in(m_acia); |
| 1327 | 1213 | } |
| 1328 | 1214 | |
| 1329 | | static WRITE_LINE_DEVICE_HANDLER( ctc_z2_w ) |
| 1215 | WRITE_LINE_MEMBER( newbrain_eim_state::ctc_z2_w ) |
| 1330 | 1216 | { |
| 1331 | | newbrain_state *driver_state = device->machine().driver_data<newbrain_state>(); |
| 1332 | | |
| 1333 | 1217 | /* connected to CTC channel 0/1 clock inputs */ |
| 1334 | | z80ctc_trg0_w(driver_state->z80ctc, state); |
| 1335 | | z80ctc_trg1_w(driver_state->z80ctc, state); |
| 1218 | z80ctc_trg0_w(m_ctc, state); |
| 1219 | z80ctc_trg1_w(m_ctc, state); |
| 1336 | 1220 | } |
| 1337 | 1221 | |
| 1338 | 1222 | static Z80CTC_INTERFACE( newbrain_ctc_intf ) |
| 1339 | 1223 | { |
| 1340 | 1224 | 0, /* timer disables */ |
| 1341 | 1225 | DEVCB_NULL, /* interrupt handler */ |
| 1342 | | DEVCB_LINE(ctc_z0_w), /* ZC/TO0 callback */ |
| 1343 | | DEVCB_LINE(ctc_z1_w), /* ZC/TO1 callback */ |
| 1344 | | DEVCB_LINE(ctc_z2_w) /* ZC/TO2 callback */ |
| 1226 | DEVCB_DRIVER_LINE_MEMBER(newbrain_eim_state, ctc_z0_w), /* ZC/TO0 callback */ |
| 1227 | DEVCB_DRIVER_LINE_MEMBER(newbrain_eim_state, ctc_z1_w), /* ZC/TO1 callback */ |
| 1228 | DEVCB_DRIVER_LINE_MEMBER(newbrain_eim_state, ctc_z2_w) /* ZC/TO2 callback */ |
| 1345 | 1229 | }; |
| 1346 | 1230 | |
| 1347 | 1231 | static TIMER_DEVICE_CALLBACK( ctc_c2_tick ) |
| 1348 | 1232 | { |
| 1349 | | newbrain_state *state = timer.machine().driver_data<newbrain_state>(); |
| 1233 | newbrain_eim_state *state = timer.machine().driver_data<newbrain_eim_state>(); |
| 1350 | 1234 | |
| 1351 | | z80ctc_trg2_w(state->z80ctc, 1); |
| 1352 | | z80ctc_trg2_w(state->z80ctc, 0); |
| 1235 | z80ctc_trg2_w(state->m_ctc, 1); |
| 1236 | z80ctc_trg2_w(state->m_ctc, 0); |
| 1353 | 1237 | } |
| 1354 | 1238 | |
| 1355 | | INLINE int get_reset_t(void) |
| 1239 | inline int newbrain_state::get_reset_t() |
| 1356 | 1240 | { |
| 1357 | 1241 | return RES_K(220) * CAP_U(10) * 1000; // t = R128 * C125 = 2.2s |
| 1358 | 1242 | } |
| 1359 | 1243 | |
| 1360 | 1244 | static TIMER_CALLBACK( reset_tick ) |
| 1361 | 1245 | { |
| 1362 | | cputag_set_input_line(machine, Z80_TAG, INPUT_LINE_RESET, CLEAR_LINE); |
| 1363 | | cputag_set_input_line(machine, COP420_TAG, INPUT_LINE_RESET, CLEAR_LINE); |
| 1246 | newbrain_state *state = machine.driver_data<newbrain_eim_state>(); |
| 1247 | |
| 1248 | state->m_maincpu->set_input_line(INPUT_LINE_RESET, CLEAR_LINE); |
| 1249 | state->m_copcpu->set_input_line(INPUT_LINE_RESET, CLEAR_LINE); |
| 1364 | 1250 | } |
| 1365 | 1251 | |
| 1366 | | INLINE int get_pwrup_t(void) |
| 1252 | inline int newbrain_state::get_pwrup_t() |
| 1367 | 1253 | { |
| 1368 | 1254 | return RES_K(560) * CAP_U(10) * 1000; // t = R129 * C127 = 5.6s |
| 1369 | 1255 | } |
| r11027 | r11028 | |
| 1372 | 1258 | { |
| 1373 | 1259 | newbrain_state *state = machine.driver_data<newbrain_state>(); |
| 1374 | 1260 | |
| 1375 | | state->pwrup = 0; |
| 1376 | | newbrain_a_bankswitch(machine); |
| 1261 | state->m_pwrup = 0; |
| 1262 | state->bankswitch(); |
| 1377 | 1263 | } |
| 1378 | 1264 | |
| 1379 | | static MACHINE_START( newbrain ) |
| 1265 | void newbrain_state::machine_start() |
| 1380 | 1266 | { |
| 1381 | | newbrain_state *state = machine.driver_data<newbrain_state>(); |
| 1267 | m_copregint = 1; |
| 1382 | 1268 | |
| 1383 | | state->copregint = 1; |
| 1384 | | |
| 1385 | | /* find devices */ |
| 1386 | | state->cassette1 = machine.device(CASSETTE1_TAG); |
| 1387 | | state->cassette2 = machine.device(CASSETTE2_TAG); |
| 1388 | | |
| 1389 | 1269 | /* allocate reset timer */ |
| 1390 | | state->reset_timer = machine.scheduler().timer_alloc(FUNC(reset_tick)); |
| 1391 | | state->reset_timer->adjust(attotime::from_usec(get_reset_t())); |
| 1270 | m_reset_timer = m_machine.scheduler().timer_alloc(FUNC(reset_tick)); |
| 1271 | m_reset_timer->adjust(attotime::from_usec(get_reset_t())); |
| 1392 | 1272 | |
| 1393 | 1273 | /* allocate power up timer */ |
| 1394 | | state->pwrup_timer = machine.scheduler().timer_alloc(FUNC(pwrup_tick)); |
| 1395 | | state->pwrup_timer->adjust(attotime::from_usec(get_pwrup_t())); |
| 1274 | m_pwrup_timer = m_machine.scheduler().timer_alloc(FUNC(pwrup_tick)); |
| 1275 | m_pwrup_timer->adjust(attotime::from_usec(get_pwrup_t())); |
| 1396 | 1276 | |
| 1397 | 1277 | /* initialize variables */ |
| 1398 | | state->pwrup = 1; |
| 1399 | | state->userint = 1; |
| 1400 | | state->userint0 = 1; |
| 1401 | | state->clkint = 1; |
| 1402 | | state->aciaint = 1; |
| 1403 | | state->copint = 1; |
| 1404 | | state->bee = 1; |
| 1405 | | state->tvcnsl = 1; |
| 1278 | m_pwrup = 1; |
| 1279 | m_userint = 1; |
| 1280 | m_userint0 = 1; |
| 1281 | m_clkint = 1; |
| 1282 | m_aciaint = 1; |
| 1283 | m_copint = 1; |
| 1284 | m_bee = 1; |
| 1285 | m_tvcnsl = 1; |
| 1406 | 1286 | |
| 1407 | 1287 | /* set up memory banking */ |
| 1408 | | newbrain_a_bankswitch(machine); |
| 1288 | bankswitch(); |
| 1409 | 1289 | |
| 1410 | 1290 | /* register for state saving */ |
| 1411 | | state->save_item(NAME(state->pwrup)); |
| 1412 | | state->save_item(NAME(state->userint)); |
| 1413 | | state->save_item(NAME(state->userint0)); |
| 1414 | | state->save_item(NAME(state->clkint)); |
| 1415 | | state->save_item(NAME(state->aciaint)); |
| 1416 | | state->save_item(NAME(state->copint)); |
| 1417 | | state->save_item(NAME(state->anint)); |
| 1418 | | state->save_item(NAME(state->bee)); |
| 1419 | | state->save_item(NAME(state->enrg1)); |
| 1420 | | state->save_item(NAME(state->enrg2)); |
| 1421 | | state->save_item(NAME(state->cop_bus)); |
| 1422 | | state->save_item(NAME(state->cop_so)); |
| 1423 | | state->save_item(NAME(state->cop_tdo)); |
| 1424 | | state->save_item(NAME(state->cop_tdi)); |
| 1425 | | state->save_item(NAME(state->cop_rd)); |
| 1426 | | state->save_item(NAME(state->cop_wr)); |
| 1427 | | state->save_item(NAME(state->cop_access)); |
| 1428 | | state->save_item(NAME(state->keylatch)); |
| 1429 | | state->save_item(NAME(state->keydata)); |
| 1430 | | state->save_item(NAME(state->paging)); |
| 1431 | | state->save_item(NAME(state->mpm)); |
| 1432 | | state->save_item(NAME(state->a16)); |
| 1433 | | state->save_item(NAME(state->pr)); |
| 1434 | | state->save_item(NAME(state->fdc_int)); |
| 1435 | | state->save_item(NAME(state->fdc_att)); |
| 1436 | | state->save_item(NAME(state->user)); |
| 1291 | save_item(NAME(m_pwrup)); |
| 1292 | save_item(NAME(m_userint)); |
| 1293 | save_item(NAME(m_userint0)); |
| 1294 | save_item(NAME(m_clkint)); |
| 1295 | save_item(NAME(m_aciaint)); |
| 1296 | save_item(NAME(m_copint)); |
| 1297 | save_item(NAME(m_anint)); |
| 1298 | save_item(NAME(m_bee)); |
| 1299 | save_item(NAME(m_enrg1)); |
| 1300 | save_item(NAME(m_enrg2)); |
| 1301 | save_item(NAME(m_cop_bus)); |
| 1302 | save_item(NAME(m_cop_so)); |
| 1303 | save_item(NAME(m_cop_tdo)); |
| 1304 | save_item(NAME(m_cop_tdi)); |
| 1305 | save_item(NAME(m_cop_rd)); |
| 1306 | save_item(NAME(m_cop_wr)); |
| 1307 | save_item(NAME(m_cop_access)); |
| 1308 | save_item(NAME(m_keylatch)); |
| 1309 | save_item(NAME(m_keydata)); |
| 1310 | save_item(NAME(m_user)); |
| 1437 | 1311 | } |
| 1438 | 1312 | |
| 1439 | | static MACHINE_START( newbrain_eim ) |
| 1313 | void newbrain_eim_state::machine_start() |
| 1440 | 1314 | { |
| 1441 | | newbrain_state *state = machine.driver_data<newbrain_state>(); |
| 1315 | newbrain_state::machine_start(); |
| 1442 | 1316 | |
| 1443 | | MACHINE_START_CALL(newbrain); |
| 1444 | | |
| 1445 | 1317 | /* allocate expansion RAM */ |
| 1446 | | state->eim_ram = auto_alloc_array(machine, UINT8, NEWBRAIN_EIM_RAM_SIZE); |
| 1318 | m_eim_ram = auto_alloc_array(m_machine, UINT8, NEWBRAIN_EIM_RAM_SIZE); |
| 1447 | 1319 | |
| 1448 | | /* find devices */ |
| 1449 | | state->z80ctc = machine.device(Z80CTC_TAG); |
| 1450 | | state->mc6850 = machine.device(MC6850_TAG); |
| 1451 | | state->upd765 = machine.device(UPD765_TAG); |
| 1452 | | |
| 1453 | 1320 | /* register for state saving */ |
| 1454 | | state->save_pointer(NAME(state->eim_ram), NEWBRAIN_EIM_RAM_SIZE); |
| 1321 | save_pointer(NAME(m_eim_ram), NEWBRAIN_EIM_RAM_SIZE); |
| 1322 | save_item(NAME(m_mpm)); |
| 1323 | save_item(NAME(m_a16)); |
| 1324 | save_item(NAME(m_pr)); |
| 1325 | save_item(NAME(m_fdc_int)); |
| 1326 | save_item(NAME(m_fdc_att)); |
| 1327 | save_item(NAME(m_paging)); |
| 1455 | 1328 | } |
| 1456 | 1329 | |
| 1457 | | static MACHINE_RESET( newbrain ) |
| 1330 | void newbrain_state::machine_reset() |
| 1458 | 1331 | { |
| 1459 | | newbrain_state *state = machine.driver_data<newbrain_state>(); |
| 1460 | | |
| 1461 | | cputag_set_input_line(machine, Z80_TAG, INPUT_LINE_RESET, HOLD_LINE); |
| 1462 | | cputag_set_input_line(machine, COP420_TAG, INPUT_LINE_RESET, HOLD_LINE); |
| 1463 | | |
| 1464 | | state->reset_timer->adjust(attotime::from_msec(get_reset_t())); |
| 1332 | m_reset_timer->adjust(attotime::from_msec(get_reset_t())); |
| 1465 | 1333 | } |
| 1466 | 1334 | |
| 1467 | 1335 | static INTERRUPT_GEN( newbrain_interrupt ) |
| 1468 | 1336 | { |
| 1469 | 1337 | newbrain_state *state = device->machine().driver_data<newbrain_state>(); |
| 1470 | 1338 | |
| 1471 | | if (!(state->enrg1 & NEWBRAIN_ENRG1_CLK)) |
| 1339 | if (!(state->m_enrg1 & NEWBRAIN_ENRG1_CLK)) |
| 1472 | 1340 | { |
| 1473 | | state->clkint = 0; |
| 1474 | | check_interrupt(device->machine()); |
| 1341 | state->m_clkint = 0; |
| 1342 | state->check_interrupt(); |
| 1475 | 1343 | } |
| 1476 | 1344 | } |
| 1477 | 1345 | |
| r11027 | r11028 | |
| 1511 | 1379 | GFXDECODE_END |
| 1512 | 1380 | |
| 1513 | 1381 | static MACHINE_CONFIG_START( newbrain_a, newbrain_state ) |
| 1514 | | /* basic system hardware */ |
| 1382 | // basic system hardware |
| 1515 | 1383 | MCFG_CPU_ADD(Z80_TAG, Z80, XTAL_16MHz/8) |
| 1516 | 1384 | MCFG_CPU_PROGRAM_MAP(newbrain_map) |
| 1517 | 1385 | MCFG_CPU_IO_MAP(newbrain_a_io_map) |
| r11027 | r11028 | |
| 1525 | 1393 | |
| 1526 | 1394 | MCFG_TIMER_ADD_PERIODIC("cop_regint", cop_regint_tick, attotime::from_usec(12500)) // HACK |
| 1527 | 1395 | |
| 1528 | | MCFG_MACHINE_START(newbrain) |
| 1529 | | MCFG_MACHINE_RESET(newbrain) |
| 1530 | | |
| 1531 | | /* video hardware */ |
| 1532 | | MCFG_DEFAULT_LAYOUT(layout_newbrain) |
| 1396 | // video hardware |
| 1533 | 1397 | MCFG_FRAGMENT_ADD(newbrain_video) |
| 1534 | 1398 | |
| 1535 | | /* cassette */ |
| 1536 | | MCFG_CASSETTE_ADD("cassette1", newbrain_cassette_config) |
| 1537 | | MCFG_CASSETTE_ADD("cassette2", newbrain_cassette_config) |
| 1399 | // devices |
| 1400 | MCFG_CASSETTE_ADD(CASSETTE1_TAG, newbrain_cassette_config) |
| 1401 | MCFG_CASSETTE_ADD(CASSETTE2_TAG, newbrain_cassette_config) |
| 1538 | 1402 | |
| 1539 | | /* internal ram */ |
| 1403 | // internal ram |
| 1540 | 1404 | MCFG_RAM_ADD(RAM_TAG) |
| 1541 | 1405 | MCFG_RAM_DEFAULT_SIZE("32K") |
| 1542 | 1406 | MACHINE_CONFIG_END |
| r11027 | r11028 | |
| 1552 | 1416 | DEVCB_NULL, |
| 1553 | 1417 | DEVCB_NULL, |
| 1554 | 1418 | DEVCB_NULL, |
| 1555 | | FLOPPY_STANDARD_5_25_DSHD, |
| 1419 | FLOPPY_STANDARD_5_25_DSDD, |
| 1556 | 1420 | FLOPPY_OPTIONS_NAME(newbrain), |
| 1557 | 1421 | NULL |
| 1558 | 1422 | }; |
| 1559 | 1423 | |
| 1560 | | static MACHINE_CONFIG_DERIVED( newbrain_eim, newbrain_a ) |
| 1561 | | |
| 1562 | | /* basic system hardware */ |
| 1424 | static MACHINE_CONFIG_DERIVED_CLASS( newbrain_eim, newbrain_a, newbrain_eim_state ) |
| 1425 | // basic system hardware |
| 1563 | 1426 | MCFG_CPU_MODIFY(Z80_TAG) |
| 1564 | 1427 | MCFG_CPU_IO_MAP(newbrain_ei_io_map) |
| 1565 | 1428 | |
| r11027 | r11028 | |
| 1567 | 1430 | MCFG_CPU_PROGRAM_MAP(newbrain_fdc_map) |
| 1568 | 1431 | MCFG_CPU_IO_MAP(newbrain_fdc_io_map) |
| 1569 | 1432 | |
| 1570 | | MCFG_MACHINE_START(newbrain_eim) |
| 1571 | | |
| 1572 | | /* Z80 CTC */ |
| 1433 | // devices |
| 1573 | 1434 | MCFG_Z80CTC_ADD(Z80CTC_TAG, XTAL_16MHz/8, newbrain_ctc_intf) |
| 1574 | 1435 | MCFG_TIMER_ADD_PERIODIC("z80ctc_c2", ctc_c2_tick, attotime::from_hz(XTAL_16MHz/4/13)) |
| 1575 | | |
| 1576 | | /* AD-DA converters */ |
| 1577 | 1436 | MCFG_ADC0809_ADD(ADC0809_TAG, 500000, newbrain_adc0809_intf) |
| 1578 | | |
| 1579 | | /* MC6850 */ |
| 1580 | 1437 | MCFG_ACIA6850_ADD(MC6850_TAG, newbrain_acia_intf) |
| 1581 | | |
| 1582 | | /* UPD765 */ |
| 1583 | 1438 | MCFG_UPD765A_ADD(UPD765_TAG, newbrain_upd765_interface) |
| 1584 | | |
| 1585 | 1439 | MCFG_FLOPPY_2_DRIVES_ADD(newbrain_floppy_config) |
| 1586 | 1440 | |
| 1587 | | /* internal ram */ |
| 1441 | // internal ram |
| 1588 | 1442 | MCFG_RAM_MODIFY(RAM_TAG) |
| 1589 | 1443 | MCFG_RAM_DEFAULT_SIZE("96K") |
| 1590 | 1444 | MACHINE_CONFIG_END |
| r11027 | r11028 | |
| 1622 | 1476 | ROM_REGION( 0x400, COP420_TAG, 0 ) |
| 1623 | 1477 | ROM_LOAD( "cop420.419", 0x000, 0x400, NO_DUMP ) |
| 1624 | 1478 | |
| 1625 | | ROM_REGION( 0x1000, "chargen", 0 ) /* The missing part of this rom should be filled with zeroes */ |
| 1479 | ROM_REGION( 0x1000, "chargen", ROMREGION_ERASE00 ) |
| 1626 | 1480 | ROM_LOAD( "char eprom iss 1.ic453", 0x0000, 0x0a01, BAD_DUMP CRC(46ecbc65) SHA1(3fe064d49a4de5e3b7383752e98ad35a674e26dd) ) // 8248R7 |
| 1627 | 1481 | ROM_END |
| 1628 | 1482 | |
| 1629 | | #define rom_newbraia rom_newbrain |
| 1483 | #define rom_newbraina rom_newbrain |
| 1630 | 1484 | |
| 1631 | | ROM_START( newbraie ) |
| 1485 | ROM_START( newbraineim ) |
| 1632 | 1486 | ROM_REGION( 0x10000, Z80_TAG, 0 ) |
| 1633 | 1487 | ROM_DEFAULT_BIOS( "rom20" ) |
| 1634 | 1488 | |
| r11027 | r11028 | |
| 1674 | 1528 | ROM_LOAD( "d417-2.rom", 0x0000, 0x2000, CRC(e8bda8b9) SHA1(c85a76a5ff7054f4ef4a472ce99ebaed1abd269c) ) |
| 1675 | 1529 | ROM_END |
| 1676 | 1530 | |
| 1677 | | ROM_START( newbraim ) |
| 1531 | ROM_START( newbrainmd ) |
| 1678 | 1532 | ROM_REGION( 0x10000, Z80_TAG, 0 ) |
| 1679 | 1533 | ROM_LOAD( "cdmd.rom", 0xc000, 0x2000, CRC(6b4d9429) SHA1(ef688be4e75aced61f487c928258c8932a0ae00a) ) |
| 1680 | 1534 | ROM_LOAD( "efmd.rom", 0xe000, 0x2000, CRC(20dd0b49) SHA1(74b517ca223cefb588e9f49e72ff2d4f1627efc6) ) |
| r11027 | r11028 | |
| 1690 | 1544 | |
| 1691 | 1545 | // YEAR NAME PARENT COMPAT MACHINE INPUT INIT COMPANY FULLNAME FLAGS |
| 1692 | 1546 | COMP( 1981, newbrain, 0, 0, newbrain_a, newbrain, 0, "Grundy Business Systems Ltd", "NewBrain AD", GAME_NOT_WORKING | GAME_NO_SOUND) |
| 1693 | | COMP( 1981, newbraie, newbrain, 0, newbrain_eim, newbrain, 0, "Grundy Business Systems Ltd", "NewBrain AD with Expansion Interface", GAME_NOT_WORKING | GAME_NO_SOUND ) |
| 1694 | | COMP( 1981, newbraia, newbrain, 0, newbrain_a, newbrain, 0, "Grundy Business Systems Ltd", "NewBrain A", GAME_NOT_WORKING | GAME_NO_SOUND) |
| 1695 | | COMP( 1981, newbraim, newbrain, 0, newbrain_a, newbrain, 0, "Grundy Business Systems Ltd", "NewBrain MD", GAME_NOT_WORKING | GAME_NO_SOUND ) |
| 1547 | COMP( 1981, newbraineim,newbrain, 0, newbrain_eim, newbrain, 0, "Grundy Business Systems Ltd", "NewBrain AD with Expansion Interface", GAME_NOT_WORKING | GAME_NO_SOUND ) |
| 1548 | COMP( 1981, newbraina, newbrain, 0, newbrain_a, newbrain, 0, "Grundy Business Systems Ltd", "NewBrain A", GAME_NOT_WORKING | GAME_NO_SOUND) |
| 1549 | COMP( 1981, newbrainmd, newbrain, 0, newbrain_a, newbrain, 0, "Grundy Business Systems Ltd", "NewBrain MD", GAME_NOT_WORKING | GAME_NO_SOUND ) |