|
|
| version 1.17, 2004/02/21 00:25:33 | version 1.21, 2005/02/07 14:46:11 |
|---|---|
| Line 1 | Line 1 |
| #include "compiler.h" | #include "compiler.h" |
| #if !defined(DISABLE_MATH_H) | |
| #include <math.h> | #include <math.h> |
| #endif | |
| #include "cpucore.h" | #include "cpucore.h" |
| #include "pccore.h" | #include "pccore.h" |
| #include "iocore.h" | #include "iocore.h" |
| Line 14 enum { | Line 16 enum { |
| RT_TABLEMAX = (1 << RT_TABLEBIT) | RT_TABLEMAX = (1 << RT_TABLEBIT) |
| }; | }; |
| static UINT16 gdc_rt[RT_TABLEMAX+1]; | |
| typedef struct { | typedef struct { |
| SINT16 x; | SINT16 x; |
| SINT16 y; | SINT16 y; |
| Line 23 typedef struct { | Line 27 typedef struct { |
| const UINT32 gdcplaneseg[4] = {VRAM_E, VRAM_B, VRAM_R, VRAM_G}; | const UINT32 gdcplaneseg[4] = {VRAM_E, VRAM_B, VRAM_R, VRAM_G}; |
| static UINT16 gdc_rt[RT_TABLEMAX+1]; | |
| static const VECTDIR vectdir[16] = { | static const VECTDIR vectdir[16] = { |
| { 0, 1, 1, 0}, { 1, 1, 1,-1}, | { 0, 1, 1, 0}, { 1, 1, 1,-1}, |
| { 1, 0, 0,-1}, { 1,-1,-1,-1}, | { 1, 0, 0,-1}, { 1,-1,-1,-1}, |
| Line 90 REG8 gdcbitreverse(REG8 data) { | Line 92 REG8 gdcbitreverse(REG8 data) { |
| void gdcsub_initialize(void) { | void gdcsub_initialize(void) { |
| #if !defined(DISABLE_MATH_H) | |
| int i; | int i; |
| for (i=0; i<=RT_TABLEMAX; i++) { | for (i=0; i<=RT_TABLEMAX; i++) { |
| gdc_rt[i] = (UINT16)((double)(1 << RT_MULBIT) * | gdc_rt[i] = (UINT16)((double)(1 << RT_MULBIT) * |
| (1 - sqrt(1 - pow((0.70710678118654 * i) / RT_TABLEMAX, 2)))); | (1 - sqrt(1 - pow((0.70710678118654 * i) / RT_TABLEMAX, 2)))); |
| } | } |
| #endif | |
| } | } |
| void gdcslavewait(NEVENTITEM item) { | void gdcslavewait(NEVENTITEM item) { |
| Line 179 void gdcsub_setvectl(GDCVECT *vect, int | Line 183 void gdcsub_setvectl(GDCVECT *vect, int |
| } | } |
| } | } |
| } | } |
| if (ope & 1) { | if (!((ope + 1) & 2)) { |
| tmp = dx; | tmp = dx; |
| dx = dy; | dx = dy; |
| dy = tmp; | dy = tmp; |
| Line 288 void gdcsub_vectl(UINT32 csrw, const GDC | Line 292 void gdcsub_vectl(UINT32 csrw, const GDC |
| void gdcsub_vectt(UINT32 csrw, const GDCVECT *vect, REG16 pat, REG8 ope) { | void gdcsub_vectt(UINT32 csrw, const GDCVECT *vect, REG16 pat, REG8 ope) { |
| _GDCPSET pset; | _GDCPSET pset; |
| BYTE multiple; | UINT8 multiple; |
| UINT sx; | UINT sx; |
| const VECTDIR *dir; | const VECTDIR *dir; |
| BYTE muly; | UINT8 muly; |
| REG16 cx; | REG16 cx; |
| REG16 cy; | REG16 cy; |
| UINT xrem; | UINT xrem; |
| BYTE mulx; | UINT8 mulx; |
| if (vect->ope & 0x80) { // SL | if (vect->ope & 0x80) { // SL |
| pat = (REG16)((GDCPATREVERSE(pat) << 8) + GDCPATREVERSE(pat >> 8)); | pat = (REG16)((GDCPATREVERSE(pat) << 8) + GDCPATREVERSE(pat >> 8)); |
| Line 473 const VECTDIR *dir; | Line 477 const VECTDIR *dir; |
| calc_gdcslavewait(pset.dots); | calc_gdcslavewait(pset.dots); |
| } | } |
| void gdcsub_text(UINT32 csrw, const GDCVECT *vect, const BYTE *pat, | void gdcsub_text(UINT32 csrw, const GDCVECT *vect, const UINT8 *pat, |
| REG8 ope) { | REG8 ope) { |
| _GDCPSET pset; | _GDCPSET pset; |
| BYTE multiple; | UINT8 multiple; |
| UINT sx; | UINT sx; |
| UINT sy; | UINT sy; |
| const VECTDIR *dir; | const VECTDIR *dir; |
| UINT patnum; | UINT patnum; |
| BYTE muly; | UINT8 muly; |
| REG16 cx; | REG16 cx; |
| REG16 cy; | REG16 cy; |
| UINT xrem; | UINT xrem; |
| BYTE bit; | UINT8 bit; |
| BYTE mulx; | UINT8 mulx; |
| gdcpset_prepare(&pset, csrw, 0xffff, ope); | gdcpset_prepare(&pset, csrw, 0xffff, ope); |
| multiple = (gdc.s.para[GDC_ZOOM] & 15) + 1; | multiple = (gdc.s.para[GDC_ZOOM] & 15) + 1; |
| Line 554 void gdcsub_write(void) { | Line 558 void gdcsub_write(void) { |
| UINT16 data; | UINT16 data; |
| UINT32 adrs; | UINT32 adrs; |
| UINT leng; | UINT leng; |
| BYTE *ptr; | UINT8 *ptr; |
| UINT16 updatebit; | UINT16 updatebit; |
| #if 0 | #if 0 |
| Line 621 void gdcsub_write(void) { | Line 625 void gdcsub_write(void) { |
| ptr += VRAM_STEP; | ptr += VRAM_STEP; |
| updatebit = 0x0202; | updatebit = 0x0202; |
| } | } |
| gdcs.grphdisp |= (BYTE)updatebit; | gdcs.grphdisp |= (UINT8)updatebit; |
| ptr += gdcplaneseg[(adrs >> 14) & 3]; | ptr += gdcplaneseg[(adrs >> 14) & 3]; |
| adrs = (adrs & 0x3fff) << 1; | adrs = (adrs & 0x3fff) << 1; |