Previous 15994 Revisions Next

r11028 Friday 1st April, 2011 at 06:38:48 UTC by Curt Coder
[NEWBRAIN] Modernized driver.
[src/mess]messdriv.c
[src/mess/drivers]newbrain.c
[src/mess/includes]newbrain.h
[src/mess/video]newbrain.c

src/mess/video/newbrain.c
r11027r11028
1#include "emu.h"
21#include "includes/newbrain.h"
2#include "newbrain.lh"
33
4static VIDEO_START( newbrain )
4void newbrain_state::video_start()
55{
6   newbrain_state *state = machine.driver_data<newbrain_state>();
7
86   /* find memory regions */
7   m_char_rom = m_machine.region("chargen")->base();
98
10   state->char_rom = machine.region("chargen")->base();
11
129   /* register for state saving */
13
14   state->save_item(NAME(state->tvcnsl));
15   state->save_item(NAME(state->tvctl));
16   state->save_item(NAME(state->tvram));
17   state->save_item(NAME(state->segment_data));
10   save_item(NAME(m_tvcnsl));
11   save_item(NAME(m_tvctl));
12   save_item(NAME(m_tvram));
13   save_item(NAME(m_segment_data));
1814}
1915
20static void newbrain_update(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
16void newbrain_state::screen_update(bitmap_t *bitmap, const rectangle *cliprect)
2117{
22   newbrain_state *state = machine.driver_data<newbrain_state>();
18   address_space *program = m_maincpu->memory().space(AS_PROGRAM);
2319
24   address_space *program = machine.device(Z80_TAG)->memory().space(AS_PROGRAM);
25
2620   int y, sx;
27   int columns = (state->tvctl & NEWBRAIN_VIDEO_80L) ? 80 : 40;
28   int excess = (state->tvctl & NEWBRAIN_VIDEO_32_40) ? 24 : 4;
29   int ucr = (state->tvctl & NEWBRAIN_VIDEO_UCR) ? 1 : 0;
30   int fs = (state->tvctl & NEWBRAIN_VIDEO_FS) ? 1 : 0;
31   int rv = (state->tvctl & NEWBRAIN_VIDEO_RV) ? 1 : 0;
21   int columns = (m_tvctl & NEWBRAIN_VIDEO_80L) ? 80 : 40;
22   int excess = (m_tvctl & NEWBRAIN_VIDEO_32_40) ? 24 : 4;
23   int ucr = (m_tvctl & NEWBRAIN_VIDEO_UCR) ? 1 : 0;
24   int fs = (m_tvctl & NEWBRAIN_VIDEO_FS) ? 1 : 0;
25   int rv = (m_tvctl & NEWBRAIN_VIDEO_RV) ? 1 : 0;
3226   int gr = 0;
3327
34   UINT16 videoram_addr = state->tvram;
28   UINT16 videoram_addr = m_tvram;
3529   UINT8 rc = 0;
3630
3731   for (y = 0; y < 250; y++)
r11027r11028
5448         {
5549            /* render character rom data */
5650            UINT16 charrom_addr = (rc << 8) | ((BIT(videoram_data, 7) & fs) << 7) | (videoram_data & 0x7f);
57            charrom_data = state->char_rom[charrom_addr & 0xfff];
51            charrom_data = m_char_rom[charrom_addr & 0xfff];
5852
5953            if ((videoram_data & 0x80) && !fs)
6054            {
r11027r11028
107101   }
108102}
109103
110static SCREEN_UPDATE( newbrain )
104bool newbrain_state::screen_update(screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect)
111105{
112   newbrain_state *state = screen->machine().driver_data<newbrain_state>();
113
114   if (state->enrg1 & NEWBRAIN_ENRG1_TVP)
106   if (m_enrg1 & NEWBRAIN_ENRG1_TVP)
115107   {
116      newbrain_update(screen->machine(), bitmap, cliprect);
108      screen_update(&bitmap, &cliprect);
117109   }
118110   else
119111   {
120      bitmap_fill(bitmap, cliprect, 0);
112      bitmap_fill(&bitmap, &cliprect, get_black_pen(m_machine));
121113   }
122114
123115   return 0;
r11027r11028
126118/* Machine Drivers */
127119
128120MACHINE_CONFIG_FRAGMENT( newbrain_video )
121   MCFG_DEFAULT_LAYOUT(layout_newbrain)
122
129123   MCFG_SCREEN_ADD(SCREEN_TAG, RASTER)
130124   MCFG_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
131125   MCFG_SCREEN_REFRESH_RATE(50)
132126   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */
133127   MCFG_SCREEN_SIZE(640, 250)
134128   MCFG_SCREEN_VISIBLE_AREA(0, 639, 0, 249)
135   MCFG_SCREEN_UPDATE(newbrain)
136129
137130   MCFG_PALETTE_LENGTH(2)
138131   MCFG_PALETTE_INIT(black_and_white)
139
140   MCFG_VIDEO_START(newbrain)
141132MACHINE_CONFIG_END
src/mess/includes/newbrain.h
r11027r11028
1#pragma once
2
13#ifndef __NEWBRAIN__
24#define __NEWBRAIN__
35
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
423#define SCREEN_TAG      "screen"
524#define Z80_TAG         "409"
625#define COP420_TAG      "419"
r11027r11028
4261{
4362public:
4463   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   { }
4670
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;
6075
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();
6978
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
73127
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
80136
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
84140
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
91147
92   /* user bus state */
93   UINT8 user;
148   // user bus state
149   UINT8 m_user;
94150
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
98154
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;
109160};
110161
111/* ---------- defined in video/newbrain.c ---------- */
162class newbrain_eim_state : public newbrain_state
163{
164public:
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   { }
112173
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
113223MACHINE_CONFIG_EXTERN( newbrain_video );
114224
115225#endif
src/mess/messdriv.c
r11027r11028
15231523
15241524   /* Grundy Business Systems Ltd */
15251525   DRIVER( newbrain )
1526   DRIVER( newbraie )
1527   DRIVER( newbraia )
1528   DRIVER( newbraim )
1526   DRIVER( newbraineim )
1527   DRIVER( newbraina )
1528   DRIVER( newbrainmd )
15291529
15301530   /* Nokia Data */
15311531   DRIVER( mm1m6 )
src/mess/drivers/newbrain.c
r11027r11028
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"
101#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"
172
183/*
194
r11027r11028
6045
6146*/
6247
63static void check_interrupt(running_machine &machine)
48void newbrain_state::check_interrupt()
6449{
65   newbrain_state *state = machine.driver_data<newbrain_state>();
50   int level = (!m_clkint || !m_copint) ? ASSERT_LINE : CLEAR_LINE;
6651
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);
7053}
7154
7255/* Bank Switching */
r11027r11028
8164#define memory_install_ram_helper(program, bank, bank_start, bank_end) \
8265   program->install_readwrite_bank(bank_start, bank_end, bank);
8366
84static void newbrain_eim_bankswitch(running_machine &machine)
67void newbrain_eim_state::bankswitch()
8568{
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);
8970   int bank;
9071
9172   for (bank = 1; bank < 9; bank++)
9273   {
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];
9576      int ch = (data >> 3) & 0x03;
9677      int eim_bank = data & 0x07;
9778
r11027r11028
10586      case 0:
10687         /* ROM */
10788         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);
10990         break;
11091
11192      case 2:
11293         /* RAM */
11394         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);
11596         break;
11697
11798      default:
r11027r11028
121102   }
122103}
123104
124static void newbrain_a_bankswitch(running_machine &machine)
105void newbrain_state::bankswitch()
125106{
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);
129108   int bank;
130109
131   if (state->paging)
132   {
133      /* expansion interface module paging */
134      newbrain_eim_bankswitch(machine);
135      return;
136   }
137
138110   for (bank = 1; bank < 9; bank++)
139111   {
140112      UINT16 bank_start = (bank - 1) * 0x2000;
r11027r11028
142114      char bank_name[10];
143115      sprintf(bank_name,"bank%d",bank);
144116
145      if (state->pwrup)
117      if (m_pwrup)
146118      {
147119         /* all banks point to ROM at 0xe000 */
148120         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);
150122      }
151123      else
152124      {
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);
154126
155127         if (bank < 5)
156128         {
r11027r11028
160132         else if (bank == 5)
161133         {
162134            /* 0x8000-0x9fff */
163            if (machine.region("eim")->base())
135            if (m_machine.region("eim")->base())
164136            {
165137               /* expansion interface ROM */
166138               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);
168140            }
169141            else
170142            {
171143               /* mirror of 0xa000-0xbfff */
172               if (machine.region(Z80_TAG)->base()[0xa001] == 0)
144               if (m_machine.region(Z80_TAG)->base()[0xa001] == 0)
173145               {
174146                  /* unmapped on the M model */
175147                  memory_install_unmapped(program, bank_name, bank_start, bank_end);
r11027r11028
180152                  memory_install_rom_helper(program, bank_name, bank_start, bank_end);
181153               }
182154
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);
184156            }
185157         }
186158         else if (bank == 6)
187159         {
188160            /* 0xa000-0xbfff */
189            if (machine.region(Z80_TAG)->base()[0xa001] == 0)
161            if (m_machine.region(Z80_TAG)->base()[0xa001] == 0)
190162            {
191163               /* unmapped on the M model */
192164               memory_install_unmapped(program, bank_name, bank_start, bank_end);
r11027r11028
204176         }
205177      }
206178
207      memory_set_bank(machine, bank_name, 0);
179      memory_set_bank(m_machine, bank_name, 0);
208180   }
209181}
210182
211183/* Enable/Status */
212184
213static WRITE8_HANDLER( enrg1_w )
185WRITE8_MEMBER( newbrain_state::enrg1_w )
214186{
215187   /*
216188
r11027r11028
227199
228200    */
229201
230   newbrain_state *state = space->machine().driver_data<newbrain_state>();
231
232   state->enrg1 = data;
202   m_enrg1 = data;
233203}
234204
235static WRITE8_HANDLER( a_enrg1_w )
205WRITE8_MEMBER( newbrain_state::a_enrg1_w )
236206{
237207   /*
238208
r11027r11028
249219
250220    */
251221
252   newbrain_state *state = space->machine().driver_data<newbrain_state>();
253
254   state->enrg1 = data;
222   m_enrg1 = data;
255223}
256224
257#ifdef UNUSED_FUNCTION
258static READ8_HANDLER( ust_r )
225READ8_MEMBER( newbrain_state::ust_r )
259226{
260227   /*
261228
r11027r11028
272239
273240    */
274241
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;
276243
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)
280245   {
281246   case 0:
282247      // excess, 1=24, 0=4
283      if (state->tvctl & NEWBRAIN_VIDEO_32_40)
248      if (m_tvctl & NEWBRAIN_VIDEO_32_40)
284249      {
285250         data |= 0x01;
286251      }
r11027r11028
288253
289254   case 1:
290255      // characters per line, 1=40, 0=80
291      if (state->tvctl & NEWBRAIN_VIDEO_80L)
256      if (m_tvctl & NEWBRAIN_VIDEO_80L)
292257      {
293258         data |= 0x01;
294259      }
r11027r11028
303268      break;
304269   }
305270
306   switch ((state->enrg1 & NEWBRAIN_ENRG1_UST_BIT_1_MASK) >> 4)
271   switch ((m_enrg1 & NEWBRAIN_ENRG1_UST_BIT_1_MASK) >> 4)
307272   {
308273   case 0:
309274      // PWRUP, if set indicates that power is supplied to Z80 and memory
310      if (state->pwrup)
275      if (m_pwrup)
311276      {
312277         data |= 0x02;
313278      }
r11027r11028
315280
316281   case 1:
317282      // TVCNSL, if set then processor has video device as primary console output
318      if (state->tvcnsl)
283      if (m_tvcnsl)
319284      {
320285         data |= 0x02;
321286      }
r11027r11028
323288
324289   case 2:
325290      // _BEE, if set then processor is Model A type
326      if (state->bee)
291      if (m_bee)
327292      {
328293         data |= 0x02;
329294      }
r11027r11028
337302
338303   return data;
339304}
340#endif /* UNUSED_FUNCTION */
341305
342static READ8_HANDLER( a_ust_r )
306READ8_MEMBER( newbrain_state::a_ust_r )
343307{
344308   /*
345309
r11027r11028
356320
357321    */
358322
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;
362324}
363325
364static READ8_HANDLER( user_r )
326READ8_MEMBER( newbrain_state::user_r )
365327{
366328   /*
367329
r11027r11028
378340
379341    */
380342
381   newbrain_state *state = space->machine().driver_data<newbrain_state>();
343   m_user = 0;
382344
383   state->user = 0;
384
385345   return 0xff;
386346}
387347
388static WRITE8_HANDLER( user_w )
348WRITE8_MEMBER( newbrain_state::user_w )
389349{
390   newbrain_state *state = space->machine().driver_data<newbrain_state>();
391
392   state->user = data;
350   m_user = data;
393351}
394352
395353/* Interrupts */
396354
397static READ8_HANDLER( clclk_r )
355READ8_MEMBER( newbrain_state::clclk_r )
398356{
399   newbrain_state *state = space->machine().driver_data<newbrain_state>();
357   m_clkint = 1;
358   check_interrupt();
400359
401   state->clkint = 1;
402   check_interrupt(space->machine());
403
404360   return 0xff;
405361}
406362
407static WRITE8_HANDLER( clclk_w )
363WRITE8_MEMBER( newbrain_state::clclk_w )
408364{
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();
413367}
414368
415static READ8_HANDLER( clusr_r )
369READ8_MEMBER( newbrain_state::clusr_r )
416370{
417   newbrain_state *state = space->machine().driver_data<newbrain_state>();
371   m_userint = 1;
418372
419   state->userint = 1;
420
421373   return 0xff;
422374}
423375
424static WRITE8_HANDLER( clusr_w )
376WRITE8_MEMBER( newbrain_state::clusr_w )
425377{
426   newbrain_state *state = space->machine().driver_data<newbrain_state>();
427
428   state->userint = 1;
378   m_userint = 1;
429379}
430380
431381/* COP420 */
432382
433static READ8_HANDLER( newbrain_cop_l_r )
383READ8_MEMBER( newbrain_state::cop_l_r )
434384{
435385   // 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;
440387}
441388
442static WRITE8_HANDLER( newbrain_cop_l_w )
389WRITE8_MEMBER( newbrain_state::cop_l_w )
443390{
444391   // 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;
449393}
450394
451static WRITE8_HANDLER( newbrain_cop_g_w )
395WRITE8_MEMBER( newbrain_state::cop_g_w )
452396{
453397   /*
454398
r11027r11028
461405
462406    */
463407
464   newbrain_state *state = space->machine().driver_data<newbrain_state>();
408   m_copint = BIT(data, 0);
409   check_interrupt();
465410
466   state->copint = BIT(data, 0);
467   check_interrupt(space->machine());
468
469411   /* tape motor enable */
470412
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);
473415}
474416
475static READ8_HANDLER( newbrain_cop_g_r )
417READ8_MEMBER( newbrain_state::cop_g_r )
476418{
477419   /*
478420
r11027r11028
485427
486428    */
487429
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);
491431}
492432
493static WRITE8_HANDLER( newbrain_cop_d_w )
433WRITE8_MEMBER( newbrain_state::cop_d_w )
494434{
495435   /*
496
497436        bit     description
498437
499438        D0      inverted to K4 -> CD4024 pin 2 (reset)
r11027r11028
503442
504443    */
505444
506   newbrain_state *state = space->machine().driver_data<newbrain_state>();
507
508445   static const char *const keynames[] = {
509446      "D0", "D1", "D2", "D3", "D4", "D5", "D6", "D7",
510447      "D8", "D9", "D10", "D11", "D12", "D13", "D14", "D15"
r11027r11028
514451
515452   if (!BIT(data, 0))
516453   {
517      state->keylatch = 0;
454      m_keylatch = 0;
518455   }
519456
520457   /* tape data output */
521458
522   state->cop_tdo = BIT(data, 1);
459   m_cop_tdo = BIT(data, 1);
523460
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);
526463
527464   /* keyboard and display clock */
528465
529466   if (!BIT(data, 2))
530467   {
531      state->keylatch++;
468      m_keylatch++;
532469
533      if (state->keylatch == 16)
470      if (m_keylatch == 16)
534471      {
535         state->keylatch = 0;
472         m_keylatch = 0;
536473      }
537474
538      state->keydata = input_port_read(space->machine(), keynames[state->keylatch]);
475      m_keydata = input_port_read(m_machine, keynames[m_keylatch]);
539476
540      output_set_digit_value(state->keylatch, state->segment_data[state->keylatch]);
477      output_set_digit_value(m_keylatch, m_segment_data[m_keylatch]);
541478   }
542479}
543480
544static READ8_HANDLER( newbrain_cop_in_r )
481READ8_MEMBER( newbrain_state::cop_in_r )
545482{
546483   /*
547484
r11027r11028
554491
555492    */
556493
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);
560495}
561496
562static WRITE8_HANDLER( newbrain_cop_so_w )
497WRITE8_MEMBER( newbrain_state::cop_so_w )
563498{
564499   // 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;
569501}
570502
571static WRITE8_HANDLER( newbrain_cop_sk_w )
503WRITE8_MEMBER( newbrain_state::cop_sk_w )
572504{
573505   // 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);
579508}
580509
581static READ8_HANDLER( newbrain_cop_si_r )
510READ8_MEMBER( newbrain_state::cop_si_r )
582511{
583512   // connected to TDI
513   m_cop_tdi = ((cassette_input(m_cassette1) > +1.0) || (cassette_input(m_cassette2) > +1.0)) ^ m_cop_tdo;
584514
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;
590516}
591517
592518/* Video */
593519
594static void newbrain_tvram_w(running_machine &machine, UINT8 data, int a6)
520void newbrain_state::tvram_w(UINT8 data, int a6)
595521{
596   newbrain_state *state = machine.driver_data<newbrain_state>();
597
598522   /* 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;
600524
601525   /* latch video address counter bit A6 */
602   state->tvram |= a6 << 6;
526   m_tvram |= a6 << 6;
603527
604528   /* latch data to video address counter bits A14-A7 */
605   state->tvram = (data << 7);
529   m_tvram = (data << 7);
606530}
607531
608static READ8_HANDLER( tvl_r )
532READ8_MEMBER( newbrain_state::tvl_r )
609533{
610534   UINT8 data = 0xff;
611535
612   newbrain_tvram_w(space->machine(), data, !offset);
536   tvram_w(data, !offset);
613537
614538   return data;
615539}
616540
617static WRITE8_HANDLER( tvl_w )
541WRITE8_MEMBER( newbrain_state::tvl_w )
618542{
619   newbrain_tvram_w(space->machine(), data, !offset);
543   tvram_w(data, !offset);
620544}
621545
622static WRITE8_HANDLER( tvctl_w )
546WRITE8_MEMBER( newbrain_state::tvctl_w )
623547{
624548   /*
625549
r11027r11028
636560
637561    */
638562
639   newbrain_state *state = space->machine().driver_data<newbrain_state>();
640
641   state->tvctl = data;
563   m_tvctl = data;
642564}
643565
644566/* Disc Controller */
645567
646static WRITE8_HANDLER( fdc_auxiliary_w )
568WRITE8_MEMBER( newbrain_eim_state::fdc_auxiliary_w )
647569{
648570   /*
649571
r11027r11028
660582
661583    */
662584
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);
664587
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));
667589
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));
671591}
672592
673static READ8_HANDLER( fdc_control_r )
593READ8_MEMBER( newbrain_eim_state::fdc_control_r )
674594{
675595   /*
676596
r11027r11028
687607
688608    */
689609
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);
693611}
694612
695#ifdef UNUSED_FUNCTION
696static READ8_HANDLER( ust2_r )
613READ8_MEMBER( newbrain_eim_state::ust2_r )
697614{
698615   /*
699616
r11027r11028
712629
713630   return 0;
714631}
715#endif /* UNUSED_FUNCTION */
716632
717633#define NEWBRAIN_COPCMD_NULLCOM      0xd0
718634#define NEWBRAIN_COPCMD_DISPCOM      0xa0
r11027r11028
743659};
744660
745661
746static READ8_HANDLER( cop_r )
662READ8_MEMBER( newbrain_state::cop_r )
747663{
748   newbrain_state *state = space->machine().driver_data<newbrain_state>();
664   m_copint = 1;
665   check_interrupt();
749666
750   state->copint = 1;
751   check_interrupt(space->machine());
752
753   return state->copdata;
667   return m_copdata;
754668}
755669
756static WRITE8_HANDLER( cop_w )
670WRITE8_MEMBER( newbrain_state::cop_w )
757671{
758   newbrain_state *state = space->machine().driver_data<newbrain_state>();
672   m_copdata = data;
759673
760   state->copdata = data;
761
762   switch (state->copstate)
674   switch (m_copstate)
763675   {
764676   case NEWBRAIN_COP_STATE_COMMAND:
765677      logerror("COP command %02x\n", data);
r11027r11028
770682         break;
771683
772684      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;
776688
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();
780692
781693         break;
782694
783695#if 0
784696      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;
788700         break;
789701#endif
790702      case NEWBRAIN_COPCMD_PDNCOM:
791703         /* power down */
792         state->copregint = 0;
704         m_copregint = 0;
793705         break;
794706
795707      default:
796708         if (data & NEWBRAIN_COPCMD_TAPECOM)
797709         {
798            state->copregint = 0;
710            m_copregint = 0;
799711         }
800712      }
801713      break;
802714
803715   case NEWBRAIN_COP_STATE_DATA:
804716      logerror("COP data %02x\n", data);
805      state->copbytes--;
717      m_copbytes--;
806718
807      if (state->copbytes == 0)
719      if (m_copbytes == 0)
808720      {
809         state->copstate = NEWBRAIN_COP_STATE_COMMAND;
810         state->copregint = 1;
721         m_copstate = NEWBRAIN_COP_STATE_COMMAND;
722         m_copregint = 1;
811723      }
812724
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();
816728
817729      break;
818730   }
r11027r11028
822734{
823735   newbrain_state *state = timer.machine().driver_data<newbrain_state>();
824736
825   if (state->copregint)
737   if (state->m_copregint)
826738   {
827739      logerror("COP REGINT\n");
828      state->copint = 0;
829      check_interrupt(timer.machine());
740      state->m_copint = 0;
741      state->check_interrupt();
830742   }
831743}
832744
833745/* Expansion Interface Module */
834746
835static WRITE8_HANDLER( ei_enrg2_w )
747WRITE8_MEMBER( newbrain_eim_state::enrg2_w )
836748{
837749   /*
838750
r11027r11028
849761
850762    */
851763
852   newbrain_state *state = space->machine().driver_data<newbrain_state>();
853
854   state->enrg2 = data;
764   m_enrg2 = data;
855765}
856766
857static WRITE8_HANDLER( ei_pr_w )
767WRITE8_MEMBER( newbrain_eim_state::pr_w )
858768{
859769   /*
860770
r11027r11028
874784
875785    */
876786
877   newbrain_state *state = space->machine().driver_data<newbrain_state>();
878
879787   int page = (BIT(offset, 12) >> 9) | (BIT(offset, 15) >> 13) | (BIT(offset, 14) >> 13) | (BIT(offset, 13) >> 13);
880788   int bank = (BIT(offset, 11) >> 3) | (data & 0x7f);
881789
882   state->pr[page] = bank;
790   m_pr[page] = bank;
883791
884   newbrain_a_bankswitch(space->machine());
792   bankswitch();
885793}
886794
887static READ8_HANDLER( ei_user_r )
795READ8_MEMBER( newbrain_eim_state::user_r )
888796{
889   newbrain_state *state = space->machine().driver_data<newbrain_state>();
797   m_user = 0xff;
890798
891   state->user = 0xff;
892
893799   return 0xff;
894800}
895801
896static WRITE8_HANDLER( ei_user_w )
802WRITE8_MEMBER( newbrain_eim_state::user_w )
897803{
898   newbrain_state *state = space->machine().driver_data<newbrain_state>();
899
900   state->user = data;
804   m_user = data;
901805}
902806
903static READ8_HANDLER( ei_anout_r )
807READ8_MEMBER( newbrain_eim_state::anout_r )
904808{
905809   return 0xff;
906810}
907811
908static WRITE8_HANDLER( ei_anout_w )
812WRITE8_MEMBER( newbrain_eim_state::anout_w )
909813{
910814}
911815
912static READ8_HANDLER( ei_anin_r )
816READ8_MEMBER( newbrain_eim_state::anin_r )
913817{
914818//  int channel = offset & 0x03;
915819
916820   return 0;
917821}
918822
919static WRITE8_HANDLER( ei_anio_w )
823WRITE8_MEMBER( newbrain_eim_state::anio_w )
920824{
921825//  int channel = offset & 0x03;
922826}
923827
924static READ8_HANDLER( ei_st0_r )
828READ8_MEMBER( newbrain_eim_state::st0_r )
925829{
926830   /*
927831
r11027r11028
938842
939843    */
940844
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;
944846}
945847
946static READ8_HANDLER( ei_st1_r )
848READ8_MEMBER( newbrain_eim_state::st1_r )
947849{
948850   /*
949851
r11027r11028
960862
961863    */
962864
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;
966866}
967867
968static READ8_HANDLER( ei_st2_r )
868READ8_MEMBER( newbrain_eim_state::st2_r )
969869{
970870   /*
971871
r11027r11028
985885   return 0;
986886}
987887
988static READ8_HANDLER( ei_usbs_r )
888READ8_MEMBER( newbrain_eim_state::usbs_r )
989889{
990890   return 0xff;
991891}
992892
993static WRITE8_HANDLER( ei_usbs_w )
893WRITE8_MEMBER( newbrain_eim_state::usbs_w )
994894{
995895}
996896
997static WRITE8_HANDLER( ei_paging_w )
897WRITE8_MEMBER( newbrain_eim_state::paging_w )
998898{
999   newbrain_state *state = space->machine().driver_data<newbrain_state>();
1000
1001899   if (BIT(offset, 8))
1002900   {
1003901      // expansion interface module
r11027r11028
1017915
1018916        */
1019917
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);
1023921   }
1024922   else if (BIT(offset, 9))
1025923   {
r11027r11028
1040938
1041939        */
1042940
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);
1044942
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);
1049947   }
1050948   else if (BIT(offset, 10))
1051949   {
r11027r11028
1059957{
1060958   newbrain_state *state = device->machine().driver_data<newbrain_state>();
1061959
1062   state->anint = level;
960   state->m_anint = level;
1063961}
1064962
1065963static ADC080X_VREF_POSITIVE_READ( newbrain_adc_vref_pos_r )
r11027r11028
1087985
1088986/* Memory Maps */
1089987
1090static ADDRESS_MAP_START( newbrain_map, AS_PROGRAM, 8 )
988static ADDRESS_MAP_START( newbrain_map, AS_PROGRAM, 8, newbrain_state )
1091989   ADDRESS_MAP_UNMAP_HIGH
1092990   AM_RANGE(0x0000, 0x1fff) AM_RAMBANK("bank1")
1093991   AM_RANGE(0x2000, 0x3fff) AM_RAMBANK("bank2")
r11027r11028
1099997   AM_RANGE(0xe000, 0xffff) AM_RAMBANK("bank8")
1100998ADDRESS_MAP_END
1101999
1102static ADDRESS_MAP_START( newbrain_ei_io_map, AS_IO, 8 )
1000static ADDRESS_MAP_START( newbrain_ei_io_map, AS_IO, 8, newbrain_eim_state )
11031001   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)
11231021ADDRESS_MAP_END
11241022
1125static ADDRESS_MAP_START( newbrain_a_io_map, AS_IO, 8 )
1023static ADDRESS_MAP_START( newbrain_a_io_map, AS_IO, 8, newbrain_state )
11261024   ADDRESS_MAP_UNMAP_HIGH
11271025   AM_RANGE(0x00, 0x00) AM_MIRROR(0xffc0) AM_READWRITE(clusr_r, clusr_w)
11281026   AM_RANGE(0x03, 0x03) AM_MIRROR(0xffc0) AM_WRITE(user_w)
r11027r11028
11351033   AM_RANGE(0x16, 0x16) AM_MIRROR(0xffc0) AM_READ(user_r)
11361034ADDRESS_MAP_END
11371035
1138static 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)
1036static 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)
11451043   AM_RANGE(COP400_PORT_CKO, COP400_PORT_CKO) AM_READNOP
11461044ADDRESS_MAP_END
11471045
1148static ADDRESS_MAP_START( newbrain_fdc_map, AS_PROGRAM, 8 )
1046static ADDRESS_MAP_START( newbrain_fdc_map, AS_PROGRAM, 8, newbrain_eim_state )
11491047   ADDRESS_MAP_UNMAP_HIGH
11501048   AM_RANGE(0x0000, 0x1fff) AM_ROM
11511049ADDRESS_MAP_END
11521050
1153static ADDRESS_MAP_START( newbrain_fdc_io_map, AS_IO, 8 )
1051static ADDRESS_MAP_START( newbrain_fdc_io_map, AS_IO, 8, newbrain_eim_state )
11541052   ADDRESS_MAP_UNMAP_HIGH
11551053   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)
11581056   AM_RANGE(0x20, 0x20) AM_WRITE(fdc_auxiliary_w)
11591057   AM_RANGE(0x40, 0x40) AM_READ(fdc_control_r)
11601058ADDRESS_MAP_END
r11027r11028
12611159
12621160/* Machine Initialization */
12631161
1264static READ_LINE_DEVICE_HANDLER( acia_rx )
1162READ_LINE_MEMBER( newbrain_eim_state::acia_rx )
12651163{
1266   newbrain_state *driver_state = device->machine().driver_data<newbrain_state>();
1267
1268   return driver_state->acia_rxd;
1164   return m_acia_rxd;
12691165}
12701166
1271static WRITE_LINE_DEVICE_HANDLER( acia_tx )
1167WRITE_LINE_MEMBER( newbrain_eim_state::acia_tx )
12721168{
1273   newbrain_state *driver_state = device->machine().driver_data<newbrain_state>();
1274
1275   driver_state->acia_txd = state;
1169   m_acia_txd = state;
12761170}
12771171
1278static WRITE_LINE_DEVICE_HANDLER( acia_interrupt )
1172WRITE_LINE_MEMBER( newbrain_eim_state::acia_interrupt )
12791173{
1280   newbrain_state *driver_state = device->machine().driver_data<newbrain_state>();
1281
1282   driver_state->aciaint = state;
1174   m_aciaint = state;
12831175}
12841176
12851177static ACIA6850_INTERFACE( newbrain_acia_intf )
12861178{
12871179   0,
12881180   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),
12911183   DEVCB_NULL,
12921184   DEVCB_NULL,
12931185   DEVCB_NULL,
1294   DEVCB_LINE(acia_interrupt)
1186   DEVCB_DRIVER_LINE_MEMBER(newbrain_eim_state, acia_interrupt)
12951187};
12961188
1297static WRITE_LINE_DEVICE_HANDLER( newbrain_fdc_interrupt )
1189WRITE_LINE_MEMBER( newbrain_eim_state::fdc_interrupt )
12981190{
1299   newbrain_state *driver_state = device->machine().driver_data<newbrain_state>();
1300
1301   driver_state->fdc_int = state;
1191   m_fdc_int = state;
13021192}
13031193
13041194static const upd765_interface newbrain_upd765_interface =
13051195{
1306   DEVCB_LINE(newbrain_fdc_interrupt),
1196   DEVCB_DRIVER_LINE_MEMBER(newbrain_eim_state, fdc_interrupt),
13071197   DEVCB_NULL,
13081198   NULL,
13091199   UPD765_RDY_PIN_NOT_CONNECTED,
13101200   {FLOPPY_0,FLOPPY_1, NULL, NULL}
13111201};
13121202
1313static WRITE_LINE_DEVICE_HANDLER( ctc_z0_w )
1203WRITE_LINE_MEMBER( newbrain_eim_state::ctc_z0_w )
13141204{
1315   newbrain_state *driver_state = device->machine().driver_data<newbrain_state>();
1316
13171205   /* 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);
13191207}
13201208
1321static WRITE_LINE_DEVICE_HANDLER( ctc_z1_w )
1209WRITE_LINE_MEMBER( newbrain_eim_state::ctc_z1_w )
13221210{
1323   newbrain_state *driver_state = device->machine().driver_data<newbrain_state>();
1324
13251211   /* 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);
13271213}
13281214
1329static WRITE_LINE_DEVICE_HANDLER( ctc_z2_w )
1215WRITE_LINE_MEMBER( newbrain_eim_state::ctc_z2_w )
13301216{
1331   newbrain_state *driver_state = device->machine().driver_data<newbrain_state>();
1332
13331217   /* 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);
13361220}
13371221
13381222static Z80CTC_INTERFACE( newbrain_ctc_intf )
13391223{
13401224   0,                    /* timer disables */
13411225   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 */
13451229};
13461230
13471231static TIMER_DEVICE_CALLBACK( ctc_c2_tick )
13481232{
1349   newbrain_state *state = timer.machine().driver_data<newbrain_state>();
1233   newbrain_eim_state *state = timer.machine().driver_data<newbrain_eim_state>();
13501234
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);
13531237}
13541238
1355INLINE int get_reset_t(void)
1239inline int newbrain_state::get_reset_t()
13561240{
13571241   return RES_K(220) * CAP_U(10) * 1000; // t = R128 * C125 = 2.2s
13581242}
13591243
13601244static TIMER_CALLBACK( reset_tick )
13611245{
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);
13641250}
13651251
1366INLINE int get_pwrup_t(void)
1252inline int newbrain_state::get_pwrup_t()
13671253{
13681254   return RES_K(560) * CAP_U(10) * 1000; // t = R129 * C127 = 5.6s
13691255}
r11027r11028
13721258{
13731259   newbrain_state *state = machine.driver_data<newbrain_state>();
13741260
1375   state->pwrup = 0;
1376   newbrain_a_bankswitch(machine);
1261   state->m_pwrup = 0;
1262   state->bankswitch();
13771263}
13781264
1379static MACHINE_START( newbrain )
1265void newbrain_state::machine_start()
13801266{
1381   newbrain_state *state = machine.driver_data<newbrain_state>();
1267   m_copregint = 1;
13821268
1383   state->copregint = 1;
1384
1385   /* find devices */
1386   state->cassette1 = machine.device(CASSETTE1_TAG);
1387   state->cassette2 = machine.device(CASSETTE2_TAG);
1388
13891269   /* 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()));
13921272
13931273   /* 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()));
13961276
13971277   /* 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;
14061286
14071287   /* set up memory banking */
1408   newbrain_a_bankswitch(machine);
1288   bankswitch();
14091289
14101290   /* 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));
14371311}
14381312
1439static MACHINE_START( newbrain_eim )
1313void newbrain_eim_state::machine_start()
14401314{
1441   newbrain_state *state = machine.driver_data<newbrain_state>();
1315   newbrain_state::machine_start();
14421316
1443   MACHINE_START_CALL(newbrain);
1444
14451317   /* 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);
14471319
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
14531320   /* 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));
14551328}
14561329
1457static MACHINE_RESET( newbrain )
1330void newbrain_state::machine_reset()
14581331{
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()));
14651333}
14661334
14671335static INTERRUPT_GEN( newbrain_interrupt )
14681336{
14691337   newbrain_state *state = device->machine().driver_data<newbrain_state>();
14701338
1471   if (!(state->enrg1 & NEWBRAIN_ENRG1_CLK))
1339   if (!(state->m_enrg1 & NEWBRAIN_ENRG1_CLK))
14721340   {
1473      state->clkint = 0;
1474      check_interrupt(device->machine());
1341      state->m_clkint = 0;
1342      state->check_interrupt();
14751343   }
14761344}
14771345
r11027r11028
15111379GFXDECODE_END
15121380
15131381static MACHINE_CONFIG_START( newbrain_a, newbrain_state )
1514   /* basic system hardware */
1382   // basic system hardware
15151383   MCFG_CPU_ADD(Z80_TAG, Z80, XTAL_16MHz/8)
15161384   MCFG_CPU_PROGRAM_MAP(newbrain_map)
15171385   MCFG_CPU_IO_MAP(newbrain_a_io_map)
r11027r11028
15251393
15261394   MCFG_TIMER_ADD_PERIODIC("cop_regint", cop_regint_tick, attotime::from_usec(12500)) // HACK
15271395
1528   MCFG_MACHINE_START(newbrain)
1529   MCFG_MACHINE_RESET(newbrain)
1530
1531   /* video hardware */
1532   MCFG_DEFAULT_LAYOUT(layout_newbrain)
1396   // video hardware
15331397   MCFG_FRAGMENT_ADD(newbrain_video)
15341398
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)
15381402
1539   /* internal ram */
1403   // internal ram
15401404   MCFG_RAM_ADD(RAM_TAG)
15411405   MCFG_RAM_DEFAULT_SIZE("32K")
15421406MACHINE_CONFIG_END
r11027r11028
15521416   DEVCB_NULL,
15531417   DEVCB_NULL,
15541418   DEVCB_NULL,
1555   FLOPPY_STANDARD_5_25_DSHD,
1419   FLOPPY_STANDARD_5_25_DSDD,
15561420   FLOPPY_OPTIONS_NAME(newbrain),
15571421   NULL
15581422};
15591423
1560static MACHINE_CONFIG_DERIVED( newbrain_eim, newbrain_a )
1561
1562   /* basic system hardware */
1424static MACHINE_CONFIG_DERIVED_CLASS( newbrain_eim, newbrain_a, newbrain_eim_state )
1425   // basic system hardware
15631426   MCFG_CPU_MODIFY(Z80_TAG)
15641427   MCFG_CPU_IO_MAP(newbrain_ei_io_map)
15651428
r11027r11028
15671430   MCFG_CPU_PROGRAM_MAP(newbrain_fdc_map)
15681431   MCFG_CPU_IO_MAP(newbrain_fdc_io_map)
15691432
1570   MCFG_MACHINE_START(newbrain_eim)
1571
1572   /* Z80 CTC */
1433   // devices
15731434   MCFG_Z80CTC_ADD(Z80CTC_TAG, XTAL_16MHz/8, newbrain_ctc_intf)
15741435   MCFG_TIMER_ADD_PERIODIC("z80ctc_c2", ctc_c2_tick, attotime::from_hz(XTAL_16MHz/4/13))
1575
1576   /* AD-DA converters */
15771436   MCFG_ADC0809_ADD(ADC0809_TAG, 500000, newbrain_adc0809_intf)
1578
1579   /* MC6850 */
15801437   MCFG_ACIA6850_ADD(MC6850_TAG, newbrain_acia_intf)
1581
1582   /* UPD765 */
15831438   MCFG_UPD765A_ADD(UPD765_TAG, newbrain_upd765_interface)
1584
15851439   MCFG_FLOPPY_2_DRIVES_ADD(newbrain_floppy_config)
15861440
1587   /* internal ram */
1441   // internal ram
15881442   MCFG_RAM_MODIFY(RAM_TAG)
15891443   MCFG_RAM_DEFAULT_SIZE("96K")
15901444MACHINE_CONFIG_END
r11027r11028
16221476   ROM_REGION( 0x400, COP420_TAG, 0 )
16231477   ROM_LOAD( "cop420.419", 0x000, 0x400, NO_DUMP )
16241478
1625   ROM_REGION( 0x1000, "chargen", 0 )   /* The missing part of this rom should be filled with zeroes */
1479   ROM_REGION( 0x1000, "chargen", ROMREGION_ERASE00 )
16261480   ROM_LOAD( "char eprom iss 1.ic453", 0x0000, 0x0a01, BAD_DUMP CRC(46ecbc65) SHA1(3fe064d49a4de5e3b7383752e98ad35a674e26dd) ) // 8248R7
16271481ROM_END
16281482
1629#define rom_newbraia rom_newbrain
1483#define rom_newbraina rom_newbrain
16301484
1631ROM_START( newbraie )
1485ROM_START( newbraineim )
16321486   ROM_REGION( 0x10000, Z80_TAG, 0 )
16331487   ROM_DEFAULT_BIOS( "rom20" )
16341488
r11027r11028
16741528   ROM_LOAD( "d417-2.rom", 0x0000, 0x2000, CRC(e8bda8b9) SHA1(c85a76a5ff7054f4ef4a472ce99ebaed1abd269c) )
16751529ROM_END
16761530
1677ROM_START( newbraim )
1531ROM_START( newbrainmd )
16781532   ROM_REGION( 0x10000, Z80_TAG, 0 )
16791533   ROM_LOAD( "cdmd.rom", 0xc000, 0x2000, CRC(6b4d9429) SHA1(ef688be4e75aced61f487c928258c8932a0ae00a) )
16801534   ROM_LOAD( "efmd.rom", 0xe000, 0x2000, CRC(20dd0b49) SHA1(74b517ca223cefb588e9f49e72ff2d4f1627efc6) )
r11027r11028
16901544
16911545//    YEAR  NAME        PARENT      COMPAT  MACHINE         INPUT       INIT    COMPANY                         FULLNAME        FLAGS
16921546COMP( 1981, newbrain,   0,          0,      newbrain_a,     newbrain,   0,      "Grundy Business Systems Ltd",   "NewBrain AD",   GAME_NOT_WORKING | GAME_NO_SOUND)
1693COMP( 1981, newbraie,   newbrain,   0,      newbrain_eim,   newbrain,   0,      "Grundy Business Systems Ltd",   "NewBrain AD with Expansion Interface",   GAME_NOT_WORKING | GAME_NO_SOUND )
1694COMP( 1981, newbraia,   newbrain,   0,      newbrain_a,     newbrain,   0,      "Grundy Business Systems Ltd",   "NewBrain A",   GAME_NOT_WORKING | GAME_NO_SOUND)
1695COMP( 1981, newbraim,   newbrain,   0,      newbrain_a,     newbrain,   0,      "Grundy Business Systems Ltd",   "NewBrain MD",   GAME_NOT_WORKING | GAME_NO_SOUND )
1547COMP( 1981, newbraineim,newbrain,   0,      newbrain_eim,   newbrain,   0,      "Grundy Business Systems Ltd",   "NewBrain AD with Expansion Interface",   GAME_NOT_WORKING | GAME_NO_SOUND )
1548COMP( 1981, newbraina,   newbrain,   0,      newbrain_a,     newbrain,   0,      "Grundy Business Systems Ltd",   "NewBrain A",   GAME_NOT_WORKING | GAME_NO_SOUND)
1549COMP( 1981, newbrainmd,   newbrain,   0,      newbrain_a,     newbrain,   0,      "Grundy Business Systems Ltd",   "NewBrain MD",   GAME_NOT_WORKING | GAME_NO_SOUND )

Previous 15994 Revisions Next


© 1998-2018 The MESS Team