--- np2/i286c/Attic/egcmem.c 2003/11/28 08:01:32 1.4 +++ np2/i286c/Attic/egcmem.c 2003/11/29 00:36:00 1.5 @@ -701,7 +701,7 @@ static void shiftinput_decw(void) { } -static void gdc_ope(UINT32 ad, UINT16 value, int func) { +static void gdc_ope(UINT32 ad, REG16 value, int func) { EGCQUAD pat; EGCQUAD dst; @@ -801,10 +801,10 @@ static void gdc_ope(UINT32 ad, UINT16 va break; default: #if defined(BYTESEX_LITTLE) - data.w[0] = value; - data.w[1] = value; - data.w[2] = value; - data.w[3] = value; + data.w[0] = (UINT16)value; + data.w[1] = (UINT16)value; + data.w[2] = (UINT16)value; + data.w[3] = (UINT16)value; #else data._b[0][0] = (BYTE)value; data._b[0][1] = (BYTE)(value >> 8); @@ -816,7 +816,7 @@ static void gdc_ope(UINT32 ad, UINT16 va } } -BYTE MEMCALL egc_read(UINT32 addr) { +REG8 MEMCALL egc_read(UINT32 addr) { UINT32 ad; UINT ext; @@ -859,10 +859,10 @@ BYTE MEMCALL egc_read(UINT32 addr) { } -void MEMCALL egc_write(UINT32 addr, BYTE value) { +void MEMCALL egc_write(UINT32 addr, REG8 value) { UINT ext; - UINT16 wvalue; + REG16 wvalue; addr = LOW15(addr); ext = EGCADDR(addr & 1); @@ -882,7 +882,8 @@ void MEMCALL egc_write(UINT32 addr, BYTE egc.patreg._b[3][ext] = mem[addr + VRAM_E]; } - wvalue = (value << 8) | (value); // ver0.28/pr4 + value = (BYTE)value; + wvalue = (value << 8) + value; if (!ext) { gdc_ope(addr, wvalue, egc.func + 6); } @@ -909,7 +910,7 @@ void MEMCALL egc_write(UINT32 addr, BYTE } } -UINT16 MEMCALL egc_read_w(UINT32 addr) { +REG16 MEMCALL egc_read_w(UINT32 addr) { UINT32 ad; @@ -965,20 +966,20 @@ UINT16 MEMCALL egc_read_w(UINT32 addr) { return(LOADINTELWORD(mem + addr)); } else if (!(egc.sft & 0x1000)) { - UINT16 ret; + REG16 ret; ret = egc_read(addr); ret |= egc_read(addr+1) << 8; return(ret); } else { - UINT16 ret; + REG16 ret; ret = egc_read(addr+1) << 8; ret |= egc_read(addr); return(ret); } } -void MEMCALL egc_write_w(UINT32 addr, UINT16 value) { +void MEMCALL egc_write_w(UINT32 addr, REG16 value) { if (!(addr & 1)) { // word access addr = LOW15(addr); @@ -1018,12 +1019,12 @@ void MEMCALL egc_write_w(UINT32 addr, UI } } else if (!(egc.sft & 0x1000)) { - egc_write(addr, (BYTE)value); - egc_write(addr+1, (BYTE)(value >> 8)); + egc_write(addr, (REG8)value); + egc_write(addr+1, (REG8)(value >> 8)); } else { - egc_write(addr+1, (BYTE)(value >> 8)); - egc_write(addr, (BYTE)value); + egc_write(addr+1, (REG8)(value >> 8)); + egc_write(addr, (REG8)value); } }