From 4a54fd4018adf931fb436acba2399efc6d6d1176 Mon Sep 17 00:00:00 2001 From: aliaspider Date: Mon, 3 Nov 2014 15:26:54 +0100 Subject: use stdint/stdbool --- source/fxinst.c | 278 ++++++++++++++++++++++++++++---------------------------- 1 file changed, 139 insertions(+), 139 deletions(-) (limited to 'source/fxinst.c') diff --git a/source/fxinst.c b/source/fxinst.c index 9481284..cc8cae0 100644 --- a/source/fxinst.c +++ b/source/fxinst.c @@ -140,23 +140,23 @@ extern void fx_flushCache(); /* 02 - cache - reintialize GSU cache */ static void fx_cache() { - uint32 c = R15 & 0xfff0; + uint32_t c = R15 & 0xfff0; if (GSU.vCacheBaseReg != c || !GSU.bCacheActive) { fx_flushCache(); GSU.vCacheBaseReg = c; - GSU.bCacheActive = TRUE; + GSU.bCacheActive = true; #if 0 if (c < (0x10000 - 512)) { - uint8 const* t = &ROM(c); + uint8_t const* t = &ROM(c); memcpy(GSU.pvCache, t, 512); } else { - uint8 const* t1; - uint8 const* t2; - uint32 i = 0x10000 - c; + uint8_t const* t1; + uint8_t const* t2; + uint32_t i = 0x10000 - c; t1 = &ROM(c); t2 = &ROM(0); memcpy(GSU.pvCache, t1, i); @@ -171,7 +171,7 @@ static void fx_cache() /* 03 - lsr - logic shift right */ static void fx_lsr() { - uint32 v; + uint32_t v; GSU.vCarry = SREG & 1; v = USEX16(SREG) >> 1; R15++; @@ -185,7 +185,7 @@ static void fx_lsr() /* 04 - rol - rotate left */ static void fx_rol() { - uint32 v = USEX16((SREG << 1) + GSU.vCarry); + uint32_t v = USEX16((SREG << 1) + GSU.vCarry); GSU.vCarry = (SREG >> 15) & 1; R15++; DREG = v; @@ -198,14 +198,14 @@ static void fx_rol() /* 05 - bra - branch always */ static void fx_bra() { - uint8 v = PIPE; + uint8_t v = PIPE; R15++; FETCHPIPE; R15 += SEX8(v); } /* Branch on condition */ -#define BRA_COND(cond) uint8 v = PIPE; R15++; FETCHPIPE; if(cond) R15 += SEX8(v); else R15++; +#define BRA_COND(cond) uint8_t v = PIPE; R15++; FETCHPIPE; if(cond) R15 += SEX8(v); else R15++; #define TEST_S (GSU.vSign & 0x8000) #define TEST_Z (USEX16(GSU.vZero) == 0) @@ -418,8 +418,8 @@ static void fx_with_r15() /* 30-3b - stw (rn) - store word */ #define FX_STW(reg) \ GSU.vLastRamAdr = GSU.avReg[reg]; \ -RAM(GSU.avReg[reg]) = (uint8)SREG; \ -RAM(GSU.avReg[reg]^1) = (uint8)(SREG>>8); \ +RAM(GSU.avReg[reg]) = (uint8_t)SREG; \ +RAM(GSU.avReg[reg]^1) = (uint8_t)(SREG>>8); \ CLRFLAGS; R15++ static void fx_stw_r0() { @@ -473,7 +473,7 @@ static void fx_stw_r11() /* 30-3b(ALT1) - stb (rn) - store byte */ #define FX_STB(reg) \ GSU.vLastRamAdr = GSU.avReg[reg]; \ -RAM(GSU.avReg[reg]) = (uint8)SREG; \ +RAM(GSU.avReg[reg]) = (uint8_t)SREG; \ CLRFLAGS; R15++ static void fx_stb_r0() { @@ -528,7 +528,7 @@ static void fx_stb_r11() static void fx_loop() { GSU.vSign = GSU.vZero = --R12; - if ((uint16) R12 != 0) + if ((uint16_t) R12 != 0) R15 = R13; else R15++; @@ -562,10 +562,10 @@ static void fx_alt3() } /* 40-4b - ldw (rn) - load word from RAM */ -#define FX_LDW(reg) uint32 v; \ +#define FX_LDW(reg) uint32_t v; \ GSU.vLastRamAdr = GSU.avReg[reg]; \ -v = (uint32)RAM(GSU.avReg[reg]); \ -v |= ((uint32)RAM(GSU.avReg[reg]^1))<<8; \ +v = (uint32_t)RAM(GSU.avReg[reg]); \ +v |= ((uint32_t)RAM(GSU.avReg[reg]^1))<<8; \ R15++; DREG = v; \ TESTR14; \ CLRFLAGS @@ -619,9 +619,9 @@ static void fx_ldw_r11() } /* 40-4b(ALT1) - ldb (rn) - load byte */ -#define FX_LDB(reg) uint32 v; \ +#define FX_LDB(reg) uint32_t v; \ GSU.vLastRamAdr = GSU.avReg[reg]; \ -v = (uint32)RAM(GSU.avReg[reg]); \ +v = (uint32_t)RAM(GSU.avReg[reg]); \ R15++; DREG = v; \ TESTR14; \ CLRFLAGS @@ -677,10 +677,10 @@ static void fx_ldb_r11() /* 4c - plot - plot pixel with R1,R2 as x,y and the color register as the color */ static void fx_plot_2bit() { - uint32 x = USEX8(R1); - uint32 y = USEX8(R2); - uint8* a; - uint8 v, c; + uint32_t x = USEX8(R1); + uint32_t y = USEX8(R2); + uint8_t* a; + uint8_t v, c; R15++; CLRFLAGS; @@ -690,9 +690,9 @@ static void fx_plot_2bit() if (y >= GSU.vScreenHeight) return; #endif if (GSU.vPlotOptionReg & 0x02) - c = (x ^ y) & 1 ? (uint8)(GSU.vColorReg >> 4) : (uint8)GSU.vColorReg; + c = (x ^ y) & 1 ? (uint8_t)(GSU.vColorReg >> 4) : (uint8_t)GSU.vColorReg; else - c = (uint8)GSU.vColorReg; + c = (uint8_t)GSU.vColorReg; if (!(GSU.vPlotOptionReg & 0x01) && !(c & 0xf)) return; a = GSU.apvScreen[y >> 3] + GSU.x[x >> 3] + ((y & 7) << 1); @@ -707,10 +707,10 @@ static void fx_plot_2bit() /* 2c(ALT1) - rpix - read color of the pixel with R1,R2 as x,y */ static void fx_rpix_2bit() { - uint32 x = USEX8(R1); - uint32 y = USEX8(R2); - uint8* a; - uint8 v; + uint32_t x = USEX8(R1); + uint32_t y = USEX8(R2); + uint8_t* a; + uint8_t v; R15++; CLRFLAGS; @@ -722,18 +722,18 @@ static void fx_rpix_2bit() v = 128 >> (x & 7); DREG = 0; - DREG |= ((uint32)((a[0] & v) != 0)) << 0; - DREG |= ((uint32)((a[1] & v) != 0)) << 1; + DREG |= ((uint32_t)((a[0] & v) != 0)) << 0; + DREG |= ((uint32_t)((a[1] & v) != 0)) << 1; TESTR14; } /* 4c - plot - plot pixel with R1,R2 as x,y and the color register as the color */ static void fx_plot_4bit() { - uint32 x = USEX8(R1); - uint32 y = USEX8(R2); - uint8* a; - uint8 v, c; + uint32_t x = USEX8(R1); + uint32_t y = USEX8(R2); + uint8_t* a; + uint8_t v, c; R15++; CLRFLAGS; @@ -743,9 +743,9 @@ static void fx_plot_4bit() if (y >= GSU.vScreenHeight) return; #endif if (GSU.vPlotOptionReg & 0x02) - c = (x ^ y) & 1 ? (uint8)(GSU.vColorReg >> 4) : (uint8)GSU.vColorReg; + c = (x ^ y) & 1 ? (uint8_t)(GSU.vColorReg >> 4) : (uint8_t)GSU.vColorReg; else - c = (uint8)GSU.vColorReg; + c = (uint8_t)GSU.vColorReg; if (!(GSU.vPlotOptionReg & 0x01) && !(c & 0xf)) return; @@ -765,10 +765,10 @@ static void fx_plot_4bit() /* 4c(ALT1) - rpix - read color of the pixel with R1,R2 as x,y */ static void fx_rpix_4bit() { - uint32 x = USEX8(R1); - uint32 y = USEX8(R2); - uint8* a; - uint8 v; + uint32_t x = USEX8(R1); + uint32_t y = USEX8(R2); + uint8_t* a; + uint8_t v; R15++; CLRFLAGS; @@ -781,20 +781,20 @@ static void fx_rpix_4bit() v = 128 >> (x & 7); DREG = 0; - DREG |= ((uint32)((a[0x00] & v) != 0)) << 0; - DREG |= ((uint32)((a[0x01] & v) != 0)) << 1; - DREG |= ((uint32)((a[0x10] & v) != 0)) << 2; - DREG |= ((uint32)((a[0x11] & v) != 0)) << 3; + DREG |= ((uint32_t)((a[0x00] & v) != 0)) << 0; + DREG |= ((uint32_t)((a[0x01] & v) != 0)) << 1; + DREG |= ((uint32_t)((a[0x10] & v) != 0)) << 2; + DREG |= ((uint32_t)((a[0x11] & v) != 0)) << 3; TESTR14; } /* 8c - plot - plot pixel with R1,R2 as x,y and the color register as the color */ static void fx_plot_8bit() { - uint32 x = USEX8(R1); - uint32 y = USEX8(R2); - uint8* a; - uint8 v, c; + uint32_t x = USEX8(R1); + uint32_t y = USEX8(R2); + uint8_t* a; + uint8_t v, c; R15++; CLRFLAGS; @@ -803,7 +803,7 @@ static void fx_plot_8bit() #ifdef CHECK_LIMITS if (y >= GSU.vScreenHeight) return; #endif - c = (uint8)GSU.vColorReg; + c = (uint8_t)GSU.vColorReg; if (!(GSU.vPlotOptionReg & 0x10)) { if (!(GSU.vPlotOptionReg & 0x01) && !(c & 0xf)) return; @@ -834,10 +834,10 @@ static void fx_plot_8bit() /* 4c(ALT1) - rpix - read color of the pixel with R1,R2 as x,y */ static void fx_rpix_8bit() { - uint32 x = USEX8(R1); - uint32 y = USEX8(R2); - uint8* a; - uint8 v; + uint32_t x = USEX8(R1); + uint32_t y = USEX8(R2); + uint8_t* a; + uint8_t v; R15++; CLRFLAGS; @@ -849,14 +849,14 @@ static void fx_rpix_8bit() v = 128 >> (x & 7); DREG = 0; - DREG |= ((uint32)((a[0x00] & v) != 0)) << 0; - DREG |= ((uint32)((a[0x01] & v) != 0)) << 1; - DREG |= ((uint32)((a[0x10] & v) != 0)) << 2; - DREG |= ((uint32)((a[0x11] & v) != 0)) << 3; - DREG |= ((uint32)((a[0x20] & v) != 0)) << 4; - DREG |= ((uint32)((a[0x21] & v) != 0)) << 5; - DREG |= ((uint32)((a[0x30] & v) != 0)) << 6; - DREG |= ((uint32)((a[0x31] & v) != 0)) << 7; + DREG |= ((uint32_t)((a[0x00] & v) != 0)) << 0; + DREG |= ((uint32_t)((a[0x01] & v) != 0)) << 1; + DREG |= ((uint32_t)((a[0x10] & v) != 0)) << 2; + DREG |= ((uint32_t)((a[0x11] & v) != 0)) << 3; + DREG |= ((uint32_t)((a[0x20] & v) != 0)) << 4; + DREG |= ((uint32_t)((a[0x21] & v) != 0)) << 5; + DREG |= ((uint32_t)((a[0x30] & v) != 0)) << 6; + DREG |= ((uint32_t)((a[0x31] & v) != 0)) << 7; GSU.vZero = DREG; TESTR14; } @@ -876,9 +876,9 @@ static void fx_rpix_obj() /* 4d - swap - swap upper and lower byte of a register */ static void fx_swap() { - uint8 c = (uint8)SREG; - uint8 d = (uint8)(SREG >> 8); - uint32 v = (((uint32)c) << 8) | ((uint32)d); + uint8_t c = (uint8_t)SREG; + uint8_t d = (uint8_t)(SREG >> 8); + uint32_t v = (((uint32_t)c) << 8) | ((uint32_t)d); R15++; DREG = v; GSU.vSign = v; @@ -890,7 +890,7 @@ static void fx_swap() /* 4e - color - copy source register to color register */ static void fx_color() { - uint8 c = (uint8)SREG; + uint8_t c = (uint8_t)SREG; if (GSU.vPlotOptionReg & 0x04) c = (c & 0xf0) | (c >> 4); if (GSU.vPlotOptionReg & 0x08) @@ -925,7 +925,7 @@ static void fx_cmode() /* 4f - not - perform exclusive exor with 1 on all bits */ static void fx_not() { - uint32 v = ~SREG; + uint32_t v = ~SREG; R15++; DREG = v; GSU.vSign = v; @@ -936,7 +936,7 @@ static void fx_not() /* 50-5f - add rn - add, register + register */ #define FX_ADD(reg) \ -int32 s = SUSEX16(SREG) + SUSEX16(GSU.avReg[reg]); \ +int32_t s = SUSEX16(SREG) + SUSEX16(GSU.avReg[reg]); \ GSU.vCarry = s >= 0x10000; \ GSU.vOverflow = ~(SREG ^ GSU.avReg[reg]) & (GSU.avReg[reg] ^ s) & 0x8000; \ GSU.vSign = s; \ @@ -1011,7 +1011,7 @@ static void fx_add_r15() /* 50-5f(ALT1) - adc rn - add with carry, register + register */ #define FX_ADC(reg) \ -int32 s = SUSEX16(SREG) + SUSEX16(GSU.avReg[reg]) + SEX16(GSU.vCarry); \ +int32_t s = SUSEX16(SREG) + SUSEX16(GSU.avReg[reg]) + SEX16(GSU.vCarry); \ GSU.vCarry = s >= 0x10000; \ GSU.vOverflow = ~(SREG ^ GSU.avReg[reg]) & (GSU.avReg[reg] ^ s) & 0x8000; \ GSU.vSign = s; \ @@ -1086,7 +1086,7 @@ static void fx_adc_r15() /* 50-5f(ALT2) - add #n - add, register + immediate */ #define FX_ADD_I(imm) \ -int32 s = SUSEX16(SREG) + imm; \ +int32_t s = SUSEX16(SREG) + imm; \ GSU.vCarry = s >= 0x10000; \ GSU.vOverflow = ~(SREG ^ imm) & (imm ^ s) & 0x8000; \ GSU.vSign = s; \ @@ -1161,7 +1161,7 @@ static void fx_add_i15() /* 50-5f(ALT3) - adc #n - add with carry, register + immediate */ #define FX_ADC_I(imm) \ -int32 s = SUSEX16(SREG) + imm + SUSEX16(GSU.vCarry); \ +int32_t s = SUSEX16(SREG) + imm + SUSEX16(GSU.vCarry); \ GSU.vCarry = s >= 0x10000; \ GSU.vOverflow = ~(SREG ^ imm) & (imm ^ s) & 0x8000; \ GSU.vSign = s; \ @@ -1236,7 +1236,7 @@ static void fx_adc_i15() /* 60-6f - sub rn - subtract, register - register */ #define FX_SUB(reg) \ -int32 s = SUSEX16(SREG) - SUSEX16(GSU.avReg[reg]); \ +int32_t s = SUSEX16(SREG) - SUSEX16(GSU.avReg[reg]); \ GSU.vCarry = s >= 0; \ GSU.vOverflow = (SREG ^ GSU.avReg[reg]) & (SREG ^ s) & 0x8000; \ GSU.vSign = s; \ @@ -1311,7 +1311,7 @@ static void fx_sub_r15() /* 60-6f(ALT1) - sbc rn - subtract with carry, register - register */ #define FX_SBC(reg) \ -int32 s = SUSEX16(SREG) - SUSEX16(GSU.avReg[reg]) - (SUSEX16(GSU.vCarry^1)); \ +int32_t s = SUSEX16(SREG) - SUSEX16(GSU.avReg[reg]) - (SUSEX16(GSU.vCarry^1)); \ GSU.vCarry = s >= 0; \ GSU.vOverflow = (SREG ^ GSU.avReg[reg]) & (SREG ^ s) & 0x8000; \ GSU.vSign = s; \ @@ -1386,7 +1386,7 @@ static void fx_sbc_r15() /* 60-6f(ALT2) - sub #n - subtract, register - immediate */ #define FX_SUB_I(imm) \ -int32 s = SUSEX16(SREG) - imm; \ +int32_t s = SUSEX16(SREG) - imm; \ GSU.vCarry = s >= 0; \ GSU.vOverflow = (SREG ^ imm) & (SREG ^ s) & 0x8000; \ GSU.vSign = s; \ @@ -1461,7 +1461,7 @@ static void fx_sub_i15() /* 60-6f(ALT3) - cmp rn - compare, register, register */ #define FX_CMP(reg) \ -int32 s = SUSEX16(SREG) - SUSEX16(GSU.avReg[reg]); \ +int32_t s = SUSEX16(SREG) - SUSEX16(GSU.avReg[reg]); \ GSU.vCarry = s >= 0; \ GSU.vOverflow = (SREG ^ GSU.avReg[reg]) & (SREG ^ s) & 0x8000; \ GSU.vSign = s; \ @@ -1536,7 +1536,7 @@ static void fx_cmp_r15() /* 70 - merge - R7 as upper byte, R8 as lower byte (used for texture-mapping) */ static void fx_merge() { - uint32 v = (R7 & 0xff00) | ((R8 & 0xff00) >> 8); + uint32_t v = (R7 & 0xff00) | ((R8 & 0xff00) >> 8); R15++; DREG = v; GSU.vOverflow = (v & 0xc0c0) << 16; @@ -1549,7 +1549,7 @@ static void fx_merge() /* 71-7f - and rn - reister & register */ #define FX_AND(reg) \ -uint32 v = SREG & GSU.avReg[reg]; \ +uint32_t v = SREG & GSU.avReg[reg]; \ R15++; DREG = v; \ GSU.vSign = v; \ GSU.vZero = v; \ @@ -1618,7 +1618,7 @@ static void fx_and_r15() /* 71-7f(ALT1) - bic rn - reister & ~register */ #define FX_BIC(reg) \ -uint32 v = SREG & ~GSU.avReg[reg]; \ +uint32_t v = SREG & ~GSU.avReg[reg]; \ R15++; DREG = v; \ GSU.vSign = v; \ GSU.vZero = v; \ @@ -1687,7 +1687,7 @@ static void fx_bic_r15() /* 71-7f(ALT2) - and #n - reister & immediate */ #define FX_AND_I(imm) \ -uint32 v = SREG & imm; \ +uint32_t v = SREG & imm; \ R15++; DREG = v; \ GSU.vSign = v; \ GSU.vZero = v; \ @@ -1756,7 +1756,7 @@ static void fx_and_i15() /* 71-7f(ALT3) - bic #n - reister & ~immediate */ #define FX_BIC_I(imm) \ -uint32 v = SREG & ~imm; \ +uint32_t v = SREG & ~imm; \ R15++; DREG = v; \ GSU.vSign = v; \ GSU.vZero = v; \ @@ -1825,7 +1825,7 @@ static void fx_bic_i15() /* 80-8f - mult rn - 8 bit to 16 bit signed multiply, register * register */ #define FX_MULT(reg) \ -uint32 v = (uint32)(SEX8(SREG) * SEX8(GSU.avReg[reg])); \ +uint32_t v = (uint32_t)(SEX8(SREG) * SEX8(GSU.avReg[reg])); \ R15++; DREG = v; \ GSU.vSign = v; \ GSU.vZero = v; \ @@ -1898,7 +1898,7 @@ static void fx_mult_r15() /* 80-8f(ALT1) - umult rn - 8 bit to 16 bit unsigned multiply, register * register */ #define FX_UMULT(reg) \ -uint32 v = USEX8(SREG) * USEX8(GSU.avReg[reg]); \ +uint32_t v = USEX8(SREG) * USEX8(GSU.avReg[reg]); \ R15++; DREG = v; \ GSU.vSign = v; \ GSU.vZero = v; \ @@ -1971,7 +1971,7 @@ static void fx_umult_r15() /* 80-8f(ALT2) - mult #n - 8 bit to 16 bit signed multiply, register * immediate */ #define FX_MULT_I(imm) \ -uint32 v = (uint32) (SEX8(SREG) * ((int32)imm)); \ +uint32_t v = (uint32_t) (SEX8(SREG) * ((int32_t)imm)); \ R15++; DREG = v; \ GSU.vSign = v; \ GSU.vZero = v; \ @@ -2044,7 +2044,7 @@ static void fx_mult_i15() /* 80-8f(ALT3) - umult #n - 8 bit to 16 bit unsigned multiply, register * immediate */ #define FX_UMULT_I(imm) \ -uint32 v = USEX8(SREG) * ((uint32)imm); \ +uint32_t v = USEX8(SREG) * ((uint32_t)imm); \ R15++; DREG = v; \ GSU.vSign = v; \ GSU.vZero = v; \ @@ -2118,8 +2118,8 @@ static void fx_umult_i15() /* 90 - sbk - store word to last accessed RAM address */ static void fx_sbk() { - RAM(GSU.vLastRamAdr) = (uint8)SREG; - RAM(GSU.vLastRamAdr ^ 1) = (uint8)(SREG >> 8); + RAM(GSU.vLastRamAdr) = (uint8_t)SREG; + RAM(GSU.vLastRamAdr ^ 1) = (uint8_t)(SREG >> 8); CLRFLAGS; R15++; } @@ -2146,7 +2146,7 @@ static void fx_link_i4() /* 95 - sex - sign extend 8 bit to 16 bit */ static void fx_sex() { - uint32 v = (uint32)SEX8(SREG); + uint32_t v = (uint32_t)SEX8(SREG); R15++; DREG = v; GSU.vSign = v; @@ -2158,9 +2158,9 @@ static void fx_sex() /* 96 - asr - aritmetric shift right by one */ static void fx_asr() { - uint32 v; + uint32_t v; GSU.vCarry = SREG & 1; - v = (uint32)(SEX16(SREG) >> 1); + v = (uint32_t)(SEX16(SREG) >> 1); R15++; DREG = v; GSU.vSign = v; @@ -2172,13 +2172,13 @@ static void fx_asr() /* 96(ALT1) - div2 - aritmetric shift right by one */ static void fx_div2() { - uint32 v; - int32 s = SEX16(SREG); + uint32_t v; + int32_t s = SEX16(SREG); GSU.vCarry = s & 1; if (s == -1) v = 0; else - v = (uint32)(s >> 1); + v = (uint32_t)(s >> 1); R15++; DREG = v; GSU.vSign = v; @@ -2190,7 +2190,7 @@ static void fx_div2() /* 97 - ror - rotate right by one */ static void fx_ror() { - uint32 v = (USEX16(SREG) >> 1) | (GSU.vCarry << 15); + uint32_t v = (USEX16(SREG) >> 1) | (GSU.vCarry << 15); GSU.vCarry = SREG & 1; R15++; DREG = v; @@ -2234,7 +2234,7 @@ static void fx_jmp_r13() GSU.vPrgBankReg = GSU.avReg[reg] & 0x7f; \ GSU.pvPrgBank = GSU.apvRomBank[GSU.vPrgBankReg]; \ R15 = SREG; \ -GSU.bCacheActive = FALSE; fx_cache(); R15--; +GSU.bCacheActive = false; fx_cache(); R15--; static void fx_ljmp_r8() { FX_LJMP(8); @@ -2263,7 +2263,7 @@ static void fx_ljmp_r13() /* 9e - lob - set upper byte to zero (keep low byte) */ static void fx_lob() { - uint32 v = USEX8(SREG); + uint32_t v = USEX8(SREG); R15++; DREG = v; GSU.vSign = v << 8; @@ -2275,8 +2275,8 @@ static void fx_lob() /* 9f - fmult - 16 bit to 32 bit signed multiplication, upper 16 bits only */ static void fx_fmult() { - uint32 v; - uint32 c = (uint32)(SEX16(SREG) * SEX16(R6)); + uint32_t v; + uint32_t c = (uint32_t)(SEX16(SREG) * SEX16(R6)); v = c >> 16; R15++; DREG = v; @@ -2290,8 +2290,8 @@ static void fx_fmult() /* 9f(ALT1) - lmult - 16 bit to 32 bit signed multiplication */ static void fx_lmult() { - uint32 v; - uint32 c = (uint32)(SEX16(SREG) * SEX16(R6)); + uint32_t v; + uint32_t c = (uint32_t)(SEX16(SREG) * SEX16(R6)); R4 = c; v = c >> 16; R15++; @@ -2306,7 +2306,7 @@ static void fx_lmult() /* a0-af - ibt rn,#pp - immediate byte transfer */ #define FX_IBT(reg) \ -uint8 v = PIPE; R15++; \ +uint8_t v = PIPE; R15++; \ FETCHPIPE; R15++; \ GSU.avReg[reg] = SEX8(v); \ CLRFLAGS; @@ -2378,10 +2378,10 @@ static void fx_ibt_r15() /* a0-af(ALT1) - lms rn,(yy) - load word from RAM (short address) */ #define FX_LMS(reg) \ -GSU.vLastRamAdr = ((uint32)PIPE) << 1; \ +GSU.vLastRamAdr = ((uint32_t)PIPE) << 1; \ R15++; FETCHPIPE; R15++; \ -GSU.avReg[reg] = (uint32)RAM(GSU.vLastRamAdr); \ -GSU.avReg[reg] |= ((uint32)RAM(GSU.vLastRamAdr+1))<<8; \ +GSU.avReg[reg] = (uint32_t)RAM(GSU.vLastRamAdr); \ +GSU.avReg[reg] |= ((uint32_t)RAM(GSU.vLastRamAdr+1))<<8; \ CLRFLAGS; static void fx_lms_r0() { @@ -2452,11 +2452,11 @@ static void fx_lms_r15() /* a0-af(ALT2) - sms (yy),rn - store word in RAM (short address) */ /* If rn == r15, is the value of r15 before or after the extra byte is read? */ #define FX_SMS(reg) \ -uint32 v = GSU.avReg[reg]; \ -GSU.vLastRamAdr = ((uint32)PIPE) << 1; \ +uint32_t v = GSU.avReg[reg]; \ +GSU.vLastRamAdr = ((uint32_t)PIPE) << 1; \ R15++; FETCHPIPE; \ -RAM(GSU.vLastRamAdr) = (uint8)v; \ -RAM(GSU.vLastRamAdr+1) = (uint8)(v>>8); \ +RAM(GSU.vLastRamAdr) = (uint8_t)v; \ +RAM(GSU.vLastRamAdr+1) = (uint8_t)(v>>8); \ CLRFLAGS; R15++; static void fx_sms_r0() { @@ -2526,7 +2526,7 @@ static void fx_sms_r15() /* b0-bf - from rn - set source register */ /* b0-bf(B) - moves rn - move register to register, and set flags, (if B flag is set) */ #define FX_FROM(reg) \ -if(TF(B)) { uint32 v = GSU.avReg[reg]; R15++; DREG = v; \ +if(TF(B)) { uint32_t v = GSU.avReg[reg]; R15++; DREG = v; \ GSU.vOverflow = (v&0x80) << 16; GSU.vSign = v; GSU.vZero = v; TESTR14; CLRFLAGS; } \ else { GSU.pvSreg = &GSU.avReg[reg]; R15++; } static void fx_from_r0() @@ -2597,7 +2597,7 @@ static void fx_from_r15() /* c0 - hib - move high-byte to low-byte */ static void fx_hib() { - uint32 v = USEX8(SREG >> 8); + uint32_t v = USEX8(SREG >> 8); R15++; DREG = v; GSU.vSign = v << 8; @@ -2608,7 +2608,7 @@ static void fx_hib() /* c1-cf - or rn */ #define FX_OR(reg) \ -uint32 v = SREG | GSU.avReg[reg]; R15++; DREG = v; \ +uint32_t v = SREG | GSU.avReg[reg]; R15++; DREG = v; \ GSU.vSign = v; \ GSU.vZero = v; \ TESTR14; \ @@ -2676,7 +2676,7 @@ static void fx_or_r15() /* c1-cf(ALT1) - xor rn */ #define FX_XOR(reg) \ -uint32 v = SREG ^ GSU.avReg[reg]; R15++; DREG = v; \ +uint32_t v = SREG ^ GSU.avReg[reg]; R15++; DREG = v; \ GSU.vSign = v; \ GSU.vZero = v; \ TESTR14; \ @@ -2744,7 +2744,7 @@ static void fx_xor_r15() /* c1-cf(ALT2) - or #n */ #define FX_OR_I(imm) \ -uint32 v = SREG | imm; R15++; DREG = v; \ +uint32_t v = SREG | imm; R15++; DREG = v; \ GSU.vSign = v; \ GSU.vZero = v; \ TESTR14; \ @@ -2812,7 +2812,7 @@ static void fx_or_i15() /* c1-cf(ALT3) - xor #n */ #define FX_XOR_I(imm) \ -uint32 v = SREG ^ imm; R15++; DREG = v; \ +uint32_t v = SREG ^ imm; R15++; DREG = v; \ GSU.vSign = v; \ GSU.vZero = v; \ TESTR14; \ @@ -2950,10 +2950,10 @@ static void fx_inc_r14() static void fx_getc() { #ifndef FX_DO_ROMBUFFER - uint8 c; + uint8_t c; c = ROM(R14); #else - uint8 c = GSU.vRomBuffer; + uint8_t c = GSU.vRomBuffer; #endif if (GSU.vPlotOptionReg & 0x04) c = (c & 0xf0) | (c >> 4); @@ -3057,11 +3057,11 @@ static void fx_dec_r14() /* ef - getb - get byte from ROM at address R14 */ static void fx_getb() { - uint32 v; + uint32_t v; #ifndef FX_DO_ROMBUFFER - v = (uint32)ROM(R14); + v = (uint32_t)ROM(R14); #else - v = (uint32)GSU.vRomBuffer; + v = (uint32_t)GSU.vRomBuffer; #endif R15++; DREG = v; @@ -3072,12 +3072,12 @@ static void fx_getb() /* ef(ALT1) - getbh - get high-byte from ROM at address R14 */ static void fx_getbh() { - uint32 v; + uint32_t v; #ifndef FX_DO_ROMBUFFER - uint32 c; - c = (uint32)ROM(R14); + uint32_t c; + c = (uint32_t)ROM(R14); #else - uint32 c = USEX8(GSU.vRomBuffer); + uint32_t c = USEX8(GSU.vRomBuffer); #endif v = USEX8(SREG) | (c << 8); R15++; @@ -3089,12 +3089,12 @@ static void fx_getbh() /* ef(ALT2) - getbl - get low-byte from ROM at address R14 */ static void fx_getbl() { - uint32 v; + uint32_t v; #ifndef FX_DO_ROMBUFFER - uint32 c; - c = (uint32)ROM(R14); + uint32_t c; + c = (uint32_t)ROM(R14); #else - uint32 c = USEX8(GSU.vRomBuffer); + uint32_t c = USEX8(GSU.vRomBuffer); #endif v = (SREG & 0xff00) | c; R15++; @@ -3106,9 +3106,9 @@ static void fx_getbl() /* ef(ALT3) - getbs - get sign extended byte from ROM at address R14 */ static void fx_getbs() { - uint32 v; + uint32_t v; #ifndef FX_DO_ROMBUFFER - int8 c; + int8_t c; c = ROM(R14); v = SEX8(c); #else @@ -3122,7 +3122,7 @@ static void fx_getbs() /* f0-ff - iwt rn,#xx - immediate word transfer to register */ #define FX_IWT(reg) \ -uint32 v = PIPE; R15++; FETCHPIPE; R15++; \ +uint32_t v = PIPE; R15++; FETCHPIPE; R15++; \ v |= USEX8(PIPE) << 8; FETCHPIPE; R15++; \ GSU.avReg[reg] = v; \ CLRFLAGS; @@ -3268,11 +3268,11 @@ static void fx_lm_r15() /* f0-ff(ALT2) - sm (xx),rn - store word in RAM */ /* If rn == r15, is the value of r15 before or after the extra bytes are read? */ #define FX_SM(reg) \ -uint32 v = GSU.avReg[reg]; \ +uint32_t v = GSU.avReg[reg]; \ GSU.vLastRamAdr = PIPE; R15++; FETCHPIPE; R15++; \ GSU.vLastRamAdr |= USEX8(PIPE) << 8; FETCHPIPE; \ -RAM(GSU.vLastRamAdr) = (uint8)v; \ -RAM(GSU.vLastRamAdr^1) = (uint8)(v>>8); \ +RAM(GSU.vLastRamAdr) = (uint8_t)v; \ +RAM(GSU.vLastRamAdr^1) = (uint8_t)(v>>8); \ CLRFLAGS; R15++; static void fx_sm_r0() { @@ -3341,7 +3341,7 @@ static void fx_sm_r15() /*** GSU executions functions ***/ -static uint32 fx_run(uint32 nInstructions) +static uint32_t fx_run(uint32_t nInstructions) { GSU.vCounter = nInstructions; READR14; @@ -3355,9 +3355,9 @@ static uint32 fx_run(uint32 nInstructions) return (nInstructions - GSU.vInstCount); } -static uint32 fx_run_to_breakpoint(uint32 nInstructions) +static uint32_t fx_run_to_breakpoint(uint32_t nInstructions) { - uint32 vCounter = 0; + uint32_t vCounter = 0; while (TF(G) && vCounter < nInstructions) { vCounter++; @@ -3376,9 +3376,9 @@ static uint32 fx_run_to_breakpoint(uint32 nInstructions) return vCounter; } -static uint32 fx_step_over(uint32 nInstructions) +static uint32_t fx_step_over(uint32_t nInstructions) { - uint32 vCounter = 0; + uint32_t vCounter = 0; while (TF(G) && vCounter < nInstructions) { vCounter++; @@ -3400,9 +3400,9 @@ static uint32 fx_step_over(uint32 nInstructions) } #ifdef FX_FUNCTION_TABLE -uint32(*FX_FUNCTION_TABLE[])(uint32) = +uint32_t(*FX_FUNCTION_TABLE[])(uint32_t) = #else -uint32(*fx_apfFunctionTable[])(uint32) = +uint32_t(*fx_apfFunctionTable[])(uint32_t) = #endif { &fx_run, -- cgit v1.2.3