aboutsummaryrefslogtreecommitdiff
path: root/source/dsp1.c
diff options
context:
space:
mode:
authortwinaphex2017-08-11 17:43:00 +0200
committertwinaphex2017-08-11 17:43:00 +0200
commitb9c74ceb1352c8f433cf6bf2c446ae07457c5267 (patch)
treeafd398fed3d08c81957373be55a12284cb932ab6 /source/dsp1.c
parent1aecedc999445e9a27e04f665fd562b576775d08 (diff)
downloadsnes9x2005-b9c74ceb1352c8f433cf6bf2c446ae07457c5267.tar.gz
snes9x2005-b9c74ceb1352c8f433cf6bf2c446ae07457c5267.tar.bz2
snes9x2005-b9c74ceb1352c8f433cf6bf2c446ae07457c5267.zip
Start making this suitable for MSVC and C89
Diffstat (limited to 'source/dsp1.c')
-rw-r--r--source/dsp1.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/source/dsp1.c b/source/dsp1.c
index 2166e87..98c0077 100644
--- a/source/dsp1.c
+++ b/source/dsp1.c
@@ -624,6 +624,10 @@ uint8_t DSP1GetByte(uint16_t address)
void DSP2SetByte(uint8_t byte, uint16_t address)
{
+#ifndef FAST_LSB_WORD_ACCESS
+ uint32_t temp;
+#endif
+
if ((address & 0xf000) == 0x6000 ||
(address >= 0x8000 && address < 0xc000))
{
@@ -715,7 +719,6 @@ void DSP2SetByte(uint8_t byte, uint16_t address)
#ifdef FAST_LSB_WORD_ACCESS
*(uint32_t*)DSP1.output = DSP2Op09Word1 * DSP2Op09Word2;
#else
- uint32_t temp;
temp = DSP2Op09Word1 * DSP2Op09Word2;
DSP1.output[0] = temp & 0xFF;
DSP1.output[1] = (temp >> 8) & 0xFF;
@@ -941,10 +944,11 @@ void DSP4SetByte(uint8_t byte, uint16_t address)
// internal memory management (06)
case 0x0005:
{
+ int32_t lcv;
+
// clear OAM tables
op06_index = 0;
op06_offset = 0;
- int32_t lcv;
for (lcv = 0; lcv < 32; lcv++)
op06_OAM[lcv] = 0;
break;
@@ -959,8 +963,9 @@ void DSP4SetByte(uint8_t byte, uint16_t address)
// sprite OAM post-table data
case 0x0006:
{
- DSP4.out_count = 32;
int32_t lcv;
+
+ DSP4.out_count = 32;
for (lcv = 0; lcv < 32; lcv++)
DSP4.output[lcv] = op06_OAM[lcv];
}