|
|
| version 1.19, 2005/02/04 06:42:11 | version 1.20, 2008/06/02 20:07:31 |
|---|---|
| Line 91 static void crtc_dispupdate(void) { | Line 91 static void crtc_dispupdate(void) { |
| updatemask = 0x3ff; | updatemask = 0x3ff; |
| } | } |
| } | } |
| else { // Analog mode | else { /* Analog mode */ |
| updatemask = 0x3ff; | updatemask = 0x3ff; |
| if (!(crtc.s.SCRN_BITS & SCRN_TEXTYx2)) { | if (!(crtc.s.SCRN_BITS & SCRN_TEXTYx2)) { |
| if (crtc.s.SCRN_BITS & SCRN_24KHZ) { | if (crtc.s.SCRN_BITS & SCRN_24KHZ) { |
| if (crtc.s.width40) { | if (crtc.s.width40) { |
| if (crtc.s.SCRN_BITS & SCRN_200LINE) { // width 40,25,0,2 | if (crtc.s.SCRN_BITS & SCRN_200LINE) { |
| /* width 40,25,0,2 */ | |
| dispmode = scrnpage + SCRN64_320x200; | dispmode = scrnpage + SCRN64_320x200; |
| } | } |
| else { // width 40,25,1,2 | else { /* width 40,25,1,2 */ |
| dispmode = SCRN64_H320x400; | dispmode = SCRN64_H320x400; |
| } | } |
| } | } |
| else { // width 80,25,?,2 | else { /* width 80,25,?,2 */ |
| updatemask = 0x7ff; | updatemask = 0x7ff; |
| pal_bank = PAL_HIGHRESO; | pal_bank = PAL_HIGHRESO; |
| pal_disp = PAL_HIGHRESO; | pal_disp = PAL_HIGHRESO; |
| } | } |
| } | } |
| else { | else { |
| if (crtc.s.width40) { // width 40,25,0,1 | if (crtc.s.width40) { /* width 40,25,0,1 */ |
| if (crtc.s.EXTPALMODE & 0x10) { | if (crtc.s.EXTPALMODE & 0x10) { |
| if (crtc.s.ZPRY & 0x10) { | if (crtc.s.ZPRY & 0x10) { |
| dispmode = SCRN64_L320x200x2 + | dispmode = SCRN64_L320x200x2 + |
| Line 134 static void crtc_dispupdate(void) { | Line 135 static void crtc_dispupdate(void) { |
| pal_disp = PAL_4096 + PAL_4096FULL; | pal_disp = PAL_4096 + PAL_4096FULL; |
| } | } |
| } | } |
| else { // width 80,25,0,1 | else { /* width 80,25,0,1 */ |
| updatemask = 0x7ff; | updatemask = 0x7ff; |
| dispmode = SCRN_WIDTH80 + SCRN64_L640x200; | dispmode = SCRN_WIDTH80 + SCRN64_L640x200; |
| } | } |
| Line 143 static void crtc_dispupdate(void) { | Line 144 static void crtc_dispupdate(void) { |
| else { | else { |
| if (crtc.s.SCRN_BITS & SCRN_24KHZ) { | if (crtc.s.SCRN_BITS & SCRN_24KHZ) { |
| if (crtc.s.width40) { | if (crtc.s.width40) { |
| if (crtc.s.SCRN_BITS & SCRN_200LINE) { // width 40,12,0,2 | if (crtc.s.SCRN_BITS & SCRN_200LINE) { |
| /* width 40,12,0,2 */ | |
| dispmode = scrnpage + SCRN64_320x100; | dispmode = scrnpage + SCRN64_320x100; |
| } | } |
| else { // width 40,12,1,2 | else { /* width 40,12,1,2 */ |
| dispmode = SCRN64_H320x200; | dispmode = SCRN64_H320x200; |
| } | } |
| } | } |
| else { // width 80,12,?,2 | else { /* width 80,12,?,2 */ |
| pal_bank = PAL_HIGHRESO; | pal_bank = PAL_HIGHRESO; |
| pal_disp = PAL_HIGHRESO; | pal_disp = PAL_HIGHRESO; |
| } | } |
| } | } |
| else { | else { |
| if (crtc.s.width40) { // width 40,12,0,1 | if (crtc.s.width40) { /* width 40,12,0,1 */ |
| if (crtc.s.EXTPALMODE & 0x10) { | if (crtc.s.EXTPALMODE & 0x10) { |
| if (crtc.s.ZPRY & 0x10) { | if (crtc.s.ZPRY & 0x10) { |
| dispmode = SCRN64_320x100x2 + | dispmode = SCRN64_320x100x2 + |
| Line 180 static void crtc_dispupdate(void) { | Line 182 static void crtc_dispupdate(void) { |
| pal_disp = PAL_4096 + PAL_4096FULL; | pal_disp = PAL_4096 + PAL_4096FULL; |
| } | } |
| } | } |
| else { // width 80,12,0,1 | else { /* width 80,12,0,1 */ |
| dispmode = SCRN_WIDTH80 + SCRN64_L640x100; | dispmode = SCRN_WIDTH80 + SCRN64_L640x100; |
| } | } |
| } | } |
| Line 238 static void crtc_timingupdate(void) { | Line 240 static void crtc_timingupdate(void) { |
| UINT yl; | UINT yl; |
| SINT32 vsyncstart; | SINT32 vsyncstart; |
| // とりあえず…ね | /* とりあえず…ね */ |
| crtc.e.pos = crtc.s.reg[CRTCREG_POSL] | crtc.e.pos = crtc.s.reg[CRTCREG_POSL] |
| + ((crtc.s.reg[CRTCREG_POSH] & 7) << 8); | + ((crtc.s.reg[CRTCREG_POSH] & 7) << 8); |
| Line 247 static void crtc_timingupdate(void) { | Line 249 static void crtc_timingupdate(void) { |
| fontclock = (crtc.s.reg[CRTCREG_CHRCY] & 0x1f) + 1; | fontclock = (crtc.s.reg[CRTCREG_CHRCY] & 0x1f) + 1; |
| fontclock = (fontclock * crtc.e.rasterclock8) >> 8; | fontclock = (fontclock * crtc.e.rasterclock8) >> 8; |
| // YsIIIが yl==0で disp信号見る…なんで? | /* YsIIIが yl==0で disp信号見る…なんで? */ |
| yl = (crtc.s.reg[CRTCREG_VDISP] & 0x7f); | yl = (crtc.s.reg[CRTCREG_VDISP] & 0x7f); |
| crtc.e.yl = yl; | crtc.e.yl = yl; |
| iocore.e.dispclock = fontclock * max(yl, 1); | iocore.e.dispclock = fontclock * max(yl, 1); |
| Line 264 static void crtc_timingupdate(void) { | Line 266 static void crtc_timingupdate(void) { |
| } | } |
| // ---- CRTC | /* CRTC */ |
| void IOOUTCALL crtc_o(UINT port, REG8 value) { | void IOOUTCALL crtc_o(UINT port, REG8 value) { |
| Line 286 void IOOUTCALL crtc_o(UINT port, REG8 va | Line 288 void IOOUTCALL crtc_o(UINT port, REG8 va |
| } | } |
| // ---- スクリーンモード | /* スクリーンモード */ |
| void IOOUTCALL scrn_o(UINT port, REG8 value) { | void IOOUTCALL scrn_o(UINT port, REG8 value) { |
| Line 298 void IOOUTCALL scrn_o(UINT port, REG8 va | Line 300 void IOOUTCALL scrn_o(UINT port, REG8 va |
| crtc_bankupdate(); | crtc_bankupdate(); |
| } | } |
| if (modify & SCRN_DISPCHANGE) { | if (modify & SCRN_DISPCHANGE) { |
| // pal_reset(); // なんで? | |
| crtc.e.scrnallflash = 1; | crtc.e.scrnallflash = 1; |
| crtc_dispupdate(); | crtc_dispupdate(); |
| crtc_clkupdate(); | crtc_clkupdate(); |
| Line 315 REG8 IOINPCALL scrn_i(UINT port) { | Line 316 REG8 IOINPCALL scrn_i(UINT port) { |
| } | } |
| // ---- プライオリティ | /* プライオリティ */ |
| void IOOUTCALL ply_o(UINT port, REG8 value) { | void IOOUTCALL ply_o(UINT port, REG8 value) { |
| Line 336 void IOOUTCALL ply_o(UINT port, REG8 val | Line 337 void IOOUTCALL ply_o(UINT port, REG8 val |
| } | } |
| // ---- パレット | /* パレット */ |
| void IOOUTCALL palette_o(UINT port, REG8 value) { | void IOOUTCALL palette_o(UINT port, REG8 value) { |
| Line 371 void IOOUTCALL palette_o(UINT port, REG8 | Line 372 void IOOUTCALL palette_o(UINT port, REG8 |
| return; | return; |
| } | } |
| sft = (port >> (8 - 2)) & (3 << 2); | sft = (port >> (8 - 2)) & (3 << 2); |
| if (crtc.e.pal_bank & PAL_4096) { // use 4096palettes | if (crtc.e.pal_bank & PAL_4096) { /* use 4096palettes */ |
| num = ((port & 0xff) << 4) + (crtc.s.lastpal >> 4); | num = ((port & 0xff) << 4) + (crtc.s.lastpal >> 4); |
| if (!(crtc.e.pal_bank & PAL_4096FULL)) { | if (!(crtc.e.pal_bank & PAL_4096FULL)) { |
| num &= 0xccc; | num &= 0xccc; |
| Line 430 REG8 IOINPCALL blackctrl_i(UINT port) { | Line 431 REG8 IOINPCALL blackctrl_i(UINT port) { |
| } | } |
| // ---- turboZ | /* turboZ */ |
| #if defined(SUPPORT_TURBOZ) | #if defined(SUPPORT_TURBOZ) |
| REG8 IOINPCALL ply_i(UINT port) { | REG8 IOINPCALL ply_i(UINT port) { |
| Line 446 REG8 IOINPCALL palette_i(UINT port) { | Line 447 REG8 IOINPCALL palette_i(UINT port) { |
| REG8 sft; | REG8 sft; |
| if ((crtc.s.EXTPALMODE & 0x80) && ((crtc.s.EXTGRPHPAL & 0x88) == 0x88)) { | if ((crtc.s.EXTPALMODE & 0x80) && ((crtc.s.EXTGRPHPAL & 0x88) == 0x88)) { |
| if (crtc.e.pal_bank & PAL_4096) { // use 4096palettes | if (crtc.e.pal_bank & PAL_4096) { /* use 4096palettes */ |
| num = ((port & 0xff) << 4) + (crtc.s.lastpal >> 4); | num = ((port & 0xff) << 4) + (crtc.s.lastpal >> 4); |
| if (!(crtc.e.pal_bank & PAL_4096FULL)) { | if (!(crtc.e.pal_bank & PAL_4096FULL)) { |
| num &= 0xccc; | num &= 0xccc; |
| Line 541 REG8 IOINPCALL exttextdisp_i(UINT port) | Line 542 REG8 IOINPCALL exttextdisp_i(UINT port) |
| #endif | #endif |
| // ---- | /* extension */ |
| void crtc_update(void) { | void crtc_update(void) { |
| Line 560 void crtc_setwidth(REG8 width40) { | Line 561 void crtc_setwidth(REG8 width40) { |
| } | } |
| // ---- | /* init/reset */ |
| #if defined(SUPPORT_TURBOZ) | #if defined(SUPPORT_TURBOZ) |
| static void resetpal(void) { | static void resetpal(void) { |
| Line 594 void crtc_reset(void) { | Line 595 void crtc_reset(void) { |
| resetpal(); | resetpal(); |
| } | } |
| #endif | #endif |
| // IPLが勝手に切り替える筈である | #if 0 |
| // if ((pccore.ROM_TYPE >= 2) && (!(pccore.DIP_SW & 1))) { | /* IPLが勝手に切り替える筈である */ |
| // crtc.s.SCRN_BITS = SCRN_200LINE; | if ((pccore.ROM_TYPE >= 2) && (!(pccore.DIP_SW & 1))) { |
| // crtc.s.reg[CRTCREG_CHRCY] = 15; | crtc.s.SCRN_BITS = SCRN_200LINE; |
| // } | crtc.s.reg[CRTCREG_CHRCY] = 15; |
| } | |
| #endif /* 0 */ | |
| pal_reset(); | pal_reset(); |
| crtc.e.palandply = 1; | crtc.e.palandply = 1; |