aboutsummaryrefslogtreecommitdiff
path: root/source/sa1.h
diff options
context:
space:
mode:
authorTwinaphex2017-02-12 16:02:47 +0100
committerGitHub2017-02-12 16:02:47 +0100
commit474a67ccdccb89d369c706347085ca4619f0cbef (patch)
treecb331b665bc5d53ad180d5500bf37e2dfbf683d8 /source/sa1.h
parentb6006bc542f89ad1b7086268f851f0ba880ad6cd (diff)
parentfb2517282da2fdfc26e58207bbb8e0a8bca35be2 (diff)
downloadsnes9x2005-474a67ccdccb89d369c706347085ca4619f0cbef.tar.gz
snes9x2005-474a67ccdccb89d369c706347085ca4619f0cbef.tar.bz2
snes9x2005-474a67ccdccb89d369c706347085ca4619f0cbef.zip
Merge pull request #31 from jamsilva/master
Improvements to both accuracy and performance.
Diffstat (limited to 'source/sa1.h')
-rw-r--r--source/sa1.h11
1 files changed, 6 insertions, 5 deletions
diff --git a/source/sa1.h b/source/sa1.h
index 2b83eb3..6eb9935 100644
--- a/source/sa1.h
+++ b/source/sa1.h
@@ -51,7 +51,7 @@ typedef struct
int64_t sum;
bool overflow;
uint8_t VirtualBitmapFormat;
- bool in_char_dma;
+ uint8_t in_char_dma;
uint8_t variable_bit_pos;
SSA1Registers Registers;
} SSA1;
@@ -78,6 +78,7 @@ void S9xSA1SetPCBase(uint32_t);
uint8_t S9xGetSA1(uint32_t);
void S9xSetSA1(uint8_t, uint32_t);
+extern SOpcodes S9xSA1OpcodesE1 [256];
extern SOpcodes S9xSA1OpcodesM1X1 [256];
extern SOpcodes S9xSA1OpcodesM1X0 [256];
extern SOpcodes S9xSA1OpcodesM0X1 [256];
@@ -92,7 +93,7 @@ void S9xFixSA1AfterSnapshotLoad();
#define TIMER_IRQ_SOURCE (1 << 6)
#define DMA_IRQ_SOURCE (1 << 5)
-static inline void S9xSA1UnpackStatus(void)
+static inline void S9xSA1UnpackStatus()
{
SA1._Zero = (SA1.Registers.PL & Zero) == 0;
SA1._Negative = (SA1.Registers.PL & Negative);
@@ -100,17 +101,17 @@ static inline void S9xSA1UnpackStatus(void)
SA1._Overflow = (SA1.Registers.PL & Overflow) >> 6;
}
-static inline void S9xSA1PackStatus(void)
+static inline void S9xSA1PackStatus()
{
SA1.Registers.PL &= ~(Zero | Negative | Carry | Overflow);
SA1.Registers.PL |= SA1._Carry | ((SA1._Zero == 0) << 1) |
(SA1._Negative & 0x80) | (SA1._Overflow << 6);
}
-static inline void S9xSA1FixCycles(void)
+static inline void S9xSA1FixCycles()
{
if (SA1CheckEmulation())
- SA1.S9xOpcodes = S9xSA1OpcodesM1X1;
+ SA1.S9xOpcodes = S9xSA1OpcodesE1;
else if (SA1CheckMemory())
{
if (SA1CheckIndex())