Previous 199869 Revisions Next

r18479 Friday 12th October, 2012 at 07:33:47 UTC by Fabio Priuli
(MESS) pc9801: fixed crash on boot. no whatsnew.
(MESS) superfx.c: using a couple of macro were it made sense. no functional change. no whatsnew.
[src/emu/cpu/superfx]superfx.c
[src/mess/drivers]pc9801.c

trunk/src/emu/cpu/superfx/superfx.c
r18478r18479
863863         case 0x04: // ROL
864864         {
865865            UINT16 carry = *(cpustate->sreg) & 0x8000;
866            superfx_gpr_write(cpustate, cpustate->dreg_idx, (*(cpustate->sreg) << 1) | (SUPERFX_SFR_CY_SET ? 1 : 0));
866            superfx_gpr_write(cpustate, cpustate->dreg_idx, (*(cpustate->sreg) << 1) | SUPERFX_SFR_CY_SET);
867867            cpustate->sfr &= ~SUPERFX_SFR_CY;
868868            cpustate->sfr |= carry ? SUPERFX_SFR_CY : 0;
869869            superfx_dreg_sfr_sz_update(cpustate);
r18478r18479
11031103                  cpustate->sfr |= (~(*(cpustate->sreg) ^ cpustate->r[op & 0xf]) & (cpustate->r[op & 0xf] ^ r) & 0x8000) ? SUPERFX_SFR_OV : 0;
11041104                  break;
11051105               case SUPERFX_SFR_ALT1: // ADC
1106                  r += cpustate->r[op & 0xf] + ((cpustate->sfr & SUPERFX_SFR_CY) ? 1 : 0);
1106                  r += cpustate->r[op & 0xf] + SUPERFX_SFR_CY_SET;
11071107                  cpustate->sfr |= (~(*(cpustate->sreg) ^ cpustate->r[op & 0xf]) & (cpustate->r[op & 0xf] ^ r) & 0x8000) ? SUPERFX_SFR_OV : 0;
11081108                  break;
11091109               case SUPERFX_SFR_ALT2: // ADDI
r18478r18479
11111111                  cpustate->sfr |= (~(*(cpustate->sreg) ^ (op & 0xf)) & ((op & 0xf) ^ r) & 0x8000) ? SUPERFX_SFR_OV : 0;
11121112                  break;
11131113               case SUPERFX_SFR_ALT3: // ADCI
1114                  r += (op & 0xf) + ((cpustate->sfr & SUPERFX_SFR_CY) ? 1 : 0);
1114                  r += (op & 0xf) + SUPERFX_SFR_CY_SET;
11151115                  cpustate->sfr |= (~(*(cpustate->sreg) ^ (op & 0xf)) & ((op & 0xf) ^ r) & 0x8000) ? SUPERFX_SFR_OV : 0;
11161116                  break;
11171117            }
r18478r18479
11371137                  superfx_gpr_write(cpustate, cpustate->dreg_idx, r);
11381138                  break;
11391139               case SUPERFX_SFR_ALT1: // SBC
1140                  r = *(cpustate->sreg) - cpustate->r[op & 0xf] - ((cpustate->sfr & SUPERFX_SFR_CY) ? 0 : 1);
1140                  r = *(cpustate->sreg) - cpustate->r[op & 0xf] - SUPERFX_SFR_CY_CLEAR;
11411141                  cpustate->sfr |= ((*(cpustate->sreg) ^ cpustate->r[op & 0xf]) & (*(cpustate->sreg) ^ r) & 0x8000) ? SUPERFX_SFR_OV : 0;
11421142                  superfx_gpr_write(cpustate, cpustate->dreg_idx, r);
11431143                  break;
trunk/src/mess/drivers/pc9801.c
r18478r18479
25252525   m_rtc->oe_w(1);
25262526
25272527   upd765a_device *fdc;
2528   fdc = machine().device<upd765a_device>("upd765_2hd");
2528   fdc = machine().device<upd765a_device>(":upd765_2hd");
25292529   fdc->setup_intrq_cb(upd765a_device::line_cb(FUNC(pc9801_state::fdc_2hd_irq), this));
25302530   fdc->setup_drq_cb(upd765a_device::line_cb(FUNC(pc9801_state::fdc_2hd_drq), this));
25312531
2532   fdc = machine().device<upd765a_device>("upd765_2dd");
2532   fdc = machine().device<upd765a_device>(":upd765_2dd");
25332533   fdc->setup_intrq_cb(upd765a_device::line_cb(FUNC(pc9801_state::fdc_2dd_irq), this));
25342534   fdc->setup_drq_cb(upd765a_device::line_cb(FUNC(pc9801_state::fdc_2dd_drq), this));
25352535
r18478r18479
25622562   MACHINE_RESET_CALL_MEMBER(pc9801);
25632563
25642564   /* 2dd interface ready line is ON by default */
2565   floppy_mon_w(floppy_get_device(machine(), 0), CLEAR_LINE);
2566   floppy_mon_w(floppy_get_device(machine(), 1), CLEAR_LINE);
2567   floppy_drive_set_ready_state(floppy_get_device(machine(), 0), (1), 0);
2568   floppy_drive_set_ready_state(floppy_get_device(machine(), 1), (1), 0);
2565   floppy_image_device *floppy;
2566   floppy = machine().device<floppy_connector>(":upd765_2hd:0")->get_device();
2567   if (floppy)
2568      floppy->mon_w(CLEAR_LINE);
2569   floppy = machine().device<floppy_connector>(":upd765_2hd:1")->get_device();
2570   if (floppy)
2571      floppy->mon_w(CLEAR_LINE);
25692572
25702573   {
25712574      UINT8 op_mode;

Previous 199869 Revisions Next


© 1997-2024 The MAME Team