|
|
| version 1.7, 2004/08/17 12:30:41 | version 1.8, 2004/08/17 14:46:37 |
|---|---|
| Line 1 | Line 1 |
| #include "compiler.h" | #include "compiler.h" |
| #include "scrnmng.h" | #include "scrnmng.h" |
| #include "sysmng.h" | #include "sysmng.h" |
| #include "pccore.h" | |
| #include "iocore.h" | |
| #include "scrndraw.h" | #include "scrndraw.h" |
| #include "sdraw.h" | #include "sdraw.h" |
| #include "palettes.h" | #include "palettes.h" |
| Line 58 void scrndraw_changepalette(void) { | Line 60 void scrndraw_changepalette(void) { |
| updateallline(0x01010101); // fillrenewalline(0x03030303) | updateallline(0x01010101); // fillrenewalline(0x03030303) |
| } | } |
| // ---- | |
| #if 0 | |
| #if defined(SUPPORT_RASTER) | |
| static REG8 rasterdraw(SDRAWFN sdrawfn, SDRAW sdraw, int maxy) { | |
| SINT32 rasterclock; | |
| SINT32 clock; | |
| PAL1EVENT *event; | |
| PAL1EVENT *eventterm; | |
| int nextupdate; | |
| int y; | |
| rasterclock = crtc.e.rasterclock8; | |
| if (crtc.s.SCRN_BITS & SCRN_24KHZ) { | |
| rasterclock = rasterclock * 2; | |
| } | |
| clock = 0; | |
| event = palevent.event; | |
| eventterm = event + palevent.events; | |
| nextupdate = 0; | |
| for (y=2; y<maxy; y+=2) { | |
| if (event >= eventterm) { | |
| break; | |
| } | |
| clock += rasterclock; | |
| // お弁当はあった? | |
| if (clock > (event->clock << 8)) { | |
| (*sdrawfn)(sdraw, y); | |
| nextupdate = y; | |
| // お弁当を食べる | |
| while(clock > (event->clock << 8)) { | |
| // ((BYTE *)pal)[event->color] = event->value; | |
| event++; | |
| if (event >= eventterm) { | |
| break; | |
| } | |
| } | |
| } | |
| } | |
| if (y < maxy) { | |
| if (!(np2cfg.LCD_MODE & 1)) { | |
| pal_makeanalog(pal, 0xffff); | |
| } | |
| else { | |
| pal_makeanalog_lcd(pal, 0xffff); | |
| } | |
| if (np2cfg.skipline) { | |
| np2_pal32[0].d = np2_pal32[NP2PAL_SKIP].d; | |
| #if defined(SUPPORT_16BPP) | |
| np2_pal16[0] = np2_pal16[NP2PAL_SKIP]; | |
| #endif | |
| } | |
| (*sdrawfn)(sdraw, maxy); | |
| } | |
| if (palevent.vsyncpal) { | |
| return(2); | |
| } | |
| else if (nextupdate) { | |
| for (y=0; y<nextupdate; y+=2) { | |
| *(UINT16 *)(renewal_line + y) |= 0x8080; | |
| } | |
| return(1); | |
| } | |
| else { | |
| return(0); | |
| } | |
| } | |
| #endif | |
| #endif | |
| // ---- | |
| REG8 scrndraw_draw(REG8 redraw) { | REG8 scrndraw_draw(REG8 redraw) { |
| const SCRNSURF *surf; | const SCRNSURF *surf; |
| Line 65 const SDRAWFN *sdrawfn; | Line 143 const SDRAWFN *sdrawfn; |
| SDRAWFN fn; | SDRAWFN fn; |
| _SDRAW sdraw; | _SDRAW sdraw; |
| UINT i; | UINT i; |
| REG8 ret; | |
| if (redraw) { | if (redraw) { |
| updateallline(0x01010101); | updateallline(0x01010101); |
| Line 110 const SDRAWFN *sdrawfn; | Line 189 const SDRAWFN *sdrawfn; |
| sdraw.y = 0; | sdraw.y = 0; |
| sdraw.xalign = surf->xalign; | sdraw.xalign = surf->xalign; |
| sdraw.yalign = surf->yalign; | sdraw.yalign = surf->yalign; |
| ret = 0; | |
| #if 1 | |
| (*fn)(&sdraw, 400); | (*fn)(&sdraw, 400); |
| #else | |
| #if !defined(SUPPORT_PALEVENT) | |
| (*fn)(&sdraw, 400); | |
| #else | |
| if (((dispmode & SCRN64_MASK) != SCRN64_INVALID) || | |
| (palevent.events >= PALEVENTMAX)) { | |
| (*fn)(&sdraw, 400); | |
| } | |
| else { | |
| ret = rasterdraw(*sdrawfn, &sdraw, 400); | |
| } | |
| #endif | |
| #endif | |
| sddr_exit2: | sddr_exit2: |
| scrnmng_surfunlock(surf); | scrnmng_surfunlock(surf); |
| sddr_exit1: | sddr_exit1: |
| return(0); | return(ret); |
| } | } |
| void scrndraw_redraw(void) { | void scrndraw_redraw(void) { |