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/dsp1.c | 514 +++++++++++++++++++++++++++++----------------------------- 1 file changed, 257 insertions(+), 257 deletions(-) (limited to 'source/dsp1.c') diff --git a/source/dsp1.c b/source/dsp1.c index 053631a..12a3327 100644 --- a/source/dsp1.c +++ b/source/dsp1.c @@ -95,17 +95,17 @@ #include "dsp1emu.c" #include "dsp2emu.c" -void (*SetDSP)(uint8, uint16) = &DSP1SetByte; -uint8(*GetDSP)(uint16) = &DSP1GetByte; +void (*SetDSP)(uint8_t, uint16_t) = &DSP1SetByte; +uint8_t(*GetDSP)(uint16_t) = &DSP1GetByte; void S9xInitDSP1() { - static bool8 init = FALSE; + static bool init = false; if (!init) { InitDSP(); - init = TRUE; + init = true; } } @@ -113,30 +113,30 @@ void S9xResetDSP1() { S9xInitDSP1(); - DSP1.waiting4command = TRUE; + DSP1.waiting4command = true; DSP1.in_count = 0; DSP1.out_count = 0; DSP1.in_index = 0; DSP1.out_index = 0; - DSP1.first_parameter = TRUE; + DSP1.first_parameter = true; } -uint8 S9xGetDSP(uint16 address) +uint8_t S9xGetDSP(uint16_t address) { - uint8 t; + uint8_t t; t = (*GetDSP)(address); //DSP1GetByte(address); return (t); } -void S9xSetDSP(uint8 byte, uint16 address) +void S9xSetDSP(uint8_t byte, uint16_t address) { (*SetDSP)(byte, address); //DSP1SetByte(byte, address); } -void DSP1SetByte(uint8 byte, uint16 address) +void DSP1SetByte(uint8_t byte, uint16_t address) { if ((address & 0xf000) == 0x6000 || (address & 0x7fff) < 0x4000) { @@ -152,8 +152,8 @@ void DSP1SetByte(uint8 byte, uint16 address) { DSP1.command = byte; DSP1.in_index = 0; - DSP1.waiting4command = FALSE; - DSP1.first_parameter = TRUE; + DSP1.waiting4command = false; + DSP1.first_parameter = true; // printf("Op%02X\n",byte); // Mario Kart uses 0x00, 0x02, 0x06, 0x0c, 0x28, 0x0a switch (byte) @@ -291,8 +291,8 @@ void DSP1SetByte(uint8 byte, uint16 address) //printf("Op%02X\n",byte); case 0x80: DSP1.in_count = 0; - DSP1.waiting4command = TRUE; - DSP1.first_parameter = TRUE; + DSP1.waiting4command = true; + DSP1.first_parameter = true; break; } DSP1.in_count <<= 1; @@ -300,15 +300,15 @@ void DSP1SetByte(uint8 byte, uint16 address) else { DSP1.parameters [DSP1.in_index] = byte; - DSP1.first_parameter = FALSE; + DSP1.first_parameter = false; DSP1.in_index++; } if (DSP1.waiting4command || (DSP1.first_parameter && byte == 0x80)) { - DSP1.waiting4command = TRUE; - DSP1.first_parameter = FALSE; + DSP1.waiting4command = true; + DSP1.first_parameter = false; } else if (DSP1.first_parameter && (DSP1.in_count != 0 || (DSP1.in_count == 0 && DSP1.in_index == 0))) @@ -325,7 +325,7 @@ void DSP1SetByte(uint8 byte, uint16 address) if (--DSP1.in_count == 0) { // Actually execute the command - DSP1.waiting4command = TRUE; + DSP1.waiting4command = true; DSP1.out_index = 0; switch (DSP1.command) { @@ -333,8 +333,8 @@ void DSP1SetByte(uint8 byte, uint16 address) DSP1.out_count = 2048; break; case 0x00: // Multiple - Op00Multiplicand = (int16)(DSP1.parameters [0] | (DSP1.parameters[1] << 8)); - Op00Multiplier = (int16)(DSP1.parameters [2] | (DSP1.parameters[3] << 8)); + Op00Multiplicand = (int16_t)(DSP1.parameters [0] | (DSP1.parameters[1] << 8)); + Op00Multiplier = (int16_t)(DSP1.parameters [2] | (DSP1.parameters[3] << 8)); DSPOp00(); @@ -344,8 +344,8 @@ void DSP1SetByte(uint8 byte, uint16 address) break; case 0x20: // Multiple - Op20Multiplicand = (int16)(DSP1.parameters [0] | (DSP1.parameters[1] << 8)); - Op20Multiplier = (int16)(DSP1.parameters [2] | (DSP1.parameters[3] << 8)); + Op20Multiplicand = (int16_t)(DSP1.parameters [0] | (DSP1.parameters[1] << 8)); + Op20Multiplier = (int16_t)(DSP1.parameters [2] | (DSP1.parameters[3] << 8)); DSPOp20(); @@ -356,99 +356,99 @@ void DSP1SetByte(uint8 byte, uint16 address) case 0x30: case 0x10: // Inverse - Op10Coefficient = (int16)(DSP1.parameters [0] | (DSP1.parameters[1] << 8)); - Op10Exponent = (int16)(DSP1.parameters [2] | (DSP1.parameters[3] << 8)); + Op10Coefficient = (int16_t)(DSP1.parameters [0] | (DSP1.parameters[1] << 8)); + Op10Exponent = (int16_t)(DSP1.parameters [2] | (DSP1.parameters[3] << 8)); DSPOp10(); DSP1.out_count = 4; - DSP1.output [0] = (uint8)(((int16) Op10CoefficientR) & 0xFF); - DSP1.output [1] = (uint8)((((int16) Op10CoefficientR) >> 8) & 0xFF); - DSP1.output [2] = (uint8)(((int16) Op10ExponentR) & 0xff); - DSP1.output [3] = (uint8)((((int16) Op10ExponentR) >> 8) & 0xff); + DSP1.output [0] = (uint8_t)(((int16_t) Op10CoefficientR) & 0xFF); + DSP1.output [1] = (uint8_t)((((int16_t) Op10CoefficientR) >> 8) & 0xFF); + DSP1.output [2] = (uint8_t)(((int16_t) Op10ExponentR) & 0xff); + DSP1.output [3] = (uint8_t)((((int16_t) Op10ExponentR) >> 8) & 0xff); break; case 0x24: case 0x04: // Sin and Cos of angle - Op04Angle = (int16)(DSP1.parameters [0] | (DSP1.parameters[1] << 8)); - Op04Radius = (uint16)(DSP1.parameters [2] | (DSP1.parameters[3] << 8)); + Op04Angle = (int16_t)(DSP1.parameters [0] | (DSP1.parameters[1] << 8)); + Op04Radius = (uint16_t)(DSP1.parameters [2] | (DSP1.parameters[3] << 8)); DSPOp04(); DSP1.out_count = 4; - DSP1.output [0] = (uint8)(Op04Sin & 0xFF); - DSP1.output [1] = (uint8)((Op04Sin >> 8) & 0xFF); - DSP1.output [2] = (uint8)(Op04Cos & 0xFF); - DSP1.output [3] = (uint8)((Op04Cos >> 8) & 0xFF); + DSP1.output [0] = (uint8_t)(Op04Sin & 0xFF); + DSP1.output [1] = (uint8_t)((Op04Sin >> 8) & 0xFF); + DSP1.output [2] = (uint8_t)(Op04Cos & 0xFF); + DSP1.output [3] = (uint8_t)((Op04Cos >> 8) & 0xFF); break; case 0x08: // Radius - Op08X = (int16)(DSP1.parameters [0] | (DSP1.parameters[1] << 8)); - Op08Y = (int16)(DSP1.parameters [2] | (DSP1.parameters[3] << 8)); - Op08Z = (int16)(DSP1.parameters [4] | (DSP1.parameters[5] << 8)); + Op08X = (int16_t)(DSP1.parameters [0] | (DSP1.parameters[1] << 8)); + Op08Y = (int16_t)(DSP1.parameters [2] | (DSP1.parameters[3] << 8)); + Op08Z = (int16_t)(DSP1.parameters [4] | (DSP1.parameters[5] << 8)); DSPOp08(); DSP1.out_count = 4; - DSP1.output [0] = (uint8)(((int16) Op08Ll) & 0xFF); - DSP1.output [1] = (uint8)((((int16) Op08Ll) >> 8) & 0xFF); - DSP1.output [2] = (uint8)(((int16) Op08Lh) & 0xFF); - DSP1.output [3] = (uint8)((((int16) Op08Lh) >> 8) & 0xFF); + DSP1.output [0] = (uint8_t)(((int16_t) Op08Ll) & 0xFF); + DSP1.output [1] = (uint8_t)((((int16_t) Op08Ll) >> 8) & 0xFF); + DSP1.output [2] = (uint8_t)(((int16_t) Op08Lh) & 0xFF); + DSP1.output [3] = (uint8_t)((((int16_t) Op08Lh) >> 8) & 0xFF); break; case 0x18: // Range - Op18X = (int16)(DSP1.parameters [0] | (DSP1.parameters[1] << 8)); - Op18Y = (int16)(DSP1.parameters [2] | (DSP1.parameters[3] << 8)); - Op18Z = (int16)(DSP1.parameters [4] | (DSP1.parameters[5] << 8)); - Op18R = (int16)(DSP1.parameters [6] | (DSP1.parameters[7] << 8)); + Op18X = (int16_t)(DSP1.parameters [0] | (DSP1.parameters[1] << 8)); + Op18Y = (int16_t)(DSP1.parameters [2] | (DSP1.parameters[3] << 8)); + Op18Z = (int16_t)(DSP1.parameters [4] | (DSP1.parameters[5] << 8)); + Op18R = (int16_t)(DSP1.parameters [6] | (DSP1.parameters[7] << 8)); DSPOp18(); DSP1.out_count = 2; - DSP1.output [0] = (uint8)(Op18D & 0xFF); - DSP1.output [1] = (uint8)((Op18D >> 8) & 0xFF); + DSP1.output [0] = (uint8_t)(Op18D & 0xFF); + DSP1.output [1] = (uint8_t)((Op18D >> 8) & 0xFF); break; case 0x38: // Range - Op38X = (int16)(DSP1.parameters [0] | (DSP1.parameters[1] << 8)); - Op38Y = (int16)(DSP1.parameters [2] | (DSP1.parameters[3] << 8)); - Op38Z = (int16)(DSP1.parameters [4] | (DSP1.parameters[5] << 8)); - Op38R = (int16)(DSP1.parameters [6] | (DSP1.parameters[7] << 8)); + Op38X = (int16_t)(DSP1.parameters [0] | (DSP1.parameters[1] << 8)); + Op38Y = (int16_t)(DSP1.parameters [2] | (DSP1.parameters[3] << 8)); + Op38Z = (int16_t)(DSP1.parameters [4] | (DSP1.parameters[5] << 8)); + Op38R = (int16_t)(DSP1.parameters [6] | (DSP1.parameters[7] << 8)); DSPOp38(); DSP1.out_count = 2; - DSP1.output [0] = (uint8)(Op38D & 0xFF); - DSP1.output [1] = (uint8)((Op38D >> 8) & 0xFF); + DSP1.output [0] = (uint8_t)(Op38D & 0xFF); + DSP1.output [1] = (uint8_t)((Op38D >> 8) & 0xFF); break; case 0x28: // Distance (vector length) - Op28X = (int16)(DSP1.parameters [0] | (DSP1.parameters[1] << 8)); - Op28Y = (int16)(DSP1.parameters [2] | (DSP1.parameters[3] << 8)); - Op28Z = (int16)(DSP1.parameters [4] | (DSP1.parameters[5] << 8)); + Op28X = (int16_t)(DSP1.parameters [0] | (DSP1.parameters[1] << 8)); + Op28Y = (int16_t)(DSP1.parameters [2] | (DSP1.parameters[3] << 8)); + Op28Z = (int16_t)(DSP1.parameters [4] | (DSP1.parameters[5] << 8)); DSPOp28(); DSP1.out_count = 2; - DSP1.output [0] = (uint8)(Op28R & 0xFF); - DSP1.output [1] = (uint8)((Op28R >> 8) & 0xFF); + DSP1.output [0] = (uint8_t)(Op28R & 0xFF); + DSP1.output [1] = (uint8_t)((Op28R >> 8) & 0xFF); break; case 0x2c: case 0x0c: // Rotate (2D rotate) - Op0CA = (int16)(DSP1.parameters [0] | (DSP1.parameters[1] << 8)); - Op0CX1 = (int16)(DSP1.parameters [2] | (DSP1.parameters[3] << 8)); - Op0CY1 = (int16)(DSP1.parameters [4] | (DSP1.parameters[5] << 8)); + Op0CA = (int16_t)(DSP1.parameters [0] | (DSP1.parameters[1] << 8)); + Op0CX1 = (int16_t)(DSP1.parameters [2] | (DSP1.parameters[3] << 8)); + Op0CY1 = (int16_t)(DSP1.parameters [4] | (DSP1.parameters[5] << 8)); DSPOp0C(); DSP1.out_count = 4; - DSP1.output [0] = (uint8)(Op0CX2 & 0xFF); - DSP1.output [1] = (uint8)((Op0CX2 >> 8) & 0xFF); - DSP1.output [2] = (uint8)(Op0CY2 & 0xFF); - DSP1.output [3] = (uint8)((Op0CY2 >> 8) & 0xFF); + DSP1.output [0] = (uint8_t)(Op0CX2 & 0xFF); + DSP1.output [1] = (uint8_t)((Op0CX2 >> 8) & 0xFF); + DSP1.output [2] = (uint8_t)(Op0CY2 & 0xFF); + DSP1.output [3] = (uint8_t)((Op0CY2 >> 8) & 0xFF); break; case 0x3c: @@ -464,12 +464,12 @@ void DSP1SetByte(uint8 byte, uint16 address) DSPOp1C(); DSP1.out_count = 6; - DSP1.output [0] = (uint8)(Op1CXAR & 0xFF); - DSP1.output [1] = (uint8)((Op1CXAR >> 8) & 0xFF); - DSP1.output [2] = (uint8)(Op1CYAR & 0xFF); - DSP1.output [3] = (uint8)((Op1CYAR >> 8) & 0xFF); - DSP1.output [4] = (uint8)(Op1CZAR & 0xFF); - DSP1.output [5] = (uint8)((Op1CZAR >> 8) & 0xFF); + DSP1.output [0] = (uint8_t)(Op1CXAR & 0xFF); + DSP1.output [1] = (uint8_t)((Op1CXAR >> 8) & 0xFF); + DSP1.output [2] = (uint8_t)(Op1CYAR & 0xFF); + DSP1.output [3] = (uint8_t)((Op1CYAR >> 8) & 0xFF); + DSP1.output [4] = (uint8_t)(Op1CZAR & 0xFF); + DSP1.output [5] = (uint8_t)((Op1CZAR >> 8) & 0xFF); break; case 0x32: @@ -487,14 +487,14 @@ void DSP1SetByte(uint8 byte, uint16 address) DSPOp02(); DSP1.out_count = 8; - DSP1.output [0] = (uint8)(Op02VOF & 0xFF); - DSP1.output [1] = (uint8)((Op02VOF >> 8) & 0xFF); - DSP1.output [2] = (uint8)(Op02VVA & 0xFF); - DSP1.output [3] = (uint8)((Op02VVA >> 8) & 0xFF); - DSP1.output [4] = (uint8)(Op02CX & 0xFF); - DSP1.output [5] = (uint8)((Op02CX >> 8) & 0xFF); - DSP1.output [6] = (uint8)(Op02CY & 0xFF); - DSP1.output [7] = (uint8)((Op02CY >> 8) & 0xFF); + DSP1.output [0] = (uint8_t)(Op02VOF & 0xFF); + DSP1.output [1] = (uint8_t)((Op02VOF >> 8) & 0xFF); + DSP1.output [2] = (uint8_t)(Op02VVA & 0xFF); + DSP1.output [3] = (uint8_t)((Op02VVA >> 8) & 0xFF); + DSP1.output [4] = (uint8_t)(Op02CX & 0xFF); + DSP1.output [5] = (uint8_t)((Op02CX >> 8) & 0xFF); + DSP1.output [6] = (uint8_t)(Op02CY & 0xFF); + DSP1.output [7] = (uint8_t)((Op02CY >> 8) & 0xFF); break; case 0x3a: //1a Mirror @@ -506,14 +506,14 @@ void DSP1SetByte(uint8 byte, uint16 address) DSPOp0A(); DSP1.out_count = 8; - DSP1.output [0] = (uint8)(Op0AA & 0xFF); - DSP1.output [2] = (uint8)(Op0AB & 0xFF); - DSP1.output [4] = (uint8)(Op0AC & 0xFF); - DSP1.output [6] = (uint8)(Op0AD & 0xFF); - DSP1.output [1] = (uint8)((Op0AA >> 8) & 0xFF); - DSP1.output [3] = (uint8)((Op0AB >> 8) & 0xFF); - DSP1.output [5] = (uint8)((Op0AC >> 8) & 0xFF); - DSP1.output [7] = (uint8)((Op0AD >> 8) & 0xFF); + DSP1.output [0] = (uint8_t)(Op0AA & 0xFF); + DSP1.output [2] = (uint8_t)(Op0AB & 0xFF); + DSP1.output [4] = (uint8_t)(Op0AC & 0xFF); + DSP1.output [6] = (uint8_t)(Op0AD & 0xFF); + DSP1.output [1] = (uint8_t)((Op0AA >> 8) & 0xFF); + DSP1.output [3] = (uint8_t)((Op0AB >> 8) & 0xFF); + DSP1.output [5] = (uint8_t)((Op0AC >> 8) & 0xFF); + DSP1.output [7] = (uint8_t)((Op0AD >> 8) & 0xFF); DSP1.in_index = 0; break; @@ -521,35 +521,35 @@ void DSP1SetByte(uint8 byte, uint16 address) case 0x26: case 0x36: case 0x06: // Project object - Op06X = (int16)(DSP1.parameters [0] | (DSP1.parameters[1] << 8)); - Op06Y = (int16)(DSP1.parameters [2] | (DSP1.parameters[3] << 8)); - Op06Z = (int16)(DSP1.parameters [4] | (DSP1.parameters[5] << 8)); + Op06X = (int16_t)(DSP1.parameters [0] | (DSP1.parameters[1] << 8)); + Op06Y = (int16_t)(DSP1.parameters [2] | (DSP1.parameters[3] << 8)); + Op06Z = (int16_t)(DSP1.parameters [4] | (DSP1.parameters[5] << 8)); DSPOp06(); DSP1.out_count = 6; - DSP1.output [0] = (uint8)(Op06H & 0xff); - DSP1.output [1] = (uint8)((Op06H >> 8) & 0xFF); - DSP1.output [2] = (uint8)(Op06V & 0xFF); - DSP1.output [3] = (uint8)((Op06V >> 8) & 0xFF); - DSP1.output [4] = (uint8)(Op06S & 0xFF); - DSP1.output [5] = (uint8)((Op06S >> 8) & 0xFF); + DSP1.output [0] = (uint8_t)(Op06H & 0xff); + DSP1.output [1] = (uint8_t)((Op06H >> 8) & 0xFF); + DSP1.output [2] = (uint8_t)(Op06V & 0xFF); + DSP1.output [3] = (uint8_t)((Op06V >> 8) & 0xFF); + DSP1.output [4] = (uint8_t)(Op06S & 0xFF); + DSP1.output [5] = (uint8_t)((Op06S >> 8) & 0xFF); break; case 0x1e: case 0x2e: case 0x3e: case 0x0e: // Target - Op0EH = (int16)(DSP1.parameters [0] | (DSP1.parameters[1] << 8)); - Op0EV = (int16)(DSP1.parameters [2] | (DSP1.parameters[3] << 8)); + Op0EH = (int16_t)(DSP1.parameters [0] | (DSP1.parameters[1] << 8)); + Op0EV = (int16_t)(DSP1.parameters [2] | (DSP1.parameters[3] << 8)); DSPOp0E(); DSP1.out_count = 4; - DSP1.output [0] = (uint8)(Op0EX & 0xFF); - DSP1.output [1] = (uint8)((Op0EX >> 8) & 0xFF); - DSP1.output [2] = (uint8)(Op0EY & 0xFF); - DSP1.output [3] = (uint8)((Op0EY >> 8) & 0xFF); + DSP1.output [0] = (uint8_t)(Op0EX & 0xFF); + DSP1.output [1] = (uint8_t)((Op0EX >> 8) & 0xFF); + DSP1.output [2] = (uint8_t)(Op0EY & 0xFF); + DSP1.output [3] = (uint8_t)((Op0EY >> 8) & 0xFF); break; // Extra commands used by Pilot Wings @@ -557,30 +557,30 @@ void DSP1SetByte(uint8 byte, uint16 address) case 0x35: case 0x31: case 0x01: // Set attitude matrix A - Op01m = (int16)(DSP1.parameters [0] | (DSP1.parameters[1] << 8)); - Op01Zr = (int16)(DSP1.parameters [2] | (DSP1.parameters[3] << 8)); - Op01Yr = (int16)(DSP1.parameters [4] | (DSP1.parameters[5] << 8)); - Op01Xr = (int16)(DSP1.parameters [6] | (DSP1.parameters[7] << 8)); + Op01m = (int16_t)(DSP1.parameters [0] | (DSP1.parameters[1] << 8)); + Op01Zr = (int16_t)(DSP1.parameters [2] | (DSP1.parameters[3] << 8)); + Op01Yr = (int16_t)(DSP1.parameters [4] | (DSP1.parameters[5] << 8)); + Op01Xr = (int16_t)(DSP1.parameters [6] | (DSP1.parameters[7] << 8)); DSPOp01(); break; case 0x15: case 0x11: // Set attitude matrix B - Op11m = (int16)(DSP1.parameters [0] | (DSP1.parameters[1] << 8)); - Op11Zr = (int16)(DSP1.parameters [2] | (DSP1.parameters[3] << 8)); - Op11Yr = (int16)(DSP1.parameters [4] | (DSP1.parameters[5] << 8)); - Op11Xr = (int16)(DSP1.parameters [7] | (DSP1.parameters[7] << 8)); + Op11m = (int16_t)(DSP1.parameters [0] | (DSP1.parameters[1] << 8)); + Op11Zr = (int16_t)(DSP1.parameters [2] | (DSP1.parameters[3] << 8)); + Op11Yr = (int16_t)(DSP1.parameters [4] | (DSP1.parameters[5] << 8)); + Op11Xr = (int16_t)(DSP1.parameters [7] | (DSP1.parameters[7] << 8)); DSPOp11(); break; case 0x25: case 0x21: // Set attitude matrix C - Op21m = (int16)(DSP1.parameters [0] | (DSP1.parameters[1] << 8)); - Op21Zr = (int16)(DSP1.parameters [2] | (DSP1.parameters[3] << 8)); - Op21Yr = (int16)(DSP1.parameters [4] | (DSP1.parameters[5] << 8)); - Op21Xr = (int16)(DSP1.parameters [6] | (DSP1.parameters[7] << 8)); + Op21m = (int16_t)(DSP1.parameters [0] | (DSP1.parameters[1] << 8)); + Op21Zr = (int16_t)(DSP1.parameters [2] | (DSP1.parameters[3] << 8)); + Op21Yr = (int16_t)(DSP1.parameters [4] | (DSP1.parameters[5] << 8)); + Op21Xr = (int16_t)(DSP1.parameters [6] | (DSP1.parameters[7] << 8)); DSPOp21(); break; @@ -589,182 +589,182 @@ void DSP1SetByte(uint8 byte, uint16 address) case 0x39: case 0x3d: case 0x0d: // Objective matrix A - Op0DX = (int16)(DSP1.parameters [0] | (DSP1.parameters[1] << 8)); - Op0DY = (int16)(DSP1.parameters [2] | (DSP1.parameters[3] << 8)); - Op0DZ = (int16)(DSP1.parameters [4] | (DSP1.parameters[5] << 8)); + Op0DX = (int16_t)(DSP1.parameters [0] | (DSP1.parameters[1] << 8)); + Op0DY = (int16_t)(DSP1.parameters [2] | (DSP1.parameters[3] << 8)); + Op0DZ = (int16_t)(DSP1.parameters [4] | (DSP1.parameters[5] << 8)); DSPOp0D(); DSP1.out_count = 6; - DSP1.output [0] = (uint8)(Op0DF & 0xFF); - DSP1.output [1] = (uint8)((Op0DF >> 8) & 0xFF); - DSP1.output [2] = (uint8)(Op0DL & 0xFF); - DSP1.output [3] = (uint8)((Op0DL >> 8) & 0xFF); - DSP1.output [4] = (uint8)(Op0DU & 0xFF); - DSP1.output [5] = (uint8)((Op0DU >> 8) & 0xFF); + DSP1.output [0] = (uint8_t)(Op0DF & 0xFF); + DSP1.output [1] = (uint8_t)((Op0DF >> 8) & 0xFF); + DSP1.output [2] = (uint8_t)(Op0DL & 0xFF); + DSP1.output [3] = (uint8_t)((Op0DL >> 8) & 0xFF); + DSP1.output [4] = (uint8_t)(Op0DU & 0xFF); + DSP1.output [5] = (uint8_t)((Op0DU >> 8) & 0xFF); break; case 0x19: case 0x1d: // Objective matrix B - Op1DX = (int16)(DSP1.parameters [0] | (DSP1.parameters[1] << 8)); - Op1DY = (int16)(DSP1.parameters [2] | (DSP1.parameters[3] << 8)); - Op1DZ = (int16)(DSP1.parameters [4] | (DSP1.parameters[5] << 8)); + Op1DX = (int16_t)(DSP1.parameters [0] | (DSP1.parameters[1] << 8)); + Op1DY = (int16_t)(DSP1.parameters [2] | (DSP1.parameters[3] << 8)); + Op1DZ = (int16_t)(DSP1.parameters [4] | (DSP1.parameters[5] << 8)); DSPOp1D(); DSP1.out_count = 6; - DSP1.output [0] = (uint8)(Op1DF & 0xFF); - DSP1.output [1] = (uint8)((Op1DF >> 8) & 0xFF); - DSP1.output [2] = (uint8)(Op1DL & 0xFF); - DSP1.output [3] = (uint8)((Op1DL >> 8) & 0xFF); - DSP1.output [4] = (uint8)(Op1DU & 0xFF); - DSP1.output [5] = (uint8)((Op1DU >> 8) & 0xFF); + DSP1.output [0] = (uint8_t)(Op1DF & 0xFF); + DSP1.output [1] = (uint8_t)((Op1DF >> 8) & 0xFF); + DSP1.output [2] = (uint8_t)(Op1DL & 0xFF); + DSP1.output [3] = (uint8_t)((Op1DL >> 8) & 0xFF); + DSP1.output [4] = (uint8_t)(Op1DU & 0xFF); + DSP1.output [5] = (uint8_t)((Op1DU >> 8) & 0xFF); break; case 0x29: case 0x2d: // Objective matrix C - Op2DX = (int16)(DSP1.parameters [0] | (DSP1.parameters[1] << 8)); - Op2DY = (int16)(DSP1.parameters [2] | (DSP1.parameters[3] << 8)); - Op2DZ = (int16)(DSP1.parameters [4] | (DSP1.parameters[5] << 8)); + Op2DX = (int16_t)(DSP1.parameters [0] | (DSP1.parameters[1] << 8)); + Op2DY = (int16_t)(DSP1.parameters [2] | (DSP1.parameters[3] << 8)); + Op2DZ = (int16_t)(DSP1.parameters [4] | (DSP1.parameters[5] << 8)); DSPOp2D(); DSP1.out_count = 6; - DSP1.output [0] = (uint8)(Op2DF & 0xFF); - DSP1.output [1] = (uint8)((Op2DF >> 8) & 0xFF); - DSP1.output [2] = (uint8)(Op2DL & 0xFF); - DSP1.output [3] = (uint8)((Op2DL >> 8) & 0xFF); - DSP1.output [4] = (uint8)(Op2DU & 0xFF); - DSP1.output [5] = (uint8)((Op2DU >> 8) & 0xFF); + DSP1.output [0] = (uint8_t)(Op2DF & 0xFF); + DSP1.output [1] = (uint8_t)((Op2DF >> 8) & 0xFF); + DSP1.output [2] = (uint8_t)(Op2DL & 0xFF); + DSP1.output [3] = (uint8_t)((Op2DL >> 8) & 0xFF); + DSP1.output [4] = (uint8_t)(Op2DU & 0xFF); + DSP1.output [5] = (uint8_t)((Op2DU >> 8) & 0xFF); break; case 0x33: case 0x03: // Subjective matrix A - Op03F = (int16)(DSP1.parameters [0] | (DSP1.parameters[1] << 8)); - Op03L = (int16)(DSP1.parameters [2] | (DSP1.parameters[3] << 8)); - Op03U = (int16)(DSP1.parameters [4] | (DSP1.parameters[5] << 8)); + Op03F = (int16_t)(DSP1.parameters [0] | (DSP1.parameters[1] << 8)); + Op03L = (int16_t)(DSP1.parameters [2] | (DSP1.parameters[3] << 8)); + Op03U = (int16_t)(DSP1.parameters [4] | (DSP1.parameters[5] << 8)); DSPOp03(); DSP1.out_count = 6; - DSP1.output [0] = (uint8)(Op03X & 0xFF); - DSP1.output [1] = (uint8)((Op03X >> 8) & 0xFF); - DSP1.output [2] = (uint8)(Op03Y & 0xFF); - DSP1.output [3] = (uint8)((Op03Y >> 8) & 0xFF); - DSP1.output [4] = (uint8)(Op03Z & 0xFF); - DSP1.output [5] = (uint8)((Op03Z >> 8) & 0xFF); + DSP1.output [0] = (uint8_t)(Op03X & 0xFF); + DSP1.output [1] = (uint8_t)((Op03X >> 8) & 0xFF); + DSP1.output [2] = (uint8_t)(Op03Y & 0xFF); + DSP1.output [3] = (uint8_t)((Op03Y >> 8) & 0xFF); + DSP1.output [4] = (uint8_t)(Op03Z & 0xFF); + DSP1.output [5] = (uint8_t)((Op03Z >> 8) & 0xFF); break; case 0x13: // Subjective matrix B - Op13F = (int16)(DSP1.parameters [0] | (DSP1.parameters[1] << 8)); - Op13L = (int16)(DSP1.parameters [2] | (DSP1.parameters[3] << 8)); - Op13U = (int16)(DSP1.parameters [4] | (DSP1.parameters[5] << 8)); + Op13F = (int16_t)(DSP1.parameters [0] | (DSP1.parameters[1] << 8)); + Op13L = (int16_t)(DSP1.parameters [2] | (DSP1.parameters[3] << 8)); + Op13U = (int16_t)(DSP1.parameters [4] | (DSP1.parameters[5] << 8)); DSPOp13(); DSP1.out_count = 6; - DSP1.output [0] = (uint8)(Op13X & 0xFF); - DSP1.output [1] = (uint8)((Op13X >> 8) & 0xFF); - DSP1.output [2] = (uint8)(Op13Y & 0xFF); - DSP1.output [3] = (uint8)((Op13Y >> 8) & 0xFF); - DSP1.output [4] = (uint8)(Op13Z & 0xFF); - DSP1.output [5] = (uint8)((Op13Z >> 8) & 0xFF); + DSP1.output [0] = (uint8_t)(Op13X & 0xFF); + DSP1.output [1] = (uint8_t)((Op13X >> 8) & 0xFF); + DSP1.output [2] = (uint8_t)(Op13Y & 0xFF); + DSP1.output [3] = (uint8_t)((Op13Y >> 8) & 0xFF); + DSP1.output [4] = (uint8_t)(Op13Z & 0xFF); + DSP1.output [5] = (uint8_t)((Op13Z >> 8) & 0xFF); break; case 0x23: // Subjective matrix C - Op23F = (int16)(DSP1.parameters [0] | (DSP1.parameters[1] << 8)); - Op23L = (int16)(DSP1.parameters [2] | (DSP1.parameters[3] << 8)); - Op23U = (int16)(DSP1.parameters [4] | (DSP1.parameters[5] << 8)); + Op23F = (int16_t)(DSP1.parameters [0] | (DSP1.parameters[1] << 8)); + Op23L = (int16_t)(DSP1.parameters [2] | (DSP1.parameters[3] << 8)); + Op23U = (int16_t)(DSP1.parameters [4] | (DSP1.parameters[5] << 8)); DSPOp23(); DSP1.out_count = 6; - DSP1.output [0] = (uint8)(Op23X & 0xFF); - DSP1.output [1] = (uint8)((Op23X >> 8) & 0xFF); - DSP1.output [2] = (uint8)(Op23Y & 0xFF); - DSP1.output [3] = (uint8)((Op23Y >> 8) & 0xFF); - DSP1.output [4] = (uint8)(Op23Z & 0xFF); - DSP1.output [5] = (uint8)((Op23Z >> 8) & 0xFF); + DSP1.output [0] = (uint8_t)(Op23X & 0xFF); + DSP1.output [1] = (uint8_t)((Op23X >> 8) & 0xFF); + DSP1.output [2] = (uint8_t)(Op23Y & 0xFF); + DSP1.output [3] = (uint8_t)((Op23Y >> 8) & 0xFF); + DSP1.output [4] = (uint8_t)(Op23Z & 0xFF); + DSP1.output [5] = (uint8_t)((Op23Z >> 8) & 0xFF); break; case 0x3b: case 0x0b: - Op0BX = (int16)(DSP1.parameters [0] | (DSP1.parameters[1] << 8)); - Op0BY = (int16)(DSP1.parameters [2] | (DSP1.parameters[3] << 8)); - Op0BZ = (int16)(DSP1.parameters [4] | (DSP1.parameters[5] << 8)); + Op0BX = (int16_t)(DSP1.parameters [0] | (DSP1.parameters[1] << 8)); + Op0BY = (int16_t)(DSP1.parameters [2] | (DSP1.parameters[3] << 8)); + Op0BZ = (int16_t)(DSP1.parameters [4] | (DSP1.parameters[5] << 8)); DSPOp0B(); DSP1.out_count = 2; - DSP1.output [0] = (uint8)(Op0BS & 0xFF); - DSP1.output [1] = (uint8)((Op0BS >> 8) & 0xFF); + DSP1.output [0] = (uint8_t)(Op0BS & 0xFF); + DSP1.output [1] = (uint8_t)((Op0BS >> 8) & 0xFF); break; case 0x1b: - Op1BX = (int16)(DSP1.parameters [0] | (DSP1.parameters[1] << 8)); - Op1BY = (int16)(DSP1.parameters [2] | (DSP1.parameters[3] << 8)); - Op1BZ = (int16)(DSP1.parameters [4] | (DSP1.parameters[5] << 8)); + Op1BX = (int16_t)(DSP1.parameters [0] | (DSP1.parameters[1] << 8)); + Op1BY = (int16_t)(DSP1.parameters [2] | (DSP1.parameters[3] << 8)); + Op1BZ = (int16_t)(DSP1.parameters [4] | (DSP1.parameters[5] << 8)); DSPOp1B(); DSP1.out_count = 2; - DSP1.output [0] = (uint8)(Op1BS & 0xFF); - DSP1.output [1] = (uint8)((Op1BS >> 8) & 0xFF); + DSP1.output [0] = (uint8_t)(Op1BS & 0xFF); + DSP1.output [1] = (uint8_t)((Op1BS >> 8) & 0xFF); break; case 0x2b: - Op2BX = (int16)(DSP1.parameters [0] | (DSP1.parameters[1] << 8)); - Op2BY = (int16)(DSP1.parameters [2] | (DSP1.parameters[3] << 8)); - Op2BZ = (int16)(DSP1.parameters [4] | (DSP1.parameters[5] << 8)); + Op2BX = (int16_t)(DSP1.parameters [0] | (DSP1.parameters[1] << 8)); + Op2BY = (int16_t)(DSP1.parameters [2] | (DSP1.parameters[3] << 8)); + Op2BZ = (int16_t)(DSP1.parameters [4] | (DSP1.parameters[5] << 8)); DSPOp2B(); DSP1.out_count = 2; - DSP1.output [0] = (uint8)(Op2BS & 0xFF); - DSP1.output [1] = (uint8)((Op2BS >> 8) & 0xFF); + DSP1.output [0] = (uint8_t)(Op2BS & 0xFF); + DSP1.output [1] = (uint8_t)((Op2BS >> 8) & 0xFF); break; case 0x34: case 0x14: - Op14Zr = (int16)(DSP1.parameters [0] | (DSP1.parameters[1] << 8)); - Op14Xr = (int16)(DSP1.parameters [2] | (DSP1.parameters[3] << 8)); - Op14Yr = (int16)(DSP1.parameters [4] | (DSP1.parameters[5] << 8)); - Op14U = (int16)(DSP1.parameters [6] | (DSP1.parameters[7] << 8)); - Op14F = (int16)(DSP1.parameters [8] | (DSP1.parameters[9] << 8)); - Op14L = (int16)(DSP1.parameters [10] | (DSP1.parameters[11] << 8)); + Op14Zr = (int16_t)(DSP1.parameters [0] | (DSP1.parameters[1] << 8)); + Op14Xr = (int16_t)(DSP1.parameters [2] | (DSP1.parameters[3] << 8)); + Op14Yr = (int16_t)(DSP1.parameters [4] | (DSP1.parameters[5] << 8)); + Op14U = (int16_t)(DSP1.parameters [6] | (DSP1.parameters[7] << 8)); + Op14F = (int16_t)(DSP1.parameters [8] | (DSP1.parameters[9] << 8)); + Op14L = (int16_t)(DSP1.parameters [10] | (DSP1.parameters[11] << 8)); DSPOp14(); DSP1.out_count = 6; - DSP1.output [0] = (uint8)(Op14Zrr & 0xFF); - DSP1.output [1] = (uint8)((Op14Zrr >> 8) & 0xFF); - DSP1.output [2] = (uint8)(Op14Xrr & 0xFF); - DSP1.output [3] = (uint8)((Op14Xrr >> 8) & 0xFF); - DSP1.output [4] = (uint8)(Op14Yrr & 0xFF); - DSP1.output [5] = (uint8)((Op14Yrr >> 8) & 0xFF); + DSP1.output [0] = (uint8_t)(Op14Zrr & 0xFF); + DSP1.output [1] = (uint8_t)((Op14Zrr >> 8) & 0xFF); + DSP1.output [2] = (uint8_t)(Op14Xrr & 0xFF); + DSP1.output [3] = (uint8_t)((Op14Xrr >> 8) & 0xFF); + DSP1.output [4] = (uint8_t)(Op14Yrr & 0xFF); + DSP1.output [5] = (uint8_t)((Op14Yrr >> 8) & 0xFF); break; case 0x27: case 0x2F: - Op2FUnknown = (int16)(DSP1.parameters [0] | (DSP1.parameters[1] << 8)); + Op2FUnknown = (int16_t)(DSP1.parameters [0] | (DSP1.parameters[1] << 8)); DSPOp2F(); DSP1.out_count = 2; - DSP1.output [0] = (uint8)(Op2FSize & 0xFF); - DSP1.output [1] = (uint8)((Op2FSize >> 8) & 0xFF); + DSP1.output [0] = (uint8_t)(Op2FSize & 0xFF); + DSP1.output [1] = (uint8_t)((Op2FSize >> 8) & 0xFF); break; case 0x07: case 0x0F: - Op0FRamsize = (int16)(DSP1.parameters [0] | (DSP1.parameters[1] << 8)); + Op0FRamsize = (int16_t)(DSP1.parameters [0] | (DSP1.parameters[1] << 8)); DSPOp0F(); DSP1.out_count = 2; - DSP1.output [0] = (uint8)(Op0FPass & 0xFF); - DSP1.output [1] = (uint8)((Op0FPass >> 8) & 0xFF); + DSP1.output [0] = (uint8_t)(Op0FPass & 0xFF); + DSP1.output [1] = (uint8_t)((Op0FPass >> 8) & 0xFF); break; default: @@ -776,9 +776,9 @@ void DSP1SetByte(uint8 byte, uint16 address) } } -uint8 DSP1GetByte(uint16 address) +uint8_t DSP1GetByte(uint16_t address) { - uint8 t; + uint8_t t; if ((address & 0xf000) == 0x6000 || // (address >= 0x8000 && address < 0xc000)) (address & 0x7fff) < 0x4000) @@ -786,10 +786,10 @@ uint8 DSP1GetByte(uint16 address) if (DSP1.out_count) { //if ((address & 1) == 0) - t = (uint8) DSP1.output [DSP1.out_index]; + t = (uint8_t) DSP1.output [DSP1.out_index]; //else //{ - // t = (uint8) (DSP1.output [DSP1.out_index] >> 8); + // t = (uint8_t) (DSP1.output [DSP1.out_index] >> 8); DSP1.out_index++; if (--DSP1.out_count == 0) { @@ -810,12 +810,12 @@ uint8 DSP1GetByte(uint16 address) if (DSP1.command == 0x1f) { if ((DSP1.out_index % 2) != 0) - t = (uint8)DSP1ROM[DSP1.out_index >> 1]; + t = (uint8_t)DSP1ROM[DSP1.out_index >> 1]; else t = DSP1ROM[DSP1.out_index >> 1] >> 8; } } - DSP1.waiting4command = TRUE; + DSP1.waiting4command = true; //} } else @@ -831,7 +831,7 @@ uint8 DSP1GetByte(uint16 address) return t; } -void DSP2SetByte(uint8 byte, uint16 address) +void DSP2SetByte(uint8_t byte, uint16_t address) { if ((address & 0xf000) == 0x6000 || (address >= 0x8000 && address < 0xc000)) @@ -840,8 +840,8 @@ void DSP2SetByte(uint8 byte, uint16 address) { DSP1.command = byte; DSP1.in_index = 0; - DSP1.waiting4command = FALSE; - // DSP1.first_parameter = TRUE; + DSP1.waiting4command = false; + // DSP1.first_parameter = true; // printf("Op%02X\n",byte); switch (byte) { @@ -873,7 +873,7 @@ void DSP2SetByte(uint8 byte, uint16 address) else { DSP1.parameters [DSP1.in_index] = byte; - // DSP1.first_parameter = FALSE; + // DSP1.first_parameter = false; DSP1.in_index++; } @@ -881,7 +881,7 @@ void DSP2SetByte(uint8 byte, uint16 address) { //DSP1.parameters [DSP1.in_index] |= (byte << 8); // Actually execute the command - DSP1.waiting4command = TRUE; + DSP1.waiting4command = true; DSP1.out_index = 0; switch (DSP1.command) { @@ -932,9 +932,9 @@ void DSP2SetByte(uint8 byte, uint16 address) DSP2Op09Word2 = DSP1.parameters[2] | (DSP1.parameters[3] << 8); DSP1.out_count = 4; #ifdef FAST_LSB_WORD_ACCESS - *(uint32*)DSP1.output = DSP2Op09Word1 * DSP2Op09Word2; + *(uint32_t*)DSP1.output = DSP2Op09Word1 * DSP2Op09Word2; #else - uint32 temp; + uint32_t temp; temp = DSP2Op09Word1 * DSP2Op09Word2; DSP1.output[0] = temp & 0xFF; DSP1.output[1] = (temp >> 8) & 0xFF; @@ -973,15 +973,15 @@ void DSP2SetByte(uint8 byte, uint16 address) } } -uint8 DSP2GetByte(uint16 address) +uint8_t DSP2GetByte(uint16_t address) { - uint8 t; + uint8_t t; if ((address & 0xf000) == 0x6000 || (address >= 0x8000 && address < 0xc000)) { if (DSP1.out_count) { - t = (uint8) DSP1.output [DSP1.out_index]; + t = (uint8_t) DSP1.output [DSP1.out_index]; DSP1.out_index++; if (DSP1.out_count == DSP1.out_index) DSP1.out_count = 0; @@ -995,8 +995,8 @@ uint8 DSP2GetByte(uint16 address) //Disable non-working chips? #ifdef DSP_DUMMY_LOOPS -//static const uint16 DSP1ROM[1024] from SNES9X v1.53 -uint16 Dsp3Rom[1024] = +//static const uint16_t DSP1ROM[1024] from SNES9X v1.53 +uint16_t Dsp3Rom[1024] = { 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, @@ -1129,7 +1129,7 @@ uint16 Dsp3Rom[1024] = }; -void DSP3SetByte(uint8 byte, uint16 address) +void DSP3SetByte(uint8_t byte, uint16_t address) { if ((address & 0xf000) == 0x6000 || (address >= 0x8000 && address < 0xc000)) @@ -1138,8 +1138,8 @@ void DSP3SetByte(uint8 byte, uint16 address) { DSP1.command = byte; DSP1.in_index = 0; - DSP1.waiting4command = FALSE; - // DSP1.first_parameter = TRUE; + DSP1.waiting4command = false; + // DSP1.first_parameter = true; // printf("Op%02X\n",byte); switch (byte) { @@ -1163,7 +1163,7 @@ void DSP3SetByte(uint8 byte, uint16 address) else { DSP1.parameters [DSP1.in_index] = byte; - // DSP1.first_parameter = FALSE; + // DSP1.first_parameter = false; DSP1.in_index++; } @@ -1171,7 +1171,7 @@ void DSP3SetByte(uint8 byte, uint16 address) { //DSP1.parameters [DSP1.in_index] |= (byte << 8); // Actually execute the command - DSP1.waiting4command = TRUE; + DSP1.waiting4command = true; DSP1.out_index = 0; switch (DSP1.command) { @@ -1202,9 +1202,9 @@ void DSP3SetByte(uint8 byte, uint16 address) } } -uint8 DSP3GetByte(uint16 address) +uint8_t DSP3GetByte(uint16_t address) { - uint8 t; + uint8_t t; if ((address & 0xf000) == 0x6000 || (address >= 0x8000 && address < 0xc000)) { @@ -1216,7 +1216,7 @@ uint8 DSP3GetByte(uint16 address) if (DSP1.command == 0x1f) { if ((DSP1.out_index % 2) != 0) - t = (uint8)Dsp3Rom[DSP1.out_index >> 1]; + t = (uint8_t)Dsp3Rom[DSP1.out_index >> 1]; else t = Dsp3Rom[DSP1.out_index >> 1] >> 8; // t=Dsp3Rom[DSP1.out_index]; @@ -1224,7 +1224,7 @@ uint8 DSP3GetByte(uint16 address) } else { - t = (uint8) DSP1.output [DSP1.out_index]; + t = (uint8_t) DSP1.output [DSP1.out_index]; DSP1.out_index++; DSP1.out_index %= 512; if (DSP1.out_count == DSP1.out_index) @@ -1257,30 +1257,30 @@ uint8 DSP3GetByte(uint16 address) typedef struct { - bool8 waiting4command; - bool8 half_command; - uint16 command; - uint32 in_count; - uint32 in_index; - uint32 out_count; - uint32 out_index; - uint8 parameters [512]; - uint8 output [512]; + bool waiting4command; + bool half_command; + uint16_t command; + uint32_t in_count; + uint32_t in_index; + uint32_t out_count; + uint32_t out_index; + uint8_t parameters [512]; + uint8_t output [512]; } SDSP4; SDSP4 DSP4; #include "dsp4emu.c" -bool DSP4_init = FALSE; +bool DSP4_init = false; -void DSP4SetByte(uint8 byte, uint16 address) +void DSP4SetByte(uint8_t byte, uint16_t address) { if (!DSP4_init) { // bootup DSP4.waiting4command = 1; - DSP4_init = TRUE; + DSP4_init = true; } if ((address & 0xf000) == 0x6000 || @@ -1298,8 +1298,8 @@ void DSP4SetByte(uint8 byte, uint16 address) { DSP4.command |= (byte << 8); DSP4.in_index = 0; - DSP4.waiting4command = FALSE; - // DSP4.first_parameter = TRUE; + DSP4.waiting4command = false; + // DSP4.first_parameter = true; DSP4.half_command = 0; DSP4.out_count = 0; DSP4.out_index = 0; @@ -1347,7 +1347,7 @@ void DSP4SetByte(uint8 byte, uint16 address) DSP4.in_count = 8; break; default: - DSP4.waiting4command = TRUE; + DSP4.waiting4command = true; //printf("(line %d) Unknown Op%02X\n",line,DSP4.command); break; } @@ -1361,7 +1361,7 @@ void DSP4SetByte(uint8 byte, uint16 address) else { DSP4.parameters [DSP4.in_index] = byte; - // DSP4.first_parameter = FALSE; + // DSP4.first_parameter = false; DSP4.in_index++; } @@ -1369,7 +1369,7 @@ void DSP4SetByte(uint8 byte, uint16 address) { //DSP4.parameters [DSP4.in_index] |= (byte << 8); // Actually execute the command - DSP4.waiting4command = TRUE; + DSP4.waiting4command = true; DSP4.out_index = 0; DSP4.in_index = 0; switch (DSP4.command) @@ -1377,7 +1377,7 @@ void DSP4SetByte(uint8 byte, uint16 address) // 16-bit multiplication case 0x0000: { - int16 multiplier, multiplicand; + int16_t multiplier, multiplicand; int product; multiplier = DSP4_READ_WORD(0); @@ -1394,7 +1394,7 @@ void DSP4SetByte(uint8 byte, uint16 address) // unknown: horizontal mapping command case 0x0011: { - int16 a, b, c, d, m; + int16_t a, b, c, d, m; a = DSP4_READ_WORD(6); b = DSP4_READ_WORD(4); @@ -1474,10 +1474,10 @@ void DSP4SetByte(uint8 byte, uint16 address) // unknown case 0x000A: { - int16 in1a = DSP4_READ_WORD(0); - int16 in2a = DSP4_READ_WORD(2); - int16 in3a = DSP4_READ_WORD(4); - int16 out1a, out2a; + int16_t in1a = DSP4_READ_WORD(0); + int16_t in2a = DSP4_READ_WORD(2); + int16_t in3a = DSP4_READ_WORD(4); + int16_t out1a, out2a; out1a = (short)0xff40; out2a = (short)0x00c0; @@ -1494,9 +1494,9 @@ void DSP4SetByte(uint8 byte, uint16 address) // render player positions around track case 0x000B: { - int16 sp_x = DSP4_READ_WORD(0); - int16 sp_y = DSP4_READ_WORD(2); - int16 oam = DSP4_READ_WORD(4); + int16_t sp_x = DSP4_READ_WORD(0); + int16_t sp_y = DSP4_READ_WORD(2); + int16_t oam = DSP4_READ_WORD(4); // Only allow 1p/1p-split to yield output (???) if (!op09_mode) @@ -1530,15 +1530,15 @@ void DSP4SetByte(uint8 byte, uint16 address) } } -uint8 DSP4GetByte(uint16 address) +uint8_t DSP4GetByte(uint16_t address) { - uint8 t; + uint8_t t; if ((address & 0xf000) == 0x6000 || (address >= 0x8000 && address < 0xc000)) { if (DSP4.out_count) { - t = (uint8) DSP4.output [DSP4.out_index]; + t = (uint8_t) DSP4.output [DSP4.out_index]; DSP4.out_index++; if (DSP4.out_count == DSP4.out_index) DSP4.out_count = 0; -- cgit v1.2.3