Previous 15994 Revisions Next

r4570 Monday 27th April, 2009 at 00:47:30 UTC by Fabio Priuli
A few more cpu[n] -> cputag conversions
[src/mess/drivers]bbcbc.c bw2.c coleco.c cpschngr.c crvision.c
[src/mess/machine]b2m.c bbc.c bebox.c bk.c cgenie.c concept.c conkort.c cybiko.c

src/mess/machine/conkort.c
r4569r4570
235235
236236   if (data == 0x2d) // TODO: bit 0 of this is configurable with S1
237237   {
238      const address_space *io = cpu_get_address_space(device->machine->cpu[0], ADDRESS_SPACE_IO);
238      const address_space *io = cputag_get_address_space(device->machine, Z80_TAG, ADDRESS_SPACE_IO);
239239
240240      memory_install_readwrite8_handler(io, ABCBUS_INP, ABCBUS_OUT, 0x18, 0, slow_bus_data_r, slow_bus_data_w);
241241      memory_install_read8_handler(io, ABCBUS_STAT, ABCBUS_STAT, 0x18, 0, slow_bus_stat_r);
r4569r4570
366366
367367   if (data == input_port_read(device->machine, "SW3"))
368368   {
369      const address_space *io = cpu_get_address_space(device->machine->cpu[0], ADDRESS_SPACE_IO);
369      const address_space *io = cputag_get_address_space(device->machine, Z80_TAG, ADDRESS_SPACE_IO);
370370
371371      memory_install_readwrite8_handler(io, ABCBUS_INP, ABCBUS_OUT, 0x18, 0, fast_bus_data_r, fast_bus_data_w);
372372      memory_install_read8_handler(io, ABCBUS_STAT, ABCBUS_STAT, 0x18, 0, fast_bus_stat_r);
src/mess/machine/b2m.c
r4569r4570
6161static void b2m_set_bank(running_machine *machine,int bank)
6262{
6363   UINT8 *rom;
64   const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM);
64   const address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM);
6565   
6666   memory_install_write8_handler(space, 0x0000, 0x27ff, 0, 0, SMH_BANK1);
6767   memory_install_write8_handler(space, 0x2800, 0x2fff, 0, 0, SMH_BANK2);
r4569r4570
283283
284284static PIC8259_SET_INT_LINE( b2m_pic_set_int_line )
285285{     
286   cpu_set_input_line(device->machine->cpu[0],0,interrupt ?  HOLD_LINE : CLEAR_LINE); 
286   cputag_set_input_line(device->machine, "maincpu", 0, interrupt ?  HOLD_LINE : CLEAR_LINE); 
287287}
288288static UINT8 vblank_state = 0;
289289
r4569r4570
346346{   
347347   vblank_state++;
348348   if (vblank_state>1) vblank_state=0;
349   pic8259_set_irq_line((device_config*)devtag_get_device(device->machine, "pic8259"),0,vblank_state);     
349   pic8259_set_irq_line((device_config*)devtag_get_device(device->machine, "pic8259"), 0, vblank_state);     
350350}
351351
352352MACHINE_RESET(b2m)
r4569r4570
356356   b2m_side = 0;
357357   b2m_drive = 0;
358358
359   cpu_set_irq_callback(machine->cpu[0], b2m_irq_callback);
360   b2m_set_bank(machine,7);
359   cpu_set_irq_callback(cputag_get_cpu(machine, "maincpu"), b2m_irq_callback);
360   b2m_set_bank(machine, 7);
361361}
362362
363363DEVICE_IMAGE_LOAD( b2m_floppy )
src/mess/machine/bk.c
r4569r4570
6262         {
6363            key_irq_vector = 0xBC;
6464         }
65         cpu_set_input_line(machine->cpu[0], 0, ASSERT_LINE);
65         cputag_set_input_line(machine, "maincpu", 0, ASSERT_LINE);
6666         break;
6767      }
6868   }
r4569r4570
8282
8383MACHINE_RESET( bk0010 )
8484{
85   cpu_set_irq_callback(machine->cpu[0], bk0010_irq_callback);
85   cpu_set_irq_callback(cputag_get_cpu(machine, "maincpu"), bk0010_irq_callback);
8686   timer_pulse(machine, ATTOTIME_IN_HZ(2400), NULL, 0, keyboard_callback);
8787
8888   kbd_state = 0;
8989   bk_scrool = 01330;
9090}
9191
92READ16_HANDLER (bk_key_state_r) {     
92READ16_HANDLER (bk_key_state_r)
93{     
9394   return kbd_state;
9495}
95READ16_HANDLER (bk_key_code_r) {
96READ16_HANDLER (bk_key_code_r)
97{
9698   kbd_state &= ~0x80; // mark reading done
9799   key_pressed = 0;
98100   return key_code;
99101}
100READ16_HANDLER (bk_vid_scrool_r) {
102READ16_HANDLER (bk_vid_scrool_r)
103{
101104   return bk_scrool;
102105}
103106
104READ16_HANDLER (bk_key_press_r) {
107READ16_HANDLER (bk_key_press_r)
108{
105109   double level = cassette_input(devtag_get_device(space->machine, "cassette"));                                               
106110   UINT16 cas;
107   if (level < 0) {
111   if (level < 0)
112   {
108113       cas = 0x00;
109    } else {
114    }
115   else
116   {
110117      cas = 0x20;
111118   }
112119
113120   return 0x8080 | key_pressed | cas;
114121}
115122
116WRITE16_HANDLER(bk_key_state_w) {
123WRITE16_HANDLER(bk_key_state_w)
124{
117125   kbd_state = (kbd_state & ~0x40) | (data & 0x40);
118126}
119WRITE16_HANDLER(bk_vid_scrool_w) {
127
128WRITE16_HANDLER(bk_vid_scrool_w)
129{
120130   bk_scrool = data;
121131}
122132
123WRITE16_HANDLER(bk_key_press_w) {
133WRITE16_HANDLER(bk_key_press_w)
134{
124135}
125136
126137READ16_HANDLER (bk_floppy_cmd_r)
r4569r4570
130141
131142WRITE16_HANDLER(bk_floppy_cmd_w)
132143{
133   if ((data & 1)==1) {
144   if ((data & 1) == 1)
145   {
134146      bk_drive = 0;
135147   }
136   if ((data & 2)==2) {
148   if ((data & 2) == 2)
149   {
137150      bk_drive = 1;
138151   }
139   if ((data & 4)==4) {
152   if ((data & 4) == 4)
153   {
140154      bk_drive = 2;
141155   }
142   if ((data & 8)==8) {
156   if ((data & 8) == 8)
157   {
143158      bk_drive = 3;
144159   }
145   if (data==0) {
160   if (data == 0)
161   {
146162      bk_drive = -1;
147163   }
148164}
src/mess/machine/concept.c
r4569r4570
150150
151151   if (final_level)
152152      /* assert interrupt */
153      cpu_set_input_line_and_vector(machine->cpu[0], M68K_IRQ_1+final_level-1, ASSERT_LINE, M68K_INT_ACK_AUTOVECTOR);
153      cputag_set_input_line_and_vector(machine, "maincpu", M68K_IRQ_1 + final_level - 1, ASSERT_LINE, M68K_INT_ACK_AUTOVECTOR);
154154   else
155155      /* clear all interrupts */
156      cpu_set_input_line_and_vector(machine->cpu[0], M68K_IRQ_1, CLEAR_LINE, M68K_INT_ACK_AUTOVECTOR);
156      cputag_set_input_line_and_vector(machine, "maincpu", M68K_IRQ_1, CLEAR_LINE, M68K_INT_ACK_AUTOVECTOR);
157157}
158158
159159INLINE void post_in_KeyQueue(int keycode)
src/mess/machine/cgenie.c
r4569r4570
9595
9696MACHINE_RESET( cgenie )
9797{
98   const address_space *space = cpu_get_address_space( machine->cpu[0], ADDRESS_SPACE_PROGRAM );
98   const address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM);
9999   const device_config *ay8910 = devtag_get_device(machine, "ay8910");
100100   UINT8 *ROM = memory_region(machine, "maincpu");
101101
r4569r4570
177177
178178MACHINE_START( cgenie )
179179{
180   const address_space *space = cpu_get_address_space( machine->cpu[0], ADDRESS_SPACE_PROGRAM );
180   const address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM);
181181   UINT8 *gfx = memory_region(machine, "gfx2");
182182   int i;
183183
r4569r4570
560560   if( (irq_status & IRQ_TIMER) == 0 )
561561   {
562562      irq_status |= IRQ_TIMER;
563      cpu_set_input_line(device->machine->cpu[0], 0, HOLD_LINE);
563      cputag_set_input_line(device->machine, "maincpu", 0, HOLD_LINE);
564564   }
565565}
566566
r4569r4570
579579         if( (irq_status & IRQ_FDC) == 0 )
580580         {
581581            irq_status |= IRQ_FDC;
582            cpu_set_input_line(device->machine->cpu[0], 0, HOLD_LINE);
582            cputag_set_input_line(device->machine, "maincpu", 0, HOLD_LINE);
583583         }
584584         break;
585585      case WD17XX_DRQ_CLR:
r4569r4570
730730      cgenie_tv_mode = input_port_read(device->machine, "DSW0") & 0x10;
731731      /* force setting of background color */
732732      port_ff ^= FF_BGD0;
733      cgenie_port_ff_w(cpu_get_address_space(device->machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0, port_ff ^ FF_BGD0);
733      cgenie_port_ff_w(cputag_get_address_space(device->machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0, port_ff ^ FF_BGD0);
734734   }
735735}
src/mess/machine/bebox.c
r4569r4570
195195   result = bebox_crossproc_interrupts;
196196
197197   /* return a different result depending on which CPU is accessing this handler */
198   if (space != cpu_get_address_space(space->machine->cpu[0], ADDRESS_SPACE_PROGRAM))
198   if (space != cputag_get_address_space(space->machine, "ppc1", ADDRESS_SPACE_PROGRAM))
199199      result |= 0x02000000;
200200   else
201201      result &= ~0x02000000;
r4569r4570
220220   };
221221   int i, line;
222222   UINT32 old_crossproc_interrupts = bebox_crossproc_interrupts;
223   static const char *const cputags[] = { "ppc1", "ppc2" };
223224
224225   bebox_mbreg32_w(&bebox_crossproc_interrupts, data, mem_mask);
225226
r4569r4570
241242               */
242243         }
243244
244         cpu_set_input_line(space->machine->cpu[crossproc_map[i].cpunum], crossproc_map[i].inputline, line);
245         cputag_set_input_line(space->machine, cputags[crossproc_map[i].cpunum], crossproc_map[i].inputline, line);
245246      }
246247   }
247248}
r4569r4570
252253
253254   if (b & 0x20)
254255   {
255      cpu_set_input_line( space->machine->cpu[1], INPUT_LINE_RESET, (b & 0x80) ? CLEAR_LINE : ASSERT_LINE);
256      cputag_set_input_line(space->machine, "ppc2", INPUT_LINE_RESET, (b & 0x80) ? CLEAR_LINE : ASSERT_LINE);
256257   }
257258}
258259
r4569r4570
261262{
262263   int cpunum;
263264   UINT32 interrupt;
265   static const char *const cputags[] = { "ppc1", "ppc2" };
264266
265267   for (cpunum = 0; cpunum < 2; cpunum++)
266268   {
r4569r4570
272274            bebox_interrupts, bebox_cpu_imask[cpunum], interrupt ? "on" : "off");
273275      }
274276
275      cpu_set_input_line(machine->cpu[cpunum], INPUT_LINE_IRQ0, interrupt ? ASSERT_LINE : CLEAR_LINE);
277      cputag_set_input_line(machine, cputags[cpunum], INPUT_LINE_IRQ0, interrupt ? ASSERT_LINE : CLEAR_LINE);
276278   }
277279}
278280
r4569r4570
322324      assert_always((interrupt_bit < ARRAY_LENGTH(interrupt_names)) && (interrupt_names[interrupt_bit] != NULL), "Raising invalid interrupt");
323325
324326      logerror("bebox_set_irq_bit(): pc[0]=0x%08x pc[1]=0x%08x %s interrupt #%u (%s)\n",
325         (unsigned) cpu_get_reg( machine->cpu[0], REG_GENPC),
326         (unsigned) cpu_get_reg( machine->cpu[1], REG_GENPC),
327         (unsigned) cpu_get_reg(cputag_get_cpu(machine, "ppc1"), REG_GENPC),
328         (unsigned) cpu_get_reg(cputag_get_cpu(machine, "ppc2"), REG_GENPC),
327329         val ? "Asserting" : "Clearing",
328330         interrupt_bit, interrupt_names[interrupt_bit]);
329331   }
r4569r4570
586588
587589static void bebox_map_vga_memory(running_machine *machine, offs_t begin, offs_t end, read8_space_func rh, write8_space_func wh)
588590{
589   const address_space *space = cpu_get_address_space( machine->cpu[0], ADDRESS_SPACE_PROGRAM );
591   const address_space *space = cputag_get_address_space(machine, "ppc1", ADDRESS_SPACE_PROGRAM);
590592
591593   read64_space_func rh64 = (rh == SMH_BANK4) ? SMH_BANK4 : bebox_vga_memory_r;
592594   write64_space_func wh64 = (wh == SMH_BANK4) ? SMH_BANK4 : bebox_vga_memory_w;
r4569r4570
722724
723725static DMA8237_MEM_READ( bebox_dma_read_byte )
724726{
725   const address_space *space = cpu_get_address_space( device->machine->cpu[0], ADDRESS_SPACE_PROGRAM );
727   const address_space *space = cputag_get_address_space(device->machine, "ppc1", ADDRESS_SPACE_PROGRAM);
726728   offs_t page_offset = (((offs_t) dma_offset[0][channel]) << 16)
727729      & 0x7FFF0000;
728730   return memory_read_byte(space, page_offset + offset);
r4569r4570
731733
732734static DMA8237_MEM_WRITE( bebox_dma_write_byte )
733735{
734   const address_space *space = cpu_get_address_space( device->machine->cpu[0], ADDRESS_SPACE_PROGRAM );
736   const address_space *space = cputag_get_address_space(device->machine, "ppc1", ADDRESS_SPACE_PROGRAM);
735737   offs_t page_offset = (((offs_t) dma_offset[0][channel]) << 16)
736738      & 0x7FFF0000;
737739   memory_write_byte(space, page_offset + offset, data);
r4569r4570
952954static UINT32 scsi53c810_fetch(running_machine *machine, UINT32 dsp)
953955{
954956   UINT32 result;
955   result = memory_read_dword_64be( cpu_get_address_space( machine->cpu[0], ADDRESS_SPACE_PROGRAM ), dsp & 0x7FFFFFFF);
957   result = memory_read_dword_64be(cputag_get_address_space(machine, "ppc1", ADDRESS_SPACE_PROGRAM), dsp & 0x7FFFFFFF);
956958   return BYTE_REVERSE32(result);
957959}
958960
r4569r4570
10181020               /* brutal ugly hack; at some point the PCI code should be handling this stuff */
10191021               if (scsi53c810_data[5] != 0xFFFFFFF0)
10201022               {
1021                  const address_space *space = cpu_get_address_space( device->machine->cpu[0], ADDRESS_SPACE_PROGRAM );
1023                  const address_space *space = cputag_get_address_space(device->machine, "ppc1", ADDRESS_SPACE_PROGRAM);
10221024
10231025                  addr = (scsi53c810_data[5] | 0xC0000000) & ~0xFF;
10241026                  memory_install_read64_handler(space, addr, addr + 0xFF, 0, 0, scsi53c810_r);
r4569r4570
10771079
10781080   timer_set(machine,  attotime_zero, NULL, 0, bebox_get_devices );
10791081
1080   cpu_set_input_line(machine->cpu[0], INPUT_LINE_RESET, CLEAR_LINE);
1081   cpu_set_input_line(machine->cpu[1], INPUT_LINE_RESET, ASSERT_LINE);
1082   cputag_set_input_line(machine, "ppc1", INPUT_LINE_RESET, CLEAR_LINE);
1083   cputag_set_input_line(machine, "ppc2", INPUT_LINE_RESET, ASSERT_LINE);
10821084}
10831085
10841086static void bebox_exit(running_machine *machine)
r4569r4570
10961098
10971099DRIVER_INIT( bebox )
10981100{
1099   const address_space *space_0 = cpu_get_address_space( machine->cpu[0], ADDRESS_SPACE_PROGRAM );
1100   const address_space *space_1 = cpu_get_address_space( machine->cpu[1], ADDRESS_SPACE_PROGRAM );
1101   const address_space *space_0 = cputag_get_address_space(machine, "ppc1", ADDRESS_SPACE_PROGRAM);
1102   const address_space *space_1 = cputag_get_address_space(machine, "ppc2", ADDRESS_SPACE_PROGRAM);
11011103   offs_t vram_begin;
11021104   offs_t vram_end;
11031105
src/mess/machine/cybiko.c
r4569r4570
8181
8282static void init_ram_handler(running_machine *machine, offs_t start, offs_t size, offs_t mirror)
8383{
84   memory_install_read_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), start, start + size - 1, 0, mirror - size, STATIC_BANK1);
85   memory_install_write_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), start, start + size - 1, 0, mirror - size, STATIC_BANK1);
84   memory_install_read_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), start, start + size - 1, 0, mirror - size, STATIC_BANK1);
85   memory_install_write_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), start, start + size - 1, 0, mirror - size, STATIC_BANK1);
8686   memory_set_bankptr( machine, 1, mess_ram);
8787}
8888
src/mess/machine/bbc.c
r4569r4570
8585   bbc_rombank=data&0x0f;
8686   if (bbc_rombank!=1)
8787   {
88      memory_set_bankptr(space->machine, 4,memory_region(space->machine, "user1")+(bbc_rombank<<14));
89   } else {
90      memory_set_bankptr(space->machine, 4,memory_region(space->machine, "user2")+((bbc_DFSType)<<14));
88      memory_set_bankptr(space->machine, 4, memory_region(space->machine, "user1") + (bbc_rombank << 14));
89   }
90   else
91   {
92      memory_set_bankptr(space->machine, 4, memory_region(space->machine, "user2") + ((bbc_DFSType) << 14));
9193   }
9294}
9395
9496
9597WRITE8_HANDLER ( bbc_memoryb3_w )
9698{
97   if (bbc_RAMSize) {
98      memory_region(space->machine, "maincpu")[offset+0x4000]=data;
99   if (bbc_RAMSize)
100   {
101      memory_region(space->machine, "maincpu")[offset + 0x4000] = data;
99102      // this array is set so that the video emulator know which addresses to redraw
100      bbc_vidmem[offset+0x4000]=1;
101   } else {
102      memory_region(space->machine, "maincpu")[offset]=data;
103      bbc_vidmem[offset]=1;
103      bbc_vidmem[offset + 0x4000] = 1;
104   }
105   else
106   {
107      memory_region(space->machine, "maincpu")[offset] = data;
108      bbc_vidmem[offset] = 1;
104109   }
105110
106111}
r4569r4570
117122
118123WRITE8_HANDLER ( bbc_memoryb4_w )
119124{
120   if (bbc_rombank==1)
125   if (bbc_rombank == 1)
121126   {
122127      // special DFS case for Acorn DFS E00 Hack that can write to the DFS RAM Bank;
123      if (bbc_DFSType==3) memory_region(space->machine, "user2")[((bbc_DFSType)<<14)+offset]=data;
128      if (bbc_DFSType == 3) memory_region(space->machine, "user2")[((bbc_DFSType) << 14) + offset] = data;
124129   } else
125130   {
126      switch (bbc_SWRAMtype) {
127         case 1:   if (bbc_SWRAMtype1[bbc_userport]) memory_region(space->machine, "user1")[(bbc_userport<<14)+offset]=data;
128         case 2:   if (bbc_SWRAMtype2[bbc_rombank])  memory_region(space->machine, "user1")[(bbc_rombank<<14)+offset]=data;
129         case 3:   if (bbc_SWRAMtype3[bbc_rombank])  memory_region(space->machine, "user1")[(bbc_rombank<<14)+offset]=data;
131      switch (bbc_SWRAMtype)
132      {
133         case 1:   if (bbc_SWRAMtype1[bbc_userport]) memory_region(space->machine, "user1")[(bbc_userport << 14) + offset] = data;
134         case 2:   if (bbc_SWRAMtype2[bbc_rombank])  memory_region(space->machine, "user1")[(bbc_rombank << 14) + offset] = data;
135         case 3:   if (bbc_SWRAMtype3[bbc_rombank])  memory_region(space->machine, "user1")[(bbc_rombank << 14) + offset] = data;
130136      }
131137   }
132138}
r4569r4570
135141/* BBC B Plus memory handling function */
136142/****************************************/
137143
138static int pagedRAM=0;
139static int vdusel=0;
144static int pagedRAM = 0;
145static int vdusel = 0;
140146
141147/*  this function should return true if
142148   the instruction is in the VDU driver address ranged
r4569r4570
147153static int vdudriverset(running_machine *machine)
148154{
149155   int PC;
150   PC=cpu_get_pc( machine->cpu[0] ); // this needs to be set to the 6502 program counter
151   return (((PC>=0xc000) && (PC<=0xdfff)) || ((pagedRAM) && ((PC>=0xa000) && (PC<=0xafff))));
156   PC = cpu_get_pc(cputag_get_cpu(machine, "maincpu")); // this needs to be set to the 6502 program counter
157   return (((PC >= 0xc000) && (PC <= 0xdfff)) || ((pagedRAM) && ((PC >= 0xa000) && (PC <= 0xafff))));
152158}
153159
154160
r4569r4570
158164{
159165   if ((offset&0x04)==0)
160166   {
161      pagedRAM   =(data>>7)&0x01;
162      bbc_rombank= data    &0x0f;
167      pagedRAM = (data >> 7) & 0x01;
168      bbc_rombank =  data & 0x0f;
163169
164170      if (pagedRAM)
165171      {
166172         /* if paged ram then set 8000 to afff to read from the ram 8000 to afff */
167         memory_set_bankptr(space->machine, 4,memory_region(space->machine, "maincpu")+0x8000);
168      } else {
173         memory_set_bankptr(space->machine, 4, memory_region(space->machine, "maincpu") + 0x8000);
174      }
175      else
176      {
169177         /* if paged rom then set the rom to be read from 8000 to afff */
170         memory_set_bankptr(space->machine, 4,memory_region(space->machine, "user1")+(bbc_rombank<<14));
178         memory_set_bankptr(space->machine, 4, memory_region(space->machine, "user1") + (bbc_rombank << 14));
171179      };
172180
173181      /* set the rom to be read from b000 to bfff */
r4569r4570
213221static DIRECT_UPDATE_HANDLER( bbcbp_direct_handler )
214222{
215223   UINT8 *ram = memory_region(space->machine, "maincpu");
216   if (vdusel==0)
224   if (vdusel == 0)
217225   {
218226      // not in shadow ram mode so just read normal ram
219      memory_set_bankptr(space->machine, 2, ram+0x3000);
220   } else {
227      memory_set_bankptr(space->machine, 2, ram + 0x3000);
228   }
229   else
230   {
221231      if (vdudriverset(space->machine))
222232      {
223233         // if VDUDriver set then read from shadow ram
224         memory_set_bankptr(space->machine, 2, ram+0xb000);
225      } else {
234         memory_set_bankptr(space->machine, 2, ram + 0xb000);
235      }
236      else
237      {
226238         // else read from normal ram
227         memory_set_bankptr(space->machine, 2, ram+0x3000);
239         memory_set_bankptr(space->machine, 2, ram + 0x3000);
228240      }
229241   }
230242   return address;
r4569r4570
237249   if (vdusel==0)
238250   {
239251      // not in shadow ram mode so just write to normal ram
240      ram[offset+0x3000]=data;
241      bbc_vidmem[offset+0x3000]=1;
242   } else {
252      ram[offset + 0x3000] = data;
253      bbc_vidmem[offset + 0x3000] = 1;
254   }
255   else
256   {
243257      if (vdudriverset(space->machine))
244258      {
245259         // if VDUDriver set then write to shadow ram
246         ram[offset+0xb000]=data;
247         bbc_vidmem[offset+0xb000]=1;
248      } else {
260         ram[offset + 0xb000] = data;
261         bbc_vidmem[offset + 0xb000] = 1;
262      }
263      else
264      {
249265         // else write to normal ram
250         ram[offset+0x3000]=data;
251         bbc_vidmem[offset+0x3000]=1;
266         ram[offset + 0x3000] = data;
267         bbc_vidmem[offset + 0x3000] = 1;
252268      }
253269   }
254270}
r4569r4570
388404
389405     if (tempIRR!=ACCCON_IRR)
390406     {
391      cpu_set_input_line(space->machine->cpu[0], M6502_IRQ_LINE, ACCCON_IRR);
407      cputag_set_input_line(space->machine, "maincpu", M6502_IRQ_LINE, ACCCON_IRR);
392408   }
393409
394410   if (ACCCON_Y)
395411   {
396      memory_set_bankptr(space->machine, 7,memory_region(space->machine, "maincpu")+0x9000);
397   } else {
398      memory_set_bankptr(space->machine, 7,memory_region(space->machine, "user1")+0x40000);
412      memory_set_bankptr(space->machine, 7, memory_region(space->machine, "maincpu") + 0x9000);
413   }
414   else
415   {
416      memory_set_bankptr(space->machine, 7, memory_region(space->machine, "user1") + 0x40000);
399417   }
400418
401419   bbcbp_setvideoshadow(space->machine, ACCCON_D);
r4569r4570
404422   if (ACCCON_X)
405423   {
406424      memory_set_bankptr( space->machine, 2, memory_region( space->machine, "maincpu" ) + 0xb000 );
407   } else {
425   }
426   else
427   {
408428      memory_set_bankptr( space->machine, 2, memory_region( space->machine, "maincpu" ) + 0x3000 );
409429   }
410430
r4569r4570
427447static int bbcm_vdudriverset(running_machine *machine)
428448{
429449   int PC;
430   PC=cpu_get_pc( machine->cpu[0] );
431   return ((PC>=0xc000) && (PC<=0xdfff));
450   PC = cpu_get_pc(cputag_get_cpu(machine, "maincpu"));
451   return ((PC >= 0xc000) && (PC <= 0xdfff));
432452}
433453
434454
435455static WRITE8_HANDLER ( page_selectbm_w )
436456{
437   pagedRAM=(data&0x80)>>7;
438   bbc_rombank=data&0x0f;
457   pagedRAM = (data & 0x80) >> 7;
458   bbc_rombank = data & 0x0f;
439459
440460   if (pagedRAM)
441461   {
442      memory_set_bankptr(space->machine, 4,memory_region(space->machine, "maincpu")+0x8000);
462      memory_set_bankptr(space->machine, 4, memory_region(space->machine, "maincpu") + 0x8000);
443463      memory_set_bank(space->machine, 5, bbc_rombank);
444   } else {
445      memory_set_bankptr(space->machine, 4,memory_region(space->machine, "user1")+((bbc_rombank)<<14));
464   }
465   else
466   {
467      memory_set_bankptr(space->machine, 4, memory_region(space->machine, "user1") + ((bbc_rombank) << 14));
446468      memory_set_bank(space->machine, 5, bbc_rombank);
447469   }
448470}
r4569r4570
451473
452474WRITE8_HANDLER ( bbc_memorybm1_w )
453475{
454   memory_region(space->machine, "maincpu")[offset]=data;
455   bbc_vidmem[offset]=1;
476   memory_region(space->machine, "maincpu")[offset] = data;
477   bbc_vidmem[offset] = 1;
456478}
457479
458480
r4569r4570
461483   if (ACCCON_X)
462484   {
463485      memory_set_bankptr( space->machine, 2, memory_region( space->machine, "maincpu" ) + 0xb000 );
464   } else {
486   }
487   else
488   {
465489      if (ACCCON_E && bbcm_vdudriverset(space->machine))
466490      {
467491         memory_set_bankptr( space->machine, 2, memory_region( space->machine, "maincpu" ) + 0xb000 );
468      } else {
492      }
493      else
494      {
469495         memory_set_bankptr( space->machine, 2, memory_region( space->machine, "maincpu" ) + 0x3000 );
470496      }
471497   }
r4569r4570
480506   UINT8 *ram = memory_region(space->machine, "maincpu");
481507   if (ACCCON_X)
482508   {
483      ram[offset+0xb000]=data;
484      bbc_vidmem[offset+0xb000]=1;
485   } else {
509      ram[offset + 0xb000] = data;
510      bbc_vidmem[offset + 0xb000] = 1;
511   }
512   else
513   {
486514      if (ACCCON_E && bbcm_vdudriverset(space->machine))
487515      {
488         ram[offset+0xb000]=data;
489         bbc_vidmem[offset+0xb000]=1;
490      } else {
491         ram[offset+0x3000]=data;
492         bbc_vidmem[offset+0x3000]=1;
516         ram[offset + 0xb000] = data;
517         bbc_vidmem[offset + 0xb000] = 1;
518      }
519      else
520      {
521         ram[offset + 0x3000] = data;
522         bbc_vidmem[offset + 0x3000] = 1;
493523      }
494524   }
495525}
r4569r4570
836866         if ((input_port_read(device->machine, colnames[column]) | 0x01) != 0xff)
837867         {
838868            via_ca2_w(via_0, 0, 1);
839         } else {
869         }
870         else
871         {
840872            via_ca2_w(via_0, 0, 0);
841873         }
842874
843      } else {
875      }
876      else
877      {
844878         via_ca2_w(via_0, 0, 0);
845879      }
846880   }
r4569r4570
919953         {
920954            via_system_porta=mc146818_port_r(space, 1);
921955            //logerror("read 146818 data %d \n",via_system_porta);
922         } else {
923            mc146818_port_w(space, 1,via_system_porta);
956         }
957         else
958         {
959            mc146818_port_w(space, 1, via_system_porta);
924960            //logerror("write 146818 data %d \n",via_system_porta);
925961         }
926962      }
r4569r4570
928964      // if address select is set then set the address in the 146818
929965      if (MC146818_AS)
930966      {
931         mc146818_port_w(space, 0,via_system_porta);
967         mc146818_port_w(space, 0, via_system_porta);
932968         //logerror("write 146818 address %d \n",via_system_porta);
933969      }
934970   }
r4569r4570
937973
938974static WRITE8_DEVICE_HANDLER( bbcb_via_system_write_porta )
939975{
940   const address_space *space = cpu_get_address_space(device->machine->cpu[0], ADDRESS_SPACE_PROGRAM);
976   const address_space *space = cputag_get_address_space(device->machine, "maincpu", ADDRESS_SPACE_PROGRAM);
941977   //logerror("SYSTEM write porta %d\n",data);
942978
943   via_system_porta=data;
944   if (b0_sound==0)
979   via_system_porta = data;
980   if (b0_sound == 0)
945981   {
946982       //logerror("Doing an unsafe write to the sound chip %d \n",data);
947983      sn76496_w(devtag_get_device(device->machine, "sn76489"), 0,via_system_porta);
948984   }
949   if (b3_keyboard==0)
985   if (b3_keyboard == 0)
950986   {
951987       //logerror("Doing an unsafe write to the keyboard %d \n",data);
952      via_system_porta=bbc_keyboard(space, via_system_porta);
988      via_system_porta = bbc_keyboard(space, via_system_porta);
953989   }
954990   if (bbc_Master) MC146818_set(space);
955991}
r4569r4570
957993
958994static WRITE8_DEVICE_HANDLER( bbcb_via_system_write_portb )
959995{
960   const address_space *space = cpu_get_address_space(device->machine->cpu[0], ADDRESS_SPACE_PROGRAM);
961   int bit,value;
962   bit=data & 0x07;
963   value=(data>>3) &0x01;
996   const address_space *space = cputag_get_address_space(device->machine, "maincpu", ADDRESS_SPACE_PROGRAM);
997   int bit, value;
998   bit = data & 0x07;
999   value = (data >> 3) & 0x01;
9641000
9651001
9661002    //logerror("SYSTEM write portb %d %d %d\n",data,bit,value);
9671003
968   if (value) {
969      switch (bit) {
1004   if (value)
1005   {
1006      switch (bit)
1007      {
9701008      case 0:
971         if (b0_sound==0) {
972            b0_sound=1;
1009         if (b0_sound == 0)
1010         {
1011            b0_sound = 1;
9731012         }
9741013         break;
9751014      case 1:
9761015         if (bbc_Master)
9771016         {
978            if (MC146818_WR==0)
1017            if (MC146818_WR == 0)
9791018            {
9801019               /* BBC MASTER has NV RAM Here */
981               MC146818_WR=1;
1020               MC146818_WR = 1;
9821021               MC146818_set(space);
9831022            }
984         } else {
985            if (b1_speech_read==0) {
1023         }
1024         else
1025         {
1026            if (b1_speech_read == 0)
1027            {
9861028               /* VSP TMS 5220 */
987               b1_speech_read=1;
1029               b1_speech_read = 1;
9881030            }
9891031         }
9901032         break;
9911033      case 2:
9921034         if (bbc_Master)
9931035         {
994            if (MC146818_DS==0)
1036            if (MC146818_DS == 0)
9951037            {
9961038               /* BBC MASTER has NV RAM Here */
997               MC146818_DS=1;
1039               MC146818_DS = 1;
9981040               MC146818_set(space);
9991041            }
1000         } else {
1001            if (b2_speech_write==0) {
1042         }
1043         else
1044         {
1045            if (b2_speech_write == 0)
1046            {
10021047               /* VSP TMS 5220 */
1003               b2_speech_write=1;
1048               b2_speech_write = 1;
10041049            }
10051050         }
10061051         break;
10071052      case 3:
1008         if (b3_keyboard==0) {
1009            b3_keyboard=1;
1053         if (b3_keyboard == 0)
1054         {
1055            b3_keyboard = 1;
10101056         }
10111057         break;
10121058      case 4:
1013         if (b4_video0==0) {
1014            b4_video0=1;
1015            bbc_setscreenstart(b4_video0,b5_video1);
1059         if (b4_video0 == 0)
1060         {
1061            b4_video0 = 1;
1062            bbc_setscreenstart(b4_video0, b5_video1);
10161063         }
10171064         break;
10181065      case 5:
1019         if (b5_video1==0) {
1020            b5_video1=1;
1021            bbc_setscreenstart(b4_video0,b5_video1);
1066         if (b5_video1 == 0)
1067         {
1068            b5_video1 = 1;
1069            bbc_setscreenstart(b4_video0, b5_video1);
10221070         }
10231071         break;
10241072      case 6:
1025         if (b6_caps_lock_led==0) {
1026            b6_caps_lock_led=1;
1073         if (b6_caps_lock_led == 0)
1074         {
1075            b6_caps_lock_led = 1;
10271076            /* call caps lock led update */
10281077         }
10291078         break;
10301079      case 7:
1031         if (b7_shift_lock_led==0) {
1032            b7_shift_lock_led=1;
1080         if (b7_shift_lock_led == 0)
1081         {
1082            b7_shift_lock_led = 1;
10331083            /* call shift lock led update */
10341084         }
10351085         break;
1036
1037   }
1038   } else {
1039      switch (bit) {
1086      }
1087   }
1088   else
1089   {
1090      switch (bit)
1091      {
10401092      case 0:
1041         if (b0_sound==1) {
1042            b0_sound=0;
1093         if (b0_sound == 1)
1094         {
1095            b0_sound = 0;
10431096            sn76496_w(devtag_get_device(space->machine, "sn76489"), 0, via_system_porta);
10441097         }
10451098         break;
10461099      case 1:
10471100         if (bbc_Master)
10481101         {
1049            if (MC146818_WR==1)
1102            if (MC146818_WR == 1)
10501103            {
10511104               /* BBC MASTER has NV RAM Here */
1052               MC146818_WR=0;
1105               MC146818_WR = 0;
10531106               MC146818_set(space);
10541107            }
1055         } else {
1056            if (b1_speech_read==1) {
1108         }
1109         else
1110         {
1111            if (b1_speech_read == 1)
1112            {
10571113               /* VSP TMS 5220 */
1058               b1_speech_read=0;
1114               b1_speech_read = 0;
10591115            }
10601116         }
10611117         break;
10621118      case 2:
10631119         if (bbc_Master)
10641120         {
1065            if (MC146818_DS==1)
1121            if (MC146818_DS == 1)
10661122            {
10671123               /* BBC MASTER has NV RAM Here */
1068               MC146818_DS=0;
1124               MC146818_DS = 0;
10691125               MC146818_set(space);
10701126            }
1071         } else {
1072            if (b2_speech_write==1) {
1127         }
1128         else
1129         {
1130            if (b2_speech_write == 1)
1131            {
10731132               /* VSP TMS 5220 */
1074               b2_speech_write=0;
1133               b2_speech_write = 0;
10751134            }
10761135         }
10771136         break;
10781137      case 3:
1079         if (b3_keyboard==1) {
1080            b3_keyboard=0;
1138         if (b3_keyboard == 1)
1139         {
1140            b3_keyboard = 0;
10811141            /* *** call keyboard enabled *** */
10821142            via_system_porta=bbc_keyboard(space, via_system_porta);
10831143         }
10841144         break;
10851145      case 4:
1086         if (b4_video0==1) {
1087            b4_video0=0;
1088            bbc_setscreenstart(b4_video0,b5_video1);
1146         if (b4_video0 == 1)
1147         {
1148            b4_video0 = 0;
1149            bbc_setscreenstart(b4_video0, b5_video1);
10891150         }
10901151         break;
10911152      case 5:
1092         if (b5_video1==1) {
1093            b5_video1=0;
1094            bbc_setscreenstart(b4_video0,b5_video1);
1153         if (b5_video1 == 1)
1154         {
1155            b5_video1 = 0;
1156            bbc_setscreenstart(b4_video0, b5_video1);
10951157         }
10961158         break;
10971159      case 6:
1098         if (b6_caps_lock_led==1) {
1099            b6_caps_lock_led=0;
1160         if (b6_caps_lock_led == 1)
1161         {
1162            b6_caps_lock_led = 0;
11001163            /* call caps lock led update */
11011164         }
11021165         break;
11031166      case 7:
1104         if (b7_shift_lock_led==1) {
1105            b7_shift_lock_led=0;
1167         if (b7_shift_lock_led == 1)
1168         {
1169            b7_shift_lock_led = 0;
11061170            /* call shift lock led update */
11071171         }
11081172         break;
r4569r4570
13731437{
13741438   if (status)
13751439   {
1376      cassette_change_state(devtag_get_device(machine, "cassette"),CASSETTE_MOTOR_ENABLED ,CASSETTE_MASK_MOTOR);
1440      cassette_change_state(devtag_get_device(machine, "cassette"), CASSETTE_MOTOR_ENABLED, CASSETTE_MASK_MOTOR);
13771441      timer_adjust_periodic(bbc_tape_timer, attotime_zero, 0, ATTOTIME_IN_HZ(44100));
1378   } else {
1379      cassette_change_state(devtag_get_device(machine, "cassette"),CASSETTE_MOTOR_DISABLED,CASSETTE_MASK_MOTOR);
1442   }
1443   else
1444   {
1445      cassette_change_state(devtag_get_device(machine, "cassette"), CASSETTE_MOTOR_DISABLED, CASSETTE_MASK_MOTOR);
13801446      timer_reset(bbc_tape_timer, attotime_never);
1381      len0=0;
1382      len1=0;
1383      len2=0;
1384      len3=0;
1385      wav_len=0;
1447      len0 = 0;
1448      len1 = 0;
1449      len2 = 0;
1450      len3 = 0;
1451      wav_len = 0;
13861452   }
13871453}
13881454
r4569r4570
16021668      {
16031669         /* I'll pulse it because if I used hold-line I'm not sure
16041670         it would clear - to be checked */
1605         cpu_set_input_line(device->machine->cpu[0], INPUT_LINE_NMI,PULSE_LINE);
1671         cputag_set_input_line(device->machine, "maincpu", INPUT_LINE_NMI,PULSE_LINE);
16061672      }
16071673   }
16081674
r4569r4570
17841850               return wd17xx_data_r(fdc, 0);
17851851         }
17861852
1787      } else {
1788         return memory_region(space->machine, "disks")[offset+(opusbank<<8)];
1853      }
1854      else
1855      {
1856         return memory_region(space->machine, "disks")[offset + (opusbank << 8)];
17891857      }
17901858   }
17911859   return 0xff;
r4569r4570
18241892               opusbank=(opusbank & 0xff00) | data;
18251893               break;
18261894         }
1827      } else {
1828         memory_region(space->machine, "disks")[offset+(opusbank<<8)]=data;
1895      }
1896      else
1897      {
1898         memory_region(space->machine, "disks")[offset + (opusbank << 8)] = data;
18291899      }
18301900   }
18311901}
r4569r4570
19862056
19872057   size = image_length (image);
19882058
1989   if (strcmp(image->tag,"cart1")==0) {
2059   if (strcmp(image->tag,"cart1") == 0)
2060   {
19902061      index = 0;
19912062   }
1992   if (strcmp(image->tag,"cart2")==0) {
2063   if (strcmp(image->tag,"cart2") == 0)
2064   {
19932065      index = 1;
19942066   }
1995   if (strcmp(image->tag,"cart3")==0) {
2067   if (strcmp(image->tag,"cart3") == 0)
2068   {
19962069      index = 2;
19972070   }
1998   if (strcmp(image->tag,"cart4")==0) {
2071   if (strcmp(image->tag,"cart4") == 0)
2072   {
19992073      index = 3;
20002074   }
20012075   addr = 0x8000 + (0x4000 * index);
20022076
20032077
2004   logerror("loading rom %s at %.4x size:%.4x\n",image_filename(image), addr, size);
2078   logerror("loading rom %s at %.4x size:%.4x\n", image_filename(image), addr, size);
20052079
20062080
2007   switch (size) {
2081   switch (size)
2082   {
20082083   case 0x2000:
20092084      read_ = image_fread(image, mem + addr, size);
2010      image_fseek(image,0,SEEK_SET);
2085      image_fseek(image, 0, SEEK_SET);
20112086      read_ = image_fread(image, mem + addr + 0x2000, size);
20122087      break;
20132088   case 0x4000:
r4569r4570
20152090      break;
20162091   default:
20172092      read_ = 0;
2018      logerror("bad rom file size of %.4x\n",size);
2093      logerror("bad rom file size of %.4x\n", size);
20192094      break;
20202095   }
20212096
r4569r4570
20822157MACHINE_RESET( bbcb )
20832158{
20842159   UINT8 *ram = memory_region(machine, "maincpu");
2085   bbc_DFSType=  (input_port_read(machine, "BBCCONFIG")>>0)&0x07;
2086   bbc_SWRAMtype=(input_port_read(machine, "BBCCONFIG")>>3)&0x03;
2087   bbc_RAMSize=  (input_port_read(machine, "BBCCONFIG")>>5)&0x01;
2160   bbc_DFSType=    (input_port_read(machine, "BBCCONFIG") >> 0) & 0x07;
2161   bbc_SWRAMtype = (input_port_read(machine, "BBCCONFIG") >> 3) & 0x03;
2162   bbc_RAMSize=    (input_port_read(machine, "BBCCONFIG") >> 5) & 0x01;
20882163
20892164   memory_set_bankptr(machine, 1,ram);
20902165   if (bbc_RAMSize)
20912166   {
20922167      /* 32K Model B */
2093      memory_set_bankptr(machine, 3,ram+0x4000);
2168      memory_set_bankptr(machine, 3, ram + 0x4000);
20942169      bbc_set_video_memory_lookups(32);
2095   } else {
2170   }
2171   else
2172   {
20962173      /* 16K just repeat the lower 16K*/
2097      memory_set_bankptr(machine, 3,ram);
2174      memory_set_bankptr(machine, 3, ram);
20982175      bbc_set_video_memory_lookups(16);
20992176   }
21002177
2101   memory_set_bankptr(machine, 4,memory_region(machine, "user1"));          /* bank 4 is the paged ROMs     from 8000 to bfff */
2102   memory_set_bankptr(machine, 7,memory_region(machine, "user1")+0x40000);  /* bank 7 points at the OS rom  from c000 to ffff */
2178   memory_set_bankptr(machine, 4, memory_region(machine, "user1"));          /* bank 4 is the paged ROMs     from 8000 to bfff */
2179   memory_set_bankptr(machine, 7, memory_region(machine, "user1") + 0x40000);  /* bank 7 points at the OS rom  from c000 to ffff */
21032180
21042181   bbcb_IC32_initialise();
21052182
21062183
2107   opusbank=0;
2184   opusbank = 0;
21082185   /*set up the required disc controller*/
21092186   //switch (bbc_DFSType) {
21102187   //case 0:   case 1: case 2: case 3:
r4569r4570
21192196{
21202197   mc6850_clock = 0;
21212198
2122   memory_set_direct_update_handler( cpu_get_address_space( machine->cpu[0], ADDRESS_SPACE_PROGRAM), bbcbp_direct_handler);
2199   memory_set_direct_update_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), bbcbp_direct_handler);
21232200
21242201   /* bank 6 is the paged ROMs     from b000 to bfff */
21252202   memory_configure_bank(machine, 6, 0, 16, memory_region(machine, "user1") + 0x3000, 1<<14);
r4569r4570
21452222{
21462223   mc6850_clock = 0;
21472224
2148   memory_set_direct_update_handler( cpu_get_address_space( machine->cpu[0], ADDRESS_SPACE_PROGRAM ), bbcm_direct_handler);
2225   memory_set_direct_update_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), bbcm_direct_handler);
21492226
21502227   /* bank 5 is the paged ROMs     from 9000 to bfff */
21512228   memory_configure_bank(machine, 5, 0, 16, memory_region(machine, "user1")+0x01000, 1<<14);
21522229
21532230   /* Set ROM/IO bank to point to rom */
21542231   memory_set_bankptr( machine, 8, memory_region(machine, "user1")+0x43c00);
2155   memory_install_read_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM),0xFC00,0xFEFF,0,0,8);
2232   memory_install_read_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0xFC00, 0xFEFF, 0, 0, 8);
21562233}
21572234
21582235MACHINE_RESET( bbcm )
21592236{
2160   memory_set_bankptr(machine, 1,memory_region(machine, "maincpu"));         /* bank 1 regular lower ram      from 0000 to 2fff */
2161   memory_set_bankptr(machine, 2,memory_region(machine, "maincpu")+0x3000);   /* bank 2 screen/shadow ram      from 3000 to 7fff */
2162   memory_set_bankptr(machine, 4,memory_region(machine, "user1"));         /* bank 4 is paged ROM or RAM   from 8000 to 8fff */
2237   memory_set_bankptr(machine, 1, memory_region(machine, "maincpu"));         /* bank 1 regular lower ram      from 0000 to 2fff */
2238   memory_set_bankptr(machine, 2, memory_region(machine, "maincpu") + 0x3000);   /* bank 2 screen/shadow ram      from 3000 to 7fff */
2239   memory_set_bankptr(machine, 4, memory_region(machine, "user1"));         /* bank 4 is paged ROM or RAM   from 8000 to 8fff */
21632240   memory_set_bank(machine, 5, 0);
2164   memory_set_bankptr(machine, 7,memory_region(machine, "user1")+0x40000); /* bank 6 OS rom of RAM         from c000 to dfff */
2241   memory_set_bankptr(machine, 7, memory_region(machine, "user1") + 0x40000); /* bank 6 OS rom of RAM         from c000 to dfff */
21652242
21662243   bbcb_IC32_initialise();
21672244
src/mess/drivers/cpschngr.c
r4569r4570
355355
356356static void cps1_irq_handler_mus(const device_config *device, int irq)
357357{
358   cpu_set_input_line(device->machine->cpu[1],0,irq ? ASSERT_LINE : CLEAR_LINE);
358   cputag_set_input_line(device->machine, "audiocpu", 0, irq ? ASSERT_LINE : CLEAR_LINE);
359359}
360360
361361static const ym2151_interface ym2151_config =
src/mess/drivers/bw2.c
r4569r4570
103103   switch (state->bank)
104104   {
105105   case BANK_RAM1:
106      memory_install_readwrite8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x0000, 0x7fff, 0, 0, SMH_BANK1, SMH_BANK1);
106      memory_install_readwrite8_handler(cputag_get_address_space(machine, Z80_TAG, ADDRESS_SPACE_PROGRAM), 0x0000, 0x7fff, 0, 0, SMH_BANK1, SMH_BANK1);
107107      break;
108108
109109   case BANK_VRAM:
110      memory_install_readwrite8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x0000, 0x3fff, 0, 0x4000, SMH_BANK1, SMH_BANK1);
110      memory_install_readwrite8_handler(cputag_get_address_space(machine, Z80_TAG, ADDRESS_SPACE_PROGRAM), 0x0000, 0x3fff, 0, 0x4000, SMH_BANK1, SMH_BANK1);
111111      break;
112112
113113   case BANK_RAM2:
r4569r4570
117117   case BANK_RAM6:
118118      if (state->bank > max_ram_bank)
119119      {
120         memory_install_readwrite8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x0000, 0x7fff, 0, 0, SMH_UNMAP, SMH_UNMAP);
120         memory_install_readwrite8_handler(cputag_get_address_space(machine, Z80_TAG, ADDRESS_SPACE_PROGRAM), 0x0000, 0x7fff, 0, 0, SMH_UNMAP, SMH_UNMAP);
121121      }
122122      else
123123      {
124         memory_install_readwrite8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x0000, 0x7fff, 0, 0, SMH_BANK1, SMH_BANK1);
124         memory_install_readwrite8_handler(cputag_get_address_space(machine, Z80_TAG, ADDRESS_SPACE_PROGRAM), 0x0000, 0x7fff, 0, 0, SMH_BANK1, SMH_BANK1);
125125      }
126126      break;
127127
128128   case BANK_ROM:
129      memory_install_readwrite8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x0000, 0x7fff, 0, 0, SMH_BANK1, SMH_UNMAP);
129      memory_install_readwrite8_handler(cputag_get_address_space(machine, Z80_TAG, ADDRESS_SPACE_PROGRAM), 0x0000, 0x7fff, 0, 0, SMH_BANK1, SMH_UNMAP);
130130      break;
131131   }
132132
r4569r4570
179179   {
180180   case BANK_RAM1:
181181   case BANK_RAMCARD_RAM:
182      memory_install_readwrite8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x0000, 0x7fff, 0, 0, SMH_BANK1, SMH_BANK1);
182      memory_install_readwrite8_handler(cputag_get_address_space(machine, Z80_TAG, ADDRESS_SPACE_PROGRAM), 0x0000, 0x7fff, 0, 0, SMH_BANK1, SMH_BANK1);
183183      break;
184184
185185   case BANK_VRAM:
186      memory_install_readwrite8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x0000, 0x3fff, 0, 0x4000, SMH_BANK1, SMH_BANK1);
186      memory_install_readwrite8_handler(cputag_get_address_space(machine, Z80_TAG, ADDRESS_SPACE_PROGRAM), 0x0000, 0x3fff, 0, 0x4000, SMH_BANK1, SMH_BANK1);
187187      break;
188188
189189   case BANK_RAM3:
r4569r4570
191191   case BANK_RAM6:
192192      if (state->bank > max_ram_bank)
193193      {
194         memory_install_readwrite8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x0000, 0x7fff, 0, 0, SMH_UNMAP, SMH_UNMAP);
194         memory_install_readwrite8_handler(cputag_get_address_space(machine, Z80_TAG, ADDRESS_SPACE_PROGRAM), 0x0000, 0x7fff, 0, 0, SMH_UNMAP, SMH_UNMAP);
195195      }
196196      else
197197      {
198         memory_install_readwrite8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x0000, 0x7fff, 0, 0, SMH_BANK1, SMH_BANK1);
198         memory_install_readwrite8_handler(cputag_get_address_space(machine, Z80_TAG, ADDRESS_SPACE_PROGRAM), 0x0000, 0x7fff, 0, 0, SMH_BANK1, SMH_BANK1);
199199      }
200200      break;
201201
202202   case BANK_RAMCARD_ROM:
203      memory_install_readwrite8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x0000, 0x3fff, 0, 0x4000, SMH_BANK1, SMH_UNMAP);
203      memory_install_readwrite8_handler(cputag_get_address_space(machine, Z80_TAG, ADDRESS_SPACE_PROGRAM), 0x0000, 0x3fff, 0, 0x4000, SMH_BANK1, SMH_UNMAP);
204204      break;
205205
206206   case BANK_ROM:
207      memory_install_readwrite8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x0000, 0x7fff, 0, 0, SMH_BANK1, SMH_UNMAP);
207      memory_install_readwrite8_handler(cputag_get_address_space(machine, Z80_TAG, ADDRESS_SPACE_PROGRAM), 0x0000, 0x7fff, 0, 0, SMH_BANK1, SMH_UNMAP);
208208      break;
209209   }
210210
r4569r4570
220220
221221   if ((get_ramdisk_size(space->machine) == 256) && (ramcard_bank > 7))
222222   {
223      memory_install_readwrite8_handler(cpu_get_address_space(space->machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x0000, 0x7fff, 0, 0, SMH_UNMAP, SMH_UNMAP);
223      memory_install_readwrite8_handler(cputag_get_address_space(space->machine, Z80_TAG, ADDRESS_SPACE_PROGRAM), 0x0000, 0x7fff, 0, 0, SMH_UNMAP, SMH_UNMAP);
224224   }
225225   else
226226   {
227      memory_install_readwrite8_handler(cpu_get_address_space(space->machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x0000, 0x7fff, 0, 0, SMH_BANK1, SMH_BANK1);
227      memory_install_readwrite8_handler(cputag_get_address_space(space->machine, Z80_TAG, ADDRESS_SPACE_PROGRAM), 0x0000, 0x7fff, 0, 0, SMH_BANK1, SMH_BANK1);
228228   }
229229
230230   memory_configure_bank(space->machine, 1, BANK_RAMCARD_RAM, 1, state->ramcard_ram + bank_offset, 0);
r4569r4570
300300         break;
301301
302302      case WD17XX_DRQ_SET:
303         if (cpu_get_reg(device->machine->cpu[0], Z80_HALT))
303         if (cpu_get_reg(cputag_get_cpu(device->machine, Z80_TAG), Z80_HALT))
304304         {
305305            cputag_set_input_line(device->machine, Z80_TAG, INPUT_LINE_NMI, HOLD_LINE);
306306         }
r4569r4570
611611      memory_configure_bank(machine, 1, BANK_RAM6, 1, state->work_ram + 0x18000, 0);
612612      memory_configure_bank(machine, 1, BANK_ROM, 1, memory_region(machine, "ic1"), 0);
613613
614      memory_install_write8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_IO), 0x30, 0x30, 0, 0x0f, &ramcard_bank_w);
614      memory_install_write8_handler(cputag_get_address_space(machine, Z80_TAG, ADDRESS_SPACE_IO), 0x30, 0x30, 0, 0x0f, &ramcard_bank_w);
615615   }
616616   else
617617   {
r4569r4570
622622      memory_configure_bank(machine, 1, BANK_RAM2, 5, state->work_ram + 0x8000, 0x8000);
623623      memory_configure_bank(machine, 1, BANK_ROM, 1, memory_region(machine, "ic1"), 0);
624624
625      memory_install_write8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_IO), 0x30, 0x30, 0, 0x0f, SMH_UNMAP);
625      memory_install_write8_handler(cputag_get_address_space(machine, Z80_TAG, ADDRESS_SPACE_IO), 0x30, 0x30, 0, 0x0f, SMH_UNMAP);
626626   }
627627
628628   memory_set_bank(machine, 1, BANK_ROM);
src/mess/drivers/coleco.c
r4569r4570
468468   static int last_state = 0;
469469
470470    // only if it goes up
471   if (state && !last_state) cpu_set_input_line(machine->cpu[0], INPUT_LINE_NMI, PULSE_LINE);
471   if (state && !last_state)
472      cputag_set_input_line(machine, "maincpu", INPUT_LINE_NMI, PULSE_LINE);
473
472474   last_state = state;
473475}
474476
r4569r4570
516518      joy_status[1] = 1;
517519
518520    if (joy_status[0] || joy_status[1])
519      cpu_set_input_line(machine->cpu[0], INPUT_LINE_IRQ0, HOLD_LINE);
521      cputag_set_input_line(machine, "maincpu", INPUT_LINE_IRQ0, HOLD_LINE);
520522}
521523
522524/* Machine Initialization */
r4569r4570
536538
537539static MACHINE_RESET( coleco )
538540{
539    cpu_set_input_line_vector(machine->cpu[0], INPUT_LINE_IRQ0, 0xff);
541    cpu_set_input_line_vector(cputag_get_cpu(machine, "maincpu"), INPUT_LINE_IRQ0, 0xff);
540542   memset(&memory_region(machine, "maincpu")[0x6000], 0xff, 0x400);   // initialize RAM
541543    timer_pulse(machine, ATTOTIME_IN_MSEC(20), NULL, 0, paddle_callback);
542544}
src/mess/drivers/crvision.c
r4569r4570
210210
211211static void crvision_vdp_interrupt(running_machine *machine, int state)
212212{
213   cpu_set_input_line(machine->cpu[0], INPUT_LINE_IRQ0, state);
213   cputag_set_input_line(machine, M6502_TAG, INPUT_LINE_IRQ0, state);
214214}
215215
216216static const TMS9928a_interface tms9918_intf =
r4569r4570
422422   {
423423   case 0x1000: // 4K
424424      image_fread(image, mem + 0x9000, 0x1000);
425      memory_install_read8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x8000, 0x9fff, 0, 0x2000, SMH_BANK1);
425      memory_install_read8_handler(cputag_get_address_space(machine, M6502_TAG, ADDRESS_SPACE_PROGRAM), 0x8000, 0x9fff, 0, 0x2000, SMH_BANK1);
426426      break;
427427
428428   case 0x1800: // 6K
429429      image_fread(image, mem + 0x9000, 0x1000);
430430      image_fread(image, mem + 0x8800, 0x0800);
431      memory_install_read8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x8000, 0x9fff, 0, 0x2000, SMH_BANK1);
431      memory_install_read8_handler(cputag_get_address_space(machine, M6502_TAG, ADDRESS_SPACE_PROGRAM), 0x8000, 0x9fff, 0, 0x2000, SMH_BANK1);
432432      break;
433433
434434   case 0x2000: // 8K
435435      image_fread(image, mem + 0x8000, 0x2000);
436      memory_install_read8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x8000, 0x9fff, 0, 0x2000, SMH_BANK1);
436      memory_install_read8_handler(cputag_get_address_space(machine, M6502_TAG, ADDRESS_SPACE_PROGRAM), 0x8000, 0x9fff, 0, 0x2000, SMH_BANK1);
437437      break;
438438
439439   case 0x2800: // 10K
440440      image_fread(image, mem + 0x8000, 0x2000);
441441      image_fread(image, mem + 0x5800, 0x0800);
442      memory_install_read8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x8000, 0x9fff, 0, 0x2000, SMH_BANK1);
443      memory_install_read8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x4000, 0x5fff, 0, 0x2000, SMH_BANK2);
442      memory_install_read8_handler(cputag_get_address_space(machine, M6502_TAG, ADDRESS_SPACE_PROGRAM), 0x8000, 0x9fff, 0, 0x2000, SMH_BANK1);
443      memory_install_read8_handler(cputag_get_address_space(machine, M6502_TAG, ADDRESS_SPACE_PROGRAM), 0x4000, 0x5fff, 0, 0x2000, SMH_BANK2);
444444      break;
445445
446446   case 0x3000: // 12K
447447      image_fread(image, mem + 0x8000, 0x2000);
448448      image_fread(image, mem + 0x5000, 0x1000);
449      memory_install_read8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x8000, 0x9fff, 0, 0x2000, SMH_BANK1);
450      memory_install_read8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x4000, 0x5fff, 0, 0x2000, SMH_BANK2);
449      memory_install_read8_handler(cputag_get_address_space(machine, M6502_TAG, ADDRESS_SPACE_PROGRAM), 0x8000, 0x9fff, 0, 0x2000, SMH_BANK1);
450      memory_install_read8_handler(cputag_get_address_space(machine, M6502_TAG, ADDRESS_SPACE_PROGRAM), 0x4000, 0x5fff, 0, 0x2000, SMH_BANK2);
451451      break;
452452
453453   case 0x4000: // 16K
454454      image_fread(image, mem + 0xa000, 0x2000);
455455      image_fread(image, mem + 0x8000, 0x2000);
456      memory_install_read8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x8000, 0xbfff, 0, 0, SMH_BANK1);
456      memory_install_read8_handler(cputag_get_address_space(machine, M6502_TAG, ADDRESS_SPACE_PROGRAM), 0x8000, 0xbfff, 0, 0, SMH_BANK1);
457457      break;
458458
459459   case 0x4800: // 18K
460460      image_fread(image, mem + 0xa000, 0x2000);
461461      image_fread(image, mem + 0x8000, 0x2000);
462462      image_fread(image, mem + 0x4800, 0x0800);
463      memory_install_read8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x8000, 0x8fff, 0, 0, SMH_BANK1);
464      memory_install_read8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x4000, 0x4fff, 0, 0x3000, SMH_BANK2);
463      memory_install_read8_handler(cputag_get_address_space(machine, M6502_TAG, ADDRESS_SPACE_PROGRAM), 0x8000, 0x8fff, 0, 0, SMH_BANK1);
464      memory_install_read8_handler(cputag_get_address_space(machine, M6502_TAG, ADDRESS_SPACE_PROGRAM), 0x4000, 0x4fff, 0, 0x3000, SMH_BANK2);
465465      break;
466466
467467   default:
src/mess/drivers/bbcbc.c
r4569r4570
8787
8888static void tms_interrupt(running_machine *machine, int dummy)
8989{
90   cpu_set_input_line(machine->cpu[0], 0, HOLD_LINE);
90   cputag_set_input_line(machine, "maincpu", 0, HOLD_LINE);
9191}
9292
9393static INTERRUPT_GEN( bbcbc_interrupt )
r4569r4570
166166
167167/*   YEAR  NAME  PARENT  COMPAT  MACHINE INPUT  INIT  CONFIG  COMPANY  FULLNAME  FLAGS */
168168CONS(1985, bbcbc,     0, 0,      bbcbc,  bbcbc, 0,    0,  "BBC",   "Bridge Companion", GAME_NOT_WORKING )
169

Previous 15994 Revisions Next


© 1998-2018 The MESS Team