|
|
| version 1.2, 2003/10/18 00:35:35 | version 1.4, 2003/11/28 08:01:32 |
|---|---|
| Line 6 | Line 6 |
| #include "vram.h" | #include "vram.h" |
| // エンディアン修正しる! | |
| // C版EGCのみ ROPの回数を記録する | // C版EGCのみ ROPの回数を記録する |
| // #define LOG_EGCROP | // #define LOG_EGCROP |
| enum { | |
| EGCADDR_L = 0, | |
| EGCADDR_H = 1 | |
| }; | |
| #define EGCADDR(a) (a) | |
| static EGCQUAD egc_src; | static EGCQUAD egc_src; |
| static EGCQUAD data; | static EGCQUAD data; |
| Line 53 void egcshift(void) { | Line 59 void egcshift(void) { |
| BYTE src8, dst8; | BYTE src8, dst8; |
| egc.remain = (egc.leng & 0xfff) + 1; | egc.remain = LOW12(egc.leng) + 1; |
| egc.func = (egc.sft >> 12) & 1; | egc.func = (egc.sft >> 12) & 1; |
| if (!egc.func) { | if (!egc.func) { |
| egc.inptr = egc.buf; | egc.inptr = egc.buf; |
| Line 794 static void gdc_ope(UINT32 ad, UINT16 va | Line 800 static void gdc_ope(UINT32 ad, UINT16 va |
| } | } |
| break; | break; |
| default: | default: |
| #if defined(BYTESEX_LITTLE) | |
| data.w[0] = value; | data.w[0] = value; |
| data.w[1] = value; | data.w[1] = value; |
| data.w[2] = value; | data.w[2] = value; |
| data.w[3] = value; | data.w[3] = value; |
| #else | |
| data._b[0][0] = (BYTE)value; | |
| data._b[0][1] = (BYTE)(value >> 8); | |
| data.w[1] = data.w[0]; | |
| data.w[2] = data.w[0]; | |
| data.w[3] = data.w[0]; | |
| #endif | |
| break; | break; |
| } | } |
| } | } |
| Line 850 void MEMCALL egc_write(UINT32 addr, BYTE | Line 864 void MEMCALL egc_write(UINT32 addr, BYTE |
| UINT ext; | UINT ext; |
| UINT16 wvalue; | UINT16 wvalue; |
| addr &= 0x7fff; | addr = LOW15(addr); |
| ext = EGCADDR(addr & 1); | ext = EGCADDR(addr & 1); |
| if (!gdcs.access) { | if (!gdcs.access) { |
| gdcs.grphdisp |= 1; | gdcs.grphdisp |= 1; |
| Line 942 UINT16 MEMCALL egc_read_w(UINT32 addr) { | Line 956 UINT16 MEMCALL egc_read_w(UINT32 addr) { |
| if (!(egc.ope & 0x2000)) { | if (!(egc.ope & 0x2000)) { |
| int pl = (egc.fgbg >> 8) & 3; | int pl = (egc.fgbg >> 8) & 3; |
| if (!(egc.ope & 0x400)) { | if (!(egc.ope & 0x400)) { |
| return(egc_src.w[pl]); | return(LOADINTELWORD(egc_src._b[pl])); |
| } | } |
| else { | else { |
| return(LOADINTELWORD(mem + ad + planead[pl])); | return(LOADINTELWORD(mem + ad + planead[pl])); |
| Line 967 UINT16 MEMCALL egc_read_w(UINT32 addr) { | Line 981 UINT16 MEMCALL egc_read_w(UINT32 addr) { |
| void MEMCALL egc_write_w(UINT32 addr, UINT16 value) { | void MEMCALL egc_write_w(UINT32 addr, UINT16 value) { |
| if (!(addr & 1)) { // word access | if (!(addr & 1)) { // word access |
| addr &= 0x7ffe; | addr = LOW15(addr); |
| if (!gdcs.access) { | if (!gdcs.access) { |
| gdcs.grphdisp |= 1; | gdcs.grphdisp |= 1; |
| *(UINT16 *)(vramupdate + addr) |= 0x0101; | *(UINT16 *)(vramupdate + addr) |= 0x0101; |