aboutsummaryrefslogtreecommitdiff
path: root/source/seta018.c
diff options
context:
space:
mode:
authorTwinaphex2017-08-16 06:04:43 +0200
committerGitHub2017-08-16 06:04:43 +0200
commite2cffaea148cfb79cc3546642acb61245b96069e (patch)
treec0a7c48d53a52641d6451aef386b7c2b73c0752a /source/seta018.c
parent4b70a73bcdb09e7f96a1e5696a512f4d33667f40 (diff)
parentb3711dfa5041d08490a8603fe221f267c0da290a (diff)
downloadsnes9x2005-e2cffaea148cfb79cc3546642acb61245b96069e.tar.gz
snes9x2005-e2cffaea148cfb79cc3546642acb61245b96069e.tar.bz2
snes9x2005-e2cffaea148cfb79cc3546642acb61245b96069e.zip
Merge pull request #41 from jamsilva/master
SA1 fixes and Brunnis' lagfix port
Diffstat (limited to 'source/seta018.c')
-rw-r--r--source/seta018.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/source/seta018.c b/source/seta018.c
index a608960..7cf0c80 100644
--- a/source/seta018.c
+++ b/source/seta018.c
@@ -7,11 +7,11 @@ ST018_Regs ST018;
uint8_t S9xGetST018(uint32_t Address)
{
- uint8_t t = 0; // Initialise to some value for the compiler
+ uint8_t t = 0; /* Initialise to some value for the compiler */
uint16_t address = (uint16_t) Address & 0xFFFF;
- // these roles may be flipped
- // op output
+ /* these roles may be flipped */
+ /* op output */
if (address == 0x3804)
{
if (ST018.out_count)
@@ -24,7 +24,7 @@ uint8_t S9xGetST018(uint32_t Address)
else
t = 0x81;
}
- else if (address == 0x3800) // status register
+ else if (address == 0x3800) /* status register */
t = ST018.status;
return t;
@@ -35,7 +35,7 @@ void S9xSetST018(uint8_t Byte, uint32_t Address)
uint16_t address = (uint16_t) Address & 0xFFFF;
static bool reset = false;
- if (!reset) // bootup values
+ if (!reset) /* bootup values */
{
ST018.waiting4command = true;
ST018.part_command = 0;
@@ -43,19 +43,19 @@ void S9xSetST018(uint8_t Byte, uint32_t Address)
}
Memory.SRAM[address] = Byte;
- ST018.status = 0x00; // default status for now
+ ST018.status = 0x00; /* default status for now */
- if (address == 0x3804) // op data goes through this address
+ if (address == 0x3804) /* op data goes through this address */
{
- if (ST018.waiting4command && ST018.part_command == 2) // check for new commands: 3 bytes length
+ if (ST018.waiting4command && ST018.part_command == 2) /* check for new commands: 3 bytes length */
{
ST018.waiting4command = false;
ST018.command <<= 8;
ST018.command |= Byte;
ST018.in_index = 0;
ST018.out_index = 0;
- ST018.part_command = 0; // 3-byte commands
- ST018.pass = 0; // data streams into the chip
+ ST018.part_command = 0; /* 3-byte commands */
+ ST018.pass = 0; /* data streams into the chip */
switch (ST018.command & 0xFFFFFF)
{
case 0x0100:
@@ -67,20 +67,20 @@ void S9xSetST018(uint8_t Byte, uint32_t Address)
break;
}
}
- else if (ST018.waiting4command) // 3-byte commands
+ else if (ST018.waiting4command) /* 3-byte commands */
{
ST018.part_command++;
ST018.command <<= 8;
ST018.command |= Byte;
}
}
- else if (address == 0x3802) // extra parameters
+ else if (address == 0x3802) /* extra parameters */
{
ST018.parameters[ST018.in_index] = Byte;
ST018.in_index++;
}
- if (ST018.in_count == ST018.in_index) // Actually execute the command
+ if (ST018.in_count == ST018.in_index) /* Actually execute the command */
{
ST018.waiting4command = true;
ST018.in_index = 0;
@@ -88,7 +88,7 @@ void S9xSetST018(uint8_t Byte, uint32_t Address)
switch (ST018.command)
{
case 0x0100:
- case 0xFF00: // hardware check?
+ case 0xFF00: /* hardware check? */
ST018.waiting4command = false;
ST018.pass++;
if (ST018.pass == 1)
@@ -96,7 +96,7 @@ void S9xSetST018(uint8_t Byte, uint32_t Address)
ST018.in_count = 1;
ST018.out_count = 2;
- // Overload's research
+ /* Overload's research */
ST018.output[0x00] = 0x81;
ST018.output[0x01] = 0x81;
}
@@ -105,7 +105,7 @@ void S9xSetST018(uint8_t Byte, uint32_t Address)
ST018.out_count = 3;
ST018.output[0x02] = 0x81;
- // done processing requests
+ /* done processing requests */
if (ST018.pass == 3)
ST018.waiting4command = true;
}