From b3711dfa5041d08490a8603fe221f267c0da290a Mon Sep 17 00:00:00 2001 From: João Silva Date: Wed, 16 Aug 2017 04:20:50 +0100 Subject: snes9x2010 Lagfix port and comment changes. --- source/seta018.c | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'source/seta018.c') 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; } -- cgit v1.2.3