From 3777d1fcf4232cde426f46b7ee5c374fd949b1b0 Mon Sep 17 00:00:00 2001 From: João Silva Date: Sun, 12 Feb 2017 01:52:03 +0000 Subject: Type fixes. Fixes from snes9x 1.50. Minor changes and optimizations. --- source/sa1.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'source/sa1.c') diff --git a/source/sa1.c b/source/sa1.c index f7324b5..54ed836 100644 --- a/source/sa1.c +++ b/source/sa1.c @@ -13,7 +13,7 @@ static void S9xSA1ReadVariableLengthData(bool inc, bool no_shift); void S9xSA1Init() { SA1.NMIActive = false; - SA1.IRQActive = false; + SA1.IRQActive = 0; SA1.WaitingForInterrupt = false; SA1.Waiting = false; SA1.Flags = 0; @@ -413,7 +413,7 @@ void S9xSetSA1(uint8_t byte, uint32_t address) break; case 0x2231: if (byte & 0x80) - SA1.in_char_dma = false; + SA1.in_char_dma = 0; break; case 0x2236: Memory.FillRAM [address] = byte; @@ -426,7 +426,7 @@ void S9xSetSA1(uint8_t byte, uint32_t address) Memory.FillRAM [0x2300] |= 0x20; if (Memory.FillRAM [0x2201] & 0x20) S9xSetIRQ(SA1_DMA_IRQ_SOURCE); - SA1.in_char_dma = true; + SA1.in_char_dma = 1; } return; case 0x2237: @@ -476,7 +476,7 @@ void S9xSetSA1(uint8_t byte, uint32_t address) SA1.sum = SA1.op1 << 16; else { - uint64_t x = (SA1.op1 / (uint16_t) SA1.op2); + uint32_t x = (SA1.op1 / (uint16_t) SA1.op2); SA1.sum = x | ((SA1.op1 - (x * (uint16_t) SA1.op2)) << 16); } break; @@ -614,8 +614,7 @@ void S9xSA1ReadVariableLengthData(bool inc, bool no_shift) addr += (s >> 4) << 1; s &= 15; } - uint32_t data = S9xSA1GetWord(addr) | - (S9xSA1GetWord(addr + 2) << 16); + uint32_t data = S9xSA1GetWord(addr) | (S9xSA1GetWord(addr + 2) << 16); data >>= s; Memory.FillRAM [0x230c] = (uint8_t) data; -- cgit v1.2.3