|
|
| version 1.12, 2004/08/17 12:30:41 | version 1.17, 2004/08/20 08:41:41 |
|---|---|
| Line 7 | Line 7 |
| #include "makescrn.h" | #include "makescrn.h" |
| UINT xmil_palettes; | UINT xmil_palettes; |
| RGB32 xmil_pal32[XMILPAL_MAX]; // xm_palette | RGB32 xmil_pal32[XMILPAL_MAX]; // xm_palette |
| #if defined(SUPPORT_16BPP) | #if defined(SUPPORT_16BPP) |
| RGB16 xmil_pal16[XMILPAL_MAX]; | RGB16 xmil_pal16[XMILPAL_MAX]; |
| #endif | |
| #if defined(SUPPORT_PALEVENT) | |
| PALEVENT palevent; | |
| #endif | #endif |
| #if defined(SUPPORT_TURBOZ) | |
| static const UINT16 pal4096banktbl[2][64] = { | static const UINT16 pal4096banktbl[2][64] = { |
| { 0x000, 0x008, 0x080, 0x088, 0x800, 0x808, 0x880, 0x888, | { 0x000, 0x008, 0x080, 0x088, 0x800, 0x808, 0x880, 0x888, |
| 0x004, 0x00C, 0x084, 0x08C, 0x804, 0x80C, 0x884, 0x88C, | 0x004, 0x00C, 0x084, 0x08C, 0x804, 0x80C, 0x884, 0x88C, |
| Line 33 static const UINT16 pal4096banktbl[2][64 | Line 36 static const UINT16 pal4096banktbl[2][64 |
| 0x110, 0x112, 0x130, 0x132, 0x310, 0x312, 0x330, 0x332, | 0x110, 0x112, 0x130, 0x132, 0x310, 0x312, 0x330, 0x332, |
| 0x111, 0x113, 0x131, 0x133, 0x311, 0x313, 0x331, 0x333}}; | 0x111, 0x113, 0x131, 0x133, 0x311, 0x313, 0x331, 0x333}}; |
| static void pal4096to64(RGB32 *pal, const UINT16 *map) { | |
| UINT r; | |
| r = 64; | |
| do { | |
| pal->d = xmil_pal32[XMILPAL_4096G + (*map++)].d; | |
| pal++; | |
| } while(--r); | |
| } | |
| #endif | |
| // ---- | |
| void pal_makegrad(RGB32 *pal, int pals, UINT32 bg, UINT32 fg) { | void pal_makegrad(RGB32 *pal, int pals, UINT32 bg, UINT32 fg) { |
| int i; | int i; |
| Line 212 void pal_setgrph4096(UINT num) { | Line 227 void pal_setgrph4096(UINT num) { |
| // ---- | // ---- |
| #if defined(SUPPORT_TURBOZ) | |
| static void pal4096to64(RGB32 *pal, const UINT16 *map) { | |
| UINT r; | |
| r = 64; | |
| do { | |
| pal->d = xmil_pal32[XMILPAL_4096G + (*map++)].d; | |
| pal++; | |
| } while(--r); | |
| } | |
| #endif | |
| void pal_update1(const UINT8 *rgbp) { | void pal_update1(const UINT8 *rgbp) { |
| UINT i; | UINT i; |
| Line 273 void pal_update1(const UINT8 *rgbp) { | Line 274 void pal_update1(const UINT8 *rgbp) { |
| } | } |
| } | } |
| else { | else { |
| bcnt = (crtc.s.BLACKPAL & 15) - 8; | bcnt = (rgbp[CRTC_BLACK] & 15) - 8; |
| for (j=i+8; j<64; j+=8) { | for (j=i+8; j<64; j+=8) { |
| bcnt--; | bcnt--; |
| if (bcnt) { | if (bcnt) { |
| Line 287 void pal_update1(const UINT8 *rgbp) { | Line 288 void pal_update1(const UINT8 *rgbp) { |
| } | } |
| } | } |
| } | } |
| #if defined(SUPPORT_16BPP) | |
| if (scrnmng_getbpp() == 16) { | |
| for (i=0; i<xmil_palettes; i++) { | |
| xmil_pal16[i] = scrnmng_makepal16(xmil_pal32[i]); | |
| } | |
| } | |
| #endif | |
| } | } |
| void pal_update(void) { | void pal_update(void) { |
| #if defined(SUPPORT_TURBOZ) || defined(SUPPORT_16BPP) | |
| UINT i; | UINT i; |
| #endif | |
| #if !defined(SUPPORT_TURBOZ) | #if !defined(SUPPORT_TURBOZ) |
| pal_update1(crtc.s.rgbp); | pal_update1(crtc.s.rgbp); |
| xmil_palettes = 64 + 64; | xmil_palettes = 64 + 64; |
| #else | #else |
| if (crtc.e.pal_disp & PAL_4096) { | if (!(crtc.e.dispmode & SCRN64_ENABLE)) { |
| pal_update1(crtc.s.rgbp); | |
| xmil_palettes = 64 + 64; | |
| scrndraw_changepalette(); | |
| return; | |
| } | |
| else if (crtc.e.pal_disp & PAL_4096) { | |
| switch(crtc.e.pal_disp & 0xf) { | switch(crtc.e.pal_disp & 0xf) { |
| case PAL_4096H: | case PAL_4096H: |
| pal4096to64(xmil_pal32, pal4096banktbl[0]); | pal4096to64(xmil_pal32, pal4096banktbl[0]); |
| Line 328 void pal_update(void) { | Line 344 void pal_update(void) { |
| xmil_pal32[xmil_palettes++].d = pals.text[i].d; | xmil_pal32[xmil_palettes++].d = pals.text[i].d; |
| } | } |
| } | } |
| else if ((crtc.e.dispmode & SCRN64_MASK) == SCRN64_INVALID) { | |
| pal_update1(crtc.s.rgbp); | |
| xmil_palettes = 64 + 64; | |
| } | |
| else { | else { |
| for (i=0; i<64; i++) { | for (i=0; i<64; i++) { |
| xmil_pal32[i].d = pals.grph64[crtc.e.pal_disp][i].d; | xmil_pal32[i].d = pals.grph64[crtc.e.pal_disp][i].d; |
| Line 353 void pal_update(void) { | Line 365 void pal_update(void) { |
| scrndraw_changepalette(); | scrndraw_changepalette(); |
| } | } |
| #if defined(SUPPORT_PALEVENT) | |
| void pal_eventclear(void) { | |
| if ((!corestat.drawframe) || | |
| (!xmilcfg.RASTER) || (scrnmng_getbpp() == 8)) { | |
| palevent.events = SUPPORT_PALEVENT; | |
| } | |
| else { | |
| CopyMemory(palevent.rgbp, crtc.s.rgbp, CRTC_RGBPMAX); | |
| palevent.events = 0; | |
| } | |
| } | |
| #endif | |
| // ---- | // ---- |