Previous 15994 Revisions Next

r3660 Thursday 27th November, 2008 at 17:11:22 UTC by Nathan Woods
Reenabled TI-85; more search and replace
[src/mess]mess.mak messdriv.c
[src/mess/drivers]ex800.c mpf1.c saturn.c x68k.c
[src/mess/machine]coco.c compis.c pc.c pc8801.c svi318.c ti85.c
[src/mess/video]ti85.c

src/mess/video/ti85.c
r3659r3660
155155
156156VIDEO_UPDATE( ti85 )
157157{
158   const address_space *space = cpu_get_address_space(screen->machine->cpu[0], ADDRESS_SPACE_PROGRAM);
158159   int x,y,b;
159160   int brightnes;
160161   int lcdmem;
src/mess/messdriv.c
r3659r3660
545545   DRIVER( avigo )      /*                                       */
546546
547547   /* TEXAS INSTRUMENTS CALCULATORS */
548//128u4   DRIVER( ti81 )      /* 1990 TI-81 (Z80 2 MHz)                     */
549//128u4   DRIVER( ti85 )      /* 1992 TI-85 (Z80 6 MHz)                     */
550//128u4   DRIVER( ti82 )      /* 1993 TI-82 (Z80 6 MHz)                     */
551//128u4   DRIVER( ti83 )      /* 1996 TI-83 (Z80 6 MHz)                     */
552//128u4   DRIVER( ti86 )      /* 1997 TI-86 (Z80 6 MHz)                     */
553//128u4   DRIVER( ti83p )      /* 1999 TI-83 Plus (Z80 6 MHz)                  */
548   DRIVER( ti81 )      /* 1990 TI-81 (Z80 2 MHz)                     */
549   DRIVER( ti85 )      /* 1992 TI-85 (Z80 6 MHz)                     */
550   DRIVER( ti82 )      /* 1993 TI-82 (Z80 6 MHz)                     */
551   DRIVER( ti83 )      /* 1996 TI-83 (Z80 6 MHz)                     */
552   DRIVER( ti86 )      /* 1997 TI-86 (Z80 6 MHz)                     */
553   DRIVER( ti83p )      /* 1999 TI-83 Plus (Z80 6 MHz)                  */
554554//   DRIVER( ti83pse )   /* 2001 TI-83 Plus Silver Edition               */
555555//   DRIVER( ti84p )      /* 2004 TI-84 Plus                           */
556556//   DRIVER( ti84pse )   /* 2004 TI-84 Plus Silver Edition               */
src/mess/machine/coco.c
r3659r3660
457457
458458static void pak_load_trailer(const pak_decodedtrailer *trailer)
459459{
460   cpunum_set_reg(0, M6809_PC, trailer->reg_pc);
461   cpunum_set_reg(0, M6809_X, trailer->reg_x);
462   cpunum_set_reg(0, M6809_Y, trailer->reg_y);
463   cpunum_set_reg(0, M6809_U, trailer->reg_u);
464   cpunum_set_reg(0, M6809_S, trailer->reg_s);
465   cpunum_set_reg(0, M6809_DP, trailer->reg_dp);
466   cpunum_set_reg(0, M6809_B, trailer->reg_b);
467   cpunum_set_reg(0, M6809_A, trailer->reg_a);
468   cpunum_set_reg(0, M6809_CC, trailer->reg_cc);
460   cpu_set_reg(machine->cpu[0], M6809_PC, trailer->reg_pc);
461   cpu_set_reg(machine->cpu[0], M6809_X, trailer->reg_x);
462   cpu_set_reg(machine->cpu[0], M6809_Y, trailer->reg_y);
463   cpu_set_reg(machine->cpu[0], M6809_U, trailer->reg_u);
464   cpu_set_reg(machine->cpu[0], M6809_S, trailer->reg_s);
465   cpu_set_reg(machine->cpu[0], M6809_DP, trailer->reg_dp);
466   cpu_set_reg(machine->cpu[0], M6809_B, trailer->reg_b);
467   cpu_set_reg(machine->cpu[0], M6809_A, trailer->reg_a);
468   cpu_set_reg(machine->cpu[0], M6809_CC, trailer->reg_cc);
469469
470470   /* I seem to only be able to get a small amount of the PIA state from the
471471    * snapshot trailers. Thus I am going to configure the PIA myself. The
r3659r3660
630630      if (preamble != 0)
631631      {
632632         /* start address - just set the address and return */
633         cpunum_set_reg(0, REG_PC, block_address);
633         cpu_set_reg(machine->cpu[0], REG_PC, block_address);
634634         done = TRUE;
635635      }
636636      else
r3659r3660
23842384   int timer_was_off = (coco3_gimereg[4] == 0x00) && (coco3_gimereg[5] == 0x00);   coco3_gimereg[offset] = data;
23852385
23862386   if (LOG_GIME)
2387      logerror("CoCo3 GIME: $%04x <== $%02x pc=$%04x\n", offset + 0xff90, data, activecpu_get_pc());
2387      logerror("CoCo3 GIME: $%04x <== $%02x pc=$%04x\n", offset + 0xff90, data, cpu_get_pc(space->cpu));
23882388
23892389   /* Features marked with '!' are not yet implemented */
23902390   switch(offset)
r3659r3660
29052905static void generic_coco12_dragon_init(running_machine *machine, const machine_init_interface *init)
29062906{
29072907   /* Set default RAM mapping */
2908   memory_set_bankptr(1, &mess_ram[0]);
2908   memory_set_bankptr(machine, 1, &mess_ram[0]);
29092909
29102910   /* Do generic Inits */
29112911   generic_init_machine(machine, init);
src/mess/machine/ti85.c
r3659r3660
137137
138138static void update_ti86_memory (running_machine *machine)
139139{
140   write8_machine_func wh;
140   const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM);
141   write8_space_func wh;
141142
142143   if (ti85_memory_page_0x4000 & 0x40)
143144   {
144      memory_set_bankptr(machine, 2,ti86_ram + 0x004000*(ti85_memory_page_0x4000&0x07));
145      memory_set_bankptr(machine, 6,ti86_ram + 0x004000*(ti85_memory_page_0x4000&0x07));
145      memory_set_bankptr(machine, 2, ti86_ram + 0x004000*(ti85_memory_page_0x4000&0x07));
146      memory_set_bankptr(machine, 6, ti86_ram + 0x004000*(ti85_memory_page_0x4000&0x07));
146147      wh = SMH_BANK6;
147148   }
148149   else
149150   {
150      memory_set_bankptr(machine, 2,memory_region(machine, "main") + 0x010000 + 0x004000*(ti85_memory_page_0x4000&0x0f));
151      memory_set_bankptr(machine, 2, memory_region(machine, "main") + 0x010000 + 0x004000*(ti85_memory_page_0x4000&0x0f));
151152      wh = SMH_UNMAP;
152153   }
153   memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x7fff, 0, 0, wh);
154   memory_install_write8_handler(space, 0x4000, 0x7fff, 0, 0, wh);
154155
155156   if (ti86_memory_page_0x8000 & 0x40)
156157   {
157      memory_set_bankptr(machine, 3,ti86_ram + 0x004000*(ti86_memory_page_0x8000&0x07));
158      memory_set_bankptr(machine, 7,ti86_ram + 0x004000*(ti86_memory_page_0x8000&0x07));
158      memory_set_bankptr(machine, 3, ti86_ram + 0x004000*(ti86_memory_page_0x8000&0x07));
159      memory_set_bankptr(machine, 7, ti86_ram + 0x004000*(ti86_memory_page_0x8000&0x07));
159160      wh = SMH_BANK7;
160161   }
161162   else
162163   {
163      memory_set_bankptr(machine, 3,memory_region(machine, "main") + 0x010000 + 0x004000*(ti86_memory_page_0x8000&0x0f));
164      memory_set_bankptr(machine, 3, memory_region(machine, "main") + 0x010000 + 0x004000*(ti86_memory_page_0x8000&0x0f));
164165      wh = SMH_UNMAP;
165166   }
166   memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x8000, 0xbfff, 0, 0, wh);
167   memory_install_write8_handler(space, 0x8000, 0xbfff, 0, 0, wh);
167168}
168169
169170/***************************************************************************
r3659r3660
172173
173174MACHINE_START( ti81 )
174175{
176   const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM);
175177   UINT8 *mem = memory_region(machine, "main");
176178
177179   ti85_timer_interrupt_mask = 0;
r3659r3660
197199
198200   timer_pulse(ATTOTIME_IN_HZ(200), NULL, 0, ti85_timer_callback);
199201
200   memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x3fff, 0, 0, SMH_UNMAP);
201   memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x7fff, 0, 0, SMH_UNMAP);
202   memory_set_bankptr(machine, 1,mem + 0x010000);
203   memory_set_bankptr(machine, 2,mem + 0x014000);
202   memory_install_write8_handler(space, 0x0000, 0x3fff, 0, 0, SMH_UNMAP);
203   memory_install_write8_handler(space, 0x4000, 0x7fff, 0, 0, SMH_UNMAP);
204   memory_set_bankptr(machine, 1, mem + 0x010000);
205   memory_set_bankptr(machine, 2, mem + 0x014000);
204206}
205207
206208MACHINE_START( ti85 )
207209{
210   const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM);
208211   UINT8 *mem = memory_region(machine, "main");
209212
210213   ti85_timer_interrupt_mask = 0;
r3659r3660
229232
230233   timer_pulse(ATTOTIME_IN_HZ(200), NULL, 0, ti85_timer_callback);
231234
232   memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x3fff, 0, 0, SMH_UNMAP);
233   memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x7fff, 0, 0, SMH_UNMAP);
234   memory_set_bankptr(machine, 1,mem + 0x010000);
235   memory_set_bankptr(machine, 2,mem + 0x014000);
235   memory_install_write8_handler(space, 0x0000, 0x3fff, 0, 0, SMH_UNMAP);
236   memory_install_write8_handler(space, 0x4000, 0x7fff, 0, 0, SMH_UNMAP);
237   memory_set_bankptr(machine, 1, mem + 0x010000);
238   memory_set_bankptr(machine, 2, mem + 0x014000);
236239
237240   add_reset_callback(machine, ti85_reset_serial);
238241   add_exit_callback(machine, ti85_free_serial_data_memory);
r3659r3660
240243
241244MACHINE_START( ti86 )
242245{
246   const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM);
243247   UINT8 *mem = memory_region(machine, "main");
244248
245249   ti85_timer_interrupt_mask = 0;
r3659r3660
260264
261265   ti86_ram = auto_malloc(128*1024);
262266   {
263      memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x3fff, 0, 0, SMH_UNMAP);
267      memory_install_write8_handler(space, 0x0000, 0x3fff, 0, 0, SMH_UNMAP);
264268
265      memory_set_bankptr(machine, 1,mem + 0x010000);
266      memory_set_bankptr(machine, 2,mem + 0x014000);
269      memory_set_bankptr(machine, 1, mem + 0x010000);
270      memory_set_bankptr(machine, 2, mem + 0x014000);
267271
268272      memory_set_bankptr(machine, 4, ti86_ram);
269273      memory_set_bankptr(machine, 8, ti86_ram);
r3659r3660
287291   return 0xff;
288292}
289293
290 READ8_HANDLER ( ti85_port_0001_r )
294READ8_HANDLER ( ti85_port_0001_r )
291295{
292296   int data = 0xff;
293297   int port;
r3659r3660
297301   if (ti85_keypad_mask == 0x7f) return data;
298302
299303   for (bit = 0; bit < 7; bit++)
304   {
300305      if (~ti85_keypad_mask&(0x01<<bit))
306      {
301307         for (port = 0; port < 8; port++)
302            {
303               data ^= input_port_read(machine, bitnames[port]) & (0x01<<bit) ? 0x01<<port : 0x00;
304            }
308         {
309            data ^= input_port_read(space->machine, bitnames[port]) & (0x01<<bit) ? 0x01<<port : 0x00;
310         }
311      }
312   }
305313   return data;
306314}
307315
r3659r3660
337345   return ti85_memory_page_0x4000;
338346}
339347
340 READ8_HANDLER ( ti85_port_0006_r )
348READ8_HANDLER ( ti85_port_0006_r )
341349{
342350   return ti85_power_mode;
343351}
344352
345 READ8_HANDLER ( ti85_port_0007_r )
353READ8_HANDLER ( ti85_port_0007_r )
346354{
347   ti85_update_serial(machine);
348        return  (ti85_white_out<<3) |
349      (ti85_red_out<<2)|
350                ((ti85_white_in&(1-ti85_white_out))<<1)|
351                (ti85_red_in&(1-ti85_red_out))|
352      ti85_PCR;
355   ti85_update_serial(space->machine);
356   return (ti85_white_out<<3)
357      | (ti85_red_out<<2)
358      | ((ti85_white_in&(1-ti85_white_out))<<1)
359      | (ti85_red_in&(1-ti85_red_out))
360      | ti85_PCR;
353361}
354362
355 READ8_HANDLER ( ti86_port_0005_r )
363READ8_HANDLER ( ti86_port_0005_r )
356364{
357365   return ti85_memory_page_0x4000;
358366}
r3659r3660
401409WRITE8_HANDLER ( ti85_port_0005_w )
402410{
403411   ti85_memory_page_0x4000 = data;
404   update_ti85_memory(machine);
412   update_ti85_memory(space->machine);
405413}
406414
407415WRITE8_HANDLER ( ti85_port_0006_w )
r3659r3660
414422   speaker_level_w(0,( (data>>2)|(data>>3) )&0x01 );
415423        ti85_red_out=(data>>2)&0x01;
416424        ti85_white_out=(data>>3)&0x01;
417   ti85_update_serial(machine);
425   ti85_update_serial(space->machine);
418426   ti85_PCR = data&0xf0;
419427}
420428
421429WRITE8_HANDLER ( ti86_port_0005_w )
422430{
423431   ti85_memory_page_0x4000 = data&((data&0x40)?0x47:0x4f);
424   update_ti86_memory(machine);
432   update_ti86_memory(space->machine);
425433}
426434
427435WRITE8_HANDLER ( ti86_port_0006_w )
428436{
429437   ti86_memory_page_0x8000 = data&((data&0x40)?0x47:0x4f);
430   update_ti86_memory(machine);
438   update_ti86_memory(space->machine);
431439}
432440
433441
r3659r3660
540548
541549   cpu_set_reg(machine->cpu[0], Z80_R, (reg[0x44]&0x7f) | (reg[0x48]&0x80));
542550
543   activecpu_set_input_line(0, 0);
544   activecpu_set_input_line(INPUT_LINE_NMI, 0);
551   cpu_set_input_line(machine->cpu[0], 0, 0);
552   cpu_set_input_line(machine->cpu[0], INPUT_LINE_NMI, 0);
545553   cpu_set_input_line(machine->cpu[0], INPUT_LINE_HALT, 0);
546554}
547555
548556static void ti85_setup_snapshot (running_machine *machine, UINT8 * data)
549557{
558   const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM);
550559   int i;
551560   unsigned char lo,hi;
552561   unsigned char * hdw = data + 0x8000 + 0x94;
src/mess/machine/svi318.c
r3659r3660
6969static INS8250_INTERRUPT( svi318_ins8250_interrupt )
7070{
7171   if (svi.bankLow != SVI_CART) {
72      cpunum_set_input_line(device->machine, 0, 0, (state ? HOLD_LINE : CLEAR_LINE));
72      cpu_set_input_line(device->machine->cpu[0], 0, (state ? HOLD_LINE : CLEAR_LINE));
7373   }
7474}
7575
r3659r3660
565565
566566void svi318_vdp_interrupt(running_machine *machine, int i)
567567{
568   cpunum_set_input_line(machine, 0, 0, (i ? HOLD_LINE : CLEAR_LINE));
568   cpu_set_input_line(machine->cpu[0], 0, (i ? HOLD_LINE : CLEAR_LINE));
569569}
570570
571571DRIVER_INIT( svi318 )
src/mess/machine/compis.c
r3659r3660
192192#ifdef UNUSED_FUNCTION
193193void compis_irq_set(UINT8 irq)
194194{
195   cpunum_set_input_line_vector(0, 0, irq);
196   cpunum_set_input_line(machine, 0, 0, HOLD_LINE);
195   cpu_set_input_line_vector(machine->cpu[0], 0, irq);
196   cpu_set_input_line(machine->cpu[0], 0, HOLD_LINE);
197197}
198198#endif
199199
r3659r3660
584584      logerror("(%f) **** Acknowledged interrupt vector %02X\n", attotime_to_double(timer_get_time()), i186.intr.poll_status & 0x1f);
585585
586586   /* clear the interrupt */
587   activecpu_set_input_line(0, CLEAR_LINE);
587   cpu_set_input_line(machine->cpu[0], 0, CLEAR_LINE);
588588   i186.intr.pending = 0;
589589
590590   /* clear the request and set the in-service bit */
r3659r3660
719719         case 0x0d:   i186.intr.in_service &= ~0x20;   break;
720720         case 0x0e:   i186.intr.in_service &= ~0x40;   break;
721721         case 0x0f:   i186.intr.in_service &= ~0x80;   break;
722         default:   logerror("%05X:ERROR - 80186 EOI with unknown vector %02X\n", activecpu_get_pc(), data & 0x1f);
722         default:   logerror("%05X:ERROR - 80186 EOI with unknown vector %02X\n", cpu_get_pc(space->cpu), data & 0x1f);
723723      }
724724      if (LOG_INTERRUPTS) logerror("(%f) **** Got EOI for vector %02X\n", attotime_to_double(timer_get_time()), data & 0x1f);
725725   }
r3659r3660
890890      diff = new_control ^ t->control;
891891      if (diff & 0x001c)
892892        logerror("%05X:ERROR! -unsupported timer mode %04X\n",
893            activecpu_get_pc(),
893            cpu_get_pc(space->cpu),
894894            new_control);
895895
896896      /* if we have real changes, update things */
r3659r3660
992992   diff = new_control ^ d->control;
993993   if (diff & 0x6811)
994994     logerror("%05X:ERROR! - unsupported DMA mode %04X\n",
995         activecpu_get_pc(),
995         cpu_get_pc(space->cpu),
996996         new_control);
997997
998998   /* if we're going live, set a timer */
r3659r3660
10491049   switch (offset)
10501050   {
10511051      case 0x11:
1052         logerror("%05X:ERROR - read from 80186 EOI\n", activecpu_get_pc());
1052         logerror("%05X:ERROR - read from 80186 EOI\n", cpu_get_pc(space->cpu));
10531053         break;
10541054
10551055      case 0x12:
1056         if (LOG_PORTS) logerror("%05X:read 80186 interrupt poll\n", activecpu_get_pc());
1056         if (LOG_PORTS) logerror("%05X:read 80186 interrupt poll\n", cpu_get_pc(space->cpu));
10571057         if (i186.intr.poll_status & 0x8000)
10581058            int_callback(machine, 0);
10591059         return i186.intr.poll_status;
10601060
10611061      case 0x13:
1062         if (LOG_PORTS) logerror("%05X:read 80186 interrupt poll status\n", activecpu_get_pc());
1062         if (LOG_PORTS) logerror("%05X:read 80186 interrupt poll status\n", cpu_get_pc(space->cpu));
10631063         return i186.intr.poll_status;
10641064
10651065      case 0x14:
1066         if (LOG_PORTS) logerror("%05X:read 80186 interrupt mask\n", activecpu_get_pc());
1066         if (LOG_PORTS) logerror("%05X:read 80186 interrupt mask\n", cpu_get_pc(space->cpu));
10671067         temp  = (i186.intr.timer  >> 3) & 0x01;
10681068         temp |= (i186.intr.dma[0] >> 1) & 0x04;
10691069         temp |= (i186.intr.dma[1] >> 0) & 0x08;
r3659r3660
10741074         return temp;
10751075
10761076      case 0x15:
1077         if (LOG_PORTS) logerror("%05X:read 80186 interrupt priority mask\n", activecpu_get_pc());
1077         if (LOG_PORTS) logerror("%05X:read 80186 interrupt priority mask\n", cpu_get_pc(space->cpu));
10781078         return i186.intr.priority_mask;
10791079
10801080      case 0x16:
1081         if (LOG_PORTS) logerror("%05X:read 80186 interrupt in-service\n", activecpu_get_pc());
1081         if (LOG_PORTS) logerror("%05X:read 80186 interrupt in-service\n", cpu_get_pc(space->cpu));
10821082         return i186.intr.in_service;
10831083
10841084      case 0x17:
1085         if (LOG_PORTS) logerror("%05X:read 80186 interrupt request\n", activecpu_get_pc());
1085         if (LOG_PORTS) logerror("%05X:read 80186 interrupt request\n", cpu_get_pc(space->cpu));
10861086         temp = i186.intr.request & ~0x0001;
10871087         if (i186.intr.status & 0x0007)
10881088            temp |= 1;
10891089         return temp;
10901090
10911091      case 0x18:
1092         if (LOG_PORTS) logerror("%05X:read 80186 interrupt status\n", activecpu_get_pc());
1092         if (LOG_PORTS) logerror("%05X:read 80186 interrupt status\n", cpu_get_pc(space->cpu));
10931093         return i186.intr.status;
10941094
10951095      case 0x19:
1096         if (LOG_PORTS) logerror("%05X:read 80186 timer interrupt control\n", activecpu_get_pc());
1096         if (LOG_PORTS) logerror("%05X:read 80186 timer interrupt control\n", cpu_get_pc(space->cpu));
10971097         return i186.intr.timer;
10981098
10991099      case 0x1a:
1100         if (LOG_PORTS) logerror("%05X:read 80186 DMA 0 interrupt control\n", activecpu_get_pc());
1100         if (LOG_PORTS) logerror("%05X:read 80186 DMA 0 interrupt control\n", cpu_get_pc(space->cpu));
11011101         return i186.intr.dma[0];
11021102
11031103      case 0x1b:
1104         if (LOG_PORTS) logerror("%05X:read 80186 DMA 1 interrupt control\n", activecpu_get_pc());
1104         if (LOG_PORTS) logerror("%05X:read 80186 DMA 1 interrupt control\n", cpu_get_pc(space->cpu));
11051105         return i186.intr.dma[1];
11061106
11071107      case 0x1c:
1108         if (LOG_PORTS) logerror("%05X:read 80186 INT 0 interrupt control\n", activecpu_get_pc());
1108         if (LOG_PORTS) logerror("%05X:read 80186 INT 0 interrupt control\n", cpu_get_pc(space->cpu));
11091109         return i186.intr.ext[0];
11101110
11111111      case 0x1d:
1112         if (LOG_PORTS) logerror("%05X:read 80186 INT 1 interrupt control\n", activecpu_get_pc());
1112         if (LOG_PORTS) logerror("%05X:read 80186 INT 1 interrupt control\n", cpu_get_pc(space->cpu));
11131113         return i186.intr.ext[1];
11141114
11151115      case 0x1e:
1116         if (LOG_PORTS) logerror("%05X:read 80186 INT 2 interrupt control\n", activecpu_get_pc());
1116         if (LOG_PORTS) logerror("%05X:read 80186 INT 2 interrupt control\n", cpu_get_pc(space->cpu));
11171117         return i186.intr.ext[2];
11181118
11191119      case 0x1f:
1120         if (LOG_PORTS) logerror("%05X:read 80186 INT 3 interrupt control\n", activecpu_get_pc());
1120         if (LOG_PORTS) logerror("%05X:read 80186 INT 3 interrupt control\n", cpu_get_pc(space->cpu));
11211121         return i186.intr.ext[3];
11221122
11231123      case 0x28:
11241124      case 0x2c:
11251125      case 0x30:
1126         if (LOG_PORTS) logerror("%05X:read 80186 Timer %d count\n", activecpu_get_pc(), (offset - 0x28) / 4);
1126         if (LOG_PORTS) logerror("%05X:read 80186 Timer %d count\n", cpu_get_pc(space->cpu), (offset - 0x28) / 4);
11271127         which = (offset - 0x28) / 4;
11281128         if (!(offset & 1))
11291129            internal_timer_sync(which);
r3659r3660
11321132      case 0x29:
11331133      case 0x2d:
11341134      case 0x31:
1135         if (LOG_PORTS) logerror("%05X:read 80186 Timer %d max A\n", activecpu_get_pc(), (offset - 0x29) / 4);
1135         if (LOG_PORTS) logerror("%05X:read 80186 Timer %d max A\n", cpu_get_pc(space->cpu), (offset - 0x29) / 4);
11361136         which = (offset - 0x29) / 4;
11371137         return i186.timer[which].maxA;
11381138
11391139      case 0x2a:
11401140      case 0x2e:
1141         logerror("%05X:read 80186 Timer %d max B\n", activecpu_get_pc(), (offset - 0x2a) / 4);
1141         logerror("%05X:read 80186 Timer %d max B\n", cpu_get_pc(space->cpu), (offset - 0x2a) / 4);
11421142         which = (offset - 0x2a) / 4;
11431143         return i186.timer[which].maxB;
11441144
11451145      case 0x2b:
11461146      case 0x2f:
11471147      case 0x33:
1148         if (LOG_PORTS) logerror("%05X:read 80186 Timer %d control\n", activecpu_get_pc(), (offset - 0x2b) / 4);
1148         if (LOG_PORTS) logerror("%05X:read 80186 Timer %d control\n", cpu_get_pc(space->cpu), (offset - 0x2b) / 4);
11491149         which = (offset - 0x2b) / 4;
11501150         return i186.timer[which].control;
11511151
11521152      case 0x50:
1153         if (LOG_PORTS) logerror("%05X:read 80186 upper chip select\n", activecpu_get_pc());
1153         if (LOG_PORTS) logerror("%05X:read 80186 upper chip select\n", cpu_get_pc(space->cpu));
11541154         return i186.mem.upper;
11551155
11561156      case 0x51:
1157         if (LOG_PORTS) logerror("%05X:read 80186 lower chip select\n", activecpu_get_pc());
1157         if (LOG_PORTS) logerror("%05X:read 80186 lower chip select\n", cpu_get_pc(space->cpu));
11581158         return i186.mem.lower;
11591159
11601160      case 0x52:
1161         if (LOG_PORTS) logerror("%05X:read 80186 peripheral chip select\n", activecpu_get_pc());
1161         if (LOG_PORTS) logerror("%05X:read 80186 peripheral chip select\n", cpu_get_pc(space->cpu));
11621162         return i186.mem.peripheral;
11631163
11641164      case 0x53:
1165         if (LOG_PORTS) logerror("%05X:read 80186 middle chip select\n", activecpu_get_pc());
1165         if (LOG_PORTS) logerror("%05X:read 80186 middle chip select\n", cpu_get_pc(space->cpu));
11661166         return i186.mem.middle;
11671167
11681168      case 0x54:
1169         if (LOG_PORTS) logerror("%05X:read 80186 middle P chip select\n", activecpu_get_pc());
1169         if (LOG_PORTS) logerror("%05X:read 80186 middle P chip select\n", cpu_get_pc(space->cpu));
11701170         return i186.mem.middle_size;
11711171
11721172      case 0x60:
11731173      case 0x68:
1174         if (LOG_PORTS) logerror("%05X:read 80186 DMA%d lower source address\n", activecpu_get_pc(), (offset - 0x60) / 8);
1174         if (LOG_PORTS) logerror("%05X:read 80186 DMA%d lower source address\n", cpu_get_pc(space->cpu), (offset - 0x60) / 8);
11751175         which = (offset - 0x60) / 8;
11761176//         stream_update(dma_stream, 0);
11771177         return i186.dma[which].source;
11781178
11791179      case 0x61:
11801180      case 0x69:
1181         if (LOG_PORTS) logerror("%05X:read 80186 DMA%d upper source address\n", activecpu_get_pc(), (offset - 0x61) / 8);
1181         if (LOG_PORTS) logerror("%05X:read 80186 DMA%d upper source address\n", cpu_get_pc(space->cpu), (offset - 0x61) / 8);
11821182         which = (offset - 0x61) / 8;
11831183//         stream_update(dma_stream, 0);
11841184         return i186.dma[which].source >> 16;
11851185
11861186      case 0x62:
11871187      case 0x6a:
1188         if (LOG_PORTS) logerror("%05X:read 80186 DMA%d lower dest address\n", activecpu_get_pc(), (offset - 0x62) / 8);
1188         if (LOG_PORTS) logerror("%05X:read 80186 DMA%d lower dest address\n", cpu_get_pc(space->cpu), (offset - 0x62) / 8);
11891189         which = (offset - 0x62) / 8;
11901190//         stream_update(dma_stream, 0);
11911191         return i186.dma[which].dest;
11921192
11931193      case 0x63:
11941194      case 0x6b:
1195         if (LOG_PORTS) logerror("%05X:read 80186 DMA%d upper dest address\n", activecpu_get_pc(), (offset - 0x63) / 8);
1195         if (LOG_PORTS) logerror("%05X:read 80186 DMA%d upper dest address\n", cpu_get_pc(space->cpu), (offset - 0x63) / 8);
11961196         which = (offset - 0x63) / 8;
11971197//         stream_update(dma_stream, 0);
11981198         return i186.dma[which].dest >> 16;
11991199
12001200      case 0x64:
12011201      case 0x6c:
1202         if (LOG_PORTS) logerror("%05X:read 80186 DMA%d transfer count\n", activecpu_get_pc(), (offset - 0x64) / 8);
1202         if (LOG_PORTS) logerror("%05X:read 80186 DMA%d transfer count\n", cpu_get_pc(space->cpu), (offset - 0x64) / 8);
12031203         which = (offset - 0x64) / 8;
12041204//         stream_update(dma_stream, 0);
12051205         return i186.dma[which].count;
12061206
12071207      case 0x65:
12081208      case 0x6d:
1209         if (LOG_PORTS) logerror("%05X:read 80186 DMA%d control\n", activecpu_get_pc(), (offset - 0x65) / 8);
1209         if (LOG_PORTS) logerror("%05X:read 80186 DMA%d control\n", cpu_get_pc(space->cpu), (offset - 0x65) / 8);
12101210         which = (offset - 0x65) / 8;
12111211//         stream_update(dma_stream, 0);
12121212         return i186.dma[which].control;
12131213
12141214      default:
1215         logerror("%05X:read 80186 port %02X\n", activecpu_get_pc(), offset);
1215         logerror("%05X:read 80186 port %02X\n", cpu_get_pc(space->cpu), offset);
12161216         break;
12171217   }
12181218   return 0x00;
r3659r3660
12311231   switch (offset)
12321232   {
12331233      case 0x11:
1234         if (LOG_PORTS) logerror("%05X:80186 EOI = %04X\n", activecpu_get_pc(), data16);
1234         if (LOG_PORTS) logerror("%05X:80186 EOI = %04X\n", cpu_get_pc(space->cpu), data16);
12351235         handle_eoi(0x8000);
12361236         update_interrupt_state(machine);
12371237         break;
12381238
12391239      case 0x12:
1240         logerror("%05X:ERROR - write to 80186 interrupt poll = %04X\n", activecpu_get_pc(), data16);
1240         logerror("%05X:ERROR - write to 80186 interrupt poll = %04X\n", cpu_get_pc(space->cpu), data16);
12411241         break;
12421242
12431243      case 0x13:
1244         logerror("%05X:ERROR - write to 80186 interrupt poll status = %04X\n", activecpu_get_pc(), data16);
1244         logerror("%05X:ERROR - write to 80186 interrupt poll status = %04X\n", cpu_get_pc(space->cpu), data16);
12451245         break;
12461246
12471247      case 0x14:
1248         if (LOG_PORTS) logerror("%05X:80186 interrupt mask = %04X\n", activecpu_get_pc(), data16);
1248         if (LOG_PORTS) logerror("%05X:80186 interrupt mask = %04X\n", cpu_get_pc(space->cpu), data16);
12491249         i186.intr.timer  = (i186.intr.timer  & ~0x08) | ((data16 << 3) & 0x08);
12501250         i186.intr.dma[0] = (i186.intr.dma[0] & ~0x08) | ((data16 << 1) & 0x08);
12511251         i186.intr.dma[1] = (i186.intr.dma[1] & ~0x08) | ((data16 << 0) & 0x08);
r3659r3660
12571257         break;
12581258
12591259      case 0x15:
1260         if (LOG_PORTS) logerror("%05X:80186 interrupt priority mask = %04X\n", activecpu_get_pc(), data16);
1260         if (LOG_PORTS) logerror("%05X:80186 interrupt priority mask = %04X\n", cpu_get_pc(space->cpu), data16);
12611261         i186.intr.priority_mask = data16 & 0x0007;
12621262         update_interrupt_state(machine);
12631263         break;
12641264
12651265      case 0x16:
1266         if (LOG_PORTS) logerror("%05X:80186 interrupt in-service = %04X\n", activecpu_get_pc(), data16);
1266         if (LOG_PORTS) logerror("%05X:80186 interrupt in-service = %04X\n", cpu_get_pc(space->cpu), data16);
12671267         i186.intr.in_service = data16 & 0x00ff;
12681268         update_interrupt_state(machine);
12691269         break;
12701270
12711271      case 0x17:
1272         if (LOG_PORTS) logerror("%05X:80186 interrupt request = %04X\n", activecpu_get_pc(), data16);
1272         if (LOG_PORTS) logerror("%05X:80186 interrupt request = %04X\n", cpu_get_pc(space->cpu), data16);
12731273         i186.intr.request = (i186.intr.request & ~0x00c0) | (data16 & 0x00c0);
12741274         update_interrupt_state(machine);
12751275         break;
12761276
12771277      case 0x18:
1278         if (LOG_PORTS) logerror("%05X:WARNING - wrote to 80186 interrupt status = %04X\n", activecpu_get_pc(), data16);
1278         if (LOG_PORTS) logerror("%05X:WARNING - wrote to 80186 interrupt status = %04X\n", cpu_get_pc(space->cpu), data16);
12791279         i186.intr.status = (i186.intr.status & ~0x8007) | (data16 & 0x8007);
12801280         update_interrupt_state(machine);
12811281         break;
12821282
12831283      case 0x19:
1284         if (LOG_PORTS) logerror("%05X:80186 timer interrupt contol = %04X\n", activecpu_get_pc(), data16);
1284         if (LOG_PORTS) logerror("%05X:80186 timer interrupt contol = %04X\n", cpu_get_pc(space->cpu), data16);
12851285         i186.intr.timer = data16 & 0x000f;
12861286         break;
12871287
12881288      case 0x1a:
1289         if (LOG_PORTS) logerror("%05X:80186 DMA 0 interrupt control = %04X\n", activecpu_get_pc(), data16);
1289         if (LOG_PORTS) logerror("%05X:80186 DMA 0 interrupt control = %04X\n", cpu_get_pc(space->cpu), data16);
12901290         i186.intr.dma[0] = data16 & 0x000f;
12911291         break;
12921292
12931293      case 0x1b:
1294         if (LOG_PORTS) logerror("%05X:80186 DMA 1 interrupt control = %04X\n", activecpu_get_pc(), data16);
1294         if (LOG_PORTS) logerror("%05X:80186 DMA 1 interrupt control = %04X\n", cpu_get_pc(space->cpu), data16);
12951295         i186.intr.dma[1] = data16 & 0x000f;
12961296         break;
12971297
12981298      case 0x1c:
1299         if (LOG_PORTS) logerror("%05X:80186 INT 0 interrupt control = %04X\n", activecpu_get_pc(), data16);
1299         if (LOG_PORTS) logerror("%05X:80186 INT 0 interrupt control = %04X\n", cpu_get_pc(space->cpu), data16);
13001300         i186.intr.ext[0] = data16 & 0x007f;
13011301         break;
13021302
13031303      case 0x1d:
1304         if (LOG_PORTS) logerror("%05X:80186 INT 1 interrupt control = %04X\n", activecpu_get_pc(), data16);
1304         if (LOG_PORTS) logerror("%05X:80186 INT 1 interrupt control = %04X\n", cpu_get_pc(space->cpu), data16);
13051305         i186.intr.ext[1] = data16 & 0x007f;
13061306         break;
13071307
13081308      case 0x1e:
1309         if (LOG_PORTS) logerror("%05X:80186 INT 2 interrupt control = %04X\n", activecpu_get_pc(), data16);
1309         if (LOG_PORTS) logerror("%05X:80186 INT 2 interrupt control = %04X\n", cpu_get_pc(space->cpu), data16);
13101310         i186.intr.ext[2] = data16 & 0x001f;
13111311         break;
13121312
13131313      case 0x1f:
1314         if (LOG_PORTS) logerror("%05X:80186 INT 3 interrupt control = %04X\n", activecpu_get_pc(), data16);
1314         if (LOG_PORTS) logerror("%05X:80186 INT 3 interrupt control = %04X\n", cpu_get_pc(space->cpu), data16);
13151315         i186.intr.ext[3] = data16 & 0x001f;
13161316         break;
13171317
13181318      case 0x28:
13191319      case 0x2c:
13201320      case 0x30:
1321         if (LOG_PORTS) logerror("%05X:80186 Timer %d count = %04X\n", activecpu_get_pc(), (offset - 0x28) / 4, data16);
1321         if (LOG_PORTS) logerror("%05X:80186 Timer %d count = %04X\n", cpu_get_pc(space->cpu), (offset - 0x28) / 4, data16);
13221322         which = (offset - 0x28) / 4;
13231323         internal_timer_update(which, data16, -1, -1, -1);
13241324         break;
r3659r3660
13261326      case 0x29:
13271327      case 0x2d:
13281328      case 0x31:
1329         if (LOG_PORTS) logerror("%05X:80186 Timer %d max A = %04X\n", activecpu_get_pc(), (offset - 0x29) / 4, data16);
1329         if (LOG_PORTS) logerror("%05X:80186 Timer %d max A = %04X\n", cpu_get_pc(space->cpu), (offset - 0x29) / 4, data16);
13301330         which = (offset - 0x29) / 4;
13311331         internal_timer_update(which, -1, data16, -1, -1);
13321332         break;
13331333
13341334      case 0x2a:
13351335      case 0x2e:
1336         if (LOG_PORTS) logerror("%05X:80186 Timer %d max B = %04X\n", activecpu_get_pc(), (offset - 0x2a) / 4, data16);
1336         if (LOG_PORTS) logerror("%05X:80186 Timer %d max B = %04X\n", cpu_get_pc(space->cpu), (offset - 0x2a) / 4, data16);
13371337         which = (offset - 0x2a) / 4;
13381338         internal_timer_update(which, -1, -1, data16, -1);
13391339         break;
r3659r3660
13411341      case 0x2b:
13421342      case 0x2f:
13431343      case 0x33:
1344         if (LOG_PORTS) logerror("%05X:80186 Timer %d control = %04X\n", activecpu_get_pc(), (offset - 0x2b) / 4, data16);
1344         if (LOG_PORTS) logerror("%05X:80186 Timer %d control = %04X\n", cpu_get_pc(space->cpu), (offset - 0x2b) / 4, data16);
13451345         which = (offset - 0x2b) / 4;
13461346         internal_timer_update(which, -1, -1, -1, data16);
13471347         break;
13481348
13491349      case 0x50:
1350         if (LOG_PORTS) logerror("%05X:80186 upper chip select = %04X\n", activecpu_get_pc(), data16);
1350         if (LOG_PORTS) logerror("%05X:80186 upper chip select = %04X\n", cpu_get_pc(space->cpu), data16);
13511351         i186.mem.upper = data16 | 0xc038;
13521352         break;
13531353
13541354      case 0x51:
1355         if (LOG_PORTS) logerror("%05X:80186 lower chip select = %04X\n", activecpu_get_pc(), data16);
1355         if (LOG_PORTS) logerror("%05X:80186 lower chip select = %04X\n", cpu_get_pc(space->cpu), data16);
13561356         i186.mem.lower = (data16 & 0x3fff) | 0x0038; printf("%X",i186.mem.lower);
13571357         break;
13581358
13591359      case 0x52:
1360         if (LOG_PORTS) logerror("%05X:80186 peripheral chip select = %04X\n", activecpu_get_pc(), data16);
1360         if (LOG_PORTS) logerror("%05X:80186 peripheral chip select = %04X\n", cpu_get_pc(space->cpu), data16);
13611361         i186.mem.peripheral = data16 | 0x0038;
13621362         break;
13631363
13641364      case 0x53:
1365         if (LOG_PORTS) logerror("%05X:80186 middle chip select = %04X\n", activecpu_get_pc(), data16);
1365         if (LOG_PORTS) logerror("%05X:80186 middle chip select = %04X\n", cpu_get_pc(space->cpu), data16);
13661366         i186.mem.middle = data16 | 0x01f8;
13671367         break;
13681368
13691369      case 0x54:
1370         if (LOG_PORTS) logerror("%05X:80186 middle P chip select = %04X\n", activecpu_get_pc(), data16);
1370         if (LOG_PORTS) logerror("%05X:80186 middle P chip select = %04X\n", cpu_get_pc(space->cpu), data16);
13711371         i186.mem.middle_size = data16 | 0x8038;
13721372
13731373         temp = (i186.mem.peripheral & 0xffc0) << 4;
r3659r3660
13911391
13921392      case 0x60:
13931393      case 0x68:
1394         if (LOG_PORTS) logerror("%05X:80186 DMA%d lower source address = %04X\n", activecpu_get_pc(), (offset - 0x60) / 8, data16);
1394         if (LOG_PORTS) logerror("%05X:80186 DMA%d lower source address = %04X\n", cpu_get_pc(space->cpu), (offset - 0x60) / 8, data16);
13951395         which = (offset - 0x60) / 8;
13961396//         stream_update(dma_stream, 0);
13971397         i186.dma[which].source = (i186.dma[which].source & ~0x0ffff) | (data16 & 0x0ffff);
r3659r3660
13991399
14001400      case 0x61:
14011401      case 0x69:
1402         if (LOG_PORTS) logerror("%05X:80186 DMA%d upper source address = %04X\n", activecpu_get_pc(), (offset - 0x61) / 8, data16);
1402         if (LOG_PORTS) logerror("%05X:80186 DMA%d upper source address = %04X\n", cpu_get_pc(space->cpu), (offset - 0x61) / 8, data16);
14031403         which = (offset - 0x61) / 8;
14041404//         stream_update(dma_stream, 0);
14051405         i186.dma[which].source = (i186.dma[which].source & ~0xf0000) | ((data16 << 16) & 0xf0000);
r3659r3660
14071407
14081408      case 0x62:
14091409      case 0x6a:
1410         if (LOG_PORTS) logerror("%05X:80186 DMA%d lower dest address = %04X\n", activecpu_get_pc(), (offset - 0x62) / 8, data16);
1410         if (LOG_PORTS) logerror("%05X:80186 DMA%d lower dest address = %04X\n", cpu_get_pc(space->cpu), (offset - 0x62) / 8, data16);
14111411         which = (offset - 0x62) / 8;
14121412//         stream_update(dma_stream, 0);
14131413         i186.dma[which].dest = (i186.dma[which].dest & ~0x0ffff) | (data16 & 0x0ffff);
r3659r3660
14151415
14161416      case 0x63:
14171417      case 0x6b:
1418         if (LOG_PORTS) logerror("%05X:80186 DMA%d upper dest address = %04X\n", activecpu_get_pc(), (offset - 0x63) / 8, data16);
1418         if (LOG_PORTS) logerror("%05X:80186 DMA%d upper dest address = %04X\n", cpu_get_pc(space->cpu), (offset - 0x63) / 8, data16);
14191419         which = (offset - 0x63) / 8;
14201420//         stream_update(dma_stream, 0);
14211421         i186.dma[which].dest = (i186.dma[which].dest & ~0xf0000) | ((data16 << 16) & 0xf0000);
r3659r3660
14231423
14241424      case 0x64:
14251425      case 0x6c:
1426         if (LOG_PORTS) logerror("%05X:80186 DMA%d transfer count = %04X\n", activecpu_get_pc(), (offset - 0x64) / 8, data16);
1426         if (LOG_PORTS) logerror("%05X:80186 DMA%d transfer count = %04X\n", cpu_get_pc(space->cpu), (offset - 0x64) / 8, data16);
14271427         which = (offset - 0x64) / 8;
14281428//         stream_update(dma_stream, 0);
14291429         i186.dma[which].count = data16;
r3659r3660
14311431
14321432      case 0x65:
14331433      case 0x6d:
1434         if (LOG_PORTS) logerror("%05X:80186 DMA%d control = %04X\n", activecpu_get_pc(), (offset - 0x65) / 8, data16);
1434         if (LOG_PORTS) logerror("%05X:80186 DMA%d control = %04X\n", cpu_get_pc(space->cpu), (offset - 0x65) / 8, data16);
14351435         which = (offset - 0x65) / 8;
14361436//         stream_update(dma_stream, 0);
14371437         update_dma_control(which, data16);
14381438         break;
14391439
14401440      case 0x7f:
1441         if (LOG_PORTS) logerror("%05X:80186 relocation register = %04X\n", activecpu_get_pc(), data16);
1441         if (LOG_PORTS) logerror("%05X:80186 relocation register = %04X\n", cpu_get_pc(space->cpu), data16);
14421442
14431443         /* we assume here there that this doesn't happen too often */
14441444         /* plus, we can't really remove the old memory range, so we also assume that it's */
r3659r3660
14591459         break;
14601460
14611461      default:
1462         logerror("%05X:80186 port %02X = %04X\n", activecpu_get_pc(), offset, data16);
1462         logerror("%05X:80186 port %02X = %04X\n", cpu_get_pc(space->cpu), offset, data16);
14631463         break;
14641464   }
14651465}
r3659r3660
14931493 *************************************************************/
14941494 
14951495static PIC8259_SET_INT_LINE( compis_pic8259_master_set_int_line ) {
1496   cpunum_set_input_line(device->machine, 0, 0, interrupt ? HOLD_LINE : CLEAR_LINE);
1496   cpu_set_input_line(device->machine->cpu[0], 0, interrupt ? HOLD_LINE : CLEAR_LINE);
14971497}
14981498
14991499
src/mess/machine/pc8801.c
r3659r3660
123123   }
124124   if (level >= 0 && level<interrupt_level_reg)
125125   {
126      cpunum_set_input_line(machine, 0, 0, HOLD_LINE);
126      cpu_set_input_line(machine->cpu[0], 0, HOLD_LINE);
127127   }
128128}
129129
r3659r3660
390390      }
391391
392392      /* extension memory */
393      memory_set_bankptr(1, ext_r + 0x0000);
394      memory_set_bankptr(2, ext_r + 0x6000);
393      memory_set_bankptr(machine, 1, ext_r + 0x0000);
394      memory_set_bankptr(machine, 2, ext_r + 0x6000);
395395      if(ext_w==NULL)
396396      {
397397         /* read only mode */
r3659r3660
414414         /* RAM */
415415         memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x5fff, 0, 0, SMH_BANK1);
416416         memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x6000, 0x7fff, 0, 0, SMH_BANK2);
417         memory_set_bankptr(1, pc8801_mainRAM + 0x0000);
418         memory_set_bankptr(2, pc8801_mainRAM + 0x6000);
417         memory_set_bankptr(machine, 1, pc8801_mainRAM + 0x0000);
418         memory_set_bankptr(machine, 2, pc8801_mainRAM + 0x6000);
419419      }
420420      else
421421      {
r3659r3660
426426         if(ROMmode)
427427         {
428428            /* N-BASIC */
429            memory_set_bankptr(1, mainROM + 0x0000);
430            memory_set_bankptr(2, mainROM + 0x6000);
429            memory_set_bankptr(machine, 1, mainROM + 0x0000);
430            memory_set_bankptr(machine, 2, mainROM + 0x6000);
431431         }
432432         else
433433         {
434434            /* N88-BASIC */
435            memory_set_bankptr(1, mainROM + 0x8000);
435            memory_set_bankptr(machine, 1, mainROM + 0x8000);
436436            if(no4throm==1) {
437437               /* 4th ROM 1 */
438               memory_set_bankptr(2, mainROM + 0x10000 + 0x2000 * no4throm2);
438               memory_set_bankptr(machine, 2, mainROM + 0x10000 + 0x2000 * no4throm2);
439439            } else {
440               memory_set_bankptr(2, mainROM + 0xe000);
440               memory_set_bankptr(machine, 2, mainROM + 0xe000);
441441            }
442442         }
443443      }
r3659r3660
447447   memory_install_read8_handler(machine, 0,  ADDRESS_SPACE_PROGRAM, 0x8000, 0x83ff, 0, 0, (RAMmode || ROMmode) ? SMH_BANK3 : pc8801_read_textwindow);
448448   memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x8000, 0x83ff, 0, 0, (RAMmode || ROMmode) ? SMH_BANK3 : pc8801_write_textwindow);
449449
450   memory_set_bankptr(4, pc8801_mainRAM + 0x8400);
450   memory_set_bankptr(machine, 4, pc8801_mainRAM + 0x8400);
451451
452452   if(is_pc8801_vram_select(machine))
453453   {
r3659r3660
461461      memory_install_read8_handler(machine, 0,  ADDRESS_SPACE_PROGRAM, 0xf000, 0xffff, 0, 0, SMH_BANK6);
462462      memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xf000, 0xffff, 0, 0, SMH_BANK6);
463463
464      memory_set_bankptr(5, pc8801_mainRAM + 0xc000);
464      memory_set_bankptr(machine, 5, pc8801_mainRAM + 0xc000);
465465      if(maptvram)
466         memory_set_bankptr(6, pc88sr_textRAM);
466         memory_set_bankptr(machine, 6, pc88sr_textRAM);
467467      else
468         memory_set_bankptr(6, pc8801_mainRAM + 0xf000);
468         memory_set_bankptr(machine, 6, pc8801_mainRAM + 0xf000);
469469   }
470470}
471471
r3659r3660
804804/* callback for /INT output from FDC */
805805static void pc8801_fdc_interrupt(int state)
806806{
807    cpunum_set_input_line(Machine, 1, 0, state ? HOLD_LINE : CLEAR_LINE);
807    cpu_set_input_line(Machine->cpu[1], 0, state ? HOLD_LINE : CLEAR_LINE);
808808}
809809
810810/* callback for /DRQ output from FDC */
src/mess/machine/pc.c
r3659r3660
172172
173173static PIC8259_SET_INT_LINE( pc_pic8259_master_set_int_line )
174174{
175   cpunum_set_input_line(device->machine, 0, 0, interrupt ? HOLD_LINE : CLEAR_LINE);
175   cpu_set_input_line(device->machine->cpu[0], 0, interrupt ? HOLD_LINE : CLEAR_LINE);
176176}
177177
178178
r3659r3660
226226   }
227227   else
228228   {
229      cpunum_set_input_line(device->machine, 0, 0, interrupt ? HOLD_LINE : CLEAR_LINE);
229      cpu_set_input_line(device->machine->cpu[0], 0, interrupt ? HOLD_LINE : CLEAR_LINE);
230230   }
231231}
232232
r3659r3660
448448
449449WRITE8_HANDLER( pc_nmi_enable_w )
450450{
451   logerror( "%08X: changing NMI state to %s\n", activecpu_get_pc(), data & 0x80 ? "enabled" : "disabled" );
451   logerror( "%08X: changing NMI state to %s\n", cpu_get_pc(space->cpu), data & 0x80 ? "enabled" : "disabled" );
452452
453453   nmi_enabled = data & 0x80;
454454}
src/mess/mess.mak
r3659r3660
431431   $(MESSOBJ)/super80.a \
432432   $(MESSOBJ)/telmac.a \
433433   $(MESSOBJ)/thomson.a \
434   $(MESSOBJ)/ti85.a \
434435   $(MESSOBJ)/tiger.a \
435436   $(MESSOBJ)/trs80.a \
436437   $(MESSOBJ)/ut88.a \
r3659r3660
482483#   $(MESSOBJ)/tangerin.a \
483484#   $(MESSOBJ)/tatung.a \
484485#   $(MESSOBJ)/teamconc.a \
485#   $(MESSOBJ)/ti85.a \
486486#   $(MESSOBJ)/ti99.a \
487487#   $(MESSOBJ)/tutor.a \
488488#   $(MESSOBJ)/tx0.a \
src/mess/drivers/x68k.c
r3659r3660
220220//              if(sys.mfp.iera & (1 << x))
221221                {
222222                    current_vector[6] = (sys.mfp.vr & 0xf0) | (x+8);
223                    cpunum_set_input_line_and_vector(machine, 0,sys.mfp.irqline,HOLD_LINE,(sys.mfp.vr & 0xf0) | (x + 8));
223                    cpu_set_input_line_and_vector(machine->cpu[0],sys.mfp.irqline,HOLD_LINE,(sys.mfp.vr & 0xf0) | (x + 8));
224224//                  logerror("MFP: Sent IRQ vector 0x%02x (IRQ line %i)\n",(sys.mfp.vr & 0xf0) | (x+8),sys.mfp.irqline);
225225                    return;  // one at a time only
226226                }
r3659r3660
239239//              if(sys.mfp.ierb & (1 << x))
240240                {
241241                    current_vector[6] = (sys.mfp.vr & 0xf0) | x;
242                    cpunum_set_input_line_and_vector(machine, 0,sys.mfp.irqline,HOLD_LINE,(sys.mfp.vr & 0xf0) | x);
242                    cpu_set_input_line_and_vector(machine->cpu[0],sys.mfp.irqline,HOLD_LINE,(sys.mfp.vr & 0xf0) | x);
243243//                  logerror("MFP: Sent IRQ vector 0x%02x (IRQ line %i)\n",(sys.mfp.vr & 0xf0) | x,sys.mfp.irqline);
244244                    return;  // one at a time only
245245                }
r3659r3660
796796      logerror("FDC: Drive #%i: Drive selection set to %02x\n",data & 0x03,data);
797797      break;
798798   default:
799//      logerror("FDC: [%08x] Wrote %04x to invalid FDC port %04x\n",activecpu_get_pc(),data,offset);
799//      logerror("FDC: [%08x] Wrote %04x to invalid FDC port %04x\n",cpu_get_pc(space->cpu),data,offset);
800800      break;
801801   }
802802}
r3659r3660
10011001      sys.sysport.sram_writeprotect = data;
10021002      break;
10031003   default:
1004//      logerror("SYS: [%08x] Wrote %04x to invalid or unimplemented system port %04x\n",activecpu_get_pc(),data,offset);
1004//      logerror("SYS: [%08x] Wrote %04x to invalid or unimplemented system port %04x\n",cpu_get_pc(space->cpu),data,offset);
10051005      break;
10061006   }
10071007}
r3659r3660
10391039    int ret;
10401040    // Initial settings indicate that IRQs are generated for FM (YM2151), Receive buffer error or full,
10411041    // MFP Timer C, and the power switch
1042//  logerror("MFP: [%08x] Reading offset %i\n",activecpu_get_pc(),offset);
1042//  logerror("MFP: [%08x] Reading offset %i\n",cpu_get_pc(space->cpu),offset);
10431043    switch(offset)
10441044    {
10451045    case 0x00:  // GPIP - General purpose I/O register (read-only)
r3659r3660
10521052//          ret |= 0x08;  // FM IRQ signal
10531053        if(video_screen_get_hpos(machine->primary_screen) > sys.crtc.width - 32)
10541054            ret |= 0x80;  // Hsync signal
1055//      logerror("MFP: [%08x] Reading offset %i (ret=%02x)\n",activecpu_get_pc(),offset,ret);
1055//      logerror("MFP: [%08x] Reading offset %i (ret=%02x)\n",cpu_get_pc(space->cpu),offset,ret);
10561056        return ret;  // bit 5 is always 1
10571057    case 3:
10581058        return sys.mfp.iera;
r3659r3660
10911091    case 23:
10921092        return x68k_keyboard_pop_scancode();
10931093    default:
1094//      logerror("MFP: [%08x] Offset %i read\n",activecpu_get_pc(),offset);
1094//      logerror("MFP: [%08x] Offset %i read\n",cpu_get_pc(space->cpu),offset);
10951095        return 0xff;
10961096    }
10971097}
r3659r3660
12171217         // Keyboard control command.
12181218         sys.mfp.usart.send_buffer = data;
12191219         x68k_keyboard_ctrl_w(data);
1220//          logerror("MFP: [%08x] USART Sent data %04x\n",activecpu_get_pc(),data);
1220//          logerror("MFP: [%08x] USART Sent data %04x\n",cpu_get_pc(space->cpu),data);
12211221      }
12221222      break;
12231223   default:
r3659r3660
14411441      if(ACCESSING_BITS_0_7)
14421442         offset++;
14431443      timer_set(ATTOTIME_IN_CYCLES(16,0), NULL, 0xeafa00+offset,x68k_fake_bus_error);
1444//      cpunum_set_input_line_and_vector(machine, 0,2,ASSERT_LINE,current_vector[2]);
1444//      cpu_set_input_line_and_vector(machine->cpu[0],2,ASSERT_LINE,current_vector[2]);
14451445   }
14461446   return 0xffff;
14471447}
r3659r3660
14571457      if(ACCESSING_BITS_0_7)
14581458         offset++;
14591459      timer_set(ATTOTIME_IN_CYCLES(16,0), NULL, 0xeafa00+offset,x68k_fake_bus_error);
1460//      cpunum_set_input_line_and_vector(machine, 0,2,ASSERT_LINE,current_vector[2]);
1460//      cpu_set_input_line_and_vector(machine->cpu[0],2,ASSERT_LINE,current_vector[2]);
14611461   }
14621462}
14631463
src/mess/drivers/mpf1.c
r3659r3660
4545      va_start( v, s_fmt );
4646      vsprintf( buf, s_fmt, v );
4747      va_end( v );
48      logerror( "%08x: %s", activecpu_get_pc(), buf );
48      logerror( "%08x: %s", cpu_get_pc(space->cpu), buf );
4949   }
5050}
5151
r3659r3660
369369        The next statement converts this to the following assignment: (which is compatible with draw_led())
370370        bit      7 6 5 4 3 2 1 0
371371        segment  p g f e d c b a */
372   if( data | ( activecpu_get_pc() != 0x63C ) )
372   if( data | ( cpu_get_pc(space->cpu) != 0x63C ) )
373373   {
374374      data = ( (data & 0x08) >> 3 ) |
375375             ( (data & 0x10) >> 3 ) |
src/mess/drivers/ex800.c
r3659r3660
188188
189189static READ8_HANDLER(ex800_porta_r)
190190{
191   logerror("PA R @%x\n", activecpu_get_pc());
191   logerror("PA R @%x\n", cpu_get_pc(space->cpu));
192192   return mame_rand(machine);
193193}
194194
195195static READ8_HANDLER(ex800_portb_r)
196196{
197   logerror("PB R @%x\n", activecpu_get_pc());
197   logerror("PB R @%x\n", cpu_get_pc(space->cpu));
198198   return mame_rand(machine);
199199}
200200
201201static READ8_HANDLER(ex800_portc_r)
202202{
203   logerror("PC R @%x\n", activecpu_get_pc());
203   logerror("PC R @%x\n", cpu_get_pc(space->cpu));
204204   return mame_rand(machine);
205205}
206206
r3659r3660
209209   if (PA6) logerror("BNK0 selected.\n");
210210   if (PA7) logerror("BNK1 selected.\n");
211211
212   logerror("PA W %x @%x\n", data, activecpu_get_pc());
212   logerror("PA W %x @%x\n", data, cpu_get_pc(space->cpu));
213213}
214214
215215static WRITE8_HANDLER(ex800_portb_w)
216216{
217217   if (data & 3)
218      logerror("PB0/1 Line feed @%x\n", activecpu_get_pc());
218      logerror("PB0/1 Line feed @%x\n", cpu_get_pc(space->cpu));
219219   if (!(data & 4))
220      logerror("PB2 Line feed @%x\n", activecpu_get_pc());
220      logerror("PB2 Line feed @%x\n", cpu_get_pc(space->cpu));
221221   if (data & 8)
222      logerror("PB3 Online LED on @%x\n", activecpu_get_pc());
222      logerror("PB3 Online LED on @%x\n", cpu_get_pc(space->cpu));
223223   else
224      logerror("PB3 Online LED off @%x\n", activecpu_get_pc());
224      logerror("PB3 Online LED off @%x\n", cpu_get_pc(space->cpu));
225225   if (data & 16)
226      logerror("PB4 Serial @%x\n", activecpu_get_pc());
226      logerror("PB4 Serial @%x\n", cpu_get_pc(space->cpu));
227227   if (data & 32)
228      logerror("PB4 Serial @%x\n", activecpu_get_pc());
228      logerror("PB4 Serial @%x\n", cpu_get_pc(space->cpu));
229229   if (data & 64)
230      logerror("PB4 Serial @%x\n", activecpu_get_pc());
230      logerror("PB4 Serial @%x\n", cpu_get_pc(space->cpu));
231231   if (data & 128)
232      logerror("PB3 Paper empty LED on @%x\n", activecpu_get_pc());
232      logerror("PB3 Paper empty LED on @%x\n", cpu_get_pc(space->cpu));
233233   else
234      logerror("PB3 Paper empty LED off @%x\n", activecpu_get_pc());
234      logerror("PB3 Paper empty LED off @%x\n", cpu_get_pc(space->cpu));
235235
236//  logerror("PB W %x @%x\n", data, activecpu_get_pc());
236//  logerror("PB W %x @%x\n", data, cpu_get_pc(space->cpu));
237237}
238238
239239static WRITE8_HANDLER(ex800_portc_w)
r3659r3660
243243   else
244244      beep_set_state(0, 1);
245245
246   logerror("PC W %x @%x\n", data, activecpu_get_pc());
246   logerror("PC W %x @%x\n", data, cpu_get_pc(space->cpu));
247247}
248248
249249
r3659r3660
251251
252252static READ8_HANDLER(ex800_devsel_r)
253253{
254   logerror("DEVSEL R @%x with offset %x\n", activecpu_get_pc(), offset);
254   logerror("DEVSEL R @%x with offset %x\n", cpu_get_pc(space->cpu), offset);
255255   return mame_rand(machine);
256256}
257257
258258static WRITE8_HANDLER(ex800_devsel_w)
259259{
260   logerror("DEVSEL W %x @%x with offset %x\n", data, activecpu_get_pc(), offset);
260   logerror("DEVSEL W %x @%x with offset %x\n", data, cpu_get_pc(space->cpu), offset);
261261}
262262
263263static READ8_HANDLER(ex800_gate5a_r)
264264{
265   logerror("GATE5A R @%x with offset %x\n", activecpu_get_pc(), offset);
265   logerror("GATE5A R @%x with offset %x\n", cpu_get_pc(space->cpu), offset);
266266   return mame_rand(machine);
267267}
268268
269269static WRITE8_HANDLER(ex800_gate5a_w)
270270{
271   logerror("GATE5A W %x @%x with offset %x\n", data, activecpu_get_pc(), offset);
271   logerror("GATE5A W %x @%x with offset %x\n", data, cpu_get_pc(space->cpu), offset);
272272}
273273
274274static READ8_HANDLER(ex800_iosel_r)
275275{
276   logerror("IOSEL R @%x with offset %x\n", activecpu_get_pc(), offset);
276   logerror("IOSEL R @%x with offset %x\n", cpu_get_pc(space->cpu), offset);
277277   return mame_rand(machine);
278278}
279279
280280static WRITE8_HANDLER(ex800_iosel_w)
281281{
282   logerror("IOSEL W %x @%x with offset %x\n", data, activecpu_get_pc(), offset);
282   logerror("IOSEL W %x @%x with offset %x\n", data, cpu_get_pc(space->cpu), offset);
283283}
284284
285285static READ8_HANDLER(ex800_gate7a_r)
286286{
287   logerror("GATE7A R @%x with offset %x\n", activecpu_get_pc(), offset);
287   logerror("GATE7A R @%x with offset %x\n", cpu_get_pc(space->cpu), offset);
288288   return mame_rand(machine);
289289}
290290
291291static WRITE8_HANDLER(ex800_gate7a_w)
292292{
293   logerror("GATE7A W %x @%x with offset %x\n", data, activecpu_get_pc(), offset);
293   logerror("GATE7A W %x @%x with offset %x\n", data, cpu_get_pc(space->cpu), offset);
294294}
295295
296296
src/mess/drivers/saturn.c
r3659r3660
245245#if 0
246246/*A-Bus IRQ checks,where they could be located these?*/
247247#define ABUSIRQ(_irq_,_vector_,_mask_) \
248   if(!(stv_scu[40] & _mask_)) { cpunum_set_input_line_and_vector(Machine, 0, _irq_, HOLD_LINE , _vector_); }
248   if(!(stv_scu[40] & _mask_)) { cpu_set_input_line_and_vector(Machine->cpu[0], _irq_, HOLD_LINE , _vector_); }
249249
250250if(stv_scu[42] & 1)//IRQ ACK
251251{
r3659r3660
541541
542542   if (offset == 0x33) return_data = saturn_region;
543543
544   if (LOG_SMPC) logerror ("cpu #%d (PC=%08X) SMPC: Read from Byte Offset %02x (%d) Returns %02x\n", cpu_getactivecpu(), activecpu_get_pc(), offset, offset>>1, return_data);
544   if (LOG_SMPC) logerror ("cpu #%d (PC=%08X) SMPC: Read from Byte Offset %02x (%d) Returns %02x\n", cpu_getactivecpu(), cpu_get_pc(space->cpu), offset, offset>>1, return_data);
545545
546546
547547   return return_data;
r3659r3660
569569         intback_stage = 2;
570570      }
571571      smpc_intbackhelper(machine);
572      cpunum_set_input_line_and_vector(machine, 0, 8, HOLD_LINE , 0x47);
572      cpu_set_input_line_and_vector(machine->cpu[0], 8, HOLD_LINE , 0x47);
573573   }
574574
575575   if ((offset == 1) && (data & 0x40))
r3659r3660
612612         if(!(stv_scu[40] & 0x0100)) /*Pad irq*/
613613         {
614614            if(LOG_SMPC) logerror ("Interrupt: PAD irq at scanline %04x, Vector 0x48 Level 0x08\n",scanline);
615            cpunum_set_input_line_and_vector(machine, 0, 8, HOLD_LINE , 0x48);
615            cpu_set_input_line_and_vector(machine->cpu[0], 8, HOLD_LINE , 0x48);
616616         }
617617   }
618618
r3659r3660
629629            if(LOG_SMPC) logerror ("SMPC: Slave ON\n");
630630            smpc_ram[0x5f]=0x02;
631631            stv_enable_slave_sh2 = 1;
632            cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, CLEAR_LINE);
632            cpu_set_input_line(machine->cpu[1], INPUT_LINE_RESET, CLEAR_LINE);
633633            break;
634634         case 0x03:
635635            if(LOG_SMPC) logerror ("SMPC: Slave OFF\n");
636636            smpc_ram[0x5f]=0x03;
637637            stv_enable_slave_sh2 = 0;
638638            cpu_trigger(machine, 1000);
639            cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, ASSERT_LINE);
639            cpu_set_input_line(machine->cpu[1], INPUT_LINE_RESET, ASSERT_LINE);
640640            break;
641641         case 0x06:
642642            if(LOG_SMPC) logerror ("SMPC: Sound ON\n");
r3659r3660
657657         case 0x0d:
658658            if(LOG_SMPC) logerror ("SMPC: System Reset\n");
659659            smpc_ram[0x5f]=0x0d;
660            cpunum_set_input_line(machine, 0, INPUT_LINE_RESET, PULSE_LINE);
660            cpu_set_input_line(machine->cpu[0], INPUT_LINE_RESET, PULSE_LINE);
661661            system_reset();
662662            break;
663663         case 0x0e:
r3659r3660
666666            cpunum_set_clock(machine, 0, MASTER_CLOCK_352/2);
667667            cpunum_set_clock(machine, 1, MASTER_CLOCK_352/2);
668668            cpunum_set_clock(machine, 2, MASTER_CLOCK_352/5);
669            cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE); // ff said this causes nmi, should we set a timer then nmi?
669            cpu_set_input_line(machine->cpu[0], INPUT_LINE_NMI, PULSE_LINE); // ff said this causes nmi, should we set a timer then nmi?
670670            break;
671671         case 0x0f:
672672            if(LOG_SMPC) logerror ("SMPC: Change Clock to 320\n");
r3659r3660
674674            cpunum_set_clock(machine, 0, MASTER_CLOCK_320/2);
675675            cpunum_set_clock(machine, 1, MASTER_CLOCK_320/2);
676676            cpunum_set_clock(machine, 2, MASTER_CLOCK_320/5);
677            cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE); // ff said this causes nmi, should we set a timer then nmi?
677            cpu_set_input_line(machine->cpu[0], INPUT_LINE_NMI, PULSE_LINE); // ff said this causes nmi, should we set a timer then nmi?
678678            break;
679679         /*"Interrupt Back"*/
680680         case 0x10:
r3659r3660
726726            {
727727//                  if(LOG_SMPC) logerror ("Interrupt: System Manager (SMPC) at scanline %04x, Vector 0x47 Level 0x08\n",scanline);
728728               smpc_intbackhelper(machine);
729               cpunum_set_input_line_and_vector(machine, 0, 8, HOLD_LINE , 0x47);
729               cpu_set_input_line_and_vector(machine->cpu[0], 8, HOLD_LINE , 0x47);
730730            }
731731         break;
732732         /* RTC write*/
r3659r3660
755755            if(LOG_SMPC) logerror ("SMPC: NMI request\n");
756756            smpc_ram[0x5f]=0x18;
757757            /*NMI is unconditionally requested?*/
758            cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE);
758            cpu_set_input_line(machine->cpu[0], INPUT_LINE_NMI, PULSE_LINE);
759759            break;
760760         case 0x19:
761761            if(LOG_SMPC) logerror ("SMPC: NMI Enable\n");
r3659r3660
771771
772772            break;
773773         default:
774            if(LOG_SMPC) logerror ("cpu #%d (PC=%08X) SMPC: undocumented Command %02x\n", cpu_getactivecpu(), activecpu_get_pc(), data);
774            if(LOG_SMPC) logerror ("cpu #%d (PC=%08X) SMPC: undocumented Command %02x\n", cpu_getactivecpu(), cpu_get_pc(space->cpu), data);
775775      }
776776
777777      // we've processed the command, clear status flag
r3659r3660
850850      if(!(stv_scu[40] & 2))/*VBLANK-OUT*/
851851      {
852852         if(LOG_IRQ) logerror ("Interrupt: VBlank-OUT at scanline %04x, Vector 0x41 Level 0x0e\n",scanline);
853         cpunum_set_input_line_and_vector(machine, 0, 0xe, HOLD_LINE , 0x41);
853         cpu_set_input_line_and_vector(machine->cpu[0], 0xe, HOLD_LINE , 0x41);
854854      }
855855      stv_vblank = 0;
856856   }
r3659r3660
866866         if((!(stv_scu[40] & 0x10)) && (!(stv_scu[38] & 0x80)))
867867         {
868868            if(LOG_IRQ) logerror ("Interrupt: Timer 1 at scanline %04x, Vector 0x44 Level 0x0b\n",scanline);
869            cpunum_set_input_line_and_vector(machine, 0, 0xb, HOLD_LINE, 0x44 );
869            cpu_set_input_line_and_vector(machine->cpu[0], 0xb, HOLD_LINE, 0x44 );
870870         }
871871         else if((!(stv_scu[40] & 0x10)) && (stv_scu[38] & 0x80))
872872         {
873873            if(timer_1 == (stv_scu[36] & 0x1ff))
874874            {
875875               if(LOG_IRQ) logerror ("Interrupt: Timer 1 at scanline %04x, Vector 0x44 Level 0x0b\n",scanline);
876               cpunum_set_input_line_and_vector(machine, 0, 0xb, HOLD_LINE, 0x44 );
876               cpu_set_input_line_and_vector(machine->cpu[0], 0xb, HOLD_LINE, 0x44 );
877877            }
878878         }
879879      }
r3659r3660
882882         if(!(stv_scu[40] & 8))/*Timer 0*/
883883         {
884884            if(LOG_IRQ) logerror ("Interrupt: Timer 0 at scanline %04x, Vector 0x43 Level 0x0c\n",scanline);
885            cpunum_set_input_line_and_vector(machine, 0, 0xc, HOLD_LINE, 0x43 );
885            cpu_set_input_line_and_vector(machine->cpu[0], 0xc, HOLD_LINE, 0x43 );
886886         }
887887      }
888888
r3659r3660
890890      if(!(stv_scu[40] & 4))/*HBLANK-IN*/
891891      {
892892         if(LOG_IRQ) logerror ("Interrupt: HBlank-In at scanline %04x, Vector 0x42 Level 0x0d\n",scanline);
893         cpunum_set_input_line_and_vector(machine, 0, 0xd, HOLD_LINE , 0x42);
893         cpu_set_input_line_and_vector(machine->cpu[0], 0xd, HOLD_LINE , 0x42);
894894      }
895895   }
896896   else if(scanline == 224)
r3659r3660
901901      if(!(stv_scu[40] & 1))/*VBLANK-IN*/
902902      {
903903         if(LOG_IRQ) logerror ("Interrupt: VBlank IN at scanline %04x, Vector 0x40 Level 0x0f\n",scanline);
904         cpunum_set_input_line_and_vector(machine, 0, 0xf, HOLD_LINE , 0x40);
904         cpu_set_input_line_and_vector(machine->cpu[0], 0xf, HOLD_LINE , 0x40);
905905      }
906906      stv_vblank = 1;
907907
r3659r3660
910910         if(!(stv_scu[40] & 8))/*Timer 0*/
911911         {
912912            if(LOG_IRQ) logerror ("Interrupt: Timer 0 at scanline %04x, Vector 0x43 Level 0x0c\n",scanline);
913            cpunum_set_input_line_and_vector(machine, 0, 0xc, HOLD_LINE, 0x43 );
913            cpu_set_input_line_and_vector(machine->cpu[0], 0xc, HOLD_LINE, 0x43 );
914914         }
915915      }
916916      if(!(stv_scu[40] & 0x2000)) /*Sprite draw end irq*/
917         cpunum_set_input_line_and_vector(machine, 0, 2, HOLD_LINE , 0x4d);
917         cpu_set_input_line_and_vector(machine->cpu[0], 2, HOLD_LINE , 0x4d);
918918   }
919919}
920920
r3659r3660
10611061
10621062   if (offset == 31)
10631063   {
1064      if(LOG_SCU) logerror("(PC=%08x) DMA status reg read\n",activecpu_get_pc());
1064      if(LOG_SCU) logerror("(PC=%08x) DMA status reg read\n",cpu_get_pc(space->cpu));
10651065         return stv_scu[offset];
10661066   }
10671067   else if ( offset == 35 )
r3659r3660
10711071    }
10721072    else if( offset == 41)
10731073    {
1074      logerror("(PC=%08x) IRQ status reg read\n",activecpu_get_pc());
1074      logerror("(PC=%08x) IRQ status reg read\n",cpu_get_pc(space->cpu));
10751075      /*TODO:for now we're activating everything here,but we need to return the proper active irqs*/
10761076      return 0xffffffff;
10771077   }
10781078   else if( offset == 50 )
10791079   {
1080      logerror("(PC=%08x) SCU version reg read\n",activecpu_get_pc());
1080      logerror("(PC=%08x) SCU version reg read\n",cpu_get_pc(space->cpu));
10811081      return 0x00000000;/*SCU Version 0*/
10821082   }
10831083    else
10841084    {
1085       if(LOG_SCU) logerror("(PC=%08x) SCU reg read at %d = %08x\n",activecpu_get_pc(),offset,stv_scu[offset]);
1085       if(LOG_SCU) logerror("(PC=%08x) SCU reg read at %d = %08x\n",cpu_get_pc(space->cpu),offset,stv_scu[offset]);
10861086       return stv_scu[offset];
10871087      }
10881088}
r3659r3660
11371137         /*Sound IRQ*/
11381138         if(/*(!(stv_scu[40] & 0x40)) &&*/ scsp_to_main_irq == 1)
11391139         {
1140            //cpunum_set_input_line_and_vector(machine, 0, 9, HOLD_LINE , 0x46);
1140            //cpu_set_input_line_and_vector(machine->cpu[0], 9, HOLD_LINE , 0x46);
11411141            logerror("SCSP: Main CPU interrupt\n");
11421142            #if 0
11431143            if((scu_dst_0 & 0x7ffffff) != 0x05a00000)
11441144            {
11451145               if(!(stv_scu[40] & 0x1000))
11461146               {
1147                  cpunum_set_input_line_and_vector(machine, 0, 3, HOLD_LINE, 0x4c);
1147                  cpu_set_input_line_and_vector(machine->cpu[0], 3, HOLD_LINE, 0x4c);
11481148                  logerror("SCU: Illegal DMA interrupt\n");
11491149               }
11501150            }
r3659r3660
11981198         /*Sound IRQ*/
11991199         if(/*(!(stv_scu[40] & 0x40)) &&*/ scsp_to_main_irq == 1)
12001200         {
1201            //cpunum_set_input_line_and_vector(machine, 0, 9, HOLD_LINE , 0x46);
1201            //cpu_set_input_line_and_vector(machine->cpu[0], 9, HOLD_LINE , 0x46);
12021202            logerror("SCSP: Main CPU interrupt\n");
12031203         }
12041204      }
r3659r3660
12481248         /*Sound IRQ*/
12491249         if(/*(!(stv_scu[40] & 0x40)) &&*/ scsp_to_main_irq == 1)
12501250         {
1251            //cpunum_set_input_line_and_vector(machine, 0, 9, HOLD_LINE , 0x46);
1251            //cpu_set_input_line_and_vector(machine->cpu[0], 9, HOLD_LINE , 0x46);
12521252            logerror("SCSP: Main CPU interrupt\n");
12531253         }
12541254      }
r3659r3660
12991299         stv_scu[40] != 0xffffffff)
13001300      {
13011301         if(LOG_SCU) logerror("cpu #%d (PC=%08X) IRQ mask reg set %08x = %d%d%d%d|%d%d%d%d|%d%d%d%d|%d%d%d%d\n",
1302         cpu_getactivecpu(), activecpu_get_pc(),
1302         cpu_getactivecpu(), cpu_get_pc(space->cpu),
13031303         stv_scu[offset],
13041304         stv_scu[offset] & 0x8000 ? 1 : 0, /*A-Bus irq*/
13051305         stv_scu[offset] & 0x4000 ? 1 : 0, /*<reserved>*/
r3659r3660
14271427
14281428   if(LOG_SCU) logerror("DMA transfer END\n");
14291429   if(!(stv_scu[40] & 0x800))/*Lv 0 DMA end irq*/
1430      cpunum_set_input_line_and_vector(machine, 0, 5, HOLD_LINE , 0x4b);
1430      cpu_set_input_line_and_vector(machine->cpu[0], 5, HOLD_LINE , 0x4b);
14311431
14321432   if(scu_add_tmp & 0x80000000)
14331433   {
r3659r3660
15301530
15311531   if(LOG_SCU) logerror("DMA transfer END\n");
15321532   if(!(stv_scu[40] & 0x400))/*Lv 1 DMA end irq*/
1533      cpunum_set_input_line_and_vector(machine, 0, 6, HOLD_LINE , 0x4a);
1533      cpu_set_input_line_and_vector(machine->cpu[0], 6, HOLD_LINE , 0x4a);
15341534
15351535   if(scu_add_tmp & 0x80000000)
15361536   {
r3659r3660
16331633
16341634   if(LOG_SCU) logerror("DMA transfer END\n");
16351635   if(!(stv_scu[40] & 0x200))/*Lv 2 DMA end irq*/
1636      cpunum_set_input_line_and_vector(machine, 0, 6, HOLD_LINE , 0x49);
1636      cpu_set_input_line_and_vector(machine->cpu[0], 6, HOLD_LINE , 0x49);
16371637
16381638   if(scu_add_tmp & 0x80000000)
16391639   {
r3659r3660
17111711   }while(job_done == 0);
17121712
17131713   if(!(stv_scu[40] & 0x800))/*Lv 0 DMA end irq*/
1714      cpunum_set_input_line_and_vector(machine, 0, 5, HOLD_LINE , 0x4b);
1714      cpu_set_input_line_and_vector(machine->cpu[0], 5, HOLD_LINE , 0x4b);
17151715
17161716   D0MV_0;
17171717}
r3659r3660
17831783   }while(job_done == 0);
17841784
17851785   if(!(stv_scu[40] & 0x400))/*Lv 1 DMA end irq*/
1786      cpunum_set_input_line_and_vector(machine, 0, 6, HOLD_LINE , 0x4a);
1786      cpu_set_input_line_and_vector(machine->cpu[0], 6, HOLD_LINE , 0x4a);
17871787
17881788   D1MV_0;
17891789}
r3659r3660
18541854   }while(job_done == 0);
18551855
18561856   if(!(stv_scu[40] & 0x200))/*Lv 2 DMA end irq*/
1857      cpunum_set_input_line_and_vector(machine, 0, 6, HOLD_LINE , 0x49);
1857      cpu_set_input_line_and_vector(machine->cpu[0], 6, HOLD_LINE , 0x49);
18581858
18591859   D2MV_0;
18601860}
r3659r3660
18921892 * Enter into Radiant Silver Gun specific menu for a test...                       */
18931893static WRITE32_HANDLER( minit_w )
18941894{
1895   logerror("cpu #%d (PC=%08X) MINIT write = %08x\n",cpu_getactivecpu(), activecpu_get_pc(),data);
1895   logerror("cpu #%d (PC=%08X) MINIT write = %08x\n",cpu_getactivecpu(), cpu_get_pc(space->cpu),data);
18961896   cpu_boost_interleave(machine, minit_boost_timeslice, ATTOTIME_IN_USEC(minit_boost));
18971897   cpu_trigger(machine, 1000);
18981898   cpunum_set_info_int(1, CPUINFO_INT_SH2_FRT_INPUT, PULSE_LINE);
r3659r3660
19001900
19011901static WRITE32_HANDLER( sinit_w )
19021902{
1903   logerror("cpu #%d (PC=%08X) SINIT write = %08x\n",cpu_getactivecpu(), activecpu_get_pc(),data);
1903   logerror("cpu #%d (PC=%08X) SINIT write = %08x\n",cpu_getactivecpu(), cpu_get_pc(space->cpu),data);
19041904   cpu_boost_interleave(machine, sinit_boost_timeslice, ATTOTIME_IN_USEC(sinit_boost));
19051905   cpunum_set_info_int(0, CPUINFO_INT_SH2_FRT_INPUT, PULSE_LINE);
19061906}
r3659r3660
21622162static MACHINE_RESET( saturn )
21632163{
21642164   // don't let the slave cpu and the 68k go anywhere
2165   cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, ASSERT_LINE);
2165   cpu_set_input_line(machine->cpu[1], INPUT_LINE_RESET, ASSERT_LINE);
21662166   stv_enable_slave_sh2 = 0;
21672167   cpunum_set_input_line(machine, 2, INPUT_LINE_RESET, ASSERT_LINE);
21682168

Previous 15994 Revisions Next


© 1998-2018 The MESS Team