diff --git a/src/dsp.c b/src/dsp.c index b4a5bf3..0673be3 100644 --- a/src/dsp.c +++ b/src/dsp.c @@ -394,13 +394,9 @@ uint8_t DSPReadByte(uint32_t offset, uint32_t who/*=UNKNOWN*/) uint16_t DSPReadWord(uint32_t offset, uint32_t who/*=UNKNOWN*/) { -#ifdef USE_STRUCTS Offset offsett; offsett.LONG = offset; offset = offsett.Members.offset; -#else - offset &= 0xFFFFFFFE; -#endif if (offset >= DSP_WORK_RAM_BASE && offset <= DSP_WORK_RAM_BASE+0x1FFF) { offset -= DSP_WORK_RAM_BASE; @@ -408,7 +404,6 @@ uint16_t DSPReadWord(uint32_t offset, uint32_t who/*=UNKNOWN*/) } else if ((offset>=DSP_CONTROL_RAM_BASE)&&(offset> 16; -#endif } return JaguarReadWord(offset, who); @@ -868,7 +856,6 @@ INLINE void DSPExec(int32_t cycles) IMASKCleared = false; } -#ifdef USE_STRUCTS OpCode opcode; opcode.WORD = DSPReadWord(dsp_pc, DSP); uint8_t index = opcode.Codes.index; @@ -878,18 +865,8 @@ INLINE void DSPExec(int32_t cycles) dsp_opcode_second_parameter = sp; dsp_pc += 2; dsp_opcode[index](); -#else - uint16_t opcode; - uint32_t index; - opcode = DSPReadWord(dsp_pc, DSP); - index = opcode >> 10; - dsp_opcode_first_parameter = (opcode >> 5) & 0x1F; - dsp_opcode_second_parameter = opcode & 0x1F; - dsp_pc += 2; - dsp_opcode[index](); - dsp_opcode_use[index]++; -#endif - cycles -= dsp_opcode_cycles[index]; + + cycles -= dsp_opcode_cycles[index]; } dsp_in_exec--; diff --git a/src/gpu.c b/src/gpu.c index edd347f..17e5e07 100644 --- a/src/gpu.c +++ b/src/gpu.c @@ -301,16 +301,11 @@ INLINE uint16_t GPUReadWord(uint32_t offset, uint32_t who/*=UNKNOWN*/) if ((offset >= GPU_WORK_RAM_BASE) && (offset < GPU_WORK_RAM_BASE+0x1000)) { offset &= 0xFFF; -#ifdef USE_STRUCTS + OpCode data; data.Bytes.UBYTE = (uint16_t)gpu_ram_8[offset]; data.Bytes.LBYTE = (uint16_t)gpu_ram_8[offset+1]; return data.WORD; -#else - uint16_t data; - data = ((uint16_t)gpu_ram_8[offset] << 8) | (uint16_t)gpu_ram_8[offset+1]; - return data; -#endif } else if ((offset >= GPU_CONTROL_RAM_BASE) && (offset < GPU_CONTROL_RAM_BASE+0x20)) { @@ -1572,7 +1567,6 @@ INLINE static void gpu_opcode_abs(void) } -#ifdef USE_STRUCTS INLINE static void gpu_opcode_div(void) // RN / RM { @@ -1603,33 +1597,6 @@ INLINE static void gpu_opcode_div(void) // RN / RM RN = q.WORD; gpu_remain = r.WORD; } -#else -INLINE static void gpu_opcode_div(void) // RN / RM -{ - unsigned i; - // Real algorithm, courtesy of SCPCD: NYAN! - uint32_t q = RN; - uint32_t r = 0; - - // If 16.16 division, stuff top 16 bits of RN into remainder and put the - // bottom 16 of RN in top 16 of quotient - if (gpu_div_control & 0x01) - q <<= 16, r = RN >> 16; - - for(i=0; i<32; i++) - { - uint32_t sign = r & 0x80000000; - r = (r << 1) | ((q >> 31) & 0x01); - r += (sign ? RM : -RM); - q = (q << 1) | (((~r) >> 31) & 0x01); - } - - RN = q; - gpu_remain = r; - -} -#endif - INLINE static void gpu_opcode_imultn(void) { diff --git a/src/vjag_memory.h b/src/vjag_memory.h index 9246f52..2e711f5 100644 --- a/src/vjag_memory.h +++ b/src/vjag_memory.h @@ -170,7 +170,6 @@ typedef union GPUControl { } GPUControl; -#ifdef USE_STRUCTS #pragma pack(push, 1) typedef union OpCode { uint16_t WORD; @@ -198,9 +197,7 @@ typedef union GPUControl { #pragma pack(pop) typedef OpCode U16Union; -#endif //USE_STRUCTS -#ifdef USE_STRUCTS typedef union Offset { uint32_t LONG; #pragma pack(push, 1) @@ -215,7 +212,6 @@ typedef union Offset { } Members; #pragma pack(pop) } Offset; -#endif //USE_STRUCTS typedef union DSPLong { uint32_t LONG;