|
|
| version 1.1.1.1, 2003/10/16 17:57:51 | version 1.8, 2005/02/08 09:19:00 |
|---|---|
| Line 1 | Line 1 |
| #include "compiler.h" | #include "compiler.h" |
| #include "memory.h" | #include "cpucore.h" |
| #include "egcmem.h" | |
| #include "pccore.h" | #include "pccore.h" |
| #include "iocore.h" | #include "iocore.h" |
| #include "memegc.h" | |
| #include "vram.h" | #include "vram.h" |
| // エンディアン修正しる。 | // エンディアン修正しる。 |
| const UINT32 maskword[16][2] = { | static const UINT16 maskword[16][4] = { |
| {0x00000000, 0x00000000}, {0x0000ffff, 0x00000000}, | {0x0000,0x0000,0x0000,0x0000}, {0xffff,0x0000,0x0000,0x0000}, |
| {0xffff0000, 0x00000000}, {0xffffffff, 0x00000000}, | {0x0000,0xffff,0x0000,0x0000}, {0xffff,0xffff,0x0000,0x0000}, |
| {0x00000000, 0x0000ffff}, {0x0000ffff, 0x0000ffff}, | {0x0000,0x0000,0xffff,0x0000}, {0xffff,0x0000,0xffff,0x0000}, |
| {0xffff0000, 0x0000ffff}, {0xffffffff, 0x0000ffff}, | {0x0000,0xffff,0xffff,0x0000}, {0xffff,0xffff,0xffff,0x0000}, |
| {0x00000000, 0xffff0000}, {0x0000ffff, 0xffff0000}, | {0x0000,0x0000,0x0000,0xffff}, {0xffff,0x0000,0x0000,0xffff}, |
| {0xffff0000, 0xffff0000}, {0xffffffff, 0xffff0000}, | {0x0000,0xffff,0x0000,0xffff}, {0xffff,0xffff,0x0000,0xffff}, |
| {0x00000000, 0xffffffff}, {0x0000ffff, 0xffffffff}, | {0x0000,0x0000,0xffff,0xffff}, {0xffff,0x0000,0xffff,0xffff}, |
| {0xffff0000, 0xffffffff}, {0xffffffff, 0xffffffff}}; | {0x0000,0xffff,0xffff,0xffff}, {0xffff,0xffff,0xffff,0xffff}}; |
| static void IOOUTCALL egc_o4a0(UINT port, BYTE value) { | static void IOOUTCALL egc_o4a0(UINT port, REG8 value) { |
| if (!(vramop.operate & VOP_EGCBIT)) { | if (!(vramop.operate & VOP_EGCBIT)) { |
| return; | return; |
| Line 57 static void IOOUTCALL egc_o4a0(UINT port | Line 57 static void IOOUTCALL egc_o4a0(UINT port |
| case 0x06: | case 0x06: |
| egc.fg &= 0xff00; | egc.fg &= 0xff00; |
| egc.fg |= value; | egc.fg |= value; |
| egc.fgc.d[0] = maskword[value & 15][0]; | egc.fgc.d[0] = *(UINT32 *)(maskword[value & 15] + 0); |
| egc.fgc.d[1] = maskword[value & 15][1]; | egc.fgc.d[1] = *(UINT32 *)(maskword[value & 15] + 2); |
| break; | break; |
| case 0x07: | case 0x07: |
| egc.fg &= 0x00ff; | egc.fg &= 0x00ff; |
| Line 67 static void IOOUTCALL egc_o4a0(UINT port | Line 67 static void IOOUTCALL egc_o4a0(UINT port |
| case 0x08: | case 0x08: |
| if (!(egc.fgbg & 0x6000)) { | if (!(egc.fgbg & 0x6000)) { |
| egc.mask.b[0] = value; | egc.mask._b[0] = value; |
| } | } |
| break; | break; |
| case 0x09: | case 0x09: |
| if (!(egc.fgbg & 0x6000)) { | if (!(egc.fgbg & 0x6000)) { |
| egc.mask.b[1] = value; | egc.mask._b[1] = value; |
| } | } |
| break; | break; |
| case 0x0a: | case 0x0a: |
| egc.bg &= 0xff00; | egc.bg &= 0xff00; |
| egc.bg |= value; | egc.bg |= value; |
| egc.bgc.d[0] = maskword[value & 15][0]; | egc.bgc.d[0] = *(UINT32 *)(maskword[value & 15] + 0); |
| egc.bgc.d[1] = maskword[value & 15][1]; | egc.bgc.d[1] = *(UINT32 *)(maskword[value & 15] + 2); |
| break; | break; |
| case 0x0b: | case 0x0b: |
| egc.bg &= 0x00ff; | egc.bg &= 0x00ff; |
| Line 91 static void IOOUTCALL egc_o4a0(UINT port | Line 91 static void IOOUTCALL egc_o4a0(UINT port |
| egc.sft &= 0xff00; | egc.sft &= 0xff00; |
| egc.sft |= value; | egc.sft |= value; |
| egcshift(); | egcshift(); |
| egc.srcmask.w = 0xffff; | |
| break; | break; |
| case 0x0d: | case 0x0d: |
| egc.sft &= 0x00ff; | egc.sft &= 0x00ff; |
| egc.sft |= value << 8; | egc.sft |= value << 8; |
| egcshift(); | egcshift(); |
| egc.srcmask.w = 0xffff; | |
| break; | break; |
| case 0x0e: | case 0x0e: |
| egc.leng &= 0xff00; | egc.leng &= 0xff00; |
| egc.leng |= value; | egc.leng |= value; |
| egcshift(); | egcshift(); |
| egc.srcmask.w = 0xffff; | |
| break; | break; |
| case 0x0f: | case 0x0f: |
| egc.leng &= 0x00ff; | egc.leng &= 0x00ff; |
| egc.leng |= value << 8; | egc.leng |= value << 8; |
| egcshift(); | egcshift(); |
| egc.srcmask.w = 0xffff; | |
| break; | break; |
| } | } |
| } | } |
| Line 119 void egc_reset(void) { | Line 123 void egc_reset(void) { |
| egc.mask.w = 0xffff; | egc.mask.w = 0xffff; |
| egc.leng = 0x000f; | egc.leng = 0x000f; |
| egcshift(); | egcshift(); |
| egc.srcmask.w = 0xffff; | |
| } | } |
| void egc_bind(void) { | void egc_bind(void) { |
| Line 130 void egc_bind(void) { | Line 135 void egc_bind(void) { |
| } | } |
| } | } |
| void IOOUTCALL egc_w16(UINT port, UINT16 value) { | void IOOUTCALL egc_w16(UINT port, REG16 value) { |
| if (!(vramop.operate & VOP_EGCBIT)) { | if (!(vramop.operate & VOP_EGCBIT)) { |
| return; | return; |
| Line 152 void IOOUTCALL egc_w16(UINT port, UINT16 | Line 157 void IOOUTCALL egc_w16(UINT port, UINT16 |
| case 0x06: | case 0x06: |
| egc.fg = value; | egc.fg = value; |
| egc.fgc.d[0] = maskword[value & 15][0]; | egc.fgc.d[0] = *(UINT32 *)(maskword[value & 15] + 0); |
| egc.fgc.d[1] = maskword[value & 15][1]; | egc.fgc.d[1] = *(UINT32 *)(maskword[value & 15] + 2); |
| break; | break; |
| case 0x08: | case 0x08: |
| Line 164 void IOOUTCALL egc_w16(UINT port, UINT16 | Line 169 void IOOUTCALL egc_w16(UINT port, UINT16 |
| case 0x0a: | case 0x0a: |
| egc.bg = value; | egc.bg = value; |
| egc.bgc.d[0] = maskword[value & 15][0]; | egc.bgc.d[0] = *(UINT32 *)(maskword[value & 15] + 0); |
| egc.bgc.d[1] = maskword[value & 15][1]; | egc.bgc.d[1] = *(UINT32 *)(maskword[value & 15] + 2); |
| break; | break; |
| case 0x0c: | case 0x0c: |
| egc.sft = value; | egc.sft = value; |
| egcshift(); | egcshift(); |
| egc.srcmask.w = 0xffff; | |
| break; | break; |
| case 0x0e: | case 0x0e: |
| egc.leng = value; | egc.leng = value; |
| egcshift(); | egcshift(); |
| egc.srcmask.w = 0xffff; | |
| break; | break; |
| } | } |
| } | } |