diff --git a/c4.cpp b/c4.cpp index ce406822..d586e79e 100644 --- a/c4.cpp +++ b/c4.cpp @@ -328,14 +328,3 @@ uint8 * S9xGetMemPointerC4 (uint16 Address) return (NULL); return (Memory.C4RAM - 0x6000 + (Address & 0xffff)); } - -#ifdef ZSNES_C4 -START_EXTERN_C - -void C4LoaDMem (char *C4RAM) -{ - memmove(C4RAM + (READ_WORD(C4RAM + 0x1f45) & 0x1fff), C4GetMemPointer(READ_3WORD(C4RAM + 0x1f40)), READ_WORD(C4RAM + 0x1f43)); -} - -END_EXTERN_C -#endif diff --git a/c4.h b/c4.h index 649d8bb3..9b4c6070 100644 --- a/c4.h +++ b/c4.h @@ -178,10 +178,6 @@ #ifndef _C4_H_ #define _C4_H_ -#ifdef ZSNES_C4 -START_EXTERN_C -#endif - extern int16 C4WFXVal; extern int16 C4WFYVal; extern int16 C4WFZVal; @@ -195,10 +191,6 @@ extern int16 C41FAngleRes; extern int16 C41FDist; extern int16 C41FDistVal; -#ifdef ZSNES_C4 -extern uint8 *C4Ram; -#endif - void C4TransfWireFrame (void); void C4TransfWireFrame2 (void); void C4CalcWireFrame (void); @@ -208,11 +200,6 @@ void C4Op1F (void); void S9xInitC4 (void); void S9xSetC4 (uint8, uint16); uint8 S9xGetC4 (uint16); - -#ifdef ZSNES_C4 -END_EXTERN_C -#endif - uint8 * S9xGetBasePointerC4 (uint16); uint8 * S9xGetMemPointerC4 (uint16); diff --git a/cheats2.cpp b/cheats2.cpp index d174c5cf..fc076b5b 100644 --- a/cheats2.cpp +++ b/cheats2.cpp @@ -186,12 +186,9 @@ static void S9xSetByteFree (uint8, uint32); static uint8 S9xGetByteFree (uint32 address) { uint32 Cycles = CPU.Cycles; - uint32 WaitAddress = CPU.WaitAddress; uint8 byte; byte = S9xGetByte(address); - - CPU.WaitAddress = WaitAddress; CPU.Cycles = Cycles; return (byte); @@ -200,11 +197,8 @@ static uint8 S9xGetByteFree (uint32 address) static void S9xSetByteFree (uint8 byte, uint32 address) { uint32 Cycles = CPU.Cycles; - uint32 WaitAddress = CPU.WaitAddress; S9xSetByte(byte, address); - - CPU.WaitAddress = WaitAddress; CPU.Cycles = Cycles; } diff --git a/controls.cpp b/controls.cpp index b34bf95b..5985781d 100644 --- a/controls.cpp +++ b/controls.cpp @@ -425,7 +425,6 @@ static const int ptrspeeds[4] = { 1, 1, 4, 8 }; S(ToggleBG2), \ S(ToggleBG3), \ S(ToggleEmuTurbo), \ - S(ToggleHDMA), \ S(ToggleSprites), \ S(ToggleTransparency) \ @@ -2454,11 +2453,6 @@ void S9xApplyCommand (s9xcommand_t cmd, int16 data1, int16 data2) DisplayStateChange("Sprites", !(Settings.BG_Forced & 16)); break; - case ToggleHDMA: - Settings.DisableHDMA = !Settings.DisableHDMA; - DisplayStateChange("HDMA emulation", !Settings.DisableHDMA); - break; - case ToggleTransparency: Settings.Transparency = !Settings.Transparency; DisplayStateChange("Transparency effects", Settings.Transparency); diff --git a/cpu.cpp b/cpu.cpp index f2efb4ce..547a4469 100644 --- a/cpu.cpp +++ b/cpu.cpp @@ -208,12 +208,16 @@ static void S9xResetCPU (void) static void S9xSoftResetCPU (void) { CPU.Cycles = 182; // Or 188. This is the cycle count just after the jump to the Reset Vector. - CPU.PrevCycles = -1; + CPU.PrevCycles = CPU.Cycles; CPU.V_Counter = 0; CPU.Flags = CPU.Flags & (DEBUG_MODE_FLAG | TRACE_FLAG); CPU.PCBase = NULL; - CPU.IRQActive = FALSE; - CPU.IRQPending = 0; + CPU.NMILine = FALSE; + CPU.IRQLine = FALSE; + CPU.IRQTransition = FALSE; + CPU.IRQLastState = FALSE; + CPU.IRQExternal = FALSE; + CPU.IRQPending = Timings.IRQPendCount; CPU.MemSpeed = SLOW_ONE_CYCLE; CPU.MemSpeedx2 = SLOW_ONE_CYCLE * 2; CPU.FastROMSpeed = SLOW_ONE_CYCLE; @@ -226,9 +230,6 @@ static void S9xSoftResetCPU (void) CPU.WhichEvent = HC_RENDER_EVENT; CPU.NextEvent = Timings.RenderPos; CPU.WaitingForInterrupt = FALSE; - CPU.WaitAddress = 0xffffffff; - CPU.WaitCounter = 0; - CPU.PBPCAtOpcodeStart = 0xffffffff; CPU.AutoSaveTimer = 0; CPU.SRAMModified = FALSE; @@ -261,7 +262,6 @@ static void S9xSoftResetCPU (void) ICPU.S9xOpcodes = S9xOpcodesE1; ICPU.S9xOpLengths = S9xOpLengthsM1X1; - ICPU.CPUExecuting = TRUE; S9xUnpackStatus(); } diff --git a/cpuexec.cpp b/cpuexec.cpp index 1537aeaf..5b1656e1 100644 --- a/cpuexec.cpp +++ b/cpuexec.cpp @@ -187,102 +187,91 @@ #include "missing.h" #endif +static inline void S9xReschedule (void); + void S9xMainLoop (void) { for (;;) { - if (CPU.Flags) + if (CPU.NMILine) { - if (CPU.Flags & NMI_FLAG) + if (Timings.NMITriggerPos <= CPU.Cycles) { - if (Timings.NMITriggerPos <= CPU.Cycles) + CPU.NMILine = FALSE; + Timings.NMITriggerPos = 0xffff; + if (CPU.WaitingForInterrupt) { - CPU.Flags &= ~NMI_FLAG; - Timings.NMITriggerPos = 0xffff; - if (CPU.WaitingForInterrupt) - { - CPU.WaitingForInterrupt = FALSE; - Registers.PCw++; - } - - S9xOpcode_NMI(); + CPU.WaitingForInterrupt = FALSE; + Registers.PCw++; } + + S9xOpcode_NMI(); } - - #ifdef DEBUGGER - if ((CPU.Flags & BREAK_FLAG) && !(CPU.Flags & SINGLE_STEP_FLAG)) - { - for (int Break = 0; Break != 6; Break++) - { - if (S9xBreakpoint[Break].Enabled && - S9xBreakpoint[Break].Bank == Registers.PB && - S9xBreakpoint[Break].Address == Registers.PCw) - { - if (S9xBreakpoint[Break].Enabled == 2) - S9xBreakpoint[Break].Enabled = TRUE; - else - CPU.Flags |= DEBUG_MODE_FLAG; - } - } - } - #endif - - if (CPU.Flags & IRQ_FLAG) - { - if (CPU.IRQPending) - // FIXME: In case of IRQ during WRAM refresh - CPU.IRQPending--; - else - { - if (CPU.WaitingForInterrupt) - { - CPU.WaitingForInterrupt = FALSE; - Registers.PCw++; - } - - if (CPU.IRQActive && !Settings.DisableIRQ) - { - if (!CheckFlag(IRQ)) - // in IRQ handler $4211 is supposed to be read, so IRQ_FLAG should be cleared. - S9xOpcode_IRQ(); - } - else - CPU.Flags &= ~IRQ_FLAG; - } - } - - if (CPU.Flags & SCAN_KEYS_FLAG) - break; - - #ifdef DEBUGGER - if (CPU.Flags & DEBUG_MODE_FLAG) - break; - - if (CPU.Flags & TRACE_FLAG) - S9xTrace(); - - if (CPU.Flags & SINGLE_STEP_FLAG) - { - CPU.Flags &= ~SINGLE_STEP_FLAG; - CPU.Flags |= DEBUG_MODE_FLAG; - } - #endif } - #ifdef CPU_SHUTDOWN - CPU.PBPCAtOpcodeStart = Registers.PBPC; + if (CPU.IRQTransition || CPU.IRQExternal) + { + if (CPU.IRQPending) + CPU.IRQPending--; + else + { + if (CPU.WaitingForInterrupt) + { + CPU.WaitingForInterrupt = FALSE; + Registers.PCw++; + } + + CPU.IRQTransition = FALSE; + CPU.IRQPending = Timings.IRQPendCount; + + if (!CheckFlag(IRQ)) + S9xOpcode_IRQ(); + } + } + + #ifdef DEBUGGER + if ((CPU.Flags & BREAK_FLAG) && !(CPU.Flags & SINGLE_STEP_FLAG)) + { + for (int Break = 0; Break != 6; Break++) + { + if (S9xBreakpoint[Break].Enabled && + S9xBreakpoint[Break].Bank == Registers.PB && + S9xBreakpoint[Break].Address == Registers.PCw) + { + if (S9xBreakpoint[Break].Enabled == 2) + S9xBreakpoint[Break].Enabled = TRUE; + else + CPU.Flags |= DEBUG_MODE_FLAG; + } + } + } + + if (CPU.Flags & DEBUG_MODE_FLAG) + break; + + if (CPU.Flags & TRACE_FLAG) + S9xTrace(); + + if (CPU.Flags & SINGLE_STEP_FLAG) + { + CPU.Flags &= ~SINGLE_STEP_FLAG; + CPU.Flags |= DEBUG_MODE_FLAG; + } #endif + if (CPU.Flags & SCAN_KEYS_FLAG) + break; + register uint8 Op; register struct SOpcodes *Opcodes; - CPU.PrevCycles = CPU.Cycles; - if (CPU.PCBase) { Op = CPU.PCBase[Registers.PCw]; + CPU.PrevCycles = CPU.Cycles; CPU.Cycles += CPU.MemSpeed; + S9xCheckInterrupts(); Opcodes = ICPU.S9xOpcodes; } else @@ -304,13 +293,8 @@ void S9xMainLoop (void) Registers.PCw++; (*Opcodes[Op].S9xOpcode)(); - if (SA1.Executing) + if (Settings.SA1) S9xSA1MainLoop(); - - #if (S9X_ACCURACY_LEVEL <= 2) - while (CPU.Cycles >= CPU.NextEvent) - S9xDoHEventProcessing(); - #endif } S9xPackStatus(); @@ -325,54 +309,54 @@ void S9xMainLoop (void) } } -void S9xSetIRQ (uint32 source) +static inline void S9xReschedule (void) { - CPU.IRQActive |= source; - CPU.IRQPending = Timings.IRQPendCount; - CPU.Flags |= IRQ_FLAG; - - if (CPU.WaitingForInterrupt) + switch (CPU.WhichEvent) { - // Force IRQ to trigger immediately after WAI - - // Final Fantasy Mystic Quest crashes without this. - CPU.WaitingForInterrupt = FALSE; - Registers.PCw++; + case HC_HBLANK_START_EVENT: + CPU.WhichEvent = HC_HDMA_START_EVENT; + CPU.NextEvent = Timings.HDMAStart; + break; + + case HC_HDMA_START_EVENT: + CPU.WhichEvent = HC_HCOUNTER_MAX_EVENT; + CPU.NextEvent = Timings.H_Max; + break; + + case HC_HCOUNTER_MAX_EVENT: + CPU.WhichEvent = HC_HDMA_INIT_EVENT; + CPU.NextEvent = Timings.HDMAInit; + break; + + case HC_HDMA_INIT_EVENT: + CPU.WhichEvent = HC_RENDER_EVENT; + CPU.NextEvent = Timings.RenderPos; + break; + + case HC_RENDER_EVENT: + CPU.WhichEvent = HC_WRAM_REFRESH_EVENT; + CPU.NextEvent = Timings.WRAMRefreshPos; + break; + + case HC_WRAM_REFRESH_EVENT: + CPU.WhichEvent = HC_HBLANK_START_EVENT; + CPU.NextEvent = Timings.HBlankStart; + break; } - -#ifdef DEBUGGER - S9xTraceMessage("--- /IRQ low"); -#endif -} - -void S9xClearIRQ (uint32 source) -{ - CPU.IRQActive &= ~source; - if (!CPU.IRQActive) - CPU.Flags &= ~IRQ_FLAG; - -#ifdef DEBUGGER - S9xTraceMessage("--- /IRQ high"); -#endif } void S9xDoHEventProcessing (void) { #ifdef DEBUGGER - static char eventname[13][32] = + static char eventname[7][32] = { "", "HC_HBLANK_START_EVENT", - "HC_IRQ_1_3_EVENT ", "HC_HDMA_START_EVENT ", - "HC_IRQ_3_5_EVENT ", "HC_HCOUNTER_MAX_EVENT", - "HC_IRQ_5_7_EVENT ", "HC_HDMA_INIT_EVENT ", - "HC_IRQ_7_9_EVENT ", "HC_RENDER_EVENT ", - "HC_IRQ_9_A_EVENT ", - "HC_WRAM_REFRESH_EVENT", - "HC_IRQ_A_1_EVENT " + "HC_WRAM_REFRESH_EVENT" }; #endif @@ -382,19 +366,13 @@ void S9xDoHEventProcessing (void) eventname[CPU.WhichEvent], CPU.NextEvent, CPU.Cycles); #endif -#ifdef CPU_SHUTDOWN - CPU.WaitCounter++; -#endif - switch (CPU.WhichEvent) { case HC_HBLANK_START_EVENT: - S9xCheckMissingHTimerPosition(Timings.HBlankStart); S9xReschedule(); break; case HC_HDMA_START_EVENT: - S9xCheckMissingHTimerPosition(Timings.HDMAStart); S9xReschedule(); if (PPU.HDMA && CPU.V_Counter <= PPU.ScreenHeight) @@ -408,19 +386,16 @@ void S9xDoHEventProcessing (void) break; case HC_HCOUNTER_MAX_EVENT: - #ifndef ZSNES_FX if (Settings.SuperFX) { if (!SuperFX.oneLineDone) S9xSuperFXExec(); SuperFX.oneLineDone = FALSE; } - #else - S9xSuperFXExec(); - #endif S9xAPUEndScanline(); CPU.Cycles -= Timings.H_Max; + CPU.PrevCycles -= Timings.H_Max; S9xAPUSetReferenceTime(CPU.Cycles); if ((Timings.NMITriggerPos != 0xffff) && (Timings.NMITriggerPos >= Timings.H_Max)) @@ -449,7 +424,7 @@ void S9xDoHEventProcessing (void) // FIXME: reading $4210 will wait 2 cycles, then perform reading, then wait 4 more cycles. Memory.FillRAM[0x4210] = Model->_5A22; - CPU.Flags &= ~NMI_FLAG; + CPU.NMILine = FALSE; Timings.NMITriggerPos = 0xffff; ICPU.Frame++; @@ -481,8 +456,6 @@ void S9xDoHEventProcessing (void) else Timings.WRAMRefreshPos = SNES_WRAM_REFRESH_HC_v1; - S9xCheckMissingHTimerPosition(0); - if (CPU.V_Counter == PPU.ScreenHeight + FIRST_VISIBLE_LINE) // VBlank starts from V=225(240). { S9xEndScreenRefresh(); @@ -517,7 +490,7 @@ void S9xDoHEventProcessing (void) { // FIXME: triggered at HC=6, checked just before the final CPU cycle, // then, when to call S9xOpcode_NMI()? - CPU.Flags |= NMI_FLAG; + CPU.NMILine = TRUE; Timings.NMITriggerPos = 6 + 6; } @@ -532,13 +505,11 @@ void S9xDoHEventProcessing (void) if (CPU.V_Counter == FIRST_VISIBLE_LINE) // V=1 S9xStartScreenRefresh(); - CPU.NextEvent = -1; S9xReschedule(); break; case HC_HDMA_INIT_EVENT: - S9xCheckMissingHTimerPosition(Timings.HDMAInit); S9xReschedule(); if (CPU.V_Counter == 0) @@ -555,7 +526,6 @@ void S9xDoHEventProcessing (void) if (CPU.V_Counter >= FIRST_VISIBLE_LINE && CPU.V_Counter <= PPU.ScreenHeight) RenderLine((uint8) (CPU.V_Counter - FIRST_VISIBLE_LINE)); - S9xCheckMissingHTimerPosition(Timings.RenderPos); S9xReschedule(); break; @@ -565,27 +535,12 @@ void S9xDoHEventProcessing (void) S9xTraceFormattedMessage("*** WRAM Refresh HC:%04d", CPU.Cycles); #endif - S9xCheckMissingHTimerHalt(Timings.WRAMRefreshPos, SNES_WRAM_REFRESH_CYCLES); + CPU.PrevCycles = CPU.Cycles; CPU.Cycles += SNES_WRAM_REFRESH_CYCLES; - - S9xCheckMissingHTimerPosition(Timings.WRAMRefreshPos); - S9xReschedule(); - - break; - - case HC_IRQ_1_3_EVENT: - case HC_IRQ_3_5_EVENT: - case HC_IRQ_5_7_EVENT: - case HC_IRQ_7_9_EVENT: - case HC_IRQ_9_A_EVENT: - case HC_IRQ_A_1_EVENT: - if (PPU.HTimerEnabled && (!PPU.VTimerEnabled || (CPU.V_Counter == PPU.VTimerPosition))) - S9xSetIRQ(PPU_IRQ_SOURCE); - else - if (PPU.VTimerEnabled && (CPU.V_Counter == PPU.VTimerPosition)) - S9xSetIRQ(PPU_IRQ_SOURCE); + S9xCheckInterrupts(); S9xReschedule(); + break; } diff --git a/cpuexec.h b/cpuexec.h index b11cff61..ccfadd5c 100644 --- a/cpuexec.h +++ b/cpuexec.h @@ -179,6 +179,9 @@ #define _CPUEXEC_H_ #include "ppu.h" +#ifdef DEBUGGER +#include "debug.h" +#endif struct SOpcodes { @@ -193,7 +196,6 @@ struct SICPU uint8 _Zero; uint8 _Negative; uint8 _Overflow; - bool8 CPUExecuting; uint32 ShiftedPB; uint32 ShiftedDB; uint32 Frame; @@ -217,8 +219,6 @@ void S9xMainLoop (void); void S9xReset (void); void S9xSoftReset (void); void S9xDoHEventProcessing (void); -void S9xClearIRQ (uint32); -void S9xSetIRQ (uint32); static inline void S9xUnpackStatus (void) { @@ -270,84 +270,43 @@ static inline void S9xFixCycles (void) } } -static inline void S9xReschedule (void) +static inline void S9xCheckInterrupts (void) { - uint8 next = 0; - int32 hpos = 0; + bool8 thisIRQ = PPU.HTimerEnabled || PPU.VTimerEnabled; - switch (CPU.WhichEvent) + if (CPU.IRQLine && thisIRQ) + CPU.IRQTransition = TRUE; + + if (PPU.HTimerEnabled) { - case HC_HBLANK_START_EVENT: - case HC_IRQ_1_3_EVENT: - next = HC_HDMA_START_EVENT; - hpos = Timings.HDMAStart; - break; + int32 htimepos = PPU.HTimerPosition; + if (CPU.Cycles >= Timings.H_Max) + htimepos += Timings.H_Max; - case HC_HDMA_START_EVENT: - case HC_IRQ_3_5_EVENT: - next = HC_HCOUNTER_MAX_EVENT; - hpos = Timings.H_Max; - break; - - case HC_HCOUNTER_MAX_EVENT: - case HC_IRQ_5_7_EVENT: - next = HC_HDMA_INIT_EVENT; - hpos = Timings.HDMAInit; - break; - - case HC_HDMA_INIT_EVENT: - case HC_IRQ_7_9_EVENT: - next = HC_RENDER_EVENT; - hpos = Timings.RenderPos; - break; - - case HC_RENDER_EVENT: - case HC_IRQ_9_A_EVENT: - next = HC_WRAM_REFRESH_EVENT; - hpos = Timings.WRAMRefreshPos; - break; - - case HC_WRAM_REFRESH_EVENT: - case HC_IRQ_A_1_EVENT: - next = HC_HBLANK_START_EVENT; - hpos = Timings.HBlankStart; - break; + if (CPU.PrevCycles >= htimepos || CPU.Cycles < htimepos) + thisIRQ = FALSE; } - if (((int32) PPU.HTimerPosition > CPU.NextEvent) && ((int32) PPU.HTimerPosition < hpos)) + if (PPU.VTimerEnabled) { - hpos = (int32) PPU.HTimerPosition; + int32 vcounter = CPU.V_Counter; + if (CPU.Cycles >= Timings.H_Max) + vcounter++; - switch (next) - { - case HC_HDMA_START_EVENT: - next = HC_IRQ_1_3_EVENT; - break; - - case HC_HCOUNTER_MAX_EVENT: - next = HC_IRQ_3_5_EVENT; - break; - - case HC_HDMA_INIT_EVENT: - next = HC_IRQ_5_7_EVENT; - break; - - case HC_RENDER_EVENT: - next = HC_IRQ_7_9_EVENT; - break; - - case HC_WRAM_REFRESH_EVENT: - next = HC_IRQ_9_A_EVENT; - break; - - case HC_HBLANK_START_EVENT: - next = HC_IRQ_A_1_EVENT; - break; - } + if (vcounter != PPU.VTimerPosition) + thisIRQ = FALSE; } - CPU.NextEvent = hpos; - CPU.WhichEvent = next; + if (!CPU.IRQLastState && thisIRQ) + { +#ifdef DEBUGGER + S9xTraceFormattedMessage("--- /IRQ High->Low prev HC:%04d curr HC:%04d HTimer:%d Pos:%04d VTimer:%d Pos:%03d", + CPU.PrevCycles, CPU.Cycles, PPU.HTimerEnabled, PPU.HTimerPosition, PPU.VTimerEnabled, PPU.VTimerPosition); +#endif + CPU.IRQLine = TRUE; + } + + CPU.IRQLastState = thisIRQ; } #endif diff --git a/cpumacro.h b/cpumacro.h index 9b1fc4cb..73c4340b 100644 --- a/cpumacro.h +++ b/cpumacro.h @@ -280,7 +280,6 @@ static void Op##OP (void) \ S9xSetPCBase(ICPU.ShiftedPB + newPC.W); \ else \ Registers.PCw = newPC.W; \ - CPUShutdown(); \ } \ } @@ -515,9 +514,6 @@ static inline void CPY (uint8 val) static inline void DEC16 (uint32 OpAddress, s9xwrap_t w) { -#ifdef CPU_SHUTDOWN - CPU.WaitAddress = 0xffffffff; -#endif uint16 Work16 = S9xGetWord(OpAddress, w) - 1; AddCycles(ONE_CYCLE); S9xSetWord(Work16, OpAddress, w, WRITE_10); @@ -527,9 +523,6 @@ static inline void DEC16 (uint32 OpAddress, s9xwrap_t w) static inline void DEC8 (uint32 OpAddress) { -#ifdef CPU_SHUTDOWN - CPU.WaitAddress = 0xffffffff; -#endif uint8 Work8 = S9xGetByte(OpAddress) - 1; AddCycles(ONE_CYCLE); S9xSetByte(Work8, OpAddress); @@ -551,9 +544,6 @@ static inline void EOR (uint8 val) static inline void INC16 (uint32 OpAddress, s9xwrap_t w) { -#ifdef CPU_SHUTDOWN - CPU.WaitAddress = 0xffffffff; -#endif uint16 Work16 = S9xGetWord(OpAddress, w) + 1; AddCycles(ONE_CYCLE); S9xSetWord(Work16, OpAddress, w, WRITE_10); @@ -563,9 +553,6 @@ static inline void INC16 (uint32 OpAddress, s9xwrap_t w) static inline void INC8 (uint32 OpAddress) { -#ifdef CPU_SHUTDOWN - CPU.WaitAddress = 0xffffffff; -#endif uint8 Work8 = S9xGetByte(OpAddress) + 1; AddCycles(ONE_CYCLE); S9xSetByte(Work8, OpAddress); diff --git a/cpuops.cpp b/cpuops.cpp index f9735475..d68cd37d 100644 --- a/cpuops.cpp +++ b/cpuops.cpp @@ -188,13 +188,9 @@ #endif #ifdef SA1_OPCODES -#define AddCycles(n) { } +#define AddCycles(n) { SA1.Cycles += (n); } #else -#if (S9X_ACCURACY_LEVEL >= 3) -#define AddCycles(n) { CPU.Cycles += (n); while (CPU.Cycles >= CPU.NextEvent) S9xDoHEventProcessing(); } -#else -#define AddCycles(n) { CPU.Cycles += (n); } -#endif +#define AddCycles(n) { CPU.PrevCycles = CPU.Cycles; CPU.Cycles += (n); S9xCheckInterrupts(); while (CPU.Cycles >= CPU.NextEvent) S9xDoHEventProcessing(); } #endif #include "cpuaddr.h" @@ -659,9 +655,6 @@ rOPX (CCSlow, AbsoluteSlow, WRAP_NONE, CPY) static void Op3AM1 (void) { AddCycles(ONE_CYCLE); -#ifdef CPU_SHUTDOWN - CPU.WaitAddress = 0xffffffff; -#endif Registers.AL--; SetZN(Registers.AL); } @@ -669,9 +662,6 @@ static void Op3AM1 (void) static void Op3AM0 (void) { AddCycles(ONE_CYCLE); -#ifdef CPU_SHUTDOWN - CPU.WaitAddress = 0xffffffff; -#endif Registers.A.W--; SetZN(Registers.A.W); } @@ -679,9 +669,6 @@ static void Op3AM0 (void) static void Op3ASlow (void) { AddCycles(ONE_CYCLE); -#ifdef CPU_SHUTDOWN - CPU.WaitAddress = 0xffffffff; -#endif if (CheckMemory()) { @@ -813,9 +800,6 @@ rOPM (53Slow, StackRelativeIndirectIndexedSlow, WRAP_NONE, EOR) static void Op1AM1 (void) { AddCycles(ONE_CYCLE); -#ifdef CPU_SHUTDOWN - CPU.WaitAddress = 0xffffffff; -#endif Registers.AL++; SetZN(Registers.AL); } @@ -823,9 +807,6 @@ static void Op1AM1 (void) static void Op1AM0 (void) { AddCycles(ONE_CYCLE); -#ifdef CPU_SHUTDOWN - CPU.WaitAddress = 0xffffffff; -#endif Registers.A.W++; SetZN(Registers.A.W); } @@ -833,9 +814,6 @@ static void Op1AM0 (void) static void Op1ASlow (void) { AddCycles(ONE_CYCLE); -#ifdef CPU_SHUTDOWN - CPU.WaitAddress = 0xffffffff; -#endif if (CheckMemory()) { @@ -1550,54 +1528,6 @@ mOPM (0CSlow, AbsoluteSlow, WRAP_BANK, TSB) /* Branch Instructions ***************************************************** */ -#ifdef CPU_SHUTDOWN - -#ifndef SA1_OPCODES - -inline void CPUShutdown (void) -{ - if (Settings.Shutdown && Registers.PBPC == CPU.WaitAddress) - { - // Don't skip cycles with a pending NMI or IRQ - could cause delayed interrupt. - if (CPU.WaitCounter == 0 && !(CPU.Flags & (IRQ_FLAG | NMI_FLAG))) - { - CPU.WaitAddress = 0xffffffff; - if (Settings.SA1) - S9xSA1ExecuteDuringSleep(); - CPU.Cycles = CPU.NextEvent; - ICPU.CPUExecuting = FALSE; - S9xAPUExecute(); - ICPU.CPUExecuting = TRUE; - } - else - if (CPU.WaitCounter >= 2) - CPU.WaitCounter = 1; - else - CPU.WaitCounter--; - } -} - -#else - -inline void CPUShutdown (void) -{ - if (Settings.Shutdown && Registers.PBPC == CPU.WaitAddress) - { - if (CPU.WaitCounter >= 1) - SA1.Executing = FALSE; - else - CPU.WaitCounter++; - } -} - -#endif - -#else - -#define CPUShutdown() - -#endif - // BCC bOP(90E0, Relative, !CheckCarry(), 0, 0) bOP(90E1, Relative, !CheckCarry(), 0, 1) @@ -1692,7 +1622,7 @@ static void Op58 (void) { ClearIRQ(); AddCycles(ONE_CYCLE); - //CHECK_FOR_IRQ(); + CHECK_FOR_IRQ(); } // SEI @@ -1714,9 +1644,6 @@ static void OpB8 (void) static void OpCAX1 (void) { AddCycles(ONE_CYCLE); -#ifdef CPU_SHUTDOWN - CPU.WaitAddress = 0xffffffff; -#endif Registers.XL--; SetZN(Registers.XL); } @@ -1724,9 +1651,6 @@ static void OpCAX1 (void) static void OpCAX0 (void) { AddCycles(ONE_CYCLE); -#ifdef CPU_SHUTDOWN - CPU.WaitAddress = 0xffffffff; -#endif Registers.X.W--; SetZN(Registers.X.W); } @@ -1734,9 +1658,6 @@ static void OpCAX0 (void) static void OpCASlow (void) { AddCycles(ONE_CYCLE); -#ifdef CPU_SHUTDOWN - CPU.WaitAddress = 0xffffffff; -#endif if (CheckIndex()) { @@ -1753,9 +1674,6 @@ static void OpCASlow (void) static void Op88X1 (void) { AddCycles(ONE_CYCLE); -#ifdef CPU_SHUTDOWN - CPU.WaitAddress = 0xffffffff; -#endif Registers.YL--; SetZN(Registers.YL); } @@ -1763,9 +1681,6 @@ static void Op88X1 (void) static void Op88X0 (void) { AddCycles(ONE_CYCLE); -#ifdef CPU_SHUTDOWN - CPU.WaitAddress = 0xffffffff; -#endif Registers.Y.W--; SetZN(Registers.Y.W); } @@ -1773,9 +1688,6 @@ static void Op88X0 (void) static void Op88Slow (void) { AddCycles(ONE_CYCLE); -#ifdef CPU_SHUTDOWN - CPU.WaitAddress = 0xffffffff; -#endif if (CheckIndex()) { @@ -1794,9 +1706,6 @@ static void Op88Slow (void) static void OpE8X1 (void) { AddCycles(ONE_CYCLE); -#ifdef CPU_SHUTDOWN - CPU.WaitAddress = 0xffffffff; -#endif Registers.XL++; SetZN(Registers.XL); } @@ -1804,9 +1713,6 @@ static void OpE8X1 (void) static void OpE8X0 (void) { AddCycles(ONE_CYCLE); -#ifdef CPU_SHUTDOWN - CPU.WaitAddress = 0xffffffff; -#endif Registers.X.W++; SetZN(Registers.X.W); } @@ -1814,9 +1720,6 @@ static void OpE8X0 (void) static void OpE8Slow (void) { AddCycles(ONE_CYCLE); -#ifdef CPU_SHUTDOWN - CPU.WaitAddress = 0xffffffff; -#endif if (CheckIndex()) { @@ -1833,9 +1736,6 @@ static void OpE8Slow (void) static void OpC8X1 (void) { AddCycles(ONE_CYCLE); -#ifdef CPU_SHUTDOWN - CPU.WaitAddress = 0xffffffff; -#endif Registers.YL++; SetZN(Registers.YL); } @@ -1843,9 +1743,6 @@ static void OpC8X1 (void) static void OpC8X0 (void) { AddCycles(ONE_CYCLE); -#ifdef CPU_SHUTDOWN - CPU.WaitAddress = 0xffffffff; -#endif Registers.Y.W++; SetZN(Registers.Y.W); } @@ -1853,9 +1750,6 @@ static void OpC8X0 (void) static void OpC8Slow (void) { AddCycles(ONE_CYCLE); -#ifdef CPU_SHUTDOWN - CPU.WaitAddress = 0xffffffff; -#endif if (CheckIndex()) { @@ -2371,7 +2265,7 @@ static void Op28E1 (void) SetFlags(MemoryFlag | IndexFlag); S9xUnpackStatus(); S9xFixCycles(); - //CHECK_FOR_IRQ(); + CHECK_FOR_IRQ(); } static void Op28E0 (void) @@ -2388,7 +2282,7 @@ static void Op28E0 (void) } S9xFixCycles(); - //CHECK_FOR_IRQ(); + CHECK_FOR_IRQ(); } static void Op28Slow (void) @@ -2416,7 +2310,7 @@ static void Op28Slow (void) } S9xFixCycles(); - //CHECK_FOR_IRQ(); + CHECK_FOR_IRQ(); } // PLX @@ -3069,17 +2963,11 @@ static void Op5CSlow (void) static void Op4C (void) { S9xSetPCBase(ICPU.ShiftedPB + ((uint16) Absolute(JUMP))); -#if defined(CPU_SHUTDOWN) && defined(SA1_OPCODES) - CPUShutdown(); -#endif } static void Op4CSlow (void) { S9xSetPCBase(ICPU.ShiftedPB + ((uint16) AbsoluteSlow(JUMP))); -#if defined(CPU_SHUTDOWN) && defined(SA1_OPCODES) - CPUShutdown(); -#endif } static void Op6C (void) @@ -3425,7 +3313,7 @@ static void OpC2 (void) } S9xFixCycles(); - //CHECK_FOR_IRQ(); + CHECK_FOR_IRQ(); } static void OpC2Slow (void) @@ -3454,7 +3342,7 @@ static void OpC2Slow (void) } S9xFixCycles(); - //CHECK_FOR_IRQ(); + CHECK_FOR_IRQ(); } static void OpE2 (void) @@ -3562,7 +3450,7 @@ static void Op40Slow (void) } S9xFixCycles(); - //CHECK_FOR_IRQ(); + CHECK_FOR_IRQ(); } /* STP/WAI ***************************************************************** */ @@ -3570,44 +3458,15 @@ static void Op40Slow (void) // WAI static void OpCB (void) { - // Ok, let's just C-ify the ASM versions separately. #ifdef SA1_OPCODES SA1.WaitingForInterrupt = TRUE; Registers.PCw--; -#if 0 - // XXX: FIXME - if (Settings.Shutdown) - { - SA1.Cycles = SA1.NextEvent; - SA1.Executing = FALSE; - //S9xAPUExecute(); // FIXME - SA1.Executing = TRUE; - } + AddCycles(TWO_CYCLES); +#else + CPU.WaitingForInterrupt = TRUE; + Registers.PCw--; + AddCycles(TWO_CYCLES); #endif -#else // SA1_OPCODES -#if 0 - if (CPU.IRQActive) - AddCycles(TWO_CYCLES); - else -#endif - { - CPU.WaitingForInterrupt = TRUE; - Registers.PCw--; - #ifdef CPU_SHUTDOWN - if (Settings.Shutdown) - { - CPU.Cycles = CPU.NextEvent; - ICPU.CPUExecuting = FALSE; - S9xAPUExecute(); - ICPU.CPUExecuting = TRUE; - } - else - AddCycles(TWO_CYCLES); - #else - AddCycles(TWO_CYCLES); -#endif - } -#endif // SA1_OPCODES } // STP diff --git a/cpuops.h b/cpuops.h index acb34060..d9bfcc1e 100644 --- a/cpuops.h +++ b/cpuops.h @@ -181,8 +181,9 @@ void S9xOpcode_NMI (void); void S9xOpcode_IRQ (void); -#define CHECK_FOR_IRQ() \ -if (CPU.IRQActive && !CheckFlag(IRQ) && !Settings.DisableIRQ) \ - S9xOpcode_IRQ() - +#ifndef SA1_OPCODES +#define CHECK_FOR_IRQ() {} // if (CPU.IRQLine) S9xOpcode_IRQ(); } +#else +#define CHECK_FOR_IRQ() {} +#endif #endif diff --git a/debug.cpp b/debug.cpp index 1a5a3894..b2151d62 100644 --- a/debug.cpp +++ b/debug.cpp @@ -872,7 +872,7 @@ static uint8 debug_cpu_op_print (char *Line, uint8 Bank, uint16 Address) break; } - sprintf(Line, "%-44s A:%04X X:%04X Y:%04X D:%04X DB:%02X S:%04X P:%c%c%c%c%c%c%c%c%c HC:%04ld VC:%03ld FC:%02d %02x", + sprintf(Line, "%-44s A:%04X X:%04X Y:%04X D:%04X DB:%02X S:%04X P:%c%c%c%c%c%c%c%c%c HC:%04ld VC:%03ld FC:%02d %03x", Line, Registers.A.W, Registers.X.W, Registers.Y.W, Registers.D.W, Registers.DB, Registers.S.W, CheckEmulation() ? 'E' : 'e', @@ -887,7 +887,7 @@ static uint8 debug_cpu_op_print (char *Line, uint8 Bank, uint16 Address) (long) CPU.Cycles, (long) CPU.V_Counter, IPPU.FrameCount, - CPU.IRQActive); + (CPU.IRQExternal ? 0x100 : 0) | (PPU.HTimerEnabled ? 0x10 : 0) | (PPU.VTimerEnabled ? 0x01 : 0)); return (Size); } diff --git a/dma.cpp b/dma.cpp index bd2c6f22..bf171090 100644 --- a/dma.cpp +++ b/dma.cpp @@ -185,7 +185,7 @@ #include "missing.h" #endif -#define ADD_CYCLES(n) CPU.Cycles += (n) +#define ADD_CYCLES(n) { CPU.PrevCycles = CPU.Cycles; CPU.Cycles += (n); S9xCheckInterrupts(); } extern uint8 *HDMAMemPointers[8]; extern int HDMA_ModeByteCounts[8]; @@ -741,9 +741,6 @@ bool8 S9xDoDMA (uint8 Channel) break; case 0x18: // VMDATAL - #ifndef CORRECT_VRAM_READS - IPPU.FirstVRAMRead = TRUE; - #endif if (!PPU.VMA.FullGraphicCount) { do @@ -766,9 +763,6 @@ bool8 S9xDoDMA (uint8 Channel) break; case 0x19: // VMDATAH - #ifndef CORRECT_VRAM_READS - IPPU.FirstVRAMRead = TRUE; - #endif if (!PPU.VMA.FullGraphicCount) { do @@ -837,9 +831,6 @@ bool8 S9xDoDMA (uint8 Channel) if (d->BAddress == 0x18) { // VMDATAL - #ifndef CORRECT_VRAM_READS - IPPU.FirstVRAMRead = TRUE; - #endif if (!PPU.VMA.FullGraphicCount) { switch (b) @@ -1282,7 +1273,7 @@ bool8 S9xDoDMA (uint8 Channel) } } - if ((CPU.Flags & NMI_FLAG) && (Timings.NMITriggerPos != 0xffff)) + if (CPU.NMILine && (Timings.NMITriggerPos != 0xffff)) { Timings.NMITriggerPos = CPU.Cycles + Timings.NMIDMADelay; if (Timings.NMITriggerPos >= Timings.H_Max) @@ -1373,10 +1364,7 @@ static inline bool8 HDMAReadLineCount (int d) void S9xStartHDMA (void) { - if (Settings.DisableHDMA) - PPU.HDMA = 0; - else - PPU.HDMA = Memory.FillRAM[0x420c]; + PPU.HDMA = Memory.FillRAM[0x420c]; #ifdef DEBUGGER missing.hdma_this_frame = PPU.HDMA; diff --git a/docs/porting.html b/docs/porting.html index 9c62e23c..a2d3d49e 100644 --- a/docs/porting.html +++ b/docs/porting.html @@ -12,7 +12,7 @@

How to Port Snes9x to a New Platform

- Version: 1.52
+ Version: 1.53
(c) Copyright 1998 Gary Henderson

Introduction

@@ -56,22 +56,10 @@

Define this if your compiler uses shift right arithmetic for signed values. For example, GCC and Visual C++ use shift right arithmetic.

-

CPU_SHUTDOWN

-

- This is a speed-up hack. When defined and if Settings.ShutdownMaster is true, Snes9x starts watching for when CPU is in a simply loop waiting for a known event to happen - like the end of the current scanline. If Snes9x spots CPU in such a loop, it simply skips the emulation of its instructions until the event happens. It can be a big win with lots of SNES games, but will break a small number of games. In this case, set Settings.ShutdownMaster to false before you load a ROM image. Note that this hack is forcibly disabled in some games. See Memory.ApplyROMFixes function for the list of such games. -

-

CORRECT_VRAM_READS

-

- You must define this. It allows correct VRAM reads. -

ZLIB / UNZIP_SUPPORT / JMA_SUPPORT

Define these if you want to support GZIP/ZIP/JMA compressed ROM images and GZIP compressed freeze-game files.

-

ZSNES_FX / ZSNES_C4

-

- Define these if your CPU is x86 compatible and you're going to use the ZSNES Super FX and C4 assembler codes. -

USE_OPENGL

Define this and set Settings.OpenGLEnable to true, then you'll get the rendered SNES image as one OpenGL texture. @@ -81,9 +69,7 @@ ZLIB
UNZIP_SUPPORT
JMA_SUPPORT
- CPU_SHUTDOWN
RIGHTSHIFT_IS_SAR
- CORRECT_VRAM_READS

Editing port.h

@@ -379,7 +365,7 @@ The sound generation rate on a SNES is directly proportional to the video output rate. Displays that synchronize with the vertical refresh but have a slightly lower refresh-rate than the emulated system can experience sound drop-outs. It may be beneficial to provide an option for users to configure Settings.SoundInputRate to suit their own systems. Setting Settings.SoundInputRate to a value that matches the actual output rate (i.e. 31977hz for 59.96hz) or lower will allow the users to eliminate crackling. A range of 31000hz to 33000hz should be inclusive enough for all displays. Use of this setting paired with the S9xSyncSound function can eliminate sound discontinuity.

- Updated most recently by: 2009/12/20 zones + Updated most recently by: 2011/1/16 zones
diff --git a/docs/snes9x.conf.default b/docs/snes9x.conf.default index c7992087..4f36d25c 100644 --- a/docs/snes9x.conf.default +++ b/docs/snes9x.conf.default @@ -67,8 +67,6 @@ Justifier2Crosshair = 4 MagicPink/Black EnableGameSpecificHacks = TRUE AllowInvalidVRAMAccess = FALSE SpeedHacks = FALSE -DisableIRQ = FALSE -DisableHDMA = FALSE HDMATiming = 100 [Netplay] @@ -231,7 +229,6 @@ K00:4 = ToggleBG3 K00:5 = ToggleSprites K00:9 = ToggleTransparency K00:BackSpace = ClipWindows -K00:0 = ToggleHDMA K00:A+Escape = Debugger M00:Pointer = Pointer Mouse1+Superscope+Justifier1 M00:B0 = {Mouse1 L,Superscope Fire,Justifier1 Trigger} diff --git a/fxemu.cpp b/fxemu.cpp index b3237ae6..ce1af63e 100644 --- a/fxemu.cpp +++ b/fxemu.cpp @@ -202,6 +202,7 @@ void S9xResetSuperFX (void) SuperFX.speedPerLine = (uint32) (0.417 * 10.5e6 * ((1.0 / (float) Memory.ROMFramesPerSecond) / ((float) (Timings.V_Max)))); SuperFX.oneLineDone = FALSE; SuperFX.vFlags = 0; + CPU.IRQExternal = FALSE; FxReset(&SuperFX); } @@ -299,13 +300,10 @@ uint8 S9xGetSuperFX (uint16 address) uint8 byte; byte = Memory.FillRAM[address]; -#ifdef CPU_SHUTDOWN - if (address == 0x3030) - CPU.WaitAddress = CPU.PBPCAtOpcodeStart; -#endif + if (address == 0x3031) { - S9xClearIRQ(GSU_IRQ_SOURCE); + CPU.IRQExternal = FALSE; Memory.FillRAM[0x3031] = byte & 0x7f; } @@ -320,7 +318,7 @@ void S9xSuperFXExec (void) uint16 GSUStatus = Memory.FillRAM[0x3000 + GSU_SFR] | (Memory.FillRAM[0x3000 + GSU_SFR + 1] << 8); if ((GSUStatus & (FLG_G | FLG_IRQ)) == FLG_IRQ) - S9xSetIRQ(GSU_IRQ_SOURCE); + CPU.IRQExternal = TRUE; } } diff --git a/fxemu.h b/fxemu.h index 45df36e8..b2ce64e7 100644 --- a/fxemu.h +++ b/fxemu.h @@ -178,7 +178,8 @@ #ifndef _FXEMU_H_ #define _FXEMU_H_ -#ifndef ZSNES_FX +#define FX_BREAKPOINT (-1) +#define FX_ERROR_ILLEGAL_ADDRESS (-2) // The FxInfo_s structure, the link between the FxEmulator and the Snes Emulator struct FxInfo_s @@ -196,41 +197,12 @@ struct FxInfo_s extern struct FxInfo_s SuperFX; void S9xInitSuperFX (void); +void S9xResetSuperFX (void); +void S9xSuperFXExec (void); void S9xSetSuperFX (uint8, uint16); uint8 S9xGetSuperFX (uint16); void fx_flushCache (void); void fx_computeScreenPointers (void); uint32 fx_run (uint32); -#define FX_BREAKPOINT (-1) -#define FX_ERROR_ILLEGAL_ADDRESS (-2) - -#else - -#define S9xSetSuperFX S9xSuperFXWriteReg -#define S9xGetSuperFX S9xSuperFXReadReg - -START_EXTERN_C -extern uint8 *SFXPlotTable; - -void S9xSuperFXWriteReg (uint8, uint32); -uint8 S9xSuperFXReadReg (uint32); -void S9xSuperFXPreSaveState (void); -void S9xSuperFXPostSaveState (void); -void S9xSuperFXPostLoadState (void); -END_EXTERN_C - -#endif - -#ifdef ZSNES_FX -START_EXTERN_C -#endif - -void S9xResetSuperFX (void); -void S9xSuperFXExec (void); - -#ifdef ZSNES_FX -END_EXTERN_C -#endif - #endif diff --git a/fxinst.h b/fxinst.h index 8f44ae99..dd3736ec 100644 --- a/fxinst.h +++ b/fxinst.h @@ -178,8 +178,6 @@ #ifndef _FXINST_H_ #define _FXINST_H_ -#ifndef ZSNES_FX - /* * FxChip(GSU) register space specification * (Register address space 3000-32ff) @@ -542,5 +540,3 @@ extern void (*fx_OpcodeTable[]) (void); #define BRANCH_DELAY_RELATIVE #endif - -#endif diff --git a/getset.h b/getset.h index bf5557b4..b7dda2b6 100644 --- a/getset.h +++ b/getset.h @@ -187,12 +187,12 @@ #include "seta.h" #include "bsx.h" -#if (S9X_ACCURACY_LEVEL >= 2) - #define addCyclesInMemoryAccess \ if (!CPU.InDMAorHDMA) \ { \ + CPU.PrevCycles = CPU.Cycles; \ CPU.Cycles += speed; \ + S9xCheckInterrupts(); \ while (CPU.Cycles >= CPU.NextEvent) \ S9xDoHEventProcessing(); \ } @@ -200,23 +200,13 @@ #define addCyclesInMemoryAccess_x2 \ if (!CPU.InDMAorHDMA) \ { \ + CPU.PrevCycles = CPU.Cycles; \ CPU.Cycles += speed << 1; \ + S9xCheckInterrupts(); \ while (CPU.Cycles >= CPU.NextEvent) \ S9xDoHEventProcessing(); \ } -#else - -#define addCyclesInMemoryAccess \ - if (!CPU.InDMAorHDMA) \ - CPU.Cycles += speed; - -#define addCyclesInMemoryAccess_x2 \ - if (!CPU.InDMAorHDMA) \ - CPU.Cycles += speed << 1; - -#endif - extern uint8 OpenBus; static inline int32 memory_speed (uint32 address) @@ -247,10 +237,6 @@ inline uint8 S9xGetByte (uint32 Address) if (GetAddress >= (uint8 *) CMemory::MAP_LAST) { - #ifdef CPU_SHUTDOWN - if (Memory.BlockIsRAM[block]) - CPU.WaitAddress = CPU.PBPCAtOpcodeStart; - #endif byte = *(GetAddress + (Address & 0xffff)); addCyclesInMemoryAccess; return (byte); @@ -379,10 +365,6 @@ inline uint16 S9xGetWord (uint32 Address, enum s9xwrap_t w = WRAP_NONE) if (GetAddress >= (uint8 *) CMemory::MAP_LAST) { - #ifdef CPU_SHUTDOWN - if (Memory.BlockIsRAM[block]) - CPU.WaitAddress = CPU.PBPCAtOpcodeStart; - #endif word = READ_WORD(GetAddress + (Address & 0xffff)); addCyclesInMemoryAccess_x2; return (word); @@ -510,33 +492,14 @@ inline uint16 S9xGetWord (uint32 Address, enum s9xwrap_t w = WRAP_NONE) inline void S9xSetByte (uint8 Byte, uint32 Address) { -#ifdef CPU_SHUTDOWN - CPU.WaitAddress = 0xffffffff; -#endif - int block = (Address & 0xffffff) >> MEMMAP_SHIFT; uint8 *SetAddress = Memory.WriteMap[block]; int32 speed = memory_speed(Address); if (SetAddress >= (uint8 *) CMemory::MAP_LAST) { - #ifdef CPU_SHUTDOWN - SetAddress += (Address & 0xffff); - *SetAddress = Byte; - addCyclesInMemoryAccess; - - if (Settings.SA1) - { - if (SetAddress == SA1.WaitByteAddress1 || SetAddress == SA1.WaitByteAddress2) - { - SA1.Executing = SA1.S9xOpcodes != NULL; - SA1.WaitCounter = 0; - } - } - #else *(SetAddress + (Address & 0xffff)) = Byte; addCyclesInMemoryAccess; - #endif return; } @@ -593,7 +556,6 @@ inline void S9xSetByte (uint8 Byte, uint32 Address) case CMemory::MAP_SA1RAM: *(Memory.SRAM + (Address & 0xffff)) = Byte; - SA1.Executing = !SA1.Waiting; addCyclesInMemoryAccess; return; @@ -670,33 +632,14 @@ inline void S9xSetWord (uint16 Word, uint32 Address, enum s9xwrap_t w = WRAP_NON return; } -#ifdef CPU_SHUTDOWN - CPU.WaitAddress = 0xffffffff; -#endif - int block = (Address & 0xffffff) >> MEMMAP_SHIFT; uint8 *SetAddress = Memory.WriteMap[block]; int32 speed = memory_speed(Address); if (SetAddress >= (uint8 *) CMemory::MAP_LAST) { - #ifdef CPU_SHUTDOWN - SetAddress += (Address & 0xffff); - WRITE_WORD(SetAddress, Word); - addCyclesInMemoryAccess_x2; - - if (Settings.SA1) - { - if (SetAddress == SA1.WaitByteAddress1 || SetAddress == SA1.WaitByteAddress2) - { - SA1.Executing = SA1.S9xOpcodes != NULL; - SA1.WaitCounter = 0; - } - } - #else WRITE_WORD(SetAddress + (Address & 0xffff), Word); addCyclesInMemoryAccess_x2; - #endif return; } @@ -806,7 +749,6 @@ inline void S9xSetWord (uint16 Word, uint32 Address, enum s9xwrap_t w = WRAP_NON case CMemory::MAP_SA1RAM: WRITE_WORD(Memory.SRAM + (Address & 0xffff), Word); - SA1.Executing = !SA1.Waiting; addCyclesInMemoryAccess_x2; return; diff --git a/globals.cpp b/globals.cpp index 2fc439a3..60d7959f 100644 --- a/globals.cpp +++ b/globals.cpp @@ -209,6 +209,8 @@ struct SDSP3 DSP3; struct SDSP4 DSP4; struct SSA1 SA1; struct SSA1Registers SA1Registers; +struct FxRegs_s GSU; +struct FxInfo_s SuperFX; struct SST010 ST010; struct SST011 ST011; struct SST018 ST018; @@ -228,10 +230,6 @@ struct Missing missing; #endif struct SCheatData Cheat; struct Watch watches[16]; -#ifndef ZSNES_FX -struct FxRegs_s GSU; -struct FxInfo_s SuperFX; -#endif CMemory Memory; char String[513]; @@ -244,15 +242,6 @@ SnesModel M1SNES = { 1, 3, 2 }; SnesModel M2SNES = { 2, 4, 3 }; SnesModel *Model = &M1SNES; -#if defined(ZSNES_FX) || defined(ZSNES_C4) -uint8 *ROM = NULL; -uint8 *SRAM = NULL; -uint8 *RegRAM = NULL; -#endif -#ifdef ZSNES_FX -uint8 *SFXPlotTable = NULL; -#endif - #ifdef GFX_MULTI_FORMAT uint32 RED_LOW_BIT_MASK = RED_LOW_BIT_MASK_RGB565; uint32 GREEN_LOW_BIT_MASK = GREEN_LOW_BIT_MASK_RGB565; diff --git a/i386/c4.asm b/i386/c4.asm deleted file mode 100644 index cf1b5de5..00000000 --- a/i386/c4.asm +++ /dev/null @@ -1,2390 +0,0 @@ -%include "macros.mac" -;******************************************************* -; Register & Memory Access Banks (0 - 3F) / (80 - BF) -;******************************************************* -; enter : BL = bank number, CX = address location -; leave : AL = value read - -EXTSYM C4WFXVal,C4WFYVal,C4WFX2Val,C4WFY2Val,C4CalcWireFrame,C4WFDist,C4WFScale,C4TransfWireFrame -EXTSYM C4TransfWireFrame2,C4WFZVal,C41FXVal,C41FYVal,C41FAngleRes,C41FDist,C4Op1F,C4Op15,C41FDistVal -EXTSYM C4Op0D,C4LoaDMem - -%ifdef ZSNES_FX -EXTSYM romdata -%else -NEWSYM romdata, dd 0 ; rom data (4MB = 4194304) -%endif - -EXTSYM pressed,vidbuffer,oamram -EXTSYM C4Ram,C4RamR,C4RamW - -C4ProcessVectors: - mov esi,[C4Ram] - mov edi,esi - add edi,1F8Ch - xor edx,edx - mov dx,[esi+1F8Ah] - cmp dx,128 - ja .ret - cmp dx,0 - jne .nozero -.ret - ret -.nozero - cmp dx,10h - jb .less - mov dx,10h -.less - mov esi,[C4Ram] - add esi,800h -.loop - mov ecx,100h - xor ebx,ebx - xor eax,eax - movsx bx,byte[edi] -.spotloop - add ah,80h - mov byte[esi],ah - sub ah,80h - add ax,bx - inc esi - loop .spotloop - add edi,3 - dec dx - jnz .loop - ret - -SECTION .data -C4ObjDisp dd 0 -C4ColRot db 1 -NEWSYM C4ObjSelec, db 0 -NEWSYM C4SObjSelec, db 0 -NEWSYM C4Pause, db 0 -C4DataCopy times 64 db 0 -;NEWSYM C4Data times 64*4096 db 0 ; 15 sprites, 4 bytes each - ; x,y,oamptr,stat (b0=oamb8,b1=16x16) - ; 4 byte header (#sobj,?,?,?) -CObjNum dw 0 -C4Temp dd 0 - -SECTION .text - -C4Edit: - ; C4 editing routines - ; Register keyboard presses - ; [ = prev object, ] = next object - ; p = pause/unpause - cmp byte[pressed+1Ah],0 - je .notpressed - mov byte[pressed+1Ah],0 - inc byte[C4ObjSelec] - inc byte[C4Temp] -.notpressed - cmp byte[pressed+1Bh],0 - je .notpressed2 - mov byte[pressed+1Bh],0 - dec byte[C4ObjSelec] - dec byte[C4Temp] -.notpressed2 - cmp byte[pressed+19h],0 - je .notpressed3 - mov byte[pressed+19h],0 - xor byte[C4Pause],1 -.notpressed3 - - ; Setup variables - mov esi,[C4Ram] - add byte[C4ColRot],16 - mov al,[esi+620h] - cmp byte[C4ObjSelec],0FFh - jne .notneg - dec al - mov byte[C4ObjSelec],al - jmp .notof -.notneg - cmp byte[C4ObjSelec],al - jb .notof - xor al,al - mov [C4ObjSelec],al -.notof - - ; Draw the dots on-screen - xor eax,eax - mov al,[C4ObjSelec] - shl eax,4 - add eax,[C4Ram] - add eax,220h - mov byte[.flipped],0 - test byte[eax+6],40h - jz .notflip - mov byte[.flipped],1 -.notflip - -; 00/01 - x position relative to BG scroll value -; 02/03 - y position relative to BG scroll value -; 04 - palette/priority settings -; 05 - OAM pointer value -; 06 - flip settings : b6 = flipx, b7 = flipy -; 07 - looks like some sprite displacement values -; 08/09 - ??? -; 0A-0F - unused - xor ebx,ebx - mov bx,[eax+8] - mov [CObjNum],bx - cmp bx,4096 - jae near .skipall - shl ebx,6 - add ebx,[C4Data] - - ; t,f,g,h = move current object - ; q = copy current object structure, w = paste current object structure - cmp byte[pressed+14h],0 - je .notmove - mov byte[pressed+14h],0 - pushad - mov ecx,15 -.next - add ebx,4 - dec byte[ebx+1] - loop .next - popad -.notmove - cmp byte[pressed+21h],0 - je .notmove2 - mov byte[pressed+21h],0 - pushad - mov ecx,15 -.next2 - add ebx,4 - cmp byte[.flipped],0 - je .noflipx - add byte[ebx],2 -.noflipx - dec byte[ebx] - loop .next2 - popad -.notmove2 - cmp byte[pressed+22h],0 - je .notmove3 - mov byte[pressed+22h],0 - pushad - mov ecx,15 -.next3 - add ebx,4 - inc byte[ebx+1] - loop .next3 - popad -.notmove3 - cmp byte[pressed+23h],0 - je .notmove4 - mov byte[pressed+23h],0 - pushad - mov ecx,15 -.next4 - add ebx,4 - cmp byte[.flipped],0 - je .noflipx2 - sub byte[ebx],2 -.noflipx2 - inc byte[ebx] - loop .next4 - popad -.notmove4 - cmp byte[pressed+10h],0 - je .notcopy - mov byte[pressed+10h],0 - pushad - mov edx,C4DataCopy - mov ecx,64 -.copylp - mov al,[ebx] - mov [edx],al - inc ebx - inc edx - loop .copylp - popad -.notcopy - cmp byte[pressed+11h],0 - je .notpaste - mov byte[pressed+11h],0 - pushad - mov edx,C4DataCopy - mov ecx,64 -.pastelp - mov al,[edx] - mov [ebx],al - inc ebx - inc edx - loop .pastelp - popad -.notpaste - - ; - = remove sub-object, + = add sub-object - ; ; = previous sub-object, ' = next sub-object - cmp byte[pressed+0Ch],0 - je .notpressed4 - mov byte[pressed+0Ch],0 - cmp byte[ebx],0 - je .notpressed4 - dec byte[ebx] -.notpressed4 - cmp byte[pressed+0Dh],0 - je .notpressed5 - mov byte[pressed+0Dh],0 - cmp byte[ebx],15 - je .notpressed5 - inc byte[ebx] -.notpressed5 - cmp byte[pressed+27h],0 - je .notpressed6 - mov byte[pressed+27h],0 - dec byte[C4SObjSelec] -.notpressed6 - cmp byte[pressed+28h],0 - je .notpressed7 - mov byte[pressed+28h],0 - inc byte[C4SObjSelec] -.notpressed7 - - ; get current sub-object displacement (0 if no sub-objects) - xor ecx,ecx - cmp byte[ebx],0 - je near .nosubobjs - - mov cl,[ebx] - cmp byte[C4ObjSelec],0FFh - jne .sobjokay2 - dec cl - mov byte[C4SObjSelec],cl - jmp .sobjokay -.sobjokay2 - cmp byte[C4SObjSelec],cl - jb .sobjokay - mov byte[C4SObjSelec],0 -.sobjokay - - xor ecx,ecx - mov cl,byte[C4SObjSelec] - shl ecx,2 - add ebx,ecx - add ebx,4 - - ; i,j,k,l = move current sub-object (17,24,25,26) - ; u = toggle between 8x8 and 16x16 tiles - ; o = toggle between high/low oam value - ; . = decrease oam value, / = increase oam value of sub-object - cmp byte[pressed+17h],0 - je .notpressed8 - mov byte[pressed+17h],0 - dec byte[ebx+1] -.notpressed8 - cmp byte[pressed+24h],0 - je .notpressed9 - mov byte[pressed+24h],0 - dec byte[ebx] - cmp byte[.flipped],0 - je .notpressed9 - add byte[ebx],2 -.notpressed9 - cmp byte[pressed+26h],0 - je .notpressed11 - mov byte[pressed+26h],0 - inc byte[ebx] - cmp byte[.flipped],0 - je .notpressed11 - sub byte[ebx],2 -.notpressed11 - cmp byte[pressed+25h],0 - je .notpressed10 - mov byte[pressed+25h],0 - inc byte[ebx+1] -.notpressed10 - cmp byte[pressed+16h],0 - je .notpressed12 - mov byte[pressed+16h],0 - xor byte[ebx+3],2 -.notpressed12 - cmp byte[pressed+18h],0 - je .notpressed13 - mov byte[pressed+18h],0 - xor byte[ebx+3],1 -.notpressed13 - cmp byte[pressed+34h],0 - je .notpressed14 - mov byte[pressed+34h],0 - dec byte[ebx+2] -.notpressed14 - cmp byte[pressed+35h],0 - je .notpressed15 - mov byte[pressed+35h],0 - inc byte[ebx+2] -.notpressed15 - - mov cl,[ebx] - mov ch,[ebx+1] -.nosubobjs - mov edx,ecx - xor ebx,ebx - xor ecx,ecx - mov bl,[eax] - sub bl,[esi+621h] - add bl,dl - mov cl,[eax+2] - sub cl,[esi+623h] - add cl,dh - mov esi,[vidbuffer] - add esi,16*2+256*2+32*2 - add esi,ebx - add esi,ebx - mov ebx,ecx - shl ebx,9 - shl ecx,6 - add esi,ebx - add esi,ecx - mov al,[C4ColRot] - mov ah,al - xor ah,0FFh - mov [esi],ax - mov [esi+16],ax - mov [esi+288*8*2],ax - mov [esi+16+288*8*2],ax -.skipall - ret - -SECTION .data -.flipped db 0 -SECTION .text - -C4AddSprite: - cmp dword[C4count],0 - je near .nosprite - mov [edi],ax - mov [edi+2],bx - mov ebx,[C4usprptr] - and [ebx],dl - mov al,dl - xor al,0FFh - and dh,al - or [ebx],dh - add edi,4 - rol dl,2 - rol dh,2 - dec dword[C4count] - cmp dl,0FCh - jne .nosprite - inc dword[C4usprptr] -.nosprite - ret - -C4ConvOAM: - inc byte[C4Timer] - and byte[C4Timer],15 - inc byte[C4Timer2] - and byte[C4Timer2],7 - mov esi,[C4Ram] - xor ecx,ecx - mov edi,esi - mov cl,[esi+620h] - mov bx,[esi+621h] - mov [.addx],bx - mov bx,[esi+623h] - mov [.addy],bx - mov [C4usprptr],esi - add dword[C4usprptr],200h - mov eax,[C4ObjDisp] - add edi,eax - shr eax,4 - add dword[C4usprptr],eax - add esi,220h - ; Convert from esi to edi - mov dl,0FCh - push ecx - mov cl,byte[C4sprites] - and cl,3 - add cl,cl - rol dl,cl - pop ecx - cmp cl,0 - je near .none - mov dword[C4count],128 - mov eax,[C4sprites] - sub dword[C4count],eax - -.loop - push ecx - push esi -; 00/01 - x position relative to BG scroll value -; 02/03 - y position relative to BG scroll value -; 04 - palette/priority settings -; 05 - OAM pointer value -; 06 - flip settings : b6 = flipx, b7 = flipy -; 07 - ??? -; 08/09 - Pointer to Sprite Structure -; 0A-0F - unused -;bit 1-3 = palette number bit 4,5 = playfield priority -;bit 6 = horizontal flip bit 7 = horizonal flip - mov ax,[esi] - sub ax,[.addx] - mov [C4SprX],ax - mov ax,[esi+2] - sub ax,[.addy] - mov [C4SprY],ax - mov al,[esi+5] - mov [C4SprOAM],al - mov al,[esi+4] - mov ah,al - and ah,0Eh - cmp ah,0 - jmp .notstage2 - jne .notstage1 - cmp byte[C4Timer],0 - je .flash - jmp .noflash -.notstage1 - jmp .notstage2 - cmp ah,4 - jne .notstage2 - cmp byte[C4Timer2],0 - je .flash -.noflash - and al,0F1h - or al,2 - jmp .notstage2 -.flash - and al,0F1h -.notstage2 - mov [C4SprAttr],al - mov al,[esi+6] - or [C4SprAttr],al -; mov [C4SprFlip],al - - xor ecx,ecx - mov cl,[esi+9] - shl ecx,16 - mov cx,[esi+7] - add cx,cx - shr ecx,1 - add ecx,[romdata] - - mov al,[ecx] - or al,al - jz near .singlespr - mov [C4SprCnt],al - inc ecx -.nextspr - xor ebx,ebx - movsx bx,byte[ecx+1] - test byte[C4SprAttr],40h - jz .notflipx - neg bx - sub bx,8 -.notflipx - add bx,[C4SprX] - xor dh,dh - test byte[ecx],20h - jz .no16x16 - or dh,10101010b - test byte[C4SprAttr],40h - jz .no16x16 - sub bx,8 -.no16x16 - cmp bx,-16 - jl near .nosprite - cmp bx,272 - jg near .nosprite - mov al,bl - test bx,100h - jz .not512b - or dh,01010101b -.not512b - xor ebx,ebx - movsx bx,byte[ecx+2] - test byte[C4SprAttr],80h - jz .notflipy - neg bx - sub bx,8 -.notflipy - add bx,[C4SprY] - test byte[ecx],20h - jz .no16x16b - test byte[C4SprAttr],80h - jz .no16x16b - sub bx,8 -.no16x16b - cmp bx,-16 - jl near .nosprite - cmp bx,224 - jg near .nosprite - mov ah,bl - mov bh,[C4SprAttr] - mov bl,[ecx] - and bl,0C0h - xor bh,bl - mov bl,[C4SprOAM] - add bl,[ecx+3] - call C4AddSprite -.nosprite - add ecx,4 - dec byte[C4SprCnt] - jnz near .nextspr - jmp .donemultispr -.singlespr - mov dh,10101010b - test byte[C4SprX+1],1 - jz .not512 - or dh,01010101b -.not512 - mov al,[C4SprX] - mov ah,[C4SprY] - mov bl,[C4SprOAM] - mov bh,[C4SprAttr] - call C4AddSprite -.donemultispr - pop esi - pop ecx - -;NEWSYM C4Data times 64*4096 db 0 ; 15 sprites, 4 bytes each - ; x,y,oamptr,stat (b0=oamb8,b1=16x16) - ; 4 byte header (#sobj,?,?,?) - - add esi,16 - dec cl - jnz near .loop -.none - mov esi,oamram - mov edi,[C4Ram] - mov ecx,544 -.next - mov al,[edi] - mov [esi],al - inc edi - inc esi - loop .next - ret - -SECTION .data -.addx dw 0 -.addy dw 0 - -C4count dd 0 -C4usprptr dd 0 -C4SprX dw 0 -C4SprY dw 0 -C4SprCnt db 0 -C4SprAttr db 0 -C4SprOAM db 0 -C4SprFlip db 0 -C4Timer db 0 -C4Timer2 db 0 - -SECTION .text - -NEWSYM C4VBlank - ret -NEWSYM C4ProcessSprites - push ecx - push esi - push edi - push ebx - push edx -; call C4ProcessVectors - -; call C4Edit - - mov esi,[C4Ram] - mov dword[C4count],8 - mov cl,[esi+626h] - mov byte[C4sprites],cl - mov ecx,[C4sprites] - shl ecx,2 - mov dword[C4ObjDisp],ecx - mov ecx,128 -; cmp byte[esi+65],50h -; jne .noincdisp - mov dword[C4count],32 - sub ecx,[C4sprites] -.noincdisp - add esi,[C4ObjDisp] - ; Clear OAM to-be ram -.next - mov byte[esi+1],0E0h - add esi,4 - dec ecx - jnz .next - - call C4ConvOAM - - pop edx - pop ebx - pop edi - pop esi - pop ecx - ret - -SECTION .data -NEWSYM SprValAdd, db 0 -C4Data dd 0 -C4sprites dd 0 -SECTION .text - -NEWSYM InitC4 - pushad - mov esi,[romdata] - add esi,4096*1024 - mov [C4Data],esi - add dword[C4Data],128*1024 - mov [C4RamR],esi - mov [C4RamW],esi - mov [C4Ram],esi - add dword[C4RamW],8192*4 - add dword[C4Ram],8192*8 - mov ecx,8192 -.c4loop - mov dword[esi],C4ReadReg - mov dword[esi+8192*4],C4WriteReg - mov dword[esi+8192*8],0 - add esi,4 - dec ecx - jnz .c4loop - mov esi,[C4RamW] - mov dword[esi+1F4Fh*4],C4RegFunction - mov esi,[C4Data] - mov ecx,16*4096 -.c4loopb - mov dword[esi],0 - add esi,4 - loop .c4loopb - popad - ret - -C4ClearSpr: - mov esi,ebx - mov edi,eax -; xor ecx,ecx -; mov cx,[eax+1F44h] -; sub cx,6000h -; add eax,ecx - shl ch,3 -.scloop2 - mov cl,byte[C4SprPos] - shl cl,2 -.scloop - mov byte[edi],0 - mov byte[edi+2000h],0 - inc edi - dec cl - jnz .scloop - dec ch - jnz .scloop2 - ret - -C4SprBitPlane: - mov edi,eax - shl ebx,2 -.scloop3 - mov ch,[C4SprPos] - push esi -.scloop4 - push esi - mov cl,8 -.loop - mov dh,8 - mov dl,80h - mov eax,[esi] -.nextd - test al,1 - jz .not0 - or byte[edi],dl -.not0 - test al,2 - jz .not1 - or byte[edi+1],dl -.not1 - test al,4 - jz .not2 - or byte[edi+16],dl -.not2 - test al,8 - jz .not3 - or byte[edi+17],dl -.not3 - shr eax,4 - shr dl,1 - dec dh - jnz .nextd - add esi,ebx - add edi,2 - dec cl - jnz .loop - add edi,16 - pop esi - add esi,4 - dec ch - jnz .scloop4 - pop esi - shl ebx,3 - add esi,ebx - add edi,dword[C4SprPtrInc] - shr ebx,3 - dec byte[C4SprPos+1] - jnz .scloop3 -.end - ret - -SECTION .data -C4XXScale dw 0 -C4XYScale dw 0 -C4YXScale dw 0 -C4YYScale dw 0 -C4CXPos dw 0 -C4CYPos dw 0 -C4CXMPos dd 0 -C4CYMPos dd 0 -C4PCXMPos dd 0 -C4PCYMPos dd 0 -SECTION .text - -DoScaleRotate: - pushad - mov esi,eax - ; Calculate X scaler - mov ax,[esi+1F80h] - and eax,01FFh - mov ax,[CosTable+eax*2] - mov bx,[esi+1F8Fh] - test bx,8000h - jz .notover - mov bx,7FFFh -.notover - imul bx - add ax,ax - adc dx,dx - mov [C4XXScale],dx - mov ax,[esi+1F80h] - and eax,01FFh - mov ax,[SinTable+eax*2] - imul bx - add ax,ax - adc dx,dx - mov [C4XYScale],dx - ; Calculate Y scaler - mov ax,[esi+1F80h] - and eax,01FFh - mov ax,[CosTable+eax*2] - mov bx,[esi+1F92h] - test bx,8000h - jz .notoverb - mov bx,7FFFh -.notoverb - imul bx - add ax,ax - add dx,dx - mov [C4YYScale],dx - mov ax,[esi+1F80h] - and eax,01FFh - mov ax,[SinTable+eax*2] - imul bx - add ax,ax - adc dx,dx - neg dx - mov [C4YXScale],dx - cmp word[esi+1F80h],0 - jne .effect - cmp word[esi+1F92h],1000h - jne .effect - mov word[C4YYScale],1000h - mov word[C4YXScale],0 -.effect - ; Calculate Pixel Resolution - mov cl,byte[C4SprPos] - shl cl,3 - mov byte[C4SprPos+2],cl - mov cl,byte[C4SprPos+1] - shl cl,3 - mov byte[C4SprPos+3],cl - ; Calculate Positions - ; (1-scale)*(pos/2) - xor eax,eax - mov al,[C4SprPos+2] - shl eax,11 - mov [C4PCXMPos],eax - xor eax,eax - mov al,[C4SprPos+3] - shl eax,11 - mov [C4PCYMPos],eax - - mov bx,[C4XXScale] - xor eax,eax - mov al,[C4SprPos+2] - shr ax,1 - imul bx - shl edx,16 - mov dx,ax - sub [C4PCXMPos],edx - mov bx,[C4YXScale] - xor eax,eax - mov al,[C4SprPos+3] - shr ax,1 - imul bx - shl edx,16 - mov dx,ax - sub [C4PCXMPos],edx - - mov bx,[C4XYScale] - xor eax,eax - mov al,[C4SprPos+2] - shr ax,1 - imul bx - shl edx,16 - mov dx,ax - sub [C4PCYMPos],edx - mov bx,[C4YYScale] - xor eax,eax - mov al,[C4SprPos+3] - shr ax,1 - imul bx - shl edx,16 - mov dx,ax - sub [C4PCYMPos],edx - - ; Start loop - mov word[C4CYPos],0 - xor edi,edi -.loop - mov ecx,[C4PCXMPos] - mov [C4CXMPos],ecx - mov ecx,[C4PCYMPos] - mov [C4CYMPos],ecx - mov al,[C4SprPos+2] - mov byte[C4CXPos],al -.loop2 - xor eax,eax - mov al,[C4SprPos+2] - mov ebx,[C4CXMPos] - sar ebx,12 - cmp ebx,eax - jae near .blank - xor eax,eax - mov al,[C4SprPos+3] - mov ebx,[C4CYMPos] - sar ebx,12 - cmp ebx,eax - jae near .blank - ; Get pixel value - mov ebx,[C4CYMPos] - xor eax,eax - shr ebx,12 - mov al,[C4SprPos+2] - mul ebx - mov ebx,[C4CXMPos] - shr ebx,12 - add eax,ebx - mov ebx,[C4SprPtr] - test al,1 - jnz .upperb - shr eax,1 - add ebx,eax - mov al,[ebx] - jmp .lowerb -.upperb - shr eax,1 - add ebx,eax - mov al,[ebx] - shr al,4 -.lowerb - mov ebx,edi - shr ebx,1 - add ebx,esi - test edi,1 - jnz .upperb2 - and al,0Fh - and byte[ebx+2000h],0F0h - or byte[ebx+2000h],al - jmp .done -.upperb2 - shl al,4 - and byte[ebx+2000h],0Fh - or byte[ebx+2000h],al - jmp .done -.blank - mov eax,edi - shr eax,1 - add eax,esi - test edi,1 - jnz .upper - and byte[eax+2000h],0F0h - jmp .done -.upper - and byte[eax+2000h],0Fh -.done - movsx eax,word[C4XXScale] - add [C4CXMPos],eax - movsx eax,word[C4XYScale] - add [C4CYMPos],eax - inc edi - dec byte[C4CXPos] - jne near .loop2 - movsx eax,word[C4YXScale] - add [C4PCXMPos],eax - movsx eax,word[C4YYScale] - add [C4PCYMPos],eax - inc word[C4CYPos] - mov al,[C4SprPos+3] - cmp byte[C4CYPos],al - jne near .loop -.noimage - popad - ret - -DoScaleRotate2: - pushad - xor ebx,ebx - mov bx,[eax+1F8Fh] - cmp bx,1000h - ja .scaled - mov bx,1000h -.scaled - mov [C4SprScale],ebx - xor ebx,ebx - mov bx,[eax+1F92h] - cmp bx,1000h - ja .scaledb - mov bx,1000h -.scaledb - mov [C4SprScaleY],ebx - mov cl,[C4SprPos] - shl cl,3 - mov ch,cl - xor ebx,ebx -.leftovercheck - dec ch - add ebx,[C4SprScale] -.leftovercheckb - cmp ebx,1000h - jb .leftovercheck - sub ebx,1000h - dec cl - jz .donecheck - jmp .leftovercheckb -.donecheck - shr ch,1 - mov cl,ch - and ecx,0FFh - mov esi,ecx - - mov cl,[C4SprPos+1] - shl cl,3 - mov ch,cl - xor ebx,ebx -.leftovercheckc - dec ch - add ebx,[C4SprScaleY] -.leftovercheckd - cmp ebx,1000h - jb .leftovercheckc - sub ebx,1000h - dec cl - jz .donecheckc - jmp .leftovercheckd -.donecheckc - shr ch,1 - mov cl,ch - and ecx,0FFh - push eax - xor eax,eax - mov al,[C4SprPos] - shl al,3 - mul ecx - add esi,eax - pop eax - - mov dword[C4SprScalerY],0 - xor edi,edi - mov cl,[C4SprPos+1] - shl cl,3 - mov [C4SprPos+3],cl -.next - push esi - push edi - xor ecx,ecx - mov cl,[C4SprPos] - shl cl,3 - mov ch,cl - mov dword[C4SprScaler],0 - xor edx,edx -.loop - mov edx,edi - shr edx,1 - add edx,[C4SprPtr] - mov bl,[edx] - test esi,1 - jz .notupper - shr bl,4 -.notupper - and bl,0Fh - mov edx,esi - shr edx,1 - test esi,1 - jz .notupperb - shl bl,4 - or byte[eax+edx+2000h],bl - jmp .notlowerb -.notupperb - or byte[eax+edx+2000h],bl -.notlowerb - inc esi - mov ebx,[C4SprScale] - add dword[C4SprScaler],ebx - dec ch -.nextcheck - cmp dword[C4SprScaler],1000h - jb near .loop - sub dword[C4SprScaler],1000h - inc edi - dec cl - jz .done - jmp .nextcheck -.done - pop edi - pop esi - xor edx,edx - mov dl,[C4SprPos] - shl dl,3 - add esi,edx - - mov ebx,[C4SprScaleY] - add dword[C4SprScalerY],ebx -.nextcheckb - cmp dword[C4SprScalerY],1000h - jb near .next - sub dword[C4SprScalerY],1000h - add edi,edx - dec byte[C4SprPos+3] - jz .doneb - jmp .nextcheckb -.doneb - - popad - ret - -C4SprScaleR: - push ecx - push ebx - push edx - push esi - push edi - mov dword[C4SprPtrInc],0 - xor ebx,ebx - mov bl,[eax+1F42h] - shl ebx,16 - mov bx,[eax+1F40h] - add bx,bx - shr ebx,1 - add ebx,[romdata] - mov ch,[eax+1F8Ch] - shr ch,3 - mov cl,[eax+1F89h] - shr cl,3 - mov [C4SprPos],cx - mov [C4SprPtr],ebx - - call C4ClearSpr - - call DoScaleRotate - - mov esi,eax - add esi,2000h - xor ebx,ebx - mov bl,[C4SprPos] - call C4SprBitPlane - pop edi - pop esi - pop edx - pop ebx - pop ecx - ret - -C4SprRotateR: - push ecx - push ebx - push edx - push esi - push edi - xor ebx,ebx - mov ebx,600h - add ebx,[C4Ram] - mov [C4SprPtr],esi - mov ch,[eax+1F8Ch] - shr ch,3 - mov cl,[eax+1F89h] - shr cl,3 - add ch,2 - mov [C4SprPos],cx - mov dword[C4SprPtrInc],64 - mov [C4SprPtr],ebx - sub byte[C4SprPos+1],2 - call C4ClearSpr - - call DoScaleRotate - mov esi,eax - add esi,2000h - xor ebx,ebx - mov bl,[C4SprPos] - add byte[C4SprPos+1],2 - call C4SprBitPlane - pop edi - pop esi - pop edx - pop ebx - pop ecx - ret - -C4SprDisintegrate: - pushad - mov dword[C4SprPtrInc],0 - xor ebx,ebx - mov bl,[eax+1F42h] - shl ebx,16 - mov bx,[eax+1F40h] - add bx,bx - shr ebx,1 - add ebx,[romdata] - mov ch,[eax+1F8Ch] - shr ch,3 - mov cl,[eax+1F89h] - shr cl,3 - mov [C4SprPos],cx - mov [C4SprPtr],ebx - - call C4ClearSpr - - mov esi,[C4Ram] - xor ebx,ebx - mov bx,[esi+1F86h] - xor eax,eax - mov al,[esi+1F89h] - shr al,1 - mul ebx - neg eax - xor ebx,ebx - mov bl,[esi+1F89h] - shr bl,1 - shl ebx,8 - add eax,ebx - push eax - xor ebx,ebx - mov bx,[esi+1F8Fh] - xor eax,eax - mov al,[esi+1F8Ch] - shr al,1 - mul ebx - neg eax - xor ebx,ebx - mov bl,[esi+1F8Ch] - shr bl,1 - shl ebx,8 - add ebx,eax - mov edx,ebx - pop ebx - mov esi,[C4Ram] - mov cl,[esi+1F89h] - mov ch,[esi+1F8Ch] - mov [C4SprPos+2],cx - movsx eax,word[esi+1F86h] - mov [.scalex],eax - movsx eax,word[esi+1F8Fh] - mov [.scaley],eax - mov esi,[C4SprPtr] - mov edi,[C4Ram] - add edi,2000h - - ; convert to 8-bit bitmap - mov cx,[C4SprPos+2] - shr cl,1 -.loop2 - mov al,[esi] - mov [edi],al - mov al,[esi] - shr al,4 - mov [edi+1],al - inc esi - add edi,2 - dec cl - jnz .loop2 - dec ch - jnz .loop2 - - mov edi,[C4Ram] - add edi,4000h - mov ecx,2000h -.lp - mov byte[edi],0 - inc edi - loop .lp - - mov esi,[C4Ram] - add esi,2000h - mov edi,[C4Ram] - add edi,4000h - - mov cx,[C4SprPos+2] -.next2 - push ebx -.next - xor eax,eax - mov ah,[C4SprPos+2] - cmp ebx,eax - jae .fail - xor eax,eax - mov ah,[C4SprPos+3] - cmp edx,eax - jae .fail - push ecx - push edx - xor eax,eax - mov al,[C4SprPos+2] - xor ecx,ecx - mov cl,dh - mul ecx - mov ecx,ebx - shr ecx,8 - add eax,ecx - mov dl,[esi] - cmp eax,2000h - jae .skipdisi - mov [edi+eax],dl -.skipdisi - pop edx - pop ecx -.fail - inc esi - add ebx,[.scalex] - dec cl - jnz near .next - pop ebx - add edx,[.scaley] - mov cl,[C4SprPos+2] - dec ch - jnz near .next2 - -.skipall - ; convert to 4-bit bitmap - mov esi,[C4Ram] - add esi,4000h - mov edi,[C4Ram] - add edi,6000h - mov cx,[C4SprPos+2] - shr cl,1 -.loop - mov al,[esi] - mov [edi],al - mov al,[esi+1] - shl al,4 - or [edi],al - inc edi - add esi,2 - dec cl - jnz .loop - dec ch - jnz .loop - - mov esi,[C4Ram] - add esi,6000h -; mov esi,[C4SprPtr] - mov eax,[C4Ram] - xor ebx,ebx - mov bl,[C4SprPos] - call C4SprBitPlane - - popad - ret - -SECTION .data -.scalex dd 0 -.scaley dd 0 -SECTION .text - -C4BitPlaneWave: - pushad - mov esi,[C4Ram] - mov dword[.temp],10h - xor eax,eax - mov al,[esi+1F83h] - mov dword[.waveptr],eax - mov word[.temp+4],0C0C0h - mov word[.temp+6],03F3Fh -.bmloopb - mov edi,[C4Ram] - add edi,[.waveptr] - xor eax,eax - movsx ax,byte[edi+$0B00] - neg ax - sub ax,16 - mov edi,[C4Ram] - add edi,0A00h - xor ecx,ecx -.bmloopa - mov ebx,[.bmptr+ecx*4] - mov dx,[.temp+6] - and [esi+ebx],dx - xor dx,dx - cmp ax,0 - jl .less - mov dx,0FF00h - cmp ax,8 - jae .less - mov dx,[edi+eax*2] -.less - and dx,[.temp+4] - or [esi+ebx],dx - inc ax - inc ecx - cmp ecx,28h - jne .bmloopa - add dword[.waveptr],1 - and dword[.waveptr],07Fh - ror word[.temp+4],2 - ror word[.temp+6],2 - cmp word[.temp+4],0C0C0h - jne near .bmloopb - add esi,16 -.bmloopa2b - mov edi,[C4Ram] - add edi,[.waveptr] - xor eax,eax - movsx ax,byte[edi+$0B00] - neg ax - sub ax,16 - mov edi,[C4Ram] - add edi,0A00h - xor ecx,ecx -.bmloopa2 - mov ebx,[.bmptr+ecx*4] - mov dx,[.temp+6] - and [esi+ebx],dx - xor dx,dx - cmp ax,0 - jl .less2 - mov dx,0FF00h - cmp ax,8 - jae .less2 - mov dx,[edi+eax*2+16] -.less2 - and dx,[.temp+4] - or [esi+ebx],dx - inc ax - inc ecx - cmp ecx,28h - jne .bmloopa2 - add dword[.waveptr],1 - and dword[.waveptr],07Fh - ror word[.temp+4],2 - ror word[.temp+6],2 - cmp word[.temp+4],0C0C0h - jne near .bmloopa2b - add esi,16 - dec dword[.temp] - jnz near .bmloopb - mov esi,[C4Ram] -; mov cx,[esi+1F80h] -; mov [C4values],cx -; mov cx,[esi+1F83h] -; mov [C4values+2],cx - popad - ret - -SECTION .data -.bmptr dd 0000h,0002h,0004h,0006h,0008h,000Ah,000Ch,000Eh - dd 0200h,0202h,0204h,0206h,0208h,020Ah,020Ch,020Eh - dd 0400h,0402h,0404h,0406h,0408h,040Ah,040Ch,040Eh - dd 0600h,0602h,0604h,0606h,0608h,060Ah,060Ch,060Eh - dd 0800h,0802h,0804h,0806h,0808h,080Ah,080Ch,080Eh -.temp dd 0,0 -.waveptr dd 0 -;C4X1 dw 0 -;C4Y1 dw 0 -;C4Z1 dw 0 -;C4X2 dw 0 -;C4Y2 dw 0 -;C4Z2 dw 0 -;C4Col dw 0 - -SECTION .text -C4DrawLine: - pushad - - ; transform both coordinates - push esi - mov ax,word[C4X1] - mov [C4WFXVal],ax - mov ax,word[C4Y1] - mov [C4WFYVal],ax - mov ax,word[C4Z1] - mov [C4WFZVal],ax - mov al,[esi+1F90h] - mov [C4WFScale],al - mov al,[esi+1F86h] - mov [C4WFX2Val],al - mov al,[esi+1F87h] - mov [C4WFY2Val],al - mov al,[esi+1F88h] - mov [C4WFDist],al - call C4TransfWireFrame2 - mov ax,[C4WFXVal] - mov word[C4X1],ax - mov ax,[C4WFYVal] - mov word[C4Y1],ax - - mov ax,word[C4X2] - mov [C4WFXVal],ax - mov ax,word[C4Y2] - mov [C4WFYVal],ax - mov ax,word[C4Z2] - mov [C4WFZVal],ax - call C4TransfWireFrame2 - mov ax,[C4WFXVal] - mov word[C4X2],ax - mov ax,[C4WFYVal] - mov word[C4Y2],ax - - add word[C4X1],48 - add word[C4Y1],48 - add word[C4X2],48 - add word[C4Y2],48 - shl dword[C4X1],8 - shl dword[C4X2],8 - shl dword[C4Y1],8 - shl dword[C4Y2],8 - ; get line info - mov ax,[C4X1+1] - mov [C4WFXVal],ax - mov ax,[C4Y1+1] - mov [C4WFYVal],ax - mov ax,[C4X2+1] - mov [C4WFX2Val],ax - mov ax,[C4Y2+1] - mov [C4WFY2Val],ax - call C4CalcWireFrame - xor ecx,ecx - mov cx,[C4WFDist] - or ecx,ecx - jnz .not0 - mov ecx,1 -.not0 - movsx eax,word[C4WFXVal] - mov [C4X2],eax - movsx eax,word[C4WFYVal] - mov [C4Y2],eax - pop esi - ; render line -.loop - ; plot pixel - cmp word[C4X1+1],0 - jl near .noplot - cmp word[C4Y1+1],0 - jl near .noplot - cmp word[C4X1+1],95 - jg near .noplot - cmp word[C4Y1+1],95 - jg near .noplot - xor eax,eax - mov dx,[C4Y1+1] - shr dx,3 - mov ax,dx - shl ax,6 - shl dx,8 - sub dx,ax - mov ax,[C4X1+1] - shr ax,3 - shl ax,4 - add ax,dx - mov dx,[C4Y1+1] - and dx,07h - add dx,dx - add ax,dx - mov dl,07Fh - push ecx - mov cl,[C4X1+1] - and cl,07h - ror dl,cl - pop ecx - and byte[esi+eax+300h],dl - and byte[esi+eax+301h],dl - xor dl,0FFh - test byte[C4Col],1 - jz .nocolor0 - or byte[esi+eax+300h],dl -.nocolor0 - test byte[C4Col],2 - jz .nocolor1 - or byte[esi+eax+301h],dl -.nocolor1 -.noplot - mov eax,[C4X2] - add [C4X1],eax - mov eax,[C4Y2] - add [C4Y1],eax - dec ecx - jnz near .loop - popad - ret - -DrawWireFrame: - mov esi,[C4Ram] - mov edi,esi - xor ebx,ebx - mov bl,[esi+1F82h] - shl ebx,16 - mov bx,[esi+1F80h] - add bx,bx - shr ebx,1 - add ebx,[romdata] - mov edi,ebx - xor ecx,ecx - mov cl,[esi+295h] -.loop - xor eax,eax - mov al,[esi+1F82h] - shl eax,16 - mov al,[edi+1] - mov ah,[edi+0] - mov edx,edi -.nextprev - cmp ax,0FFFFh - jne .notprev - sub edx,5 - mov al,[edx+3] - mov ah,[edx+2] - jmp .nextprev -.notprev - add ax,ax - shr eax,1 - add eax,[romdata] - xor edx,edx - mov dl,[esi+1F82h] - shl edx,16 - mov dl,[edi+3] - mov dh,[edi+2] -; mov [C4values+6],dx - add dx,dx - shr edx,1 - add edx,[romdata] - xor ebx,ebx - mov bh,[eax] - mov bl,[eax+1] - mov [C4X1],ebx - mov bh,[eax+2] - mov bl,[eax+3] - mov [C4Y1],ebx - mov bh,[eax+4] - mov bl,[eax+5] - mov [C4Z1],ebx - mov bh,[edx] - mov bl,[edx+1] - mov [C4X2],ebx - mov bh,[edx+2] - mov bl,[edx+3] - mov [C4Y2],ebx - mov bh,[edx+4] - mov bl,[edx+5] - mov [C4Z2],ebx - mov al,[edi+4] - mov [C4Col],al - add edi,5 - call C4DrawLine - dec ecx - jnz near .loop - ret - -SECTION .data -C4X1 dd 0 -C4Y1 dd 0 -C4Z1 dd 0 -C4X2 dd 0 -C4Y2 dd 0 -C4Z2 dd 0 -C4Col dd 0 -SECTION .text - -WireFrameB: - pushad - ; 28EECA - ; 7F80 (3bytes) = pointer to data - ; 7F86-7F88 = rotation, 7F90 = scale (/7A?) - ; 6295 = # of lines, 7FA5 = ??? - mov esi,[C4Ram] - add esi,300h - mov ecx,16*12*3 -.loop - mov dword[esi],0 - add esi,4 - loop .loop - call DrawWireFrame - - mov esi,[C4Ram] - mov cx,[esi+1FA5h] -; mov [C4values],cx -; mov cx,[esi+1F86h] -; mov [C4values],cx -; mov cx,[esi+1F88h] -; mov [C4values+2],cx -; mov cx,[esi+1F90h] -; mov [C4values+4],cx - popad - ret - -WireFrameB2: - pushad - call DrawWireFrame - popad - ret - -C4WireFrame: - pushad - mov esi,[C4Ram] - mov ax,[esi+1F83h] - and ax,0FFh - mov [C4WFX2Val],ax -; mov [C4values],ax - mov ax,[esi+1F86h] - and ax,0FFh - mov [C4WFY2Val],ax -; mov [C4values+2],ax - mov ax,[esi+1F89h] - and ax,0FFh - mov [C4WFDist],ax -; mov [C4values+4],ax - mov ax,[esi+1F8Ch] - and ax,0FFh - mov [C4WFScale],ax -; mov [C4values+6],ax - - ; transform vertices (MMX2 - 36 vertices, 54 lines) - xor ecx,ecx - mov cx,[esi+1F80h] - xor al,al -.loop - mov ax,[esi+1] - mov [C4WFXVal],ax - mov ax,[esi+5] - mov [C4WFYVal],ax - mov ax,[esi+9] - mov [C4WFZVal],ax - push esi - push ecx - call C4TransfWireFrame - pop ecx - pop esi - ; Displace - mov ax,[C4WFXVal] - add ax,80h - mov [esi+1],ax - mov ax,[C4WFYVal] - add ax,50h - mov [esi+5],ax - add esi,10h - loop .loop - ; Uses 6001,6005,6600,6602,6605 - - mov esi,[C4Ram] - mov word[esi+$600],23 - mov word[esi+$602],60h - mov word[esi+$605],40h - mov word[esi+$600+8],23 - mov word[esi+$602+8],60h - mov word[esi+$605+8],40h - - xor ecx,ecx - mov cx,[esi+0B00h] - mov edi,esi - add edi,0B02h -.lineloop - xor eax,eax - mov al,[edi] - shl eax,4 - add eax,[C4Ram] - mov bx,[eax+1] - mov [C4WFXVal],bx - mov bx,[eax+5] - mov [C4WFYVal],bx - xor eax,eax - mov al,[edi+1] - shl eax,4 - add eax,[C4Ram] - mov bx,[eax+1] - mov [C4WFX2Val],bx - mov bx,[eax+5] - mov [C4WFY2Val],bx - push esi - push edi - push ecx - call C4CalcWireFrame - pop ecx - pop edi - pop esi - mov ax,[C4WFDist] - or ax,ax - jnz .yeswire - mov ax,1 -.yeswire - mov word[esi+$600],ax - mov ax,[C4WFXVal] - mov word[esi+$602],ax - mov ax,[C4WFYVal] - mov word[esi+$605],ax - add edi,2 - add esi,8 - dec ecx - jnz near .lineloop -.done - popad - ret - -C4Transform: - ; 7F81,4,7,9,A,B,0,1,D - pushad - mov esi,[C4Ram] - mov ax,word[esi+1F81h] - mov [C4WFXVal],ax - mov ax,word[esi+1F84h] - mov [C4WFYVal],ax - mov ax,word[esi+1F87h] - mov [C4WFZVal],ax - mov al,[esi+1F90h] - mov [C4WFScale],al - mov al,[esi+1F89h] - mov [C4WFX2Val],al - mov al,[esi+1F8Ah] - mov [C4WFY2Val],al - mov al,[esi+1F8Bh] - mov [C4WFDist],al - call C4TransfWireFrame2 - mov ax,[C4WFXVal] - mov word[esi+1F80h],ax - mov ax,[C4WFYVal] - mov word[esi+1F83h],ax - popad - ret - -SECTION .data -C4SprPos dd 0 -C4SprScale dd 0 -C4SprScaleY dd 0 -C4SprScaler dd 0 -C4SprScalerY dd 0 -C4SprPtr dd 0 -C4SprPtrInc dd 0 -NEWSYM C4values, dd 0,0,0 -SECTION .text - -C4activate: - cmp ecx,1F4Fh - jne .noc4test - push esi - mov esi,[C4Ram] - cmp byte[esi+1F4Dh],0Eh - jne .befnoc4test - test al,0C3h - jnz .befnoc4test - shr al,2 - mov [esi+1F80h],al - pop esi - ret -.befnoc4test - pop esi -.noc4test - cmp al,00h - je near .dosprites - cmp al,01h - je near .dowireframe - cmp al,05h ; ? - je near .propulsion - cmp al,0Dh ; ? - je near .equatevelocity - cmp al,10h ; supply angle+distance, return x/y displacement - je near .direction - cmp al,13h ; Convert polar coordinates to rectangular 2 (similar to 10) - je near .polarcord2 - cmp al,15h ; ? - je near .calcdistance - cmp al,1Fh ; supply x/y displacement, return angle (+distance?) - je near .calcangle - cmp al,22h ; supply x/y displacement, return angle (+distance?) - je near .linearray - cmp al,25h - je near .multiply - cmp al,2Dh ; ??? - je near .transform - cmp al,40h - je near .sum - cmp al,54h - je near .square - cmp al,5Ch - je near .immediatereg - cmp al,89h - je near .immediaterom - ret -.dowireframe - call WireFrameB - ret -.linearray - pushad - ; C,F,0,3,6,9 -> 6800 (E1h bytes) - ; 0,3 = screen scroll coordinates - ; 6,9 = light source coordinates - ; C,F = angle of both arrays - mov esi,[C4Ram] - xor ecx,ecx -.loopline - ; process position - xor eax,eax - mov al,[esi+1F8Ch] - or ecx,ecx - jz .secondlineb - mov al,[esi+1F8Fh] -.secondlineb - test al,80h - jz .notua - or ah,1 -.notua - movsx ebx,word[CosTable+eax*2] - mov ax,word[SinTable+eax*2] - shl eax,16 - cmp ebx,0 - je near .finish - xor edx,edx - test eax,80000000h - jz .notnegline - mov edx,0FFFFFFFFh -.notnegline - idiv ebx - mov [C4Temp],eax - xor edx,edx - mov bx,[esi+1F83h] - sub bx,[esi+1F89h] - dec bx - movsx ebx,bx -.nextline - test ebx,80000000h - jnz .none - mov eax,[C4Temp] - imul eax,ebx - sar eax,16 - sub ax,[esi+1F80h] - add ax,[esi+1F86h] - inc ax - add ax,cx - cmp ax,0 - jge .not0line - xor ax,ax - or ecx,ecx - jz .not0line - mov byte[esi+edx+$800],1 -.not0line - cmp ax,255 - jl .not255line - mov ax,255 -.not255line - jmp .doneline -.none - mov al,1 - sub al,cl -.doneline - or ecx,ecx - jnz .secondline - mov [esi+edx+$800],al - jmp .firstline -.secondline - mov [esi+edx+$900],al -.firstline - inc ebx - inc edx - cmp edx,0E1h - jne .nextline - or ecx,ecx - jnz .finish - mov ecx,1 - jmp .loopline -.finish - mov cx,[C4Temp] -; mov [C4values],cx - mov cx,[C4Temp+2] -; mov [C4values+2],cx - mov cx,[esi+1F8Ch] -; mov [C4values+4],cx - mov cx,[esi+1F8Fh] -; mov [C4values+6],cx - popad - ret -.propulsion - pushad - ; 81 = 5B, 83 = 0x300 - ; 0x300 = /1, 0x280 = /4 - mov esi,[C4Ram] - - mov cx,[esi+1F83h] - mov [C4values+2],cx - mov cx,[esi+1F81h] - mov [C4values],cx - xor bx,bx - -; mov ax,256*256 - xor ax,ax - mov dx,1 - mov bx,[esi+1F83h] - or dx,dx - jz .done - idiv bx - mov [C4values+6],ax - mov bx,[esi+1F81h] - imul bx - shl edx,16 - mov dx,ax - sar edx,8 -.done - mov word[esi+1F80h],dx - mov [C4values+4],dx - -; and eax,1FFh -; mov bx,[SinTable+eax*2] -; mov ax,[esi+1F81h] ; distance? -; imul bx -; mov ax,dx -; shl ax,1 -; shl dx,3 -; add dx,ax - - popad - ret -.polarcord2 - pushad - mov esi,[C4Ram] - xor ecx,ecx - mov cx,[esi+1F80h] - and ecx,1FFh - movsx eax,word[esi+1F83h] - add eax,eax - movsx ebx,word[CosTable+ecx*2] - imul ebx,eax - sar ebx,8 - adc ebx,0 - mov [esi+1F86h],ebx - movsx ebx,word[SinTable+ecx*2] - imul ebx,eax - sar ebx,8 - adc ebx,0 - mov [esi+1F89h],bx - sar ebx,16 - mov [esi+1F8Bh],bl - popad - ret -.dosprites -; mov byte[debstop3],0 - push eax - mov eax,[C4Ram] - cmp byte[eax+1F4Dh],0 - je near .sprites - cmp byte[eax+1F4Dh],3 - je near .scaler - cmp byte[eax+1F4Dh],5 - je near .lines - cmp byte[eax+1F4Dh],7 - je near .rotater - cmp byte[eax+1F4Dh],8 - je near .wireframeb - cmp byte[eax+1F4Dh],0Bh - je near .disintegrate - cmp byte[eax+1F4Dh],0Ch - je near .bitmap - pop eax - ret -.wireframeb - pop eax - call WireFrameB2 - ret -.sprites - pop eax - call C4ProcessSprites - ret -.disintegrate - call C4SprDisintegrate - pop eax - ret -.dolines -; mov byte[debstop3],0 - ret -.bitmap - call C4BitPlaneWave - pop eax - ret -.calcdistance - pushad - mov esi,[C4Ram] - mov bx,[esi+1F80h] - mov [C41FXVal],bx - mov bx,[esi+1F83h] - mov [C41FYVal],bx -; mov eax,[C4Ram] -; mov cx,[eax+1F80h] -; mov [C4values+0],cx -; mov cx,[eax+1F83h] -; mov [C4values+2],cx - call C4Op15 - mov eax,[C4Ram] - mov bx,[C41FDist] - mov [eax+1F80h],bx -; mov word[eax+1F80h],50 -; mov cx,[eax+1F80h] -; mov [C4values+4],cx - popad - ret -.calcangle - pushad - mov esi,[C4Ram] - mov bx,[esi+1F80h] - mov [C41FXVal],bx - mov bx,[esi+1F83h] - mov [C41FYVal],bx - call C4Op1F - mov eax,[C4Ram] - mov bx,[C41FAngleRes] - mov [eax+1F86h],bx -; mov esi,[C4Ram] -; mov cx,[esi+1F86h] -; mov [C4values],cx -; mov cx,[esi+1F80h] -; mov [C4values+2],cx -; mov cx,[esi+1F83h] -; mov [C4values+4],cx - popad - ret -.transform - ; 7F81,4,7,9,A,B,0,1,D -; mov byte[debstop3],0 - pushad -; mov eax,[C4Ram] - call C4Transform -; mov word[eax+1F80h],0 -; mov word[eax+1F83h],0 - popad - ret -.multiply - pushad - mov esi,[C4Ram] - mov eax,[esi+1F80h] - and eax,0FFFFFFh - mov ebx,[esi+1F83h] - and ebx,0FFFFFFh - imul eax,ebx - mov [esi+1F80h],eax - popad - ret -.sum - pushad - xor eax,eax - xor ebx,ebx - mov esi,[C4Ram] - mov ecx,800h -.sumloop - mov bl,byte[esi] - inc esi - add ax,bx - dec ecx - jnz .sumloop - mov [esi+1F80h-0800h],ax - popad - ret -.square - pushad - xor edx,edx - mov esi,[C4Ram] - mov eax,[esi+1F80h] - shl eax,8 - sar eax,8 - imul eax - mov [esi+1F83h],eax - mov [esi+1F87h],dx - popad - ret -.equatevelocity - pushad - mov esi,[C4Ram] - mov bx,[esi+1F80h] - mov [C41FXVal],bx - mov bx,[esi+1F83h] - mov [C41FYVal],bx - mov bx,[esi+1F86h] - mov [C41FDistVal],bx - call C4Op0D - mov bx,[C41FXVal] - mov [esi+1F89h],bx - mov bx,[C41FYVal] - mov [esi+1F8Ch],bx - popad - ret - - - pushad - mov esi,[C4Ram] - mov cx,[esi+$1F86] - cmp cx,40h - jb .nomult - shr cx,7 -.nomult - mov ax,[esi+$1F80] -; imul cx - shl ax,4 - mov word[esi+$1F89],ax - mov ax,[esi+$1F83] -; imul cx - shl ax,4 - mov word[esi+$1F8C],ax -; mov cx,[esi+$1F80] -; mov [C4values],cx -; mov cx,[esi+$1F83] -; mov [C4values+2],cx -; mov cx,[esi+$1F86] -; mov [C4values+4],cx - popad - ret -.lines - call C4WireFrame - pop eax - ret -.scaler - push esi - push ecx - mov esi,[C4Ram] -; mov cx,[esi+1F8Fh] -; mov [C4values],cx -; mov cx,[esi+1F92h] -; mov [C4values+2],cx -; mov cx,[esi+1F80h] -; mov [C4values+4],cx - pop ecx - pop esi - call C4SprScaleR - pop eax - ret -.rotater - push esi - push ecx - mov esi,[C4Ram] -; mov cx,[esi+1F8Fh] -; mov [C4values],cx -; mov cx,[esi+1F92h] -; mov [C4values+2],cx -; mov cx,[esi+1F80h] -; mov [C4values+4],cx - pop ecx - pop esi - call C4SprRotateR - pop eax - ret -.direction - push eax - push ebx - push esi - push edx - push ecx - mov esi,[C4Ram] - xor ecx,ecx - mov ax,[esi+1F80h] - and eax,1FFh - mov bx,[CosTable+eax*2] - mov ax,[esi+1F83h] - imul bx - add ax,ax - adc dx,dx - mov ax,dx - movsx edx,dx - mov [esi+1F86h],edx - mov ax,[esi+1F80h] - and eax,1FFh - mov bx,[SinTable+eax*2] - mov ax,[esi+1F83h] - imul bx - add ax,ax - adc dx,dx - mov ax,dx - movsx edx,dx - mov eax,edx - sar eax,6 - sub edx,eax - mov al,[esi+198Ch] - mov [esi+1F89h],edx - mov [esi+198Ch],al -; mov cx,[esi+1F80h] -; mov [C4values],cx -; mov cx,[esi+1F83h] -; mov [C4values+2],cx -; mov cx,[esi+1F86h] -; mov [C4values+4],cx - pop ecx - pop edx - pop esi - pop ebx - pop eax - ret -.immediaterom - push eax - mov eax,[C4Ram] - mov byte[eax+1F80h],36h - mov byte[eax+1F81h],43h - mov byte[eax+1F82h],05h - pop eax - ret -.immediatereg - push eax - mov eax,[C4Ram] - mov dword[eax+0*4],0FF000000h - mov dword[eax+1*4],0FF00FFFFh - mov dword[eax+2*4],0FF000000h - mov dword[eax+3*4],00000FFFFh - mov dword[eax+4*4],00000FFFFh - mov dword[eax+5*4],07FFFFF80h - mov dword[eax+6*4],0FF008000h - mov dword[eax+7*4],07FFF007Fh - mov dword[eax+8*4],0FFFF7FFFh - mov dword[eax+9*4],0FF010000h - mov dword[eax+10*4],00100FEFFh - mov dword[eax+11*4],000FEFF00h - pop eax - ret - -;NEWSYM C4RegFunction - add ecx,[C4Ram] - mov [ecx],al - sub ecx,[C4Ram] - cmp ecx,1F4Fh - je near C4activate - ret - -NEWSYM C4ReadReg - add ecx,[C4Ram] - mov al,[ecx] - sub ecx,[C4Ram] - ret - -NEWSYM C4RegFunction -NEWSYM C4WriteReg - add ecx,[C4Ram] - mov [ecx],al - sub ecx,[C4Ram] - cmp ecx,1F4Fh - je near C4activate - cmp ecx,1F47h - je .C4Memcpy - ret - -.C4Memcpy - pushad - push dword [C4Ram] - call C4LoaDMem - pop eax - popad - ret - -SECTION .data -SinTable: -dw $00000,$00192,$00324,$004B6,$00647,$007D9,$0096A,$00AFB,$00C8B,$00E1B,$00FAB -dw $01139,$012C8,$01455,$015E2,$0176D,$018F8,$01A82,$01C0B,$01D93,$01F19,$0209F -dw $02223,$023A6,$02528,$026A8,$02826,$029A3,$02B1F,$02C98,$02E11,$02F87,$030FB -dw $0326E,$033DE,$0354D,$036BA,$03824,$0398C,$03AF2,$03C56,$03DB8,$03F17,$04073 -dw $041CE,$04325,$0447A,$045CD,$0471C,$04869,$049B4,$04AFB,$04C3F,$04D81,$04EBF -dw $04FFB,$05133,$05269,$0539B,$054CA,$055F5,$0571D,$05842,$05964,$05A82,$05B9D -dw $05CB4,$05DC7,$05ED7,$05FE3,$060EC,$061F1,$062F2,$063EF,$064E8,$065DD,$066CF -dw $067BD,$068A6,$0698C,$06A6D,$06B4A,$06C24,$06CF9,$06DCA,$06E96,$06F5F,$07023 -dw $070E2,$0719E,$07255,$07307,$073B5,$0745F,$07504,$075A5,$07641,$076D9,$0776C -dw $077FA,$07884,$07909,$0798A,$07A05,$07A7D,$07AEF,$07B5D,$07BC5,$07C29,$07C89 -dw $07CE3,$07D39,$07D8A,$07DD6,$07E1D,$07E5F,$07E9D,$07ED5,$07F09,$07F38,$07F62 -dw $07F87,$07FA7,$07FC2,$07FD8,$07FE9,$07FF6,$07FFD,$07FFF,$07FFD,$07FF6,$07FE9 -dw $07FD8,$07FC2,$07FA7,$07F87,$07F62,$07F38,$07F09,$07ED5,$07E9D,$07E5F,$07E1D -dw $07DD6,$07D8A,$07D39,$07CE3,$07C89,$07C29,$07BC5,$07B5D,$07AEF,$07A7D,$07A05 -dw $0798A,$07909,$07884,$077FA,$0776C,$076D9,$07641,$075A5,$07504,$0745F,$073B5 -dw $07307,$07255,$0719E,$070E2,$07023,$06F5F,$06E96,$06DCA,$06CF9,$06C24,$06B4A -dw $06A6D,$0698C,$068A6,$067BD,$066CF,$065DD,$064E8,$063EF,$062F2,$061F1,$060EC -dw $05FE3,$05ED7,$05DC7,$05CB4,$05B9D,$05A82,$05964,$05842,$0571D,$055F5,$054CA -dw $0539B,$05269,$05133,$04FFB,$04EBF,$04D81,$04C3F,$04AFB,$049B4,$04869,$0471C -dw $045CD,$0447A,$04325,$041CE,$04073,$03F17,$03DB8,$03C56,$03AF2,$0398C,$03824 -dw $036BA,$0354D,$033DE,$0326E,$030FB,$02F87,$02E11,$02C98,$02B1F,$029A3,$02826 -dw $026A8,$02528,$023A6,$02223,$0209F,$01F19,$01D93,$01C0B,$01A82,$018F8,$0176D -dw $015E2,$01455,$012C8,$01139,$00FAB,$00E1B,$00C8B,$00AFB,$0096A,$007D9,$00647 -dw $004B6,$00324,$00192 -dw $00000,$0FE6E,$0FCDC,$0FB4A,$0F9B9,$0F827,$0F696,$0F505,$0F375,$0F1E5,$0F055 -dw $0EEC7,$0ED38,$0EBAB,$0EA1E,$0E893,$0E708,$0E57E,$0E3F5,$0E26D,$0E0E7,$0DF61 -dw $0DDDD,$0DC5A,$0DAD8,$0D958,$0D7DA,$0D65D,$0D4E1,$0D368,$0D1EF,$0D079,$0CF05 -dw $0CD92,$0CC22,$0CAB3,$0C946,$0C7DC,$0C674,$0C50E,$0C3AA,$0C248,$0C0E9,$0BF8D -dw $0BE32,$0BCDB,$0BB86,$0BA33,$0B8E4,$0B797,$0B64C,$0B505,$0B3C1,$0B27F,$0B141 -dw $0B005,$0AECD,$0AD97,$0AC65,$0AB36,$0AA0B,$0A8E3,$0A7BE,$0A69C,$0A57E,$0A463 -dw $0A34C,$0A239,$0A129,$0A01D,$09F14,$09E0F,$09D0E,$09C11,$09B18,$09A23,$09931 -dw $09843,$0975A,$09674,$09593,$094B6,$093DC,$09307,$09236,$0916A,$090A1,$08FDD -dw $08F1E,$08E62,$08DAB,$08CF9,$08C4B,$08BA1,$08AFC,$08A5B,$089BF,$08927,$08894 -dw $08806,$0877C,$086F7,$08676,$085FB,$08583,$08511,$084A3,$0843B,$083D7,$08377 -dw $0831D,$082C7,$08276,$0822A,$081E3,$081A1,$08163,$0812B,$080F7,$080C8,$0809E -dw $08079,$08059,$0803E,$08028,$08017,$0800A,$08003,$08001,$08003,$0800A,$08017 -dw $08028,$0803E,$08059,$08079,$0809E,$080C8,$080F7,$0812B,$08163,$081A1,$081E3 -dw $0822A,$08276,$082C7,$0831D,$08377,$083D7,$0843B,$084A3,$08511,$08583,$085FB -dw $08676,$086F7,$0877C,$08806,$08894,$08927,$089BF,$08A5B,$08AFC,$08BA1,$08C4B -dw $08CF9,$08DAB,$08E62,$08F1E,$08FDD,$090A1,$0916A,$09236,$09307,$093DC,$094B6 -dw $09593,$09674,$0975A,$09843,$09931,$09A23,$09B18,$09C11,$09D0E,$09E0F,$09F14 -dw $0A01D,$0A129,$0A239,$0A34C,$0A463,$0A57E,$0A69C,$0A7BE,$0A8E3,$0AA0B,$0AB36 -dw $0AC65,$0AD97,$0AECD,$0B005,$0B141,$0B27F,$0B3C1,$0B505,$0B64C,$0B797,$0B8E4 -dw $0BA33,$0BB86,$0BCDB,$0BE32,$0BF8D,$0C0E9,$0C248,$0C3AA,$0C50E,$0C674,$0C7DC -dw $0C946,$0CAB3,$0CC22,$0CD92,$0CF05,$0D079,$0D1EF,$0D368,$0D4E1,$0D65D,$0D7DA -dw $0D958,$0DAD8,$0DC5A,$0DDDD,$0DF61,$0E0E7,$0E26D,$0E3F5,$0E57E,$0E708,$0E893 -dw $0EA1E,$0EBAB,$0ED38,$0EEC7,$0F055,$0F1E5,$0F375,$0F505,$0F696,$0F827,$0F9B9 -dw $0FB4A,$0FCDC,$0FE6E - - -CosTable: -dw $07FFF,$07FFD,$07FF6,$07FE9,$07FD8,$07FC2,$07FA7,$07F87,$07F62,$07F38,$07F09 -dw $07ED5,$07E9D,$07E5F,$07E1D,$07DD6,$07D8A,$07D39,$07CE3,$07C89,$07C29,$07BC5 -dw $07B5D,$07AEF,$07A7D,$07A05,$0798A,$07909,$07884,$077FA,$0776C,$076D9,$07641 -dw $075A5,$07504,$0745F,$073B5,$07307,$07255,$0719E,$070E2,$07023,$06F5F,$06E96 -dw $06DCA,$06CF9,$06C24,$06B4A,$06A6D,$0698C,$068A6,$067BD,$066CF,$065DD,$064E8 -dw $063EF,$062F2,$061F1,$060EC,$05FE3,$05ED7,$05DC7,$05CB4,$05B9D,$05A82,$05964 -dw $05842,$0571D,$055F5,$054CA,$0539B,$05269,$05133,$04FFB,$04EBF,$04D81,$04C3F -dw $04AFB,$049B4,$04869,$0471C,$045CD,$0447A,$04325,$041CE,$04073,$03F17,$03DB8 -dw $03C56,$03AF2,$0398C,$03824,$036BA,$0354D,$033DE,$0326E,$030FB,$02F87,$02E11 -dw $02C98,$02B1F,$029A3,$02826,$026A8,$02528,$023A6,$02223,$0209F,$01F19,$01D93 -dw $01C0B,$01A82,$018F8,$0176D,$015E2,$01455,$012C8,$01139,$00FAB,$00E1B,$00C8B -dw $00AFB,$0096A,$007D9,$00647,$004B6,$00324,$00192,$00000,$0FE6E,$0FCDC,$0FB4A -dw $0F9B9,$0F827,$0F696,$0F505,$0F375,$0F1E5,$0F055,$0EEC7,$0ED38,$0EBAB,$0EA1E -dw $0E893,$0E708,$0E57E,$0E3F5,$0E26D,$0E0E7,$0DF61,$0DDDD,$0DC5A,$0DAD8,$0D958 -dw $0D7DA,$0D65D,$0D4E1,$0D368,$0D1EF,$0D079,$0CF05,$0CD92,$0CC22,$0CAB3,$0C946 -dw $0C7DC,$0C674,$0C50E,$0C3AA,$0C248,$0C0E9,$0BF8D,$0BE32,$0BCDB,$0BB86,$0BA33 -dw $0B8E4,$0B797,$0B64C,$0B505,$0B3C1,$0B27F,$0B141,$0B005,$0AECD,$0AD97,$0AC65 -dw $0AB36,$0AA0B,$0A8E3,$0A7BE,$0A69C,$0A57E,$0A463,$0A34C,$0A239,$0A129,$0A01D -dw $09F14,$09E0F,$09D0E,$09C11,$09B18,$09A23,$09931,$09843,$0975A,$09674,$09593 -dw $094B6,$093DC,$09307,$09236,$0916A,$090A1,$08FDD,$08F1E,$08E62,$08DAB,$08CF9 -dw $08C4B,$08BA1,$08AFC,$08A5B,$089BF,$08927,$08894,$08806,$0877C,$086F7,$08676 -dw $085FB,$08583,$08511,$084A3,$0843B,$083D7,$08377,$0831D,$082C7,$08276,$0822A -dw $081E3,$081A1,$08163,$0812B,$080F7,$080C8,$0809E,$08079,$08059,$0803E,$08028 -dw $08017,$0800A,$08003 -dw $08001,$08003,$0800A,$08017,$08028,$0803E,$08059,$08079,$0809E,$080C8,$080F7, -dw $0812B,$08163,$081A1,$081E3,$0822A,$08276,$082C7,$0831D,$08377,$083D7,$0843B, -dw $084A3,$08511,$08583,$085FB,$08676,$086F7,$0877C,$08806,$08894,$08927,$089BF, -dw $08A5B,$08AFC,$08BA1,$08C4B,$08CF9,$08DAB,$08E62,$08F1E,$08FDD,$090A1,$0916A, -dw $09236,$09307,$093DC,$094B6,$09593,$09674,$0975A,$09843,$09931,$09A23,$09B18, -dw $09C11,$09D0E,$09E0F,$09F14,$0A01D,$0A129,$0A239,$0A34C,$0A463,$0A57E,$0A69C, -dw $0A7BE,$0A8E3,$0AA0B,$0AB36,$0AC65,$0AD97,$0AECD,$0B005,$0B141,$0B27F,$0B3C1, -dw $0B505,$0B64C,$0B797,$0B8E4,$0BA33,$0BB86,$0BCDB,$0BE32,$0BF8D,$0C0E9,$0C248, -dw $0C3AA,$0C50E,$0C674,$0C7DC,$0C946,$0CAB3,$0CC22,$0CD92,$0CF05,$0D079,$0D1EF, -dw $0D368,$0D4E1,$0D65D,$0D7DA,$0D958,$0DAD8,$0DC5A,$0DDDD,$0DF61,$0E0E7,$0E26D, -dw $0E3F5,$0E57E,$0E708,$0E893,$0EA1E,$0EBAB,$0ED38,$0EEC7,$0F055,$0F1E5,$0F375, -dw $0F505,$0F696,$0F827,$0F9B9,$0FB4A,$0FCDC,$0FE6E,$00000,$00192,$00324,$004B6, -dw $00647,$007D9,$0096A,$00AFB,$00C8B,$00E1B,$00FAB,$01139,$012C8,$01455,$015E2, -dw $0176D,$018F8,$01A82,$01C0B,$01D93,$01F19,$0209F,$02223,$023A6,$02528,$026A8, -dw $02826,$029A3,$02B1F,$02C98,$02E11,$02F87,$030FB,$0326E,$033DE,$0354D,$036BA, -dw $03824,$0398C,$03AF2,$03C56,$03DB8,$03F17,$04073,$041CE,$04325,$0447A,$045CD, -dw $0471C,$04869,$049B4,$04AFB,$04C3F,$04D81,$04EBF,$04FFB,$05133,$05269,$0539B, -dw $054CA,$055F5,$0571D,$05842,$05964,$05A82,$05B9D,$05CB4,$05DC7,$05ED7,$05FE3, -dw $060EC,$061F1,$062F2,$063EF,$064E8,$065DD,$066CF,$067BD,$068A6,$0698C,$06A6D, -dw $06B4A,$06C24,$06CF9,$06DCA,$06E96,$06F5F,$07023,$070E2,$0719E,$07255,$07307, -dw $073B5,$0745F,$07504,$075A5,$07641,$076D9,$0776C,$077FA,$07884,$07909,$0798A, -dw $07A05,$07A7D,$07AEF,$07B5D,$07BC5,$07C29,$07C89,$07CE3,$07D39,$07D8A,$07DD6, -dw $07E1D,$07E5F,$07E9D,$07ED5,$07F09,$07F38,$07F62,$07F87,$07FA7,$07FC2,$07FD8, -dw $07FE9,$07FF6,$07FFD - -SECTION .text diff --git a/i386/fxemu2.asm b/i386/fxemu2.asm deleted file mode 100644 index 76de7b41..00000000 --- a/i386/fxemu2.asm +++ /dev/null @@ -1,2692 +0,0 @@ -;Copyright (C) 1997-2001 ZSNES Team ( zsknight@zsnes.com / _demo_@zsnes.com ) -; -;This program is free software; you can redistribute it and/or -;modify it under the terms of the GNU General Public License -;as published by the Free Software Foundation; either -;version 2 of the License, or (at your option) any later -;version. -; -;This program is distributed in the hope that it will be useful, -;but WITHOUT ANY WARRANTY; without even the implied warranty of -;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;GNU General Public License for more details. -; -;You should have received a copy of the GNU General Public License -;along with this program; if not, write to the Free Software -;Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - -%include "macros.mac" - -EXTSYM FxTable,FxTableb,FxTablec,FxTabled,SfxMemTable,flagnz,fxbit01,fxbit23 -EXTSYM fxxand,sfx128lineloc,sfx160lineloc,sfx192lineloc,sfxobjlineloc -EXTSYM sfxramdata,fxbit45,fxbit67,SFXProc,ChangeOps -EXTSYM PLOTJmpa,PLOTJmpb - -NEWSYM FxEmu2AsmStart - -%include "fxemu2.mac" - - - - - - -; * Optimise PLOT, COLOR! -SECTION .text -NEWSYM FlushCache - ; Copy 512 bytes from pb:eax to SfxCACHERAM - ret - -SECTION .bss -NEWSYM tempsfx, resb 3 - -SECTION .data ;ALIGN=32 - -; FxChip emulation by _Demo_ -; Optimised by zsKnight -; based on fxemu by lestat - -NEWSYM SfxR0, dd 0 ; default source/destination register -NEWSYM SfxR1, dd 0 ; pixel plot X position register -NEWSYM SfxR2, dd 0 ; pixel plot Y position register -NEWSYM SfxR3, dd 0 ; -NEWSYM SfxR4, dd 0 ; lower 16 bit result of lmult -NEWSYM SfxR5, dd 0 ; -NEWSYM SfxR6, dd 0 ; multiplier for fmult and lmult -NEWSYM SfxR7, dd 0 ; fixed point texel X position for merge -NEWSYM SfxR8, dd 0 ; fixed point texel Y position for merge -NEWSYM SfxR9, dd 0 ; -NEWSYM SfxR10, dd 0 ; -NEWSYM SfxR11, dd 0 ; return address set by link -NEWSYM SfxR12, dd 0 ; loop counter -NEWSYM SfxR13, dd 0 ; loop point address -NEWSYM SfxR14, dd 0 ; rom address for getb, getbh, getbl, getbs -NEWSYM SfxR15, dd 0 ; program counter - -NEWSYM SfxSFR, dd 0 ; status flag register (16bit) -;SFR status flag register bits: -; 0 - -; 1 Z Zero flag -; 2 CY Carry flag -; 3 S Sign flag -; 4 OV Overflow flag -; 5 G Go flag (set to 1 when the GSU is running) -; 6 R Set to 1 when reading ROM using R14 address -; 7 - -; 8 ALT1 Mode set-up flag for the next instruction -; 9 ALT2 Mode set-up flag for the next instruction -;10 IL Immediate lower 8-bit flag -;11 IH Immediate higher 8-bit flag -;12 B Set to 1 when the WITH instruction is executed -;13 - -;14 - -;15 IRQ Set to 1 when GSU caused an interrupt -; Set to 0 when read by 658c16 - -NEWSYM SfxBRAMR, dd 0 ; backup ram read only on/off (8bit) -NEWSYM SfxPBR, dd 0 ; program bank register (8bit) -NEWSYM SfxROMBR, dd 0 ; rom bank register (8bit) -NEWSYM SfxCFGR, dd 0 ; control flags register (8bit) -NEWSYM SfxSCBR, dd 0 ; screen bank register (8bit) -NEWSYM SfxCLSR, dd 0 ; clock speed register (8bit) -NEWSYM SfxSCMR, dd 0 ; screen mode register (8bit) -NEWSYM SfxVCR, dd 0 ; version code register (8bit) -NEWSYM SfxRAMBR, dd 0 ; ram bank register (8bit) -NEWSYM SfxCBR, dd 0 ; cache base register (16bit) - -NEWSYM SfxCOLR, dd 0 ; Internal color register -NEWSYM SfxPOR, dd 0 ; Plot option register - -NEWSYM SfxCacheFlags, dd 0 ; Saying what parts of the cache was written to -NEWSYM SfxLastRamAdr, dd 0 ; Last RAM address accessed -NEWSYM SfxDREG, dd 0 ; Current destination register index -NEWSYM SfxSREG, dd 0 ; Current source register index -NEWSYM SfxRomBuffer, dd 0 ; Current byte read by R14 -NEWSYM SfxPIPE, dd 0 ; Instructionset pipe -NEWSYM SfxPipeAdr, dd 0 ; The address of where the pipe was read from - -NEWSYM SfxnRamBanks, dd 4 ; Number of 64kb-banks in FxRam (Don't confuse it with SNES-Ram!!!) -NEWSYM SfxnRomBanks, dd 0 ; Number of 32kb-banks in Cart-ROM - -NEWSYM SfxvScreenHeight, dd 0 ; 128, 160 or 192 -NEWSYM SfxvScreenSize, dd 0 - -NEWSYM SfxCacheActive, dd 0 ; Cache Active - -NEWSYM SfxCarry, dd 0 ; Carry flag -NEWSYM SfxSignZero, dd 1 ; Sign and Zero flag -NEWSYM SfxB, dd 0 ; B flag (1 when with instruction executed) -NEWSYM SfxOverflow, dd 0 ; Overflow flag - -NEWSYM SfxCACHERAM, times 512 db 0 ; 512 bytes of GSU cache memory -num2writesfxreg equ $-SfxR0 -; pharos equ hack *sigh* -NEWSYM PHnum2writesfxreg, dd num2writesfxreg - -NEWSYM SfxCPB, dd 0 -NEWSYM SfxCROM, dd 0 -NEWSYM SfxRAMMem, dd 0 -NEWSYM withr15sk, dd 0 -NEWSYM sfxclineloc, dd 0 -NEWSYM SCBRrel, dd 0 -NEWSYM fxbit01pcal, dd 0 -NEWSYM fxbit23pcal, dd 0 -NEWSYM fxbit45pcal, dd 0 -NEWSYM fxbit67pcal, dd 0 - -;SfxRAM times 256*1024 db 0 - -; If we need this later... - -SECTION .text -NEWSYM FxOp00 ; STOP stop GSU execution (and maybe generate an IRQ) ; Verified. - FETCHPIPE - mov [SfxPIPE],cl - and dword [SfxSFR],0FFFFh-32 ; Clear Go flag (set to 1 when the GSU is running) - test dword [SfxCFGR],080h ; Check if the interrupt generation is on - jnz .NoIRQ - or dword [SfxSFR],08000h ; Set IRQ Flag -.NoIRQ - CLRFLAGS - inc ebp - mov eax,[NumberOfOpcodes] - add eax,0F0000000h - add [ChangeOps],eax - mov dword [NumberOfOpcodes],1 - mov dword[SFXProc],0 - xor cl,cl - ret - -NEWSYM FxOp01 ; NOP no operation ; Verified. - FETCHPIPE - CLRFLAGS - inc ebp ; Increase program counter - ret - -NEWSYM FxOp02 ; CACHE reintialize GSU cache - mov eax,ebp - FETCHPIPE - sub eax,[SfxCPB] - and eax,0FFF0h - cmp dword [SfxCBR],eax - je .SkipUpdate - cmp byte [SfxCacheActive],1 - je .SkipUpdate - mov dword [SfxCBR],eax - mov dword [SfxCacheActive],1 - call FlushCache -.SkipUpdate - CLRFLAGS - inc ebp ; Increase program counter - ret - -NEWSYM FxOp03 ; LSR logic shift right ; Verified. - mov eax,[esi] ; Read Source - FETCHPIPE - mov [SfxCarry],al - and byte[SfxCarry],1 - shr ax,1 ; logic shift right - inc ebp ; Increase program counter - mov [edi],eax ; Write Destination - mov dword [SfxSignZero],eax - CLRFLAGS - ret - -NEWSYM FxOp04 ; ROL rotate left (RCL?) ; V - shr byte[SfxCarry],1 - mov eax,[esi] ; Read Source - FETCHPIPE - rcl ax,1 - rcl byte[SfxCarry],1 - inc ebp ; Increase program counter - mov [edi],eax ; Write Destination - mov [SfxSignZero],eax - CLRFLAGS - ret - -NEWSYM FxOp05 ; BRA branch always ; Verified. - movsx eax,byte[ebp] - mov cl,[ebp+1] - inc ebp - add ebp,eax - call [FxTable+ecx*4] - ret - -NEWSYM FxOp06 ; BGE branch on greater or equals ; Verified. - movsx eax,byte[ebp] - mov ebx,[SfxSignZero] - shr ebx,15 - inc ebp - xor bl,[SfxOverflow] - mov cl,[ebp] - test bl,01h - jnz .nojump - add ebp,eax - call [FxTable+ecx*4] - ret -.nojump - inc ebp - call [FxTable+ecx*4] - ret - -NEWSYM FxOp07 ; BLT branch on lesss than ; Verified. - movsx eax,byte[ebp] - mov ebx,[SfxSignZero] - shr ebx,15 - inc ebp - xor bl,[SfxOverflow] - mov cl,[ebp] - test bl,01h - jz .nojump - add ebp,eax - call [FxTable+ecx*4] - ret -.nojump - inc ebp - call [FxTable+ecx*4] - ret - -NEWSYM FxOp08 ; BNE branch on not equal ; Verified. - movsx eax,byte[ebp] - inc ebp - test dword[SfxSignZero],0FFFFh - mov cl,[ebp] - jz .nojump - add ebp,eax - call [FxTable+ecx*4] - ret -.nojump - inc ebp - call [FxTable+ecx*4] - ret - -NEWSYM FxOp09 ; BEQ branch on equal (z=1) ; Verified. - movsx eax,byte[ebp] - inc ebp - test dword[SfxSignZero],0FFFFh - mov cl,[ebp] - jnz .nojump - add ebp,eax - call [FxTable+ecx*4] - ret -.nojump - inc ebp - call [FxTable+ecx*4] - ret - -NEWSYM FxOp0A ; BPL branch on plus ; Verified. - movsx eax,byte[ebp] - inc ebp - test dword[SfxSignZero],088000h - mov cl,[ebp] - jnz .nojump - add ebp,eax - call [FxTable+ecx*4] - ret -.nojump - inc ebp - call [FxTable+ecx*4] - ret - -NEWSYM FxOp0B ; BMI branch on minus ; Verified. - movsx eax,byte[ebp] - inc ebp - test dword[SfxSignZero],088000h - mov cl,[ebp] - jz .nojump - add ebp,eax - call [FxTable+ecx*4] - ret -.nojump - inc ebp - call [FxTable+ecx*4] - ret - -NEWSYM FxOp0C ; BCC branch on carry clear ; Verified. - movsx eax,byte[ebp] - inc ebp - test byte[SfxCarry],01h - mov cl,[ebp] - jnz .nojump - add ebp,eax - call [FxTable+ecx*4] - ret -.nojump - inc ebp - call [FxTable+ecx*4] - ret - -NEWSYM FxOp0D ; BCS branch on carry set ; Verified. - movsx eax,byte[ebp] - inc ebp - test byte[SfxCarry],01h - mov cl,[ebp] - jz .nojump - add ebp,eax - call [FxTable+ecx*4] - ret -.nojump - inc ebp - call [FxTable+ecx*4] - ret - -NEWSYM FxOp0E ; BVC branch on overflow clear ; Verified. - movsx eax,byte[ebp] - inc ebp - test byte[SfxOverflow],01h - mov cl,[ebp] - jnz .nojump - add ebp,eax - call [FxTable+ecx*4] - ret -.nojump - inc ebp - call [FxTable+ecx*4] - ret - -NEWSYM FxOp0F ; BVS branch on overflow set ; Verified. - movsx eax,byte[ebp] - inc ebp - test byte[SfxOverflow],01h - mov cl,[ebp] - jz .nojump - add ebp,eax - call [FxTable+ecx*4] - ret -.nojump - inc ebp - call [FxTable+ecx*4] - ret - -NEWSYM FxOp10 ; TO RN set register n as destination register - TORN 0 -NEWSYM FxOp11 ; TO RN set register n as destination register - TORN 1 -NEWSYM FxOp12 ; TO RN set register n as destination register - TORN 2 -NEWSYM FxOp13 ; TO RN set register n as destination register - TORN 3 -NEWSYM FxOp14 ; TO RN set register n as destination register - TORN 4 -NEWSYM FxOp15 ; TO RN set register n as destination register - TORN 5 -NEWSYM FxOp16 ; TO RN set register n as destination register - TORN 6 -NEWSYM FxOp17 ; TO RN set register n as destination register - TORN 7 -NEWSYM FxOp18 ; TO RN set register n as destination register - TORN 8 -NEWSYM FxOp19 ; TO RN set register n as destination register - TORN 9 -NEWSYM FxOp1A ; TO RN set register n as destination register - TORN 10 -NEWSYM FxOp1B ; TO RN set register n as destination register - TORN 11 -NEWSYM FxOp1C ; TO RN set register n as destination register - TORN 12 -NEWSYM FxOp1D ; TO RN set register n as destination register - TORN 13 -NEWSYM FxOp1E ; TO RN set register n as destination register - FETCHPIPE - mov edi,SfxR0+14*4 - inc ebp - call [FxTable+ecx*4] - mov edi,SfxR0 - UpdateR14 - ret -NEWSYM FxOp1F ; TO RN set register n as destination register - FETCHPIPE - mov edi,SfxR0+15*4 - inc ebp - call [FxTable+ecx*4] - mov ebp,[SfxCPB] - add ebp,[SfxR15] - mov edi,SfxR0 - ret - -NEWSYM FxOp20 ; WITH set register n as source and destination register - WITH 0 -NEWSYM FxOp21 ; WITH set register n as source and destination register - WITH 1 -NEWSYM FxOp22 ; WITH set register n as source and destination register - WITH 2 -NEWSYM FxOp23 ; WITH set register n as source and destination register - WITH 3 -NEWSYM FxOp24 ; WITH set register n as source and destination register - WITH 4 -NEWSYM FxOp25 ; WITH set register n as source and destination register - WITH 5 -NEWSYM FxOp26 ; WITH set register n as source and destination register - WITH 6 -NEWSYM FxOp27 ; WITH set register n as source and destination register - WITH 7 -NEWSYM FxOp28 ; WITH set register n as source and destination register - WITH 8 -NEWSYM FxOp29 ; WITH set register n as source and destination register - WITH 9 -NEWSYM FxOp2A ; WITH set register n as source and destination register - WITH 10 -NEWSYM FxOp2B ; WITH set register n as source and destination register - WITH 11 -NEWSYM FxOp2C ; WITH set register n as source and destination register - WITH 12 -NEWSYM FxOp2D ; WITH set register n as source and destination register - WITH 13 -NEWSYM FxOp2E ; WITH set register n as source and destination register - FETCHPIPE - mov esi,SfxR0+14*4 - mov edi,SfxR0+14*4 - mov dword [SfxB],1 - inc ebp - call [FxTablec+ecx*4] - mov dword [SfxB],0 ; Clear B Flag - mov esi,SfxR0 - mov edi,SfxR0 - UpdateR14 - ret -NEWSYM FxOp2F ; WITH set register n as source and destination register - FETCHPIPE - mov esi,SfxR0+15*4 - mov edi,SfxR0+15*4 - mov dword [SfxB],1 - inc ebp - mov eax,ebp - sub eax,[SfxCPB] - mov dword[withr15sk],0 - mov [SfxR15],eax - call [FxTableb+ecx*4] - cmp dword[withr15sk],1 - je .skip - mov ebp,[SfxCPB] - add ebp,[SfxR15] -.skip - mov dword [SfxB],0 ; Clear B Flag - mov esi,SfxR0 - mov edi,SfxR0 - ret - -NEWSYM FxOp30 ; STW RN store word - STWRN 0 -NEWSYM FxOp31 ; STW RN store word - STWRN 1 -NEWSYM FxOp32 ; STW RN store word - STWRN 2 -NEWSYM FxOp33 ; STW RN store word - STWRN 3 -NEWSYM FxOp34 ; STW RN store word - STWRN 4 -NEWSYM FxOp35 ; STW RN store word - STWRN 5 -NEWSYM FxOp36 ; STW RN store word - STWRN 6 -NEWSYM FxOp37 ; STW RN store word - STWRN 7 -NEWSYM FxOp38 ; STW RN store word - STWRN 8 -NEWSYM FxOp39 ; STW RN store word - STWRN 9 -NEWSYM FxOp3A ; STW RN store word - STWRN 10 -NEWSYM FxOp3B ; STW RN store word - STWRN 11 - -NEWSYM FxOp30A1 ; STB RN store byte - STBRN 0 -NEWSYM FxOp31A1 ; STB RN store byte - STBRN 1 -NEWSYM FxOp32A1 ; STB RN store byte - STBRN 2 -NEWSYM FxOp33A1 ; STB RN store byte - STBRN 3 -NEWSYM FxOp34A1 ; STB RN store byte - STBRN 4 -NEWSYM FxOp35A1 ; STB RN store byte - STBRN 5 -NEWSYM FxOp36A1 ; STB RN store byte - STBRN 6 -NEWSYM FxOp37A1 ; STB RN store byte - STBRN 7 -NEWSYM FxOp38A1 ; STB RN store byte - STBRN 8 -NEWSYM FxOp39A1 ; STB RN store byte - STBRN 9 -NEWSYM FxOp3AA1 ; STB RN store byte - STBRN 10 -NEWSYM FxOp3BA1 ; STB RN store byte - STBRN 11 - -NEWSYM FxOp3C ; LOOP decrement loop counter, and branch on not zero ; V - dec word [SfxR12] ; decrement loop counter - FETCHPIPE - mov eax,[SfxR12] - mov [SfxSignZero],eax - or eax,eax - jz .NoBranch - mov eax,dword [SfxR13] - mov ebp,[SfxCPB] - add ebp,eax - CLRFLAGS - ret -.NoBranch - inc ebp - CLRFLAGS - ret - -NEWSYM FxOp3D ; ALT1 set alt1 mode ; Verified. - FETCHPIPE - mov dword [SfxB],0 - or ch,01h - inc ebp - call [FxTable+ecx*4] - xor ch,ch - ret - -NEWSYM FxOp3E ; ALT2 set alt1 mode ; Verified. - FETCHPIPE - mov dword [SfxB],0 - or ch,02h - inc ebp - call [FxTable+ecx*4] - xor ch,ch - ret - -NEWSYM FxOp3F ; ALT3 set alt3 mode ; Verified. - FETCHPIPE - mov dword [SfxB],0 - or ch,03h - inc ebp - call [FxTable+ecx*4] - xor ch,ch - ret - -NEWSYM FxOp40 ; LDW RN load word from RAM - LDWRN 0 -NEWSYM FxOp41 ; LDW RN load word from RAM - LDWRN 1 -NEWSYM FxOp42 ; LDW RN load word from RAM - LDWRN 2 -NEWSYM FxOp43 ; LDW RN load word from RAM - LDWRN 3 -NEWSYM FxOp44 ; LDW RN load word from RAM - LDWRN 4 -NEWSYM FxOp45 ; LDW RN load word from RAM - LDWRN 5 -NEWSYM FxOp46 ; LDW RN load word from RAM - LDWRN 6 -NEWSYM FxOp47 ; LDW RN load word from RAM - LDWRN 7 -NEWSYM FxOp48 ; LDW RN load word from RAM - LDWRN 8 -NEWSYM FxOp49 ; LDW RN load word from RAM - LDWRN 9 -NEWSYM FxOp4A ; LDW RN load word from RAM - LDWRN 10 -NEWSYM FxOp4B ; LDW RN load word from RAM - LDWRN 11 - -NEWSYM FxOp40A1 ; LDB RN load byte from RAM - LDBRN 0 -NEWSYM FxOp41A1 ; LDB RN load byte from RAM - LDBRN 1 -NEWSYM FxOp42A1 ; LDB RN load byte from RAM - LDBRN 2 -NEWSYM FxOp43A1 ; LDB RN load byte from RAM - LDBRN 3 -NEWSYM FxOp44A1 ; LDB RN load byte from RAM - LDBRN 4 -NEWSYM FxOp45A1 ; LDB RN load byte from RAM - LDBRN 5 -NEWSYM FxOp46A1 ; LDB RN load byte from RAM - LDBRN 6 -NEWSYM FxOp47A1 ; LDB RN load byte from RAM - LDBRN 7 -NEWSYM FxOp48A1 ; LDB RN load byte from RAM - LDBRN 8 -NEWSYM FxOp49A1 ; LDB RN load byte from RAM - LDBRN 9 -NEWSYM FxOp4AA1 ; LDB RN load byte from RAM - LDBRN 10 -NEWSYM FxOp4BA1 ; LDB RN load byte from RAM - LDBRN 11 - -NEWSYM FxOp4C1284b ; PLOT 4bit - plotlines4b plotb -NEWSYM FxOp4C1284bz ; PLOT 4bit, zero check - plotlines4b plotbz -NEWSYM FxOp4C1284bd ; PLOT 4bit, dither - plotlines4b plotbd -NEWSYM FxOp4C1284bzd ; PLOT 4bit, zero check + dither - plotlines4b plotbzd - -NEWSYM FxOp4C1282b ; PLOT 2bit - plotlines2b plotb -NEWSYM FxOp4C1282bz ; PLOT 2bit, zero check - plotlines2b plotbz -NEWSYM FxOp4C1282bd ; PLOT 2bit, dither - plotlines2b plotbd -NEWSYM FxOp4C1282bzd ; PLOT 2bit, zero check + dither - plotlines2b plotbzd - -NEWSYM FxOp4C1288b ; PLOT 8bit - plotlines8b plotb -NEWSYM FxOp4C1288bz ; PLOT 8bit, zero check - plotlines8b plotbz -NEWSYM FxOp4C1288bd ; PLOT 8bit, dither - plotlines8b plotbd -NEWSYM FxOp4C1288bzd ; PLOT 8bit, zero check + dither - plotlines8b plotbzd - -NEWSYM FxOp4C1288bl ; PLOT 8bit - plotlines8bl plotb -NEWSYM FxOp4C1288bzl ; PLOT 8bit, zero check - plotlines8bl plotbz -NEWSYM FxOp4C1288bdl ; PLOT 8bit, dither - plotlines8bl plotbd -NEWSYM FxOp4C1288bzdl ; PLOT 8bit, zero check + dither - plotlines8bl plotbzd - -NEWSYM FxOp4C ; PLOT plot pixel with R1,R2 as x,y and the color register as the color - jmp FxOp4C1284b - FETCHPIPE - inc ebp - CLRFLAGS - mov ebx,[SfxR2] - mov bh,[SfxR1] - mov eax,[sfxclineloc] - mov ebx,[eax+ebx*4] - cmp ebx,0FFFFFFFFh - je near .nodraw - xor eax,eax - ; bits 5/2 : 00 = 128 pixels, 01 = 160 pixels, 10 = 192 pixels, 11 = obj - ; bits 1/0 : 00 = 4 color, 01 = 16-color, 10 = not used, 11 = 256 color - ; 192 pixels = 24 tiles, 160 pixels = 20 tiles, 128 pixels = 16 tiles - ; 16+8(4/3) 16+4(4/2) 16(4/0) - push ecx - mov al,[SfxSCMR] - and al,00000011b ; 4 + 32 - cmp al,0 - je near .colors4 - cmp al,3 - je near .colors256 - - shl ebx,5 ; x32 (16 colors) - mov al,[SfxSCBR] - shl eax,10 ; Get SFX address - add eax,ebx - add eax,[sfxramdata] - mov ebx,[SfxR2] - and ebx,07h - shl ebx,1 - add eax,ebx - mov cl,[SfxR1] - and cl,07h - xor cl,07h - mov bl,1 - shl bl,cl - mov bh,bl - xor bh,0FFh - pop ecx - test byte[SfxPOR],01h - jnz .nozerocheck_16 - test byte[SfxCOLR],0Fh - jz .nodraw -.nozerocheck_16 - mov dl,[SfxCOLR] - test byte[SfxPOR],02h - jz .nodither4b - mov dh,[SfxR1] - xor dh,[SfxR2] - test dh,01h - jz .nodither4b - shr dh,4 -.nodither4b - and byte[eax],bh - and byte[eax+1],bh - and byte[eax+16],bh - and byte[eax+17],bh - test dl,01h - jz .nodraw_16 - or byte[eax], bl -.nodraw_16 - test dl,02h - jz .nodraw2_16 - or byte[eax+1], bl -.nodraw2_16 - test dl,04h - jz .nodraw3_16 - or byte[eax+16],bl -.nodraw3_16 - test dl,08h - jz .nodraw4_16 - or byte[eax+17],bl -.nodraw4_16 -.nodraw - inc word [SfxR1] - ret - -.colors4 - shl ebx,4 ; x16 (4 colors) - mov al,[SfxSCBR] - shl eax,10 ; Get SFX address - add eax,ebx - add eax,[sfxramdata] - mov ebx,[SfxR2] - and ebx,07h - shl ebx,1 - add eax,ebx - mov cl,[SfxR1] - and cl,07h - xor cl,07h - mov bl,1 - shl bl,cl - mov bh,bl - xor bh,0FFh - pop ecx - test byte[SfxPOR],01h - jnz .nozerocheck_4 - test byte[SfxCOLR],03h - jz .noplot_4 -.nozerocheck_4 - mov dl,[SfxCOLR] - test byte[SfxPOR],02h - jz .nodither2b - mov dh,[SfxR1] - xor dh,[SfxR2] - test dh,01h - jz .nodither2b - shr dh,4 -.nodither2b - and byte[eax],bh - and byte[eax+1],bh - test dl,01h - jz .nodraw_4 - or byte[eax], bl -.nodraw_4 - test dl,02h - jz .nodraw2_4 - or byte[eax+1], bl -.nodraw2_4 -.noplot_4 - inc word [SfxR1] - ret - -.colors256 - shl ebx,6 ; x64 (256 colors) - mov al,[SfxSCBR] - shl eax,10 ; Get SFX address - add eax,ebx - add eax,[sfxramdata] - mov ebx,[SfxR2] - and ebx,07h - shl ebx,1 - add eax,ebx - mov cl,[SfxR1] - and cl,07h - xor cl,07h - mov bl,1 - shl bl,cl - mov bh,bl - xor bh,0FFh - pop ecx - test byte[SfxPOR],01h - jnz .nozerocheck_256 - mov dl,0FFh - test byte[SfxPOR],08h - jz .nozerocheckb_256 - mov dl,0Fh -.nozerocheckb_256 - test byte[SfxCOLR],dl - jz .noplot_256 -.nozerocheck_256 - mov dl,[SfxCOLR] - and byte[eax],bh - and byte[eax+1],bh - and byte[eax+16],bh - and byte[eax+17],bh - and byte[eax+32],bh - and byte[eax+33],bh - and byte[eax+48],bh - and byte[eax+49],bh - test dl,01h - jz .nodraw_256 - or byte[eax], bl -.nodraw_256 - test dl,02h - jz .nodraw2_256 - or byte[eax+1], bl -.nodraw2_256 - test dl,04h - jz .nodraw3_256 - or byte[eax+16],bl -.nodraw3_256 - test dl,08h - jz .nodraw4_256 - or byte[eax+17],bl -.nodraw4_256 - test dl,10h - jz .nodraw5_256 - or byte[eax+32], bl -.nodraw5_256 - test dl,20h - jz .nodraw6_256 - or byte[eax+33], bl -.nodraw6_256 - test dl,40h - jz .nodraw7_256 - or byte[eax+48],bl -.nodraw7_256 - test dl,80h - jz .nodraw8_256 - or byte[eax+49],bl -.nodraw8_256 -.noplot_256 - inc word [SfxR1] - ret - -SECTION .bss -.prevx resw 1 -.prevy resw 1 - -sfxwarning resb 1 - -SECTION .text - -NEWSYM FxOp4CA1 ; RPIX read color of the pixel with R1,R2 as x,y - FETCHPIPE - mov ebx,[SfxR2] - mov bh,[SfxR1] - test byte[SfxPOR],10h - jnz .objmode - mov al,[SfxSCMR] - and al,00100100b ; 4 + 32 - cmp al,4 - je .lines160 - cmp al,32 - je .lines192 - cmp al,36 - je .objmode - mov eax,[sfx128lineloc] - jmp .donelines -.lines160 - mov eax,[sfx160lineloc] - jmp .donelines -.lines192 - mov eax,[sfx192lineloc] - jmp .donelines -.objmode - mov eax,[sfxobjlineloc] -.donelines - mov ebx,[eax+ebx*4] - cmp ebx,0FFFFFFFFh - je near .nodraw - xor eax,eax - ; bits 5/2 : 00 = 128 pixels, 01 = 160 pixels, 10 = 192 pixels, 11 = obj - ; bits 1/0 : 00 = 4 color, 01 = 16-color, 10 = not used, 11 = 256 color - ; 192 pixels = 24 tiles, 160 pixels = 20 tiles, 128 pixels = 16 tiles - ; 16+8(4/3) 16+4(4/2) 16(4/0) - push ecx - mov al,[SfxSCMR] - and al,00000011b ; 4 + 32 - - cmp al,0 - je near .colors4 - cmp al,3 - je near .colors256 - - shl ebx,5 ; x32 (16 colors) - mov al,[SfxSCBR] - shl eax,10 ; Get SFX address - add eax,ebx - add eax,[sfxramdata] - mov ebx,[SfxR2] - and ebx,07h - shl ebx,1 - add eax,ebx - mov cl,[SfxR1] - and cl,07h - xor cl,07h - mov bl,1 - shl bl,cl - pop ecx - xor bh,bh - test byte[eax],bl - jz .nodraw_16 - or bh,01h -.nodraw_16 - test byte[eax+1],bl - jz .nodraw2_16 - or bh,02h -.nodraw2_16 - test byte[eax+16],bl - jz .nodraw3_16 - or bh,04h -.nodraw3_16 - test byte[eax+17],bl - jz .nodraw4_16 - or bh,08h -.nodraw4_16 -.nodraw - mov bl,bh - and ebx,0FFh - inc ebp -; UpdateR14 - CLRFLAGS - mov [edi],ebx ; Write Destination - mov [flagnz],ebx - ret - -.colors4 - shl ebx,4 ; x16 (4 colors) - mov al,[SfxSCBR] - shl eax,10 ; Get SFX address - add eax,ebx - add eax,[sfxramdata] - mov ebx,[SfxR2] - and ebx,07h - shl ebx,1 - add eax,ebx - mov cl,[SfxR1] - and cl,07h - xor cl,07h - mov bl,1 - shl bl,cl - mov bh,bl - xor bh,0FFh - pop ecx - xor bh,bh - test byte[eax],bl - jz .nodraw_4 - or bh,01h -.nodraw_4 - test byte[eax+1],bl - jz .nodraw2_4 - or bh,02h -.nodraw2_4 - mov bl,bh - and ebx,0FFh - inc ebp -; UpdateR14 - CLRFLAGS - mov [edi],ebx ; Write Destination - mov [flagnz],ebx - ret - -.colors256 - shl ebx,6 ; x64 (256 colors) - mov al,[SfxSCBR] - shl eax,10 ; Get SFX address - add eax,ebx - add eax,[sfxramdata] - mov ebx,[SfxR2] - and ebx,07h - shl ebx,1 - add eax,ebx - mov cl,[SfxR1] - and cl,07h - xor cl,07h - mov bl,1 - shl bl,cl - mov bh,bl - xor bh,0FFh - pop ecx - xor bh,bh - test byte[eax],bl - jz .nodraw_256 - or bh,01h -.nodraw_256 - test byte[eax+1],bl - jz .nodraw2_256 - or bh,02h -.nodraw2_256 - test byte[eax+16],bl - jz .nodraw3_256 - or bh,04h -.nodraw3_256 - test byte[eax+17],bl - jz .nodraw4_256 - or bh,08h -.nodraw4_256 - test byte[eax+32],bl - jz .nodraw5_256 - or bh,10h -.nodraw5_256 - test byte[eax+33],bl - jz .nodraw6_256 - or bh,20h -.nodraw6_256 - test byte[eax+48],bl - jz .nodraw7_256 - or bh,40h -.nodraw7_256 - test byte[eax+49],bl - jz .nodraw8_256 - or bh,80h -.nodraw8_256 - mov bl,bh - and ebx,0FFh - inc ebp -; UpdateR14 - CLRFLAGS - mov [edi],ebx ; Write Destination - mov [flagnz],ebx - ret - -NEWSYM FxOp4D ; SWAP swap upper and lower byte of a register ; V - mov eax,[esi] ; Read Source - FETCHPIPE - ror ax,8 - inc ebp ; Increase program counter - mov [SfxSignZero],eax - mov [edi],eax ; Write Destination - CLRFLAGS - ret - -NEWSYM FxOp4E ; COLOR copy source register to color register ; V - FETCHPIPE - mov eax,[esi] ; Read Source - ; if bit 3 of SfxPOR is set, then don't modify the upper 4 bits - test byte[SfxPOR],04h - jz .nohighnibble - mov bl,al - shr bl,4 - and al,0F0h - or al,bl -.nohighnibble - test byte[SfxPOR],08h - jnz .preserveupper - cmp [SfxCOLR],al - je .nocolchange - mov [SfxCOLR],al - and eax,0FFh - mov ebx,[fxbit01+eax*4] - mov [fxbit01pcal],ebx - mov ebx,[fxbit23+eax*4] - mov [fxbit23pcal],ebx - mov ebx,[fxbit45+eax*4] - mov [fxbit45pcal],ebx - mov ebx,[fxbit67+eax*4] - mov [fxbit67pcal],ebx -.nocolchange - CLRFLAGS - inc ebp ; Increase program counter - ret -.preserveupper - mov bl,[SfxCOLR] - and al,0Fh - and bl,0F0h - or al,bl - cmp [SfxCOLR],al - je .nocolchange - mov [SfxCOLR],al - and eax,0FFh - mov ebx,[fxbit01+eax*4] - mov [fxbit01pcal],ebx - mov ebx,[fxbit23+eax*4] - mov [fxbit23pcal],ebx - mov ebx,[fxbit45+eax*4] - mov [fxbit45pcal],ebx - mov ebx,[fxbit67+eax*4] - mov [fxbit67pcal],ebx - CLRFLAGS - inc ebp ; Increase program counter - ret - -NEWSYM FxOp4EA1 ; CMODE set plot option register ; V - FETCHPIPE - mov eax,[esi] ; Read Source - inc ebp ; Increase program counter - mov dword [SfxPOR],eax - - test byte[SfxPOR],10h - jnz .objmode - mov al,[SfxSCMR] - and al,00100100b ; 4 + 32 - cmp al,4 - je .lines160 - cmp al,32 - je .lines192 - cmp al,36 - je .objmode - mov eax,[sfx128lineloc] - jmp .donelines -.lines160 - mov eax,[sfx160lineloc] - jmp .donelines -.lines192 - mov eax,[sfx192lineloc] - jmp .donelines -.objmode - mov eax,[sfxobjlineloc] -.donelines - mov [sfxclineloc],eax - - - push ebx - mov al,[SfxSCMR] - and eax,00000011b - mov bl,[SfxPOR] - and bl,0Fh - shl bl,2 - or al,bl - mov ebx,[PLOTJmpb+eax*4] - mov eax,[PLOTJmpa+eax*4] - mov dword [FxTable+4Ch*4],eax - mov dword [FxTableb+4Ch*4],eax - mov dword [FxTablec+4Ch*4],eax - mov dword [FxTabled+4Ch*4],ebx - pop ebx - - CLRFLAGS - ret - -NEWSYM FxOp4F ; NOT perform exclusive exor with 1 on all bits ; V - mov eax,[esi] ; Read Source - FETCHPIPE - xor eax,0FFFFh - inc ebp ; Increase program counter - mov [SfxSignZero],eax - mov [edi],eax ; Write Destination - CLRFLAGS - ret - -NEWSYM FxOp50 ; ADD RN add, register + register - ADDRN 0 -NEWSYM FxOp51 ; ADD RN add, register + register - ADDRN 1 -NEWSYM FxOp52 ; ADD RN add, register + register - ADDRN 2 -NEWSYM FxOp53 ; ADD RN add, register + register - ADDRN 3 -NEWSYM FxOp54 ; ADD RN add, register + register - ADDRN 4 -NEWSYM FxOp55 ; ADD RN add, register + register - ADDRN 5 -NEWSYM FxOp56 ; ADD RN add, register + register - ADDRN 6 -NEWSYM FxOp57 ; ADD RN add, register + register - ADDRN 7 -NEWSYM FxOp58 ; ADD RN add, register + register - ADDRN 8 -NEWSYM FxOp59 ; ADD RN add, register + register - ADDRN 9 -NEWSYM FxOp5A ; ADD RN add, register + register - ADDRN 10 -NEWSYM FxOp5B ; ADD RN add, register + register - ADDRN 11 -NEWSYM FxOp5C ; ADD RN add, register + register - ADDRN 12 -NEWSYM FxOp5D ; ADD RN add, register + register - ADDRN 13 -NEWSYM FxOp5E ; ADD RN add, register + register - ADDRN 14 -NEWSYM FxOp5F ; ADD RN add, register + register - FETCHPIPE - mov eax, [esi] ; Read Source - mov ebx,ebp - sub ebx,[SfxCPB] - add ax,bx - seto byte[SfxOverflow] - setc byte[SfxCarry] - mov [SfxSignZero],eax - inc ebp ; Increase program counter - mov [edi],eax ; Write Destination - CLRFLAGS - ret - -NEWSYM FxOp50A1 ; ADC RN add with carry, register + register - ADCRN 0 -NEWSYM FxOp51A1 ; ADC RN add with carry, register + register - ADCRN 1 -NEWSYM FxOp52A1 ; ADC RN add with carry, register + register - ADCRN 2 -NEWSYM FxOp53A1 ; ADC RN add with carry, register + register - ADCRN 3 -NEWSYM FxOp54A1 ; ADC RN add with carry, register + register - ADCRN 4 -NEWSYM FxOp55A1 ; ADC RN add with carry, register + register - ADCRN 5 -NEWSYM FxOp56A1 ; ADC RN add with carry, register + register - ADCRN 6 -NEWSYM FxOp57A1 ; ADC RN add with carry, register + register - ADCRN 7 -NEWSYM FxOp58A1 ; ADC RN add with carry, register + register - ADCRN 8 -NEWSYM FxOp59A1 ; ADC RN add with carry, register + register - ADCRN 9 -NEWSYM FxOp5AA1 ; ADC RN add with carry, register + register - ADCRN 10 -NEWSYM FxOp5BA1 ; ADC RN add with carry, register + register - ADCRN 11 -NEWSYM FxOp5CA1 ; ADC RN add with carry, register + register - ADCRN 12 -NEWSYM FxOp5DA1 ; ADC RN add with carry, register + register - ADCRN 13 -NEWSYM FxOp5EA1 ; ADC RN add with carry, register + register - ADCRN 14 -NEWSYM FxOp5FA1 ; ADC RN add with carry, register + register - FETCHPIPE - mov eax, [esi] ; Read Source - mov ebx,ebp - sub ebx,[SfxCPB] - shr byte[SfxCarry],1 - adc ax,bx - seto byte[SfxOverflow] - setc byte[SfxCarry] - mov [SfxSignZero],eax - inc ebp ; Increase program counter - mov [edi],eax ; Write Destination - CLRFLAGS - ret - -; Weird opcode (FxOp50A2, add 0, wow!) -NEWSYM FxOp50A2 ; ADI RN add, register + immediate - ADIRN 0 -NEWSYM FxOp51A2 ; ADI RN add, register + immediate - ADIRN 1 -NEWSYM FxOp52A2 ; ADI RN add, register + immediate - ADIRN 2 -NEWSYM FxOp53A2 ; ADI RN add, register + immediate - ADIRN 3 -NEWSYM FxOp54A2 ; ADI RN add, register + immediate - ADIRN 4 -NEWSYM FxOp55A2 ; ADI RN add, register + immediate - ADIRN 5 -NEWSYM FxOp56A2 ; ADI RN add, register + immediate - ADIRN 6 -NEWSYM FxOp57A2 ; ADI RN add, register + immediate - ADIRN 7 -NEWSYM FxOp58A2 ; ADI RN add, register + immediate - ADIRN 8 -NEWSYM FxOp59A2 ; ADI RN add, register + immediate - ADIRN 9 -NEWSYM FxOp5AA2 ; ADI RN add, register + immediate - ADIRN 10 -NEWSYM FxOp5BA2 ; ADI RN add, register + immediate - ADIRN 11 -NEWSYM FxOp5CA2 ; ADI RN add, register + immediate - ADIRN 12 -NEWSYM FxOp5DA2 ; ADI RN add, register + immediate - ADIRN 13 -NEWSYM FxOp5EA2 ; ADI RN add, register + immediate - ADIRN 14 -NEWSYM FxOp5FA2 ; ADI RN add, register + immediate - ADIRN 15 - -; Another very useful opcode -NEWSYM FxOp50A3 ; ADCIRN add with carry, register + immediate - ADCIRN 0 -NEWSYM FxOp51A3 ; ADCIRN add with carry, register + immediate - ADCIRN 1 -NEWSYM FxOp52A3 ; ADCIRN add with carry, register + immediate - ADCIRN 2 -NEWSYM FxOp53A3 ; ADCIRN add with carry, register + immediate - ADCIRN 3 -NEWSYM FxOp54A3 ; ADCIRN add with carry, register + immediate - ADCIRN 4 -NEWSYM FxOp55A3 ; ADCIRN add with carry, register + immediate - ADCIRN 5 -NEWSYM FxOp56A3 ; ADCIRN add with carry, register + immediate - ADCIRN 6 -NEWSYM FxOp57A3 ; ADCIRN add with carry, register + immediate - ADCIRN 7 -NEWSYM FxOp58A3 ; ADCIRN add with carry, register + immediate - ADCIRN 8 -NEWSYM FxOp59A3 ; ADCIRN add with carry, register + immediate - ADCIRN 9 -NEWSYM FxOp5AA3 ; ADCIRN add with carry, register + immediate - ADCIRN 10 -NEWSYM FxOp5BA3 ; ADCIRN add with carry, register + immediate - ADCIRN 11 -NEWSYM FxOp5CA3 ; ADCIRN add with carry, register + immediate - ADCIRN 12 -NEWSYM FxOp5DA3 ; ADCIRN add with carry, register + immediate - ADCIRN 13 -NEWSYM FxOp5EA3 ; ADCIRN add with carry, register + immediate - ADCIRN 14 -NEWSYM FxOp5FA3 ; ADCIRN add with carry, register + immediate - ADCIRN 15 - -NEWSYM FxOp60 ; SUBRN subtract, register - register - SUBRN 0 -NEWSYM FxOp61 ; SUBRN subtract, register - register - SUBRN 1 -NEWSYM FxOp62 ; SUBRN subtract, register - register - SUBRN 2 -NEWSYM FxOp63 ; SUBRN subtract, register - register - SUBRN 3 -NEWSYM FxOp64 ; SUBRN subtract, register - register - SUBRN 4 -NEWSYM FxOp65 ; SUBRN subtract, register - register - SUBRN 5 -NEWSYM FxOp66 ; SUBRN subtract, register - register - SUBRN 6 -NEWSYM FxOp67 ; SUBRN subtract, register - register - SUBRN 7 -NEWSYM FxOp68 ; SUBRN subtract, register - register - SUBRN 8 -NEWSYM FxOp69 ; SUBRN subtract, register - register - SUBRN 9 -NEWSYM FxOp6A ; SUBRN subtract, register - register - SUBRN 10 -NEWSYM FxOp6B ; SUBRN subtract, register - register - SUBRN 11 -NEWSYM FxOp6C ; SUBRN subtract, register - register - SUBRN 12 -NEWSYM FxOp6D ; SUBRN subtract, register - register - SUBRN 13 -NEWSYM FxOp6E ; SUBRN subtract, register - register - SUBRN 14 -NEWSYM FxOp6F ; SUBRN subtract, register - register - FETCHPIPE - mov eax,[esi] ; Read Source - mov ebx,ebp - sub ebx,[SfxCPB] - sub ax,bx - seto byte[SfxOverflow] - setc byte[SfxCarry] - xor byte[SfxCarry],1 - inc ebp ; Increase program counter - mov [edi],eax ; Write Destination - mov [SfxSignZero],eax - CLRFLAGS - ret - -NEWSYM FxOp60A1 ; SBCRN subtract with carry, register - register - SBCRN 0 -NEWSYM FxOp61A1 ; SBCRN subtract with carry, register - register - SBCRN 1 -NEWSYM FxOp62A1 ; SBCRN subtract with carry, register - register - SBCRN 2 -NEWSYM FxOp63A1 ; SBCRN subtract with carry, register - register - SBCRN 3 -NEWSYM FxOp64A1 ; SBCRN subtract with carry, register - register - SBCRN 4 -NEWSYM FxOp65A1 ; SBCRN subtract with carry, register - register - SBCRN 5 -NEWSYM FxOp66A1 ; SBCRN subtract with carry, register - register - SBCRN 6 -NEWSYM FxOp67A1 ; SBCRN subtract with carry, register - register - SBCRN 7 -NEWSYM FxOp68A1 ; SBCRN subtract with carry, register - register - SBCRN 8 -NEWSYM FxOp69A1 ; SBCRN subtract with carry, register - register - SBCRN 9 -NEWSYM FxOp6AA1 ; SBCRN subtract with carry, register - register - SBCRN 10 -NEWSYM FxOp6BA1 ; SBCRN subtract with carry, register - register - SBCRN 11 -NEWSYM FxOp6CA1 ; SBCRN subtract with carry, register - register - SBCRN 12 -NEWSYM FxOp6DA1 ; SBCRN subtract with carry, register - register - SBCRN 13 -NEWSYM FxOp6EA1 ; SBCRN subtract with carry, register - register - SBCRN 14 -NEWSYM FxOp6FA1 ; SBCRN subtract with carry, register - register - mov eax,[esi] ; Read Source - mov ebx,ebp - FETCHPIPE - sub ebx,[SfxCPB] - cmp byte[SfxCarry],1 - sbb ax,bx - seto byte[SfxOverflow] - setc byte[SfxCarry] - xor byte[SfxCarry],1 - inc ebp ; Increase program counter - mov [edi],eax ; Write Destination - mov [SfxSignZero],eax - CLRFLAGS - ret - -NEWSYM FxOp60A2 ; SUBIRN subtract, register - immediate - SUBIRN 0 -NEWSYM FxOp61A2 ; SUBIRN subtract, register - immediate - SUBIRN 1 -NEWSYM FxOp62A2 ; SUBIRN subtract, register - immediate - SUBIRN 2 -NEWSYM FxOp63A2 ; SUBIRN subtract, register - immediate - SUBIRN 3 -NEWSYM FxOp64A2 ; SUBIRN subtract, register - immediate - SUBIRN 4 -NEWSYM FxOp65A2 ; SUBIRN subtract, register - immediate - SUBIRN 5 -NEWSYM FxOp66A2 ; SUBIRN subtract, register - immediate - SUBIRN 6 -NEWSYM FxOp67A2 ; SUBIRN subtract, register - immediate - SUBIRN 7 -NEWSYM FxOp68A2 ; SUBIRN subtract, register - immediate - SUBIRN 8 -NEWSYM FxOp69A2 ; SUBIRN subtract, register - immediate - SUBIRN 9 -NEWSYM FxOp6AA2 ; SUBIRN subtract, register - immediate - SUBIRN 10 -NEWSYM FxOp6BA2 ; SUBIRN subtract, register - immediate - SUBIRN 11 -NEWSYM FxOp6CA2 ; SUBIRN subtract, register - immediate - SUBIRN 12 -NEWSYM FxOp6DA2 ; SUBIRN subtract, register - immediate - SUBIRN 13 -NEWSYM FxOp6EA2 ; SUBIRN subtract, register - immediate - SUBIRN 14 -NEWSYM FxOp6FA2 ; SUBIRN subtract, register - immediate - SUBIRN 15 - -NEWSYM FxOp60A3 ; CMPRN compare, register, register - CMPRN 0 -NEWSYM FxOp61A3 ; CMPRN compare, register, register - CMPRN 1 -NEWSYM FxOp62A3 ; CMPRN compare, register, register - CMPRN 2 -NEWSYM FxOp63A3 ; CMPRN compare, register, register - CMPRN 3 -NEWSYM FxOp64A3 ; CMPRN compare, register, register - CMPRN 4 -NEWSYM FxOp65A3 ; CMPRN compare, register, register - CMPRN 5 -NEWSYM FxOp66A3 ; CMPRN compare, register, register - CMPRN 6 -NEWSYM FxOp67A3 ; CMPRN compare, register, register - CMPRN 7 -NEWSYM FxOp68A3 ; CMPRN compare, register, register - CMPRN 8 -NEWSYM FxOp69A3 ; CMPRN compare, register, register - CMPRN 9 -NEWSYM FxOp6AA3 ; CMPRN compare, register, register - CMPRN 10 -NEWSYM FxOp6BA3 ; CMPRN compare, register, register - CMPRN 11 -NEWSYM FxOp6CA3 ; CMPRN compare, register, register - CMPRN 12 -NEWSYM FxOp6DA3 ; CMPRN compare, register, register - CMPRN 13 -NEWSYM FxOp6EA3 ; CMPRN compare, register, register - CMPRN 14 -NEWSYM FxOp6FA3 ; CMPRN compare, register, register - FETCHPIPE - mov eax,[esi] ; Read Source - mov ebx,ebp - sub ebx,[SfxCPB] - sub ax,bx - seto byte[SfxOverflow] - setc byte[SfxCarry] - xor byte[SfxCarry],1 - mov [SfxSignZero],eax - CLRFLAGS - inc ebp ; Increase program counter - ret - -NEWSYM FxOp70 ; MERGE R7 as upper byte, R8 as lower byte (used for texture-mapping) */ - ; V - xor eax,eax - FETCHPIPE - mov ah,byte [SfxR7+1] - mov al,byte [SfxR8+1] - inc ebp - mov [edi],eax ; Write Destination - mov dword[SfxSignZero],0001h - test eax,0F0F0h - jz .nozero - mov dword[SfxSignZero],0000h -.nozero - test eax,08080h - jz .nosign - or dword [SfxSignZero],80000h -.nosign - mov dword [SfxOverflow],1 - test ax,0c0c0h - jnz .Overflow - mov dword [SfxOverflow],0 -.Overflow - mov dword [SfxCarry],1 - test ax,0e0e0h - jnz .Carry - mov dword [SfxCarry],0 -.Carry - CLRFLAGS - ret - -NEWSYM FxOp71 ; AND RN register & register - ANDRN 1 -NEWSYM FxOp72 ; AND RN register & register - ANDRN 2 -NEWSYM FxOp73 ; AND RN register & register - ANDRN 3 -NEWSYM FxOp74 ; AND RN register & register - ANDRN 4 -NEWSYM FxOp75 ; AND RN register & register - ANDRN 5 -NEWSYM FxOp76 ; AND RN register & register - ANDRN 6 -NEWSYM FxOp77 ; AND RN register & register - ANDRN 7 -NEWSYM FxOp78 ; AND RN register & register - ANDRN 8 -NEWSYM FxOp79 ; AND RN register & register - ANDRN 9 -NEWSYM FxOp7A ; AND RN register & register - ANDRN 10 -NEWSYM FxOp7B ; AND RN register & register - ANDRN 11 -NEWSYM FxOp7C ; AND RN register & register - ANDRN 12 -NEWSYM FxOp7D ; AND RN register & register - ANDRN 13 -NEWSYM FxOp7E ; AND RN register & register - ANDRN 14 -NEWSYM FxOp7F ; AND RN register & register - FETCHPIPE - mov eax,[esi] ; Read Source - mov ebx,ebp - sub ebx,[SfxCPB] - and eax,ebx - inc ebp - mov dword [SfxSignZero],eax - mov [edi],eax ; Write Destination - CLRFLAGS - ret - -NEWSYM FxOp71A1 ; BIC RN register & ~register - BICRN 1 -NEWSYM FxOp72A1 ; BIC RN register & ~register - BICRN 2 -NEWSYM FxOp73A1 ; BIC RN register & ~register - BICRN 3 -NEWSYM FxOp74A1 ; BIC RN register & ~register - BICRN 4 -NEWSYM FxOp75A1 ; BIC RN register & ~register - BICRN 5 -NEWSYM FxOp76A1 ; BIC RN register & ~register - BICRN 6 -NEWSYM FxOp77A1 ; BIC RN register & ~register - BICRN 7 -NEWSYM FxOp78A1 ; BIC RN register & ~register - BICRN 8 -NEWSYM FxOp79A1 ; BIC RN register & ~register - BICRN 9 -NEWSYM FxOp7AA1 ; BIC RN register & ~register - BICRN 10 -NEWSYM FxOp7BA1 ; BIC RN register & ~register - BICRN 11 -NEWSYM FxOp7CA1 ; BIC RN register & ~register - BICRN 12 -NEWSYM FxOp7DA1 ; BIC RN register & ~register - BICRN 13 -NEWSYM FxOp7EA1 ; BIC RN register & ~register - BICRN 14 -NEWSYM FxOp7FA1 ; BIC RN register & ~register - FETCHPIPE - mov ebx,ebp - sub ebx,[SfxCPB] - mov eax,[esi] ; Read Source - xor ebx,0FFFFh - and eax,ebx - inc ebp - mov dword [SfxSignZero],eax - mov [edi],eax ; Write Destination - CLRFLAGS - ret - -NEWSYM FxOp71A2 ; ANDIRN and #n - register & immediate - ANDIRN 1 -NEWSYM FxOp72A2 ; ANDIRN and #n - register & immediate - ANDIRN 2 -NEWSYM FxOp73A2 ; ANDIRN and #n - register & immediate - ANDIRN 3 -NEWSYM FxOp74A2 ; ANDIRN and #n - register & immediate - ANDIRN 4 -NEWSYM FxOp75A2 ; ANDIRN and #n - register & immediate - ANDIRN 5 -NEWSYM FxOp76A2 ; ANDIRN and #n - register & immediate - ANDIRN 6 -NEWSYM FxOp77A2 ; ANDIRN and #n - register & immediate - ANDIRN 7 -NEWSYM FxOp78A2 ; ANDIRN and #n - register & immediate - ANDIRN 8 -NEWSYM FxOp79A2 ; ANDIRN and #n - register & immediate - ANDIRN 9 -NEWSYM FxOp7AA2 ; ANDIRN and #n - register & immediate - ANDIRN 10 -NEWSYM FxOp7BA2 ; ANDIRN and #n - register & immediate - ANDIRN 11 -NEWSYM FxOp7CA2 ; ANDIRN and #n - register & immediate - ANDIRN 12 -NEWSYM FxOp7DA2 ; ANDIRN and #n - register & immediate - ANDIRN 13 -NEWSYM FxOp7EA2 ; ANDIRN and #n - register & immediate - ANDIRN 14 -NEWSYM FxOp7FA2 ; ANDIRN and #n - register & immediate - ANDIRN 15 - -NEWSYM FxOp71A3 ; BICIRN register & ~immediate - BICIRN 1 ^ 0FFFFh -NEWSYM FxOp72A3 ; BICIRN register & ~immediate - BICIRN 2 ^ 0FFFFh -NEWSYM FxOp73A3 ; BICIRN register & ~immediate - BICIRN 3 ^ 0FFFFh -NEWSYM FxOp74A3 ; BICIRN register & ~immediate - BICIRN 4 ^ 0FFFFh -NEWSYM FxOp75A3 ; BICIRN register & ~immediate - BICIRN 5 ^ 0FFFFh -NEWSYM FxOp76A3 ; BICIRN register & ~immediate - BICIRN 6 ^ 0FFFFh -NEWSYM FxOp77A3 ; BICIRN register & ~immediate - BICIRN 7 ^ 0FFFFh -NEWSYM FxOp78A3 ; BICIRN register & ~immediate - BICIRN 8 ^ 0FFFFh -NEWSYM FxOp79A3 ; BICIRN register & ~immediate - BICIRN 9 ^ 0FFFFh -NEWSYM FxOp7AA3 ; BICIRN register & ~immediate - BICIRN 10 ^ 0FFFFh -NEWSYM FxOp7BA3 ; BICIRN register & ~immediate - BICIRN 11 ^ 0FFFFh -NEWSYM FxOp7CA3 ; BICIRN register & ~immediate - BICIRN 12 ^ 0FFFFh -NEWSYM FxOp7DA3 ; BICIRN register & ~immediate - BICIRN 13 ^ 0FFFFh -NEWSYM FxOp7EA3 ; BICIRN register & ~immediate - BICIRN 14 ^ 0FFFFh -NEWSYM FxOp7FA3 ; BICIRN register & ~immediate - BICIRN 15 ^ 0FFFFh - -NEWSYM FxOp80 ; MULTRN 8 bit to 16 bit signed multiply, register * register - MULTRN 0 -NEWSYM FxOp81 ; MULTRN 8 bit to 16 bit signed multiply, register * register - MULTRN 1 -NEWSYM FxOp82 ; MULTRN 8 bit to 16 bit signed multiply, register * register - MULTRN 2 -NEWSYM FxOp83 ; MULTRN 8 bit to 16 bit signed multiply, register * register - MULTRN 3 -NEWSYM FxOp84 ; MULTRN 8 bit to 16 bit signed multiply, register * register - MULTRN 4 -NEWSYM FxOp85 ; MULTRN 8 bit to 16 bit signed multiply, register * register - MULTRN 5 -NEWSYM FxOp86 ; MULTRN 8 bit to 16 bit signed multiply, register * register - MULTRN 6 -NEWSYM FxOp87 ; MULTRN 8 bit to 16 bit signed multiply, register * register - MULTRN 7 -NEWSYM FxOp88 ; MULTRN 8 bit to 16 bit signed multiply, register * register - MULTRN 8 -NEWSYM FxOp89 ; MULTRN 8 bit to 16 bit signed multiply, register * register - MULTRN 9 -NEWSYM FxOp8A ; MULTRN 8 bit to 16 bit signed multiply, register * register - MULTRN 10 -NEWSYM FxOp8B ; MULTRN 8 bit to 16 bit signed multiply, register * register - MULTRN 11 -NEWSYM FxOp8C ; MULTRN 8 bit to 16 bit signed multiply, register * register - MULTRN 12 -NEWSYM FxOp8D ; MULTRN 8 bit to 16 bit signed multiply, register * register - MULTRN 13 -NEWSYM FxOp8E ; MULTRN 8 bit to 16 bit signed multiply, register * register - MULTRN 14 -NEWSYM FxOp8F ; MULTRN 8 bit to 16 bit signed multiply, register * register - FETCHPIPE - mov ebx,ebp - mov al,byte [esi] ; Read Source - sub ebx,[SfxCPB] - imul bl - inc ebp - and eax,0FFFFh - mov [SfxSignZero],eax - mov [edi],eax ; Write Destination - CLRFLAGS - ret - -NEWSYM FxOp80A1 ; UMULRN 8 bit to 16 bit unsigned multiply, register * register - UMULTRN 0 -NEWSYM FxOp81A1 ; UMULRN 8 bit to 16 bit unsigned multiply, register * register - UMULTRN 1 -NEWSYM FxOp82A1 ; UMULRN 8 bit to 16 bit unsigned multiply, register * register - UMULTRN 2 -NEWSYM FxOp83A1 ; UMULRN 8 bit to 16 bit unsigned multiply, register * register - UMULTRN 3 -NEWSYM FxOp84A1 ; UMULRN 8 bit to 16 bit unsigned multiply, register * register - UMULTRN 4 -NEWSYM FxOp85A1 ; UMULRN 8 bit to 16 bit unsigned multiply, register * register - UMULTRN 5 -NEWSYM FxOp86A1 ; UMULRN 8 bit to 16 bit unsigned multiply, register * register - UMULTRN 6 -NEWSYM FxOp87A1 ; UMULRN 8 bit to 16 bit unsigned multiply, register * register - UMULTRN 7 -NEWSYM FxOp88A1 ; UMULRN 8 bit to 16 bit unsigned multiply, register * register - UMULTRN 8 -NEWSYM FxOp89A1 ; UMULRN 8 bit to 16 bit unsigned multiply, register * register - UMULTRN 9 -NEWSYM FxOp8AA1 ; UMULRN 8 bit to 16 bit unsigned multiply, register * register - UMULTRN 10 -NEWSYM FxOp8BA1 ; UMULRN 8 bit to 16 bit unsigned multiply, register * register - UMULTRN 11 -NEWSYM FxOp8CA1 ; UMULRN 8 bit to 16 bit unsigned multiply, register * register - UMULTRN 12 -NEWSYM FxOp8DA1 ; UMULRN 8 bit to 16 bit unsigned multiply, register * register - UMULTRN 13 -NEWSYM FxOp8EA1 ; UMULRN 8 bit to 16 bit unsigned multiply, register * register - UMULTRN 14 -NEWSYM FxOp8FA1 ; UMULRN 8 bit to 16 bit unsigned multiply, register * register - FETCHPIPE - mov ebx,ebp - mov al,byte [esi] ; Read Source - sub ebx,[SfxCPB] - mul bl - inc ebp - and eax,0FFFFh - mov [SfxSignZero],eax - mov [edi],eax ; Write Destination - CLRFLAGS - ret - -NEWSYM FxOp80A2 ; MULIRN 8 bit to 16 bit signed multiply, register * immediate - MULTIRN 0 -NEWSYM FxOp81A2 ; MULIRN 8 bit to 16 bit signed multiply, register * immediate - MULTIRN 1 -NEWSYM FxOp82A2 ; MULIRN 8 bit to 16 bit signed multiply, register * immediate - MULTIRN 2 -NEWSYM FxOp83A2 ; MULIRN 8 bit to 16 bit signed multiply, register * immediate - MULTIRN 3 -NEWSYM FxOp84A2 ; MULIRN 8 bit to 16 bit signed multiply, register * immediate - MULTIRN 4 -NEWSYM FxOp85A2 ; MULIRN 8 bit to 16 bit signed multiply, register * immediate - MULTIRN 5 -NEWSYM FxOp86A2 ; MULIRN 8 bit to 16 bit signed multiply, register * immediate - MULTIRN 6 -NEWSYM FxOp87A2 ; MULIRN 8 bit to 16 bit signed multiply, register * immediate - MULTIRN 7 -NEWSYM FxOp88A2 ; MULIRN 8 bit to 16 bit signed multiply, register * immediate - MULTIRN 8 -NEWSYM FxOp89A2 ; MULIRN 8 bit to 16 bit signed multiply, register * immediate - MULTIRN 9 -NEWSYM FxOp8AA2 ; MULIRN 8 bit to 16 bit signed multiply, register * immediate - MULTIRN 10 -NEWSYM FxOp8BA2 ; MULIRN 8 bit to 16 bit signed multiply, register * immediate - MULTIRN 11 -NEWSYM FxOp8CA2 ; MULIRN 8 bit to 16 bit signed multiply, register * immediate - MULTIRN 12 -NEWSYM FxOp8DA2 ; MULIRN 8 bit to 16 bit signed multiply, register * immediate - MULTIRN 13 -NEWSYM FxOp8EA2 ; MULIRN 8 bit to 16 bit signed multiply, register * immediate - MULTIRN 14 -NEWSYM FxOp8FA2 ; MULIRN 8 bit to 16 bit signed multiply, register * immediate - MULTIRN 15 - -NEWSYM FxOp80A3 ;UMULIRN 8 bit to 16 bit unsigned multiply, register * immediate - UMULTIRN 0 -NEWSYM FxOp81A3 ;UMULIRN 8 bit to 16 bit unsigned multiply, register * immediate - UMULTIRN 1 -NEWSYM FxOp82A3 ;UMULIRN 8 bit to 16 bit unsigned multiply, register * immediate - UMULTIRN 2 -NEWSYM FxOp83A3 ;UMULIRN 8 bit to 16 bit unsigned multiply, register * immediate - UMULTIRN 3 -NEWSYM FxOp84A3 ;UMULIRN 8 bit to 16 bit unsigned multiply, register * immediate - UMULTIRN 4 -NEWSYM FxOp85A3 ;UMULIRN 8 bit to 16 bit unsigned multiply, register * immediate - UMULTIRN 5 -NEWSYM FxOp86A3 ;UMULIRN 8 bit to 16 bit unsigned multiply, register * immediate - UMULTIRN 6 -NEWSYM FxOp87A3 ;UMULIRN 8 bit to 16 bit unsigned multiply, register * immediate - UMULTIRN 7 -NEWSYM FxOp88A3 ;UMULIRN 8 bit to 16 bit unsigned multiply, register * immediate - UMULTIRN 8 -NEWSYM FxOp89A3 ;UMULIRN 8 bit to 16 bit unsigned multiply, register * immediate - UMULTIRN 9 -NEWSYM FxOp8AA3 ;UMULIRN 8 bit to 16 bit unsigned multiply, register * immediate - UMULTIRN 10 -NEWSYM FxOp8BA3 ;UMULIRN 8 bit to 16 bit unsigned multiply, register * immediate - UMULTIRN 11 -NEWSYM FxOp8CA3 ;UMULIRN 8 bit to 16 bit unsigned multiply, register * immediate - UMULTIRN 12 -NEWSYM FxOp8DA3 ;UMULIRN 8 bit to 16 bit unsigned multiply, register * immediate - UMULTIRN 13 -NEWSYM FxOp8EA3 ;UMULIRN 8 bit to 16 bit unsigned multiply, register * immediate - UMULTIRN 14 -NEWSYM FxOp8FA3 ;UMULIRN 8 bit to 16 bit unsigned multiply, register * immediate - UMULTIRN 15 - -NEWSYM FxOp90 ; SBK store word to last accessed RAM address ; V - mov ebx,[SfxLastRamAdr] ; Load last ram address - mov eax,[esi] ; Read Source - FETCHPIPE - mov [ebx],al ; Store Word - sub ebx,[SfxRAMMem] - xor ebx,1 - add ebx,[SfxRAMMem] - inc ebp ; Increase program counter - mov [ebx],ah ; Store Word - CLRFLAGS - ret - -NEWSYM FxOp91 ; LINK#n R11 = R15 + immediate - LINK 1 -NEWSYM FxOp92 ; LINK#n R11 = R15 + immediate - LINK 2 -NEWSYM FxOp93 ; LINK#n R11 = R15 + immediate - LINK 3 -NEWSYM FxOp94 ; LINK#n R11 = R15 + immediate - LINK 4 - -NEWSYM FxOp95 ; SEX sign extend 8 bit to 16 bit ; V - movsx eax, byte [esi] ; Read Source - FETCHPIPE - and eax,0FFFFh - inc ebp - mov [edi],eax ; Write Destination - mov [SfxSignZero],eax - CLRFLAGS - ret - -NEWSYM FxOp96 ; ASR aritmethic shift right by one ; V - mov eax,[esi] ; Read Source - FETCHPIPE - mov [SfxCarry],al - and byte[SfxCarry],1 - sar ax,1 ; logic shift right - inc ebp ; Increase program counter - mov [edi],eax ; Write Destination - mov dword [SfxSignZero],eax - CLRFLAGS - ret - -NEWSYM FxOp96A1 ; DIV2 aritmethic shift right by one ; V - mov eax,[esi] ; Read Source - FETCHPIPE - cmp ax,-1 - je .minusone - mov [SfxCarry],al - and byte[SfxCarry],1 - sar ax,1 ; logic shift right - inc ebp ; Increase program counter - mov [edi],eax ; Write Destination - mov dword [SfxSignZero],eax - CLRFLAGS - ret -.minusone - mov byte[SfxCarry],1 - xor eax,eax - inc ebp ; Increase program counter - mov [edi],eax ; Write Destination - mov dword [SfxSignZero],eax - CLRFLAGS - ret - -NEWSYM FxOp97 ; ROR rotate right by one ; V - FETCHPIPE - mov eax,[esi] ; Read Source - shr byte[SfxCarry],1 - rcr ax,1 - setc byte[SfxCarry] - inc ebp ; Increase program counter - mov [edi],eax ; Write Destination - mov [SfxSignZero],eax - CLRFLAGS - ret - -NEWSYM FxOp98 ; JMPRN jump to address of register - JMPRN 8 -NEWSYM FxOp99 ; JMPRN jump to address of register - JMPRN 9 -NEWSYM FxOp9A ; JMPRN jump to address of register - JMPRN 10 -NEWSYM FxOp9B ; JMPRN jump to address of register - JMPRN 11 -NEWSYM FxOp9C ; JMPRN jump to address of register - JMPRN 12 -NEWSYM FxOp9D ; JMPRN jump to address of register - JMPRN 13 - -NEWSYM FxOp98A1 ; LJMPRN set program bank to source register and jump to address of register - LJMPRN 8 -NEWSYM FxOp99A1 ; LJMPRN set program bank to source register and jump to address of register - LJMPRN 9 -NEWSYM FxOp9AA1 ; LJMPRN set program bank to source register and jump to address of register - LJMPRN 10 -NEWSYM FxOp9BA1 ; LJMPRN set program bank to source register and jump to address of register - LJMPRN 11 -NEWSYM FxOp9CA1 ; LJMPRN set program bank to source register and jump to address of register - LJMPRN 12 -NEWSYM FxOp9DA1 ; LJMPRN set program bank to source register and jump to address of register - LJMPRN 13 - -NEWSYM FxOp9E ; LOB set upper byte to zero (keep low byte) ; V - mov eax,[esi] ; Read Source - FETCHPIPE - and eax,0FFh - inc ebp - mov [edi],eax ; Write Destination - shl eax,8 - mov dword [SfxSignZero],eax - CLRFLAGS - ret - -NEWSYM FxOp9F ; FMULT 16 bit to 32 bit signed multiplication, upper 16 bits only - ; V - mov eax,[esi] ; Read Source - mov ebx,[SfxR6] - FETCHPIPE - imul bx - inc ebp - and edx,0FFFFh - mov [SfxSignZero],edx - mov [edi],edx ; Write Destination - shr ax,15 - mov [SfxCarry],al - CLRFLAGS - ret - -NEWSYM FxOp9FA1 ; LMULT 16 bit to 32 bit signed multiplication ; V - mov eax,[esi] ; Read Source - mov ebx,[SfxR6] - FETCHPIPE - imul bx - and edx,0FFFFh - inc ebp - mov [edi],edx ; Write Destination - mov [SfxR4],ax - mov [SfxSignZero],edx - shr ax,15 - mov [SfxCarry],al - CLRFLAGS - ret - -NEWSYM FxOpA0 ; IBTRN,#PP immediate byte transfer - IBTRN 0 -NEWSYM FxOpA1 ; IBTRN,#PP immediate byte transfer - IBTRN 1 -NEWSYM FxOpA2 ; IBTRN,#PP immediate byte transfer - IBTRN 2 -NEWSYM FxOpA3 ; IBTRN,#PP immediate byte transfer - IBTRN 3 -NEWSYM FxOpA4 ; IBTRN,#PP immediate byte transfer - IBTRN 4 -NEWSYM FxOpA5 ; IBTRN,#PP immediate byte transfer - IBTRN 5 -NEWSYM FxOpA6 ; IBTRN,#PP immediate byte transfer - IBTRN 6 -NEWSYM FxOpA7 ; IBTRN,#PP immediate byte transfer - IBTRN 7 -NEWSYM FxOpA8 ; IBTRN,#PP immediate byte transfer - IBTRN 8 -NEWSYM FxOpA9 ; IBTRN,#PP immediate byte transfer - IBTRN 9 -NEWSYM FxOpAA ; IBTRN,#PP immediate byte transfer - IBTRN 10 -NEWSYM FxOpAB ; IBTRN,#PP immediate byte transfer - IBTRN 11 -NEWSYM FxOpAC ; IBTRN,#PP immediate byte transfer - IBTRN 12 -NEWSYM FxOpAD ; IBTRN,#PP immediate byte transfer - IBTRN 13 -NEWSYM FxOpAE ; IBTRN,#PP immediate byte transfer - movsx eax,byte[ebp] - mov cl,[ebp+1] - add ebp,2 - mov [SfxR0+14*4],ax - UpdateR14 - CLRFLAGS - ret -NEWSYM FxOpAF ; IBTRN,#PP immediate byte transfer - movsx eax,byte[ebp] - mov cl,[ebp+1] - and eax,0FFFFh - mov ebp,[SfxCPB] - add ebp,eax - CLRFLAGS - ret - -NEWSYM FxOpA0A1 ; LMS rn,(yy) load word from RAM (short address) - LMSRN 0 -NEWSYM FxOpA1A1 ; LMS rn,(yy) load word from RAM (short address) - LMSRN 1 -NEWSYM FxOpA2A1 ; LMS rn,(yy) load word from RAM (short address) - LMSRN 2 -NEWSYM FxOpA3A1 ; LMS rn,(yy) load word from RAM (short address) - LMSRN 3 -NEWSYM FxOpA4A1 ; LMS rn,(yy) load word from RAM (short address) - LMSRN 4 -NEWSYM FxOpA5A1 ; LMS rn,(yy) load word from RAM (short address) - LMSRN 5 -NEWSYM FxOpA6A1 ; LMS rn,(yy) load word from RAM (short address) - LMSRN 6 -NEWSYM FxOpA7A1 ; LMS rn,(yy) load word from RAM (short address) - LMSRN 7 -NEWSYM FxOpA8A1 ; LMS rn,(yy) load word from RAM (short address) - LMSRN 8 -NEWSYM FxOpA9A1 ; LMS rn,(yy) load word from RAM (short address) - LMSRN 9 -NEWSYM FxOpAAA1 ; LMS rn,(yy) load word from RAM (short address) - LMSRN 10 -NEWSYM FxOpABA1 ; LMS rn,(yy) load word from RAM (short address) - LMSRN 11 -NEWSYM FxOpACA1 ; LMS rn,(yy) load word from RAM (short address) - LMSRN 12 -NEWSYM FxOpADA1 ; LMS rn,(yy) load word from RAM (short address) - LMSRN 13 -NEWSYM FxOpAEA1 ; LMS rn,(yy) load word from RAM (short address) - xor eax,eax - mov al,[ebp] - add eax,eax - inc ebp - add eax,[SfxRAMMem] - mov cl,[ebp] - mov dword [SfxLastRamAdr],eax - mov ebx,[eax] ; Read word from ram - inc ebp - mov [SfxR0+14*4],bx ; Write data - UpdateR14 - CLRFLAGS - ret -NEWSYM FxOpAFA1 ; LMS rn,(yy) load word from RAM (short address) - xor eax,eax - mov al,[ebp] - add eax,eax - inc ebp - add eax,[SfxRAMMem] - mov cl,[ebp] - mov dword [SfxLastRamAdr],eax - mov ebx,[eax] ; Read word from ram - and ebx,0FFFFh - mov ebp,[SfxCPB] - add ebp,ebx - CLRFLAGS - ret - -NEWSYM FxOpA0A2 ; SMS (yy),rn store word in RAM (short address) - SMSRN 0 -NEWSYM FxOpA1A2 ; SMS (yy),rn store word in RAM (short address) - SMSRN 1 -NEWSYM FxOpA2A2 ; SMS (yy),rn store word in RAM (short address) - SMSRN 2 -NEWSYM FxOpA3A2 ; SMS (yy),rn store word in RAM (short address) - SMSRN 3 -NEWSYM FxOpA4A2 ; SMS (yy),rn store word in RAM (short address) - SMSRN 4 -NEWSYM FxOpA5A2 ; SMS (yy),rn store word in RAM (short address) - SMSRN 5 -NEWSYM FxOpA6A2 ; SMS (yy),rn store word in RAM (short address) - SMSRN 6 -NEWSYM FxOpA7A2 ; SMS (yy),rn store word in RAM (short address) - SMSRN 7 -NEWSYM FxOpA8A2 ; SMS (yy),rn store word in RAM (short address) - SMSRN 8 -NEWSYM FxOpA9A2 ; SMS (yy),rn store word in RAM (short address) - SMSRN 9 -NEWSYM FxOpAAA2 ; SMS (yy),rn store word in RAM (short address) - SMSRN 10 -NEWSYM FxOpABA2 ; SMS (yy),rn store word in RAM (short address) - SMSRN 11 -NEWSYM FxOpACA2 ; SMS (yy),rn store word in RAM (short address) - SMSRN 12 -NEWSYM FxOpADA2 ; SMS (yy),rn store word in RAM (short address) - SMSRN 13 -NEWSYM FxOpAEA2 ; SMS (yy),rn store word in RAM (short address) - SMSRN 14 -NEWSYM FxOpAFA2 ; SMS (yy),rn store word in RAM (short address) - xor eax,eax - mov ebx,ebp - sub ebx,[SfxCPB] - mov al,[ebp] - inc ebp - add eax,eax - FETCHPIPE - add eax,[SfxRAMMem] - mov dword [SfxLastRamAdr],eax - inc ebp - mov [eax],bx ; Write word to ram - CLRFLAGS - ret - -NEWSYM FxOpB0 ; FROM rn set source register - FROMRN 0 -NEWSYM FxOpB1 ; FROM rn set source register - FROMRN 1 -NEWSYM FxOpB2 ; FROM rn set source register - FROMRN 2 -NEWSYM FxOpB3 ; FROM rn set source register - FROMRN 3 -NEWSYM FxOpB4 ; FROM rn set source register - FROMRN 4 -NEWSYM FxOpB5 ; FROM rn set source register - FROMRN 5 -NEWSYM FxOpB6 ; FROM rn set source register - FROMRN 6 -NEWSYM FxOpB7 ; FROM rn set source register - FROMRN 7 -NEWSYM FxOpB8 ; FROM rn set source register - FROMRN 8 -NEWSYM FxOpB9 ; FROM rn set source register - FROMRN 9 -NEWSYM FxOpBA ; FROM rn set source register - FROMRN 10 -NEWSYM FxOpBB ; FROM rn set source register - FROMRN 11 -NEWSYM FxOpBC ; FROM rn set source register - FROMRN 12 -NEWSYM FxOpBD ; FROM rn set source register - FROMRN 13 -NEWSYM FxOpBE ; FROM rn set source register - FROMRN 14 -NEWSYM FxOpBF ; FROM rn set source register - FETCHPIPE - mov esi,SfxR0+15*4 - inc ebp ; Increase program counter - mov eax,ebp - sub eax,[SfxCPB] - mov [SfxR15],eax - call [FxTableb+ecx*4] - mov esi,SfxR0 - ret - -NEWSYM FxOpC0 ; HIB move high-byte to low-byte ; V - mov eax,[esi] ; Read Source - FETCHPIPE - and eax,0FF00h - mov dword [SfxSignZero],eax - shr eax,8 - inc ebp - mov [edi],eax - CLRFLAGS - ret - -NEWSYM FxOpC1 ; OR rn or rn - ORRN 1 -NEWSYM FxOpC2 ; OR rn or rn - ORRN 2 -NEWSYM FxOpC3 ; OR rn or rn - ORRN 3 -NEWSYM FxOpC4 ; OR rn or rn - ORRN 4 -NEWSYM FxOpC5 ; OR rn or rn - ORRN 5 -NEWSYM FxOpC6 ; OR rn or rn - ORRN 6 -NEWSYM FxOpC7 ; OR rn or rn - ORRN 7 -NEWSYM FxOpC8 ; OR rn or rn - ORRN 8 -NEWSYM FxOpC9 ; OR rn or rn - ORRN 9 -NEWSYM FxOpCA ; OR rn or rn - ORRN 10 -NEWSYM FxOpCB ; OR rn or rn - ORRN 11 -NEWSYM FxOpCC ; OR rn or rn - ORRN 12 -NEWSYM FxOpCD ; OR rn or rn - ORRN 13 -NEWSYM FxOpCE ; OR rn or rn - ORRN 14 -NEWSYM FxOpCF ; OR rn or rn - mov eax,[esi] ; Read Source - mov ebx,ebp - FETCHPIPE - sub ebx,[SfxCPB] - or eax,ebx - inc ebp - mov [edi],eax ; Write DREG - mov [SfxSignZero],eax - CLRFLAGS - ret - -NEWSYM FxOpC1A1 ; XOR rn xor rn - XORRN 1 -NEWSYM FxOpC2A1 ; XOR rn xor rn - XORRN 2 -NEWSYM FxOpC3A1 ; XOR rn xor rn - XORRN 3 -NEWSYM FxOpC4A1 ; XOR rn xor rn - XORRN 4 -NEWSYM FxOpC5A1 ; XOR rn xor rn - XORRN 5 -NEWSYM FxOpC6A1 ; XOR rn xor rn - XORRN 6 -NEWSYM FxOpC7A1 ; XOR rn xor rn - XORRN 7 -NEWSYM FxOpC8A1 ; XOR rn xor rn - XORRN 8 -NEWSYM FxOpC9A1 ; XOR rn xor rn - XORRN 9 -NEWSYM FxOpCAA1 ; XOR rn xor rn - XORRN 10 -NEWSYM FxOpCBA1 ; XOR rn xor rn - XORRN 11 -NEWSYM FxOpCCA1 ; XOR rn xor rn - XORRN 12 -NEWSYM FxOpCDA1 ; XOR rn xor rn - XORRN 13 -NEWSYM FxOpCEA1 ; XOR rn xor rn - XORRN 14 -NEWSYM FxOpCFA1 ; XOR rn xor rn - FETCHPIPE - mov eax,[esi] ; Read Source - mov ebx,ebp - sub ebx,[SfxCPB] - xor eax,ebx - inc ebp - mov [edi],eax ; Write DREG - mov [SfxSignZero],eax - CLRFLAGS - ret - -NEWSYM FxOpC1A2 ; OR #n OR #n - ORI 1 -NEWSYM FxOpC2A2 ; OR #n OR #n - ORI 2 -NEWSYM FxOpC3A2 ; OR #n OR #n - ORI 3 -NEWSYM FxOpC4A2 ; OR #n OR #n - ORI 4 -NEWSYM FxOpC5A2 ; OR #n OR #n - ORI 5 -NEWSYM FxOpC6A2 ; OR #n OR #n - ORI 6 -NEWSYM FxOpC7A2 ; OR #n OR #n - ORI 7 -NEWSYM FxOpC8A2 ; OR #n OR #n - ORI 8 -NEWSYM FxOpC9A2 ; OR #n OR #n - ORI 9 -NEWSYM FxOpCAA2 ; OR #n OR #n - ORI 10 -NEWSYM FxOpCBA2 ; OR #n OR #n - ORI 11 -NEWSYM FxOpCCA2 ; OR #n OR #n - ORI 12 -NEWSYM FxOpCDA2 ; OR #n OR #n - ORI 13 -NEWSYM FxOpCEA2 ; OR #n OR #n - ORI 14 -NEWSYM FxOpCFA2 ; OR #n OR #n - ORI 15 - -NEWSYM FxOpC1A3 ; XOR #n xor #n - XORI 1 -NEWSYM FxOpC2A3 ; XOR #n xor #n - XORI 2 -NEWSYM FxOpC3A3 ; XOR #n xor #n - XORI 3 -NEWSYM FxOpC4A3 ; XOR #n xor #n - XORI 4 -NEWSYM FxOpC5A3 ; XOR #n xor #n - XORI 5 -NEWSYM FxOpC6A3 ; XOR #n xor #n - XORI 6 -NEWSYM FxOpC7A3 ; XOR #n xor #n - XORI 7 -NEWSYM FxOpC8A3 ; XOR #n xor #n - XORI 8 -NEWSYM FxOpC9A3 ; XOR #n xor #n - XORI 9 -NEWSYM FxOpCAA3 ; XOR #n xor #n - XORI 10 -NEWSYM FxOpCBA3 ; XOR #n xor #n - XORI 11 -NEWSYM FxOpCCA3 ; XOR #n xor #n - XORI 12 -NEWSYM FxOpCDA3 ; XOR #n xor #n - XORI 13 -NEWSYM FxOpCEA3 ; XOR #n xor #n - XORI 14 -NEWSYM FxOpCFA3 ; XOR #n xor #n - XORI 15 - -NEWSYM FxOpD0 ; INC rn increase by one - INCRN 0 -NEWSYM FxOpD1 ; INC rn increase by one - INCRN 1 -NEWSYM FxOpD2 ; INC rn increase by one - INCRN 2 -NEWSYM FxOpD3 ; INC rn increase by one - INCRN 3 -NEWSYM FxOpD4 ; INC rn increase by one - INCRN 4 -NEWSYM FxOpD5 ; INC rn increase by one - INCRN 5 -NEWSYM FxOpD6 ; INC rn increase by one - INCRN 6 -NEWSYM FxOpD7 ; INC rn increase by one - INCRN 7 -NEWSYM FxOpD8 ; INC rn increase by one - INCRN 8 -NEWSYM FxOpD9 ; INC rn increase by one - INCRN 9 -NEWSYM FxOpDA ; INC rn increase by one - INCRN 10 -NEWSYM FxOpDB ; INC rn increase by one - INCRN 11 -NEWSYM FxOpDC ; INC rn increase by one - INCRN 12 -NEWSYM FxOpDD ; INC rn increase by one - INCRN 13 -NEWSYM FxOpDE ; INC rn increase by one - FETCHPIPE - mov eax,[SfxR0+14*4] ; Read Source - inc ax - mov [SfxR0+14*4],eax - mov [SfxSignZero],eax - CLRFLAGS - inc ebp - UpdateR14 - ret - -NEWSYM FxOpDF ; GETC transfer ROM buffer to color register - mov eax,[SfxRomBuffer] - FETCHPIPE - mov eax,[eax] - test byte[SfxPOR],04h - jz .nohighnibble - mov bl,al - shr bl,4 - and al,0F0h - or al,bl -.nohighnibble - test byte[SfxPOR],08h - jnz .preserveupper - cmp [SfxCOLR],al - je .nocolchange - mov [SfxCOLR],al - and eax,0FFh - mov ebx,[fxbit01+eax*4] - mov [fxbit01pcal],ebx - mov ebx,[fxbit23+eax*4] - mov [fxbit23pcal],ebx - mov ebx,[fxbit45+eax*4] - mov [fxbit45pcal],ebx - mov ebx,[fxbit67+eax*4] - mov [fxbit67pcal],ebx -.nocolchange - CLRFLAGS - inc ebp ; Increase program counter - ret -.preserveupper - mov bl,[SfxCOLR] - and al,0Fh - and bl,0F0h - or al,bl - cmp [SfxCOLR],al - je .nocolchange - mov [SfxCOLR],al - and eax,0FFh - mov ebx,[fxbit01+eax*4] - mov [fxbit01pcal],ebx - mov ebx,[fxbit23+eax*4] - mov [fxbit23pcal],ebx - mov ebx,[fxbit45+eax*4] - mov [fxbit45pcal],ebx - mov ebx,[fxbit67+eax*4] - mov [fxbit67pcal],ebx - CLRFLAGS - inc ebp ; Increase program counter - ret - -NEWSYM FxOpDFA2 ; RAMB set current RAM bank ; Verified - mov eax,[esi] ; Read Source - mov ebx,[SfxnRamBanks] - FETCHPIPE - dec ebx - and eax,ebx - mov dword [SfxRAMBR],eax - shl eax,16 - add eax,[sfxramdata] - mov dword [SfxRAMMem],eax - CLRFLAGS - inc ebp - ret - -NEWSYM FxOpDFA3 ; ROMB set current ROM bank ; Verified - mov eax,[esi] ; Read Source - and eax,07Fh - FETCHPIPE - mov dword [SfxROMBR],eax - mov eax,[SfxMemTable+eax*4] - mov [SfxCROM],eax - CLRFLAGS - inc ebp - ret - -NEWSYM FxOpE0 ; DEC rn decrement by one - DECRN 0 -NEWSYM FxOpE1 ; DEC rn decrement by one - DECRN 1 -NEWSYM FxOpE2 ; DEC rn decrement by one - DECRN 2 -NEWSYM FxOpE3 ; DEC rn decrement by one - DECRN 3 -NEWSYM FxOpE4 ; DEC rn decrement by one - DECRN 4 -NEWSYM FxOpE5 ; DEC rn decrement by one - DECRN 5 -NEWSYM FxOpE6 ; DEC rn decrement by one - DECRN 6 -NEWSYM FxOpE7 ; DEC rn decrement by one - DECRN 7 -NEWSYM FxOpE8 ; DEC rn decrement by one - DECRN 8 -NEWSYM FxOpE9 ; DEC rn decrement by one - DECRN 9 -NEWSYM FxOpEA ; DEC rn decrement by one - DECRN 10 -NEWSYM FxOpEB ; DEC rn decrement by one - DECRN 11 -NEWSYM FxOpEC ; DEC rn decrement by one - DECRN 12 -NEWSYM FxOpED ; DEC rn decrement by one - DECRN 13 -NEWSYM FxOpEE ; DEC rn decrement by one - dec word[SfxR0+14*4] - FETCHPIPE - mov eax,[SfxR0+14*4] ; Read Source - mov [SfxSignZero],eax - UpdateR14 - CLRFLAGS - inc ebp - ret - -NEWSYM FxOpEF ; getb get byte from ROM at address R14 ; V - FETCHPIPE - mov eax,[SfxRomBuffer] - inc ebp - mov eax,[eax] - and eax,0FFh -; cmp edi,SfxR15 -; je .nor15 - mov [edi],eax ; Write DREG - CLRFLAGS - ret -.nor15 -; mov eax,ebp -; sub eax,[SfxCPB] -; mov [SfxR15],al - or eax,8000h - mov [edi],eax ; Write DREG - CLRFLAGS - ret - -NEWSYM FxOpEFA1 ; getbh get high-byte from ROM at address R14 ; V - mov eax,[esi] ; Read Source - mov ebx,[SfxRomBuffer] - and eax,0FFh - FETCHPIPE - mov ah,[ebx] - inc ebp - mov [edi],eax ; Write DREG - CLRFLAGS - ret - -NEWSYM FxOpEFA2 ; getbl get low-byte from ROM at address R14 ; V - mov eax,[esi] ; Read Source - mov ebx,[SfxRomBuffer] - and eax,0FF00h - FETCHPIPE - mov al,[ebx] - inc ebp - mov [edi],eax ; Write DREG - CLRFLAGS - ret - -NEWSYM FxOpEFA3 ; getbs get sign extended byte from ROM at address R14 ; V - mov ebx,[SfxRomBuffer] - FETCHPIPE - movsx eax,byte[ebx] - inc ebp - mov [edi],ax ; Write DREG - CLRFLAGS - ret - -NEWSYM FxOpF0 ; IWT RN,#xx immediate word transfer to register - IWTRN 0 -NEWSYM FxOpF1 ; IWT RN,#xx immediate word transfer to register - IWTRN 1 -NEWSYM FxOpF2 ; IWT RN,#xx immediate word transfer to register - IWTRN 2 -NEWSYM FxOpF3 ; IWT RN,#xx immediate word transfer to register - IWTRN 3 -NEWSYM FxOpF4 ; IWT RN,#xx immediate word transfer to register - IWTRN 4 -NEWSYM FxOpF5 ; IWT RN,#xx immediate word transfer to register - IWTRN 5 -NEWSYM FxOpF6 ; IWT RN,#xx immediate word transfer to register - IWTRN 6 -NEWSYM FxOpF7 ; IWT RN,#xx immediate word transfer to register - IWTRN 7 -NEWSYM FxOpF8 ; IWT RN,#xx immediate word transfer to register - IWTRN 8 -NEWSYM FxOpF9 ; IWT RN,#xx immediate word transfer to register - IWTRN 9 -NEWSYM FxOpFA ; IWT RN,#xx immediate word transfer to register - IWTRN 10 -NEWSYM FxOpFB ; IWT RN,#xx immediate word transfer to register - IWTRN 11 -NEWSYM FxOpFC ; IWT RN,#xx immediate word transfer to register - IWTRN 12 -NEWSYM FxOpFD ; IWT RN,#xx immediate word transfer to register - IWTRN 13 -NEWSYM FxOpFE ; IWT RN,#xx immediate word transfer to register - mov eax,[ebp] - mov cl,[ebp+2] - and eax,0FFFFh - add ebp,3 - mov [SfxR0+14*4],eax - UpdateR14 - CLRFLAGS - ret -NEWSYM FxOpFF ; IWT RN,#xx immediate word transfer to register - mov eax,[ebp] - mov cl,[ebp+2] - and eax,0FFFFh - mov ebp,[SfxCPB] - add ebp,eax - CLRFLAGS - ret - -NEWSYM FxOpF0A1 ; LM RN,(XX) load word from RAM - LMRN 0 -NEWSYM FxOpF1A1 ; LM RN,(XX) load word from RAM - LMRN 1 -NEWSYM FxOpF2A1 ; LM RN,(XX) load word from RAM - LMRN 2 -NEWSYM FxOpF3A1 ; LM RN,(XX) load word from RAM - LMRN 3 -NEWSYM FxOpF4A1 ; LM RN,(XX) load word from RAM - LMRN 4 -NEWSYM FxOpF5A1 ; LM RN,(XX) load word from RAM - LMRN 5 -NEWSYM FxOpF6A1 ; LM RN,(XX) load word from RAM - LMRN 6 -NEWSYM FxOpF7A1 ; LM RN,(XX) load word from RAM - LMRN 7 -NEWSYM FxOpF8A1 ; LM RN,(XX) load word from RAM - LMRN 8 -NEWSYM FxOpF9A1 ; LM RN,(XX) load word from RAM - LMRN 9 -NEWSYM FxOpFAA1 ; LM RN,(XX) load word from RAM - LMRN 10 -NEWSYM FxOpFBA1 ; LM RN,(XX) load word from RAM - LMRN 11 -NEWSYM FxOpFCA1 ; LM RN,(XX) load word from RAM - LMRN 12 -NEWSYM FxOpFDA1 ; LM RN,(XX) load word from RAM - LMRN 13 -NEWSYM FxOpFEA1 ; LM RN,(XX) load word from RAM - xor eax,eax - mov cl,[ebp+2] - mov ax,[ebp] - mov ebx,[SfxRAMMem] - mov [SfxLastRamAdr],eax - add [SfxLastRamAdr],ebx - mov dl,[eax+ebx] - xor eax,1 - add ebp,3 - mov dh,[eax+ebx] - mov word [SfxR0+14*4],dx ; Store Word - UpdateR14 - CLRFLAGS - ret -NEWSYM FxOpFFA1 ; LM RN,(XX) load word from RAM - FETCHPIPE - mov eax,ecx - inc ebp - FETCHPIPE - inc ebp - mov ah,cl - FETCHPIPE - mov ebx,[SfxRAMMem] - mov [SfxLastRamAdr],eax - add [SfxLastRamAdr],ebx - mov dl,[eax+ebx] - xor eax,1 - mov dh,[eax+ebx] - and edx,0FFFFh - mov ebp,[SfxCPB] - add ebp,edx - CLRFLAGS - ret - -NEWSYM FxOpF0A2 ; SM (XX),RN store word in RAM - SMRN 0 -NEWSYM FxOpF1A2 ; SM (XX),RN store word in RAM - SMRN 1 -NEWSYM FxOpF2A2 ; SM (XX),RN store word in RAM - SMRN 2 -NEWSYM FxOpF3A2 ; SM (XX),RN store word in RAM - SMRN 3 -NEWSYM FxOpF4A2 ; SM (XX),RN store word in RAM - SMRN 4 -NEWSYM FxOpF5A2 ; SM (XX),RN store word in RAM - SMRN 5 -NEWSYM FxOpF6A2 ; SM (XX),RN store word in RAM - SMRN 6 -NEWSYM FxOpF7A2 ; SM (XX),RN store word in RAM - SMRN 7 -NEWSYM FxOpF8A2 ; SM (XX),RN store word in RAM - SMRN 8 -NEWSYM FxOpF9A2 ; SM (XX),RN store word in RAM - SMRN 9 -NEWSYM FxOpFAA2 ; SM (XX),RN store word in RAM - SMRN 10 -NEWSYM FxOpFBA2 ; SM (XX),RN store word in RAM - SMRN 11 -NEWSYM FxOpFCA2 ; SM (XX),RN store word in RAM - SMRN 12 -NEWSYM FxOpFDA2 ; SM (XX),RN store word in RAM - SMRN 13 -NEWSYM FxOpFEA2 ; SM (XX),RN store word in RAM - SMRN 14 -NEWSYM FxOpFFA2 ; SM (XX),RN store word in RAM - FETCHPIPE - mov ebx,ebp - sub ebx,[SfxCPB] - mov eax,ecx - inc ebp - FETCHPIPE - inc ebp - mov ah,cl - FETCHPIPE - mov dx,bx - mov ebx,[SfxRAMMem] - mov [SfxLastRamAdr],eax - add [SfxLastRamAdr],ebx - mov [eax+ebx],dl - xor eax,1 - inc ebp - mov [eax+ebx],dh - CLRFLAGS - ret - -SECTION .bss ;ALIGN=32 - -NEWSYM NumberOfOpcodes, resd 1 ; Number of opcodes to execute -NEWSYM NumberOfOpcodesBU, resd 1 ; Number of opcodes to execute backup value -NEWSYM sfxwarningb, resb 1 - -SECTION .text - -NEWSYM MainLoop - mov eax,[SfxPBR] - and eax,0FFh -; mov byte[fxtrace+eax],1 - mov ebp,[SfxCPB] - add ebp,[SfxR15] - xor ecx,ecx - mov cl,[SfxPIPE] - mov ch,[SfxSFR+1] - and ch,03h - ; pack esi/edi - PackEsiEdi - jmp [FxTabled+ecx*4] - jmp .LoopAgain -ALIGN16 -.LoopAgain - call [FxTable+ecx*4] - dec dword [NumberOfOpcodes] - jnz .LoopAgain -.EndLoop -NEWSYM FXEndLoop - sub ebp,[SfxCPB] - mov [SfxR15],ebp - mov [SfxPIPE],cl - and byte[SfxSFR+1],0FFh-03h - or [SfxSFR+1],ch - UnPackEsiEdi - ret - -SECTION .data -NEWSYM fxtrace, db 0; times 65536 db 0 -SECTION .text - -NEWSYM FxEmu2AsmEnd diff --git a/i386/fxemu2.mac b/i386/fxemu2.mac deleted file mode 100644 index 9ec7671b..00000000 --- a/i386/fxemu2.mac +++ /dev/null @@ -1,834 +0,0 @@ -;Copyright (C) 1997-2001 ZSNES Team ( zsknight@zsnes.com / _demo_@zsnes.com ) -; -;This program is free software; you can redistribute it and/or -;modify it under the terms of the GNU General Public License -;as published by the Free Software Foundation; either -;version 2 of the License, or (at your option) any later -;version. -; -;This program is distributed in the hope that it will be useful, -;but WITHOUT ANY WARRANTY; without even the implied warranty of -;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;GNU General Public License for more details. -; -;You should have received a copy of the GNU General Public License -;along with this program; if not, write to the Free Software -;Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - - - - - - - - - -%macro FETCHPIPE 0 -; mov edx,[SfxPBR] -; mov edx,[SfxMemTable+edx*4] -; mov edx,[SfxCPB] -; mov edx,[SfxR15] - mov cl,[ebp] -%endmacro - -%macro UpdateR14 0 -; mov edx,[SfxROMBR] -; mov edx,[SfxMemTable+edx*4] - mov eax,[SfxCROM] -; and dword[SfxR14],0FFFFh - add eax,[SfxR14] - mov [SfxRomBuffer],eax -%endmacro - -%macro UpdateR15 0 - mov ebp,[SfxCPB] - add ebp,[SfxR15] -%endmacro - -%macro CLRFLAGS 0 - ;and dword [SfxSFR],0FFFFh-0100h-0200h-1000h ; Clear ALT1,ALT2 and B Flags -; xor ch,ch -; mov dword [SfxB],0 ; Clear B Flag -; mov esi,SfxR0 -; mov edi,SfxR0 -%endmacro - -%macro TORN 1 ; V - FETCHPIPE - mov edi, SfxR0+%1*4 - inc ebp ; Increase program counter - call [FxTable+ecx*4] - mov edi,SfxR0 - ret -%endmacro - -%macro WITH 1 ; Verified. - FETCHPIPE - mov esi,SfxR0+%1*4 - mov edi,SfxR0+%1*4 - mov dword [SfxB],1 - inc ebp ; Increase program counter - call [FxTablec+ecx*4] - mov esi,SfxR0 - mov edi,SfxR0 - mov dword [SfxB],0 ; Clear B Flag - ret -%endmacro - -%macro STWRN 1 ; V - mov eax,[SfxR0+%1*4] ; Read register - mov ebx,[SfxRAMMem] - mov dword [SfxLastRamAdr],eax ; Save last ram address - add dword [SfxLastRamAdr],ebx ; Save last ram address - mov edx,[esi] ; Read Source - FETCHPIPE - mov [ebx+eax],dl ; Store Word - xor eax,1 - inc ebp ; Increase program counter - mov [ebx+eax],dh ; Store Word - CLRFLAGS - ret -%endmacro - -%macro STBRN 1 ; V - mov eax,[SfxR0+%1*4] ; Read register - FETCHPIPE - add eax,[SfxRAMMem] - mov dword [SfxLastRamAdr],eax ; Save last ram address - mov ebx,[esi] ; Read Source - mov byte [eax],bl ; Store Byte - CLRFLAGS - inc ebp ; Increase program counter - ret -%endmacro - -%macro LDWRN 1 ; V - mov eax,[SfxR0+%1*4] ; Read register - mov ebx,[SfxRAMMem] - mov dword [SfxLastRamAdr],eax ; Save last ram address - FETCHPIPE - mov dl,[ebx+eax] ; Store Word - add dword [SfxLastRamAdr],ebx ; Save last ram address - xor eax,1 - and edx,0FFFFh - inc ebp ; Increase program counter - mov dh,[ebx+eax] ; Store Word - mov [edi],edx ; Read Source - CLRFLAGS - ret -%endmacro - -%macro LDBRN 1 ; V - mov eax,[SfxR0+%1*4] ; Read register - FETCHPIPE - add eax,[SfxRAMMem] - xor ebx,ebx - mov dword [SfxLastRamAdr],eax ; Save last ram address - mov bl,[eax] ; Read Byte - inc ebp ; Increase program counter - mov [edi],ebx ; Store Result - CLRFLAGS - ret -%endmacro - -; test byte[SfxPOR],01h -; jnz .nozerocheck -; test byte[SfxPOR],02h -; jz .nodither - -; **** Can pre-calculate [SfxSCBR] << 10 + [sfxramdata] -; Pre-calculate fxbit values from color register - -%macro drawpix4b 0 - and [eax],edx - and [eax+16],edx - xor edx,0FFFFFFFFh - mov ebx,[fxbit01pcal] - and ebx,edx - or [eax], ebx - and edx,[fxbit23pcal] - or [eax+16], edx -%endmacro - -%macro drawpix4bd 0 - and [eax],edx - and [eax+16],edx - xor edx,0FFFFFFFFh - mov ebx,[fxbit45pcal] - and ebx,edx - or [eax], ebx - and edx,[fxbit67pcal] - or [eax+16], edx -%endmacro - -%macro drawpix2b 0 - and [eax],edx - xor edx,0FFFFFFFFh - and edx,[fxbit01pcal] - or [eax], edx -%endmacro - -%macro drawpix2bd 0 - and [eax],edx - xor edx,0FFFFFFFFh - and edx,[fxbit45pcal] - or [eax], edx -%endmacro - -%macro drawpix8b 0 - and [eax],edx - and [eax+16],edx - and [eax+32],edx - and [eax+48],edx - xor edx,0FFFFFFFFh - mov ebx,[fxbit01pcal] - and ebx,edx - or [eax], ebx - mov ebx,[fxbit23pcal] - and ebx,edx - or [eax+16], ebx - mov ebx,[fxbit45pcal] - and ebx,edx - or [eax+32], ebx - and edx,[fxbit67pcal] - or [eax+48], edx -%endmacro - -%macro drawpix8bd 0 - and [eax],edx - and [eax+16],edx - and [eax+32],edx - and [eax+48],edx - xor edx,0FFFFFFFFh - mov ebx,[fxbit45pcal] - and ebx,edx - or [eax], ebx - mov ebx,[fxbit67pcal] - and ebx,edx - or [eax+16], ebx - mov ebx,[fxbit01pcal] - and ebx,edx - or [eax+32], ebx - and edx,[fxbit23pcal] - or [eax+48], edx -%endmacro - -%macro plotb 5 - shl eax,%3 - and ebx,07h - add ebx,ebx - add eax,ebx - add eax,[SCBRrel] - mov bl,[SfxR1] - mov edx,[fxxand+ebx*4] - %2 -%endmacro - -%macro plotbz 5 - shl eax,%3 - and ebx,07h - add ebx,ebx - add eax,ebx - add eax,[SCBRrel] - mov bl,[SfxR1] - mov edx,[fxxand+ebx*4] - test byte[SfxCOLR],%5 - jz .nodraw - %2 -%endmacro - -%macro plotbd 5 - shl eax,%3 - and ebx,07h - add ebx,ebx - add eax,ebx - add eax,[SCBRrel] - mov bl,[SfxR1] - mov edx,[fxxand+ebx*4] - mov bl,[SfxR1] - xor bl,[SfxR2] - test bl,01h - jz near .nodither4b - %4 - inc word [SfxR1] - %1 -.nodither4b - %2 -%endmacro - -%macro plotbzd 5 - shl eax,%3 - and ebx,07h - add ebx,ebx - add eax,ebx - add eax,[SCBRrel] - mov bl,[SfxR1] - mov edx,[fxxand+ebx*4] - test byte[SfxCOLR],%5 - jz near .nodraw - mov bl,[SfxR1] - xor bl,[SfxR2] - test bl,01h - jz .nodither4b - %4 - inc word [SfxR1] - %1 -.nodither4b - %2 -%endmacro - -%macro plotlines4b 1 - mov ebx,[SfxR2] - FETCHPIPE - mov bh,[SfxR1] - mov eax,[sfxclineloc] - inc ebp - mov eax,[eax+ebx*4] - cmp eax,0FFFFFFFFh - je near .nodraw - %1 ret, drawpix4b, 5, drawpix4bd, 0Fh -.nodraw - inc word [SfxR1] - ret -%endmacro - -%macro plotlines4bb 1 - mov ebx,[SfxR2] - FETCHPIPE - mov bh,[SfxR1] - mov eax,[sfxclineloc] - inc ebp - mov eax,[eax+ebx*4] - cmp eax,0FFFFFFFFh - je near .nodraw - %1 FXReturn, drawpix4b, 5, drawpix4bd, 0Fh -.nodraw - inc word [SfxR1] - FXReturn -%endmacro - -%macro plotlines2b 1 - mov ebx,[SfxR2] - FETCHPIPE - mov bh,[SfxR1] - mov eax,[sfxclineloc] - inc ebp - mov eax,[eax+ebx*4] - cmp eax,0FFFFFFFFh - je near .nodraw - %1 ret, drawpix2b, 4, drawpix2bd, 03h -.nodraw - inc word [SfxR1] - ret -%endmacro - -%macro plotlines2bb 1 - mov ebx,[SfxR2] - FETCHPIPE - mov bh,[SfxR1] - mov eax,[sfxclineloc] - inc ebp - mov eax,[eax+ebx*4] - cmp eax,0FFFFFFFFh - je near .nodraw - %1 FXReturn, drawpix2b, 4, drawpix2bd, 03h -.nodraw - inc word [SfxR1] - FXReturn -%endmacro - -%macro plotlines8b 1 - mov ebx,[SfxR2] - FETCHPIPE - mov bh,[SfxR1] - mov eax,[sfxclineloc] - inc ebp - mov eax,[eax+ebx*4] - cmp eax,0FFFFFFFFh - je near .nodraw - %1 ret, drawpix8b, 6, drawpix8bd, 0FFh -.nodraw - inc word [SfxR1] - ret -%endmacro - -%macro plotlines8bb 1 - mov ebx,[SfxR2] - FETCHPIPE - mov bh,[SfxR1] - mov eax,[sfxclineloc] - inc ebp - mov eax,[eax+ebx*4] - cmp eax,0FFFFFFFFh - je near .nodraw - %1 FXReturn, drawpix8b, 6, drawpix8bd, 0FFh -.nodraw - inc word [SfxR1] - FXReturn -%endmacro - -%macro plotlines8bl 1 - mov ebx,[SfxR2] - FETCHPIPE - mov bh,[SfxR1] - mov eax,[sfxclineloc] - inc ebp - mov eax,[eax+ebx*4] - cmp eax,0FFFFFFFFh - je near .nodraw - %1 ret, drawpix8b, 6, drawpix8bd, 0Fh -.nodraw - inc word [SfxR1] - ret -%endmacro - -%macro plotlines8bbl 1 - mov ebx,[SfxR2] - FETCHPIPE - mov bh,[SfxR1] - mov eax,[sfxclineloc] - inc ebp - mov eax,[eax+ebx*4] - cmp eax,0FFFFFFFFh - je near .nodraw - %1 FXReturn, drawpix8b, 6, drawpix8bd, 0Fh -.nodraw - inc word [SfxR1] - FXReturn -%endmacro - -%macro ADDRN 1 ; V - mov eax, [esi] ; Read Source - mov ebx, [SfxR0+%1*4] - FETCHPIPE - add ax,bx - seto byte[SfxOverflow] - setc byte[SfxCarry] - mov [SfxSignZero],eax - inc ebp ; Increase program counter - mov [edi],eax ; Write Destination - CLRFLAGS - ret -%endmacro - -%macro ADCRN 1 ; V - FETCHPIPE - mov eax, [esi] ; Read Source - mov ebx, [SfxR0+%1*4] - shr byte[SfxCarry],1 - adc ax,bx - seto byte[SfxOverflow] - setc byte[SfxCarry] - mov [SfxSignZero],eax - inc ebp ; Increase program counter - mov [edi],eax ; Write Destination - CLRFLAGS - ret -%endmacro - -%macro ADIRN 1 ; V - mov eax, [esi] ; Read Source - FETCHPIPE - add ax,%1 - seto byte[SfxOverflow] - setc byte[SfxCarry] - mov [SfxSignZero],eax - inc ebp ; Increase program counter - mov [edi],eax ; Write Destination - CLRFLAGS - ret -%endmacro - -%macro ADCIRN 1 ; V - FETCHPIPE - mov eax, [esi] ; Read Source - shr byte[SfxCarry],1 - adc ax,%1 - seto byte[SfxOverflow] - setc byte[SfxCarry] - mov [SfxSignZero],eax - inc ebp ; Increase program counter - mov [edi],eax ; Write Destination - CLRFLAGS - ret -%endmacro - -%macro SUBRN 1 ; V - mov eax,[esi] ; Read Source - mov ebx,[SfxR0+%1*4] - FETCHPIPE - sub ax,bx - seto byte[SfxOverflow] - setc byte[SfxCarry] - xor byte[SfxCarry],1 - inc ebp ; Increase program counter - mov [edi],eax ; Write Destination - mov [SfxSignZero],eax - CLRFLAGS - ret -%endmacro - -%macro SBCRN 1 ; V - FETCHPIPE - mov eax,[esi] ; Read Source - mov ebx,[SfxR0+%1*4] - cmp byte[SfxCarry],1 - sbb ax,bx - seto byte[SfxOverflow] - setc byte[SfxCarry] - xor byte[SfxCarry],1 - inc ebp ; Increase program counter - mov [edi],eax ; Write Destination - mov [SfxSignZero],eax - CLRFLAGS - ret -%endmacro - -%macro SUBIRN 1 ; V - mov eax,[esi] ; Read Source - FETCHPIPE - sub ax,%1 - seto byte[SfxOverflow] - setc byte[SfxCarry] - xor byte[SfxCarry],1 - inc ebp ; Increase program counter - mov [edi],eax ; Write Destination - mov [SfxSignZero],eax - CLRFLAGS - ret -%endmacro - -%macro CMPRN 1 ; V - mov eax,[esi] ; Read Source - mov ebx,[SfxR0+%1*4] - FETCHPIPE - sub ax,bx - seto byte[SfxOverflow] - setc byte[SfxCarry] - xor byte[SfxCarry],1 - mov [SfxSignZero],eax - CLRFLAGS - inc ebp ; Increase program counter - ret -%endmacro - -%macro ANDRN 1 ; V - mov eax,[esi] ; Read Source - mov ebx,[SfxR0+%1*4] ; Read RN - FETCHPIPE - and eax,ebx - inc ebp - mov dword [SfxSignZero],eax - mov [edi],eax ; Write Destination - CLRFLAGS - ret -%endmacro - -%macro BICRN 1 ; V - mov ebx,[SfxR0+%1*4] ; Read RN - mov eax,[esi] ; Read Source - xor ebx,0FFFFh - FETCHPIPE - and eax,ebx - inc ebp - mov dword [SfxSignZero],eax - mov [edi],eax ; Write Destination - CLRFLAGS - ret -%endmacro - -%macro ANDIRN 1 ; V - mov eax,[esi] ; Read Source - FETCHPIPE - and eax,%1 - inc ebp - mov dword [SfxSignZero],eax - mov [edi],eax ; Write Destination - CLRFLAGS - ret -%endmacro - -%macro BICIRN 1 ; V - mov eax,[esi] ; Read Source - FETCHPIPE - and eax,%1 - inc ebp - mov dword [SfxSignZero],eax - mov [edi],eax ; Write Destination - CLRFLAGS - ret -%endmacro - -%macro MULTRN 1 ; V - mov al,byte [esi] ; Read Source - mov bl,byte [SfxR0+%1*4] ; Read RN - FETCHPIPE - imul bl - inc ebp - and eax,0FFFFh - mov [SfxSignZero],eax - mov [edi],eax ; Write Destination - CLRFLAGS - ret -%endmacro - -%macro UMULTRN 1 ; V - mov al,byte [esi] ; Read Source - mov bl,byte [SfxR0+%1*4] ; Read RN - FETCHPIPE - mul bl - inc ebp - and eax,0FFFFh - mov [SfxSignZero],eax - mov [edi],eax ; Write Destination - CLRFLAGS - ret -%endmacro - -%macro MULTIRN 1 ; V - mov al,byte [esi] ; Read Source - mov bl,%1 ; Read RN - FETCHPIPE - imul bl - inc ebp - and eax,0FFFFh - mov [SfxSignZero],eax - mov [edi],eax ; Write Destination - CLRFLAGS - ret -%endmacro - -%macro UMULTIRN 1 ; V - mov al,byte [esi] ; Read Source - mov bl,%1 ; Read RN - FETCHPIPE - mul bl - inc ebp - and eax,0FFFFh - mov [SfxSignZero],eax - mov [edi],eax ; Write Destination - CLRFLAGS - ret -%endmacro - -%macro LINK 1 ; Verified. - mov eax,ebp - sub eax,[SfxCPB] - add eax,%1 - FETCHPIPE - mov word [SfxR11],ax - CLRFLAGS - inc ebp - ret -%endmacro - -%macro JMPRN 1 ; V - FETCHPIPE - mov eax,[SfxR0+%1*4] ; Read RN - mov ebp,[SfxCPB] - add ebp,eax - CLRFLAGS - ret -%endmacro - -%macro LJMPRN 1 ; V - FETCHPIPE - mov eax,[SfxR0+%1*4] - and eax,07Fh - mov byte[SfxPBR],al -; mov byte[fxtrace+eax],1 - mov eax,[SfxMemTable+eax*4] - mov [SfxCPB],eax - mov ebp,eax - add ebp,[esi] ; Read RN - mov dword [SfxCacheActive],0 - push ecx - call FxOp02 - pop ecx - dec ebp - ret -%endmacro - -%macro IBTRN 1 ; V - movsx eax,byte[ebp] - mov cl,[ebp+1] - add ebp,2 - mov [SfxR0+%1*4],ax - CLRFLAGS - ret -%endmacro - -%macro LMSRN 1 ; Verified. - xor eax,eax - mov al,[ebp] - add eax,eax - inc ebp - add eax,[SfxRAMMem] - mov cl,[ebp] - mov dword [SfxLastRamAdr],eax - mov ebx,[eax] ; Read word from ram - inc ebp - mov [SfxR0+%1*4],bx ; Write data - CLRFLAGS - ret -%endmacro - -%macro SMSRN 1 ; Verified. - xor eax,eax - mov al,[ebp] - inc ebp - add eax,eax - mov cl,[ebp] - add eax,[SfxRAMMem] - mov ebx,[SfxR0+%1*4] ; Read data - mov dword [SfxLastRamAdr],eax - inc ebp - mov [eax],bx ; Write word to ram - CLRFLAGS - ret -%endmacro - -%macro FROMRN 1 ; V - FETCHPIPE - mov esi,SfxR0+%1*4 - inc ebp ; Increase program counter - call [FxTable+ecx*4] - mov esi,SfxR0 - ret -%endmacro - -%macro ORRN 1 ; V - mov eax,[esi] ; Read Source - mov ebx,[SfxR0+%1*4] ; Read - FETCHPIPE - or eax,ebx - inc ebp - mov [edi],eax ; Write DREG - mov [SfxSignZero],eax - CLRFLAGS - ret -%endmacro - -%macro XORRN 1 ; V - mov eax,[esi] ; Read Source - mov ebx,[SfxR0+%1*4] ; Read - FETCHPIPE - xor eax,ebx - inc ebp - mov [edi],eax ; Write DREG - mov [SfxSignZero],eax - CLRFLAGS - ret -%endmacro - -%macro ORI 1 ; V - mov eax,[esi] ; Read Source - FETCHPIPE - or eax,%1 - inc ebp - mov [edi],eax ; Write DREG - mov [SfxSignZero],eax - CLRFLAGS - ret -%endmacro - -%macro XORI 1 ; V - mov eax,[esi] ; Read Source - FETCHPIPE - xor eax,%1 - inc ebp - mov [edi],eax ; Write DREG - mov [SfxSignZero],eax - CLRFLAGS - ret -%endmacro - -%macro INCRN 1 ; Verified - inc word[SfxR0+%1*4] - FETCHPIPE - mov eax,[SfxR0+%1*4] ; Read Source - mov [SfxSignZero],eax - CLRFLAGS - inc ebp - ret -%endmacro - -%macro DECRN 1 ; Verified - dec word[SfxR0+%1*4] - FETCHPIPE - mov eax,[SfxR0+%1*4] ; Read Source - mov [SfxR0+%1*4],eax - mov [SfxSignZero],eax - CLRFLAGS - inc ebp - ret -%endmacro - -%macro IWTRN 1 ; aka LEA ; Verified. - mov eax,[ebp] - mov cl,[ebp+2] - and eax,0FFFFh - add ebp,3 - mov [SfxR0+%1*4],eax - CLRFLAGS - ret -%endmacro - -%macro LMRN 1 ; Verified! - xor eax,eax - mov cl,[ebp+2] - mov ax,[ebp] - mov ebx,[SfxRAMMem] - mov [SfxLastRamAdr],eax - add [SfxLastRamAdr],ebx - mov dl,[eax+ebx] - xor eax,1 - add ebp,3 - mov dh,[eax+ebx] - mov word [SfxR0+%1*4],dx ; Store Word - CLRFLAGS - ret -%endmacro - -%macro SMRN 1 ; Verified - mov ebx,[SfxR0+%1*4] - mov eax,[ebp] - mov cl,[ebp+2] - and eax,0FFFFh - mov dx,bx - mov ebx,[SfxRAMMem] - mov [SfxLastRamAdr],eax - add [SfxLastRamAdr],ebx - mov [eax+ebx],dl - xor eax,1 - add ebp,3 - mov [eax+ebx],dh - CLRFLAGS - ret -%endmacro - -%macro PackEsiEdi 0 - mov eax,[SfxSREG] - shl eax,2 - add eax,SfxR0 - mov esi,eax - mov eax,[SfxDREG] - shl eax,2 - add eax,SfxR0 - mov edi,eax - mov eax,[SfxRAMBR] - shl eax,16 - add eax,[sfxramdata] - mov dword [SfxRAMMem],eax -%endmacro - -%macro UnPackEsiEdi 0 - mov eax,esi - sub eax,SfxR0 - shr eax,2 - mov [SfxSREG],eax - mov eax,edi - sub eax,SfxR0 - shr eax,2 - mov [SfxDREG],eax -%endmacro diff --git a/i386/fxemu2b.asm b/i386/fxemu2b.asm deleted file mode 100644 index a3234d83..00000000 --- a/i386/fxemu2b.asm +++ /dev/null @@ -1,617 +0,0 @@ -;Copyright (C) 1997-2001 ZSNES Team ( zsknight@zsnes.com / _demo_@zsnes.com ) -; -;This program is free software; you can redistribute it and/or -;modify it under the terms of the GNU General Public License -;as published by the Free Software Foundation; either -;version 2 of the License, or (at your option) any later -;version. -; -;This program is distributed in the hope that it will be useful, -;but WITHOUT ANY WARRANTY; without even the implied warranty of -;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;GNU General Public License for more details. -; -;You should have received a copy of the GNU General Public License -;along with this program; if not, write to the Free Software -;Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - -%include "macros.mac" - -EXTSYM FxTable,FxTableb,FxTablec,SfxB,SfxCPB,SfxCROM,SfxCarry,SfxOverflow -EXTSYM SfxR0,SfxR14,SfxR15,SfxRomBuffer,SfxSignZero,withr15sk - -NEWSYM FxEmu2BAsmStart - -%include "fxemu2.mac" -%include "fxemu2b.mac" - - - - - - -NEWSYM FxOpb05 ; BRA branch always ; Verified. - movsx eax,byte[ebp] - mov cl,[ebp+1] - inc ebp - add ebp,eax - call [FxTableb+ecx*4] - ret - -NEWSYM FxOpb06 ; BGE branch on greater or equals ; Verified. - movsx eax,byte[ebp] - mov ebx,[SfxSignZero] - shr ebx,15 - inc ebp - xor bl,[SfxOverflow] - mov cl,[ebp] - test bl,01h - jnz .nojump - add ebp,eax - call [FxTableb+ecx*4] - ret -.nojump - inc ebp - call [FxTableb+ecx*4] - ret - -NEWSYM FxOpb07 ; BLT branch on lesss than ; Verified. - movsx eax,byte[ebp] - mov ebx,[SfxSignZero] - shr ebx,15 - inc ebp - xor bl,[SfxOverflow] - mov cl,[ebp] - test bl,01h - jz .nojump - add ebp,eax - call [FxTableb+ecx*4] - ret -.nojump - inc ebp - call [FxTableb+ecx*4] - ret - -NEWSYM FxOpb08 ; BNE branch on not equal ; Verified. - movsx eax,byte[ebp] - inc ebp - test dword[SfxSignZero],0FFFFh - mov cl,[ebp] - jz .nojump - add ebp,eax - call [FxTableb+ecx*4] - ret -.nojump - inc ebp - call [FxTableb+ecx*4] - ret - -NEWSYM FxOpb09 ; BEQ branch on equal (z=1) ; Verified. - movsx eax,byte[ebp] - inc ebp - test dword[SfxSignZero],0FFFFh - mov cl,[ebp] - jnz .nojump - add ebp,eax - call [FxTableb+ecx*4] - ret -.nojump - inc ebp - call [FxTableb+ecx*4] - ret - -NEWSYM FxOpb0A ; BPL branch on plus ; Verified. - movsx eax,byte[ebp] - inc ebp - test dword[SfxSignZero],088000h - mov cl,[ebp] - jnz .nojump - add ebp,eax - call [FxTableb+ecx*4] - ret -.nojump - inc ebp - call [FxTableb+ecx*4] - ret - -NEWSYM FxOpb0B ; BMI branch on minus ; Verified. - movsx eax,byte[ebp] - inc ebp - test dword[SfxSignZero],088000h - mov cl,[ebp] - jz .nojump - add ebp,eax - call [FxTableb+ecx*4] - ret -.nojump - inc ebp - call [FxTableb+ecx*4] - ret - -NEWSYM FxOpb0C ; BCC branch on carry clear ; Verified. - movsx eax,byte[ebp] - inc ebp - test byte[SfxCarry],01h - mov cl,[ebp] - jnz .nojump - add ebp,eax - call [FxTableb+ecx*4] - ret -.nojump - inc ebp - call [FxTableb+ecx*4] - ret - -NEWSYM FxOpb0D ; BCS branch on carry set ; Verified. - movsx eax,byte[ebp] - inc ebp - test byte[SfxCarry],01h - mov cl,[ebp] - jz .nojump - add ebp,eax - call [FxTableb+ecx*4] - ret -.nojump - inc ebp - call [FxTableb+ecx*4] - ret - -NEWSYM FxOpb0E ; BVC branch on overflow clear ; Verified. - movsx eax,byte[ebp] - inc ebp - test byte[SfxOverflow],01h - mov cl,[ebp] - jnz .nojump - add ebp,eax - call [FxTableb+ecx*4] - ret -.nojump - inc ebp - call [FxTableb+ecx*4] - ret - -NEWSYM FxOpb0F ; BVS branch on overflow set ; Verified. - movsx eax,byte[ebp] - inc ebp - test byte[SfxOverflow],01h - mov cl,[ebp] - jz .nojump - add ebp,eax - call [FxTableb+ecx*4] - ret -.nojump - inc ebp - call [FxTableb+ecx*4] - ret - -NEWSYM FxOpb10 ; TO RN set register n as destination register - TORNb 0 -NEWSYM FxOpb11 ; TO RN set register n as destination register - TORNb 1 -NEWSYM FxOpb12 ; TO RN set register n as destination register - TORNb 2 -NEWSYM FxOpb13 ; TO RN set register n as destination register - TORNb 3 -NEWSYM FxOpb14 ; TO RN set register n as destination register - TORNb 4 -NEWSYM FxOpb15 ; TO RN set register n as destination register - TORNb 5 -NEWSYM FxOpb16 ; TO RN set register n as destination register - TORNb 6 -NEWSYM FxOpb17 ; TO RN set register n as destination register - TORNb 7 -NEWSYM FxOpb18 ; TO RN set register n as destination register - TORNb 8 -NEWSYM FxOpb19 ; TO RN set register n as destination register - TORNb 9 -NEWSYM FxOpb1A ; TO RN set register n as destination register - TORNb 10 -NEWSYM FxOpb1B ; TO RN set register n as destination register - TORNb 11 -NEWSYM FxOpb1C ; TO RN set register n as destination register - TORNb 12 -NEWSYM FxOpb1D ; TO RN set register n as destination register - TORNb 13 -NEWSYM FxOpb1E ; TO RN set register n as destination register - FETCHPIPE - test dword [SfxB],1 - jnz .VersionB - mov edi,SfxR0+14*4 - inc ebp - mov eax,ebp - sub eax,[SfxCPB] - mov dword[withr15sk],1 - mov [SfxR15],eax - call [FxTableb+ecx*4] - mov edi,SfxR0 - UpdateR14 - ret -.VersionB - mov eax,[esi] ; Read Source - mov dword[withr15sk],1 - mov [SfxR0+14*4],eax ; Write - CLRFLAGS - UpdateR14 - inc ebp ; Increase program counter - ret -NEWSYM FxOpb1F ; TO RN set register n as destination register - FETCHPIPE - test dword [SfxB],1 - jnz .VersionB - mov edi,SfxR0+15*4 - inc ebp - mov eax,ebp - sub eax,[SfxCPB] - mov [SfxR15],eax - call [FxTableb+ecx*4] - mov ebp,[SfxCPB] - mov dword[withr15sk],1 - add ebp,[SfxR15] - mov edi,SfxR0 - ret -.VersionB - mov eax,[esi] ; Read Source - mov ebp,[SfxCPB] - mov dword[withr15sk],1 - add ebp,eax - CLRFLAGS - ret - -NEWSYM FxOpb3D ; ALT1 set alt1 mode ; Verified. - FETCHPIPE - mov dword [SfxB],0 - or ch,01h - inc ebp - mov eax,ebp - sub eax,[SfxCPB] - mov [SfxR15],eax - call [FxTableb+ecx*4] - xor ch,ch - ret - -NEWSYM FxOpb3E ; ALT2 set alt1 mode ; Verified. - FETCHPIPE - mov dword [SfxB],0 - or ch,02h - inc ebp - mov eax,ebp - sub eax,[SfxCPB] - mov [SfxR15],eax - call [FxTable+ecx*4] - xor ch,ch - ret - -NEWSYM FxOpb3F ; ALT3 set alt3 mode ; Verified. - FETCHPIPE - mov dword [SfxB],0 - or ch,03h - inc ebp - mov eax,ebp - sub eax,[SfxCPB] - mov [SfxR15],eax - call [FxTable+ecx*4] - xor ch,ch - ret - -NEWSYM FxOpbB0 ; FROM rn set source register - FROMRNb 0 -NEWSYM FxOpbB1 ; FROM rn set source register - FROMRNb 1 -NEWSYM FxOpbB2 ; FROM rn set source register - FROMRNb 2 -NEWSYM FxOpbB3 ; FROM rn set source register - FROMRNb 3 -NEWSYM FxOpbB4 ; FROM rn set source register - FROMRNb 4 -NEWSYM FxOpbB5 ; FROM rn set source register - FROMRNb 5 -NEWSYM FxOpbB6 ; FROM rn set source register - FROMRNb 6 -NEWSYM FxOpbB7 ; FROM rn set source register - FROMRNb 7 -NEWSYM FxOpbB8 ; FROM rn set source register - FROMRNb 8 -NEWSYM FxOpbB9 ; FROM rn set source register - FROMRNb 9 -NEWSYM FxOpbBA ; FROM rn set source register - FROMRNb 10 -NEWSYM FxOpbBB ; FROM rn set source register - FROMRNb 11 -NEWSYM FxOpbBC ; FROM rn set source register - FROMRNb 12 -NEWSYM FxOpbBD ; FROM rn set source register - FROMRNb 13 -NEWSYM FxOpbBE ; FROM rn set source register - FROMRNb 14 -NEWSYM FxOpbBF ; FROM rn set source register - test dword [SfxB],1 - jnz .VersionB - mov esi,SfxR0+15*4 - inc ebp ; Increase program counter - mov eax,ebp - sub eax,[SfxCPB] - mov [SfxR15],eax - call [FxTableb+ecx*4] - mov esi,SfxR0 - ret -.VersionB - FETCHPIPE - mov eax,ebp - sub eax,[SfxCPB] - inc ebp - mov [edi],eax ; Write Destination - mov [SfxSignZero],eax - shr al,7 - mov byte[SfxOverflow],al - CLRFLAGS - ret - -NEWSYM FxOpc05 ; BRA branch always ; Verified. - movsx eax,byte[ebp] - mov cl,[ebp+1] - inc ebp - add ebp,eax - call [FxTablec+ecx*4] - ret - -NEWSYM FxOpc06 ; BGE branch on greater or equals ; Verified. - movsx eax,byte[ebp] - mov ebx,[SfxSignZero] - shr ebx,15 - inc ebp - xor bl,[SfxOverflow] - mov cl,[ebp] - test bl,01h - jnz .nojump - add ebp,eax - call [FxTablec+ecx*4] - ret -.nojump - inc ebp - call [FxTablec+ecx*4] - ret - -NEWSYM FxOpc07 ; BLT branch on lesss than ; Verified. - movsx eax,byte[ebp] - mov ebx,[SfxSignZero] - shr ebx,15 - inc ebp - xor bl,[SfxOverflow] - mov cl,[ebp] - test bl,01h - jz .nojump - add ebp,eax - call [FxTablec+ecx*4] - ret -.nojump - inc ebp - call [FxTablec+ecx*4] - ret - -NEWSYM FxOpc08 ; BNE branch on not equal ; Verified. - movsx eax,byte[ebp] - inc ebp - test dword[SfxSignZero],0FFFFh - mov cl,[ebp] - jz .nojump - add ebp,eax - call [FxTablec+ecx*4] - ret -.nojump - inc ebp - call [FxTablec+ecx*4] - ret - -NEWSYM FxOpc09 ; BEQ branch on equal (z=1) ; Verified. - movsx eax,byte[ebp] - inc ebp - test dword[SfxSignZero],0FFFFh - mov cl,[ebp] - jnz .nojump - add ebp,eax - call [FxTablec+ecx*4] - ret -.nojump - inc ebp - call [FxTablec+ecx*4] - ret - -NEWSYM FxOpc0A ; BPL branch on plus ; Verified. - movsx eax,byte[ebp] - inc ebp - test dword[SfxSignZero],088000h - mov cl,[ebp] - jnz .nojump - add ebp,eax - call [FxTablec+ecx*4] - ret -.nojump - inc ebp - call [FxTablec+ecx*4] - ret - -NEWSYM FxOpc0B ; BMI branch on minus ; Verified. - movsx eax,byte[ebp] - inc ebp - test dword[SfxSignZero],088000h - mov cl,[ebp] - jz .nojump - add ebp,eax - call [FxTablec+ecx*4] - ret -.nojump - inc ebp - call [FxTablec+ecx*4] - ret - -NEWSYM FxOpc0C ; BCC branch on carry clear ; Verified. - movsx eax,byte[ebp] - inc ebp - test byte[SfxCarry],01h - mov cl,[ebp] - jnz .nojump - add ebp,eax - call [FxTablec+ecx*4] - ret -.nojump - inc ebp - call [FxTablec+ecx*4] - ret - -NEWSYM FxOpc0D ; BCS branch on carry set ; Verified. - movsx eax,byte[ebp] - inc ebp - test byte[SfxCarry],01h - mov cl,[ebp] - jz .nojump - add ebp,eax - call [FxTablec+ecx*4] - ret -.nojump - inc ebp - call [FxTablec+ecx*4] - ret - -NEWSYM FxOpc0E ; BVC branch on overflow clear ; Verified. - movsx eax,byte[ebp] - inc ebp - test byte[SfxOverflow],01h - mov cl,[ebp] - jnz .nojump - add ebp,eax - call [FxTablec+ecx*4] - ret -.nojump - inc ebp - call [FxTablec+ecx*4] - ret - -NEWSYM FxOpc0F ; BVS branch on overflow set ; Verified. - movsx eax,byte[ebp] - inc ebp - test byte[SfxOverflow],01h - mov cl,[ebp] - jz .nojump - add ebp,eax - call [FxTablec+ecx*4] - ret -.nojump - inc ebp - call [FxTablec+ecx*4] - ret - -NEWSYM FxOpc10 ; TO RN set register n as destination register - TORNc 0 -NEWSYM FxOpc11 ; TO RN set register n as destination register - TORNc 1 -NEWSYM FxOpc12 ; TO RN set register n as destination register - TORNc 2 -NEWSYM FxOpc13 ; TO RN set register n as destination register - TORNc 3 -NEWSYM FxOpc14 ; TO RN set register n as destination register - TORNc 4 -NEWSYM FxOpc15 ; TO RN set register n as destination register - TORNc 5 -NEWSYM FxOpc16 ; TO RN set register n as destination register - TORNc 6 -NEWSYM FxOpc17 ; TO RN set register n as destination register - TORNc 7 -NEWSYM FxOpc18 ; TO RN set register n as destination register - TORNc 8 -NEWSYM FxOpc19 ; TO RN set register n as destination register - TORNc 9 -NEWSYM FxOpc1A ; TO RN set register n as destination register - TORNc 10 -NEWSYM FxOpc1B ; TO RN set register n as destination register - TORNc 11 -NEWSYM FxOpc1C ; TO RN set register n as destination register - TORNc 12 -NEWSYM FxOpc1D ; TO RN set register n as destination register - TORNc 13 -NEWSYM FxOpc1E ; TO RN set register n as destination register - FETCHPIPE - mov eax,[esi] ; Read Source - mov [SfxR0+14*4],eax ; Write - CLRFLAGS - UpdateR14 - inc ebp ; Increase program counter - ret -NEWSYM FxOpc1F ; TO RN set register n as destination register - FETCHPIPE - mov eax,[esi] ; Read Source - mov ebp,[SfxCPB] - mov [SfxR15],eax - add ebp,eax - CLRFLAGS - ret - -NEWSYM FxOpc3D ; ALT1 set alt1 mode ; Verified. - FETCHPIPE - mov dword [SfxB],0 - or ch,01h - inc ebp - call [FxTablec+ecx*4] - xor ch,ch - ret - -NEWSYM FxOpc3E ; ALT2 set alt1 mode ; Verified. - FETCHPIPE - mov dword [SfxB],0 - or ch,02h - inc ebp - call [FxTablec+ecx*4] - xor ch,ch - ret - -NEWSYM FxOpc3F ; ALT3 set alt3 mode ; Verified. - FETCHPIPE - mov dword [SfxB],0 - or ch,03h - inc ebp - call [FxTablec+ecx*4] - xor ch,ch - ret - -NEWSYM FxOpcB0 ; FROM rn set source register - FROMRNc 0 -NEWSYM FxOpcB1 ; FROM rn set source register - FROMRNc 1 -NEWSYM FxOpcB2 ; FROM rn set source register - FROMRNc 2 -NEWSYM FxOpcB3 ; FROM rn set source register - FROMRNc 3 -NEWSYM FxOpcB4 ; FROM rn set source register - FROMRNc 4 -NEWSYM FxOpcB5 ; FROM rn set source register - FROMRNc 5 -NEWSYM FxOpcB6 ; FROM rn set source register - FROMRNc 6 -NEWSYM FxOpcB7 ; FROM rn set source register - FROMRNc 7 -NEWSYM FxOpcB8 ; FROM rn set source register - FROMRNc 8 -NEWSYM FxOpcB9 ; FROM rn set source register - FROMRNc 9 -NEWSYM FxOpcBA ; FROM rn set source register - FROMRNc 10 -NEWSYM FxOpcBB ; FROM rn set source register - FROMRNc 11 -NEWSYM FxOpcBC ; FROM rn set source register - FROMRNc 12 -NEWSYM FxOpcBD ; FROM rn set source register - FROMRNc 13 -NEWSYM FxOpcBE ; FROM rn set source register - FROMRNc 14 -NEWSYM FxOpcBF ; FROM rn set source register - FETCHPIPE - mov eax,ebp - sub eax,[SfxCPB] - inc ebp - mov [edi],eax ; Write Destination - mov [SfxSignZero],eax - shr al,7 - mov byte[SfxOverflow],al - CLRFLAGS - ret - -NEWSYM FxEmu2BAsmEnd diff --git a/i386/fxemu2b.mac b/i386/fxemu2b.mac deleted file mode 100644 index 758feb68..00000000 --- a/i386/fxemu2b.mac +++ /dev/null @@ -1,88 +0,0 @@ -;Copyright (C) 1997-2001 ZSNES Team ( zsknight@zsnes.com / _demo_@zsnes.com ) -; -;This program is free software; you can redistribute it and/or -;modify it under the terms of the GNU General Public License -;as published by the Free Software Foundation; either -;version 2 of the License, or (at your option) any later -;version. -; -;This program is distributed in the hope that it will be useful, -;but WITHOUT ANY WARRANTY; without even the implied warranty of -;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;GNU General Public License for more details. -; -;You should have received a copy of the GNU General Public License -;along with this program; if not, write to the Free Software -;Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - - - - - - - - - -%macro TORNb 1 ; V - FETCHPIPE - test dword [SfxB],1 - jnz .VersionB - mov edi, SfxR0+%1*4 - inc ebp ; Increase program counter - mov eax,ebp - sub eax,[SfxCPB] - mov dword[withr15sk],1 - mov [SfxR15],eax - call [FxTableb+ecx*4] - mov edi,SfxR0 - ret -.VersionB - mov eax,[esi] ; Read Source - mov dword[withr15sk],1 - inc ebp ; Increase program counter - mov [SfxR0+%1*4],eax ; Write - CLRFLAGS - ret -%endmacro - -%macro FROMRNb 1 ; V - FETCHPIPE - test dword [SfxB],1 - jnz .VersionB - mov esi,SfxR0+%1*4 - inc ebp ; Increase program counter - call [FxTable+ecx*4] - mov esi,SfxR0 - ret -.VersionB - mov eax,[SfxR0+%1*4] ; Read - inc ebp - mov [edi],eax ; Write Destination - mov [SfxSignZero],eax - shr al,7 - mov byte[SfxOverflow],al - CLRFLAGS - ret -%endmacro - -%macro TORNc 1 ; V - FETCHPIPE - mov eax,[esi] ; Read Source - inc ebp ; Increase program counter - mov [SfxR0+%1*4],eax ; Write - CLRFLAGS - ret -%endmacro - - -%macro FROMRNc 1 ; V - FETCHPIPE - mov eax,[SfxR0+%1*4] ; Read - inc ebp - mov [edi],eax ; Write Destination - mov [SfxSignZero],eax - shr al,7 - mov byte[SfxOverflow],al - CLRFLAGS - ret -%endmacro diff --git a/i386/fxemu2c.asm b/i386/fxemu2c.asm deleted file mode 100644 index f41caf10..00000000 --- a/i386/fxemu2c.asm +++ /dev/null @@ -1,2557 +0,0 @@ -;Copyright (C) 1997-2001 ZSNES Team ( zsknight@zsnes.com / _demo_@zsnes.com ) -; -;This program is free software; you can redistribute it and/or -;modify it under the terms of the GNU General Public License -;as published by the Free Software Foundation; either -;version 2 of the License, or (at your option) any later -;version. -; -;This program is distributed in the hope that it will be useful, -;but WITHOUT ANY WARRANTY; without even the implied warranty of -;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;GNU General Public License for more details. -; -;You should have received a copy of the GNU General Public License -;along with this program; if not, write to the Free Software -;Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - -%include "macros.mac" - -EXTSYM FXEndLoop,FlushCache,FxOp02,FxTable,FxTableb,FxTablec,FxTabled -EXTSYM NumberOfOpcodes,SfxB,SfxCBR,SfxCFGR,SfxCOLR,SfxCPB,SfxCROM -EXTSYM SfxCacheActive,SfxCarry,SfxLastRamAdr,SfxMemTable,SfxOverflow -EXTSYM SfxPBR,SfxPIPE,SfxPOR,SfxR0,SfxR1,SfxR11,SfxR12,SfxR13,SfxR14 -EXTSYM SfxR15,SfxR2,SfxR4,SfxR6,SfxR7,SfxR8,SfxRAMBR,SfxRAMMem,SfxROMBR -EXTSYM SfxRomBuffer,SfxSCBR,SfxSCMR,SfxSFR,SfxSignZero,SfxnRamBanks,flagnz -EXTSYM sfx128lineloc,sfx160lineloc,sfx192lineloc,sfxobjlineloc,sfxramdata -EXTSYM withr15sk,sfxclineloc,SCBRrel,ChangeOps -EXTSYM fxbit01pcal,fxbit23pcal,fxbit45pcal,fxbit67pcal -EXTSYM fxbit01,fxbit23,fxbit45,fxbit67 -EXTSYM fxxand -EXTSYM PLOTJmpa,PLOTJmpb - -NEWSYM FxEmu2CAsmStart - -%include "fxemu2.mac" -%include "fxemu2b.mac" -%include "fxemu2c.mac" - - - - -SECTION .text ;ALIGN=32 - -ALIGN32 -NEWSYM FxOpd00 ; STOP stop GSU execution (and maybe generate an IRQ) ; Verified. - FETCHPIPE - mov [SfxPIPE],cl - and dword [SfxSFR],0FFFFh-32 ; Clear Go flag (set to 1 when the GSU is running) - test dword [SfxCFGR],080h ; Check if the interrupt generation is on - jnz .NoIRQ - or dword [SfxSFR],08000h ; Set IRQ Flag -.NoIRQ - CLRFLAGS - inc ebp - mov eax,[NumberOfOpcodes] - add eax,0F0000000h - add [ChangeOps],eax - mov dword [NumberOfOpcodes],1 - jmp FXEndLoop - FXReturn - -NEWSYM FxOpd01 ; NOP no operation ; Verified. - FETCHPIPE - CLRFLAGS - inc ebp ; Increase program counter - FXReturn - -NEWSYM FxOpd02 ; CACHE reintialize GSU cache - mov eax,ebp - FETCHPIPE - sub eax,[SfxCPB] - and eax,0FFF0h - cmp dword [SfxCBR],eax - je .SkipUpdate - cmp byte [SfxCacheActive],1 - je .SkipUpdate - mov dword [SfxCBR],eax - mov dword [SfxCacheActive],1 - call FlushCache -.SkipUpdate - CLRFLAGS - inc ebp ; Increase program counter - FXReturn - -NEWSYM FxOpd03 ; LSR logic shift right ; Verified. - mov eax,[esi] ; Read Source - FETCHPIPE - mov [SfxCarry],al - and byte[SfxCarry],1 - shr ax,1 ; logic shift right - inc ebp ; Increase program counter - mov [edi],eax ; Write Destination - mov dword [SfxSignZero],eax - CLRFLAGS - FXReturn - -NEWSYM FxOpd04 ; ROL rotate left (RCL?) ; V - shr byte[SfxCarry],1 - mov eax,[esi] ; Read Source - FETCHPIPE - rcl ax,1 - rcl byte[SfxCarry],1 - inc ebp ; Increase program counter - mov [edi],eax ; Write Destination - mov [SfxSignZero],eax - CLRFLAGS - FXReturn - -NEWSYM FxOpd05 ; BRA branch always ; Verified. - movsx eax,byte[ebp] - mov cl,[ebp+1] - inc ebp - add ebp,eax - call [FxTable+ecx*4] - FXReturn2 - -NEWSYM FxOpd06 ; BGE branch on greater or equals ; Verified. - movsx eax,byte[ebp] - mov ebx,[SfxSignZero] - shr ebx,15 - inc ebp - xor bl,[SfxOverflow] - mov cl,[ebp] - test bl,01h - jnz .nojump - add ebp,eax - call [FxTable+ecx*4] - FXReturn2 -.nojump - inc ebp - call [FxTable+ecx*4] - FXReturn2 - -NEWSYM FxOpd07 ; BLT branch on lesss than ; Verified. - movsx eax,byte[ebp] - mov ebx,[SfxSignZero] - shr ebx,15 - inc ebp - xor bl,[SfxOverflow] - mov cl,[ebp] - test bl,01h - jz .nojump - add ebp,eax - call [FxTable+ecx*4] - FXReturn2 -.nojump - inc ebp - call [FxTable+ecx*4] - FXReturn2 - -NEWSYM FxOpd08 ; BNE branch on not equal ; Verified. - movsx eax,byte[ebp] - inc ebp - test dword[SfxSignZero],0FFFFh - mov cl,[ebp] - jz .nojump - add ebp,eax - call [FxTable+ecx*4] - FXReturn2 -.nojump - inc ebp - call [FxTable+ecx*4] - FXReturn2 - -NEWSYM FxOpd09 ; BEQ branch on equal (z=1) ; Verified. - movsx eax,byte[ebp] - inc ebp - test dword[SfxSignZero],0FFFFh - mov cl,[ebp] - jnz .nojump - add ebp,eax - call [FxTable+ecx*4] - FXReturn2 -.nojump - inc ebp - call [FxTable+ecx*4] - FXReturn2 - -NEWSYM FxOpd0A ; BPL branch on plus ; Verified. - movsx eax,byte[ebp] - inc ebp - test dword[SfxSignZero],088000h - mov cl,[ebp] - jnz .nojump - add ebp,eax - call [FxTable+ecx*4] - FXReturn2 -.nojump - inc ebp - call [FxTable+ecx*4] - FXReturn2 - -NEWSYM FxOpd0B ; BMI branch on minus ; Verified. - movsx eax,byte[ebp] - inc ebp - test dword[SfxSignZero],088000h - mov cl,[ebp] - jz .nojump - add ebp,eax - call [FxTable+ecx*4] - FXReturn2 -.nojump - inc ebp - call [FxTable+ecx*4] - FXReturn2 - -NEWSYM FxOpd0C ; BCC branch on carry clear ; Verified. - movsx eax,byte[ebp] - inc ebp - test byte[SfxCarry],01h - mov cl,[ebp] - jnz .nojump - add ebp,eax - call [FxTable+ecx*4] - FXReturn2 -.nojump - inc ebp - call [FxTable+ecx*4] - FXReturn2 - -NEWSYM FxOpd0D ; BCS branch on carry set ; Verified. - movsx eax,byte[ebp] - inc ebp - test byte[SfxCarry],01h - mov cl,[ebp] - jz .nojump - add ebp,eax - call [FxTable+ecx*4] - FXReturn2 -.nojump - inc ebp - call [FxTable+ecx*4] - FXReturn2 - -NEWSYM FxOpd0E ; BVC branch on overflow clear ; Verified. - movsx eax,byte[ebp] - inc ebp - test byte[SfxOverflow],01h - mov cl,[ebp] - jnz .nojump - add ebp,eax - call [FxTable+ecx*4] - FXReturn2 -.nojump - inc ebp - call [FxTable+ecx*4] - FXReturn2 - -NEWSYM FxOpd0F ; BVS branch on overflow set ; Verified. - movsx eax,byte[ebp] - inc ebp - test byte[SfxOverflow],01h - mov cl,[ebp] - jz .nojump - add ebp,eax - call [FxTable+ecx*4] - FXReturn2 -.nojump - inc ebp - call [FxTable+ecx*4] - FXReturn2 - -NEWSYM FxOpd10 ; TO RN set register n as destination register - TORNd 0 -NEWSYM FxOpd11 ; TO RN set register n as destination register - TORNd 1 -NEWSYM FxOpd12 ; TO RN set register n as destination register - TORNd 2 -NEWSYM FxOpd13 ; TO RN set register n as destination register - TORNd 3 -NEWSYM FxOpd14 ; TO RN set register n as destination register - TORNd 4 -NEWSYM FxOpd15 ; TO RN set register n as destination register - TORNd 5 -NEWSYM FxOpd16 ; TO RN set register n as destination register - TORNd 6 -NEWSYM FxOpd17 ; TO RN set register n as destination register - TORNd 7 -NEWSYM FxOpd18 ; TO RN set register n as destination register - TORNd 8 -NEWSYM FxOpd19 ; TO RN set register n as destination register - TORNd 9 -NEWSYM FxOpd1A ; TO RN set register n as destination register - TORNd 10 -NEWSYM FxOpd1B ; TO RN set register n as destination register - TORNd 11 -NEWSYM FxOpd1C ; TO RN set register n as destination register - TORNd 12 -NEWSYM FxOpd1D ; TO RN set register n as destination register - TORNd 13 -NEWSYM FxOpd1E ; TO RN set register n as destination register - FETCHPIPE - mov edi,SfxR0+14*4 - inc ebp - call [FxTable+ecx*4] - mov edi,SfxR0 - UpdateR14 - FXReturn -NEWSYM FxOpd1F ; TO RN set register n as destination register - FETCHPIPE - mov edi,SfxR0+15*4 - inc ebp - call [FxTable+ecx*4] - mov ebp,[SfxCPB] - add ebp,[SfxR15] - mov edi,SfxR0 - FXReturn - -NEWSYM FxOpd20 ; WITH set register n as source and destination register - WITHc 0 -NEWSYM FxOpd21 ; WITH set register n as source and destination register - WITHc 1 -NEWSYM FxOpd22 ; WITH set register n as source and destination register - WITHc 2 -NEWSYM FxOpd23 ; WITH set register n as source and destination register - WITHc 3 -NEWSYM FxOpd24 ; WITH set register n as source and destination register - WITHc 4 -NEWSYM FxOpd25 ; WITH set register n as source and destination register - WITHc 5 -NEWSYM FxOpd26 ; WITH set register n as source and destination register - WITHc 6 -NEWSYM FxOpd27 ; WITH set register n as source and destination register - WITHc 7 -NEWSYM FxOpd28 ; WITH set register n as source and destination register - WITHc 8 -NEWSYM FxOpd29 ; WITH set register n as source and destination register - WITHc 9 -NEWSYM FxOpd2A ; WITH set register n as source and destination register - WITHc 10 -NEWSYM FxOpd2B ; WITH set register n as source and destination register - WITHc 11 -NEWSYM FxOpd2C ; WITH set register n as source and destination register - WITHc 12 -NEWSYM FxOpd2D ; WITH set register n as source and destination register - WITHc 13 -NEWSYM FxOpd2E ; WITH set register n as source and destination register - FETCHPIPE - mov esi,SfxR0+14*4 - mov edi,SfxR0+14*4 - mov dword [SfxB],1 - inc ebp - call [FxTablec+ecx*4] - mov dword [SfxB],0 ; Clear B Flag - mov esi,SfxR0 - mov edi,SfxR0 - UpdateR14 - FXReturn -NEWSYM FxOpd2F ; WITH set register n as source and destination register - FETCHPIPE - mov esi,SfxR0+15*4 - mov edi,SfxR0+15*4 - mov dword [SfxB],1 - inc ebp - mov eax,ebp - sub eax,[SfxCPB] - mov dword[withr15sk],0 - mov [SfxR15],eax - call [FxTableb+ecx*4] - cmp dword[withr15sk],1 - je .skip - mov ebp,[SfxCPB] - add ebp,[SfxR15] -.skip - mov dword [SfxB],0 ; Clear B Flag - mov esi,SfxR0 - mov edi,SfxR0 - FXReturn - -NEWSYM FxOpd30 ; STW RN store word - STWRNc 0 -NEWSYM FxOpd31 ; STW RN store word - STWRNc 1 -NEWSYM FxOpd32 ; STW RN store word - STWRNc 2 -NEWSYM FxOpd33 ; STW RN store word - STWRNc 3 -NEWSYM FxOpd34 ; STW RN store word - STWRNc 4 -NEWSYM FxOpd35 ; STW RN store word - STWRNc 5 -NEWSYM FxOpd36 ; STW RN store word - STWRNc 6 -NEWSYM FxOpd37 ; STW RN store word - STWRNc 7 -NEWSYM FxOpd38 ; STW RN store word - STWRNc 8 -NEWSYM FxOpd39 ; STW RN store word - STWRNc 9 -NEWSYM FxOpd3A ; STW RN store word - STWRNc 10 -NEWSYM FxOpd3B ; STW RN store word - STWRNc 11 - -NEWSYM FxOpd30A1 ; STB RN store byte - STBRNc 0 -NEWSYM FxOpd31A1 ; STB RN store byte - STBRNc 1 -NEWSYM FxOpd32A1 ; STB RN store byte - STBRNc 2 -NEWSYM FxOpd33A1 ; STB RN store byte - STBRNc 3 -NEWSYM FxOpd34A1 ; STB RN store byte - STBRNc 4 -NEWSYM FxOpd35A1 ; STB RN store byte - STBRNc 5 -NEWSYM FxOpd36A1 ; STB RN store byte - STBRNc 6 -NEWSYM FxOpd37A1 ; STB RN store byte - STBRNc 7 -NEWSYM FxOpd38A1 ; STB RN store byte - STBRNc 8 -NEWSYM FxOpd39A1 ; STB RN store byte - STBRNc 9 -NEWSYM FxOpd3AA1 ; STB RN store byte - STBRNc 10 -NEWSYM FxOpd3BA1 ; STB RN store byte - STBRNc 11 - -NEWSYM FxOpd3C ; LOOP decrement loop counter, and branch on not zero ; V - dec word [SfxR12] ; decrement loop counter - FETCHPIPE - mov eax,[SfxR12] - mov [SfxSignZero],eax - or eax,eax - jz .NoBranch - mov eax,dword [SfxR13] - mov ebp,[SfxCPB] - add ebp,eax - CLRFLAGS - FXReturn -.NoBranch - inc ebp - CLRFLAGS - FXReturn - -NEWSYM FxOpd3D ; ALT1 set alt1 mode ; Verified. - FETCHPIPE - mov dword [SfxB],0 - or ch,01h - inc ebp - call [FxTable+ecx*4] - xor ch,ch - FXReturn - -NEWSYM FxOpd3E ; ALT2 set alt1 mode ; Verified. - FETCHPIPE - mov dword [SfxB],0 - or ch,02h - inc ebp - call [FxTable+ecx*4] - xor ch,ch - FXReturn - -NEWSYM FxOpd3F ; ALT3 set alt3 mode ; Verified. - FETCHPIPE - mov dword [SfxB],0 - or ch,03h - inc ebp - call [FxTable+ecx*4] - xor ch,ch - FXReturn - -NEWSYM FxOpd40 ; LDW RN load word from RAM - LDWRNc 0 -NEWSYM FxOpd41 ; LDW RN load word from RAM - LDWRNc 1 -NEWSYM FxOpd42 ; LDW RN load word from RAM - LDWRNc 2 -NEWSYM FxOpd43 ; LDW RN load word from RAM - LDWRNc 3 -NEWSYM FxOpd44 ; LDW RN load word from RAM - LDWRNc 4 -NEWSYM FxOpd45 ; LDW RN load word from RAM - LDWRNc 5 -NEWSYM FxOpd46 ; LDW RN load word from RAM - LDWRNc 6 -NEWSYM FxOpd47 ; LDW RN load word from RAM - LDWRNc 7 -NEWSYM FxOpd48 ; LDW RN load word from RAM - LDWRNc 8 -NEWSYM FxOpd49 ; LDW RN load word from RAM - LDWRNc 9 -NEWSYM FxOpd4A ; LDW RN load word from RAM - LDWRNc 10 -NEWSYM FxOpd4B ; LDW RN load word from RAM - LDWRNc 11 - -NEWSYM FxOpd40A1 ; LDB RN load byte from RAM - LDBRNc 0 -NEWSYM FxOpd41A1 ; LDB RN load byte from RAM - LDBRNc 1 -NEWSYM FxOpd42A1 ; LDB RN load byte from RAM - LDBRNc 2 -NEWSYM FxOpd43A1 ; LDB RN load byte from RAM - LDBRNc 3 -NEWSYM FxOpd44A1 ; LDB RN load byte from RAM - LDBRNc 4 -NEWSYM FxOpd45A1 ; LDB RN load byte from RAM - LDBRNc 5 -NEWSYM FxOpd46A1 ; LDB RN load byte from RAM - LDBRNc 6 -NEWSYM FxOpd47A1 ; LDB RN load byte from RAM - LDBRNc 7 -NEWSYM FxOpd48A1 ; LDB RN load byte from RAM - LDBRNc 8 -NEWSYM FxOpd49A1 ; LDB RN load byte from RAM - LDBRNc 9 -NEWSYM FxOpd4AA1 ; LDB RN load byte from RAM - LDBRNc 10 -NEWSYM FxOpd4BA1 ; LDB RN load byte from RAM - LDBRNc 11 - - -NEWSYM FxOpd4C1284b ; PLOT 4bit - plotlines4bb plotb -NEWSYM FxOpd4C1284bz ; PLOT 4bit, zero check - plotlines4bb plotbz -NEWSYM FxOpd4C1284bd ; PLOT 4bit, dither - plotlines4bb plotbd -NEWSYM FxOpd4C1284bzd ; PLOT 4bit, zero check + dither - plotlines4bb plotbzd - -NEWSYM FxOpd4C1282b ; PLOT 2bit - plotlines2bb plotb -NEWSYM FxOpd4C1282bz ; PLOT 2bit, zero check - plotlines2bb plotbz -NEWSYM FxOpd4C1282bd ; PLOT 2bit, dither - plotlines2bb plotbd -NEWSYM FxOpd4C1282bzd ; PLOT 2bit, zero check + dither - plotlines2bb plotbzd - -NEWSYM FxOpd4C1288b ; PLOT 8bit - plotlines8bb plotb -NEWSYM FxOpd4C1288bz ; PLOT 8bit, zero check - plotlines8bb plotbz -NEWSYM FxOpd4C1288bd ; PLOT 8bit, dither - plotlines8bb plotb -NEWSYM FxOpd4C1288bzd ; PLOT 8bit, zero check + dither - plotlines8bb plotbz - -NEWSYM FxOpd4C1288bl ; PLOT 8bit - plotlines8bbl plotb -NEWSYM FxOpd4C1288bzl ; PLOT 8bit, zero check - plotlines8bbl plotbz -NEWSYM FxOpd4C1288bdl ; PLOT 8bit, dither - plotlines8bbl plotb -NEWSYM FxOpd4C1288bzdl ; PLOT 8bit, zero check + dither - plotlines8bbl plotbz - -NEWSYM FxOpd4C ; PLOT plot pixel with R1,R2 as x,y and the color register as the color - jmp FxOpd4C1284b - - FETCHPIPE - inc ebp - CLRFLAGS - mov ebx,[SfxR2] - mov bh,[SfxR1] - mov eax,[sfxclineloc] - mov ebx,[eax+ebx*4] - cmp ebx,0FFFFFFFFh - je near .nodraw - xor eax,eax - ; bits 5/2 : 00 = 128 pixels, 01 = 160 pixels, 10 = 192 pixels, 11 = obj - ; bits 1/0 : 00 = 4 color, 01 = 16-color, 10 = not used, 11 = 256 color - ; 192 pixels = 24 tiles, 160 pixels = 20 tiles, 128 pixels = 16 tiles - ; 16+8(4/3) 16+4(4/2) 16(4/0) - push ecx - mov al,[SfxSCMR] - and al,00000011b ; 4 + 32 - cmp al,0 - je near .colors4 - cmp al,3 - je near .colors256 - - shl ebx,5 ; x32 (16 colors) - mov al,[SfxSCBR] - shl eax,10 ; Get SFX address - add eax,ebx - add eax,[sfxramdata] - mov ebx,[SfxR2] - and ebx,07h - shl ebx,1 - add eax,ebx - mov cl,[SfxR1] - and cl,07h - xor cl,07h - mov bl,1 - shl bl,cl - mov bh,bl - xor bh,0FFh - pop ecx - test byte[SfxPOR],01h - jnz .nozerocheck_16 - test byte[SfxCOLR],0Fh - jz .nodraw -.nozerocheck_16 - mov dl,[SfxCOLR] - test byte[SfxPOR],02h - jz .nodither4b - mov dh,[SfxR1] - xor dh,[SfxR2] - test dh,01h - jz .nodither4b - shr dh,4 -.nodither4b - and byte[eax],bh - and byte[eax+1],bh - and byte[eax+16],bh - and byte[eax+17],bh - test dl,01h - jz .nodraw_16 - or byte[eax], bl -.nodraw_16 - test dl,02h - jz .nodraw2_16 - or byte[eax+1], bl -.nodraw2_16 - test dl,04h - jz .nodraw3_16 - or byte[eax+16],bl -.nodraw3_16 - test dl,08h - jz .nodraw4_16 - or byte[eax+17],bl -.nodraw4_16 -.nodraw - inc word [SfxR1] - FXReturn - -.colors4 - shl ebx,4 ; x16 (4 colors) - mov al,[SfxSCBR] - shl eax,10 ; Get SFX address - add eax,ebx - add eax,[sfxramdata] - mov ebx,[SfxR2] - and ebx,07h - shl ebx,1 - add eax,ebx - mov cl,[SfxR1] - and cl,07h - xor cl,07h - mov bl,1 - shl bl,cl - mov bh,bl - xor bh,0FFh - pop ecx - test byte[SfxPOR],01h - jnz .nozerocheck_4 - test byte[SfxCOLR],03h - jz .noplot_4 -.nozerocheck_4 - mov dl,[SfxCOLR] - test byte[SfxPOR],02h - jz .nodither2b - mov dh,[SfxR1] - xor dh,[SfxR2] - test dh,01h - jz .nodither2b - shr dh,4 -.nodither2b - and byte[eax],bh - and byte[eax+1],bh - test dl,01h - jz .nodraw_4 - or byte[eax], bl -.nodraw_4 - test dl,02h - jz .nodraw2_4 - or byte[eax+1], bl -.nodraw2_4 -.noplot_4 - inc word [SfxR1] - FXReturn - -.colors256 - shl ebx,6 ; x64 (256 colors) - mov al,[SfxSCBR] - shl eax,10 ; Get SFX address - add eax,ebx - add eax,[sfxramdata] - mov ebx,[SfxR2] - and ebx,07h - shl ebx,1 - add eax,ebx - mov cl,[SfxR1] - and cl,07h - xor cl,07h - mov bl,1 - shl bl,cl - mov bh,bl - xor bh,0FFh - pop ecx - test byte[SfxPOR],01h - jnz .nozerocheck_256 - mov dl,0FFh - test byte[SfxPOR],08h - jz .nozerocheckb_256 - mov dl,0Fh -.nozerocheckb_256 - test byte[SfxCOLR],dl - jz .noplot_256 -.nozerocheck_256 - mov dl,[SfxCOLR] - and byte[eax],bh - and byte[eax+1],bh - and byte[eax+16],bh - and byte[eax+17],bh - and byte[eax+32],bh - and byte[eax+33],bh - and byte[eax+48],bh - and byte[eax+49],bh - test dl,01h - jz .nodraw_256 - or byte[eax], bl -.nodraw_256 - test dl,02h - jz .nodraw2_256 - or byte[eax+1], bl -.nodraw2_256 - test dl,04h - jz .nodraw3_256 - or byte[eax+16],bl -.nodraw3_256 - test dl,08h - jz .nodraw4_256 - or byte[eax+17],bl -.nodraw4_256 - test dl,10h - jz .nodraw5_256 - or byte[eax+32], bl -.nodraw5_256 - test dl,20h - jz .nodraw6_256 - or byte[eax+33], bl -.nodraw6_256 - test dl,40h - jz .nodraw7_256 - or byte[eax+48],bl -.nodraw7_256 - test dl,80h - jz .nodraw8_256 - or byte[eax+49],bl -.nodraw8_256 -.noplot_256 - inc word [SfxR1] - FXReturn - -SECTION .bss -.prevx resw 1 -.prevy resw 1 - -SECTION .text - -NEWSYM FxOpd4CA1 ; RPIX read color of the pixel with R1,R2 as x,y - FETCHPIPE - mov ebx,[SfxR2] - mov bh,[SfxR1] - test byte[SfxPOR],10h - jnz .objmode - mov al,[SfxSCMR] - and al,00100100b ; 4 + 32 - cmp al,4 - je .lines160 - cmp al,32 - je .lines192 - cmp al,36 - je .objmode - mov eax,[sfx128lineloc] - jmp .donelines -.lines160 - mov eax,[sfx160lineloc] - jmp .donelines -.lines192 - mov eax,[sfx192lineloc] - jmp .donelines -.objmode - mov eax,[sfxobjlineloc] -.donelines - mov ebx,[eax+ebx*4] - cmp ebx,0FFFFFFFFh - je near .nodraw - xor eax,eax - ; bits 5/2 : 00 = 128 pixels, 01 = 160 pixels, 10 = 192 pixels, 11 = obj - ; bits 1/0 : 00 = 4 color, 01 = 16-color, 10 = not used, 11 = 256 color - ; 192 pixels = 24 tiles, 160 pixels = 20 tiles, 128 pixels = 16 tiles - ; 16+8(4/3) 16+4(4/2) 16(4/0) - push ecx - mov al,[SfxSCMR] - and al,00000011b ; 4 + 32 - - cmp al,0 - je near .colors4 - cmp al,3 - je near .colors256 - - shl ebx,5 ; x32 (16 colors) - mov al,[SfxSCBR] - shl eax,10 ; Get SFX address - add eax,ebx - add eax,[sfxramdata] - mov ebx,[SfxR2] - and ebx,07h - shl ebx,1 - add eax,ebx - mov cl,[SfxR1] - and cl,07h - xor cl,07h - mov bl,1 - shl bl,cl - pop ecx - xor bh,bh - test byte[eax],bl - jz .nodraw_16 - or bh,01h -.nodraw_16 - test byte[eax+1],bl - jz .nodraw2_16 - or bh,02h -.nodraw2_16 - test byte[eax+16],bl - jz .nodraw3_16 - or bh,04h -.nodraw3_16 - test byte[eax+17],bl - jz .nodraw4_16 - or bh,08h -.nodraw4_16 -.nodraw - mov bl,bh - and ebx,0FFh - inc ebp -; UpdateR14 - CLRFLAGS - mov [edi],ebx ; Write Destination - mov [flagnz],ebx - FXReturn - -.colors4 - shl ebx,4 ; x16 (4 colors) - mov al,[SfxSCBR] - shl eax,10 ; Get SFX address - add eax,ebx - add eax,[sfxramdata] - mov ebx,[SfxR2] - and ebx,07h - shl ebx,1 - add eax,ebx - mov cl,[SfxR1] - and cl,07h - xor cl,07h - mov bl,1 - shl bl,cl - mov bh,bl - xor bh,0FFh - pop ecx - xor bh,bh - test byte[eax],bl - jz .nodraw_4 - or bh,01h -.nodraw_4 - test byte[eax+1],bl - jz .nodraw2_4 - or bh,02h -.nodraw2_4 - mov bl,bh - and ebx,0FFh - inc ebp -; UpdateR14 - CLRFLAGS - mov [edi],ebx ; Write Destination - mov [flagnz],ebx - FXReturn - -.colors256 - shl ebx,6 ; x64 (256 colors) - mov al,[SfxSCBR] - shl eax,10 ; Get SFX address - add eax,ebx - add eax,[sfxramdata] - mov ebx,[SfxR2] - and ebx,07h - shl ebx,1 - add eax,ebx - mov cl,[SfxR1] - and cl,07h - xor cl,07h - mov bl,1 - shl bl,cl - mov bh,bl - xor bh,0FFh - pop ecx - xor bh,bh - test byte[eax],bl - jz .nodraw_256 - or bh,01h -.nodraw_256 - test byte[eax+1],bl - jz .nodraw2_256 - or bh,02h -.nodraw2_256 - test byte[eax+16],bl - jz .nodraw3_256 - or bh,04h -.nodraw3_256 - test byte[eax+17],bl - jz .nodraw4_256 - or bh,08h -.nodraw4_256 - test byte[eax+32],bl - jz .nodraw5_256 - or bh,10h -.nodraw5_256 - test byte[eax+33],bl - jz .nodraw6_256 - or bh,20h -.nodraw6_256 - test byte[eax+48],bl - jz .nodraw7_256 - or bh,40h -.nodraw7_256 - test byte[eax+49],bl - jz .nodraw8_256 - or bh,80h -.nodraw8_256 - mov bl,bh - and ebx,0FFh - inc ebp -; UpdateR14 - CLRFLAGS - mov [edi],ebx ; Write Destination - mov [flagnz],ebx - FXReturn - -NEWSYM FxOpd4D ; SWAP swap upper and lower byte of a register ; V - mov eax,[esi] ; Read Source - FETCHPIPE - ror ax,8 - inc ebp ; Increase program counter - mov [SfxSignZero],eax - mov [edi],eax ; Write Destination - CLRFLAGS - FXReturn - -NEWSYM FxOpd4E ; COLOR copy source register to color register ; V - FETCHPIPE - mov eax,[esi] ; Read Source - ; if bit 3 of SfxPOR is set, then don't modify the upper 4 bits - test byte[SfxPOR],04h - jz .nohighnibble - mov bl,al - shr bl,4 - and al,0F0h - or al,bl -.nohighnibble - test byte[SfxPOR],08h - jnz .preserveupper - cmp [SfxCOLR],al - je .nocolchange - mov [SfxCOLR],al - and eax,0FFh - mov ebx,[fxbit01+eax*4] - mov [fxbit01pcal],ebx - mov ebx,[fxbit23+eax*4] - mov [fxbit23pcal],ebx - mov ebx,[fxbit45+eax*4] - mov [fxbit45pcal],ebx - mov ebx,[fxbit67+eax*4] - mov [fxbit67pcal],ebx -.nocolchange - CLRFLAGS - inc ebp ; Increase program counter - FXReturn -.preserveupper - mov bl,[SfxCOLR] - and al,0Fh - and bl,0F0h - or al,bl - cmp [SfxCOLR],al - je .nocolchange - mov [SfxCOLR],al - and eax,0FFh - mov ebx,[fxbit01+eax*4] - mov [fxbit01pcal],ebx - mov ebx,[fxbit23+eax*4] - mov [fxbit23pcal],ebx - mov ebx,[fxbit45+eax*4] - mov [fxbit45pcal],ebx - mov ebx,[fxbit67+eax*4] - mov [fxbit67pcal],ebx - CLRFLAGS - inc ebp ; Increase program counter - FXReturn - -NEWSYM FxOpd4EA1 ; CMODE set plot option register ; V - FETCHPIPE - mov eax,[esi] ; Read Source - inc ebp ; Increase program counter - mov dword [SfxPOR],eax - - test byte[SfxPOR],10h - jnz .objmode - mov al,[SfxSCMR] - and al,00100100b ; 4 + 32 - cmp al,4 - je .lines160 - cmp al,32 - je .lines192 - cmp al,36 - je .objmode - mov eax,[sfx128lineloc] - jmp .donelines -.lines160 - mov eax,[sfx160lineloc] - jmp .donelines -.lines192 - mov eax,[sfx192lineloc] - jmp .donelines -.objmode - mov eax,[sfxobjlineloc] -.donelines - mov [sfxclineloc],eax - - - push ebx - mov al,[SfxSCMR] - and eax,00000011b - mov bl,[SfxPOR] - and bl,0Fh - shl bl,2 - or al,bl - mov ebx,[PLOTJmpb+eax*4] - mov eax,[PLOTJmpa+eax*4] - - mov dword [FxTable+4Ch*4],eax - mov dword [FxTableb+4Ch*4],eax - mov dword [FxTablec+4Ch*4],eax - mov dword [FxTabled+4Ch*4],ebx - pop ebx - - CLRFLAGS - FXReturn - -NEWSYM FxOpd4F ; NOT perform exclusive exor with 1 on all bits ; V - mov eax,[esi] ; Read Source - FETCHPIPE - xor eax,0FFFFh - inc ebp ; Increase program counter - mov [SfxSignZero],eax - mov [edi],eax ; Write Destination - CLRFLAGS - FXReturn - -NEWSYM FxOpd50 ; ADD RN add, register + register - ADDRNc 0 -NEWSYM FxOpd51 ; ADD RN add, register + register - ADDRNc 1 -NEWSYM FxOpd52 ; ADD RN add, register + register - ADDRNc 2 -NEWSYM FxOpd53 ; ADD RN add, register + register - ADDRNc 3 -NEWSYM FxOpd54 ; ADD RN add, register + register - ADDRNc 4 -NEWSYM FxOpd55 ; ADD RN add, register + register - ADDRNc 5 -NEWSYM FxOpd56 ; ADD RN add, register + register - ADDRNc 6 -NEWSYM FxOpd57 ; ADD RN add, register + register - ADDRNc 7 -NEWSYM FxOpd58 ; ADD RN add, register + register - ADDRNc 8 -NEWSYM FxOpd59 ; ADD RN add, register + register - ADDRNc 9 -NEWSYM FxOpd5A ; ADD RN add, register + register - ADDRNc 10 -NEWSYM FxOpd5B ; ADD RN add, register + register - ADDRNc 11 -NEWSYM FxOpd5C ; ADD RN add, register + register - ADDRNc 12 -NEWSYM FxOpd5D ; ADD RN add, register + register - ADDRNc 13 -NEWSYM FxOpd5E ; ADD RN add, register + register - ADDRNc 14 -NEWSYM FxOpd5F ; ADD RN add, register + register - FETCHPIPE - mov eax, [esi] ; Read Source - mov ebx,ebp - sub ebx,[SfxCPB] - add ax,bx - seto byte[SfxOverflow] - setc byte[SfxCarry] - mov [SfxSignZero],eax - inc ebp ; Increase program counter - mov [edi],eax ; Write Destination - CLRFLAGS - FXReturn - -NEWSYM FxOpd50A1 ; ADC RN add with carry, register + register - ADCRNc 0 -NEWSYM FxOpd51A1 ; ADC RN add with carry, register + register - ADCRNc 1 -NEWSYM FxOpd52A1 ; ADC RN add with carry, register + register - ADCRNc 2 -NEWSYM FxOpd53A1 ; ADC RN add with carry, register + register - ADCRNc 3 -NEWSYM FxOpd54A1 ; ADC RN add with carry, register + register - ADCRNc 4 -NEWSYM FxOpd55A1 ; ADC RN add with carry, register + register - ADCRNc 5 -NEWSYM FxOpd56A1 ; ADC RN add with carry, register + register - ADCRNc 6 -NEWSYM FxOpd57A1 ; ADC RN add with carry, register + register - ADCRNc 7 -NEWSYM FxOpd58A1 ; ADC RN add with carry, register + register - ADCRNc 8 -NEWSYM FxOpd59A1 ; ADC RN add with carry, register + register - ADCRNc 9 -NEWSYM FxOpd5AA1 ; ADC RN add with carry, register + register - ADCRNc 10 -NEWSYM FxOpd5BA1 ; ADC RN add with carry, register + register - ADCRNc 11 -NEWSYM FxOpd5CA1 ; ADC RN add with carry, register + register - ADCRNc 12 -NEWSYM FxOpd5DA1 ; ADC RN add with carry, register + register - ADCRNc 13 -NEWSYM FxOpd5EA1 ; ADC RN add with carry, register + register - ADCRNc 14 -NEWSYM FxOpd5FA1 ; ADC RN add with carry, register + register - FETCHPIPE - mov eax, [esi] ; Read Source - mov ebx,ebp - sub ebx,[SfxCPB] - shr byte[SfxCarry],1 - adc ax,bx - seto byte[SfxOverflow] - setc byte[SfxCarry] - mov [SfxSignZero],eax - inc ebp ; Increase program counter - mov [edi],eax ; Write Destination - CLRFLAGS - FXReturn - -; Weird Opdode (FxOpd50A2, add 0, wow!) -NEWSYM FxOpd50A2 ; ADI RN add, register + immediate - ADIRNc 0 -NEWSYM FxOpd51A2 ; ADI RN add, register + immediate - ADIRNc 1 -NEWSYM FxOpd52A2 ; ADI RN add, register + immediate - ADIRNc 2 -NEWSYM FxOpd53A2 ; ADI RN add, register + immediate - ADIRNc 3 -NEWSYM FxOpd54A2 ; ADI RN add, register + immediate - ADIRNc 4 -NEWSYM FxOpd55A2 ; ADI RN add, register + immediate - ADIRNc 5 -NEWSYM FxOpd56A2 ; ADI RN add, register + immediate - ADIRNc 6 -NEWSYM FxOpd57A2 ; ADI RN add, register + immediate - ADIRNc 7 -NEWSYM FxOpd58A2 ; ADI RN add, register + immediate - ADIRNc 8 -NEWSYM FxOpd59A2 ; ADI RN add, register + immediate - ADIRNc 9 -NEWSYM FxOpd5AA2 ; ADI RN add, register + immediate - ADIRNc 10 -NEWSYM FxOpd5BA2 ; ADI RN add, register + immediate - ADIRNc 11 -NEWSYM FxOpd5CA2 ; ADI RN add, register + immediate - ADIRNc 12 -NEWSYM FxOpd5DA2 ; ADI RN add, register + immediate - ADIRNc 13 -NEWSYM FxOpd5EA2 ; ADI RN add, register + immediate - ADIRNc 14 -NEWSYM FxOpd5FA2 ; ADI RN add, register + immediate - ADIRNc 15 - -; Another very useful Opdode -NEWSYM FxOpd50A3 ; ADCIRN add with carry, register + immediate - ADCIRNc 0 -NEWSYM FxOpd51A3 ; ADCIRN add with carry, register + immediate - ADCIRNc 1 -NEWSYM FxOpd52A3 ; ADCIRN add with carry, register + immediate - ADCIRNc 2 -NEWSYM FxOpd53A3 ; ADCIRN add with carry, register + immediate - ADCIRNc 3 -NEWSYM FxOpd54A3 ; ADCIRN add with carry, register + immediate - ADCIRNc 4 -NEWSYM FxOpd55A3 ; ADCIRN add with carry, register + immediate - ADCIRNc 5 -NEWSYM FxOpd56A3 ; ADCIRN add with carry, register + immediate - ADCIRNc 6 -NEWSYM FxOpd57A3 ; ADCIRN add with carry, register + immediate - ADCIRNc 7 -NEWSYM FxOpd58A3 ; ADCIRN add with carry, register + immediate - ADCIRNc 8 -NEWSYM FxOpd59A3 ; ADCIRN add with carry, register + immediate - ADCIRNc 9 -NEWSYM FxOpd5AA3 ; ADCIRN add with carry, register + immediate - ADCIRNc 10 -NEWSYM FxOpd5BA3 ; ADCIRN add with carry, register + immediate - ADCIRNc 11 -NEWSYM FxOpd5CA3 ; ADCIRN add with carry, register + immediate - ADCIRNc 12 -NEWSYM FxOpd5DA3 ; ADCIRN add with carry, register + immediate - ADCIRNc 13 -NEWSYM FxOpd5EA3 ; ADCIRN add with carry, register + immediate - ADCIRNc 14 -NEWSYM FxOpd5FA3 ; ADCIRN add with carry, register + immediate - ADCIRNc 15 - -NEWSYM FxOpd60 ; SUBRN subtract, register - register - SUBRNc 0 -NEWSYM FxOpd61 ; SUBRN subtract, register - register - SUBRNc 1 -NEWSYM FxOpd62 ; SUBRN subtract, register - register - SUBRNc 2 -NEWSYM FxOpd63 ; SUBRN subtract, register - register - SUBRNc 3 -NEWSYM FxOpd64 ; SUBRN subtract, register - register - SUBRNc 4 -NEWSYM FxOpd65 ; SUBRN subtract, register - register - SUBRNc 5 -NEWSYM FxOpd66 ; SUBRN subtract, register - register - SUBRNc 6 -NEWSYM FxOpd67 ; SUBRN subtract, register - register - SUBRNc 7 -NEWSYM FxOpd68 ; SUBRN subtract, register - register - SUBRNc 8 -NEWSYM FxOpd69 ; SUBRN subtract, register - register - SUBRNc 9 -NEWSYM FxOpd6A ; SUBRN subtract, register - register - SUBRNc 10 -NEWSYM FxOpd6B ; SUBRN subtract, register - register - SUBRNc 11 -NEWSYM FxOpd6C ; SUBRN subtract, register - register - SUBRNc 12 -NEWSYM FxOpd6D ; SUBRN subtract, register - register - SUBRNc 13 -NEWSYM FxOpd6E ; SUBRN subtract, register - register - SUBRNc 14 -NEWSYM FxOpd6F ; SUBRN subtract, register - register - FETCHPIPE - mov eax,[esi] ; Read Source - mov ebx,ebp - sub ebx,[SfxCPB] - sub ax,bx - seto byte[SfxOverflow] - setc byte[SfxCarry] - xor byte[SfxCarry],1 - inc ebp ; Increase program counter - mov [edi],eax ; Write Destination - mov [SfxSignZero],eax - CLRFLAGS - FXReturn - -NEWSYM FxOpd60A1 ; SBCRN subtract with carry, register - register - SBCRNc 0 -NEWSYM FxOpd61A1 ; SBCRN subtract with carry, register - register - SBCRNc 1 -NEWSYM FxOpd62A1 ; SBCRN subtract with carry, register - register - SBCRNc 2 -NEWSYM FxOpd63A1 ; SBCRN subtract with carry, register - register - SBCRNc 3 -NEWSYM FxOpd64A1 ; SBCRN subtract with carry, register - register - SBCRNc 4 -NEWSYM FxOpd65A1 ; SBCRN subtract with carry, register - register - SBCRNc 5 -NEWSYM FxOpd66A1 ; SBCRN subtract with carry, register - register - SBCRNc 6 -NEWSYM FxOpd67A1 ; SBCRN subtract with carry, register - register - SBCRNc 7 -NEWSYM FxOpd68A1 ; SBCRN subtract with carry, register - register - SBCRNc 8 -NEWSYM FxOpd69A1 ; SBCRN subtract with carry, register - register - SBCRNc 9 -NEWSYM FxOpd6AA1 ; SBCRN subtract with carry, register - register - SBCRNc 10 -NEWSYM FxOpd6BA1 ; SBCRN subtract with carry, register - register - SBCRNc 11 -NEWSYM FxOpd6CA1 ; SBCRN subtract with carry, register - register - SBCRNc 12 -NEWSYM FxOpd6DA1 ; SBCRN subtract with carry, register - register - SBCRNc 13 -NEWSYM FxOpd6EA1 ; SBCRN subtract with carry, register - register - SBCRNc 14 -NEWSYM FxOpd6FA1 ; SBCRN subtract with carry, register - register - mov eax,[esi] ; Read Source - mov ebx,ebp - FETCHPIPE - sub ebx,[SfxCPB] - cmp byte[SfxCarry],1 - sbb ax,bx - seto byte[SfxOverflow] - setc byte[SfxCarry] - xor byte[SfxCarry],1 - inc ebp ; Increase program counter - mov [edi],eax ; Write Destination - mov [SfxSignZero],eax - CLRFLAGS - FXReturn - -NEWSYM FxOpd60A2 ; SUBIRN subtract, register - immediate - SUBIRNc 0 -NEWSYM FxOpd61A2 ; SUBIRN subtract, register - immediate - SUBIRNc 1 -NEWSYM FxOpd62A2 ; SUBIRN subtract, register - immediate - SUBIRNc 2 -NEWSYM FxOpd63A2 ; SUBIRN subtract, register - immediate - SUBIRNc 3 -NEWSYM FxOpd64A2 ; SUBIRN subtract, register - immediate - SUBIRNc 4 -NEWSYM FxOpd65A2 ; SUBIRN subtract, register - immediate - SUBIRNc 5 -NEWSYM FxOpd66A2 ; SUBIRN subtract, register - immediate - SUBIRNc 6 -NEWSYM FxOpd67A2 ; SUBIRN subtract, register - immediate - SUBIRNc 7 -NEWSYM FxOpd68A2 ; SUBIRN subtract, register - immediate - SUBIRNc 8 -NEWSYM FxOpd69A2 ; SUBIRN subtract, register - immediate - SUBIRNc 9 -NEWSYM FxOpd6AA2 ; SUBIRN subtract, register - immediate - SUBIRNc 10 -NEWSYM FxOpd6BA2 ; SUBIRN subtract, register - immediate - SUBIRNc 11 -NEWSYM FxOpd6CA2 ; SUBIRN subtract, register - immediate - SUBIRNc 12 -NEWSYM FxOpd6DA2 ; SUBIRN subtract, register - immediate - SUBIRNc 13 -NEWSYM FxOpd6EA2 ; SUBIRN subtract, register - immediate - SUBIRNc 14 -NEWSYM FxOpd6FA2 ; SUBIRN subtract, register - immediate - SUBIRNc 15 - -NEWSYM FxOpd60A3 ; CMPRN compare, register, register - CMPRNc 0 -NEWSYM FxOpd61A3 ; CMPRN compare, register, register - CMPRNc 1 -NEWSYM FxOpd62A3 ; CMPRN compare, register, register - CMPRNc 2 -NEWSYM FxOpd63A3 ; CMPRN compare, register, register - CMPRNc 3 -NEWSYM FxOpd64A3 ; CMPRN compare, register, register - CMPRNc 4 -NEWSYM FxOpd65A3 ; CMPRN compare, register, register - CMPRNc 5 -NEWSYM FxOpd66A3 ; CMPRN compare, register, register - CMPRNc 6 -NEWSYM FxOpd67A3 ; CMPRN compare, register, register - CMPRNc 7 -NEWSYM FxOpd68A3 ; CMPRN compare, register, register - CMPRNc 8 -NEWSYM FxOpd69A3 ; CMPRN compare, register, register - CMPRNc 9 -NEWSYM FxOpd6AA3 ; CMPRN compare, register, register - CMPRNc 10 -NEWSYM FxOpd6BA3 ; CMPRN compare, register, register - CMPRNc 11 -NEWSYM FxOpd6CA3 ; CMPRN compare, register, register - CMPRNc 12 -NEWSYM FxOpd6DA3 ; CMPRN compare, register, register - CMPRNc 13 -NEWSYM FxOpd6EA3 ; CMPRN compare, register, register - CMPRNc 14 -NEWSYM FxOpd6FA3 ; CMPRN compare, register, register - FETCHPIPE - mov eax,[esi] ; Read Source - mov ebx,ebp - sub ebx,[SfxCPB] - sub ax,bx - seto byte[SfxOverflow] - setc byte[SfxCarry] - xor byte[SfxCarry],1 - mov [SfxSignZero],eax - CLRFLAGS - inc ebp ; Increase program counter - FXReturn - -NEWSYM FxOpd70 ; MERGE R7 as upper byte, R8 as lower byte (used for texture-mapping) */ - ; V - xor eax,eax - FETCHPIPE - mov ah,byte [SfxR7+1] - mov al,byte [SfxR8+1] - inc ebp - mov [edi],eax ; Write Destination - mov dword[SfxSignZero],0001h - test eax,0F0F0h - jz .nozero - mov dword[SfxSignZero],0000h -.nozero - test eax,08080h - jz .nosign - or dword [SfxSignZero],80000h -.nosign - mov dword [SfxOverflow],1 - test ax,0c0c0h - jnz .Overflow - mov dword [SfxOverflow],0 -.Overflow - mov dword [SfxCarry],1 - test ax,0e0e0h - jnz .Carry - mov dword [SfxCarry],0 -.Carry - CLRFLAGS - FXReturn - -NEWSYM FxOpd71 ; AND RN register & register - ANDRNc 1 -NEWSYM FxOpd72 ; AND RN register & register - ANDRNc 2 -NEWSYM FxOpd73 ; AND RN register & register - ANDRNc 3 -NEWSYM FxOpd74 ; AND RN register & register - ANDRNc 4 -NEWSYM FxOpd75 ; AND RN register & register - ANDRNc 5 -NEWSYM FxOpd76 ; AND RN register & register - ANDRNc 6 -NEWSYM FxOpd77 ; AND RN register & register - ANDRNc 7 -NEWSYM FxOpd78 ; AND RN register & register - ANDRNc 8 -NEWSYM FxOpd79 ; AND RN register & register - ANDRNc 9 -NEWSYM FxOpd7A ; AND RN register & register - ANDRNc 10 -NEWSYM FxOpd7B ; AND RN register & register - ANDRNc 11 -NEWSYM FxOpd7C ; AND RN register & register - ANDRNc 12 -NEWSYM FxOpd7D ; AND RN register & register - ANDRNc 13 -NEWSYM FxOpd7E ; AND RN register & register - ANDRNc 14 -NEWSYM FxOpd7F ; AND RN register & register - FETCHPIPE - mov eax,[esi] ; Read Source - mov ebx,ebp - sub ebx,[SfxCPB] - and eax,ebx - inc ebp - mov dword [SfxSignZero],eax - mov [edi],eax ; Write Destination - CLRFLAGS - FXReturn - -NEWSYM FxOpd71A1 ; BIC RN register & ~register - BICRNc 1 -NEWSYM FxOpd72A1 ; BIC RN register & ~register - BICRNc 2 -NEWSYM FxOpd73A1 ; BIC RN register & ~register - BICRNc 3 -NEWSYM FxOpd74A1 ; BIC RN register & ~register - BICRNc 4 -NEWSYM FxOpd75A1 ; BIC RN register & ~register - BICRNc 5 -NEWSYM FxOpd76A1 ; BIC RN register & ~register - BICRNc 6 -NEWSYM FxOpd77A1 ; BIC RN register & ~register - BICRNc 7 -NEWSYM FxOpd78A1 ; BIC RN register & ~register - BICRNc 8 -NEWSYM FxOpd79A1 ; BIC RN register & ~register - BICRNc 9 -NEWSYM FxOpd7AA1 ; BIC RN register & ~register - BICRNc 10 -NEWSYM FxOpd7BA1 ; BIC RN register & ~register - BICRNc 11 -NEWSYM FxOpd7CA1 ; BIC RN register & ~register - BICRNc 12 -NEWSYM FxOpd7DA1 ; BIC RN register & ~register - BICRNc 13 -NEWSYM FxOpd7EA1 ; BIC RN register & ~register - BICRNc 14 -NEWSYM FxOpd7FA1 ; BIC RN register & ~register - FETCHPIPE - mov ebx,ebp - sub ebx,[SfxCPB] - mov eax,[esi] ; Read Source - xor ebx,0FFFFh - and eax,ebx - inc ebp - mov dword [SfxSignZero],eax - mov [edi],eax ; Write Destination - CLRFLAGS - FXReturn - -NEWSYM FxOpd71A2 ; ANDIRNc and #n - register & immediate - ANDIRNc 1 -NEWSYM FxOpd72A2 ; ANDIRNc and #n - register & immediate - ANDIRNc 2 -NEWSYM FxOpd73A2 ; ANDIRNc and #n - register & immediate - ANDIRNc 3 -NEWSYM FxOpd74A2 ; ANDIRNc and #n - register & immediate - ANDIRNc 4 -NEWSYM FxOpd75A2 ; ANDIRNc and #n - register & immediate - ANDIRNc 5 -NEWSYM FxOpd76A2 ; ANDIRNc and #n - register & immediate - ANDIRNc 6 -NEWSYM FxOpd77A2 ; ANDIRNc and #n - register & immediate - ANDIRNc 7 -NEWSYM FxOpd78A2 ; ANDIRNc and #n - register & immediate - ANDIRNc 8 -NEWSYM FxOpd79A2 ; ANDIRNc and #n - register & immediate - ANDIRNc 9 -NEWSYM FxOpd7AA2 ; ANDIRNc and #n - register & immediate - ANDIRNc 10 -NEWSYM FxOpd7BA2 ; ANDIRNc and #n - register & immediate - ANDIRNc 11 -NEWSYM FxOpd7CA2 ; ANDIRNc and #n - register & immediate - ANDIRNc 12 -NEWSYM FxOpd7DA2 ; ANDIRNc and #n - register & immediate - ANDIRNc 13 -NEWSYM FxOpd7EA2 ; ANDIRNc and #n - register & immediate - ANDIRNc 14 -NEWSYM FxOpd7FA2 ; ANDIRNc and #n - register & immediate - ANDIRNc 15 - -NEWSYM FxOpd71A3 ; BICIRNc register & ~immediate - BICIRNc 1 ^ 0FFFFh -NEWSYM FxOpd72A3 ; BICIRNc register & ~immediate - BICIRNc 2 ^ 0FFFFh -NEWSYM FxOpd73A3 ; BICIRNc register & ~immediate - BICIRNc 3 ^ 0FFFFh -NEWSYM FxOpd74A3 ; BICIRNc register & ~immediate - BICIRNc 4 ^ 0FFFFh -NEWSYM FxOpd75A3 ; BICIRNc register & ~immediate - BICIRNc 5 ^ 0FFFFh -NEWSYM FxOpd76A3 ; BICIRNc register & ~immediate - BICIRNc 6 ^ 0FFFFh -NEWSYM FxOpd77A3 ; BICIRNc register & ~immediate - BICIRNc 7 ^ 0FFFFh -NEWSYM FxOpd78A3 ; BICIRNc register & ~immediate - BICIRNc 8 ^ 0FFFFh -NEWSYM FxOpd79A3 ; BICIRNc register & ~immediate - BICIRNc 9 ^ 0FFFFh -NEWSYM FxOpd7AA3 ; BICIRNc register & ~immediate - BICIRNc 10 ^ 0FFFFh -NEWSYM FxOpd7BA3 ; BICIRNc register & ~immediate - BICIRNc 11 ^ 0FFFFh -NEWSYM FxOpd7CA3 ; BICIRNc register & ~immediate - BICIRNc 12 ^ 0FFFFh -NEWSYM FxOpd7DA3 ; BICIRNc register & ~immediate - BICIRNc 13 ^ 0FFFFh -NEWSYM FxOpd7EA3 ; BICIRNc register & ~immediate - BICIRNc 14 ^ 0FFFFh -NEWSYM FxOpd7FA3 ; BICIRNc register & ~immediate - BICIRNc 15 ^ 0FFFFh - -NEWSYM FxOpd80 ; MULTRNc 8 bit to 16 bit signed multiply, register * register - MULTRNc 0 -NEWSYM FxOpd81 ; MULTRNc 8 bit to 16 bit signed multiply, register * register - MULTRNc 1 -NEWSYM FxOpd82 ; MULTRNc 8 bit to 16 bit signed multiply, register * register - MULTRNc 2 -NEWSYM FxOpd83 ; MULTRNc 8 bit to 16 bit signed multiply, register * register - MULTRNc 3 -NEWSYM FxOpd84 ; MULTRNc 8 bit to 16 bit signed multiply, register * register - MULTRNc 4 -NEWSYM FxOpd85 ; MULTRNc 8 bit to 16 bit signed multiply, register * register - MULTRNc 5 -NEWSYM FxOpd86 ; MULTRNc 8 bit to 16 bit signed multiply, register * register - MULTRNc 6 -NEWSYM FxOpd87 ; MULTRNc 8 bit to 16 bit signed multiply, register * register - MULTRNc 7 -NEWSYM FxOpd88 ; MULTRNc 8 bit to 16 bit signed multiply, register * register - MULTRNc 8 -NEWSYM FxOpd89 ; MULTRNc 8 bit to 16 bit signed multiply, register * register - MULTRNc 9 -NEWSYM FxOpd8A ; MULTRNc 8 bit to 16 bit signed multiply, register * register - MULTRNc 10 -NEWSYM FxOpd8B ; MULTRNc 8 bit to 16 bit signed multiply, register * register - MULTRNc 11 -NEWSYM FxOpd8C ; MULTRNc 8 bit to 16 bit signed multiply, register * register - MULTRNc 12 -NEWSYM FxOpd8D ; MULTRNc 8 bit to 16 bit signed multiply, register * register - MULTRNc 13 -NEWSYM FxOpd8E ; MULTRNc 8 bit to 16 bit signed multiply, register * register - MULTRNc 14 -NEWSYM FxOpd8F ; MULTRNc 8 bit to 16 bit signed multiply, register * register - FETCHPIPE - mov ebx,ebp - mov al,byte [esi] ; Read Source - sub ebx,[SfxCPB] - imul bl - inc ebp - and eax,0FFFFh - mov [SfxSignZero],eax - mov [edi],eax ; Write Destination - CLRFLAGS - FXReturn - -NEWSYM FxOpd80A1 ; UMULRN 8 bit to 16 bit unsigned multiply, register * register - UMULTRNc 0 -NEWSYM FxOpd81A1 ; UMULRN 8 bit to 16 bit unsigned multiply, register * register - UMULTRNc 1 -NEWSYM FxOpd82A1 ; UMULRN 8 bit to 16 bit unsigned multiply, register * register - UMULTRNc 2 -NEWSYM FxOpd83A1 ; UMULRN 8 bit to 16 bit unsigned multiply, register * register - UMULTRNc 3 -NEWSYM FxOpd84A1 ; UMULRN 8 bit to 16 bit unsigned multiply, register * register - UMULTRNc 4 -NEWSYM FxOpd85A1 ; UMULRN 8 bit to 16 bit unsigned multiply, register * register - UMULTRNc 5 -NEWSYM FxOpd86A1 ; UMULRN 8 bit to 16 bit unsigned multiply, register * register - UMULTRNc 6 -NEWSYM FxOpd87A1 ; UMULRN 8 bit to 16 bit unsigned multiply, register * register - UMULTRNc 7 -NEWSYM FxOpd88A1 ; UMULRN 8 bit to 16 bit unsigned multiply, register * register - UMULTRNc 8 -NEWSYM FxOpd89A1 ; UMULRN 8 bit to 16 bit unsigned multiply, register * register - UMULTRNc 9 -NEWSYM FxOpd8AA1 ; UMULRN 8 bit to 16 bit unsigned multiply, register * register - UMULTRNc 10 -NEWSYM FxOpd8BA1 ; UMULRN 8 bit to 16 bit unsigned multiply, register * register - UMULTRNc 11 -NEWSYM FxOpd8CA1 ; UMULRN 8 bit to 16 bit unsigned multiply, register * register - UMULTRNc 12 -NEWSYM FxOpd8DA1 ; UMULRN 8 bit to 16 bit unsigned multiply, register * register - UMULTRNc 13 -NEWSYM FxOpd8EA1 ; UMULRN 8 bit to 16 bit unsigned multiply, register * register - UMULTRNc 14 -NEWSYM FxOpd8FA1 ; UMULRN 8 bit to 16 bit unsigned multiply, register * register - FETCHPIPE - mov ebx,ebp - mov al,byte [esi] ; Read Source - sub ebx,[SfxCPB] - mul bl - inc ebp - and eax,0FFFFh - mov [SfxSignZero],eax - mov [edi],eax ; Write Destination - CLRFLAGS - FXReturn - -NEWSYM FxOpd80A2 ; MULIRN 8 bit to 16 bit signed multiply, register * immediate - MULTIRNc 0 -NEWSYM FxOpd81A2 ; MULIRN 8 bit to 16 bit signed multiply, register * immediate - MULTIRNc 1 -NEWSYM FxOpd82A2 ; MULIRN 8 bit to 16 bit signed multiply, register * immediate - MULTIRNc 2 -NEWSYM FxOpd83A2 ; MULIRN 8 bit to 16 bit signed multiply, register * immediate - MULTIRNc 3 -NEWSYM FxOpd84A2 ; MULIRN 8 bit to 16 bit signed multiply, register * immediate - MULTIRNc 4 -NEWSYM FxOpd85A2 ; MULIRN 8 bit to 16 bit signed multiply, register * immediate - MULTIRNc 5 -NEWSYM FxOpd86A2 ; MULIRN 8 bit to 16 bit signed multiply, register * immediate - MULTIRNc 6 -NEWSYM FxOpd87A2 ; MULIRN 8 bit to 16 bit signed multiply, register * immediate - MULTIRNc 7 -NEWSYM FxOpd88A2 ; MULIRN 8 bit to 16 bit signed multiply, register * immediate - MULTIRNc 8 -NEWSYM FxOpd89A2 ; MULIRN 8 bit to 16 bit signed multiply, register * immediate - MULTIRNc 9 -NEWSYM FxOpd8AA2 ; MULIRN 8 bit to 16 bit signed multiply, register * immediate - MULTIRNc 10 -NEWSYM FxOpd8BA2 ; MULIRN 8 bit to 16 bit signed multiply, register * immediate - MULTIRNc 11 -NEWSYM FxOpd8CA2 ; MULIRN 8 bit to 16 bit signed multiply, register * immediate - MULTIRNc 12 -NEWSYM FxOpd8DA2 ; MULIRN 8 bit to 16 bit signed multiply, register * immediate - MULTIRNc 13 -NEWSYM FxOpd8EA2 ; MULIRN 8 bit to 16 bit signed multiply, register * immediate - MULTIRNc 14 -NEWSYM FxOpd8FA2 ; MULIRN 8 bit to 16 bit signed multiply, register * immediate - MULTIRNc 15 - -NEWSYM FxOpd80A3 ;UMULIRN 8 bit to 16 bit unsigned multiply, register * immediate - UMULTIRNc 0 -NEWSYM FxOpd81A3 ;UMULIRN 8 bit to 16 bit unsigned multiply, register * immediate - UMULTIRNc 1 -NEWSYM FxOpd82A3 ;UMULIRN 8 bit to 16 bit unsigned multiply, register * immediate - UMULTIRNc 2 -NEWSYM FxOpd83A3 ;UMULIRN 8 bit to 16 bit unsigned multiply, register * immediate - UMULTIRNc 3 -NEWSYM FxOpd84A3 ;UMULIRN 8 bit to 16 bit unsigned multiply, register * immediate - UMULTIRNc 4 -NEWSYM FxOpd85A3 ;UMULIRN 8 bit to 16 bit unsigned multiply, register * immediate - UMULTIRNc 5 -NEWSYM FxOpd86A3 ;UMULIRN 8 bit to 16 bit unsigned multiply, register * immediate - UMULTIRNc 6 -NEWSYM FxOpd87A3 ;UMULIRN 8 bit to 16 bit unsigned multiply, register * immediate - UMULTIRNc 7 -NEWSYM FxOpd88A3 ;UMULIRN 8 bit to 16 bit unsigned multiply, register * immediate - UMULTIRNc 8 -NEWSYM FxOpd89A3 ;UMULIRN 8 bit to 16 bit unsigned multiply, register * immediate - UMULTIRNc 9 -NEWSYM FxOpd8AA3 ;UMULIRN 8 bit to 16 bit unsigned multiply, register * immediate - UMULTIRNc 10 -NEWSYM FxOpd8BA3 ;UMULIRN 8 bit to 16 bit unsigned multiply, register * immediate - UMULTIRNc 11 -NEWSYM FxOpd8CA3 ;UMULIRN 8 bit to 16 bit unsigned multiply, register * immediate - UMULTIRNc 12 -NEWSYM FxOpd8DA3 ;UMULIRN 8 bit to 16 bit unsigned multiply, register * immediate - UMULTIRNc 13 -NEWSYM FxOpd8EA3 ;UMULIRN 8 bit to 16 bit unsigned multiply, register * immediate - UMULTIRNc 14 -NEWSYM FxOpd8FA3 ;UMULIRN 8 bit to 16 bit unsigned multiply, register * immediate - UMULTIRNc 15 - -NEWSYM FxOpd90 ; SBK store word to last accessed RAM address ; V - mov ebx,[SfxLastRamAdr] ; Load last ram address - mov eax,[esi] ; Read Source - FETCHPIPE - mov [ebx],al ; Store Word - sub ebx,[SfxRAMMem] - xor ebx,1 - add ebx,[SfxRAMMem] - inc ebp ; Increase program counter - mov [ebx],ah ; Store Word - CLRFLAGS - FXReturn - -NEWSYM FxOpd91 ; LINKc#n R11 = R15 + immediate - LINKc 1 -NEWSYM FxOpd92 ; LINKc#n R11 = R15 + immediate - LINKc 2 -NEWSYM FxOpd93 ; LINKc#n R11 = R15 + immediate - LINKc 3 -NEWSYM FxOpd94 ; LINKc#n R11 = R15 + immediate - LINKc 4 - -NEWSYM FxOpd95 ; SEX sign extend 8 bit to 16 bit ; V - movsx eax, byte [esi] ; Read Source - FETCHPIPE - and eax,0FFFFh - inc ebp - mov [edi],eax ; Write Destination - mov [SfxSignZero],eax - CLRFLAGS - FXReturn - -NEWSYM FxOpd96 ; ASR aritmethic shift right by one ; V - mov eax,[esi] ; Read Source - FETCHPIPE - mov [SfxCarry],al - and byte[SfxCarry],1 - sar ax,1 ; logic shift right - inc ebp ; Increase program counter - mov [edi],eax ; Write Destination - mov dword [SfxSignZero],eax - CLRFLAGS - FXReturn - -NEWSYM FxOpd96A1 ; DIV2 aritmethic shift right by one ; V - mov eax,[esi] ; Read Source - FETCHPIPE - cmp ax,-1 - je .minusone - mov [SfxCarry],al - and byte[SfxCarry],1 - sar ax,1 ; logic shift right - inc ebp ; Increase program counter - mov [edi],eax ; Write Destination - mov dword [SfxSignZero],eax - CLRFLAGS - FXReturn -.minusone - mov byte[SfxCarry],1 - xor eax,eax - inc ebp ; Increase program counter - mov [edi],eax ; Write Destination - mov dword [SfxSignZero],eax - CLRFLAGS - FXReturn - -NEWSYM FxOpd97 ; ROR rotate right by one ; V - FETCHPIPE - mov eax,[esi] ; Read Source - shr byte[SfxCarry],1 - rcr ax,1 - setc byte[SfxCarry] - inc ebp ; Increase program counter - mov [edi],eax ; Write Destination - mov [SfxSignZero],eax - CLRFLAGS - FXReturn - -NEWSYM FxOpd98 ; JMPRNc jump to address of register - JMPRNc 8 -NEWSYM FxOpd99 ; JMPRNc jump to address of register - JMPRNc 9 -NEWSYM FxOpd9A ; JMPRNc jump to address of register - JMPRNc 10 -NEWSYM FxOpd9B ; JMPRNc jump to address of register - JMPRNc 11 -NEWSYM FxOpd9C ; JMPRNc jump to address of register - JMPRNc 12 -NEWSYM FxOpd9D ; JMPRNc jump to address of register - JMPRNc 13 - -NEWSYM FxOpd98A1 ; LJMPRNc set program bank to source register and jump to address of register - LJMPRNc 8 -NEWSYM FxOpd99A1 ; LJMPRNc set program bank to source register and jump to address of register - LJMPRNc 9 -NEWSYM FxOpd9AA1 ; LJMPRNc set program bank to source register and jump to address of register - LJMPRNc 10 -NEWSYM FxOpd9BA1 ; LJMPRNc set program bank to source register and jump to address of register - LJMPRNc 11 -NEWSYM FxOpd9CA1 ; LJMPRNc set program bank to source register and jump to address of register - LJMPRNc 12 -NEWSYM FxOpd9DA1 ; LJMPRNc set program bank to source register and jump to address of register - LJMPRNc 13 - -NEWSYM FxOpd9E ; LOB set upper byte to zero (keep low byte) ; V - mov eax,[esi] ; Read Source - FETCHPIPE - and eax,0FFh - inc ebp - mov [edi],eax ; Write Destination - shl eax,8 - mov dword [SfxSignZero],eax - CLRFLAGS - FXReturn - -NEWSYM FxOpd9F ; FMULT 16 bit to 32 bit signed multiplication, upper 16 bits only - ; V - mov eax,[esi] ; Read Source - mov ebx,[SfxR6] - FETCHPIPE - imul bx - inc ebp - and edx,0FFFFh - mov [SfxSignZero],edx - mov [edi],edx ; Write Destination - shr ax,15 - mov [SfxCarry],al - CLRFLAGS - FXReturn - -NEWSYM FxOpd9FA1 ; LMULT 16 bit to 32 bit signed multiplication ; V - mov eax,[esi] ; Read Source - mov ebx,[SfxR6] - FETCHPIPE - imul bx - and edx,0FFFFh - inc ebp - mov [edi],edx ; Write Destination - mov [SfxR4],ax - mov [SfxSignZero],edx - shr ax,15 - mov [SfxCarry],al - CLRFLAGS - FXReturn - -NEWSYM FxOpdA0 ; IBTRNc,#PP immediate byte transfer - IBTRNc 0 -NEWSYM FxOpdA1 ; IBTRNc,#PP immediate byte transfer - IBTRNc 1 -NEWSYM FxOpdA2 ; IBTRNc,#PP immediate byte transfer - IBTRNc 2 -NEWSYM FxOpdA3 ; IBTRNc,#PP immediate byte transfer - IBTRNc 3 -NEWSYM FxOpdA4 ; IBTRNc,#PP immediate byte transfer - IBTRNc 4 -NEWSYM FxOpdA5 ; IBTRNc,#PP immediate byte transfer - IBTRNc 5 -NEWSYM FxOpdA6 ; IBTRNc,#PP immediate byte transfer - IBTRNc 6 -NEWSYM FxOpdA7 ; IBTRNc,#PP immediate byte transfer - IBTRNc 7 -NEWSYM FxOpdA8 ; IBTRNc,#PP immediate byte transfer - IBTRNc 8 -NEWSYM FxOpdA9 ; IBTRNc,#PP immediate byte transfer - IBTRNc 9 -NEWSYM FxOpdAA ; IBTRNc,#PP immediate byte transfer - IBTRNc 10 -NEWSYM FxOpdAB ; IBTRNc,#PP immediate byte transfer - IBTRNc 11 -NEWSYM FxOpdAC ; IBTRNc,#PP immediate byte transfer - IBTRNc 12 -NEWSYM FxOpdAD ; IBTRNc,#PP immediate byte transfer - IBTRNc 13 -NEWSYM FxOpdAE ; IBTRNc,#PP immediate byte transfer - movsx eax,byte[ebp] - mov cl,[ebp+1] - add ebp,2 - mov [SfxR0+14*4],ax - UpdateR14 - CLRFLAGS - FXReturn -NEWSYM FxOpdAF ; IBTRNc,#PP immediate byte transfer - movsx eax,byte[ebp] - mov cl,[ebp+1] - and eax,0FFFFh - mov ebp,[SfxCPB] - add ebp,eax - CLRFLAGS - FXReturn - -NEWSYM FxOpdA0A1 ; LMS rn,(yy) load word from RAM (short address) - LMSRNc 0 -NEWSYM FxOpdA1A1 ; LMS rn,(yy) load word from RAM (short address) - LMSRNc 1 -NEWSYM FxOpdA2A1 ; LMS rn,(yy) load word from RAM (short address) - LMSRNc 2 -NEWSYM FxOpdA3A1 ; LMS rn,(yy) load word from RAM (short address) - LMSRNc 3 -NEWSYM FxOpdA4A1 ; LMS rn,(yy) load word from RAM (short address) - LMSRNc 4 -NEWSYM FxOpdA5A1 ; LMS rn,(yy) load word from RAM (short address) - LMSRNc 5 -NEWSYM FxOpdA6A1 ; LMS rn,(yy) load word from RAM (short address) - LMSRNc 6 -NEWSYM FxOpdA7A1 ; LMS rn,(yy) load word from RAM (short address) - LMSRNc 7 -NEWSYM FxOpdA8A1 ; LMS rn,(yy) load word from RAM (short address) - LMSRNc 8 -NEWSYM FxOpdA9A1 ; LMS rn,(yy) load word from RAM (short address) - LMSRNc 9 -NEWSYM FxOpdAAA1 ; LMS rn,(yy) load word from RAM (short address) - LMSRNc 10 -NEWSYM FxOpdABA1 ; LMS rn,(yy) load word from RAM (short address) - LMSRNc 11 -NEWSYM FxOpdACA1 ; LMS rn,(yy) load word from RAM (short address) - LMSRNc 12 -NEWSYM FxOpdADA1 ; LMS rn,(yy) load word from RAM (short address) - LMSRNc 13 -NEWSYM FxOpdAEA1 ; LMS rn,(yy) load word from RAM (short address) - xor eax,eax - mov al,[ebp] - add eax,eax - inc ebp - add eax,[SfxRAMMem] - mov cl,[ebp] - mov dword [SfxLastRamAdr],eax - mov ebx,[eax] ; Read word from ram - inc ebp - mov [SfxR0+14*4],bx ; Write data - UpdateR14 - CLRFLAGS - FXReturn -NEWSYM FxOpdAFA1 ; LMS rn,(yy) load word from RAM (short address) - xor eax,eax - mov al,[ebp] - add eax,eax - inc ebp - add eax,[SfxRAMMem] - mov cl,[ebp] - mov dword [SfxLastRamAdr],eax - mov ebx,[eax] ; Read word from ram - and ebx,0FFFFh - mov ebp,[SfxCPB] - add ebp,ebx - CLRFLAGS - FXReturn - -NEWSYM FxOpdA0A2 ; SMS (yy),rn store word in RAM (short address) - SMSRNc 0 -NEWSYM FxOpdA1A2 ; SMS (yy),rn store word in RAM (short address) - SMSRNc 1 -NEWSYM FxOpdA2A2 ; SMS (yy),rn store word in RAM (short address) - SMSRNc 2 -NEWSYM FxOpdA3A2 ; SMS (yy),rn store word in RAM (short address) - SMSRNc 3 -NEWSYM FxOpdA4A2 ; SMS (yy),rn store word in RAM (short address) - SMSRNc 4 -NEWSYM FxOpdA5A2 ; SMS (yy),rn store word in RAM (short address) - SMSRNc 5 -NEWSYM FxOpdA6A2 ; SMS (yy),rn store word in RAM (short address) - SMSRNc 6 -NEWSYM FxOpdA7A2 ; SMS (yy),rn store word in RAM (short address) - SMSRNc 7 -NEWSYM FxOpdA8A2 ; SMS (yy),rn store word in RAM (short address) - SMSRNc 8 -NEWSYM FxOpdA9A2 ; SMS (yy),rn store word in RAM (short address) - SMSRNc 9 -NEWSYM FxOpdAAA2 ; SMS (yy),rn store word in RAM (short address) - SMSRNc 10 -NEWSYM FxOpdABA2 ; SMS (yy),rn store word in RAM (short address) - SMSRNc 11 -NEWSYM FxOpdACA2 ; SMS (yy),rn store word in RAM (short address) - SMSRNc 12 -NEWSYM FxOpdADA2 ; SMS (yy),rn store word in RAM (short address) - SMSRNc 13 -NEWSYM FxOpdAEA2 ; SMS (yy),rn store word in RAM (short address) - SMSRNc 14 -NEWSYM FxOpdAFA2 ; SMS (yy),rn store word in RAM (short address) - xor eax,eax - mov ebx,ebp - sub ebx,[SfxCPB] - mov al,[ebp] - inc ebp - add eax,eax - FETCHPIPE - add eax,[SfxRAMMem] - mov dword [SfxLastRamAdr],eax - inc ebp - mov [eax],bx ; Write word to ram - CLRFLAGS - FXReturn - -NEWSYM FxOpdB0 ; FROM rn set source register - FROMRNd 0 -NEWSYM FxOpdB1 ; FROM rn set source register - FROMRNd 1 -NEWSYM FxOpdB2 ; FROM rn set source register - FROMRNd 2 -NEWSYM FxOpdB3 ; FROM rn set source register - FROMRNd 3 -NEWSYM FxOpdB4 ; FROM rn set source register - FROMRNd 4 -NEWSYM FxOpdB5 ; FROM rn set source register - FROMRNd 5 -NEWSYM FxOpdB6 ; FROM rn set source register - FROMRNd 6 -NEWSYM FxOpdB7 ; FROM rn set source register - FROMRNd 7 -NEWSYM FxOpdB8 ; FROM rn set source register - FROMRNd 8 -NEWSYM FxOpdB9 ; FROM rn set source register - FROMRNd 9 -NEWSYM FxOpdBA ; FROM rn set source register - FROMRNd 10 -NEWSYM FxOpdBB ; FROM rn set source register - FROMRNd 11 -NEWSYM FxOpdBC ; FROM rn set source register - FROMRNd 12 -NEWSYM FxOpdBD ; FROM rn set source register - FROMRNd 13 -NEWSYM FxOpdBE ; FROM rn set source register - FROMRNd 14 -NEWSYM FxOpdBF ; FROM rn set source register - FETCHPIPE - mov esi,SfxR0+15*4 - inc ebp ; Increase program counter - mov eax,ebp - sub eax,[SfxCPB] - mov [SfxR15],eax - call [FxTableb+ecx*4] - mov esi,SfxR0 - FXReturn - -NEWSYM FxOpdC0 ; HIB move high-byte to low-byte ; V - mov eax,[esi] ; Read Source - FETCHPIPE - and eax,0FF00h - mov dword [SfxSignZero],eax - shr eax,8 - inc ebp - mov [edi],eax - CLRFLAGS - FXReturn - -NEWSYM FxOpdC1 ; OR rn or rn - ORRNc 1 -NEWSYM FxOpdC2 ; OR rn or rn - ORRNc 2 -NEWSYM FxOpdC3 ; OR rn or rn - ORRNc 3 -NEWSYM FxOpdC4 ; OR rn or rn - ORRNc 4 -NEWSYM FxOpdC5 ; OR rn or rn - ORRNc 5 -NEWSYM FxOpdC6 ; OR rn or rn - ORRNc 6 -NEWSYM FxOpdC7 ; OR rn or rn - ORRNc 7 -NEWSYM FxOpdC8 ; OR rn or rn - ORRNc 8 -NEWSYM FxOpdC9 ; OR rn or rn - ORRNc 9 -NEWSYM FxOpdCA ; OR rn or rn - ORRNc 10 -NEWSYM FxOpdCB ; OR rn or rn - ORRNc 11 -NEWSYM FxOpdCC ; OR rn or rn - ORRNc 12 -NEWSYM FxOpdCD ; OR rn or rn - ORRNc 13 -NEWSYM FxOpdCE ; OR rn or rn - ORRNc 14 -NEWSYM FxOpdCF ; OR rn or rn - mov eax,[esi] ; Read Source - mov ebx,ebp - FETCHPIPE - sub ebx,[SfxCPB] - or eax,ebx - inc ebp - mov [edi],eax ; Write DREG - mov [SfxSignZero],eax - CLRFLAGS - FXReturn - -NEWSYM FxOpdC1A1 ; XOR rn xor rn - XORRNc 1 -NEWSYM FxOpdC2A1 ; XOR rn xor rn - XORRNc 2 -NEWSYM FxOpdC3A1 ; XOR rn xor rn - XORRNc 3 -NEWSYM FxOpdC4A1 ; XOR rn xor rn - XORRNc 4 -NEWSYM FxOpdC5A1 ; XOR rn xor rn - XORRNc 5 -NEWSYM FxOpdC6A1 ; XOR rn xor rn - XORRNc 6 -NEWSYM FxOpdC7A1 ; XOR rn xor rn - XORRNc 7 -NEWSYM FxOpdC8A1 ; XOR rn xor rn - XORRNc 8 -NEWSYM FxOpdC9A1 ; XOR rn xor rn - XORRNc 9 -NEWSYM FxOpdCAA1 ; XOR rn xor rn - XORRNc 10 -NEWSYM FxOpdCBA1 ; XOR rn xor rn - XORRNc 11 -NEWSYM FxOpdCCA1 ; XOR rn xor rn - XORRNc 12 -NEWSYM FxOpdCDA1 ; XOR rn xor rn - XORRNc 13 -NEWSYM FxOpdCEA1 ; XOR rn xor rn - XORRNc 14 -NEWSYM FxOpdCFA1 ; XOR rn xor rn - FETCHPIPE - mov eax,[esi] ; Read Source - mov ebx,ebp - sub ebx,[SfxCPB] - xor eax,ebx - inc ebp - mov [edi],eax ; Write DREG - mov [SfxSignZero],eax - CLRFLAGS - FXReturn - -NEWSYM FxOpdC1A2 ; OR #n OR #n - ORIc 1 -NEWSYM FxOpdC2A2 ; OR #n OR #n - ORIc 2 -NEWSYM FxOpdC3A2 ; OR #n OR #n - ORIc 3 -NEWSYM FxOpdC4A2 ; OR #n OR #n - ORIc 4 -NEWSYM FxOpdC5A2 ; OR #n OR #n - ORIc 5 -NEWSYM FxOpdC6A2 ; OR #n OR #n - ORIc 6 -NEWSYM FxOpdC7A2 ; OR #n OR #n - ORIc 7 -NEWSYM FxOpdC8A2 ; OR #n OR #n - ORIc 8 -NEWSYM FxOpdC9A2 ; OR #n OR #n - ORIc 9 -NEWSYM FxOpdCAA2 ; OR #n OR #n - ORIc 10 -NEWSYM FxOpdCBA2 ; OR #n OR #n - ORIc 11 -NEWSYM FxOpdCCA2 ; OR #n OR #n - ORIc 12 -NEWSYM FxOpdCDA2 ; OR #n OR #n - ORIc 13 -NEWSYM FxOpdCEA2 ; OR #n OR #n - ORIc 14 -NEWSYM FxOpdCFA2 ; OR #n OR #n - ORIc 15 - -NEWSYM FxOpdC1A3 ; XOR #n xor #n - XORIc 1 -NEWSYM FxOpdC2A3 ; XOR #n xor #n - XORIc 2 -NEWSYM FxOpdC3A3 ; XOR #n xor #n - XORIc 3 -NEWSYM FxOpdC4A3 ; XOR #n xor #n - XORIc 4 -NEWSYM FxOpdC5A3 ; XOR #n xor #n - XORIc 5 -NEWSYM FxOpdC6A3 ; XOR #n xor #n - XORIc 6 -NEWSYM FxOpdC7A3 ; XOR #n xor #n - XORIc 7 -NEWSYM FxOpdC8A3 ; XOR #n xor #n - XORIc 8 -NEWSYM FxOpdC9A3 ; XOR #n xor #n - XORIc 9 -NEWSYM FxOpdCAA3 ; XOR #n xor #n - XORIc 10 -NEWSYM FxOpdCBA3 ; XOR #n xor #n - XORIc 11 -NEWSYM FxOpdCCA3 ; XOR #n xor #n - XORIc 12 -NEWSYM FxOpdCDA3 ; XOR #n xor #n - XORIc 13 -NEWSYM FxOpdCEA3 ; XOR #n xor #n - XORIc 14 -NEWSYM FxOpdCFA3 ; XOR #n xor #n - XORIc 15 - -NEWSYM FxOpdD0 ; INC rn increase by one - INCRNc 0 -NEWSYM FxOpdD1 ; INC rn increase by one - INCRNc 1 -NEWSYM FxOpdD2 ; INC rn increase by one - INCRNc 2 -NEWSYM FxOpdD3 ; INC rn increase by one - INCRNc 3 -NEWSYM FxOpdD4 ; INC rn increase by one - INCRNc 4 -NEWSYM FxOpdD5 ; INC rn increase by one - INCRNc 5 -NEWSYM FxOpdD6 ; INC rn increase by one - INCRNc 6 -NEWSYM FxOpdD7 ; INC rn increase by one - INCRNc 7 -NEWSYM FxOpdD8 ; INC rn increase by one - INCRNc 8 -NEWSYM FxOpdD9 ; INC rn increase by one - INCRNc 9 -NEWSYM FxOpdDA ; INC rn increase by one - INCRNc 10 -NEWSYM FxOpdDB ; INC rn increase by one - INCRNc 11 -NEWSYM FxOpdDC ; INC rn increase by one - INCRNc 12 -NEWSYM FxOpdDD ; INC rn increase by one - INCRNc 13 -NEWSYM FxOpdDE ; INC rn increase by one - FETCHPIPE - mov eax,[SfxR0+14*4] ; Read Source - inc ax - mov [SfxR0+14*4],eax - mov [SfxSignZero],eax - CLRFLAGS - inc ebp - UpdateR14 - FXReturn - -NEWSYM FxOpdDF ; GETC transfer ROM buffer to color register - mov eax,[SfxRomBuffer] - FETCHPIPE - mov eax,[eax] - test byte[SfxPOR],04h - jz .nohighnibble - mov bl,al - shr bl,4 - and al,0F0h - or al,bl -.nohighnibble - test byte[SfxPOR],08h - jnz .preserveupper - cmp [SfxCOLR],al - je .nocolchange - mov [SfxCOLR],al - and eax,0FFh - mov ebx,[fxbit01+eax*4] - mov [fxbit01pcal],ebx - mov ebx,[fxbit23+eax*4] - mov [fxbit23pcal],ebx - mov ebx,[fxbit45+eax*4] - mov [fxbit45pcal],ebx - mov ebx,[fxbit67+eax*4] - mov [fxbit67pcal],ebx -.nocolchange - CLRFLAGS - inc ebp ; Increase program counter - FXReturn -.preserveupper - mov bl,[SfxCOLR] - and al,0Fh - and bl,0F0h - or al,bl - cmp [SfxCOLR],al - je .nocolchange - mov [SfxCOLR],al - and eax,0FFh - mov ebx,[fxbit01+eax*4] - mov [fxbit01pcal],ebx - mov ebx,[fxbit23+eax*4] - mov [fxbit23pcal],ebx - mov ebx,[fxbit45+eax*4] - mov [fxbit45pcal],ebx - mov ebx,[fxbit67+eax*4] - mov [fxbit67pcal],ebx - CLRFLAGS - inc ebp ; Increase program counter - FXReturn - -NEWSYM FxOpdDFA2 ; RAMB set current RAM bank ; Verified - mov eax,[esi] ; Read Source - mov ebx,[SfxnRamBanks] - FETCHPIPE - dec ebx - and eax,ebx - mov dword [SfxRAMBR],eax - shl eax,16 - add eax,[sfxramdata] - mov dword [SfxRAMMem],eax - CLRFLAGS - inc ebp - FXReturn - -NEWSYM FxOpdDFA3 ; ROMB set current ROM bank ; Verified - mov eax,[esi] ; Read Source - and eax,07Fh - FETCHPIPE - mov dword [SfxROMBR],eax - mov eax,[SfxMemTable+eax*4] - mov [SfxCROM],eax - CLRFLAGS - inc ebp - FXReturn - -NEWSYM FxOpdE0 ; DEC rn decrement by one - DECRNc 0 -NEWSYM FxOpdE1 ; DEC rn decrement by one - DECRNc 1 -NEWSYM FxOpdE2 ; DEC rn decrement by one - DECRNc 2 -NEWSYM FxOpdE3 ; DEC rn decrement by one - DECRNc 3 -NEWSYM FxOpdE4 ; DEC rn decrement by one - DECRNc 4 -NEWSYM FxOpdE5 ; DEC rn decrement by one - DECRNc 5 -NEWSYM FxOpdE6 ; DEC rn decrement by one - DECRNc 6 -NEWSYM FxOpdE7 ; DEC rn decrement by one - DECRNc 7 -NEWSYM FxOpdE8 ; DEC rn decrement by one - DECRNc 8 -NEWSYM FxOpdE9 ; DEC rn decrement by one - DECRNc 9 -NEWSYM FxOpdEA ; DEC rn decrement by one - DECRNc 10 -NEWSYM FxOpdEB ; DEC rn decrement by one - DECRNc 11 -NEWSYM FxOpdEC ; DEC rn decrement by one - DECRNc 12 -NEWSYM FxOpdED ; DEC rn decrement by one - DECRNc 13 -NEWSYM FxOpdEE ; DEC rn decrement by one - dec word[SfxR0+14*4] - FETCHPIPE - mov eax,[SfxR0+14*4] ; Read Source - mov [SfxSignZero],eax - UpdateR14 - CLRFLAGS - inc ebp - FXReturn - -NEWSYM FxOpdEF ; getb get byte from ROM at address R14 ; V - FETCHPIPE - mov eax,[SfxRomBuffer] - inc ebp - mov eax,[eax] - and eax,0FFh -; cmp edi,SfxR15 -; je .nor15 - mov [edi],eax ; Write DREG - CLRFLAGS - FXReturn -.nor15 - or eax,8000h - mov [edi],eax ; Write DREG - CLRFLAGS - FXReturn - - add eax,ebp - sub eax,[SfxCPB] - mov [SfxR15],eax - CLRFLAGS - FXReturn - -NEWSYM FxOpdEFA1 ; getbh get high-byte from ROM at address R14 ; V - mov eax,[esi] ; Read Source - mov ebx,[SfxRomBuffer] - and eax,0FFh - FETCHPIPE - mov ah,[ebx] - inc ebp - mov [edi],eax ; Write DREG - CLRFLAGS - FXReturn - -NEWSYM FxOpdEFA2 ; getbl get low-byte from ROM at address R14 ; V - mov eax,[esi] ; Read Source - mov ebx,[SfxRomBuffer] - and eax,0FF00h - FETCHPIPE - mov al,[ebx] - inc ebp - mov [edi],eax ; Write DREG - CLRFLAGS - FXReturn - -NEWSYM FxOpdEFA3 ; getbs get sign extended byte from ROM at address R14 ; V - mov ebx,[SfxRomBuffer] - FETCHPIPE - movsx eax,byte[ebx] - inc ebp - mov [edi],ax ; Write DREG - CLRFLAGS - FXReturn - -NEWSYM FxOpdF0 ; IWT RN,#xx immediate word transfer to register - IWTRNc 0 -NEWSYM FxOpdF1 ; IWT RN,#xx immediate word transfer to register - IWTRNc 1 -NEWSYM FxOpdF2 ; IWT RN,#xx immediate word transfer to register - IWTRNc 2 -NEWSYM FxOpdF3 ; IWT RN,#xx immediate word transfer to register - IWTRNc 3 -NEWSYM FxOpdF4 ; IWT RN,#xx immediate word transfer to register - IWTRNc 4 -NEWSYM FxOpdF5 ; IWT RN,#xx immediate word transfer to register - IWTRNc 5 -NEWSYM FxOpdF6 ; IWT RN,#xx immediate word transfer to register - IWTRNc 6 -NEWSYM FxOpdF7 ; IWT RN,#xx immediate word transfer to register - IWTRNc 7 -NEWSYM FxOpdF8 ; IWT RN,#xx immediate word transfer to register - IWTRNc 8 -NEWSYM FxOpdF9 ; IWT RN,#xx immediate word transfer to register - IWTRNc 9 -NEWSYM FxOpdFA ; IWT RN,#xx immediate word transfer to register - IWTRNc 10 -NEWSYM FxOpdFB ; IWT RN,#xx immediate word transfer to register - IWTRNc 11 -NEWSYM FxOpdFC ; IWT RN,#xx immediate word transfer to register - IWTRNc 12 -NEWSYM FxOpdFD ; IWT RN,#xx immediate word transfer to register - IWTRNc 13 -NEWSYM FxOpdFE ; IWT RN,#xx immediate word transfer to register - mov eax,[ebp] - mov cl,[ebp+2] - and eax,0FFFFh - add ebp,3 - mov [SfxR0+14*4],eax - UpdateR14 - CLRFLAGS - FXReturn -NEWSYM FxOpdFF ; IWT RN,#xx immediate word transfer to register - mov eax,[ebp] - mov cl,[ebp+2] - and eax,0FFFFh - mov ebp,[SfxCPB] - add ebp,eax - CLRFLAGS - FXReturn - -NEWSYM FxOpdF0A1 ; LM RN,(XX) load word from RAM - LMRNc 0 -NEWSYM FxOpdF1A1 ; LM RN,(XX) load word from RAM - LMRNc 1 -NEWSYM FxOpdF2A1 ; LM RN,(XX) load word from RAM - LMRNc 2 -NEWSYM FxOpdF3A1 ; LM RN,(XX) load word from RAM - LMRNc 3 -NEWSYM FxOpdF4A1 ; LM RN,(XX) load word from RAM - LMRNc 4 -NEWSYM FxOpdF5A1 ; LM RN,(XX) load word from RAM - LMRNc 5 -NEWSYM FxOpdF6A1 ; LM RN,(XX) load word from RAM - LMRNc 6 -NEWSYM FxOpdF7A1 ; LM RN,(XX) load word from RAM - LMRNc 7 -NEWSYM FxOpdF8A1 ; LM RN,(XX) load word from RAM - LMRNc 8 -NEWSYM FxOpdF9A1 ; LM RN,(XX) load word from RAM - LMRNc 9 -NEWSYM FxOpdFAA1 ; LM RN,(XX) load word from RAM - LMRNc 10 -NEWSYM FxOpdFBA1 ; LM RN,(XX) load word from RAM - LMRNc 11 -NEWSYM FxOpdFCA1 ; LM RN,(XX) load word from RAM - LMRNc 12 -NEWSYM FxOpdFDA1 ; LM RN,(XX) load word from RAM - LMRNc 13 -NEWSYM FxOpdFEA1 ; LM RN,(XX) load word from RAM - xor eax,eax - mov cl,[ebp+2] - mov ax,[ebp] - mov ebx,[SfxRAMMem] - mov [SfxLastRamAdr],eax - add [SfxLastRamAdr],ebx - mov dl,[eax+ebx] - xor eax,1 - add ebp,3 - mov dh,[eax+ebx] - mov word [SfxR0+14*4],dx ; Store Word - UpdateR14 - CLRFLAGS - FXReturn -NEWSYM FxOpdFFA1 ; LM RN,(XX) load word from RAM - FETCHPIPE - mov eax,ecx - inc ebp - FETCHPIPE - inc ebp - mov ah,cl - FETCHPIPE - mov ebx,[SfxRAMMem] - mov [SfxLastRamAdr],eax - add [SfxLastRamAdr],ebx - mov dl,[eax+ebx] - xor eax,1 - mov dh,[eax+ebx] - and edx,0FFFFh - mov ebp,[SfxCPB] - add ebp,edx - CLRFLAGS - FXReturn - -NEWSYM FxOpdF0A2 ; SM (XX),RN store word in RAM - SMRNc 0 -NEWSYM FxOpdF1A2 ; SM (XX),RN store word in RAM - SMRNc 1 -NEWSYM FxOpdF2A2 ; SM (XX),RN store word in RAM - SMRNc 2 -NEWSYM FxOpdF3A2 ; SM (XX),RN store word in RAM - SMRNc 3 -NEWSYM FxOpdF4A2 ; SM (XX),RN store word in RAM - SMRNc 4 -NEWSYM FxOpdF5A2 ; SM (XX),RN store word in RAM - SMRNc 5 -NEWSYM FxOpdF6A2 ; SM (XX),RN store word in RAM - SMRNc 6 -NEWSYM FxOpdF7A2 ; SM (XX),RN store word in RAM - SMRNc 7 -NEWSYM FxOpdF8A2 ; SM (XX),RN store word in RAM - SMRNc 8 -NEWSYM FxOpdF9A2 ; SM (XX),RN store word in RAM - SMRNc 9 -NEWSYM FxOpdFAA2 ; SM (XX),RN store word in RAM - SMRNc 10 -NEWSYM FxOpdFBA2 ; SM (XX),RN store word in RAM - SMRNc 11 -NEWSYM FxOpdFCA2 ; SM (XX),RN store word in RAM - SMRNc 12 -NEWSYM FxOpdFDA2 ; SM (XX),RN store word in RAM - SMRNc 13 -NEWSYM FxOpdFEA2 ; SM (XX),RN store word in RAM - SMRNc 14 -NEWSYM FxOpdFFA2 ; SM (XX),RN store word in RAM - FETCHPIPE - mov ebx,ebp - sub ebx,[SfxCPB] - mov eax,ecx - inc ebp - FETCHPIPE - inc ebp - mov ah,cl - FETCHPIPE - mov dx,bx - mov ebx,[SfxRAMMem] - mov [SfxLastRamAdr],eax - add [SfxLastRamAdr],ebx - mov [eax+ebx],dl - xor eax,1 - inc ebp - mov [eax+ebx],dh - CLRFLAGS - FXReturn - -NEWSYM FxEmu2CAsmEnd diff --git a/i386/fxemu2c.mac b/i386/fxemu2c.mac deleted file mode 100644 index 4595e121..00000000 --- a/i386/fxemu2c.mac +++ /dev/null @@ -1,528 +0,0 @@ -;Copyright (C) 1997-2001 ZSNES Team ( zsknight@zsnes.com / _demo_@zsnes.com ) -; -;This program is free software; you can redistribute it and/or -;modify it under the terms of the GNU General Public License -;as published by the Free Software Foundation; either -;version 2 of the License, or (at your option) any later -;version. -; -;This program is distributed in the hope that it will be useful, -;but WITHOUT ANY WARRANTY; without even the implied warranty of -;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;GNU General Public License for more details. -; -;You should have received a copy of the GNU General Public License -;along with this program; if not, write to the Free Software -;Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - - - - - - - - - -%macro FXReturn 0 - dec dword [NumberOfOpcodes] - jmp [FxTabled+ecx*4] - ALIGN32 -%endmacro - -%macro FXReturn2 0 - dec dword [NumberOfOpcodes] - js %%endloop - jmp [FxTabled+ecx*4] -%%endloop - jmp FXEndLoop -; jmp [FxTabled+ecx*4] - ALIGN32 -%endmacro - -%macro TORNd 1 ; V - FETCHPIPE - mov edi, SfxR0+%1*4 - inc ebp ; Increase program counter - call [FxTable+ecx*4] - mov edi,SfxR0 - FXReturn -%endmacro - -%macro WITHc 1 ; Verified. - FETCHPIPE - mov esi,SfxR0+%1*4 - mov edi,SfxR0+%1*4 - mov dword [SfxB],1 - inc ebp ; Increase program counter - call [FxTablec+ecx*4] - mov esi,SfxR0 - mov edi,SfxR0 - mov dword [SfxB],0 ; Clear B Flag - FXReturn -%endmacro - -%macro STWRNc 1 ; V - mov eax,[SfxR0+%1*4] ; Read register - mov ebx,[SfxRAMMem] - mov dword [SfxLastRamAdr],eax ; Save last ram address - add dword [SfxLastRamAdr],ebx ; Save last ram address - mov edx,[esi] ; Read Source - FETCHPIPE - mov [ebx+eax],dl ; Store Word - xor eax,1 - inc ebp ; Increase program counter - mov [ebx+eax],dh ; Store Word - CLRFLAGS - FXReturn -%endmacro - -%macro STBRNc 1 ; V - mov eax,[SfxR0+%1*4] ; Read register - FETCHPIPE - add eax,[SfxRAMMem] - mov dword [SfxLastRamAdr],eax ; Save last ram address - mov ebx,[esi] ; Read Source - mov byte [eax],bl ; Store Byte - CLRFLAGS - inc ebp ; Increase program counter - FXReturn -%endmacro - -%macro LDWRNc 1 ; V - mov eax,[SfxR0+%1*4] ; Read register - mov ebx,[SfxRAMMem] - mov dword [SfxLastRamAdr],eax ; Save last ram address - FETCHPIPE - mov dl,[ebx+eax] ; Store Word - add dword [SfxLastRamAdr],ebx ; Save last ram address - xor eax,1 - and edx,0FFFFh - inc ebp ; Increase program counter - mov dh,[ebx+eax] ; Store Word - mov [edi],edx ; Read Source - CLRFLAGS - FXReturn -%endmacro - -%macro LDBRNc 1 ; V - mov eax,[SfxR0+%1*4] ; Read register - FETCHPIPE - add eax,[SfxRAMMem] - xor ebx,ebx - mov dword [SfxLastRamAdr],eax ; Save last ram address - mov bl,[eax] ; Read Byte - inc ebp ; Increase program counter - mov [edi],ebx ; Store Result - CLRFLAGS - FXReturn -%endmacro - -%macro ADDRNc 1 ; V - mov eax, [esi] ; Read Source - mov ebx, [SfxR0+%1*4] - FETCHPIPE - add ax,bx - seto byte[SfxOverflow] - setc byte[SfxCarry] - mov [SfxSignZero],eax - inc ebp ; Increase program counter - mov [edi],eax ; Write Destination - CLRFLAGS - FXReturn -%endmacro - -%macro ADCRNc 1 ; V - FETCHPIPE - mov eax, [esi] ; Read Source - mov ebx, [SfxR0+%1*4] - shr byte[SfxCarry],1 - adc ax,bx - seto byte[SfxOverflow] - setc byte[SfxCarry] - mov [SfxSignZero],eax - inc ebp ; Increase program counter - mov [edi],eax ; Write Destination - CLRFLAGS - FXReturn -%endmacro - -%macro ADIRNc 1 ; V - mov eax, [esi] ; Read Source - FETCHPIPE - add ax,%1 - seto byte[SfxOverflow] - setc byte[SfxCarry] - mov [SfxSignZero],eax - inc ebp ; Increase program counter - mov [edi],eax ; Write Destination - CLRFLAGS - FXReturn -%endmacro - -%macro ADCIRNc 1 ; V - FETCHPIPE - mov eax, [esi] ; Read Source - shr byte[SfxCarry],1 - adc ax,%1 - seto byte[SfxOverflow] - setc byte[SfxCarry] - mov [SfxSignZero],eax - inc ebp ; Increase program counter - mov [edi],eax ; Write Destination - CLRFLAGS - FXReturn -%endmacro - -%macro SUBRNc 1 ; V - mov eax,[esi] ; Read Source - mov ebx,[SfxR0+%1*4] - FETCHPIPE - sub ax,bx - seto byte[SfxOverflow] - setc byte[SfxCarry] - xor byte[SfxCarry],1 - inc ebp ; Increase program counter - mov [edi],eax ; Write Destination - mov [SfxSignZero],eax - CLRFLAGS - FXReturn -%endmacro - -%macro SBCRNc 1 ; V - FETCHPIPE - mov eax,[esi] ; Read Source - mov ebx,[SfxR0+%1*4] - cmp byte[SfxCarry],1 - sbb ax,bx - seto byte[SfxOverflow] - setc byte[SfxCarry] - xor byte[SfxCarry],1 - inc ebp ; Increase program counter - mov [edi],eax ; Write Destination - mov [SfxSignZero],eax - CLRFLAGS - FXReturn -%endmacro - -%macro SUBIRNc 1 ; V - mov eax,[esi] ; Read Source - FETCHPIPE - sub ax,%1 - seto byte[SfxOverflow] - setc byte[SfxCarry] - xor byte[SfxCarry],1 - inc ebp ; Increase program counter - mov [edi],eax ; Write Destination - mov [SfxSignZero],eax - CLRFLAGS - FXReturn -%endmacro - -%macro CMPRNc 1 ; V - mov eax,[esi] ; Read Source - mov ebx,[SfxR0+%1*4] - FETCHPIPE - sub ax,bx - seto byte[SfxOverflow] - setc byte[SfxCarry] - xor byte[SfxCarry],1 - mov [SfxSignZero],eax - CLRFLAGS - inc ebp ; Increase program counter - FXReturn -%endmacro - -%macro ANDRNc 1 ; V - mov eax,[esi] ; Read Source - mov ebx,[SfxR0+%1*4] ; Read RN - FETCHPIPE - and eax,ebx - inc ebp - mov dword [SfxSignZero],eax - mov [edi],eax ; Write Destination - CLRFLAGS - FXReturn -%endmacro - -%macro BICRNc 1 ; V - mov ebx,[SfxR0+%1*4] ; Read RN - mov eax,[esi] ; Read Source - xor ebx,0FFFFh - FETCHPIPE - and eax,ebx - inc ebp - mov dword [SfxSignZero],eax - mov [edi],eax ; Write Destination - CLRFLAGS - FXReturn -%endmacro - -%macro ANDIRNc 1 ; V - mov eax,[esi] ; Read Source - FETCHPIPE - and eax,%1 - inc ebp - mov dword [SfxSignZero],eax - mov [edi],eax ; Write Destination - CLRFLAGS - FXReturn -%endmacro - -%macro BICIRNc 1 ; V - mov eax,[esi] ; Read Source - FETCHPIPE - and eax,%1 - inc ebp - mov dword [SfxSignZero],eax - mov [edi],eax ; Write Destination - CLRFLAGS - FXReturn -%endmacro - -%macro MULTRNc 1 ; V - mov al,byte [esi] ; Read Source - mov bl,byte [SfxR0+%1*4] ; Read RN - FETCHPIPE - imul bl - inc ebp - and eax,0FFFFh - mov [SfxSignZero],eax - mov [edi],eax ; Write Destination - CLRFLAGS - FXReturn -%endmacro - -%macro UMULTRNc 1 ; V - mov al,byte [esi] ; Read Source - mov bl,byte [SfxR0+%1*4] ; Read RN - FETCHPIPE - mul bl - inc ebp - and eax,0FFFFh - mov [SfxSignZero],eax - mov [edi],eax ; Write Destination - CLRFLAGS - FXReturn -%endmacro - -%macro MULTIRNc 1 ; V - mov al,byte [esi] ; Read Source - mov bl,%1 ; Read RN - FETCHPIPE - imul bl - inc ebp - and eax,0FFFFh - mov [SfxSignZero],eax - mov [edi],eax ; Write Destination - CLRFLAGS - FXReturn -%endmacro - -%macro UMULTIRNc 1 ; V - mov al,byte [esi] ; Read Source - mov bl,%1 ; Read RN - FETCHPIPE - mul bl - inc ebp - and eax,0FFFFh - mov [SfxSignZero],eax - mov [edi],eax ; Write Destination - CLRFLAGS - FXReturn -%endmacro - -%macro LINKc 1 ; Verified. - mov eax,ebp - sub eax,[SfxCPB] - add eax,%1 - FETCHPIPE - mov word [SfxR11],ax - CLRFLAGS - inc ebp - FXReturn -%endmacro - -%macro JMPRNc 1 ; V - FETCHPIPE - mov eax,[SfxR0+%1*4] ; Read RN - mov ebp,[SfxCPB] - add ebp,eax - CLRFLAGS - FXReturn -%endmacro - -%macro LJMPRNc 1 ; V - FETCHPIPE - mov eax,[SfxR0+%1*4] - and eax,07Fh - mov byte[SfxPBR],al -; mov byte[fxtrace+eax],1 - mov eax,[SfxMemTable+eax*4] - mov [SfxCPB],eax - mov ebp,eax - add ebp,[esi] ; Read RN - mov dword [SfxCacheActive],0 - push ecx - call FxOp02 - pop ecx - dec ebp - FXReturn -%endmacro - -%macro IBTRNc 1 ; V - movsx eax,byte[ebp] - mov cl,[ebp+1] - add ebp,2 - mov [SfxR0+%1*4],ax - CLRFLAGS - FXReturn -%endmacro - -%macro LMSRNc 1 ; Verified. - xor eax,eax - mov al,[ebp] - add eax,eax - inc ebp - add eax,[SfxRAMMem] - mov cl,[ebp] - mov dword [SfxLastRamAdr],eax - mov ebx,[eax] ; Read word from ram - inc ebp - mov [SfxR0+%1*4],bx ; Write data - CLRFLAGS - FXReturn -%endmacro - -%macro SMSRNc 1 ; Verified. - xor eax,eax - mov al,[ebp] - inc ebp - add eax,eax - mov cl,[ebp] - add eax,[SfxRAMMem] - mov ebx,[SfxR0+%1*4] ; Read data - mov dword [SfxLastRamAdr],eax - inc ebp - mov [eax],bx ; Write word to ram - CLRFLAGS - FXReturn -%endmacro - -%macro FROMRNd 1 ; V - FETCHPIPE - mov esi,SfxR0+%1*4 - inc ebp ; Increase program counter - call [FxTable+ecx*4] - mov esi,SfxR0 - FXReturn -%endmacro - -%macro ORRNc 1 ; V - mov eax,[esi] ; Read Source - mov ebx,[SfxR0+%1*4] ; Read - FETCHPIPE - or eax,ebx - inc ebp - mov [edi],eax ; Write DREG - mov [SfxSignZero],eax - CLRFLAGS - FXReturn -%endmacro - -%macro XORRNc 1 ; V - mov eax,[esi] ; Read Source - mov ebx,[SfxR0+%1*4] ; Read - FETCHPIPE - xor eax,ebx - inc ebp - mov [edi],eax ; Write DREG - mov [SfxSignZero],eax - CLRFLAGS - FXReturn -%endmacro - -%macro ORIc 1 ; V - mov eax,[esi] ; Read Source - FETCHPIPE - or eax,%1 - inc ebp - mov [edi],eax ; Write DREG - mov [SfxSignZero],eax - CLRFLAGS - FXReturn -%endmacro - -%macro XORIc 1 ; V - mov eax,[esi] ; Read Source - FETCHPIPE - xor eax,%1 - inc ebp - mov [edi],eax ; Write DREG - mov [SfxSignZero],eax - CLRFLAGS - FXReturn -%endmacro - -%macro INCRNc 1 ; Verified - inc word[SfxR0+%1*4] - FETCHPIPE - mov eax,[SfxR0+%1*4] ; Read Source - mov [SfxSignZero],eax - CLRFLAGS - inc ebp - FXReturn -%endmacro - -%macro DECRNc 1 ; Verified - dec word[SfxR0+%1*4] - FETCHPIPE - mov eax,[SfxR0+%1*4] ; Read Source - mov [SfxR0+%1*4],eax - mov [SfxSignZero],eax - CLRFLAGS - inc ebp - FXReturn -%endmacro - -%macro IWTRNc 1 ; aka LEA ; Verified. - mov eax,[ebp] - mov cl,[ebp+2] - and eax,0FFFFh - add ebp,3 - mov [SfxR0+%1*4],eax - CLRFLAGS - FXReturn -%endmacro - -%macro LMRNc 1 ; Verified! - xor eax,eax - mov cl,[ebp+2] - mov ax,[ebp] - mov ebx,[SfxRAMMem] - mov [SfxLastRamAdr],eax - add [SfxLastRamAdr],ebx - mov dl,[eax+ebx] - xor eax,1 - add ebp,3 - mov dh,[eax+ebx] - mov word [SfxR0+%1*4],dx ; Store Word - CLRFLAGS - FXReturn -%endmacro - -%macro SMRNc 1 ; Verified - mov ebx,[SfxR0+%1*4] - mov eax,[ebp] - mov cl,[ebp+2] - and eax,0FFFFh - mov dx,bx - mov ebx,[SfxRAMMem] - mov [SfxLastRamAdr],eax - add [SfxLastRamAdr],ebx - mov [eax+ebx],dl - xor eax,1 - add ebp,3 - mov [eax+ebx],dh - CLRFLAGS - FXReturn -%endmacro diff --git a/i386/fxtable.asm b/i386/fxtable.asm deleted file mode 100644 index e41d3c92..00000000 --- a/i386/fxtable.asm +++ /dev/null @@ -1,3557 +0,0 @@ -; Snes9x - Portable Super Nintendo Entertainment System (TM) emulator. -; -; Super FX assembler emulator code -; (c) Copyright 1998, 1999 zsKnight and _Demo_. -; -; Permission to use, copy, modify and distribute Snes9x in both binary and -; source form, for non-commercial purposes, is hereby granted without fee, -; providing that this license information and copyright notice appear with -; all copies and any derived work. -; -; This software is provided 'as-is', without any express or implied -; warranty. In no event shall the authors be held liable for any damages -; arising from the use of this software. -; -; Snes9x is freeware for PERSONAL USE only. Commercial users should -; seek permission of the copyright holders first. Commercial use includes -; charging money for Snes9x or software derived from Snes9x. -; -; The copyright holders request that bug fixes and improvements to the code -; should be forwarded to them so everyone can benefit from the modifications -; in future versions. -; -; Super NES and Super Nintendo Entertainment System are trademarks of -; Nintendo Co., Limited and its subsidiary companies. -; -%include "macros.mac" -EXTSYM FxTable,FxTableA1,FxTableA2,FxTableA3,FxTableb,FxTablebA1,FxTablebA2 -EXTSYM FxTablebA3,FxTablec,FxTablecA1,FxTablecA2,FxTablecA3,FxTabled -EXTSYM FxTabledA1,FxTabledA2,FxTabledA3,SfxMemTable,romdata,sfxramdata -EXTSYM sfxplottable - -EXTSYM FxOp00,FxOp01,FxOp02,FxOp03,FxOp04,FxOp05,FxOp06,FxOp07,FxOp08 -EXTSYM FxOp09,FxOp0A,FxOp0B,FxOp0C,FxOp0D,FxOp0E,FxOp0F,FxOp10,FxOp11 -EXTSYM FxOp12,FxOp13,FxOp14,FxOp15,FxOp16,FxOp17,FxOp18,FxOp19,FxOp1A -EXTSYM FxOp1B,FxOp1C,FxOp1D,FxOp1E,FxOp1F,FxOp20,FxOp21,FxOp22,FxOp23 -EXTSYM FxOp24,FxOp25,FxOp26,FxOp27,FxOp28,FxOp29,FxOp2A,FxOp2B,FxOp2C -EXTSYM FxOp2D,FxOp2E,FxOp2F,FxOp30,FxOp30A1,FxOp31,FxOp31A1,FxOp32 -EXTSYM FxOp32A1,FxOp33,FxOp33A1,FxOp34,FxOp34A1,FxOp35,FxOp35A1,FxOp36 -EXTSYM FxOp36A1,FxOp37,FxOp37A1,FxOp38,FxOp38A1,FxOp39,FxOp39A1,FxOp3A -EXTSYM FxOp3AA1,FxOp3B,FxOp3BA1,FxOp3C,FxOp3D,FxOp3E,FxOp3F,FxOp40 -EXTSYM FxOp40A1,FxOp41,FxOp41A1,FxOp42,FxOp42A1,FxOp43,FxOp43A1,FxOp44 -EXTSYM FxOp44A1,FxOp45,FxOp45A1,FxOp46,FxOp46A1,FxOp47,FxOp47A1,FxOp48 -EXTSYM FxOp48A1,FxOp49,FxOp49A1,FxOp4A,FxOp4AA1,FxOp4B,FxOp4BA1,FxOp4C -EXTSYM FxOp4CA1,FxOp4D,FxOp4E,FxOp4EA1,FxOp4F,FxOp50,FxOp50A1,FxOp50A2 -EXTSYM FxOp50A3,FxOp51,FxOp51A1,FxOp51A2,FxOp51A3,FxOp52,FxOp52A1,FxOp52A2 -EXTSYM FxOp52A3,FxOp53,FxOp53A1,FxOp53A2,FxOp53A3,FxOp54,FxOp54A1,FxOp54A2 -EXTSYM FxOp54A3,FxOp55,FxOp55A1,FxOp55A2,FxOp55A3,FxOp56,FxOp56A1,FxOp56A2 -EXTSYM FxOp56A3,FxOp57,FxOp57A1,FxOp57A2,FxOp57A3,FxOp58,FxOp58A1,FxOp58A2 -EXTSYM FxOp58A3,FxOp59,FxOp59A1,FxOp59A2,FxOp59A3,FxOp5A,FxOp5AA1,FxOp5AA2 -EXTSYM FxOp5AA3,FxOp5B,FxOp5BA1,FxOp5BA2,FxOp5BA3,FxOp5C,FxOp5CA1,FxOp5CA2 -EXTSYM FxOp5CA3,FxOp5D,FxOp5DA1,FxOp5DA2,FxOp5DA3,FxOp5E,FxOp5EA1,FxOp5EA2 -EXTSYM FxOp5EA3,FxOp5F,FxOp5FA1,FxOp5FA2,FxOp5FA3,FxOp60,FxOp60A1,FxOp60A2 -EXTSYM FxOp60A3,FxOp61,FxOp61A1,FxOp61A2,FxOp61A3,FxOp62,FxOp62A1,FxOp62A2 -EXTSYM FxOp62A3,FxOp63,FxOp63A1,FxOp63A2,FxOp63A3,FxOp64,FxOp64A1,FxOp64A2 -EXTSYM FxOp64A3,FxOp65,FxOp65A1,FxOp65A2,FxOp65A3,FxOp66,FxOp66A1,FxOp66A2 -EXTSYM FxOp66A3,FxOp67,FxOp67A1,FxOp67A2,FxOp67A3,FxOp68,FxOp68A1,FxOp68A2 -EXTSYM FxOp68A3,FxOp69,FxOp69A1,FxOp69A2,FxOp69A3,FxOp6A,FxOp6AA1,FxOp6AA2 -EXTSYM FxOp6AA3,FxOp6B,FxOp6BA1,FxOp6BA2,FxOp6BA3,FxOp6C,FxOp6CA1,FxOp6CA2 -EXTSYM FxOp6CA3,FxOp6D,FxOp6DA1,FxOp6DA2,FxOp6DA3,FxOp6E,FxOp6EA1,FxOp6EA2 -EXTSYM FxOp6EA3,FxOp6F,FxOp6FA1,FxOp6FA2,FxOp6FA3,FxOp70,FxOp71,FxOp71A1 -EXTSYM FxOp71A2,FxOp71A3,FxOp72,FxOp72A1,FxOp72A2,FxOp72A3,FxOp73,FxOp73A1 -EXTSYM FxOp73A2,FxOp73A3,FxOp74,FxOp74A1,FxOp74A2,FxOp74A3,FxOp75,FxOp75A1 -EXTSYM FxOp75A2,FxOp75A3,FxOp76,FxOp76A1,FxOp76A2,FxOp76A3,FxOp77,FxOp77A1 -EXTSYM FxOp77A2,FxOp77A3,FxOp78,FxOp78A1,FxOp78A2,FxOp78A3,FxOp79,FxOp79A1 -EXTSYM FxOp79A2,FxOp79A3,FxOp7A,FxOp7AA1,FxOp7AA2,FxOp7AA3,FxOp7B,FxOp7BA1 -EXTSYM FxOp7BA2,FxOp7BA3,FxOp7C,FxOp7CA1,FxOp7CA2,FxOp7CA3,FxOp7D,FxOp7DA1 -EXTSYM FxOp7DA2,FxOp7DA3,FxOp7E,FxOp7EA1,FxOp7EA2,FxOp7EA3,FxOp7F,FxOp7FA1 -EXTSYM FxOp7FA2,FxOp7FA3,FxOp80,FxOp80A1,FxOp80A2,FxOp80A3,FxOp81,FxOp81A1 -EXTSYM FxOp81A2,FxOp81A3,FxOp82,FxOp82A1,FxOp82A2,FxOp82A3,FxOp83,FxOp83A1 -EXTSYM FxOp83A2,FxOp83A3,FxOp84,FxOp84A1,FxOp84A2,FxOp84A3,FxOp85,FxOp85A1 -EXTSYM FxOp85A2,FxOp85A3,FxOp86,FxOp86A1,FxOp86A2,FxOp86A3,FxOp87,FxOp87A1 -EXTSYM FxOp87A2,FxOp87A3,FxOp88,FxOp88A1,FxOp88A2,FxOp88A3,FxOp89,FxOp89A1 -EXTSYM FxOp89A2,FxOp89A3,FxOp8A,FxOp8AA1,FxOp8AA2,FxOp8AA3,FxOp8B,FxOp8BA1 -EXTSYM FxOp8BA2,FxOp8BA3,FxOp8C,FxOp8CA1,FxOp8CA2,FxOp8CA3,FxOp8D,FxOp8DA1 -EXTSYM FxOp8DA2,FxOp8DA3,FxOp8E,FxOp8EA1,FxOp8EA2,FxOp8EA3,FxOp8F,FxOp8FA1 -EXTSYM FxOp8FA2,FxOp8FA3,FxOp90,FxOp91,FxOp92,FxOp93,FxOp94,FxOp95,FxOp96 -EXTSYM FxOp96A1,FxOp97,FxOp98,FxOp98A1,FxOp99,FxOp99A1,FxOp9A,FxOp9AA1,FxOp9B -EXTSYM FxOp9BA1,FxOp9C,FxOp9CA1,FxOp9D,FxOp9DA1,FxOp9E,FxOp9F,FxOp9FA1,FxOpA0 -EXTSYM FxOpA0A1,FxOpA0A2,FxOpA1,FxOpA1A1,FxOpA1A2,FxOpA2,FxOpA2A1,FxOpA2A2 -EXTSYM FxOpA3,FxOpA3A1,FxOpA3A2,FxOpA4,FxOpA4A1,FxOpA4A2,FxOpA5,FxOpA5A1 -EXTSYM FxOpA5A2,FxOpA6,FxOpA6A1,FxOpA6A2,FxOpA7,FxOpA7A1,FxOpA7A2,FxOpA8 -EXTSYM FxOpA8A1,FxOpA8A2,FxOpA9,FxOpA9A1,FxOpA9A2,FxOpAA,FxOpAAA1,FxOpAAA2 -EXTSYM FxOpAB,FxOpABA1,FxOpABA2,FxOpAC,FxOpACA1,FxOpACA2,FxOpAD,FxOpADA1 -EXTSYM FxOpADA2,FxOpAE,FxOpAEA1,FxOpAEA2,FxOpAF,FxOpAFA1,FxOpAFA2,FxOpB0 -EXTSYM FxOpB1,FxOpB2,FxOpB3,FxOpB4,FxOpB5,FxOpB6,FxOpB7,FxOpB8,FxOpB9,FxOpBA -EXTSYM FxOpBB,FxOpBC,FxOpBD,FxOpBE,FxOpBF,FxOpC0,FxOpC1,FxOpC1A1,FxOpC1A2 -EXTSYM FxOpC1A3,FxOpC2,FxOpC2A1,FxOpC2A2,FxOpC2A3,FxOpC3,FxOpC3A1,FxOpC3A2 -EXTSYM FxOpC3A3,FxOpC4,FxOpC4A1,FxOpC4A2,FxOpC4A3,FxOpC5,FxOpC5A1,FxOpC5A2 -EXTSYM FxOpC5A3,FxOpC6,FxOpC6A1,FxOpC6A2,FxOpC6A3,FxOpC7,FxOpC7A1,FxOpC7A2 -EXTSYM FxOpC7A3,FxOpC8,FxOpC8A1,FxOpC8A2,FxOpC8A3,FxOpC9,FxOpC9A1,FxOpC9A2 -EXTSYM FxOpC9A3,FxOpCA,FxOpCAA1,FxOpCAA2,FxOpCAA3,FxOpCB,FxOpCBA1,FxOpCBA2 -EXTSYM FxOpCBA3,FxOpCC,FxOpCCA1,FxOpCCA2,FxOpCCA3,FxOpCD,FxOpCDA1,FxOpCDA2 -EXTSYM FxOpCDA3,FxOpCE,FxOpCEA1,FxOpCEA2,FxOpCEA3,FxOpCF,FxOpCFA1,FxOpCFA2 -EXTSYM FxOpCFA3,FxOpD0,FxOpD1,FxOpD2,FxOpD3,FxOpD4,FxOpD5,FxOpD6,FxOpD7 -EXTSYM FxOpD8,FxOpD9,FxOpDA,FxOpDB,FxOpDC,FxOpDD,FxOpDE,FxOpDF,FxOpDFA2 -EXTSYM FxOpDFA3,FxOpE0,FxOpE1,FxOpE2,FxOpE3,FxOpE4,FxOpE5,FxOpE6,FxOpE7 -EXTSYM FxOpE8,FxOpE9,FxOpEA,FxOpEB,FxOpEC,FxOpED,FxOpEE,FxOpEF,FxOpEFA1 -EXTSYM FxOpEFA2,FxOpEFA3,FxOpF0,FxOpF0A1,FxOpF0A2,FxOpF1,FxOpF1A1,FxOpF1A2 -EXTSYM FxOpF2,FxOpF2A1,FxOpF2A2,FxOpF3,FxOpF3A1,FxOpF3A2,FxOpF4,FxOpF4A1 -EXTSYM FxOpF4A2,FxOpF5,FxOpF5A1,FxOpF5A2,FxOpF6,FxOpF6A1,FxOpF6A2,FxOpF7 -EXTSYM FxOpF7A1,FxOpF7A2,FxOpF8,FxOpF8A1,FxOpF8A2,FxOpF9,FxOpF9A1,FxOpF9A2 -EXTSYM FxOpFA,FxOpFAA1,FxOpFAA2,FxOpFB,FxOpFBA1,FxOpFBA2,FxOpFC,FxOpFCA1 -EXTSYM FxOpFCA2,FxOpFD,FxOpFDA1,FxOpFDA2,FxOpFE,FxOpFEA1,FxOpFEA2,FxOpFF -EXTSYM FxOpFFA1,FxOpFFA2,FxOpb05,FxOpb06,FxOpb07,FxOpb08,FxOpb09,FxOpb0A -EXTSYM FxOpb0B,FxOpb0C,FxOpb0D,FxOpb0E,FxOpb0F,FxOpb10,FxOpb11,FxOpb12 -EXTSYM FxOpb13,FxOpb14,FxOpb15,FxOpb16,FxOpb17,FxOpb18,FxOpb19,FxOpb1A,FxOpb1B -EXTSYM FxOpb1C,FxOpb1D,FxOpb1E,FxOpb1F,FxOpb3D,FxOpb3E,FxOpb3F,FxOpbB0,FxOpbB1 -EXTSYM FxOpbB2,FxOpbB3,FxOpbB4,FxOpbB5,FxOpbB6,FxOpbB7,FxOpbB8,FxOpbB9,FxOpbBA -EXTSYM FxOpbBB,FxOpbBC,FxOpbBD,FxOpbBE,FxOpbBF,FxOpc05,FxOpc06,FxOpc07,FxOpc08 -EXTSYM FxOpc09,FxOpc0A,FxOpc0B,FxOpc0C,FxOpc0D,FxOpc0E,FxOpc0F,FxOpc10,FxOpc11 -EXTSYM FxOpc12,FxOpc13,FxOpc14,FxOpc15,FxOpc16,FxOpc17,FxOpc18,FxOpc19,FxOpc1A -EXTSYM FxOpc1B,FxOpc1C,FxOpc1D,FxOpc1E,FxOpc1F,FxOpc3D,FxOpc3E,FxOpc3F,FxOpcB0 -EXTSYM FxOpcB1,FxOpcB2,FxOpcB3,FxOpcB4,FxOpcB5,FxOpcB6,FxOpcB7,FxOpcB8,FxOpcB9 -EXTSYM FxOpcBA,FxOpcBB,FxOpcBC,FxOpcBD,FxOpcBE,FxOpcBF,FxOpd00,FxOpd01,FxOpd02 -EXTSYM FxOpd03,FxOpd04,FxOpd05,FxOpd06,FxOpd07,FxOpd08,FxOpd09,FxOpd0A,FxOpd0B -EXTSYM FxOpd0C,FxOpd0D,FxOpd0E,FxOpd0F,FxOpd10,FxOpd11,FxOpd12,FxOpd13,FxOpd14 -EXTSYM FxOpd15,FxOpd16,FxOpd17,FxOpd18,FxOpd19,FxOpd1A,FxOpd1B,FxOpd1C,FxOpd1D -EXTSYM FxOpd1E,FxOpd1F,FxOpd20,FxOpd21,FxOpd22,FxOpd23,FxOpd24,FxOpd25,FxOpd26 -EXTSYM FxOpd27,FxOpd28,FxOpd29,FxOpd2A,FxOpd2B,FxOpd2C,FxOpd2D,FxOpd2E,FxOpd2F -EXTSYM FxOpd30,FxOpd30A1,FxOpd31,FxOpd31A1,FxOpd32,FxOpd32A1,FxOpd33,FxOpd33A1 -EXTSYM FxOpd34,FxOpd34A1,FxOpd35,FxOpd35A1,FxOpd36,FxOpd36A1,FxOpd37,FxOpd37A1 -EXTSYM FxOpd38,FxOpd38A1,FxOpd39,FxOpd39A1,FxOpd3A,FxOpd3AA1,FxOpd3B,FxOpd3BA1 -EXTSYM FxOpd3C,FxOpd3D,FxOpd3E,FxOpd3F,FxOpd40,FxOpd40A1,FxOpd41,FxOpd41A1 -EXTSYM FxOpd42,FxOpd42A1,FxOpd43,FxOpd43A1,FxOpd44,FxOpd44A1,FxOpd45,FxOpd45A1 -EXTSYM FxOpd46,FxOpd46A1,FxOpd47,FxOpd47A1,FxOpd48,FxOpd48A1,FxOpd49,FxOpd49A1 -EXTSYM FxOpd4A,FxOpd4AA1,FxOpd4B,FxOpd4BA1,FxOpd4C,FxOpd4CA1,FxOpd4D,FxOpd4E -EXTSYM FxOpd4EA1,FxOpd4F,FxOpd50,FxOpd50A1,FxOpd50A2,FxOpd50A3,FxOpd51,FxOpd51A1 -EXTSYM FxOpd51A2,FxOpd51A3,FxOpd52,FxOpd52A1,FxOpd52A2,FxOpd52A3,FxOpd53 -EXTSYM FxOpd53A1,FxOpd53A2,FxOpd53A3,FxOpd54,FxOpd54A1,FxOpd54A2,FxOpd54A3 -EXTSYM FxOpd55,FxOpd55A1,FxOpd55A2,FxOpd55A3,FxOpd56,FxOpd56A1,FxOpd56A2 -EXTSYM FxOpd56A3,FxOpd57,FxOpd57A1,FxOpd57A2,FxOpd57A3,FxOpd58,FxOpd58A1 -EXTSYM FxOpd58A2,FxOpd58A3,FxOpd59,FxOpd59A1,FxOpd59A2,FxOpd59A3,FxOpd5A -EXTSYM FxOpd5AA1,FxOpd5AA2,FxOpd5AA3,FxOpd5B,FxOpd5BA1,FxOpd5BA2,FxOpd5BA3 -EXTSYM FxOpd5C,FxOpd5CA1,FxOpd5CA2,FxOpd5CA3,FxOpd5D,FxOpd5DA1,FxOpd5DA2 -EXTSYM FxOpd5DA3,FxOpd5E,FxOpd5EA1,FxOpd5EA2,FxOpd5EA3,FxOpd5F,FxOpd5FA1 -EXTSYM FxOpd5FA2,FxOpd5FA3,FxOpd60,FxOpd60A1,FxOpd60A2,FxOpd60A3,FxOpd61 -EXTSYM FxOpd61A1,FxOpd61A2,FxOpd61A3,FxOpd62,FxOpd62A1,FxOpd62A2,FxOpd62A3 -EXTSYM FxOpd63,FxOpd63A1,FxOpd63A2,FxOpd63A3,FxOpd64,FxOpd64A1,FxOpd64A2 -EXTSYM FxOpd64A3,FxOpd65,FxOpd65A1,FxOpd65A2,FxOpd65A3,FxOpd66,FxOpd66A1 -EXTSYM FxOpd66A2,FxOpd66A3,FxOpd67,FxOpd67A1,FxOpd67A2,FxOpd67A3,FxOpd68 -EXTSYM FxOpd68A1,FxOpd68A2,FxOpd68A3,FxOpd69,FxOpd69A1,FxOpd69A2,FxOpd69A3 -EXTSYM FxOpd6A,FxOpd6AA1,FxOpd6AA2,FxOpd6AA3,FxOpd6B,FxOpd6BA1,FxOpd6BA2 -EXTSYM FxOpd6BA3,FxOpd6C,FxOpd6CA1,FxOpd6CA2,FxOpd6CA3,FxOpd6D,FxOpd6DA1 -EXTSYM FxOpd6DA2,FxOpd6DA3,FxOpd6E,FxOpd6EA1,FxOpd6EA2,FxOpd6EA3,FxOpd6F -EXTSYM FxOpd6FA1,FxOpd6FA2,FxOpd6FA3,FxOpd70,FxOpd71,FxOpd71A1,FxOpd71A2 -EXTSYM FxOpd71A3,FxOpd72,FxOpd72A1,FxOpd72A2,FxOpd72A3,FxOpd73,FxOpd73A1 -EXTSYM FxOpd73A2,FxOpd73A3,FxOpd74,FxOpd74A1,FxOpd74A2,FxOpd74A3,FxOpd75 -EXTSYM FxOpd75A1,FxOpd75A2,FxOpd75A3,FxOpd76,FxOpd76A1,FxOpd76A2,FxOpd76A3 -EXTSYM FxOpd77,FxOpd77A1,FxOpd77A2,FxOpd77A3,FxOpd78,FxOpd78A1,FxOpd78A2 -EXTSYM FxOpd78A3,FxOpd79,FxOpd79A1,FxOpd79A2,FxOpd79A3,FxOpd7A,FxOpd7AA1 -EXTSYM FxOpd7AA2,FxOpd7AA3,FxOpd7B,FxOpd7BA1,FxOpd7BA2,FxOpd7BA3,FxOpd7C -EXTSYM FxOpd7CA1,FxOpd7CA2,FxOpd7CA3,FxOpd7D,FxOpd7DA1,FxOpd7DA2,FxOpd7DA3 -EXTSYM FxOpd7E,FxOpd7EA1,FxOpd7EA2,FxOpd7EA3,FxOpd7F,FxOpd7FA1,FxOpd7FA2 -EXTSYM FxOpd7FA3,FxOpd80,FxOpd80A1,FxOpd80A2,FxOpd80A3,FxOpd81,FxOpd81A1 -EXTSYM FxOpd81A2,FxOpd81A3,FxOpd82,FxOpd82A1,FxOpd82A2,FxOpd82A3,FxOpd83 -EXTSYM FxOpd83A1,FxOpd83A2,FxOpd83A3,FxOpd84,FxOpd84A1,FxOpd84A2,FxOpd84A3 -EXTSYM FxOpd85,FxOpd85A1,FxOpd85A2,FxOpd85A3,FxOpd86,FxOpd86A1,FxOpd86A2 -EXTSYM FxOpd86A3,FxOpd87,FxOpd87A1,FxOpd87A2,FxOpd87A3,FxOpd88,FxOpd88A1 -EXTSYM FxOpd88A2,FxOpd88A3,FxOpd89,FxOpd89A1,FxOpd89A2,FxOpd89A3,FxOpd8A -EXTSYM FxOpd8AA1,FxOpd8AA2,FxOpd8AA3,FxOpd8B,FxOpd8BA1,FxOpd8BA2,FxOpd8BA3 -EXTSYM FxOpd8C,FxOpd8CA1,FxOpd8CA2,FxOpd8CA3,FxOpd8D,FxOpd8DA1,FxOpd8DA2 -EXTSYM FxOpd8DA3,FxOpd8E,FxOpd8EA1,FxOpd8EA2,FxOpd8EA3,FxOpd8F,FxOpd8FA1 -EXTSYM FxOpd8FA2,FxOpd8FA3,FxOpd90,FxOpd91,FxOpd92,FxOpd93,FxOpd94,FxOpd95 -EXTSYM FxOpd96,FxOpd96A1,FxOpd97,FxOpd98,FxOpd98A1,FxOpd99,FxOpd99A1,FxOpd9A -EXTSYM FxOpd9AA1,FxOpd9B,FxOpd9BA1,FxOpd9C,FxOpd9CA1,FxOpd9D,FxOpd9DA1,FxOpd9E -EXTSYM FxOpd9F,FxOpd9FA1,FxOpdA0,FxOpdA0A1,FxOpdA0A2,FxOpdA1,FxOpdA1A1,FxOpdA1A2 -EXTSYM FxOpdA2,FxOpdA2A1,FxOpdA2A2,FxOpdA3,FxOpdA3A1,FxOpdA3A2,FxOpdA4,FxOpdA4A1 -EXTSYM FxOpdA4A2,FxOpdA5,FxOpdA5A1,FxOpdA5A2,FxOpdA6,FxOpdA6A1,FxOpdA6A2,FxOpdA7 -EXTSYM FxOpdA7A1,FxOpdA7A2,FxOpdA8,FxOpdA8A1,FxOpdA8A2,FxOpdA9,FxOpdA9A1 -EXTSYM FxOpdA9A2,FxOpdAA,FxOpdAAA1,FxOpdAAA2,FxOpdAB,FxOpdABA1,FxOpdABA2 -EXTSYM FxOpdAC,FxOpdACA1,FxOpdACA2,FxOpdAD,FxOpdADA1,FxOpdADA2,FxOpdAE -EXTSYM FxOpdAEA1,FxOpdAEA2,FxOpdAF,FxOpdAFA1,FxOpdAFA2,FxOpdB0,FxOpdB1,FxOpdB2 -EXTSYM FxOpdB3,FxOpdB4,FxOpdB5,FxOpdB6,FxOpdB7,FxOpdB8,FxOpdB9,FxOpdBA,FxOpdBB -EXTSYM FxOpdBC,FxOpdBD,FxOpdBE,FxOpdBF,FxOpdC0,FxOpdC1,FxOpdC1A1,FxOpdC1A2 -EXTSYM FxOpdC1A3,FxOpdC2,FxOpdC2A1,FxOpdC2A2,FxOpdC2A3,FxOpdC3,FxOpdC3A1 -EXTSYM FxOpdC3A2,FxOpdC3A3,FxOpdC4,FxOpdC4A1,FxOpdC4A2,FxOpdC4A3,FxOpdC5 -EXTSYM FxOpdC5A1,FxOpdC5A2,FxOpdC5A3,FxOpdC6,FxOpdC6A1,FxOpdC6A2,FxOpdC6A3 -EXTSYM FxOpdC7,FxOpdC7A1,FxOpdC7A2,FxOpdC7A3,FxOpdC8,FxOpdC8A1,FxOpdC8A2 -EXTSYM FxOpdC8A3,FxOpdC9,FxOpdC9A1,FxOpdC9A2,FxOpdC9A3,FxOpdCA,FxOpdCAA1 -EXTSYM FxOpdCAA2,FxOpdCAA3,FxOpdCB,FxOpdCBA1,FxOpdCBA2,FxOpdCBA3,FxOpdCC -EXTSYM FxOpdCCA1,FxOpdCCA2,FxOpdCCA3,FxOpdCD,FxOpdCDA1,FxOpdCDA2,FxOpdCDA3 -EXTSYM FxOpdCE,FxOpdCEA1,FxOpdCEA2,FxOpdCEA3,FxOpdCF,FxOpdCFA1,FxOpdCFA2 -EXTSYM FxOpdCFA3,FxOpdD0,FxOpdD1,FxOpdD2,FxOpdD3,FxOpdD4,FxOpdD5,FxOpdD6 -EXTSYM FxOpdD7,FxOpdD8,FxOpdD9,FxOpdDA,FxOpdDB,FxOpdDC,FxOpdDD,FxOpdDE,FxOpdDF -EXTSYM FxOpdDFA2,FxOpdDFA3,FxOpdE0,FxOpdE1,FxOpdE2,FxOpdE3,FxOpdE4,FxOpdE5 -EXTSYM FxOpdE6,FxOpdE7,FxOpdE8,FxOpdE9,FxOpdEA,FxOpdEB,FxOpdEC,FxOpdED,FxOpdEE -EXTSYM FxOpdEF,FxOpdEFA1,FxOpdEFA2,FxOpdEFA3,FxOpdF0,FxOpdF0A1,FxOpdF0A2,FxOpdF1 -EXTSYM FxOpdF1A1,FxOpdF1A2,FxOpdF2,FxOpdF2A1,FxOpdF2A2,FxOpdF3,FxOpdF3A1,FxOpdF3A2 -EXTSYM FxOpdF4,FxOpdF4A1,FxOpdF4A2,FxOpdF5,FxOpdF5A1,FxOpdF5A2,FxOpdF6,FxOpdF6A1 -EXTSYM FxOpdF6A2,FxOpdF7,FxOpdF7A1,FxOpdF7A2,FxOpdF8,FxOpdF8A1,FxOpdF8A2,FxOpdF9 -EXTSYM FxOpdF9A1,FxOpdF9A2,FxOpdFA,FxOpdFAA1,FxOpdFAA2,FxOpdFB,FxOpdFBA1,FxOpdFBA2 -EXTSYM FxOpdFC,FxOpdFCA1,FxOpdFCA2,FxOpdFD,FxOpdFDA1,FxOpdFDA2,FxOpdFE,FxOpdFEA1 -EXTSYM FxOpdFEA2,FxOpdFF,FxOpdFFA1,FxOpdFFA2,PLOTJmpa,PLOTJmpb - -EXTSYM FxOp4C1284b,FxOp4C1284bz,FxOp4C1284bd,FxOp4C1284bzd -EXTSYM FxOp4C1282b,FxOp4C1282bz,FxOp4C1282bd,FxOp4C1282bzd -EXTSYM FxOp4C1288b,FxOp4C1288bz,FxOp4C1288bd,FxOp4C1288bzd -EXTSYM FxOp4C1288bl,FxOp4C1288bzl,FxOp4C1288bdl,FxOp4C1288bzdl -EXTSYM FxOpd4C1284b,FxOpd4C1284bz,FxOpd4C1284bd,FxOpd4C1284bzd -EXTSYM FxOpd4C1282b,FxOpd4C1282bz,FxOpd4C1282bd,FxOpd4C1282bzd -EXTSYM FxOpd4C1288b,FxOpd4C1288bz,FxOpd4C1288bd,FxOpd4C1288bzd -EXTSYM FxOpd4C1288bl,FxOpd4C1288bzl,FxOpd4C1288bdl,FxOpd4C1288bzdl - - -EXTSYM fxxand,fxbit01,fxbit23,fxbit45,fxbit67 - -NEWSYM FxTableAsmStart - -SECTION .bss ;ALIGN=32 -NEWSYM sfx128lineloc, resd 1 -NEWSYM sfx160lineloc, resd 1 -NEWSYM sfx192lineloc, resd 1 -NEWSYM sfxobjlineloc, resd 1 - -SECTION .text - -NEWSYM InitFxTables - -; cmp al,0 -; je near .colors4 -; cmp al,3 -; je near .colors256 -; test byte[SfxPOR],01h -; jz .zerocheck -; test byte[SfxPOR],02h -; jz .nodither4b - ; Initiate PLOT jump tables - xor ebx,ebx - mov ecx,64 - mov eax,PLOTJmpa -.ploop - mov edx,ebx - push ebx - and edx,03h - test bl,04h - jz near .zerocheck - test bl,08h - jnz .dither - cmp dl,0 - je .colors4 - cmp dl,3 - je .colors256 - mov ebx,FxOp4C1284b - jmp .end -.colors4 - mov ebx,FxOp4C1282b - jmp .end -.colors256 - test bl,20h - jnz .lowercheck - mov ebx,FxOp4C1288b - jmp .end -.lowercheck - mov ebx,FxOp4C1288bl - jmp .end -.dither - cmp dl,0 - je .colors4d - cmp dl,3 - je .colors256d - mov ebx,FxOp4C1284bd - jmp .end -.colors4d - mov ebx,FxOp4C1282bd - jmp .end -.colors256d - test bl,20h - jnz .lowercheckd - mov ebx,FxOp4C1288bd - jmp .end -.lowercheckd - mov ebx,FxOp4C1288bdl - jmp .end -.zerocheck - test bl,08h - jnz .ditherz - cmp dl,0 - je .colors4z - cmp dl,3 - je .colors256z - mov ebx,FxOp4C1284bz - jmp .end -.colors4z - mov ebx,FxOp4C1282bz - jmp .end -.colors256z - test bl,20h - jnz .lowercheckz - mov ebx,FxOp4C1288bz - jmp .end -.lowercheckz - mov ebx,FxOp4C1288bzl - jmp .end -.ditherz - cmp dl,0 - je .colors4dz - cmp dl,3 - je .colors256dz - mov ebx,FxOp4C1284bzd - jmp .end -.colors4dz - mov ebx,FxOp4C1282bzd - jmp .end -.colors256dz - test bl,20h - jnz .lowercheckdz - mov ebx,FxOp4C1288bzd - jmp .end -.lowercheckdz - mov ebx,FxOp4C1288bzdl -.end - mov [eax],ebx - pop ebx - inc ebx - add eax,4 - dec ecx - jnz near .ploop - - xor ebx,ebx - mov ecx,64 - mov eax,PLOTJmpb -.ploop2 - mov edx,ebx - push ebx - and edx,03h - test bl,04h - jz near .zerocheck2 - test bl,08h - jnz .dither2 - cmp dl,0 - je .colors42 - cmp dl,3 - je .colors2562 - mov ebx,FxOpd4C1284b - jmp .end2 -.colors42 - mov ebx,FxOpd4C1282b - jmp .end2 -.colors2562 - test bl,20h - jnz .lowercheck2 - mov ebx,FxOpd4C1288b - jmp .end2 -.lowercheck2 - mov ebx,FxOpd4C1288bl - jmp .end2 -.dither2 - cmp dl,0 - je .colors4d2 - cmp dl,3 - je .colors256d2 - mov ebx,FxOpd4C1284bd - jmp .end2 -.colors4d2 - mov ebx,FxOpd4C1282bd - jmp .end2 -.colors256d2 - test bl,20h - jnz .lowercheckd2 - mov ebx,FxOpd4C1288bd - jmp .end2 -.lowercheckd2 - mov ebx,FxOpd4C1288bdl - jmp .end2 -.zerocheck2 - test bl,08h - jnz .ditherz2 - cmp dl,0 - je .colors4z2 - cmp dl,3 - je .colors256z2 - mov ebx,FxOpd4C1284bz - jmp .end2 -.colors4z2 - mov ebx,FxOpd4C1282bz - jmp .end2 -.colors256z2 - test bl,20h - jnz .lowercheckz2 - mov ebx,FxOpd4C1288bz - jmp .end2 -.lowercheckz2 - mov ebx,FxOpd4C1288bzl - jmp .end2 -.ditherz2 - cmp dl,0 - je .colors4dz2 - cmp dl,3 - je .colors256dz2 - mov ebx,FxOpd4C1284bzd - jmp .end2 -.colors4dz2 - mov ebx,FxOpd4C1282bzd - jmp .end2 -.colors256dz2 - test bl,20h - jnz .lowercheckdz2 - mov ebx,FxOpd4C1288bzd - jmp .end2 -.lowercheckdz2 - mov ebx,FxOpd4C1288bzdl -.end2 - mov [eax],ebx - pop ebx - inc ebx - add eax,4 - dec ecx - jnz near .ploop2 - - ; Initiate AND and bit tables - mov eax,fxxand - mov ecx,256 - xor ebx,ebx -.loopat - push ecx - mov ecx,ebx - and ecx,07h - xor ecx,07h - mov edx,0101h - shl edx,cl - xor edx,0FFFFFFFFh - pop ecx - mov [eax],edx - inc ebx - add eax,4 - dec ecx - jnz .loopat - ; bit tables - mov eax,fxbit01 - mov ecx,256 - xor ebx,ebx -.loopb01 - xor edx,edx - test ebx,01h - jz .nob0 - or edx,0FFh -.nob0 - test ebx,02h - jz .nob1 - or edx,0FF00h -.nob1 - mov [eax],edx - xor edx,edx - test ebx,04h - jz .nob2 - or edx,0FFh -.nob2 - test ebx,08h - jz .nob3 - or edx,0FF00h -.nob3 - mov [eax+256*4],edx - xor edx,edx - test ebx,10h - jz .nob4 - or edx,0FFh -.nob4 - test ebx,20h - jz .nob5 - or edx,0FF00h -.nob5 - mov [eax+256*8],edx - xor edx,edx - test ebx,40h - jz .nob6 - or edx,0FFh -.nob6 - test ebx,80h - jz .nob7 - or edx,0FF00h -.nob7 - mov [eax+256*12],edx - add eax,4 - inc ebx - dec ecx - jnz near .loopb01 - - ; Initialize PLOT tables -; mov esi,[sfxramdata] - mov esi,[sfxplottable] -; add esi,1024*1024 - ; Create 4 * 256k plot tables - ; 128 line mode - mov [sfx128lineloc],esi - xor eax,eax - xor ebx,ebx -.nexty -.nextx - cmp eax,128 - jae .over - push eax - push ebx - shr eax,3 - shr ebx,3 - shl ebx,4 - add ebx,eax - mov [esi],ebx - add esi,4 - pop ebx - pop eax - jmp .notover -.over - mov dword[esi],0FFFFFFFFh - add esi,4 -.notover - inc al - jnz .nextx - inc bl - jnz .nexty - ; 160 line mode - mov [sfx160lineloc],esi -.nexty2 -.nextx2 - cmp eax,160 - jae .over2 - push eax - push ebx - shr eax,3 - shr ebx,3 - mov edx,ebx - shl ebx,4 - shl edx,2 - add ebx,eax - add ebx,edx - mov [esi],ebx - add esi,4 - pop ebx - pop eax - jmp .notover2 -.over2 - mov dword[esi],0FFFFFFFFh - add esi,4 -.notover2 - inc al - jnz .nextx2 - inc bl - jnz .nexty2 - ; 192 line mode - mov [sfx192lineloc],esi -.nexty3 -.nextx3 - cmp eax,192 - jae .over3 - push eax - push ebx - shr eax,3 - shr ebx,3 - mov edx,ebx - shl ebx,4 - shl edx,3 - add ebx,eax - add ebx,edx - mov [esi],ebx - add esi,4 - pop ebx - pop eax - jmp .notover3 -.over3 - mov dword[esi],0FFFFFFFFh - add esi,4 -.notover3 - inc al - jnz .nextx3 - inc bl - jnz .nexty3 - ; obj mode - mov [sfxobjlineloc],esi -.nexty4 -.nextx4 - push eax - push ebx - and ebx,80h - and eax,80h - shl ebx,1 - shl eax,2 - add ebx,eax - mov edx,ebx - pop ebx - pop eax - push eax - push ebx - and ebx,78h - and eax,78h - shr ebx,3 - shl eax,1 - add ebx,eax - add edx,ebx - pop ebx - pop eax - mov [esi],edx - add esi,4 - inc al - jnz .nextx4 - inc bl - jnz .nexty4 - - mov eax,[romdata] - xor ebx,ebx - mov ecx,256 -.loopc - mov [SfxMemTable+ebx*4],eax - inc ebx - dec ecx - jnz .loopc - - mov eax,[romdata] - add eax,200000h - xor ebx,ebx - mov ecx,64 -.loop - mov [SfxMemTable+ebx*4],eax - add eax,65536 - inc ebx - dec ecx - jnz .loop - - mov eax,[romdata] - mov ecx,64 -.loop2 - mov [SfxMemTable+ebx*4],eax - add eax,65536 - inc ebx - dec ecx - jnz .loop2 - - mov eax,[sfxramdata] - mov [SfxMemTable+70h*4],eax - add eax,65536 - mov [SfxMemTable+71h*4],eax - add eax,65536 - mov [SfxMemTable+72h*4],eax - add eax,65536 - mov [SfxMemTable+73h*4],eax - - mov eax,[romdata] - add eax,200000h - - xor ebx,ebx - mov ebx,80h - mov ecx,64 -.loops - mov [SfxMemTable+ebx*4],eax - add eax,65536 - inc ebx - dec ecx - jnz .loops - - mov eax,[romdata] - mov ecx,64 -.loop2s - mov [SfxMemTable+ebx*4],eax - add eax,65536 - inc ebx - dec ecx - jnz .loop2s - mov eax,[sfxramdata] - mov [SfxMemTable+0F0h*4],eax - add eax,65536 - mov [SfxMemTable+0F1h*4],eax - add eax,65536 - mov [SfxMemTable+0F2h*4],eax - add eax,65536 - mov [SfxMemTable+0F3h*4],eax - - mov dword [FxTable+00h*4],FxOp00 - mov dword [FxTable+01h*4],FxOp01 - mov dword [FxTable+02h*4],FxOp02 - mov dword [FxTable+03h*4],FxOp03 - mov dword [FxTable+04h*4],FxOp04 - mov dword [FxTable+05h*4],FxOp05 - mov dword [FxTable+06h*4],FxOp06 - mov dword [FxTable+07h*4],FxOp07 - mov dword [FxTable+08h*4],FxOp08 - mov dword [FxTable+09h*4],FxOp09 - mov dword [FxTable+0Ah*4],FxOp0A - mov dword [FxTable+0Bh*4],FxOp0B - mov dword [FxTable+0Ch*4],FxOp0C - mov dword [FxTable+0Dh*4],FxOp0D - mov dword [FxTable+0Eh*4],FxOp0E - mov dword [FxTable+0Fh*4],FxOp0F - - mov dword [FxTable+10h*4],FxOp10 - mov dword [FxTable+11h*4],FxOp11 - mov dword [FxTable+12h*4],FxOp12 - mov dword [FxTable+13h*4],FxOp13 - mov dword [FxTable+14h*4],FxOp14 - mov dword [FxTable+15h*4],FxOp15 - mov dword [FxTable+16h*4],FxOp16 - mov dword [FxTable+17h*4],FxOp17 - mov dword [FxTable+18h*4],FxOp18 - mov dword [FxTable+19h*4],FxOp19 - mov dword [FxTable+1Ah*4],FxOp1A - mov dword [FxTable+1Bh*4],FxOp1B - mov dword [FxTable+1Ch*4],FxOp1C - mov dword [FxTable+1Dh*4],FxOp1D - mov dword [FxTable+1Eh*4],FxOp1E - mov dword [FxTable+1Fh*4],FxOp1F - - mov dword [FxTable+20h*4],FxOp20 - mov dword [FxTable+21h*4],FxOp21 - mov dword [FxTable+22h*4],FxOp22 - mov dword [FxTable+23h*4],FxOp23 - mov dword [FxTable+24h*4],FxOp24 - mov dword [FxTable+25h*4],FxOp25 - mov dword [FxTable+26h*4],FxOp26 - mov dword [FxTable+27h*4],FxOp27 - mov dword [FxTable+28h*4],FxOp28 - mov dword [FxTable+29h*4],FxOp29 - mov dword [FxTable+2Ah*4],FxOp2A - mov dword [FxTable+2Bh*4],FxOp2B - mov dword [FxTable+2Ch*4],FxOp2C - mov dword [FxTable+2Dh*4],FxOp2D - mov dword [FxTable+2Eh*4],FxOp2E - mov dword [FxTable+2Fh*4],FxOp2F - - mov dword [FxTable+30h*4],FxOp30 - mov dword [FxTable+31h*4],FxOp31 - mov dword [FxTable+32h*4],FxOp32 - mov dword [FxTable+33h*4],FxOp33 - mov dword [FxTable+34h*4],FxOp34 - mov dword [FxTable+35h*4],FxOp35 - mov dword [FxTable+36h*4],FxOp36 - mov dword [FxTable+37h*4],FxOp37 - mov dword [FxTable+38h*4],FxOp38 - mov dword [FxTable+39h*4],FxOp39 - mov dword [FxTable+3Ah*4],FxOp3A - mov dword [FxTable+3Bh*4],FxOp3B - mov dword [FxTable+3Ch*4],FxOp3C - mov dword [FxTable+3Dh*4],FxOp3D - mov dword [FxTable+3Eh*4],FxOp3E - mov dword [FxTable+3Fh*4],FxOp3F - - mov dword [FxTable+40h*4],FxOp40 - mov dword [FxTable+41h*4],FxOp41 - mov dword [FxTable+42h*4],FxOp42 - mov dword [FxTable+43h*4],FxOp43 - mov dword [FxTable+44h*4],FxOp44 - mov dword [FxTable+45h*4],FxOp45 - mov dword [FxTable+46h*4],FxOp46 - mov dword [FxTable+47h*4],FxOp47 - mov dword [FxTable+48h*4],FxOp48 - mov dword [FxTable+49h*4],FxOp49 - mov dword [FxTable+4Ah*4],FxOp4A - mov dword [FxTable+4Bh*4],FxOp4B - mov dword [FxTable+4Ch*4],FxOp4C - mov dword [FxTable+4Dh*4],FxOp4D - mov dword [FxTable+4Eh*4],FxOp4E - mov dword [FxTable+4Fh*4],FxOp4F - - mov dword [FxTable+50h*4],FxOp50 - mov dword [FxTable+51h*4],FxOp51 - mov dword [FxTable+52h*4],FxOp52 - mov dword [FxTable+53h*4],FxOp53 - mov dword [FxTable+54h*4],FxOp54 - mov dword [FxTable+55h*4],FxOp55 - mov dword [FxTable+56h*4],FxOp56 - mov dword [FxTable+57h*4],FxOp57 - mov dword [FxTable+58h*4],FxOp58 - mov dword [FxTable+59h*4],FxOp59 - mov dword [FxTable+5Ah*4],FxOp5A - mov dword [FxTable+5Bh*4],FxOp5B - mov dword [FxTable+5Ch*4],FxOp5C - mov dword [FxTable+5Dh*4],FxOp5D - mov dword [FxTable+5Eh*4],FxOp5E - mov dword [FxTable+5Fh*4],FxOp5F - - mov dword [FxTable+60h*4],FxOp60 - mov dword [FxTable+61h*4],FxOp61 - mov dword [FxTable+62h*4],FxOp62 - mov dword [FxTable+63h*4],FxOp63 - mov dword [FxTable+64h*4],FxOp64 - mov dword [FxTable+65h*4],FxOp65 - mov dword [FxTable+66h*4],FxOp66 - mov dword [FxTable+67h*4],FxOp67 - mov dword [FxTable+68h*4],FxOp68 - mov dword [FxTable+69h*4],FxOp69 - mov dword [FxTable+6Ah*4],FxOp6A - mov dword [FxTable+6Bh*4],FxOp6B - mov dword [FxTable+6Ch*4],FxOp6C - mov dword [FxTable+6Dh*4],FxOp6D - mov dword [FxTable+6Eh*4],FxOp6E - mov dword [FxTable+6Fh*4],FxOp6F - - mov dword [FxTable+70h*4],FxOp70 - mov dword [FxTable+71h*4],FxOp71 - mov dword [FxTable+72h*4],FxOp72 - mov dword [FxTable+73h*4],FxOp73 - mov dword [FxTable+74h*4],FxOp74 - mov dword [FxTable+75h*4],FxOp75 - mov dword [FxTable+76h*4],FxOp76 - mov dword [FxTable+77h*4],FxOp77 - mov dword [FxTable+78h*4],FxOp78 - mov dword [FxTable+79h*4],FxOp79 - mov dword [FxTable+7Ah*4],FxOp7A - mov dword [FxTable+7Bh*4],FxOp7B - mov dword [FxTable+7Ch*4],FxOp7C - mov dword [FxTable+7Dh*4],FxOp7D - mov dword [FxTable+7Eh*4],FxOp7E - mov dword [FxTable+7Fh*4],FxOp7F - - mov dword [FxTable+80h*4],FxOp80 - mov dword [FxTable+81h*4],FxOp81 - mov dword [FxTable+82h*4],FxOp82 - mov dword [FxTable+83h*4],FxOp83 - mov dword [FxTable+84h*4],FxOp84 - mov dword [FxTable+85h*4],FxOp85 - mov dword [FxTable+86h*4],FxOp86 - mov dword [FxTable+87h*4],FxOp87 - mov dword [FxTable+88h*4],FxOp88 - mov dword [FxTable+89h*4],FxOp89 - mov dword [FxTable+8Ah*4],FxOp8A - mov dword [FxTable+8Bh*4],FxOp8B - mov dword [FxTable+8Ch*4],FxOp8C - mov dword [FxTable+8Dh*4],FxOp8D - mov dword [FxTable+8Eh*4],FxOp8E - mov dword [FxTable+8Fh*4],FxOp8F - - mov dword [FxTable+90h*4],FxOp90 - mov dword [FxTable+91h*4],FxOp91 - mov dword [FxTable+92h*4],FxOp92 - mov dword [FxTable+93h*4],FxOp93 - mov dword [FxTable+94h*4],FxOp94 - mov dword [FxTable+95h*4],FxOp95 - mov dword [FxTable+96h*4],FxOp96 - mov dword [FxTable+97h*4],FxOp97 - mov dword [FxTable+98h*4],FxOp98 - mov dword [FxTable+99h*4],FxOp99 - mov dword [FxTable+9Ah*4],FxOp9A - mov dword [FxTable+9Bh*4],FxOp9B - mov dword [FxTable+9Ch*4],FxOp9C - mov dword [FxTable+9Dh*4],FxOp9D - mov dword [FxTable+9Eh*4],FxOp9E - mov dword [FxTable+9Fh*4],FxOp9F - - mov dword [FxTable+0A0h*4],FxOpA0 - mov dword [FxTable+0A1h*4],FxOpA1 - mov dword [FxTable+0A2h*4],FxOpA2 - mov dword [FxTable+0A3h*4],FxOpA3 - mov dword [FxTable+0A4h*4],FxOpA4 - mov dword [FxTable+0A5h*4],FxOpA5 - mov dword [FxTable+0A6h*4],FxOpA6 - mov dword [FxTable+0A7h*4],FxOpA7 - mov dword [FxTable+0A8h*4],FxOpA8 - mov dword [FxTable+0A9h*4],FxOpA9 - mov dword [FxTable+0AAh*4],FxOpAA - mov dword [FxTable+0ABh*4],FxOpAB - mov dword [FxTable+0ACh*4],FxOpAC - mov dword [FxTable+0ADh*4],FxOpAD - mov dword [FxTable+0AEh*4],FxOpAE - mov dword [FxTable+0AFh*4],FxOpAF - - mov dword [FxTable+0B0h*4],FxOpB0 - mov dword [FxTable+0B1h*4],FxOpB1 - mov dword [FxTable+0B2h*4],FxOpB2 - mov dword [FxTable+0B3h*4],FxOpB3 - mov dword [FxTable+0B4h*4],FxOpB4 - mov dword [FxTable+0B5h*4],FxOpB5 - mov dword [FxTable+0B6h*4],FxOpB6 - mov dword [FxTable+0B7h*4],FxOpB7 - mov dword [FxTable+0B8h*4],FxOpB8 - mov dword [FxTable+0B9h*4],FxOpB9 - mov dword [FxTable+0BAh*4],FxOpBA - mov dword [FxTable+0BBh*4],FxOpBB - mov dword [FxTable+0BCh*4],FxOpBC - mov dword [FxTable+0BDh*4],FxOpBD - mov dword [FxTable+0BEh*4],FxOpBE - mov dword [FxTable+0BFh*4],FxOpBF - - mov dword [FxTable+0C0h*4],FxOpC0 - mov dword [FxTable+0C1h*4],FxOpC1 - mov dword [FxTable+0C2h*4],FxOpC2 - mov dword [FxTable+0C3h*4],FxOpC3 - mov dword [FxTable+0C4h*4],FxOpC4 - mov dword [FxTable+0C5h*4],FxOpC5 - mov dword [FxTable+0C6h*4],FxOpC6 - mov dword [FxTable+0C7h*4],FxOpC7 - mov dword [FxTable+0C8h*4],FxOpC8 - mov dword [FxTable+0C9h*4],FxOpC9 - mov dword [FxTable+0CAh*4],FxOpCA - mov dword [FxTable+0CBh*4],FxOpCB - mov dword [FxTable+0CCh*4],FxOpCC - mov dword [FxTable+0CDh*4],FxOpCD - mov dword [FxTable+0CEh*4],FxOpCE - mov dword [FxTable+0CFh*4],FxOpCF - - mov dword [FxTable+0D0h*4],FxOpD0 - mov dword [FxTable+0D1h*4],FxOpD1 - mov dword [FxTable+0D2h*4],FxOpD2 - mov dword [FxTable+0D3h*4],FxOpD3 - mov dword [FxTable+0D4h*4],FxOpD4 - mov dword [FxTable+0D5h*4],FxOpD5 - mov dword [FxTable+0D6h*4],FxOpD6 - mov dword [FxTable+0D7h*4],FxOpD7 - mov dword [FxTable+0D8h*4],FxOpD8 - mov dword [FxTable+0D9h*4],FxOpD9 - mov dword [FxTable+0DAh*4],FxOpDA - mov dword [FxTable+0DBh*4],FxOpDB - mov dword [FxTable+0DCh*4],FxOpDC - mov dword [FxTable+0DDh*4],FxOpDD - mov dword [FxTable+0DEh*4],FxOpDE - mov dword [FxTable+0DFh*4],FxOpDF - - mov dword [FxTable+0E0h*4],FxOpE0 - mov dword [FxTable+0E1h*4],FxOpE1 - mov dword [FxTable+0E2h*4],FxOpE2 - mov dword [FxTable+0E3h*4],FxOpE3 - mov dword [FxTable+0E4h*4],FxOpE4 - mov dword [FxTable+0E5h*4],FxOpE5 - mov dword [FxTable+0E6h*4],FxOpE6 - mov dword [FxTable+0E7h*4],FxOpE7 - mov dword [FxTable+0E8h*4],FxOpE8 - mov dword [FxTable+0E9h*4],FxOpE9 - mov dword [FxTable+0EAh*4],FxOpEA - mov dword [FxTable+0EBh*4],FxOpEB - mov dword [FxTable+0ECh*4],FxOpEC - mov dword [FxTable+0EDh*4],FxOpED - mov dword [FxTable+0EEh*4],FxOpEE - mov dword [FxTable+0EFh*4],FxOpEF - - mov dword [FxTable+0F0h*4],FxOpF0 - mov dword [FxTable+0F1h*4],FxOpF1 - mov dword [FxTable+0F2h*4],FxOpF2 - mov dword [FxTable+0F3h*4],FxOpF3 - mov dword [FxTable+0F4h*4],FxOpF4 - mov dword [FxTable+0F5h*4],FxOpF5 - mov dword [FxTable+0F6h*4],FxOpF6 - mov dword [FxTable+0F7h*4],FxOpF7 - mov dword [FxTable+0F8h*4],FxOpF8 - mov dword [FxTable+0F9h*4],FxOpF9 - mov dword [FxTable+0FAh*4],FxOpFA - mov dword [FxTable+0FBh*4],FxOpFB - mov dword [FxTable+0FCh*4],FxOpFC - mov dword [FxTable+0FDh*4],FxOpFD - mov dword [FxTable+0FEh*4],FxOpFE - mov dword [FxTable+0FFh*4],FxOpFF - - - mov dword [FxTableA1+00h*4],FxOp00 - mov dword [FxTableA1+01h*4],FxOp01 - mov dword [FxTableA1+02h*4],FxOp02 - mov dword [FxTableA1+03h*4],FxOp03 - mov dword [FxTableA1+04h*4],FxOp04 - mov dword [FxTableA1+05h*4],FxOp05 - mov dword [FxTableA1+06h*4],FxOp06 - mov dword [FxTableA1+07h*4],FxOp07 - mov dword [FxTableA1+08h*4],FxOp08 - mov dword [FxTableA1+09h*4],FxOp09 - mov dword [FxTableA1+0Ah*4],FxOp0A - mov dword [FxTableA1+0Bh*4],FxOp0B - mov dword [FxTableA1+0Ch*4],FxOp0C - mov dword [FxTableA1+0Dh*4],FxOp0D - mov dword [FxTableA1+0Eh*4],FxOp0E - mov dword [FxTableA1+0Fh*4],FxOp0F - - mov dword [FxTableA1+10h*4],FxOp10 - mov dword [FxTableA1+11h*4],FxOp11 - mov dword [FxTableA1+12h*4],FxOp12 - mov dword [FxTableA1+13h*4],FxOp13 - mov dword [FxTableA1+14h*4],FxOp14 - mov dword [FxTableA1+15h*4],FxOp15 - mov dword [FxTableA1+16h*4],FxOp16 - mov dword [FxTableA1+17h*4],FxOp17 - mov dword [FxTableA1+18h*4],FxOp18 - mov dword [FxTableA1+19h*4],FxOp19 - mov dword [FxTableA1+1Ah*4],FxOp1A - mov dword [FxTableA1+1Bh*4],FxOp1B - mov dword [FxTableA1+1Ch*4],FxOp1C - mov dword [FxTableA1+1Dh*4],FxOp1D - mov dword [FxTableA1+1Eh*4],FxOp1E - mov dword [FxTableA1+1Fh*4],FxOp1F - - mov dword [FxTableA1+20h*4],FxOp20 - mov dword [FxTableA1+21h*4],FxOp21 - mov dword [FxTableA1+22h*4],FxOp22 - mov dword [FxTableA1+23h*4],FxOp23 - mov dword [FxTableA1+24h*4],FxOp24 - mov dword [FxTableA1+25h*4],FxOp25 - mov dword [FxTableA1+26h*4],FxOp26 - mov dword [FxTableA1+27h*4],FxOp27 - mov dword [FxTableA1+28h*4],FxOp28 - mov dword [FxTableA1+29h*4],FxOp29 - mov dword [FxTableA1+2Ah*4],FxOp2A - mov dword [FxTableA1+2Bh*4],FxOp2B - mov dword [FxTableA1+2Ch*4],FxOp2C - mov dword [FxTableA1+2Dh*4],FxOp2D - mov dword [FxTableA1+2Eh*4],FxOp2E - mov dword [FxTableA1+2Fh*4],FxOp2F - - mov dword [FxTableA1+30h*4],FxOp30A1 - mov dword [FxTableA1+31h*4],FxOp31A1 - mov dword [FxTableA1+32h*4],FxOp32A1 - mov dword [FxTableA1+33h*4],FxOp33A1 - mov dword [FxTableA1+34h*4],FxOp34A1 - mov dword [FxTableA1+35h*4],FxOp35A1 - mov dword [FxTableA1+36h*4],FxOp36A1 - mov dword [FxTableA1+37h*4],FxOp37A1 - mov dword [FxTableA1+38h*4],FxOp38A1 - mov dword [FxTableA1+39h*4],FxOp39A1 - mov dword [FxTableA1+3Ah*4],FxOp3AA1 - mov dword [FxTableA1+3Bh*4],FxOp3BA1 - mov dword [FxTableA1+3Ch*4],FxOp3C - mov dword [FxTableA1+3Dh*4],FxOp3D - mov dword [FxTableA1+3Eh*4],FxOp3E - mov dword [FxTableA1+3Fh*4],FxOp3F - - mov dword [FxTableA1+40h*4],FxOp40A1 - mov dword [FxTableA1+41h*4],FxOp41A1 - mov dword [FxTableA1+42h*4],FxOp42A1 - mov dword [FxTableA1+43h*4],FxOp43A1 - mov dword [FxTableA1+44h*4],FxOp44A1 - mov dword [FxTableA1+45h*4],FxOp45A1 - mov dword [FxTableA1+46h*4],FxOp46A1 - mov dword [FxTableA1+47h*4],FxOp47A1 - mov dword [FxTableA1+48h*4],FxOp48A1 - mov dword [FxTableA1+49h*4],FxOp49A1 - mov dword [FxTableA1+4Ah*4],FxOp4AA1 - mov dword [FxTableA1+4Bh*4],FxOp4BA1 - mov dword [FxTableA1+4Ch*4],FxOp4CA1 - mov dword [FxTableA1+4Dh*4],FxOp4D - mov dword [FxTableA1+4Eh*4],FxOp4EA1 - mov dword [FxTableA1+4Fh*4],FxOp4F - - mov dword [FxTableA1+50h*4],FxOp50A1 - mov dword [FxTableA1+51h*4],FxOp51A1 - mov dword [FxTableA1+52h*4],FxOp52A1 - mov dword [FxTableA1+53h*4],FxOp53A1 - mov dword [FxTableA1+54h*4],FxOp54A1 - mov dword [FxTableA1+55h*4],FxOp55A1 - mov dword [FxTableA1+56h*4],FxOp56A1 - mov dword [FxTableA1+57h*4],FxOp57A1 - mov dword [FxTableA1+58h*4],FxOp58A1 - mov dword [FxTableA1+59h*4],FxOp59A1 - mov dword [FxTableA1+5Ah*4],FxOp5AA1 - mov dword [FxTableA1+5Bh*4],FxOp5BA1 - mov dword [FxTableA1+5Ch*4],FxOp5CA1 - mov dword [FxTableA1+5Dh*4],FxOp5DA1 - mov dword [FxTableA1+5Eh*4],FxOp5EA1 - mov dword [FxTableA1+5Fh*4],FxOp5FA1 - - mov dword [FxTableA1+60h*4],FxOp60A1 - mov dword [FxTableA1+61h*4],FxOp61A1 - mov dword [FxTableA1+62h*4],FxOp62A1 - mov dword [FxTableA1+63h*4],FxOp63A1 - mov dword [FxTableA1+64h*4],FxOp64A1 - mov dword [FxTableA1+65h*4],FxOp65A1 - mov dword [FxTableA1+66h*4],FxOp66A1 - mov dword [FxTableA1+67h*4],FxOp67A1 - mov dword [FxTableA1+68h*4],FxOp68A1 - mov dword [FxTableA1+69h*4],FxOp69A1 - mov dword [FxTableA1+6Ah*4],FxOp6AA1 - mov dword [FxTableA1+6Bh*4],FxOp6BA1 - mov dword [FxTableA1+6Ch*4],FxOp6CA1 - mov dword [FxTableA1+6Dh*4],FxOp6DA1 - mov dword [FxTableA1+6Eh*4],FxOp6EA1 - mov dword [FxTableA1+6Fh*4],FxOp6FA1 - - mov dword [FxTableA1+70h*4],FxOp70 - mov dword [FxTableA1+71h*4],FxOp71A1 - mov dword [FxTableA1+72h*4],FxOp72A1 - mov dword [FxTableA1+73h*4],FxOp73A1 - mov dword [FxTableA1+74h*4],FxOp74A1 - mov dword [FxTableA1+75h*4],FxOp75A1 - mov dword [FxTableA1+76h*4],FxOp76A1 - mov dword [FxTableA1+77h*4],FxOp77A1 - mov dword [FxTableA1+78h*4],FxOp78A1 - mov dword [FxTableA1+79h*4],FxOp79A1 - mov dword [FxTableA1+7Ah*4],FxOp7AA1 - mov dword [FxTableA1+7Bh*4],FxOp7BA1 - mov dword [FxTableA1+7Ch*4],FxOp7CA1 - mov dword [FxTableA1+7Dh*4],FxOp7DA1 - mov dword [FxTableA1+7Eh*4],FxOp7EA1 - mov dword [FxTableA1+7Fh*4],FxOp7FA1 - - mov dword [FxTableA1+80h*4],FxOp80A1 - mov dword [FxTableA1+81h*4],FxOp81A1 - mov dword [FxTableA1+82h*4],FxOp82A1 - mov dword [FxTableA1+83h*4],FxOp83A1 - mov dword [FxTableA1+84h*4],FxOp84A1 - mov dword [FxTableA1+85h*4],FxOp85A1 - mov dword [FxTableA1+86h*4],FxOp86A1 - mov dword [FxTableA1+87h*4],FxOp87A1 - mov dword [FxTableA1+88h*4],FxOp88A1 - mov dword [FxTableA1+89h*4],FxOp89A1 - mov dword [FxTableA1+8Ah*4],FxOp8AA1 - mov dword [FxTableA1+8Bh*4],FxOp8BA1 - mov dword [FxTableA1+8Ch*4],FxOp8CA1 - mov dword [FxTableA1+8Dh*4],FxOp8DA1 - mov dword [FxTableA1+8Eh*4],FxOp8EA1 - mov dword [FxTableA1+8Fh*4],FxOp8FA1 - - mov dword [FxTableA1+90h*4],FxOp90 - mov dword [FxTableA1+91h*4],FxOp91 - mov dword [FxTableA1+92h*4],FxOp92 - mov dword [FxTableA1+93h*4],FxOp93 - mov dword [FxTableA1+94h*4],FxOp94 - mov dword [FxTableA1+95h*4],FxOp95 - mov dword [FxTableA1+96h*4],FxOp96A1 - mov dword [FxTableA1+97h*4],FxOp97 - mov dword [FxTableA1+98h*4],FxOp98A1 - mov dword [FxTableA1+99h*4],FxOp99A1 - mov dword [FxTableA1+9Ah*4],FxOp9AA1 - mov dword [FxTableA1+9Bh*4],FxOp9BA1 - mov dword [FxTableA1+9Ch*4],FxOp9CA1 - mov dword [FxTableA1+9Dh*4],FxOp9DA1 - mov dword [FxTableA1+9Eh*4],FxOp9E - mov dword [FxTableA1+9Fh*4],FxOp9FA1 - - mov dword [FxTableA1+0A0h*4],FxOpA0A1 - mov dword [FxTableA1+0A1h*4],FxOpA1A1 - mov dword [FxTableA1+0A2h*4],FxOpA2A1 - mov dword [FxTableA1+0A3h*4],FxOpA3A1 - mov dword [FxTableA1+0A4h*4],FxOpA4A1 - mov dword [FxTableA1+0A5h*4],FxOpA5A1 - mov dword [FxTableA1+0A6h*4],FxOpA6A1 - mov dword [FxTableA1+0A7h*4],FxOpA7A1 - mov dword [FxTableA1+0A8h*4],FxOpA8A1 - mov dword [FxTableA1+0A9h*4],FxOpA9A1 - mov dword [FxTableA1+0AAh*4],FxOpAAA1 - mov dword [FxTableA1+0ABh*4],FxOpABA1 - mov dword [FxTableA1+0ACh*4],FxOpACA1 - mov dword [FxTableA1+0ADh*4],FxOpADA1 - mov dword [FxTableA1+0AEh*4],FxOpAEA1 - mov dword [FxTableA1+0AFh*4],FxOpAFA1 - - mov dword [FxTableA1+0B0h*4],FxOpB0 - mov dword [FxTableA1+0B1h*4],FxOpB1 - mov dword [FxTableA1+0B2h*4],FxOpB2 - mov dword [FxTableA1+0B3h*4],FxOpB3 - mov dword [FxTableA1+0B4h*4],FxOpB4 - mov dword [FxTableA1+0B5h*4],FxOpB5 - mov dword [FxTableA1+0B6h*4],FxOpB6 - mov dword [FxTableA1+0B7h*4],FxOpB7 - mov dword [FxTableA1+0B8h*4],FxOpB8 - mov dword [FxTableA1+0B9h*4],FxOpB9 - mov dword [FxTableA1+0BAh*4],FxOpBA - mov dword [FxTableA1+0BBh*4],FxOpBB - mov dword [FxTableA1+0BCh*4],FxOpBC - mov dword [FxTableA1+0BDh*4],FxOpBD - mov dword [FxTableA1+0BEh*4],FxOpBE - mov dword [FxTableA1+0BFh*4],FxOpBF - - mov dword [FxTableA1+0C0h*4],FxOpC0 - mov dword [FxTableA1+0C1h*4],FxOpC1A1 - mov dword [FxTableA1+0C2h*4],FxOpC2A1 - mov dword [FxTableA1+0C3h*4],FxOpC3A1 - mov dword [FxTableA1+0C4h*4],FxOpC4A1 - mov dword [FxTableA1+0C5h*4],FxOpC5A1 - mov dword [FxTableA1+0C6h*4],FxOpC6A1 - mov dword [FxTableA1+0C7h*4],FxOpC7A1 - mov dword [FxTableA1+0C8h*4],FxOpC8A1 - mov dword [FxTableA1+0C9h*4],FxOpC9A1 - mov dword [FxTableA1+0CAh*4],FxOpCAA1 - mov dword [FxTableA1+0CBh*4],FxOpCBA1 - mov dword [FxTableA1+0CCh*4],FxOpCCA1 - mov dword [FxTableA1+0CDh*4],FxOpCDA1 - mov dword [FxTableA1+0CEh*4],FxOpCEA1 - mov dword [FxTableA1+0CFh*4],FxOpCFA1 - - mov dword [FxTableA1+0D0h*4],FxOpD0 - mov dword [FxTableA1+0D1h*4],FxOpD1 - mov dword [FxTableA1+0D2h*4],FxOpD2 - mov dword [FxTableA1+0D3h*4],FxOpD3 - mov dword [FxTableA1+0D4h*4],FxOpD4 - mov dword [FxTableA1+0D5h*4],FxOpD5 - mov dword [FxTableA1+0D6h*4],FxOpD6 - mov dword [FxTableA1+0D7h*4],FxOpD7 - mov dword [FxTableA1+0D8h*4],FxOpD8 - mov dword [FxTableA1+0D9h*4],FxOpD9 - mov dword [FxTableA1+0DAh*4],FxOpDA - mov dword [FxTableA1+0DBh*4],FxOpDB - mov dword [FxTableA1+0DCh*4],FxOpDC - mov dword [FxTableA1+0DDh*4],FxOpDD - mov dword [FxTableA1+0DEh*4],FxOpDE - mov dword [FxTableA1+0DFh*4],FxOpDF - - mov dword [FxTableA1+0E0h*4],FxOpE0 - mov dword [FxTableA1+0E1h*4],FxOpE1 - mov dword [FxTableA1+0E2h*4],FxOpE2 - mov dword [FxTableA1+0E3h*4],FxOpE3 - mov dword [FxTableA1+0E4h*4],FxOpE4 - mov dword [FxTableA1+0E5h*4],FxOpE5 - mov dword [FxTableA1+0E6h*4],FxOpE6 - mov dword [FxTableA1+0E7h*4],FxOpE7 - mov dword [FxTableA1+0E8h*4],FxOpE8 - mov dword [FxTableA1+0E9h*4],FxOpE9 - mov dword [FxTableA1+0EAh*4],FxOpEA - mov dword [FxTableA1+0EBh*4],FxOpEB - mov dword [FxTableA1+0ECh*4],FxOpEC - mov dword [FxTableA1+0EDh*4],FxOpED - mov dword [FxTableA1+0EEh*4],FxOpEE - mov dword [FxTableA1+0EFh*4],FxOpEFA1 - - mov dword [FxTableA1+0F0h*4],FxOpF0A1 - mov dword [FxTableA1+0F1h*4],FxOpF1A1 - mov dword [FxTableA1+0F2h*4],FxOpF2A1 - mov dword [FxTableA1+0F3h*4],FxOpF3A1 - mov dword [FxTableA1+0F4h*4],FxOpF4A1 - mov dword [FxTableA1+0F5h*4],FxOpF5A1 - mov dword [FxTableA1+0F6h*4],FxOpF6A1 - mov dword [FxTableA1+0F7h*4],FxOpF7A1 - mov dword [FxTableA1+0F8h*4],FxOpF8A1 - mov dword [FxTableA1+0F9h*4],FxOpF9A1 - mov dword [FxTableA1+0FAh*4],FxOpFAA1 - mov dword [FxTableA1+0FBh*4],FxOpFBA1 - mov dword [FxTableA1+0FCh*4],FxOpFCA1 - mov dword [FxTableA1+0FDh*4],FxOpFDA1 - mov dword [FxTableA1+0FEh*4],FxOpFEA1 - mov dword [FxTableA1+0FFh*4],FxOpFFA1 - - - mov dword [FxTableA2+00h*4],FxOp00 - mov dword [FxTableA2+01h*4],FxOp01 - mov dword [FxTableA2+02h*4],FxOp02 - mov dword [FxTableA2+03h*4],FxOp03 - mov dword [FxTableA2+04h*4],FxOp04 - mov dword [FxTableA2+05h*4],FxOp05 - mov dword [FxTableA2+06h*4],FxOp06 - mov dword [FxTableA2+07h*4],FxOp07 - mov dword [FxTableA2+08h*4],FxOp08 - mov dword [FxTableA2+09h*4],FxOp09 - mov dword [FxTableA2+0Ah*4],FxOp0A - mov dword [FxTableA2+0Bh*4],FxOp0B - mov dword [FxTableA2+0Ch*4],FxOp0C - mov dword [FxTableA2+0Dh*4],FxOp0D - mov dword [FxTableA2+0Eh*4],FxOp0E - mov dword [FxTableA2+0Fh*4],FxOp0F - - mov dword [FxTableA2+10h*4],FxOp10 - mov dword [FxTableA2+11h*4],FxOp11 - mov dword [FxTableA2+12h*4],FxOp12 - mov dword [FxTableA2+13h*4],FxOp13 - mov dword [FxTableA2+14h*4],FxOp14 - mov dword [FxTableA2+15h*4],FxOp15 - mov dword [FxTableA2+16h*4],FxOp16 - mov dword [FxTableA2+17h*4],FxOp17 - mov dword [FxTableA2+18h*4],FxOp18 - mov dword [FxTableA2+19h*4],FxOp19 - mov dword [FxTableA2+1Ah*4],FxOp1A - mov dword [FxTableA2+1Bh*4],FxOp1B - mov dword [FxTableA2+1Ch*4],FxOp1C - mov dword [FxTableA2+1Dh*4],FxOp1D - mov dword [FxTableA2+1Eh*4],FxOp1E - mov dword [FxTableA2+1Fh*4],FxOp1F - - mov dword [FxTableA2+20h*4],FxOp20 - mov dword [FxTableA2+21h*4],FxOp21 - mov dword [FxTableA2+22h*4],FxOp22 - mov dword [FxTableA2+23h*4],FxOp23 - mov dword [FxTableA2+24h*4],FxOp24 - mov dword [FxTableA2+25h*4],FxOp25 - mov dword [FxTableA2+26h*4],FxOp26 - mov dword [FxTableA2+27h*4],FxOp27 - mov dword [FxTableA2+28h*4],FxOp28 - mov dword [FxTableA2+29h*4],FxOp29 - mov dword [FxTableA2+2Ah*4],FxOp2A - mov dword [FxTableA2+2Bh*4],FxOp2B - mov dword [FxTableA2+2Ch*4],FxOp2C - mov dword [FxTableA2+2Dh*4],FxOp2D - mov dword [FxTableA2+2Eh*4],FxOp2E - mov dword [FxTableA2+2Fh*4],FxOp2F - - mov dword [FxTableA2+30h*4],FxOp30 - mov dword [FxTableA2+31h*4],FxOp31 - mov dword [FxTableA2+32h*4],FxOp32 - mov dword [FxTableA2+33h*4],FxOp33 - mov dword [FxTableA2+34h*4],FxOp34 - mov dword [FxTableA2+35h*4],FxOp35 - mov dword [FxTableA2+36h*4],FxOp36 - mov dword [FxTableA2+37h*4],FxOp37 - mov dword [FxTableA2+38h*4],FxOp38 - mov dword [FxTableA2+39h*4],FxOp39 - mov dword [FxTableA2+3Ah*4],FxOp3A - mov dword [FxTableA2+3Bh*4],FxOp3B - mov dword [FxTableA2+3Ch*4],FxOp3C - mov dword [FxTableA2+3Dh*4],FxOp3D - mov dword [FxTableA2+3Eh*4],FxOp3E - mov dword [FxTableA2+3Fh*4],FxOp3F - - mov dword [FxTableA2+40h*4],FxOp40 - mov dword [FxTableA2+41h*4],FxOp41 - mov dword [FxTableA2+42h*4],FxOp42 - mov dword [FxTableA2+43h*4],FxOp43 - mov dword [FxTableA2+44h*4],FxOp44 - mov dword [FxTableA2+45h*4],FxOp45 - mov dword [FxTableA2+46h*4],FxOp46 - mov dword [FxTableA2+47h*4],FxOp47 - mov dword [FxTableA2+48h*4],FxOp48 - mov dword [FxTableA2+49h*4],FxOp49 - mov dword [FxTableA2+4Ah*4],FxOp4A - mov dword [FxTableA2+4Bh*4],FxOp4B - mov dword [FxTableA2+4Ch*4],FxOp4C - mov dword [FxTableA2+4Dh*4],FxOp4D - mov dword [FxTableA2+4Eh*4],FxOp4E - mov dword [FxTableA2+4Fh*4],FxOp4F - - mov dword [FxTableA2+50h*4],FxOp50A2 - mov dword [FxTableA2+51h*4],FxOp51A2 - mov dword [FxTableA2+52h*4],FxOp52A2 - mov dword [FxTableA2+53h*4],FxOp53A2 - mov dword [FxTableA2+54h*4],FxOp54A2 - mov dword [FxTableA2+55h*4],FxOp55A2 - mov dword [FxTableA2+56h*4],FxOp56A2 - mov dword [FxTableA2+57h*4],FxOp57A2 - mov dword [FxTableA2+58h*4],FxOp58A2 - mov dword [FxTableA2+59h*4],FxOp59A2 - mov dword [FxTableA2+5Ah*4],FxOp5AA2 - mov dword [FxTableA2+5Bh*4],FxOp5BA2 - mov dword [FxTableA2+5Ch*4],FxOp5CA2 - mov dword [FxTableA2+5Dh*4],FxOp5DA2 - mov dword [FxTableA2+5Eh*4],FxOp5EA2 - mov dword [FxTableA2+5Fh*4],FxOp5FA2 - - mov dword [FxTableA2+60h*4],FxOp60A2 - mov dword [FxTableA2+61h*4],FxOp61A2 - mov dword [FxTableA2+62h*4],FxOp62A2 - mov dword [FxTableA2+63h*4],FxOp63A2 - mov dword [FxTableA2+64h*4],FxOp64A2 - mov dword [FxTableA2+65h*4],FxOp65A2 - mov dword [FxTableA2+66h*4],FxOp66A2 - mov dword [FxTableA2+67h*4],FxOp67A2 - mov dword [FxTableA2+68h*4],FxOp68A2 - mov dword [FxTableA2+69h*4],FxOp69A2 - mov dword [FxTableA2+6Ah*4],FxOp6AA2 - mov dword [FxTableA2+6Bh*4],FxOp6BA2 - mov dword [FxTableA2+6Ch*4],FxOp6CA2 - mov dword [FxTableA2+6Dh*4],FxOp6DA2 - mov dword [FxTableA2+6Eh*4],FxOp6EA2 - mov dword [FxTableA2+6Fh*4],FxOp6FA2 - - mov dword [FxTableA2+70h*4],FxOp70 - mov dword [FxTableA2+71h*4],FxOp71A2 - mov dword [FxTableA2+72h*4],FxOp72A2 - mov dword [FxTableA2+73h*4],FxOp73A2 - mov dword [FxTableA2+74h*4],FxOp74A2 - mov dword [FxTableA2+75h*4],FxOp75A2 - mov dword [FxTableA2+76h*4],FxOp76A2 - mov dword [FxTableA2+77h*4],FxOp77A2 - mov dword [FxTableA2+78h*4],FxOp78A2 - mov dword [FxTableA2+79h*4],FxOp79A2 - mov dword [FxTableA2+7Ah*4],FxOp7AA2 - mov dword [FxTableA2+7Bh*4],FxOp7BA2 - mov dword [FxTableA2+7Ch*4],FxOp7CA2 - mov dword [FxTableA2+7Dh*4],FxOp7DA2 - mov dword [FxTableA2+7Eh*4],FxOp7EA2 - mov dword [FxTableA2+7Fh*4],FxOp7FA2 - - mov dword [FxTableA2+80h*4],FxOp80A2 - mov dword [FxTableA2+81h*4],FxOp81A2 - mov dword [FxTableA2+82h*4],FxOp82A2 - mov dword [FxTableA2+83h*4],FxOp83A2 - mov dword [FxTableA2+84h*4],FxOp84A2 - mov dword [FxTableA2+85h*4],FxOp85A2 - mov dword [FxTableA2+86h*4],FxOp86A2 - mov dword [FxTableA2+87h*4],FxOp87A2 - mov dword [FxTableA2+88h*4],FxOp88A2 - mov dword [FxTableA2+89h*4],FxOp89A2 - mov dword [FxTableA2+8Ah*4],FxOp8AA2 - mov dword [FxTableA2+8Bh*4],FxOp8BA2 - mov dword [FxTableA2+8Ch*4],FxOp8CA2 - mov dword [FxTableA2+8Dh*4],FxOp8DA2 - mov dword [FxTableA2+8Eh*4],FxOp8EA2 - mov dword [FxTableA2+8Fh*4],FxOp8FA2 - - mov dword [FxTableA2+90h*4],FxOp90 - mov dword [FxTableA2+91h*4],FxOp91 - mov dword [FxTableA2+92h*4],FxOp92 - mov dword [FxTableA2+93h*4],FxOp93 - mov dword [FxTableA2+94h*4],FxOp94 - mov dword [FxTableA2+95h*4],FxOp95 - mov dword [FxTableA2+96h*4],FxOp96 - mov dword [FxTableA2+97h*4],FxOp97 - mov dword [FxTableA2+98h*4],FxOp98 - mov dword [FxTableA2+99h*4],FxOp99 - mov dword [FxTableA2+9Ah*4],FxOp9A - mov dword [FxTableA2+9Bh*4],FxOp9B - mov dword [FxTableA2+9Ch*4],FxOp9C - mov dword [FxTableA2+9Dh*4],FxOp9D - mov dword [FxTableA2+9Eh*4],FxOp9E - mov dword [FxTableA2+9Fh*4],FxOp9F - - mov dword [FxTableA2+0A0h*4],FxOpA0A2 - mov dword [FxTableA2+0A1h*4],FxOpA1A2 - mov dword [FxTableA2+0A2h*4],FxOpA2A2 - mov dword [FxTableA2+0A3h*4],FxOpA3A2 - mov dword [FxTableA2+0A4h*4],FxOpA4A2 - mov dword [FxTableA2+0A5h*4],FxOpA5A2 - mov dword [FxTableA2+0A6h*4],FxOpA6A2 - mov dword [FxTableA2+0A7h*4],FxOpA7A2 - mov dword [FxTableA2+0A8h*4],FxOpA8A2 - mov dword [FxTableA2+0A9h*4],FxOpA9A2 - mov dword [FxTableA2+0AAh*4],FxOpAAA2 - mov dword [FxTableA2+0ABh*4],FxOpABA2 - mov dword [FxTableA2+0ACh*4],FxOpACA2 - mov dword [FxTableA2+0ADh*4],FxOpADA2 - mov dword [FxTableA2+0AEh*4],FxOpAEA2 - mov dword [FxTableA2+0AFh*4],FxOpAFA2 - - mov dword [FxTableA2+0B0h*4],FxOpB0 - mov dword [FxTableA2+0B1h*4],FxOpB1 - mov dword [FxTableA2+0B2h*4],FxOpB2 - mov dword [FxTableA2+0B3h*4],FxOpB3 - mov dword [FxTableA2+0B4h*4],FxOpB4 - mov dword [FxTableA2+0B5h*4],FxOpB5 - mov dword [FxTableA2+0B6h*4],FxOpB6 - mov dword [FxTableA2+0B7h*4],FxOpB7 - mov dword [FxTableA2+0B8h*4],FxOpB8 - mov dword [FxTableA2+0B9h*4],FxOpB9 - mov dword [FxTableA2+0BAh*4],FxOpBA - mov dword [FxTableA2+0BBh*4],FxOpBB - mov dword [FxTableA2+0BCh*4],FxOpBC - mov dword [FxTableA2+0BDh*4],FxOpBD - mov dword [FxTableA2+0BEh*4],FxOpBE - mov dword [FxTableA2+0BFh*4],FxOpBF - - mov dword [FxTableA2+0C0h*4],FxOpC0 - mov dword [FxTableA2+0C1h*4],FxOpC1A2 - mov dword [FxTableA2+0C2h*4],FxOpC2A2 - mov dword [FxTableA2+0C3h*4],FxOpC3A2 - mov dword [FxTableA2+0C4h*4],FxOpC4A2 - mov dword [FxTableA2+0C5h*4],FxOpC5A2 - mov dword [FxTableA2+0C6h*4],FxOpC6A2 - mov dword [FxTableA2+0C7h*4],FxOpC7A2 - mov dword [FxTableA2+0C8h*4],FxOpC8A2 - mov dword [FxTableA2+0C9h*4],FxOpC9A2 - mov dword [FxTableA2+0CAh*4],FxOpCAA2 - mov dword [FxTableA2+0CBh*4],FxOpCBA2 - mov dword [FxTableA2+0CCh*4],FxOpCCA2 - mov dword [FxTableA2+0CDh*4],FxOpCDA2 - mov dword [FxTableA2+0CEh*4],FxOpCEA2 - mov dword [FxTableA2+0CFh*4],FxOpCFA2 - - mov dword [FxTableA2+0D0h*4],FxOpD0 - mov dword [FxTableA2+0D1h*4],FxOpD1 - mov dword [FxTableA2+0D2h*4],FxOpD2 - mov dword [FxTableA2+0D3h*4],FxOpD3 - mov dword [FxTableA2+0D4h*4],FxOpD4 - mov dword [FxTableA2+0D5h*4],FxOpD5 - mov dword [FxTableA2+0D6h*4],FxOpD6 - mov dword [FxTableA2+0D7h*4],FxOpD7 - mov dword [FxTableA2+0D8h*4],FxOpD8 - mov dword [FxTableA2+0D9h*4],FxOpD9 - mov dword [FxTableA2+0DAh*4],FxOpDA - mov dword [FxTableA2+0DBh*4],FxOpDB - mov dword [FxTableA2+0DCh*4],FxOpDC - mov dword [FxTableA2+0DDh*4],FxOpDD - mov dword [FxTableA2+0DEh*4],FxOpDE - mov dword [FxTableA2+0DFh*4],FxOpDFA2 - - mov dword [FxTableA2+0E0h*4],FxOpE0 - mov dword [FxTableA2+0E1h*4],FxOpE1 - mov dword [FxTableA2+0E2h*4],FxOpE2 - mov dword [FxTableA2+0E3h*4],FxOpE3 - mov dword [FxTableA2+0E4h*4],FxOpE4 - mov dword [FxTableA2+0E5h*4],FxOpE5 - mov dword [FxTableA2+0E6h*4],FxOpE6 - mov dword [FxTableA2+0E7h*4],FxOpE7 - mov dword [FxTableA2+0E8h*4],FxOpE8 - mov dword [FxTableA2+0E9h*4],FxOpE9 - mov dword [FxTableA2+0EAh*4],FxOpEA - mov dword [FxTableA2+0EBh*4],FxOpEB - mov dword [FxTableA2+0ECh*4],FxOpEC - mov dword [FxTableA2+0EDh*4],FxOpED - mov dword [FxTableA2+0EEh*4],FxOpEE - mov dword [FxTableA2+0EFh*4],FxOpEFA2 - - mov dword [FxTableA2+0F0h*4],FxOpF0A2 - mov dword [FxTableA2+0F1h*4],FxOpF1A2 - mov dword [FxTableA2+0F2h*4],FxOpF2A2 - mov dword [FxTableA2+0F3h*4],FxOpF3A2 - mov dword [FxTableA2+0F4h*4],FxOpF4A2 - mov dword [FxTableA2+0F5h*4],FxOpF5A2 - mov dword [FxTableA2+0F6h*4],FxOpF6A2 - mov dword [FxTableA2+0F7h*4],FxOpF7A2 - mov dword [FxTableA2+0F8h*4],FxOpF8A2 - mov dword [FxTableA2+0F9h*4],FxOpF9A2 - mov dword [FxTableA2+0FAh*4],FxOpFAA2 - mov dword [FxTableA2+0FBh*4],FxOpFBA2 - mov dword [FxTableA2+0FCh*4],FxOpFCA2 - mov dword [FxTableA2+0FDh*4],FxOpFDA2 - mov dword [FxTableA2+0FEh*4],FxOpFEA2 - mov dword [FxTableA2+0FFh*4],FxOpFFA2 - - mov dword [FxTableA3+00h*4],FxOp00 - mov dword [FxTableA3+01h*4],FxOp01 - mov dword [FxTableA3+02h*4],FxOp02 - mov dword [FxTableA3+03h*4],FxOp03 - mov dword [FxTableA3+04h*4],FxOp04 - mov dword [FxTableA3+05h*4],FxOp05 - mov dword [FxTableA3+06h*4],FxOp06 - mov dword [FxTableA3+07h*4],FxOp07 - mov dword [FxTableA3+08h*4],FxOp08 - mov dword [FxTableA3+09h*4],FxOp09 - mov dword [FxTableA3+0Ah*4],FxOp0A - mov dword [FxTableA3+0Bh*4],FxOp0B - mov dword [FxTableA3+0Ch*4],FxOp0C - mov dword [FxTableA3+0Dh*4],FxOp0D - mov dword [FxTableA3+0Eh*4],FxOp0E - mov dword [FxTableA3+0Fh*4],FxOp0F - - mov dword [FxTableA3+10h*4],FxOp10 - mov dword [FxTableA3+11h*4],FxOp11 - mov dword [FxTableA3+12h*4],FxOp12 - mov dword [FxTableA3+13h*4],FxOp13 - mov dword [FxTableA3+14h*4],FxOp14 - mov dword [FxTableA3+15h*4],FxOp15 - mov dword [FxTableA3+16h*4],FxOp16 - mov dword [FxTableA3+17h*4],FxOp17 - mov dword [FxTableA3+18h*4],FxOp18 - mov dword [FxTableA3+19h*4],FxOp19 - mov dword [FxTableA3+1Ah*4],FxOp1A - mov dword [FxTableA3+1Bh*4],FxOp1B - mov dword [FxTableA3+1Ch*4],FxOp1C - mov dword [FxTableA3+1Dh*4],FxOp1D - mov dword [FxTableA3+1Eh*4],FxOp1E - mov dword [FxTableA3+1Fh*4],FxOp1F - - mov dword [FxTableA3+20h*4],FxOp20 - mov dword [FxTableA3+21h*4],FxOp21 - mov dword [FxTableA3+22h*4],FxOp22 - mov dword [FxTableA3+23h*4],FxOp23 - mov dword [FxTableA3+24h*4],FxOp24 - mov dword [FxTableA3+25h*4],FxOp25 - mov dword [FxTableA3+26h*4],FxOp26 - mov dword [FxTableA3+27h*4],FxOp27 - mov dword [FxTableA3+28h*4],FxOp28 - mov dword [FxTableA3+29h*4],FxOp29 - mov dword [FxTableA3+2Ah*4],FxOp2A - mov dword [FxTableA3+2Bh*4],FxOp2B - mov dword [FxTableA3+2Ch*4],FxOp2C - mov dword [FxTableA3+2Dh*4],FxOp2D - mov dword [FxTableA3+2Eh*4],FxOp2E - mov dword [FxTableA3+2Fh*4],FxOp2F - - mov dword [FxTableA3+30h*4],FxOp30 - mov dword [FxTableA3+31h*4],FxOp31 - mov dword [FxTableA3+32h*4],FxOp32 - mov dword [FxTableA3+33h*4],FxOp33 - mov dword [FxTableA3+34h*4],FxOp34 - mov dword [FxTableA3+35h*4],FxOp35 - mov dword [FxTableA3+36h*4],FxOp36 - mov dword [FxTableA3+37h*4],FxOp37 - mov dword [FxTableA3+38h*4],FxOp38 - mov dword [FxTableA3+39h*4],FxOp39 - mov dword [FxTableA3+3Ah*4],FxOp3A - mov dword [FxTableA3+3Bh*4],FxOp3B - mov dword [FxTableA3+3Ch*4],FxOp3C - mov dword [FxTableA3+3Dh*4],FxOp3D - mov dword [FxTableA3+3Eh*4],FxOp3E - mov dword [FxTableA3+3Fh*4],FxOp3F - - mov dword [FxTableA3+40h*4],FxOp40 - mov dword [FxTableA3+41h*4],FxOp41 - mov dword [FxTableA3+42h*4],FxOp42 - mov dword [FxTableA3+43h*4],FxOp43 - mov dword [FxTableA3+44h*4],FxOp44 - mov dword [FxTableA3+45h*4],FxOp45 - mov dword [FxTableA3+46h*4],FxOp46 - mov dword [FxTableA3+47h*4],FxOp47 - mov dword [FxTableA3+48h*4],FxOp48 - mov dword [FxTableA3+49h*4],FxOp49 - mov dword [FxTableA3+4Ah*4],FxOp4A - mov dword [FxTableA3+4Bh*4],FxOp4B - mov dword [FxTableA3+4Ch*4],FxOp4C - mov dword [FxTableA3+4Dh*4],FxOp4D - mov dword [FxTableA3+4Eh*4],FxOp4E - mov dword [FxTableA3+4Fh*4],FxOp4F - - mov dword [FxTableA3+50h*4],FxOp50A3 - mov dword [FxTableA3+51h*4],FxOp51A3 - mov dword [FxTableA3+52h*4],FxOp52A3 - mov dword [FxTableA3+53h*4],FxOp53A3 - mov dword [FxTableA3+54h*4],FxOp54A3 - mov dword [FxTableA3+55h*4],FxOp55A3 - mov dword [FxTableA3+56h*4],FxOp56A3 - mov dword [FxTableA3+57h*4],FxOp57A3 - mov dword [FxTableA3+58h*4],FxOp58A3 - mov dword [FxTableA3+59h*4],FxOp59A3 - mov dword [FxTableA3+5Ah*4],FxOp5AA3 - mov dword [FxTableA3+5Bh*4],FxOp5BA3 - mov dword [FxTableA3+5Ch*4],FxOp5CA3 - mov dword [FxTableA3+5Dh*4],FxOp5DA3 - mov dword [FxTableA3+5Eh*4],FxOp5EA3 - mov dword [FxTableA3+5Fh*4],FxOp5FA3 - - mov dword [FxTableA3+60h*4],FxOp60A3 - mov dword [FxTableA3+61h*4],FxOp61A3 - mov dword [FxTableA3+62h*4],FxOp62A3 - mov dword [FxTableA3+63h*4],FxOp63A3 - mov dword [FxTableA3+64h*4],FxOp64A3 - mov dword [FxTableA3+65h*4],FxOp65A3 - mov dword [FxTableA3+66h*4],FxOp66A3 - mov dword [FxTableA3+67h*4],FxOp67A3 - mov dword [FxTableA3+68h*4],FxOp68A3 - mov dword [FxTableA3+69h*4],FxOp69A3 - mov dword [FxTableA3+6Ah*4],FxOp6AA3 - mov dword [FxTableA3+6Bh*4],FxOp6BA3 - mov dword [FxTableA3+6Ch*4],FxOp6CA3 - mov dword [FxTableA3+6Dh*4],FxOp6DA3 - mov dword [FxTableA3+6Eh*4],FxOp6EA3 - mov dword [FxTableA3+6Fh*4],FxOp6FA3 - - mov dword [FxTableA3+70h*4],FxOp70 - mov dword [FxTableA3+71h*4],FxOp71A3 - mov dword [FxTableA3+72h*4],FxOp72A3 - mov dword [FxTableA3+73h*4],FxOp73A3 - mov dword [FxTableA3+74h*4],FxOp74A3 - mov dword [FxTableA3+75h*4],FxOp75A3 - mov dword [FxTableA3+76h*4],FxOp76A3 - mov dword [FxTableA3+77h*4],FxOp77A3 - mov dword [FxTableA3+78h*4],FxOp78A3 - mov dword [FxTableA3+79h*4],FxOp79A3 - mov dword [FxTableA3+7Ah*4],FxOp7AA3 - mov dword [FxTableA3+7Bh*4],FxOp7BA3 - mov dword [FxTableA3+7Ch*4],FxOp7CA3 - mov dword [FxTableA3+7Dh*4],FxOp7DA3 - mov dword [FxTableA3+7Eh*4],FxOp7EA3 - mov dword [FxTableA3+7Fh*4],FxOp7FA3 - - mov dword [FxTableA3+80h*4],FxOp80A3 - mov dword [FxTableA3+81h*4],FxOp81A3 - mov dword [FxTableA3+82h*4],FxOp82A3 - mov dword [FxTableA3+83h*4],FxOp83A3 - mov dword [FxTableA3+84h*4],FxOp84A3 - mov dword [FxTableA3+85h*4],FxOp85A3 - mov dword [FxTableA3+86h*4],FxOp86A3 - mov dword [FxTableA3+87h*4],FxOp87A3 - mov dword [FxTableA3+88h*4],FxOp88A3 - mov dword [FxTableA3+89h*4],FxOp89A3 - mov dword [FxTableA3+8Ah*4],FxOp8AA3 - mov dword [FxTableA3+8Bh*4],FxOp8BA3 - mov dword [FxTableA3+8Ch*4],FxOp8CA3 - mov dword [FxTableA3+8Dh*4],FxOp8DA3 - mov dword [FxTableA3+8Eh*4],FxOp8EA3 - mov dword [FxTableA3+8Fh*4],FxOp8FA3 - - mov dword [FxTableA3+90h*4],FxOp90 - mov dword [FxTableA3+91h*4],FxOp91 - mov dword [FxTableA3+92h*4],FxOp92 - mov dword [FxTableA3+93h*4],FxOp93 - mov dword [FxTableA3+94h*4],FxOp94 - mov dword [FxTableA3+95h*4],FxOp95 - mov dword [FxTableA3+96h*4],FxOp96 - mov dword [FxTableA3+97h*4],FxOp97 - mov dword [FxTableA3+98h*4],FxOp98 - mov dword [FxTableA3+99h*4],FxOp99 - mov dword [FxTableA3+9Ah*4],FxOp9A - mov dword [FxTableA3+9Bh*4],FxOp9B - mov dword [FxTableA3+9Ch*4],FxOp9C - mov dword [FxTableA3+9Dh*4],FxOp9D - mov dword [FxTableA3+9Eh*4],FxOp9E - mov dword [FxTableA3+9Fh*4],FxOp9F - - mov dword [FxTableA3+0A0h*4],FxOpA0 - mov dword [FxTableA3+0A1h*4],FxOpA1 - mov dword [FxTableA3+0A2h*4],FxOpA2 - mov dword [FxTableA3+0A3h*4],FxOpA3 - mov dword [FxTableA3+0A4h*4],FxOpA4 - mov dword [FxTableA3+0A5h*4],FxOpA5 - mov dword [FxTableA3+0A6h*4],FxOpA6 - mov dword [FxTableA3+0A7h*4],FxOpA7 - mov dword [FxTableA3+0A8h*4],FxOpA8 - mov dword [FxTableA3+0A9h*4],FxOpA9 - mov dword [FxTableA3+0AAh*4],FxOpAA - mov dword [FxTableA3+0ABh*4],FxOpAB - mov dword [FxTableA3+0ACh*4],FxOpAC - mov dword [FxTableA3+0ADh*4],FxOpAD - mov dword [FxTableA3+0AEh*4],FxOpAE - mov dword [FxTableA3+0AFh*4],FxOpAF - - mov dword [FxTableA3+0B0h*4],FxOpB0 - mov dword [FxTableA3+0B1h*4],FxOpB1 - mov dword [FxTableA3+0B2h*4],FxOpB2 - mov dword [FxTableA3+0B3h*4],FxOpB3 - mov dword [FxTableA3+0B4h*4],FxOpB4 - mov dword [FxTableA3+0B5h*4],FxOpB5 - mov dword [FxTableA3+0B6h*4],FxOpB6 - mov dword [FxTableA3+0B7h*4],FxOpB7 - mov dword [FxTableA3+0B8h*4],FxOpB8 - mov dword [FxTableA3+0B9h*4],FxOpB9 - mov dword [FxTableA3+0BAh*4],FxOpBA - mov dword [FxTableA3+0BBh*4],FxOpBB - mov dword [FxTableA3+0BCh*4],FxOpBC - mov dword [FxTableA3+0BDh*4],FxOpBD - mov dword [FxTableA3+0BEh*4],FxOpBE - mov dword [FxTableA3+0BFh*4],FxOpBF - - mov dword [FxTableA3+0C0h*4],FxOpC0 - mov dword [FxTableA3+0C1h*4],FxOpC1A3 - mov dword [FxTableA3+0C2h*4],FxOpC2A3 - mov dword [FxTableA3+0C3h*4],FxOpC3A3 - mov dword [FxTableA3+0C4h*4],FxOpC4A3 - mov dword [FxTableA3+0C5h*4],FxOpC5A3 - mov dword [FxTableA3+0C6h*4],FxOpC6A3 - mov dword [FxTableA3+0C7h*4],FxOpC7A3 - mov dword [FxTableA3+0C8h*4],FxOpC8A3 - mov dword [FxTableA3+0C9h*4],FxOpC9A3 - mov dword [FxTableA3+0CAh*4],FxOpCAA3 - mov dword [FxTableA3+0CBh*4],FxOpCBA3 - mov dword [FxTableA3+0CCh*4],FxOpCCA3 - mov dword [FxTableA3+0CDh*4],FxOpCDA3 - mov dword [FxTableA3+0CEh*4],FxOpCEA3 - mov dword [FxTableA3+0CFh*4],FxOpCFA3 - - mov dword [FxTableA3+0D0h*4],FxOpD0 - mov dword [FxTableA3+0D1h*4],FxOpD1 - mov dword [FxTableA3+0D2h*4],FxOpD2 - mov dword [FxTableA3+0D3h*4],FxOpD3 - mov dword [FxTableA3+0D4h*4],FxOpD4 - mov dword [FxTableA3+0D5h*4],FxOpD5 - mov dword [FxTableA3+0D6h*4],FxOpD6 - mov dword [FxTableA3+0D7h*4],FxOpD7 - mov dword [FxTableA3+0D8h*4],FxOpD8 - mov dword [FxTableA3+0D9h*4],FxOpD9 - mov dword [FxTableA3+0DAh*4],FxOpDA - mov dword [FxTableA3+0DBh*4],FxOpDB - mov dword [FxTableA3+0DCh*4],FxOpDC - mov dword [FxTableA3+0DDh*4],FxOpDD - mov dword [FxTableA3+0DEh*4],FxOpDE - mov dword [FxTableA3+0DFh*4],FxOpDFA3 - - mov dword [FxTableA3+0E0h*4],FxOpE0 - mov dword [FxTableA3+0E1h*4],FxOpE1 - mov dword [FxTableA3+0E2h*4],FxOpE2 - mov dword [FxTableA3+0E3h*4],FxOpE3 - mov dword [FxTableA3+0E4h*4],FxOpE4 - mov dword [FxTableA3+0E5h*4],FxOpE5 - mov dword [FxTableA3+0E6h*4],FxOpE6 - mov dword [FxTableA3+0E7h*4],FxOpE7 - mov dword [FxTableA3+0E8h*4],FxOpE8 - mov dword [FxTableA3+0E9h*4],FxOpE9 - mov dword [FxTableA3+0EAh*4],FxOpEA - mov dword [FxTableA3+0EBh*4],FxOpEB - mov dword [FxTableA3+0ECh*4],FxOpEC - mov dword [FxTableA3+0EDh*4],FxOpED - mov dword [FxTableA3+0EEh*4],FxOpEE - mov dword [FxTableA3+0EFh*4],FxOpEFA3 - - mov dword [FxTableA3+0F0h*4],FxOpF0 - mov dword [FxTableA3+0F1h*4],FxOpF1 - mov dword [FxTableA3+0F2h*4],FxOpF2 - mov dword [FxTableA3+0F3h*4],FxOpF3 - mov dword [FxTableA3+0F4h*4],FxOpF4 - mov dword [FxTableA3+0F5h*4],FxOpF5 - mov dword [FxTableA3+0F6h*4],FxOpF6 - mov dword [FxTableA3+0F7h*4],FxOpF7 - mov dword [FxTableA3+0F8h*4],FxOpF8 - mov dword [FxTableA3+0F9h*4],FxOpF9 - mov dword [FxTableA3+0FAh*4],FxOpFA - mov dword [FxTableA3+0FBh*4],FxOpFB - mov dword [FxTableA3+0FCh*4],FxOpFC - mov dword [FxTableA3+0FDh*4],FxOpFD - mov dword [FxTableA3+0FEh*4],FxOpFE - mov dword [FxTableA3+0FFh*4],FxOpFF - - ; Transfer FxTable to FxTableb and FxTablec - mov esi,FxTable - mov edi,FxTableb - mov ecx,256*4 - rep movsd - mov esi,FxTable - mov edi,FxTablec - mov ecx,256*4 - rep movsd - - mov dword [FxTableb+05h*4],FxOpb05 - mov dword [FxTableb+06h*4],FxOpb06 - mov dword [FxTableb+07h*4],FxOpb07 - mov dword [FxTableb+08h*4],FxOpb08 - mov dword [FxTableb+09h*4],FxOpb09 - mov dword [FxTableb+0Ah*4],FxOpb0A - mov dword [FxTableb+0Bh*4],FxOpb0B - mov dword [FxTableb+0Ch*4],FxOpb0C - mov dword [FxTableb+0Dh*4],FxOpb0D - mov dword [FxTableb+0Eh*4],FxOpb0E - mov dword [FxTableb+0Fh*4],FxOpb0F - mov dword [FxTableb+10h*4],FxOpb10 - mov dword [FxTableb+11h*4],FxOpb11 - mov dword [FxTableb+12h*4],FxOpb12 - mov dword [FxTableb+13h*4],FxOpb13 - mov dword [FxTableb+14h*4],FxOpb14 - mov dword [FxTableb+15h*4],FxOpb15 - mov dword [FxTableb+16h*4],FxOpb16 - mov dword [FxTableb+17h*4],FxOpb17 - mov dword [FxTableb+18h*4],FxOpb18 - mov dword [FxTableb+19h*4],FxOpb19 - mov dword [FxTableb+1Ah*4],FxOpb1A - mov dword [FxTableb+1Bh*4],FxOpb1B - mov dword [FxTableb+1Ch*4],FxOpb1C - mov dword [FxTableb+1Dh*4],FxOpb1D - mov dword [FxTableb+1Eh*4],FxOpb1E - mov dword [FxTableb+1Fh*4],FxOpb1F - mov dword [FxTableb+3Dh*4],FxOpb3D - mov dword [FxTableb+3Eh*4],FxOpb3E - mov dword [FxTableb+3Fh*4],FxOpb3F - mov dword [FxTableb+0B0h*4],FxOpbB0 - mov dword [FxTableb+0B1h*4],FxOpbB1 - mov dword [FxTableb+0B2h*4],FxOpbB2 - mov dword [FxTableb+0B3h*4],FxOpbB3 - mov dword [FxTableb+0B4h*4],FxOpbB4 - mov dword [FxTableb+0B5h*4],FxOpbB5 - mov dword [FxTableb+0B6h*4],FxOpbB6 - mov dword [FxTableb+0B7h*4],FxOpbB7 - mov dword [FxTableb+0B8h*4],FxOpbB8 - mov dword [FxTableb+0B9h*4],FxOpbB9 - mov dword [FxTableb+0BAh*4],FxOpbBA - mov dword [FxTableb+0BBh*4],FxOpbBB - mov dword [FxTableb+0BCh*4],FxOpbBC - mov dword [FxTableb+0BDh*4],FxOpbBD - mov dword [FxTableb+0BEh*4],FxOpbBE - mov dword [FxTableb+0BFh*4],FxOpbBF - - mov dword [FxTablebA1+05h*4],FxOpb05 - mov dword [FxTablebA1+06h*4],FxOpb06 - mov dword [FxTablebA1+07h*4],FxOpb07 - mov dword [FxTablebA1+08h*4],FxOpb08 - mov dword [FxTablebA1+09h*4],FxOpb09 - mov dword [FxTablebA1+0Ah*4],FxOpb0A - mov dword [FxTablebA1+0Bh*4],FxOpb0B - mov dword [FxTablebA1+0Ch*4],FxOpb0C - mov dword [FxTablebA1+0Dh*4],FxOpb0D - mov dword [FxTablebA1+0Eh*4],FxOpb0E - mov dword [FxTablebA1+0Fh*4],FxOpb0F - mov dword [FxTablebA1+10h*4],FxOpb10 - mov dword [FxTablebA1+11h*4],FxOpb11 - mov dword [FxTablebA1+12h*4],FxOpb12 - mov dword [FxTablebA1+13h*4],FxOpb13 - mov dword [FxTablebA1+14h*4],FxOpb14 - mov dword [FxTablebA1+15h*4],FxOpb15 - mov dword [FxTablebA1+16h*4],FxOpb16 - mov dword [FxTablebA1+17h*4],FxOpb17 - mov dword [FxTablebA1+18h*4],FxOpb18 - mov dword [FxTablebA1+19h*4],FxOpb19 - mov dword [FxTablebA1+1Ah*4],FxOpb1A - mov dword [FxTablebA1+1Bh*4],FxOpb1B - mov dword [FxTablebA1+1Ch*4],FxOpb1C - mov dword [FxTablebA1+1Dh*4],FxOpb1D - mov dword [FxTablebA1+1Eh*4],FxOpb1E - mov dword [FxTablebA1+1Fh*4],FxOpb1F - mov dword [FxTablebA1+3Dh*4],FxOpb3D - mov dword [FxTablebA1+3Eh*4],FxOpb3E - mov dword [FxTablebA1+3Fh*4],FxOpb3F - mov dword [FxTablebA1+0B0h*4],FxOpbB0 - mov dword [FxTablebA1+0B1h*4],FxOpbB1 - mov dword [FxTablebA1+0B2h*4],FxOpbB2 - mov dword [FxTablebA1+0B3h*4],FxOpbB3 - mov dword [FxTablebA1+0B4h*4],FxOpbB4 - mov dword [FxTablebA1+0B5h*4],FxOpbB5 - mov dword [FxTablebA1+0B6h*4],FxOpbB6 - mov dword [FxTablebA1+0B7h*4],FxOpbB7 - mov dword [FxTablebA1+0B8h*4],FxOpbB8 - mov dword [FxTablebA1+0B9h*4],FxOpbB9 - mov dword [FxTablebA1+0BAh*4],FxOpbBA - mov dword [FxTablebA1+0BBh*4],FxOpbBB - mov dword [FxTablebA1+0BCh*4],FxOpbBC - mov dword [FxTablebA1+0BDh*4],FxOpbBD - mov dword [FxTablebA1+0BEh*4],FxOpbBE - mov dword [FxTablebA1+0BFh*4],FxOpbBF - - mov dword [FxTablebA2+05h*4],FxOpb05 - mov dword [FxTablebA2+06h*4],FxOpb06 - mov dword [FxTablebA2+07h*4],FxOpb07 - mov dword [FxTablebA2+08h*4],FxOpb08 - mov dword [FxTablebA2+09h*4],FxOpb09 - mov dword [FxTablebA2+0Ah*4],FxOpb0A - mov dword [FxTablebA2+0Bh*4],FxOpb0B - mov dword [FxTablebA2+0Ch*4],FxOpb0C - mov dword [FxTablebA2+0Dh*4],FxOpb0D - mov dword [FxTablebA2+0Eh*4],FxOpb0E - mov dword [FxTablebA2+0Fh*4],FxOpb0F - mov dword [FxTablebA2+10h*4],FxOpb10 - mov dword [FxTablebA2+11h*4],FxOpb11 - mov dword [FxTablebA2+12h*4],FxOpb12 - mov dword [FxTablebA2+13h*4],FxOpb13 - mov dword [FxTablebA2+14h*4],FxOpb14 - mov dword [FxTablebA2+15h*4],FxOpb15 - mov dword [FxTablebA2+16h*4],FxOpb16 - mov dword [FxTablebA2+17h*4],FxOpb17 - mov dword [FxTablebA2+18h*4],FxOpb18 - mov dword [FxTablebA2+19h*4],FxOpb19 - mov dword [FxTablebA2+1Ah*4],FxOpb1A - mov dword [FxTablebA2+1Bh*4],FxOpb1B - mov dword [FxTablebA2+1Ch*4],FxOpb1C - mov dword [FxTablebA2+1Dh*4],FxOpb1D - mov dword [FxTablebA2+1Eh*4],FxOpb1E - mov dword [FxTablebA2+1Fh*4],FxOpb1F - mov dword [FxTablebA2+3Dh*4],FxOpb3D - mov dword [FxTablebA2+3Eh*4],FxOpb3E - mov dword [FxTablebA2+3Fh*4],FxOpb3F - mov dword [FxTablebA2+0B0h*4],FxOpbB0 - mov dword [FxTablebA2+0B1h*4],FxOpbB1 - mov dword [FxTablebA2+0B2h*4],FxOpbB2 - mov dword [FxTablebA2+0B3h*4],FxOpbB3 - mov dword [FxTablebA2+0B4h*4],FxOpbB4 - mov dword [FxTablebA2+0B5h*4],FxOpbB5 - mov dword [FxTablebA2+0B6h*4],FxOpbB6 - mov dword [FxTablebA2+0B7h*4],FxOpbB7 - mov dword [FxTablebA2+0B8h*4],FxOpbB8 - mov dword [FxTablebA2+0B9h*4],FxOpbB9 - mov dword [FxTablebA2+0BAh*4],FxOpbBA - mov dword [FxTablebA2+0BBh*4],FxOpbBB - mov dword [FxTablebA2+0BCh*4],FxOpbBC - mov dword [FxTablebA2+0BDh*4],FxOpbBD - mov dword [FxTablebA2+0BEh*4],FxOpbBE - mov dword [FxTablebA2+0BFh*4],FxOpbBF - - mov dword [FxTablebA3+05h*4],FxOpb05 - mov dword [FxTablebA3+06h*4],FxOpb06 - mov dword [FxTablebA3+07h*4],FxOpb07 - mov dword [FxTablebA3+08h*4],FxOpb08 - mov dword [FxTablebA3+09h*4],FxOpb09 - mov dword [FxTablebA3+0Ah*4],FxOpb0A - mov dword [FxTablebA3+0Bh*4],FxOpb0B - mov dword [FxTablebA3+0Ch*4],FxOpb0C - mov dword [FxTablebA3+0Dh*4],FxOpb0D - mov dword [FxTablebA3+0Eh*4],FxOpb0E - mov dword [FxTablebA3+0Fh*4],FxOpb0F - mov dword [FxTablebA3+10h*4],FxOpb10 - mov dword [FxTablebA3+11h*4],FxOpb11 - mov dword [FxTablebA3+12h*4],FxOpb12 - mov dword [FxTablebA3+13h*4],FxOpb13 - mov dword [FxTablebA3+14h*4],FxOpb14 - mov dword [FxTablebA3+15h*4],FxOpb15 - mov dword [FxTablebA3+16h*4],FxOpb16 - mov dword [FxTablebA3+17h*4],FxOpb17 - mov dword [FxTablebA3+18h*4],FxOpb18 - mov dword [FxTablebA3+19h*4],FxOpb19 - mov dword [FxTablebA3+1Ah*4],FxOpb1A - mov dword [FxTablebA3+1Bh*4],FxOpb1B - mov dword [FxTablebA3+1Ch*4],FxOpb1C - mov dword [FxTablebA3+1Dh*4],FxOpb1D - mov dword [FxTablebA3+1Eh*4],FxOpb1E - mov dword [FxTablebA3+1Fh*4],FxOpb1F - mov dword [FxTablebA3+3Dh*4],FxOpb3D - mov dword [FxTablebA3+3Eh*4],FxOpb3E - mov dword [FxTablebA3+3Fh*4],FxOpb3F - mov dword [FxTablebA3+0B0h*4],FxOpbB0 - mov dword [FxTablebA3+0B1h*4],FxOpbB1 - mov dword [FxTablebA3+0B2h*4],FxOpbB2 - mov dword [FxTablebA3+0B3h*4],FxOpbB3 - mov dword [FxTablebA3+0B4h*4],FxOpbB4 - mov dword [FxTablebA3+0B5h*4],FxOpbB5 - mov dword [FxTablebA3+0B6h*4],FxOpbB6 - mov dword [FxTablebA3+0B7h*4],FxOpbB7 - mov dword [FxTablebA3+0B8h*4],FxOpbB8 - mov dword [FxTablebA3+0B9h*4],FxOpbB9 - mov dword [FxTablebA3+0BAh*4],FxOpbBA - mov dword [FxTablebA3+0BBh*4],FxOpbBB - mov dword [FxTablebA3+0BCh*4],FxOpbBC - mov dword [FxTablebA3+0BDh*4],FxOpbBD - mov dword [FxTablebA3+0BEh*4],FxOpbBE - mov dword [FxTablebA3+0BFh*4],FxOpbBF - - mov dword [FxTablec+05h*4],FxOpc05 - mov dword [FxTablec+06h*4],FxOpc06 - mov dword [FxTablec+07h*4],FxOpc07 - mov dword [FxTablec+08h*4],FxOpc08 - mov dword [FxTablec+09h*4],FxOpc09 - mov dword [FxTablec+0Ah*4],FxOpc0A - mov dword [FxTablec+0Bh*4],FxOpc0B - mov dword [FxTablec+0Ch*4],FxOpc0C - mov dword [FxTablec+0Dh*4],FxOpc0D - mov dword [FxTablec+0Eh*4],FxOpc0E - mov dword [FxTablec+0Fh*4],FxOpc0F - mov dword [FxTablec+10h*4],FxOpc10 - mov dword [FxTablec+11h*4],FxOpc11 - mov dword [FxTablec+12h*4],FxOpc12 - mov dword [FxTablec+13h*4],FxOpc13 - mov dword [FxTablec+14h*4],FxOpc14 - mov dword [FxTablec+15h*4],FxOpc15 - mov dword [FxTablec+16h*4],FxOpc16 - mov dword [FxTablec+17h*4],FxOpc17 - mov dword [FxTablec+18h*4],FxOpc18 - mov dword [FxTablec+19h*4],FxOpc19 - mov dword [FxTablec+1Ah*4],FxOpc1A - mov dword [FxTablec+1Bh*4],FxOpc1B - mov dword [FxTablec+1Ch*4],FxOpc1C - mov dword [FxTablec+1Dh*4],FxOpc1D - mov dword [FxTablec+1Eh*4],FxOpc1E - mov dword [FxTablec+1Fh*4],FxOpc1F - mov dword [FxTablec+3Dh*4],FxOpc3D - mov dword [FxTablec+3Eh*4],FxOpc3E - mov dword [FxTablec+3Fh*4],FxOpc3F - mov dword [FxTablec+0B0h*4],FxOpcB0 - mov dword [FxTablec+0B1h*4],FxOpcB1 - mov dword [FxTablec+0B2h*4],FxOpcB2 - mov dword [FxTablec+0B3h*4],FxOpcB3 - mov dword [FxTablec+0B4h*4],FxOpcB4 - mov dword [FxTablec+0B5h*4],FxOpcB5 - mov dword [FxTablec+0B6h*4],FxOpcB6 - mov dword [FxTablec+0B7h*4],FxOpcB7 - mov dword [FxTablec+0B8h*4],FxOpcB8 - mov dword [FxTablec+0B9h*4],FxOpcB9 - mov dword [FxTablec+0BAh*4],FxOpcBA - mov dword [FxTablec+0BBh*4],FxOpcBB - mov dword [FxTablec+0BCh*4],FxOpcBC - mov dword [FxTablec+0BDh*4],FxOpcBD - mov dword [FxTablec+0BEh*4],FxOpcBE - mov dword [FxTablec+0BFh*4],FxOpcBF - - mov dword [FxTablecA1+05h*4],FxOpc05 - mov dword [FxTablecA1+06h*4],FxOpc06 - mov dword [FxTablecA1+07h*4],FxOpc07 - mov dword [FxTablecA1+08h*4],FxOpc08 - mov dword [FxTablecA1+09h*4],FxOpc09 - mov dword [FxTablecA1+0Ah*4],FxOpc0A - mov dword [FxTablecA1+0Bh*4],FxOpc0B - mov dword [FxTablecA1+0Ch*4],FxOpc0C - mov dword [FxTablecA1+0Dh*4],FxOpc0D - mov dword [FxTablecA1+0Eh*4],FxOpc0E - mov dword [FxTablecA1+0Fh*4],FxOpc0F - mov dword [FxTablecA1+10h*4],FxOpc10 - mov dword [FxTablecA1+11h*4],FxOpc11 - mov dword [FxTablecA1+12h*4],FxOpc12 - mov dword [FxTablecA1+13h*4],FxOpc13 - mov dword [FxTablecA1+14h*4],FxOpc14 - mov dword [FxTablecA1+15h*4],FxOpc15 - mov dword [FxTablecA1+16h*4],FxOpc16 - mov dword [FxTablecA1+17h*4],FxOpc17 - mov dword [FxTablecA1+18h*4],FxOpc18 - mov dword [FxTablecA1+19h*4],FxOpc19 - mov dword [FxTablecA1+1Ah*4],FxOpc1A - mov dword [FxTablecA1+1Bh*4],FxOpc1B - mov dword [FxTablecA1+1Ch*4],FxOpc1C - mov dword [FxTablecA1+1Dh*4],FxOpc1D - mov dword [FxTablecA1+1Eh*4],FxOpc1E - mov dword [FxTablecA1+1Fh*4],FxOpc1F - mov dword [FxTablecA1+3Dh*4],FxOpc3D - mov dword [FxTablecA1+3Eh*4],FxOpc3E - mov dword [FxTablecA1+3Fh*4],FxOpc3F - mov dword [FxTablecA1+0B0h*4],FxOpcB0 - mov dword [FxTablecA1+0B1h*4],FxOpcB1 - mov dword [FxTablecA1+0B2h*4],FxOpcB2 - mov dword [FxTablecA1+0B3h*4],FxOpcB3 - mov dword [FxTablecA1+0B4h*4],FxOpcB4 - mov dword [FxTablecA1+0B5h*4],FxOpcB5 - mov dword [FxTablecA1+0B6h*4],FxOpcB6 - mov dword [FxTablecA1+0B7h*4],FxOpcB7 - mov dword [FxTablecA1+0B8h*4],FxOpcB8 - mov dword [FxTablecA1+0B9h*4],FxOpcB9 - mov dword [FxTablecA1+0BAh*4],FxOpcBA - mov dword [FxTablecA1+0BBh*4],FxOpcBB - mov dword [FxTablecA1+0BCh*4],FxOpcBC - mov dword [FxTablecA1+0BDh*4],FxOpcBD - mov dword [FxTablecA1+0BEh*4],FxOpcBE - mov dword [FxTablecA1+0BFh*4],FxOpcBF - - mov dword [FxTablecA2+05h*4],FxOpc05 - mov dword [FxTablecA2+06h*4],FxOpc06 - mov dword [FxTablecA2+07h*4],FxOpc07 - mov dword [FxTablecA2+08h*4],FxOpc08 - mov dword [FxTablecA2+09h*4],FxOpc09 - mov dword [FxTablecA2+0Ah*4],FxOpc0A - mov dword [FxTablecA2+0Bh*4],FxOpc0B - mov dword [FxTablecA2+0Ch*4],FxOpc0C - mov dword [FxTablecA2+0Dh*4],FxOpc0D - mov dword [FxTablecA2+0Eh*4],FxOpc0E - mov dword [FxTablecA2+0Fh*4],FxOpc0F - mov dword [FxTablecA2+10h*4],FxOpc10 - mov dword [FxTablecA2+11h*4],FxOpc11 - mov dword [FxTablecA2+12h*4],FxOpc12 - mov dword [FxTablecA2+13h*4],FxOpc13 - mov dword [FxTablecA2+14h*4],FxOpc14 - mov dword [FxTablecA2+15h*4],FxOpc15 - mov dword [FxTablecA2+16h*4],FxOpc16 - mov dword [FxTablecA2+17h*4],FxOpc17 - mov dword [FxTablecA2+18h*4],FxOpc18 - mov dword [FxTablecA2+19h*4],FxOpc19 - mov dword [FxTablecA2+1Ah*4],FxOpc1A - mov dword [FxTablecA2+1Bh*4],FxOpc1B - mov dword [FxTablecA2+1Ch*4],FxOpc1C - mov dword [FxTablecA2+1Dh*4],FxOpc1D - mov dword [FxTablecA2+1Eh*4],FxOpc1E - mov dword [FxTablecA2+1Fh*4],FxOpc1F - mov dword [FxTablecA2+3Dh*4],FxOpc3D - mov dword [FxTablecA2+3Eh*4],FxOpc3E - mov dword [FxTablecA2+3Fh*4],FxOpc3F - mov dword [FxTablecA2+0B0h*4],FxOpcB0 - mov dword [FxTablecA2+0B1h*4],FxOpcB1 - mov dword [FxTablecA2+0B2h*4],FxOpcB2 - mov dword [FxTablecA2+0B3h*4],FxOpcB3 - mov dword [FxTablecA2+0B4h*4],FxOpcB4 - mov dword [FxTablecA2+0B5h*4],FxOpcB5 - mov dword [FxTablecA2+0B6h*4],FxOpcB6 - mov dword [FxTablecA2+0B7h*4],FxOpcB7 - mov dword [FxTablecA2+0B8h*4],FxOpcB8 - mov dword [FxTablecA2+0B9h*4],FxOpcB9 - mov dword [FxTablecA2+0BAh*4],FxOpcBA - mov dword [FxTablecA2+0BBh*4],FxOpcBB - mov dword [FxTablecA2+0BCh*4],FxOpcBC - mov dword [FxTablecA2+0BDh*4],FxOpcBD - mov dword [FxTablecA2+0BEh*4],FxOpcBE - mov dword [FxTablecA2+0BFh*4],FxOpcBF - - mov dword [FxTablecA3+05h*4],FxOpc05 - mov dword [FxTablecA3+06h*4],FxOpc06 - mov dword [FxTablecA3+07h*4],FxOpc07 - mov dword [FxTablecA3+08h*4],FxOpc08 - mov dword [FxTablecA3+09h*4],FxOpc09 - mov dword [FxTablecA3+0Ah*4],FxOpc0A - mov dword [FxTablecA3+0Bh*4],FxOpc0B - mov dword [FxTablecA3+0Ch*4],FxOpc0C - mov dword [FxTablecA3+0Dh*4],FxOpc0D - mov dword [FxTablecA3+0Eh*4],FxOpc0E - mov dword [FxTablecA3+0Fh*4],FxOpc0F - mov dword [FxTablecA3+10h*4],FxOpc10 - mov dword [FxTablecA3+11h*4],FxOpc11 - mov dword [FxTablecA3+12h*4],FxOpc12 - mov dword [FxTablecA3+13h*4],FxOpc13 - mov dword [FxTablecA3+14h*4],FxOpc14 - mov dword [FxTablecA3+15h*4],FxOpc15 - mov dword [FxTablecA3+16h*4],FxOpc16 - mov dword [FxTablecA3+17h*4],FxOpc17 - mov dword [FxTablecA3+18h*4],FxOpc18 - mov dword [FxTablecA3+19h*4],FxOpc19 - mov dword [FxTablecA3+1Ah*4],FxOpc1A - mov dword [FxTablecA3+1Bh*4],FxOpc1B - mov dword [FxTablecA3+1Ch*4],FxOpc1C - mov dword [FxTablecA3+1Dh*4],FxOpc1D - mov dword [FxTablecA3+1Eh*4],FxOpc1E - mov dword [FxTablecA3+1Fh*4],FxOpc1F - mov dword [FxTablecA3+3Dh*4],FxOpc3D - mov dword [FxTablecA3+3Eh*4],FxOpc3E - mov dword [FxTablecA3+3Fh*4],FxOpc3F - mov dword [FxTablecA3+0B0h*4],FxOpcB0 - mov dword [FxTablecA3+0B1h*4],FxOpcB1 - mov dword [FxTablecA3+0B2h*4],FxOpcB2 - mov dword [FxTablecA3+0B3h*4],FxOpcB3 - mov dword [FxTablecA3+0B4h*4],FxOpcB4 - mov dword [FxTablecA3+0B5h*4],FxOpcB5 - mov dword [FxTablecA3+0B6h*4],FxOpcB6 - mov dword [FxTablecA3+0B7h*4],FxOpcB7 - mov dword [FxTablecA3+0B8h*4],FxOpcB8 - mov dword [FxTablecA3+0B9h*4],FxOpcB9 - mov dword [FxTablecA3+0BAh*4],FxOpcBA - mov dword [FxTablecA3+0BBh*4],FxOpcBB - mov dword [FxTablecA3+0BCh*4],FxOpcBC - mov dword [FxTablecA3+0BDh*4],FxOpcBD - mov dword [FxTablecA3+0BEh*4],FxOpcBE - mov dword [FxTablecA3+0BFh*4],FxOpcBF - - mov dword [FxTabled+00h*4],FxOpd00 - mov dword [FxTabled+01h*4],FxOpd01 - mov dword [FxTabled+02h*4],FxOpd02 - mov dword [FxTabled+03h*4],FxOpd03 - mov dword [FxTabled+04h*4],FxOpd04 - mov dword [FxTabled+05h*4],FxOpd05 - mov dword [FxTabled+06h*4],FxOpd06 - mov dword [FxTabled+07h*4],FxOpd07 - mov dword [FxTabled+08h*4],FxOpd08 - mov dword [FxTabled+09h*4],FxOpd09 - mov dword [FxTabled+0Ah*4],FxOpd0A - mov dword [FxTabled+0Bh*4],FxOpd0B - mov dword [FxTabled+0Ch*4],FxOpd0C - mov dword [FxTabled+0Dh*4],FxOpd0D - mov dword [FxTabled+0Eh*4],FxOpd0E - mov dword [FxTabled+0Fh*4],FxOpd0F - - mov dword [FxTabled+10h*4],FxOpd10 - mov dword [FxTabled+11h*4],FxOpd11 - mov dword [FxTabled+12h*4],FxOpd12 - mov dword [FxTabled+13h*4],FxOpd13 - mov dword [FxTabled+14h*4],FxOpd14 - mov dword [FxTabled+15h*4],FxOpd15 - mov dword [FxTabled+16h*4],FxOpd16 - mov dword [FxTabled+17h*4],FxOpd17 - mov dword [FxTabled+18h*4],FxOpd18 - mov dword [FxTabled+19h*4],FxOpd19 - mov dword [FxTabled+1Ah*4],FxOpd1A - mov dword [FxTabled+1Bh*4],FxOpd1B - mov dword [FxTabled+1Ch*4],FxOpd1C - mov dword [FxTabled+1Dh*4],FxOpd1D - mov dword [FxTabled+1Eh*4],FxOpd1E - mov dword [FxTabled+1Fh*4],FxOpd1F - - mov dword [FxTabled+20h*4],FxOpd20 - mov dword [FxTabled+21h*4],FxOpd21 - mov dword [FxTabled+22h*4],FxOpd22 - mov dword [FxTabled+23h*4],FxOpd23 - mov dword [FxTabled+24h*4],FxOpd24 - mov dword [FxTabled+25h*4],FxOpd25 - mov dword [FxTabled+26h*4],FxOpd26 - mov dword [FxTabled+27h*4],FxOpd27 - mov dword [FxTabled+28h*4],FxOpd28 - mov dword [FxTabled+29h*4],FxOpd29 - mov dword [FxTabled+2Ah*4],FxOpd2A - mov dword [FxTabled+2Bh*4],FxOpd2B - mov dword [FxTabled+2Ch*4],FxOpd2C - mov dword [FxTabled+2Dh*4],FxOpd2D - mov dword [FxTabled+2Eh*4],FxOpd2E - mov dword [FxTabled+2Fh*4],FxOpd2F - - mov dword [FxTabled+30h*4],FxOpd30 - mov dword [FxTabled+31h*4],FxOpd31 - mov dword [FxTabled+32h*4],FxOpd32 - mov dword [FxTabled+33h*4],FxOpd33 - mov dword [FxTabled+34h*4],FxOpd34 - mov dword [FxTabled+35h*4],FxOpd35 - mov dword [FxTabled+36h*4],FxOpd36 - mov dword [FxTabled+37h*4],FxOpd37 - mov dword [FxTabled+38h*4],FxOpd38 - mov dword [FxTabled+39h*4],FxOpd39 - mov dword [FxTabled+3Ah*4],FxOpd3A - mov dword [FxTabled+3Bh*4],FxOpd3B - mov dword [FxTabled+3Ch*4],FxOpd3C - mov dword [FxTabled+3Dh*4],FxOpd3D - mov dword [FxTabled+3Eh*4],FxOpd3E - mov dword [FxTabled+3Fh*4],FxOpd3F - - mov dword [FxTabled+40h*4],FxOpd40 - mov dword [FxTabled+41h*4],FxOpd41 - mov dword [FxTabled+42h*4],FxOpd42 - mov dword [FxTabled+43h*4],FxOpd43 - mov dword [FxTabled+44h*4],FxOpd44 - mov dword [FxTabled+45h*4],FxOpd45 - mov dword [FxTabled+46h*4],FxOpd46 - mov dword [FxTabled+47h*4],FxOpd47 - mov dword [FxTabled+48h*4],FxOpd48 - mov dword [FxTabled+49h*4],FxOpd49 - mov dword [FxTabled+4Ah*4],FxOpd4A - mov dword [FxTabled+4Bh*4],FxOpd4B - mov dword [FxTabled+4Ch*4],FxOpd4C - mov dword [FxTabled+4Dh*4],FxOpd4D - mov dword [FxTabled+4Eh*4],FxOpd4E - mov dword [FxTabled+4Fh*4],FxOpd4F - - mov dword [FxTabled+50h*4],FxOpd50 - mov dword [FxTabled+51h*4],FxOpd51 - mov dword [FxTabled+52h*4],FxOpd52 - mov dword [FxTabled+53h*4],FxOpd53 - mov dword [FxTabled+54h*4],FxOpd54 - mov dword [FxTabled+55h*4],FxOpd55 - mov dword [FxTabled+56h*4],FxOpd56 - mov dword [FxTabled+57h*4],FxOpd57 - mov dword [FxTabled+58h*4],FxOpd58 - mov dword [FxTabled+59h*4],FxOpd59 - mov dword [FxTabled+5Ah*4],FxOpd5A - mov dword [FxTabled+5Bh*4],FxOpd5B - mov dword [FxTabled+5Ch*4],FxOpd5C - mov dword [FxTabled+5Dh*4],FxOpd5D - mov dword [FxTabled+5Eh*4],FxOpd5E - mov dword [FxTabled+5Fh*4],FxOpd5F - - mov dword [FxTabled+60h*4],FxOpd60 - mov dword [FxTabled+61h*4],FxOpd61 - mov dword [FxTabled+62h*4],FxOpd62 - mov dword [FxTabled+63h*4],FxOpd63 - mov dword [FxTabled+64h*4],FxOpd64 - mov dword [FxTabled+65h*4],FxOpd65 - mov dword [FxTabled+66h*4],FxOpd66 - mov dword [FxTabled+67h*4],FxOpd67 - mov dword [FxTabled+68h*4],FxOpd68 - mov dword [FxTabled+69h*4],FxOpd69 - mov dword [FxTabled+6Ah*4],FxOpd6A - mov dword [FxTabled+6Bh*4],FxOpd6B - mov dword [FxTabled+6Ch*4],FxOpd6C - mov dword [FxTabled+6Dh*4],FxOpd6D - mov dword [FxTabled+6Eh*4],FxOpd6E - mov dword [FxTabled+6Fh*4],FxOpd6F - - mov dword [FxTabled+70h*4],FxOpd70 - mov dword [FxTabled+71h*4],FxOpd71 - mov dword [FxTabled+72h*4],FxOpd72 - mov dword [FxTabled+73h*4],FxOpd73 - mov dword [FxTabled+74h*4],FxOpd74 - mov dword [FxTabled+75h*4],FxOpd75 - mov dword [FxTabled+76h*4],FxOpd76 - mov dword [FxTabled+77h*4],FxOpd77 - mov dword [FxTabled+78h*4],FxOpd78 - mov dword [FxTabled+79h*4],FxOpd79 - mov dword [FxTabled+7Ah*4],FxOpd7A - mov dword [FxTabled+7Bh*4],FxOpd7B - mov dword [FxTabled+7Ch*4],FxOpd7C - mov dword [FxTabled+7Dh*4],FxOpd7D - mov dword [FxTabled+7Eh*4],FxOpd7E - mov dword [FxTabled+7Fh*4],FxOpd7F - - mov dword [FxTabled+80h*4],FxOpd80 - mov dword [FxTabled+81h*4],FxOpd81 - mov dword [FxTabled+82h*4],FxOpd82 - mov dword [FxTabled+83h*4],FxOpd83 - mov dword [FxTabled+84h*4],FxOpd84 - mov dword [FxTabled+85h*4],FxOpd85 - mov dword [FxTabled+86h*4],FxOpd86 - mov dword [FxTabled+87h*4],FxOpd87 - mov dword [FxTabled+88h*4],FxOpd88 - mov dword [FxTabled+89h*4],FxOpd89 - mov dword [FxTabled+8Ah*4],FxOpd8A - mov dword [FxTabled+8Bh*4],FxOpd8B - mov dword [FxTabled+8Ch*4],FxOpd8C - mov dword [FxTabled+8Dh*4],FxOpd8D - mov dword [FxTabled+8Eh*4],FxOpd8E - mov dword [FxTabled+8Fh*4],FxOpd8F - - mov dword [FxTabled+90h*4],FxOpd90 - mov dword [FxTabled+91h*4],FxOpd91 - mov dword [FxTabled+92h*4],FxOpd92 - mov dword [FxTabled+93h*4],FxOpd93 - mov dword [FxTabled+94h*4],FxOpd94 - mov dword [FxTabled+95h*4],FxOpd95 - mov dword [FxTabled+96h*4],FxOpd96 - mov dword [FxTabled+97h*4],FxOpd97 - mov dword [FxTabled+98h*4],FxOpd98 - mov dword [FxTabled+99h*4],FxOpd99 - mov dword [FxTabled+9Ah*4],FxOpd9A - mov dword [FxTabled+9Bh*4],FxOpd9B - mov dword [FxTabled+9Ch*4],FxOpd9C - mov dword [FxTabled+9Dh*4],FxOpd9D - mov dword [FxTabled+9Eh*4],FxOpd9E - mov dword [FxTabled+9Fh*4],FxOpd9F - - mov dword [FxTabled+0A0h*4],FxOpdA0 - mov dword [FxTabled+0A1h*4],FxOpdA1 - mov dword [FxTabled+0A2h*4],FxOpdA2 - mov dword [FxTabled+0A3h*4],FxOpdA3 - mov dword [FxTabled+0A4h*4],FxOpdA4 - mov dword [FxTabled+0A5h*4],FxOpdA5 - mov dword [FxTabled+0A6h*4],FxOpdA6 - mov dword [FxTabled+0A7h*4],FxOpdA7 - mov dword [FxTabled+0A8h*4],FxOpdA8 - mov dword [FxTabled+0A9h*4],FxOpdA9 - mov dword [FxTabled+0AAh*4],FxOpdAA - mov dword [FxTabled+0ABh*4],FxOpdAB - mov dword [FxTabled+0ACh*4],FxOpdAC - mov dword [FxTabled+0ADh*4],FxOpdAD - mov dword [FxTabled+0AEh*4],FxOpdAE - mov dword [FxTabled+0AFh*4],FxOpdAF - - mov dword [FxTabled+0B0h*4],FxOpdB0 - mov dword [FxTabled+0B1h*4],FxOpdB1 - mov dword [FxTabled+0B2h*4],FxOpdB2 - mov dword [FxTabled+0B3h*4],FxOpdB3 - mov dword [FxTabled+0B4h*4],FxOpdB4 - mov dword [FxTabled+0B5h*4],FxOpdB5 - mov dword [FxTabled+0B6h*4],FxOpdB6 - mov dword [FxTabled+0B7h*4],FxOpdB7 - mov dword [FxTabled+0B8h*4],FxOpdB8 - mov dword [FxTabled+0B9h*4],FxOpdB9 - mov dword [FxTabled+0BAh*4],FxOpdBA - mov dword [FxTabled+0BBh*4],FxOpdBB - mov dword [FxTabled+0BCh*4],FxOpdBC - mov dword [FxTabled+0BDh*4],FxOpdBD - mov dword [FxTabled+0BEh*4],FxOpdBE - mov dword [FxTabled+0BFh*4],FxOpdBF - - mov dword [FxTabled+0C0h*4],FxOpdC0 - mov dword [FxTabled+0C1h*4],FxOpdC1 - mov dword [FxTabled+0C2h*4],FxOpdC2 - mov dword [FxTabled+0C3h*4],FxOpdC3 - mov dword [FxTabled+0C4h*4],FxOpdC4 - mov dword [FxTabled+0C5h*4],FxOpdC5 - mov dword [FxTabled+0C6h*4],FxOpdC6 - mov dword [FxTabled+0C7h*4],FxOpdC7 - mov dword [FxTabled+0C8h*4],FxOpdC8 - mov dword [FxTabled+0C9h*4],FxOpdC9 - mov dword [FxTabled+0CAh*4],FxOpdCA - mov dword [FxTabled+0CBh*4],FxOpdCB - mov dword [FxTabled+0CCh*4],FxOpdCC - mov dword [FxTabled+0CDh*4],FxOpdCD - mov dword [FxTabled+0CEh*4],FxOpdCE - mov dword [FxTabled+0CFh*4],FxOpdCF - - mov dword [FxTabled+0D0h*4],FxOpdD0 - mov dword [FxTabled+0D1h*4],FxOpdD1 - mov dword [FxTabled+0D2h*4],FxOpdD2 - mov dword [FxTabled+0D3h*4],FxOpdD3 - mov dword [FxTabled+0D4h*4],FxOpdD4 - mov dword [FxTabled+0D5h*4],FxOpdD5 - mov dword [FxTabled+0D6h*4],FxOpdD6 - mov dword [FxTabled+0D7h*4],FxOpdD7 - mov dword [FxTabled+0D8h*4],FxOpdD8 - mov dword [FxTabled+0D9h*4],FxOpdD9 - mov dword [FxTabled+0DAh*4],FxOpdDA - mov dword [FxTabled+0DBh*4],FxOpdDB - mov dword [FxTabled+0DCh*4],FxOpdDC - mov dword [FxTabled+0DDh*4],FxOpdDD - mov dword [FxTabled+0DEh*4],FxOpdDE - mov dword [FxTabled+0DFh*4],FxOpdDF - - mov dword [FxTabled+0E0h*4],FxOpdE0 - mov dword [FxTabled+0E1h*4],FxOpdE1 - mov dword [FxTabled+0E2h*4],FxOpdE2 - mov dword [FxTabled+0E3h*4],FxOpdE3 - mov dword [FxTabled+0E4h*4],FxOpdE4 - mov dword [FxTabled+0E5h*4],FxOpdE5 - mov dword [FxTabled+0E6h*4],FxOpdE6 - mov dword [FxTabled+0E7h*4],FxOpdE7 - mov dword [FxTabled+0E8h*4],FxOpdE8 - mov dword [FxTabled+0E9h*4],FxOpdE9 - mov dword [FxTabled+0EAh*4],FxOpdEA - mov dword [FxTabled+0EBh*4],FxOpdEB - mov dword [FxTabled+0ECh*4],FxOpdEC - mov dword [FxTabled+0EDh*4],FxOpdED - mov dword [FxTabled+0EEh*4],FxOpdEE - mov dword [FxTabled+0EFh*4],FxOpdEF - - mov dword [FxTabled+0F0h*4],FxOpdF0 - mov dword [FxTabled+0F1h*4],FxOpdF1 - mov dword [FxTabled+0F2h*4],FxOpdF2 - mov dword [FxTabled+0F3h*4],FxOpdF3 - mov dword [FxTabled+0F4h*4],FxOpdF4 - mov dword [FxTabled+0F5h*4],FxOpdF5 - mov dword [FxTabled+0F6h*4],FxOpdF6 - mov dword [FxTabled+0F7h*4],FxOpdF7 - mov dword [FxTabled+0F8h*4],FxOpdF8 - mov dword [FxTabled+0F9h*4],FxOpdF9 - mov dword [FxTabled+0FAh*4],FxOpdFA - mov dword [FxTabled+0FBh*4],FxOpdFB - mov dword [FxTabled+0FCh*4],FxOpdFC - mov dword [FxTabled+0FDh*4],FxOpdFD - mov dword [FxTabled+0FEh*4],FxOpdFE - mov dword [FxTabled+0FFh*4],FxOpdFF - - - mov dword [FxTabledA1+00h*4],FxOpd00 - mov dword [FxTabledA1+01h*4],FxOpd01 - mov dword [FxTabledA1+02h*4],FxOpd02 - mov dword [FxTabledA1+03h*4],FxOpd03 - mov dword [FxTabledA1+04h*4],FxOpd04 - mov dword [FxTabledA1+05h*4],FxOpd05 - mov dword [FxTabledA1+06h*4],FxOpd06 - mov dword [FxTabledA1+07h*4],FxOpd07 - mov dword [FxTabledA1+08h*4],FxOpd08 - mov dword [FxTabledA1+09h*4],FxOpd09 - mov dword [FxTabledA1+0Ah*4],FxOpd0A - mov dword [FxTabledA1+0Bh*4],FxOpd0B - mov dword [FxTabledA1+0Ch*4],FxOpd0C - mov dword [FxTabledA1+0Dh*4],FxOpd0D - mov dword [FxTabledA1+0Eh*4],FxOpd0E - mov dword [FxTabledA1+0Fh*4],FxOpd0F - - mov dword [FxTabledA1+10h*4],FxOpd10 - mov dword [FxTabledA1+11h*4],FxOpd11 - mov dword [FxTabledA1+12h*4],FxOpd12 - mov dword [FxTabledA1+13h*4],FxOpd13 - mov dword [FxTabledA1+14h*4],FxOpd14 - mov dword [FxTabledA1+15h*4],FxOpd15 - mov dword [FxTabledA1+16h*4],FxOpd16 - mov dword [FxTabledA1+17h*4],FxOpd17 - mov dword [FxTabledA1+18h*4],FxOpd18 - mov dword [FxTabledA1+19h*4],FxOpd19 - mov dword [FxTabledA1+1Ah*4],FxOpd1A - mov dword [FxTabledA1+1Bh*4],FxOpd1B - mov dword [FxTabledA1+1Ch*4],FxOpd1C - mov dword [FxTabledA1+1Dh*4],FxOpd1D - mov dword [FxTabledA1+1Eh*4],FxOpd1E - mov dword [FxTabledA1+1Fh*4],FxOpd1F - - mov dword [FxTabledA1+20h*4],FxOpd20 - mov dword [FxTabledA1+21h*4],FxOpd21 - mov dword [FxTabledA1+22h*4],FxOpd22 - mov dword [FxTabledA1+23h*4],FxOpd23 - mov dword [FxTabledA1+24h*4],FxOpd24 - mov dword [FxTabledA1+25h*4],FxOpd25 - mov dword [FxTabledA1+26h*4],FxOpd26 - mov dword [FxTabledA1+27h*4],FxOpd27 - mov dword [FxTabledA1+28h*4],FxOpd28 - mov dword [FxTabledA1+29h*4],FxOpd29 - mov dword [FxTabledA1+2Ah*4],FxOpd2A - mov dword [FxTabledA1+2Bh*4],FxOpd2B - mov dword [FxTabledA1+2Ch*4],FxOpd2C - mov dword [FxTabledA1+2Dh*4],FxOpd2D - mov dword [FxTabledA1+2Eh*4],FxOpd2E - mov dword [FxTabledA1+2Fh*4],FxOpd2F - - mov dword [FxTabledA1+30h*4],FxOpd30A1 - mov dword [FxTabledA1+31h*4],FxOpd31A1 - mov dword [FxTabledA1+32h*4],FxOpd32A1 - mov dword [FxTabledA1+33h*4],FxOpd33A1 - mov dword [FxTabledA1+34h*4],FxOpd34A1 - mov dword [FxTabledA1+35h*4],FxOpd35A1 - mov dword [FxTabledA1+36h*4],FxOpd36A1 - mov dword [FxTabledA1+37h*4],FxOpd37A1 - mov dword [FxTabledA1+38h*4],FxOpd38A1 - mov dword [FxTabledA1+39h*4],FxOpd39A1 - mov dword [FxTabledA1+3Ah*4],FxOpd3AA1 - mov dword [FxTabledA1+3Bh*4],FxOpd3BA1 - mov dword [FxTabledA1+3Ch*4],FxOpd3C - mov dword [FxTabledA1+3Dh*4],FxOpd3D - mov dword [FxTabledA1+3Eh*4],FxOpd3E - mov dword [FxTabledA1+3Fh*4],FxOpd3F - - mov dword [FxTabledA1+40h*4],FxOpd40A1 - mov dword [FxTabledA1+41h*4],FxOpd41A1 - mov dword [FxTabledA1+42h*4],FxOpd42A1 - mov dword [FxTabledA1+43h*4],FxOpd43A1 - mov dword [FxTabledA1+44h*4],FxOpd44A1 - mov dword [FxTabledA1+45h*4],FxOpd45A1 - mov dword [FxTabledA1+46h*4],FxOpd46A1 - mov dword [FxTabledA1+47h*4],FxOpd47A1 - mov dword [FxTabledA1+48h*4],FxOpd48A1 - mov dword [FxTabledA1+49h*4],FxOpd49A1 - mov dword [FxTabledA1+4Ah*4],FxOpd4AA1 - mov dword [FxTabledA1+4Bh*4],FxOpd4BA1 - mov dword [FxTabledA1+4Ch*4],FxOpd4CA1 - mov dword [FxTabledA1+4Dh*4],FxOpd4D - mov dword [FxTabledA1+4Eh*4],FxOpd4EA1 - mov dword [FxTabledA1+4Fh*4],FxOpd4F - - mov dword [FxTabledA1+50h*4],FxOpd50A1 - mov dword [FxTabledA1+51h*4],FxOpd51A1 - mov dword [FxTabledA1+52h*4],FxOpd52A1 - mov dword [FxTabledA1+53h*4],FxOpd53A1 - mov dword [FxTabledA1+54h*4],FxOpd54A1 - mov dword [FxTabledA1+55h*4],FxOpd55A1 - mov dword [FxTabledA1+56h*4],FxOpd56A1 - mov dword [FxTabledA1+57h*4],FxOpd57A1 - mov dword [FxTabledA1+58h*4],FxOpd58A1 - mov dword [FxTabledA1+59h*4],FxOpd59A1 - mov dword [FxTabledA1+5Ah*4],FxOpd5AA1 - mov dword [FxTabledA1+5Bh*4],FxOpd5BA1 - mov dword [FxTabledA1+5Ch*4],FxOpd5CA1 - mov dword [FxTabledA1+5Dh*4],FxOpd5DA1 - mov dword [FxTabledA1+5Eh*4],FxOpd5EA1 - mov dword [FxTabledA1+5Fh*4],FxOpd5FA1 - - mov dword [FxTabledA1+60h*4],FxOpd60A1 - mov dword [FxTabledA1+61h*4],FxOpd61A1 - mov dword [FxTabledA1+62h*4],FxOpd62A1 - mov dword [FxTabledA1+63h*4],FxOpd63A1 - mov dword [FxTabledA1+64h*4],FxOpd64A1 - mov dword [FxTabledA1+65h*4],FxOpd65A1 - mov dword [FxTabledA1+66h*4],FxOpd66A1 - mov dword [FxTabledA1+67h*4],FxOpd67A1 - mov dword [FxTabledA1+68h*4],FxOpd68A1 - mov dword [FxTabledA1+69h*4],FxOpd69A1 - mov dword [FxTabledA1+6Ah*4],FxOpd6AA1 - mov dword [FxTabledA1+6Bh*4],FxOpd6BA1 - mov dword [FxTabledA1+6Ch*4],FxOpd6CA1 - mov dword [FxTabledA1+6Dh*4],FxOpd6DA1 - mov dword [FxTabledA1+6Eh*4],FxOpd6EA1 - mov dword [FxTabledA1+6Fh*4],FxOpd6FA1 - - mov dword [FxTabledA1+70h*4],FxOpd70 - mov dword [FxTabledA1+71h*4],FxOpd71A1 - mov dword [FxTabledA1+72h*4],FxOpd72A1 - mov dword [FxTabledA1+73h*4],FxOpd73A1 - mov dword [FxTabledA1+74h*4],FxOpd74A1 - mov dword [FxTabledA1+75h*4],FxOpd75A1 - mov dword [FxTabledA1+76h*4],FxOpd76A1 - mov dword [FxTabledA1+77h*4],FxOpd77A1 - mov dword [FxTabledA1+78h*4],FxOpd78A1 - mov dword [FxTabledA1+79h*4],FxOpd79A1 - mov dword [FxTabledA1+7Ah*4],FxOpd7AA1 - mov dword [FxTabledA1+7Bh*4],FxOpd7BA1 - mov dword [FxTabledA1+7Ch*4],FxOpd7CA1 - mov dword [FxTabledA1+7Dh*4],FxOpd7DA1 - mov dword [FxTabledA1+7Eh*4],FxOpd7EA1 - mov dword [FxTabledA1+7Fh*4],FxOpd7FA1 - - mov dword [FxTabledA1+80h*4],FxOpd80A1 - mov dword [FxTabledA1+81h*4],FxOpd81A1 - mov dword [FxTabledA1+82h*4],FxOpd82A1 - mov dword [FxTabledA1+83h*4],FxOpd83A1 - mov dword [FxTabledA1+84h*4],FxOpd84A1 - mov dword [FxTabledA1+85h*4],FxOpd85A1 - mov dword [FxTabledA1+86h*4],FxOpd86A1 - mov dword [FxTabledA1+87h*4],FxOpd87A1 - mov dword [FxTabledA1+88h*4],FxOpd88A1 - mov dword [FxTabledA1+89h*4],FxOpd89A1 - mov dword [FxTabledA1+8Ah*4],FxOpd8AA1 - mov dword [FxTabledA1+8Bh*4],FxOpd8BA1 - mov dword [FxTabledA1+8Ch*4],FxOpd8CA1 - mov dword [FxTabledA1+8Dh*4],FxOpd8DA1 - mov dword [FxTabledA1+8Eh*4],FxOpd8EA1 - mov dword [FxTabledA1+8Fh*4],FxOpd8FA1 - - mov dword [FxTabledA1+90h*4],FxOpd90 - mov dword [FxTabledA1+91h*4],FxOpd91 - mov dword [FxTabledA1+92h*4],FxOpd92 - mov dword [FxTabledA1+93h*4],FxOpd93 - mov dword [FxTabledA1+94h*4],FxOpd94 - mov dword [FxTabledA1+95h*4],FxOpd95 - mov dword [FxTabledA1+96h*4],FxOpd96A1 - mov dword [FxTabledA1+97h*4],FxOpd97 - mov dword [FxTabledA1+98h*4],FxOpd98A1 - mov dword [FxTabledA1+99h*4],FxOpd99A1 - mov dword [FxTabledA1+9Ah*4],FxOpd9AA1 - mov dword [FxTabledA1+9Bh*4],FxOpd9BA1 - mov dword [FxTabledA1+9Ch*4],FxOpd9CA1 - mov dword [FxTabledA1+9Dh*4],FxOpd9DA1 - mov dword [FxTabledA1+9Eh*4],FxOpd9E - mov dword [FxTabledA1+9Fh*4],FxOpd9FA1 - - mov dword [FxTabledA1+0A0h*4],FxOpdA0A1 - mov dword [FxTabledA1+0A1h*4],FxOpdA1A1 - mov dword [FxTabledA1+0A2h*4],FxOpdA2A1 - mov dword [FxTabledA1+0A3h*4],FxOpdA3A1 - mov dword [FxTabledA1+0A4h*4],FxOpdA4A1 - mov dword [FxTabledA1+0A5h*4],FxOpdA5A1 - mov dword [FxTabledA1+0A6h*4],FxOpdA6A1 - mov dword [FxTabledA1+0A7h*4],FxOpdA7A1 - mov dword [FxTabledA1+0A8h*4],FxOpdA8A1 - mov dword [FxTabledA1+0A9h*4],FxOpdA9A1 - mov dword [FxTabledA1+0AAh*4],FxOpdAAA1 - mov dword [FxTabledA1+0ABh*4],FxOpdABA1 - mov dword [FxTabledA1+0ACh*4],FxOpdACA1 - mov dword [FxTabledA1+0ADh*4],FxOpdADA1 - mov dword [FxTabledA1+0AEh*4],FxOpdAEA1 - mov dword [FxTabledA1+0AFh*4],FxOpdAFA1 - - mov dword [FxTabledA1+0B0h*4],FxOpdB0 - mov dword [FxTabledA1+0B1h*4],FxOpdB1 - mov dword [FxTabledA1+0B2h*4],FxOpdB2 - mov dword [FxTabledA1+0B3h*4],FxOpdB3 - mov dword [FxTabledA1+0B4h*4],FxOpdB4 - mov dword [FxTabledA1+0B5h*4],FxOpdB5 - mov dword [FxTabledA1+0B6h*4],FxOpdB6 - mov dword [FxTabledA1+0B7h*4],FxOpdB7 - mov dword [FxTabledA1+0B8h*4],FxOpdB8 - mov dword [FxTabledA1+0B9h*4],FxOpdB9 - mov dword [FxTabledA1+0BAh*4],FxOpdBA - mov dword [FxTabledA1+0BBh*4],FxOpdBB - mov dword [FxTabledA1+0BCh*4],FxOpdBC - mov dword [FxTabledA1+0BDh*4],FxOpdBD - mov dword [FxTabledA1+0BEh*4],FxOpdBE - mov dword [FxTabledA1+0BFh*4],FxOpdBF - - mov dword [FxTabledA1+0C0h*4],FxOpdC0 - mov dword [FxTabledA1+0C1h*4],FxOpdC1A1 - mov dword [FxTabledA1+0C2h*4],FxOpdC2A1 - mov dword [FxTabledA1+0C3h*4],FxOpdC3A1 - mov dword [FxTabledA1+0C4h*4],FxOpdC4A1 - mov dword [FxTabledA1+0C5h*4],FxOpdC5A1 - mov dword [FxTabledA1+0C6h*4],FxOpdC6A1 - mov dword [FxTabledA1+0C7h*4],FxOpdC7A1 - mov dword [FxTabledA1+0C8h*4],FxOpdC8A1 - mov dword [FxTabledA1+0C9h*4],FxOpdC9A1 - mov dword [FxTabledA1+0CAh*4],FxOpdCAA1 - mov dword [FxTabledA1+0CBh*4],FxOpdCBA1 - mov dword [FxTabledA1+0CCh*4],FxOpdCCA1 - mov dword [FxTabledA1+0CDh*4],FxOpdCDA1 - mov dword [FxTabledA1+0CEh*4],FxOpdCEA1 - mov dword [FxTabledA1+0CFh*4],FxOpdCFA1 - - mov dword [FxTabledA1+0D0h*4],FxOpdD0 - mov dword [FxTabledA1+0D1h*4],FxOpdD1 - mov dword [FxTabledA1+0D2h*4],FxOpdD2 - mov dword [FxTabledA1+0D3h*4],FxOpdD3 - mov dword [FxTabledA1+0D4h*4],FxOpdD4 - mov dword [FxTabledA1+0D5h*4],FxOpdD5 - mov dword [FxTabledA1+0D6h*4],FxOpdD6 - mov dword [FxTabledA1+0D7h*4],FxOpdD7 - mov dword [FxTabledA1+0D8h*4],FxOpdD8 - mov dword [FxTabledA1+0D9h*4],FxOpdD9 - mov dword [FxTabledA1+0DAh*4],FxOpdDA - mov dword [FxTabledA1+0DBh*4],FxOpdDB - mov dword [FxTabledA1+0DCh*4],FxOpdDC - mov dword [FxTabledA1+0DDh*4],FxOpdDD - mov dword [FxTabledA1+0DEh*4],FxOpdDE - mov dword [FxTabledA1+0DFh*4],FxOpdDF - - mov dword [FxTabledA1+0E0h*4],FxOpdE0 - mov dword [FxTabledA1+0E1h*4],FxOpdE1 - mov dword [FxTabledA1+0E2h*4],FxOpdE2 - mov dword [FxTabledA1+0E3h*4],FxOpdE3 - mov dword [FxTabledA1+0E4h*4],FxOpdE4 - mov dword [FxTabledA1+0E5h*4],FxOpdE5 - mov dword [FxTabledA1+0E6h*4],FxOpdE6 - mov dword [FxTabledA1+0E7h*4],FxOpdE7 - mov dword [FxTabledA1+0E8h*4],FxOpdE8 - mov dword [FxTabledA1+0E9h*4],FxOpdE9 - mov dword [FxTabledA1+0EAh*4],FxOpdEA - mov dword [FxTabledA1+0EBh*4],FxOpdEB - mov dword [FxTabledA1+0ECh*4],FxOpdEC - mov dword [FxTabledA1+0EDh*4],FxOpdED - mov dword [FxTabledA1+0EEh*4],FxOpdEE - mov dword [FxTabledA1+0EFh*4],FxOpdEFA1 - - mov dword [FxTabledA1+0F0h*4],FxOpdF0A1 - mov dword [FxTabledA1+0F1h*4],FxOpdF1A1 - mov dword [FxTabledA1+0F2h*4],FxOpdF2A1 - mov dword [FxTabledA1+0F3h*4],FxOpdF3A1 - mov dword [FxTabledA1+0F4h*4],FxOpdF4A1 - mov dword [FxTabledA1+0F5h*4],FxOpdF5A1 - mov dword [FxTabledA1+0F6h*4],FxOpdF6A1 - mov dword [FxTabledA1+0F7h*4],FxOpdF7A1 - mov dword [FxTabledA1+0F8h*4],FxOpdF8A1 - mov dword [FxTabledA1+0F9h*4],FxOpdF9A1 - mov dword [FxTabledA1+0FAh*4],FxOpdFAA1 - mov dword [FxTabledA1+0FBh*4],FxOpdFBA1 - mov dword [FxTabledA1+0FCh*4],FxOpdFCA1 - mov dword [FxTabledA1+0FDh*4],FxOpdFDA1 - mov dword [FxTabledA1+0FEh*4],FxOpdFEA1 - mov dword [FxTabledA1+0FFh*4],FxOpdFFA1 - - - mov dword [FxTabledA2+00h*4],FxOpd00 - mov dword [FxTabledA2+01h*4],FxOpd01 - mov dword [FxTabledA2+02h*4],FxOpd02 - mov dword [FxTabledA2+03h*4],FxOpd03 - mov dword [FxTabledA2+04h*4],FxOpd04 - mov dword [FxTabledA2+05h*4],FxOpd05 - mov dword [FxTabledA2+06h*4],FxOpd06 - mov dword [FxTabledA2+07h*4],FxOpd07 - mov dword [FxTabledA2+08h*4],FxOpd08 - mov dword [FxTabledA2+09h*4],FxOpd09 - mov dword [FxTabledA2+0Ah*4],FxOpd0A - mov dword [FxTabledA2+0Bh*4],FxOpd0B - mov dword [FxTabledA2+0Ch*4],FxOpd0C - mov dword [FxTabledA2+0Dh*4],FxOpd0D - mov dword [FxTabledA2+0Eh*4],FxOpd0E - mov dword [FxTabledA2+0Fh*4],FxOpd0F - - mov dword [FxTabledA2+10h*4],FxOpd10 - mov dword [FxTabledA2+11h*4],FxOpd11 - mov dword [FxTabledA2+12h*4],FxOpd12 - mov dword [FxTabledA2+13h*4],FxOpd13 - mov dword [FxTabledA2+14h*4],FxOpd14 - mov dword [FxTabledA2+15h*4],FxOpd15 - mov dword [FxTabledA2+16h*4],FxOpd16 - mov dword [FxTabledA2+17h*4],FxOpd17 - mov dword [FxTabledA2+18h*4],FxOpd18 - mov dword [FxTabledA2+19h*4],FxOpd19 - mov dword [FxTabledA2+1Ah*4],FxOpd1A - mov dword [FxTabledA2+1Bh*4],FxOpd1B - mov dword [FxTabledA2+1Ch*4],FxOpd1C - mov dword [FxTabledA2+1Dh*4],FxOpd1D - mov dword [FxTabledA2+1Eh*4],FxOpd1E - mov dword [FxTabledA2+1Fh*4],FxOpd1F - - mov dword [FxTabledA2+20h*4],FxOpd20 - mov dword [FxTabledA2+21h*4],FxOpd21 - mov dword [FxTabledA2+22h*4],FxOpd22 - mov dword [FxTabledA2+23h*4],FxOpd23 - mov dword [FxTabledA2+24h*4],FxOpd24 - mov dword [FxTabledA2+25h*4],FxOpd25 - mov dword [FxTabledA2+26h*4],FxOpd26 - mov dword [FxTabledA2+27h*4],FxOpd27 - mov dword [FxTabledA2+28h*4],FxOpd28 - mov dword [FxTabledA2+29h*4],FxOpd29 - mov dword [FxTabledA2+2Ah*4],FxOpd2A - mov dword [FxTabledA2+2Bh*4],FxOpd2B - mov dword [FxTabledA2+2Ch*4],FxOpd2C - mov dword [FxTabledA2+2Dh*4],FxOpd2D - mov dword [FxTabledA2+2Eh*4],FxOpd2E - mov dword [FxTabledA2+2Fh*4],FxOpd2F - - mov dword [FxTabledA2+30h*4],FxOpd30 - mov dword [FxTabledA2+31h*4],FxOpd31 - mov dword [FxTabledA2+32h*4],FxOpd32 - mov dword [FxTabledA2+33h*4],FxOpd33 - mov dword [FxTabledA2+34h*4],FxOpd34 - mov dword [FxTabledA2+35h*4],FxOpd35 - mov dword [FxTabledA2+36h*4],FxOpd36 - mov dword [FxTabledA2+37h*4],FxOpd37 - mov dword [FxTabledA2+38h*4],FxOpd38 - mov dword [FxTabledA2+39h*4],FxOpd39 - mov dword [FxTabledA2+3Ah*4],FxOpd3A - mov dword [FxTabledA2+3Bh*4],FxOpd3B - mov dword [FxTabledA2+3Ch*4],FxOpd3C - mov dword [FxTabledA2+3Dh*4],FxOpd3D - mov dword [FxTabledA2+3Eh*4],FxOpd3E - mov dword [FxTabledA2+3Fh*4],FxOpd3F - - mov dword [FxTabledA2+40h*4],FxOpd40 - mov dword [FxTabledA2+41h*4],FxOpd41 - mov dword [FxTabledA2+42h*4],FxOpd42 - mov dword [FxTabledA2+43h*4],FxOpd43 - mov dword [FxTabledA2+44h*4],FxOpd44 - mov dword [FxTabledA2+45h*4],FxOpd45 - mov dword [FxTabledA2+46h*4],FxOpd46 - mov dword [FxTabledA2+47h*4],FxOpd47 - mov dword [FxTabledA2+48h*4],FxOpd48 - mov dword [FxTabledA2+49h*4],FxOpd49 - mov dword [FxTabledA2+4Ah*4],FxOpd4A - mov dword [FxTabledA2+4Bh*4],FxOpd4B - mov dword [FxTabledA2+4Ch*4],FxOpd4C - mov dword [FxTabledA2+4Dh*4],FxOpd4D - mov dword [FxTabledA2+4Eh*4],FxOpd4E - mov dword [FxTabledA2+4Fh*4],FxOpd4F - - mov dword [FxTabledA2+50h*4],FxOpd50A2 - mov dword [FxTabledA2+51h*4],FxOpd51A2 - mov dword [FxTabledA2+52h*4],FxOpd52A2 - mov dword [FxTabledA2+53h*4],FxOpd53A2 - mov dword [FxTabledA2+54h*4],FxOpd54A2 - mov dword [FxTabledA2+55h*4],FxOpd55A2 - mov dword [FxTabledA2+56h*4],FxOpd56A2 - mov dword [FxTabledA2+57h*4],FxOpd57A2 - mov dword [FxTabledA2+58h*4],FxOpd58A2 - mov dword [FxTabledA2+59h*4],FxOpd59A2 - mov dword [FxTabledA2+5Ah*4],FxOpd5AA2 - mov dword [FxTabledA2+5Bh*4],FxOpd5BA2 - mov dword [FxTabledA2+5Ch*4],FxOpd5CA2 - mov dword [FxTabledA2+5Dh*4],FxOpd5DA2 - mov dword [FxTabledA2+5Eh*4],FxOpd5EA2 - mov dword [FxTabledA2+5Fh*4],FxOpd5FA2 - - mov dword [FxTabledA2+60h*4],FxOpd60A2 - mov dword [FxTabledA2+61h*4],FxOpd61A2 - mov dword [FxTabledA2+62h*4],FxOpd62A2 - mov dword [FxTabledA2+63h*4],FxOpd63A2 - mov dword [FxTabledA2+64h*4],FxOpd64A2 - mov dword [FxTabledA2+65h*4],FxOpd65A2 - mov dword [FxTabledA2+66h*4],FxOpd66A2 - mov dword [FxTabledA2+67h*4],FxOpd67A2 - mov dword [FxTabledA2+68h*4],FxOpd68A2 - mov dword [FxTabledA2+69h*4],FxOpd69A2 - mov dword [FxTabledA2+6Ah*4],FxOpd6AA2 - mov dword [FxTabledA2+6Bh*4],FxOpd6BA2 - mov dword [FxTabledA2+6Ch*4],FxOpd6CA2 - mov dword [FxTabledA2+6Dh*4],FxOpd6DA2 - mov dword [FxTabledA2+6Eh*4],FxOpd6EA2 - mov dword [FxTabledA2+6Fh*4],FxOpd6FA2 - - mov dword [FxTabledA2+70h*4],FxOpd70 - mov dword [FxTabledA2+71h*4],FxOpd71A2 - mov dword [FxTabledA2+72h*4],FxOpd72A2 - mov dword [FxTabledA2+73h*4],FxOpd73A2 - mov dword [FxTabledA2+74h*4],FxOpd74A2 - mov dword [FxTabledA2+75h*4],FxOpd75A2 - mov dword [FxTabledA2+76h*4],FxOpd76A2 - mov dword [FxTabledA2+77h*4],FxOpd77A2 - mov dword [FxTabledA2+78h*4],FxOpd78A2 - mov dword [FxTabledA2+79h*4],FxOpd79A2 - mov dword [FxTabledA2+7Ah*4],FxOpd7AA2 - mov dword [FxTabledA2+7Bh*4],FxOpd7BA2 - mov dword [FxTabledA2+7Ch*4],FxOpd7CA2 - mov dword [FxTabledA2+7Dh*4],FxOpd7DA2 - mov dword [FxTabledA2+7Eh*4],FxOpd7EA2 - mov dword [FxTabledA2+7Fh*4],FxOpd7FA2 - - mov dword [FxTabledA2+80h*4],FxOpd80A2 - mov dword [FxTabledA2+81h*4],FxOpd81A2 - mov dword [FxTabledA2+82h*4],FxOpd82A2 - mov dword [FxTabledA2+83h*4],FxOpd83A2 - mov dword [FxTabledA2+84h*4],FxOpd84A2 - mov dword [FxTabledA2+85h*4],FxOpd85A2 - mov dword [FxTabledA2+86h*4],FxOpd86A2 - mov dword [FxTabledA2+87h*4],FxOpd87A2 - mov dword [FxTabledA2+88h*4],FxOpd88A2 - mov dword [FxTabledA2+89h*4],FxOpd89A2 - mov dword [FxTabledA2+8Ah*4],FxOpd8AA2 - mov dword [FxTabledA2+8Bh*4],FxOpd8BA2 - mov dword [FxTabledA2+8Ch*4],FxOpd8CA2 - mov dword [FxTabledA2+8Dh*4],FxOpd8DA2 - mov dword [FxTabledA2+8Eh*4],FxOpd8EA2 - mov dword [FxTabledA2+8Fh*4],FxOpd8FA2 - - mov dword [FxTabledA2+90h*4],FxOpd90 - mov dword [FxTabledA2+91h*4],FxOpd91 - mov dword [FxTabledA2+92h*4],FxOpd92 - mov dword [FxTabledA2+93h*4],FxOpd93 - mov dword [FxTabledA2+94h*4],FxOpd94 - mov dword [FxTabledA2+95h*4],FxOpd95 - mov dword [FxTabledA2+96h*4],FxOpd96 - mov dword [FxTabledA2+97h*4],FxOpd97 - mov dword [FxTabledA2+98h*4],FxOpd98 - mov dword [FxTabledA2+99h*4],FxOpd99 - mov dword [FxTabledA2+9Ah*4],FxOpd9A - mov dword [FxTabledA2+9Bh*4],FxOpd9B - mov dword [FxTabledA2+9Ch*4],FxOpd9C - mov dword [FxTabledA2+9Dh*4],FxOpd9D - mov dword [FxTabledA2+9Eh*4],FxOpd9E - mov dword [FxTabledA2+9Fh*4],FxOpd9F - - mov dword [FxTabledA2+0A0h*4],FxOpdA0A2 - mov dword [FxTabledA2+0A1h*4],FxOpdA1A2 - mov dword [FxTabledA2+0A2h*4],FxOpdA2A2 - mov dword [FxTabledA2+0A3h*4],FxOpdA3A2 - mov dword [FxTabledA2+0A4h*4],FxOpdA4A2 - mov dword [FxTabledA2+0A5h*4],FxOpdA5A2 - mov dword [FxTabledA2+0A6h*4],FxOpdA6A2 - mov dword [FxTabledA2+0A7h*4],FxOpdA7A2 - mov dword [FxTabledA2+0A8h*4],FxOpdA8A2 - mov dword [FxTabledA2+0A9h*4],FxOpdA9A2 - mov dword [FxTabledA2+0AAh*4],FxOpdAAA2 - mov dword [FxTabledA2+0ABh*4],FxOpdABA2 - mov dword [FxTabledA2+0ACh*4],FxOpdACA2 - mov dword [FxTabledA2+0ADh*4],FxOpdADA2 - mov dword [FxTabledA2+0AEh*4],FxOpdAEA2 - mov dword [FxTabledA2+0AFh*4],FxOpdAFA2 - - mov dword [FxTabledA2+0B0h*4],FxOpdB0 - mov dword [FxTabledA2+0B1h*4],FxOpdB1 - mov dword [FxTabledA2+0B2h*4],FxOpdB2 - mov dword [FxTabledA2+0B3h*4],FxOpdB3 - mov dword [FxTabledA2+0B4h*4],FxOpdB4 - mov dword [FxTabledA2+0B5h*4],FxOpdB5 - mov dword [FxTabledA2+0B6h*4],FxOpdB6 - mov dword [FxTabledA2+0B7h*4],FxOpdB7 - mov dword [FxTabledA2+0B8h*4],FxOpdB8 - mov dword [FxTabledA2+0B9h*4],FxOpdB9 - mov dword [FxTabledA2+0BAh*4],FxOpdBA - mov dword [FxTabledA2+0BBh*4],FxOpdBB - mov dword [FxTabledA2+0BCh*4],FxOpdBC - mov dword [FxTabledA2+0BDh*4],FxOpdBD - mov dword [FxTabledA2+0BEh*4],FxOpdBE - mov dword [FxTabledA2+0BFh*4],FxOpdBF - - mov dword [FxTabledA2+0C0h*4],FxOpdC0 - mov dword [FxTabledA2+0C1h*4],FxOpdC1A2 - mov dword [FxTabledA2+0C2h*4],FxOpdC2A2 - mov dword [FxTabledA2+0C3h*4],FxOpdC3A2 - mov dword [FxTabledA2+0C4h*4],FxOpdC4A2 - mov dword [FxTabledA2+0C5h*4],FxOpdC5A2 - mov dword [FxTabledA2+0C6h*4],FxOpdC6A2 - mov dword [FxTabledA2+0C7h*4],FxOpdC7A2 - mov dword [FxTabledA2+0C8h*4],FxOpdC8A2 - mov dword [FxTabledA2+0C9h*4],FxOpdC9A2 - mov dword [FxTabledA2+0CAh*4],FxOpdCAA2 - mov dword [FxTabledA2+0CBh*4],FxOpdCBA2 - mov dword [FxTabledA2+0CCh*4],FxOpdCCA2 - mov dword [FxTabledA2+0CDh*4],FxOpdCDA2 - mov dword [FxTabledA2+0CEh*4],FxOpdCEA2 - mov dword [FxTabledA2+0CFh*4],FxOpdCFA2 - - mov dword [FxTabledA2+0D0h*4],FxOpdD0 - mov dword [FxTabledA2+0D1h*4],FxOpdD1 - mov dword [FxTabledA2+0D2h*4],FxOpdD2 - mov dword [FxTabledA2+0D3h*4],FxOpdD3 - mov dword [FxTabledA2+0D4h*4],FxOpdD4 - mov dword [FxTabledA2+0D5h*4],FxOpdD5 - mov dword [FxTabledA2+0D6h*4],FxOpdD6 - mov dword [FxTabledA2+0D7h*4],FxOpdD7 - mov dword [FxTabledA2+0D8h*4],FxOpdD8 - mov dword [FxTabledA2+0D9h*4],FxOpdD9 - mov dword [FxTabledA2+0DAh*4],FxOpdDA - mov dword [FxTabledA2+0DBh*4],FxOpdDB - mov dword [FxTabledA2+0DCh*4],FxOpdDC - mov dword [FxTabledA2+0DDh*4],FxOpdDD - mov dword [FxTabledA2+0DEh*4],FxOpdDE - mov dword [FxTabledA2+0DFh*4],FxOpdDFA2 - - mov dword [FxTabledA2+0E0h*4],FxOpdE0 - mov dword [FxTabledA2+0E1h*4],FxOpdE1 - mov dword [FxTabledA2+0E2h*4],FxOpdE2 - mov dword [FxTabledA2+0E3h*4],FxOpdE3 - mov dword [FxTabledA2+0E4h*4],FxOpdE4 - mov dword [FxTabledA2+0E5h*4],FxOpdE5 - mov dword [FxTabledA2+0E6h*4],FxOpdE6 - mov dword [FxTabledA2+0E7h*4],FxOpdE7 - mov dword [FxTabledA2+0E8h*4],FxOpdE8 - mov dword [FxTabledA2+0E9h*4],FxOpdE9 - mov dword [FxTabledA2+0EAh*4],FxOpdEA - mov dword [FxTabledA2+0EBh*4],FxOpdEB - mov dword [FxTabledA2+0ECh*4],FxOpdEC - mov dword [FxTabledA2+0EDh*4],FxOpdED - mov dword [FxTabledA2+0EEh*4],FxOpdEE - mov dword [FxTabledA2+0EFh*4],FxOpdEFA2 - - mov dword [FxTabledA2+0F0h*4],FxOpdF0A2 - mov dword [FxTabledA2+0F1h*4],FxOpdF1A2 - mov dword [FxTabledA2+0F2h*4],FxOpdF2A2 - mov dword [FxTabledA2+0F3h*4],FxOpdF3A2 - mov dword [FxTabledA2+0F4h*4],FxOpdF4A2 - mov dword [FxTabledA2+0F5h*4],FxOpdF5A2 - mov dword [FxTabledA2+0F6h*4],FxOpdF6A2 - mov dword [FxTabledA2+0F7h*4],FxOpdF7A2 - mov dword [FxTabledA2+0F8h*4],FxOpdF8A2 - mov dword [FxTabledA2+0F9h*4],FxOpdF9A2 - mov dword [FxTabledA2+0FAh*4],FxOpdFAA2 - mov dword [FxTabledA2+0FBh*4],FxOpdFBA2 - mov dword [FxTabledA2+0FCh*4],FxOpdFCA2 - mov dword [FxTabledA2+0FDh*4],FxOpdFDA2 - mov dword [FxTabledA2+0FEh*4],FxOpdFEA2 - mov dword [FxTabledA2+0FFh*4],FxOpdFFA2 - - mov dword [FxTabledA3+00h*4],FxOpd00 - mov dword [FxTabledA3+01h*4],FxOpd01 - mov dword [FxTabledA3+02h*4],FxOpd02 - mov dword [FxTabledA3+03h*4],FxOpd03 - mov dword [FxTabledA3+04h*4],FxOpd04 - mov dword [FxTabledA3+05h*4],FxOpd05 - mov dword [FxTabledA3+06h*4],FxOpd06 - mov dword [FxTabledA3+07h*4],FxOpd07 - mov dword [FxTabledA3+08h*4],FxOpd08 - mov dword [FxTabledA3+09h*4],FxOpd09 - mov dword [FxTabledA3+0Ah*4],FxOpd0A - mov dword [FxTabledA3+0Bh*4],FxOpd0B - mov dword [FxTabledA3+0Ch*4],FxOpd0C - mov dword [FxTabledA3+0Dh*4],FxOpd0D - mov dword [FxTabledA3+0Eh*4],FxOpd0E - mov dword [FxTabledA3+0Fh*4],FxOpd0F - - mov dword [FxTabledA3+10h*4],FxOpd10 - mov dword [FxTabledA3+11h*4],FxOpd11 - mov dword [FxTabledA3+12h*4],FxOpd12 - mov dword [FxTabledA3+13h*4],FxOpd13 - mov dword [FxTabledA3+14h*4],FxOpd14 - mov dword [FxTabledA3+15h*4],FxOpd15 - mov dword [FxTabledA3+16h*4],FxOpd16 - mov dword [FxTabledA3+17h*4],FxOpd17 - mov dword [FxTabledA3+18h*4],FxOpd18 - mov dword [FxTabledA3+19h*4],FxOpd19 - mov dword [FxTabledA3+1Ah*4],FxOpd1A - mov dword [FxTabledA3+1Bh*4],FxOpd1B - mov dword [FxTabledA3+1Ch*4],FxOpd1C - mov dword [FxTabledA3+1Dh*4],FxOpd1D - mov dword [FxTabledA3+1Eh*4],FxOpd1E - mov dword [FxTabledA3+1Fh*4],FxOpd1F - - mov dword [FxTabledA3+20h*4],FxOpd20 - mov dword [FxTabledA3+21h*4],FxOpd21 - mov dword [FxTabledA3+22h*4],FxOpd22 - mov dword [FxTabledA3+23h*4],FxOpd23 - mov dword [FxTabledA3+24h*4],FxOpd24 - mov dword [FxTabledA3+25h*4],FxOpd25 - mov dword [FxTabledA3+26h*4],FxOpd26 - mov dword [FxTabledA3+27h*4],FxOpd27 - mov dword [FxTabledA3+28h*4],FxOpd28 - mov dword [FxTabledA3+29h*4],FxOpd29 - mov dword [FxTabledA3+2Ah*4],FxOpd2A - mov dword [FxTabledA3+2Bh*4],FxOpd2B - mov dword [FxTabledA3+2Ch*4],FxOpd2C - mov dword [FxTabledA3+2Dh*4],FxOpd2D - mov dword [FxTabledA3+2Eh*4],FxOpd2E - mov dword [FxTabledA3+2Fh*4],FxOpd2F - - mov dword [FxTabledA3+30h*4],FxOpd30 - mov dword [FxTabledA3+31h*4],FxOpd31 - mov dword [FxTabledA3+32h*4],FxOpd32 - mov dword [FxTabledA3+33h*4],FxOpd33 - mov dword [FxTabledA3+34h*4],FxOpd34 - mov dword [FxTabledA3+35h*4],FxOpd35 - mov dword [FxTabledA3+36h*4],FxOpd36 - mov dword [FxTabledA3+37h*4],FxOpd37 - mov dword [FxTabledA3+38h*4],FxOpd38 - mov dword [FxTabledA3+39h*4],FxOpd39 - mov dword [FxTabledA3+3Ah*4],FxOpd3A - mov dword [FxTabledA3+3Bh*4],FxOpd3B - mov dword [FxTabledA3+3Ch*4],FxOpd3C - mov dword [FxTabledA3+3Dh*4],FxOpd3D - mov dword [FxTabledA3+3Eh*4],FxOpd3E - mov dword [FxTabledA3+3Fh*4],FxOpd3F - - mov dword [FxTabledA3+40h*4],FxOpd40 - mov dword [FxTabledA3+41h*4],FxOpd41 - mov dword [FxTabledA3+42h*4],FxOpd42 - mov dword [FxTabledA3+43h*4],FxOpd43 - mov dword [FxTabledA3+44h*4],FxOpd44 - mov dword [FxTabledA3+45h*4],FxOpd45 - mov dword [FxTabledA3+46h*4],FxOpd46 - mov dword [FxTabledA3+47h*4],FxOpd47 - mov dword [FxTabledA3+48h*4],FxOpd48 - mov dword [FxTabledA3+49h*4],FxOpd49 - mov dword [FxTabledA3+4Ah*4],FxOpd4A - mov dword [FxTabledA3+4Bh*4],FxOpd4B - mov dword [FxTabledA3+4Ch*4],FxOpd4C - mov dword [FxTabledA3+4Dh*4],FxOpd4D - mov dword [FxTabledA3+4Eh*4],FxOpd4E - mov dword [FxTabledA3+4Fh*4],FxOpd4F - - mov dword [FxTabledA3+50h*4],FxOpd50A3 - mov dword [FxTabledA3+51h*4],FxOpd51A3 - mov dword [FxTabledA3+52h*4],FxOpd52A3 - mov dword [FxTabledA3+53h*4],FxOpd53A3 - mov dword [FxTabledA3+54h*4],FxOpd54A3 - mov dword [FxTabledA3+55h*4],FxOpd55A3 - mov dword [FxTabledA3+56h*4],FxOpd56A3 - mov dword [FxTabledA3+57h*4],FxOpd57A3 - mov dword [FxTabledA3+58h*4],FxOpd58A3 - mov dword [FxTabledA3+59h*4],FxOpd59A3 - mov dword [FxTabledA3+5Ah*4],FxOpd5AA3 - mov dword [FxTabledA3+5Bh*4],FxOpd5BA3 - mov dword [FxTabledA3+5Ch*4],FxOpd5CA3 - mov dword [FxTabledA3+5Dh*4],FxOpd5DA3 - mov dword [FxTabledA3+5Eh*4],FxOpd5EA3 - mov dword [FxTabledA3+5Fh*4],FxOpd5FA3 - - mov dword [FxTabledA3+60h*4],FxOpd60A3 - mov dword [FxTabledA3+61h*4],FxOpd61A3 - mov dword [FxTabledA3+62h*4],FxOpd62A3 - mov dword [FxTabledA3+63h*4],FxOpd63A3 - mov dword [FxTabledA3+64h*4],FxOpd64A3 - mov dword [FxTabledA3+65h*4],FxOpd65A3 - mov dword [FxTabledA3+66h*4],FxOpd66A3 - mov dword [FxTabledA3+67h*4],FxOpd67A3 - mov dword [FxTabledA3+68h*4],FxOpd68A3 - mov dword [FxTabledA3+69h*4],FxOpd69A3 - mov dword [FxTabledA3+6Ah*4],FxOpd6AA3 - mov dword [FxTabledA3+6Bh*4],FxOpd6BA3 - mov dword [FxTabledA3+6Ch*4],FxOpd6CA3 - mov dword [FxTabledA3+6Dh*4],FxOpd6DA3 - mov dword [FxTabledA3+6Eh*4],FxOpd6EA3 - mov dword [FxTabledA3+6Fh*4],FxOpd6FA3 - - mov dword [FxTabledA3+70h*4],FxOpd70 - mov dword [FxTabledA3+71h*4],FxOpd71A3 - mov dword [FxTabledA3+72h*4],FxOpd72A3 - mov dword [FxTabledA3+73h*4],FxOpd73A3 - mov dword [FxTabledA3+74h*4],FxOpd74A3 - mov dword [FxTabledA3+75h*4],FxOpd75A3 - mov dword [FxTabledA3+76h*4],FxOpd76A3 - mov dword [FxTabledA3+77h*4],FxOpd77A3 - mov dword [FxTabledA3+78h*4],FxOpd78A3 - mov dword [FxTabledA3+79h*4],FxOpd79A3 - mov dword [FxTabledA3+7Ah*4],FxOpd7AA3 - mov dword [FxTabledA3+7Bh*4],FxOpd7BA3 - mov dword [FxTabledA3+7Ch*4],FxOpd7CA3 - mov dword [FxTabledA3+7Dh*4],FxOpd7DA3 - mov dword [FxTabledA3+7Eh*4],FxOpd7EA3 - mov dword [FxTabledA3+7Fh*4],FxOpd7FA3 - - mov dword [FxTabledA3+80h*4],FxOpd80A3 - mov dword [FxTabledA3+81h*4],FxOpd81A3 - mov dword [FxTabledA3+82h*4],FxOpd82A3 - mov dword [FxTabledA3+83h*4],FxOpd83A3 - mov dword [FxTabledA3+84h*4],FxOpd84A3 - mov dword [FxTabledA3+85h*4],FxOpd85A3 - mov dword [FxTabledA3+86h*4],FxOpd86A3 - mov dword [FxTabledA3+87h*4],FxOpd87A3 - mov dword [FxTabledA3+88h*4],FxOpd88A3 - mov dword [FxTabledA3+89h*4],FxOpd89A3 - mov dword [FxTabledA3+8Ah*4],FxOpd8AA3 - mov dword [FxTabledA3+8Bh*4],FxOpd8BA3 - mov dword [FxTabledA3+8Ch*4],FxOpd8CA3 - mov dword [FxTabledA3+8Dh*4],FxOpd8DA3 - mov dword [FxTabledA3+8Eh*4],FxOpd8EA3 - mov dword [FxTabledA3+8Fh*4],FxOpd8FA3 - - mov dword [FxTabledA3+90h*4],FxOpd90 - mov dword [FxTabledA3+91h*4],FxOpd91 - mov dword [FxTabledA3+92h*4],FxOpd92 - mov dword [FxTabledA3+93h*4],FxOpd93 - mov dword [FxTabledA3+94h*4],FxOpd94 - mov dword [FxTabledA3+95h*4],FxOpd95 - mov dword [FxTabledA3+96h*4],FxOpd96 - mov dword [FxTabledA3+97h*4],FxOpd97 - mov dword [FxTabledA3+98h*4],FxOpd98 - mov dword [FxTabledA3+99h*4],FxOpd99 - mov dword [FxTabledA3+9Ah*4],FxOpd9A - mov dword [FxTabledA3+9Bh*4],FxOpd9B - mov dword [FxTabledA3+9Ch*4],FxOpd9C - mov dword [FxTabledA3+9Dh*4],FxOpd9D - mov dword [FxTabledA3+9Eh*4],FxOpd9E - mov dword [FxTabledA3+9Fh*4],FxOpd9F - - mov dword [FxTabledA3+0A0h*4],FxOpdA0 - mov dword [FxTabledA3+0A1h*4],FxOpdA1 - mov dword [FxTabledA3+0A2h*4],FxOpdA2 - mov dword [FxTabledA3+0A3h*4],FxOpdA3 - mov dword [FxTabledA3+0A4h*4],FxOpdA4 - mov dword [FxTabledA3+0A5h*4],FxOpdA5 - mov dword [FxTabledA3+0A6h*4],FxOpdA6 - mov dword [FxTabledA3+0A7h*4],FxOpdA7 - mov dword [FxTabledA3+0A8h*4],FxOpdA8 - mov dword [FxTabledA3+0A9h*4],FxOpdA9 - mov dword [FxTabledA3+0AAh*4],FxOpdAA - mov dword [FxTabledA3+0ABh*4],FxOpdAB - mov dword [FxTabledA3+0ACh*4],FxOpdAC - mov dword [FxTabledA3+0ADh*4],FxOpdAD - mov dword [FxTabledA3+0AEh*4],FxOpdAE - mov dword [FxTabledA3+0AFh*4],FxOpdAF - - mov dword [FxTabledA3+0B0h*4],FxOpdB0 - mov dword [FxTabledA3+0B1h*4],FxOpdB1 - mov dword [FxTabledA3+0B2h*4],FxOpdB2 - mov dword [FxTabledA3+0B3h*4],FxOpdB3 - mov dword [FxTabledA3+0B4h*4],FxOpdB4 - mov dword [FxTabledA3+0B5h*4],FxOpdB5 - mov dword [FxTabledA3+0B6h*4],FxOpdB6 - mov dword [FxTabledA3+0B7h*4],FxOpdB7 - mov dword [FxTabledA3+0B8h*4],FxOpdB8 - mov dword [FxTabledA3+0B9h*4],FxOpdB9 - mov dword [FxTabledA3+0BAh*4],FxOpdBA - mov dword [FxTabledA3+0BBh*4],FxOpdBB - mov dword [FxTabledA3+0BCh*4],FxOpdBC - mov dword [FxTabledA3+0BDh*4],FxOpdBD - mov dword [FxTabledA3+0BEh*4],FxOpdBE - mov dword [FxTabledA3+0BFh*4],FxOpdBF - - mov dword [FxTabledA3+0C0h*4],FxOpdC0 - mov dword [FxTabledA3+0C1h*4],FxOpdC1A3 - mov dword [FxTabledA3+0C2h*4],FxOpdC2A3 - mov dword [FxTabledA3+0C3h*4],FxOpdC3A3 - mov dword [FxTabledA3+0C4h*4],FxOpdC4A3 - mov dword [FxTabledA3+0C5h*4],FxOpdC5A3 - mov dword [FxTabledA3+0C6h*4],FxOpdC6A3 - mov dword [FxTabledA3+0C7h*4],FxOpdC7A3 - mov dword [FxTabledA3+0C8h*4],FxOpdC8A3 - mov dword [FxTabledA3+0C9h*4],FxOpdC9A3 - mov dword [FxTabledA3+0CAh*4],FxOpdCAA3 - mov dword [FxTabledA3+0CBh*4],FxOpdCBA3 - mov dword [FxTabledA3+0CCh*4],FxOpdCCA3 - mov dword [FxTabledA3+0CDh*4],FxOpdCDA3 - mov dword [FxTabledA3+0CEh*4],FxOpdCEA3 - mov dword [FxTabledA3+0CFh*4],FxOpdCFA3 - - mov dword [FxTabledA3+0D0h*4],FxOpdD0 - mov dword [FxTabledA3+0D1h*4],FxOpdD1 - mov dword [FxTabledA3+0D2h*4],FxOpdD2 - mov dword [FxTabledA3+0D3h*4],FxOpdD3 - mov dword [FxTabledA3+0D4h*4],FxOpdD4 - mov dword [FxTabledA3+0D5h*4],FxOpdD5 - mov dword [FxTabledA3+0D6h*4],FxOpdD6 - mov dword [FxTabledA3+0D7h*4],FxOpdD7 - mov dword [FxTabledA3+0D8h*4],FxOpdD8 - mov dword [FxTabledA3+0D9h*4],FxOpdD9 - mov dword [FxTabledA3+0DAh*4],FxOpdDA - mov dword [FxTabledA3+0DBh*4],FxOpdDB - mov dword [FxTabledA3+0DCh*4],FxOpdDC - mov dword [FxTabledA3+0DDh*4],FxOpdDD - mov dword [FxTabledA3+0DEh*4],FxOpdDE - mov dword [FxTabledA3+0DFh*4],FxOpdDFA3 - - mov dword [FxTabledA3+0E0h*4],FxOpdE0 - mov dword [FxTabledA3+0E1h*4],FxOpdE1 - mov dword [FxTabledA3+0E2h*4],FxOpdE2 - mov dword [FxTabledA3+0E3h*4],FxOpdE3 - mov dword [FxTabledA3+0E4h*4],FxOpdE4 - mov dword [FxTabledA3+0E5h*4],FxOpdE5 - mov dword [FxTabledA3+0E6h*4],FxOpdE6 - mov dword [FxTabledA3+0E7h*4],FxOpdE7 - mov dword [FxTabledA3+0E8h*4],FxOpdE8 - mov dword [FxTabledA3+0E9h*4],FxOpdE9 - mov dword [FxTabledA3+0EAh*4],FxOpdEA - mov dword [FxTabledA3+0EBh*4],FxOpdEB - mov dword [FxTabledA3+0ECh*4],FxOpdEC - mov dword [FxTabledA3+0EDh*4],FxOpdED - mov dword [FxTabledA3+0EEh*4],FxOpdEE - mov dword [FxTabledA3+0EFh*4],FxOpdEFA3 - - mov dword [FxTabledA3+0F0h*4],FxOpdF0 - mov dword [FxTabledA3+0F1h*4],FxOpdF1 - mov dword [FxTabledA3+0F2h*4],FxOpdF2 - mov dword [FxTabledA3+0F3h*4],FxOpdF3 - mov dword [FxTabledA3+0F4h*4],FxOpdF4 - mov dword [FxTabledA3+0F5h*4],FxOpdF5 - mov dword [FxTabledA3+0F6h*4],FxOpdF6 - mov dword [FxTabledA3+0F7h*4],FxOpdF7 - mov dword [FxTabledA3+0F8h*4],FxOpdF8 - mov dword [FxTabledA3+0F9h*4],FxOpdF9 - mov dword [FxTabledA3+0FAh*4],FxOpdFA - mov dword [FxTabledA3+0FBh*4],FxOpdFB - mov dword [FxTabledA3+0FCh*4],FxOpdFC - mov dword [FxTabledA3+0FDh*4],FxOpdFD - mov dword [FxTabledA3+0FEh*4],FxOpdFE - mov dword [FxTabledA3+0FFh*4],FxOpdFF - ret - -; normal -SECTION .data -NEWSYM sfxnametab - db 'STOP NOP CACHE LSR ' - db 'ROL BRA BLT BGE ' - db 'BNE BEQ BPL BMI ' - db 'BCC BCS BVC BVS ' - - db 'TO R0 TO R1 TO R2 TO R3 ' ; MOVE when B=1 - db 'TO R4 TO R5 TO R6 TO R7 ' - db 'TO R8 TO R9 TO R10 TO R11 ' - db 'TO R12 TO R13 TO R14 TO R15 ' - - db 'WITH R0 WITH R1 WITH R2 WITH R3 ' - db 'WITH R4 WITH R5 WITH R6 WITH R7 ' - db 'WITH R8 WITH R9 WITH R10WITH R11' - db 'WITH R12WITH R13WITH R14WITH R15' - - db 'STW(R0) STW(R1) STW(R2) STW(R3) ' - db 'STW(R4) STW(R5) STW(R6) STW(R7) ' - db 'STW(R8) STW(R9) STW(R10)STW(R11)' - db 'LOOP ALT1 ALT2 ALT3 ' - - db 'LDW(R0) LDW(R1) LDW(R2) LDW(R3) ' - db 'LDW(R4) LDW(R5) LDW(R6) LDW(R7) ' - db 'LDW(R8) LDW(R9) LDW(R10)LDW(R11)' - db 'PLOT SWAP COLOR NOT ' - - db 'ADD R0 ADD R1 ADD R2 ADD R3 ' - db 'ADD R4 ADD R5 ADD R6 ADD R7 ' - db 'ADD R8 ADD R9 ADD R10 ADD R11 ' - db 'ADD R12 ADD R13 ADD R14 ADD R15 ' - - db 'SUB R0 SUB R1 SUB R2 SUB R3 ' - db 'SUB R4 SUB R5 SUB R6 SUB R7 ' - db 'SUB R8 SUB R9 SUB R10 SUB R11 ' - db 'SUB R12 SUB R13 SUB R14 SUB R15 ' - - db 'MERGE AND R1 AND R2 AND R3 ' - db 'AND R4 AND R5 AND R6 AND R7 ' - db 'AND R8 AND R9 AND R10 AND R11 ' - db 'AND R12 AND R13 AND R14 AND R15 ' - - db 'MULT R0 MULT R1 MULT R2 MULT R3 ' - db 'MULT R4 MULT R5 MULT R6 MULT R7 ' - db 'MULT R8 MULT R9 MULT R10MULT R11' - db 'MULT R12MULT R13MULT R14MULT R15' - - db 'SBK LINK #$1LINK #$2LINK #$3' - db 'LINK #$4SEX ASR ROR ' - db 'JMP R8 JMP R9 JMP R10 JMP R11 ' - db 'JMP R12 JMP R13 LOB FMULT ' - - db 'IBT R0 IBT R1 IBT R2 IBT R3 ' - db 'IBT R4 IBT R5 IBT R6 IBT R7 ' - db 'IBT R8 IBT R9 IBT R10 IBT R11 ' - db 'IBT R12 IBT R13 IBT R14 IBT R15 ' - - db 'FROM R0 FROM R1 FROM R2 FROM R3 ' ; MOVES if B=1 - db 'FROM R4 FROM R5 FROM R6 FROM R7 ' - db 'FROM R8 FROM R9 FROM R10FROM R11' - db 'FROM R12FROM R13FROM R14FROM R15' - - db 'HIB OR R1 OR R2 OR R3 ' - db 'OR R4 OR R5 OR R6 OR R7 ' - db 'OR R8 OR R9 OR R10 OR R11 ' - db 'OR R12 OR R13 OR R14 OR R15 ' - - db 'INC R0 INC R1 INC R2 INC R3 ' - db 'INC R4 INC R5 INC R6 INC R7 ' - db 'INC R8 INC R9 INC R10 INC R11 ' - db 'INC R12 INC R13 INC R14 GETC ' - - db 'DEC R0 DEC R1 DEC R2 DEC R3 ' - db 'DEC R4 DEC R5 DEC R6 DEC R7 ' - db 'DEC R8 DEC R9 DEC R10 DEC R11 ' - db 'DEC R12 DEC R13 DEC R14 GETB ' - - db 'IWT R0 IWT R1 IWT R2 IWT R3 ' - db 'IWT R4 IWT R5 IWT R6 IWT R7 ' - db 'IWT R8 IWT R9 IWT R10 IWT R11 ' - db 'IWT R12 IWT R13 IWT R14 IWT R15 ' - -;A1 - db 'STOP NOP CACHE LSR ' - db 'ROL BRA BLT BGE ' - db 'BNE BEQ BPL BMI ' - db 'BCC BCS BVC BVS ' - - db 'TO R0 TO R1 TO R2 TO R3 ' ; MOVE when B=1 - db 'TO R4 TO R5 TO R6 TO R7 ' - db 'TO R8 TO R9 TO R10 TO R11 ' - db 'TO R12 TO R13 TO R14 TO R15 ' - - db 'WITH R0 WITH R1 WITH R2 WITH R3 ' - db 'WITH R4 WITH R5 WITH R6 WITH R7 ' - db 'WITH R8 WITH R9 WITH R10WITH R11' - db 'WITH R12WITH R13WITH R14WITH R15' - - db 'STB(R0) STB(R1) STB(R2) STB(R3) ' - db 'STB(R4) STB(R5) STB(R6) STB(R7) ' - db 'STB(R8) STB(R9) STB(R10)STB(R11)' - db 'LOOP ALT1 ALT2 ALT3 ' - - db 'LDB(R0) LDB(R1) LDB(R2) LDB(R3) ' - db 'LDB(R4) LDB(R5) LDB(R6) LDB(R7) ' - db 'LDB(R8) LDB(R9) LDB(R10)LDB(R11)' - db 'PLOT SWAP CMODE NOT ' - - db 'ADC R0 ADC R1 ADC R2 ADC R3 ' - db 'ADC R4 ADC R5 ADC R6 ADC R7 ' - db 'ADC R8 ADC R9 ADC R10 ADC R11 ' - db 'ADC R12 ADC R13 ADC R14 ADC R15 ' - - db 'SBC R0 SBC R1 SBC R2 SBC R3 ' - db 'SBC R4 SBC R5 SBC R6 SBC R7 ' - db 'SBC R8 SBC R9 SBC R10 SBC R11 ' - db 'SBC R12 SBC R13 SBC R14 SBC R15 ' - - db 'MERGE BIC R1 BIC R2 BIC R3 ' - db 'BIC R4 BIC R5 BIC R6 BIC R7 ' - db 'BIC R8 BIC R9 BIC R10 BIC R11 ' - db 'BIC R12 BIC R13 BIC R14 BIC R15 ' - - db 'UMULTR0 UMULTR1 UMULTR2 UMULTR3 ' - db 'UMULTR4 UMULTR5 UMULTR6 UMULTR7 ' - db 'UMULTR8 UMULTR9 UMULTR10UMULTR11' - db 'UMULTR12UMULTR13UMULTR14UMULTR15' - - db 'SBK LINK #$1LINK #$2LINK #$3' - db 'LINK #$4SEX DIV2 ROR ' - db 'LJMP R8 LJMP R9 LJMP R10LJMP R11' - db 'LJMP R12LJMP R13LOB LMULT ' - - db 'LMS R0 LMS R1 LMS R2 LMS R3 ' - db 'LMS R4 LMS R5 LMS R6 LMS R7 ' - db 'LMS R8 LMS R9 LMS R10 LMS R11 ' - db 'LMS R12 LMS R13 LMS R14 LMS R15 ' - - db 'FROM R0 FROM R1 FROM R2 FROM R3 ' ; MOVES if B=1 - db 'FROM R4 FROM R5 FROM R6 FROM R7 ' - db 'FROM R8 FROM R9 FROM R10FROM R11' - db 'FROM R12FROM R13FROM R14FROM R15' - - db 'HIB XOR R1 XOR R2 XOR R3 ' - db 'XOR R4 XOR R5 XOR R6 XOR R7 ' - db 'XOR R8 XOR R9 XOR R10 XOR R11 ' - db 'XOR R12 XOR R13 XOR R14 XOR R15 ' - - db 'INC R0 INC R1 INC R2 INC R3 ' - db 'INC R4 INC R5 INC R6 INC R7 ' - db 'INC R8 INC R9 INC R10 INC R11 ' - db 'INC R12 INC R13 INC R14 GETC ' - - db 'DEC R0 DEC R1 DEC R2 DEC R3 ' - db 'DEC R4 DEC R5 DEC R6 DEC R7 ' - db 'DEC R8 DEC R9 DEC R10 DEC R11 ' - db 'DEC R12 DEC R13 DEC R14 GETBH ' - - db 'LM R0 LM R1 LM R2 LM R3 ' - db 'LM R4 LM R5 LM R6 LM R7 ' - db 'LM R8 LM R9 LM R10 LM R11 ' - db 'LM R12 LM R13 LM R14 LM R15 ' -;A2 - db 'STOP NOP CACHE LSR ' - db 'ROL BRA BLT BGE ' - db 'BNE BEQ BPL BMI ' - db 'BCC BCS BVC BVS ' - - db 'TO R0 TO R1 TO R2 TO R3 ' ; MOVE when B=1 - db 'TO R4 TO R5 TO R6 TO R7 ' - db 'TO R8 TO R9 TO R10 TO R11 ' - db 'TO R12 TO R13 TO R14 TO R15 ' - - db 'WITH R0 WITH R1 WITH R2 WITH R3 ' - db 'WITH R4 WITH R5 WITH R6 WITH R7 ' - db 'WITH R8 WITH R9 WITH R10WITH R11' - db 'WITH R12WITH R13WITH R14WITH R15' - - db 'STW(R0) STW(R1) STW(R2) STW(R3) ' - db 'STW(R4) STW(R5) STW(R6) STW(R7) ' - db 'STW(R8) STW(R9) STW(R10)STW(R11)' - db 'LOOP ALT1 ALT2 ALT3 ' - - db 'LDW(R0) LDW(R1) LDW(R2) LDW(R3) ' - db 'LDW(R4) LDW(R5) LDW(R6) LDW(R7) ' - db 'LDW(R8) LDW(R9) LDW(R10)LDW(R11)' - db 'PLOT SWAP COLOR NOT ' - - db 'ADD #$0 ADD #$1 ADD #$2 ADD #$3 ' - db 'ADD #$4 ADD #$5 ADD #$6 ADD #$7 ' - db 'ADD #$8 ADD #$9 ADD #$A ADD #$B ' - db 'ADD #$C ADD #$D ADD #$E ADD #$F ' - - db 'SUB #$0 SUB #$1 SUB #$2 SUB #$3 ' - db 'SUB #$4 SUB #$5 SUB #$6 SUB #$7 ' - db 'SUB #$8 SUB #$9 SUB #$A SUB #$B ' - db 'SUB #$C SUB #$D SUB #$E SUB #$F ' - - db 'MERGE AND #$1 AND #$2 AND #$3 ' - db 'AND #$4 AND #$5 AND #$6 AND #$7 ' - db 'AND #$8 AND #$9 AND #$A AND #$B ' - db 'AND #$C AND #$D AND #$E AND #$F ' - - db 'MULTIR0 MULTIR1 MULTIR2 MULTIR3 ' - db 'MULTIR4 MULTIR5 MULTIR6 MULTIR7 ' - db 'MULTIR8 MULTIR9 MULTIR10MULTIR11' - db 'MULTIR12MULTIR13MULTIR14MULTIR15' - - db 'SBK LINK #$1LINK #$2LINK #$3' - db 'LINK #$4SEX ASR ROR ' - db 'JMP R8 JMP R9 JMP R10 JMP R11 ' - db 'JMP R12 JMP R13 LOB FMULT ' - - db 'SMS R0 SMS R1 SMS R2 SMS R3 ' - db 'SMS R4 SMS R5 SMS R6 SMS R7 ' - db 'SMS R8 SMS R9 SMS R10 SMS R11 ' - db 'SMS R12 SMS R13 SMS R14 SMS R15 ' - - db 'FROM R0 FROM R1 FROM R2 FROM R3 ' ; MOVES if B=1 - db 'FROM R4 FROM R5 FROM R6 FROM R7 ' - db 'FROM R8 FROM R9 FROM R10FROM R11' - db 'FROM R12FROM R13FROM R14FROM R15' - - db 'HIB OR #$1 OR #$2 OR #$3 ' - db 'OR #$4 OR #$5 OR #$6 OR #$7 ' - db 'OR #$8 OR #$9 OR #$A OR #$B ' - db 'OR #$C OR #$D OR #$E OR #$F ' - - db 'INC R0 INC R1 INC R2 INC R3 ' - db 'INC R4 INC R5 INC R6 INC R7 ' - db 'INC R8 INC R9 INC R10 INC R11 ' - db 'INC R12 INC R13 INC R14 RAMB ' - - db 'DEC R0 DEC R1 DEC R2 DEC R3 ' - db 'DEC R4 DEC R5 DEC R6 DEC R7 ' - db 'DEC R8 DEC R9 DEC R10 DEC R11 ' - db 'DEC R12 DEC R13 DEC R14 GETBL ' - - db 'SM R0 SM R1 SM R2 SM R3 ' - db 'SM R4 SM R5 SM R6 SM R7 ' - db 'SM R8 SM R9 SM R10 SM R11 ' - db 'SM R12 SM R13 SM R14 SM R15 ' -;A3 - db 'STOP NOP CACHE LSR ' - db 'ROL BRA BLT BGE ' - db 'BNE BEQ BPL BMI ' - db 'BCC BCS BVC BVS ' - - db 'TO R0 TO R1 TO R2 TO R3 ' ; MOVE when B=1 - db 'TO R4 TO R5 TO R6 TO R7 ' - db 'TO R8 TO R9 TO R10 TO R11 ' - db 'TO R12 TO R13 TO R14 TO R15 ' - - db 'WITH R0 WITH R1 WITH R2 WITH R3 ' - db 'WITH R4 WITH R5 WITH R6 WITH R7 ' - db 'WITH R8 WITH R9 WITH R10WITH R11' - db 'WITH R12WITH R13WITH R14WITH R15' - - db 'STW(R0) STW(R1) STW(R2) STW(R3) ' - db 'STW(R4) STW(R5) STW(R6) STW(R7) ' - db 'STW(R8) STW(R9) STW(R10)STW(R11)' - db 'LOOP ALT1 ALT2 ALT3 ' - - db 'LDW(R0) LDW(R1) LDW(R2) LDW(R3) ' - db 'LDW(R4) LDW(R5) LDW(R6) LDW(R7) ' - db 'LDW(R8) LDW(R9) LDW(R10)LDW(R11)' - db 'PLOT SWAP COLOR NOT ' - - db 'ADC #$0 ADC #$1 ADC #$2 ADC #$3 ' - db 'ADC #$4 ADC #$5 ADC #$6 ADC #$7 ' - db 'ADC #$8 ADC #$9 ADC #$A ADC #$B ' - db 'ADC #$C ADC #$D ADC #$E ADC #$F ' - - db 'CMP R0 CMP R1 CMP R2 CMP R3 ' - db 'CMP R4 CMP R5 CMP R6 CMP R7 ' - db 'CMP R8 CMP R9 CMP R10 CMP R11 ' - db 'CMP R12 CMP R13 CMP R14 CMP R15 ' - - db 'MERGE BIC #$1 BIC #$2 BIC #$3 ' - db 'BIC #$4 BIC #$5 BIC #$6 BIC #$7 ' - db 'BIC #$8 BIC #$9 BIC #$A BIC #$B ' - db 'BIC #$C BIC #$D BIC #$E BIC #$F ' - - db 'UMULIR0 UMULIR1 UMULIR2 UMULIR3 ' - db 'UMULIR4 UMULIR5 UMULIR6 UMULIR7 ' - db 'UMULIR8 UMULIR9 UMULIR10UMULIR11' - db 'UMULIR12UMULIR13UMULIR14UMULIR15' - - db 'SBK LINK #$1LINK #$2LINK #$3' - db 'LINK #$4SEX ASR ROR ' - db 'JMP R8 JMP R9 JMP R10 JMP R11 ' - db 'JMP R12 JMP R13 LOB FMULT ' - - db 'IBT R0 IBT R1 IBT R2 IBT R3 ' - db 'IBT R4 IBT R5 IBT R6 IBT R7 ' - db 'IBT R8 IBT R9 IBT R10 IBT R11 ' - db 'IBT R12 IBT R13 IBT R14 IBT R15 ' - - db 'FROM R0 FROM R1 FROM R2 FROM R3 ' ; MOVES if B=1 - db 'FROM R4 FROM R5 FROM R6 FROM R7 ' - db 'FROM R8 FROM R9 FROM R10FROM R11' - db 'FROM R12FROM R13FROM R14FROM R15' - - db 'HIB XOR #$1 XOR #$2 XOR #$3 ' - db 'XOR #$4 XOR #$5 XOR #$6 XOR #$7 ' - db 'XOR #$8 XOR #$9 XOR #$A XOR #$B ' - db 'XOR #$C XOR #$D XOR #$E XOR #$F ' - - db 'INC R0 INC R1 INC R2 INC R3 ' - db 'INC R4 INC R5 INC R6 INC R7 ' - db 'INC R8 INC R9 INC R10 INC R11 ' - db 'INC R12 INC R13 INC R14 ROMB ' - - db 'DEC R0 DEC R1 DEC R2 DEC R3 ' - db 'DEC R4 DEC R5 DEC R6 DEC R7 ' - db 'DEC R8 DEC R9 DEC R10 DEC R11 ' - db 'DEC R12 DEC R13 DEC R14 GETBS ' - - db 'IWT R0 IWT R1 IWT R2 IWT R3 ' - db 'IWT R4 IWT R5 IWT R6 IWT R7 ' - db 'IWT R8 IWT R9 IWT R10 IWT R11 ' - db 'IWT R12 IWT R13 IWT R14 IWT R15 ' - -SECTION .text -NEWSYM FxTableAsmEnd diff --git a/i386/macros.mac b/i386/macros.mac deleted file mode 100644 index 5866f0b6..00000000 --- a/i386/macros.mac +++ /dev/null @@ -1,80 +0,0 @@ -;Copyright (C) 1997-2006 ZSNES Team ( zsKnight, _Demo_, pagefault, Nach ) -; -;http://www.zsnes.com -;http://sourceforge.net/projects/zsnes -; -;This program is free software; you can redistribute it and/or -;modify it under the terms of the GNU General Public License -;version 2 as published by the Free Software Foundation. -; -;This program is distributed in the hope that it will be useful, -;but WITHOUT ANY WARRANTY; without even the implied warranty of -;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;GNU General Public License for more details. -; -;You should have received a copy of the GNU General Public License -;along with this program; if not, write to the Free Software -;Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - - -%ifidn __OUTPUT_FORMAT__,elf -section .note.GNU-stack noalloc noexec nowrite progbits -%endif - -%ifdef __AMD64__ -bits 64 -%else -bits 32 -%endif - -section .text -; Zsnes required macros - -%define ZVERSION 'Pre 1.43' - - -%ifdef MACHO -section .text align=16 -section .data align=4 -section .bss align=4 -%endif - -%ifdef ELF - -%imacro newsym 1 - GLOBAL %1 - %1: -%endmacro -%imacro newsym 2+ - GLOBAL %1 - %1: %2 -%endmacro -%define EXTSYM EXTERN - -%else - -%imacro newsym 1 - GLOBAL _%1 - _%1: - %1: -%endmacro -%imacro newsym 2+ - GLOBAL _%1 - _%1: - %1: %2 -%endmacro -%imacro EXTSYM 1-* -%rep %0 - EXTERN _%1 - %define %1 _%1 -%rotate 1 -%endrep -%endmacro -%endif - -%macro ALIGN32 0 - times ($$-$) & 1Fh nop ; Long word alignment -%endmacro -%macro ALIGN16 0 - times ($$-$) & 1Fh nop ; Long word alignment -%endmacro diff --git a/i386/regs.mac b/i386/regs.mac deleted file mode 100644 index cb8d312b..00000000 --- a/i386/regs.mac +++ /dev/null @@ -1,101 +0,0 @@ -; Snes9x - Portable Super Nintendo Entertainment System (TM) emulator. -; -; Super FX assembler emulator code -; (c) Copyright 1998, 1999 zsKnight and _Demo_. -; -; Permission to use, copy, modify and distribute Snes9x in both binary and -; source form, for non-commercial purposes, is hereby granted without fee, -; providing that this license information and copyright notice appear with -; all copies and any derived work. -; -; This software is provided 'as-is', without any express or implied -; warranty. In no event shall the authors be held liable for any damages -; arising from the use of this software. -; -; Snes9x is freeware for PERSONAL USE only. Commercial users should -; seek permission of the copyright holders first. Commercial use includes -; charging money for Snes9x or software derived from Snes9x. -; -; The copyright holders request that bug fixes and improvements to the code -; should be forwarded to them so everyone can benefit from the modifications -; in future versions. -; -; Super NES and Super Nintendo Entertainment System are trademarks of -; Nintendo Co., Limited and its subsidiary companies. -; -;******************************************************* -; InitReg Initializes Registers -;******************************************************* - -%macro setreg 2 - mov edi,%1 - add edi,[regptr] - mov eax,%2 - mov [edi],eax -%endmacro - -;******************************************************* -; Registers Note : Remember to restore AH, ECX, & DX -;******************************************************* - -%macro checkmultchange 0 - ; execute multiplication - cmp byte[multchange],0 - je .nomult - push edx - push eax - xor bh,bh - mov bl,[mode7B+1] - mov ax,[mode7A] - test bl,80h - jz .noneg - mov bh,0FFh -.noneg - imul bx - mov [compmult],ax - mov [compmult+2],dl - pop eax - pop edx - mov byte[multchange],0 -.nomult -%endmacro - -%macro mouse4016doxA 2 - cmp byte[JoyAPos],%1 - jne .nx7 - mov bx,[mousexpos] - shr bx,%2 - and bx,1 - mov al,bl -.nx7 -%endmacro - -%macro mouse4016doyA 2 - cmp byte[JoyAPos],%1 - jne .ny7 - mov bx,[mouseypos] - shr bx,%2 - and bx,1 - mov al,bl -.ny7 -%endmacro - -%macro mouse4017dox 2 - cmp byte[JoyBPos],%1 - jne .nx7 - mov bx,[mousexpos] - shr bx,%2 - and bx,1 - mov al,bl -.nx7 -%endmacro - -%macro mouse4017doy 2 - cmp byte[JoyBPos],%1 - jne .ny7 - mov bx,[mouseypos] - shr bx,%2 - and bx,1 - mov al,bl -.ny7 -%endmacro diff --git a/i386/regsw.mac b/i386/regsw.mac deleted file mode 100644 index a95d47a2..00000000 --- a/i386/regsw.mac +++ /dev/null @@ -1,51 +0,0 @@ -; Snes9x - Portable Super Nintendo Entertainment System (TM) emulator. -; -; Super FX assembler emulator code -; (c) Copyright 1998, 1999 zsKnight and _Demo_. -; -; Permission to use, copy, modify and distribute Snes9x in both binary and -; source form, for non-commercial purposes, is hereby granted without fee, -; providing that this license information and copyright notice appear with -; all copies and any derived work. -; -; This software is provided 'as-is', without any express or implied -; warranty. In no event shall the authors be held liable for any damages -; arising from the use of this software. -; -; Snes9x is freeware for PERSONAL USE only. Commercial users should -; seek permission of the copyright holders first. Commercial use includes -; charging money for Snes9x or software derived from Snes9x. -; -; The copyright holders request that bug fixes and improvements to the code -; should be forwarded to them so everyone can benefit from the modifications -; in future versions. -; -; Super NES and Super Nintendo Entertainment System are trademarks of -; Nintendo Co., Limited and its subsidiary companies. -; -;******************************************************* -; InitRegW Initializes Write Registers -;******************************************************* - -%macro reenablespc 0 - cmp dword[cycpbl],1000000h - jb %%enspc - mov dword[cycpbl],0 - test byte[curexecstate],02h - jnz %%enspc - or byte[curexecstate],02h - push ebx - xor ebx,ebx - mov bl,dl - EXTSYM tableadc - mov edi,[tableadc+ebx*4] - pop ebx -%%enspc -%endmacro - -%macro setregw 2 - mov edi,%1 - add edi,[regptw] - mov eax,%2 - mov [edi],eax -%endmacro diff --git a/i386/sfxproc.asm b/i386/sfxproc.asm deleted file mode 100644 index 4b6a5c2c..00000000 --- a/i386/sfxproc.asm +++ /dev/null @@ -1,678 +0,0 @@ -;Copyright (C) 1997-2001 ZSNES Team ( zsknight@zsnes.com / _demo_@zsnes.com ) -; -;This program is free software; you can redistribute it and/or -;modify it under the terms of the GNU General Public License -;as published by the Free Software Foundation; either -;version 2 of the License, or (at your option) any later -;version. -; -;This program is distributed in the hope that it will be useful, -;but WITHOUT ANY WARRANTY; without even the implied warranty of -;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;GNU General Public License for more details. -; -;You should have received a copy of the GNU General Public License -;along with this program; if not, write to the Free Software -;Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - -%include "macros.mac" - -EXTSYM NumberOfOpcodes,SfxB,SfxBRAMR,SfxCBR,SfxCFGR,SfxCLSR,SfxCPB,SfxCROM -EXTSYM SfxCarry,SfxMemTable,SfxOverflow,SfxPBR,SfxPIPE,SfxR0,SfxR1,SfxR10 -EXTSYM SfxR11,SfxR12,SfxR13,SfxR14,SfxR15,SfxR2,SfxR3,SfxR4,SfxR5,SfxR6 -EXTSYM SfxR7,SfxR8,SfxR9,SfxRAMBR,SfxRAMMem,SfxROMBR,SfxSCBR,SfxSCMR,SfxSFR -EXTSYM SfxSignZero,SfxnRamBanks,StartSFX,regptr,regptw,sfxramdata -EXTSYM SfxPOR,sfxclineloc,UpdatePORSCMR,UpdateCLSR,UpdateSCBRCOLR,SfxAC -EXTSYM sfx128lineloc,sfx160lineloc,sfx192lineloc,sfxobjlineloc - -NEWSYM SfxProcAsmStart - -%include "regs.mac" -%include "regsw.mac" - - - - - - -%macro AssembleSFXFlags 0 - and word[SfxSFR],8F60h - test byte[SfxCarry],1 - jz .nosfxcarry - or word[SfxSFR],04h -.nosfxcarry - cmp word[SfxSignZero],0 - jne .nozero - or word[SfxSFR],02h -.nozero - test word[SfxSignZero],8000h - jz .noneg - or word[SfxSFR],08h -.noneg - cmp byte[SfxOverflow],0 - je .noof - or word[SfxSFR],10h -.noof - cmp byte[SfxB],0 - je .bzero - or word[SfxSFR],1000h -.bzero -%endmacro - - -NEWSYM initsfxregsr - setreg 3000h*4,reg3000r - setreg 3001h*4,reg3001r - setreg 3002h*4,reg3002r - setreg 3003h*4,reg3003r - setreg 3004h*4,reg3004r - setreg 3005h*4,reg3005r - setreg 3006h*4,reg3006r - setreg 3007h*4,reg3007r - setreg 3008h*4,reg3008r - setreg 3009h*4,reg3009r - setreg 300Ah*4,reg300Ar - setreg 300Bh*4,reg300Br - setreg 300Ch*4,reg300Cr - setreg 300Dh*4,reg300Dr - setreg 300Eh*4,reg300Er - setreg 300Fh*4,reg300Fr - setreg 3010h*4,reg3010r - setreg 3011h*4,reg3011r - setreg 3012h*4,reg3012r - setreg 3013h*4,reg3013r - setreg 3014h*4,reg3014r - setreg 3015h*4,reg3015r - setreg 3016h*4,reg3016r - setreg 3017h*4,reg3017r - setreg 3018h*4,reg3018r - setreg 3019h*4,reg3019r - setreg 301Ah*4,reg301Ar - setreg 301Bh*4,reg301Br - setreg 301Ch*4,reg301Cr - setreg 301Dh*4,reg301Dr - setreg 301Eh*4,reg301Er - setreg 301Fh*4,reg301Fr - setreg 3030h*4,reg3030r - setreg 3031h*4,reg3031r - setreg 3032h*4,reg3032r - setreg 3033h*4,reg3033r - setreg 3034h*4,reg3034r - setreg 3035h*4,reg3035r - setreg 3036h*4,reg3036r - setreg 3037h*4,reg3037r - setreg 3038h*4,reg3038r - setreg 3039h*4,reg3039r - setreg 303Ah*4,reg303Ar - setreg 303Bh*4,reg303Br - setreg 303Ch*4,reg303Cr - setreg 303Dh*4,reg303Dr - setreg 303Eh*4,reg303Er - setreg 303Fh*4,reg303Fr - ; set 3100-31FF to cacheregr - mov edi,3100h*4 - add edi,[regptr] - mov eax,cacheregr - mov ecx,200h -.loop - mov [edi],eax - add edi,4 - dec ecx - jnz .loop - ret - -NEWSYM initsfxregsw - setregw 3000h*4,reg3000w - setregw 3001h*4,reg3001w - setregw 3002h*4,reg3002w - setregw 3003h*4,reg3003w - setregw 3004h*4,reg3004w - setregw 3005h*4,reg3005w - setregw 3006h*4,reg3006w - setregw 3007h*4,reg3007w - setregw 3008h*4,reg3008w - setregw 3009h*4,reg3009w - setregw 300Ah*4,reg300Aw - setregw 300Bh*4,reg300Bw - setregw 300Ch*4,reg300Cw - setregw 300Dh*4,reg300Dw - setregw 300Eh*4,reg300Ew - setregw 300Fh*4,reg300Fw - setregw 3010h*4,reg3010w - setregw 3011h*4,reg3011w - setregw 3012h*4,reg3012w - setregw 3013h*4,reg3013w - setregw 3014h*4,reg3014w - setregw 3015h*4,reg3015w - setregw 3016h*4,reg3016w - setregw 3017h*4,reg3017w - setregw 3018h*4,reg3018w - setregw 3019h*4,reg3019w - setregw 301Ah*4,reg301Aw - setregw 301Bh*4,reg301Bw - setregw 301Ch*4,reg301Cw - setregw 301Dh*4,reg301Dw - setregw 301Eh*4,reg301Ew - setregw 301Fh*4,reg301Fw - setregw 3030h*4,reg3030w - setregw 3031h*4,reg3031w - setregw 3032h*4,reg3032w - setregw 3033h*4,reg3033w - setregw 3034h*4,reg3034w - setregw 3035h*4,reg3035w - setregw 3036h*4,reg3036w - setregw 3037h*4,reg3037w - setregw 3038h*4,reg3038w - setregw 3039h*4,reg3039w - setregw 303Ah*4,reg303Aw - setregw 303Bh*4,reg303Bw - setregw 303Ch*4,reg303Cw - setregw 303Dh*4,reg303Dw - setregw 303Eh*4,reg303Ew - setregw 303Fh*4,reg303Fw - ; set 3100-31FF to cacheregw - mov edi,3100h*4 - add edi,[regptw] - mov eax,cacheregw - mov ecx,200h -.loop - mov [edi],eax - add edi,4 - dec ecx - jnz .loop - ret - -NEWSYM cacheregr - or byte[cachewarning],1 - ret - -NEWSYM cacheregw - or byte[cachewarning],2 - ret - -SECTION .bss -NEWSYM cachewarning, resb 1 -NEWSYM SFXProc, resd 1 -NEWSYM ChangeOps, resd 1 - -SECTION .text - -; SFX Registers - -NEWSYM reg3000r - mov al,[SfxR0] - ret -NEWSYM reg3001r - mov al,[SfxR0+1] - ret -NEWSYM reg3002r - mov al,[SfxR1] - ret -NEWSYM reg3003r - mov al,[SfxR1+1] - ret -NEWSYM reg3004r - mov al,[SfxR2] - ret -NEWSYM reg3005r - mov al,[SfxR2+1] - ret -NEWSYM reg3006r - mov al,[SfxR3] - ret -NEWSYM reg3007r - mov al,[SfxR3+1] - ret -NEWSYM reg3008r - mov al,[SfxR4] - ret -NEWSYM reg3009r - mov al,[SfxR4+1] - ret -NEWSYM reg300Ar - mov al,[SfxR5] - ret -NEWSYM reg300Br - mov al,[SfxR5+1] - ret -NEWSYM reg300Cr - mov al,[SfxR6] - ret -NEWSYM reg300Dr - mov al,[SfxR6+1] - ret -NEWSYM reg300Er - mov al,[SfxR7] - ret -NEWSYM reg300Fr - mov al,[SfxR7+1] - ret -NEWSYM reg3010r - mov al,[SfxR8] - ret -NEWSYM reg3011r - mov al,[SfxR8+1] - ret -NEWSYM reg3012r - mov al,[SfxR9] - ret -NEWSYM reg3013r - mov al,[SfxR9+1] - ret -NEWSYM reg3014r - mov al,[SfxR10] - ret -NEWSYM reg3015r - mov al,[SfxR10+1] - ret -NEWSYM reg3016r - mov al,[SfxR11] - ret -NEWSYM reg3017r - mov al,[SfxR11+1] - ret -NEWSYM reg3018r - mov al,[SfxR12] - ret -NEWSYM reg3019r - mov al,[SfxR12+1] - ret -NEWSYM reg301Ar - mov al,[SfxR13] - ret -NEWSYM reg301Br - mov al,[SfxR13+1] - ret -NEWSYM reg301Cr - mov al,[SfxR14] - ret -NEWSYM reg301Dr - mov al,[SfxR14+1] - ret -NEWSYM reg301Er - mov al,[SfxR15] - ret -NEWSYM reg301Fr - mov al,[SfxR15+1] - ret - -; Other SFX stuff - -NEWSYM reg3030r - AssembleSFXFlags - mov al,[SfxSFR] - ret -NEWSYM reg3031r - cmp byte[SfxAC],1 - je .alwaysclear - cmp dword[ChangeOps],-350*240 - jl .noclear -.alwaysclear - and byte[SfxSFR+1],07fh ; clear IRQ flag - jmp .cleared -.noclear - cmp dword[ChangeOps],-350*240*4 - jge .clear - mov dword[ChangeOps],-350*240*4 - jmp .cleared -.clear - add dword[ChangeOps],350*240 -.cleared - mov al,[SfxSFR+1] - ret -SECTION .bss -.test resb 1 -SECTION .text - -NEWSYM reg3032r ; Unused - xor al,al - ret -NEWSYM reg3033r ; BRAMR Backup Ram Read only on/off (bits 1-15 unused) - mov al,[SfxBRAMR] - ret -NEWSYM reg3034r ; PBR (Program Bank) - mov al,[SfxPBR] - ret -NEWSYM reg3035r ; Unused - xor al,al - ret -NEWSYM reg3036r ; ROMBR (Gamepak Rom Bank Register) - mov al,[SfxROMBR] - ret -NEWSYM reg3037r ; CFGR (Control Flags Register) - mov al,[SfxCFGR] - ret -NEWSYM reg3038r ; SCBR (Screen Bank Register) - mov al,[SfxSCBR] - ret -NEWSYM reg3039r ; CLSR (Clock Speed Register) - mov al,[SfxCLSR] - ret -NEWSYM reg303Ar ; SCMR (Screen Mode Register) - mov al,[SfxSCMR] - test byte[SfxPOR],10h - jnz .objmode - mov al,[SfxSCMR] - and al,00100100b ; 4 + 32 - cmp al,4 - je .lines160 - cmp al,32 - je .lines192 - cmp al,36 - je .objmode - mov eax,[sfx128lineloc] - jmp .donelines -.lines160 - mov eax,[sfx160lineloc] - jmp .donelines -.lines192 - mov eax,[sfx192lineloc] - jmp .donelines -.objmode - mov eax,[sfxobjlineloc] -.donelines - mov [sfxclineloc],eax - ret -NEWSYM reg303Br ; VCR (Version Code Register) - mov al,20h - ret -NEWSYM reg303Cr ; RAMBR (Ram bank register) - mov al,[SfxRAMBR] - ret -NEWSYM reg303Dr ; Unused - xor al,al - ret -NEWSYM reg303Er ; CBR (Cache Base Register), lower byte - mov al,[SfxCBR] - ret -NEWSYM reg303Fr ; CBR (Cache Base Register), upper byte - mov al,[SfxCBR+1] - ret - -; SFX Write Registers - -NEWSYM reg3000w - mov [SfxR0],al - ret -NEWSYM reg3001w - mov [SfxR0+1],al - ret -NEWSYM reg3002w - mov [SfxR1],al - ret -NEWSYM reg3003w - mov [SfxR1+1],al - ret -NEWSYM reg3004w - mov [SfxR2],al - ret -NEWSYM reg3005w - mov [SfxR2+1],al - ret -NEWSYM reg3006w - mov [SfxR3],al - ret -NEWSYM reg3007w - mov [SfxR3+1],al - ret -NEWSYM reg3008w - mov [SfxR4],al - ret -NEWSYM reg3009w - mov [SfxR4+1],al - ret -NEWSYM reg300Aw - mov [SfxR5],al - ret -NEWSYM reg300Bw - mov [SfxR5+1],al - ret -NEWSYM reg300Cw - mov [SfxR6],al - ret -NEWSYM reg300Dw - mov [SfxR6+1],al - ret -NEWSYM reg300Ew - mov [SfxR7],al - ret -NEWSYM reg300Fw - mov [SfxR7+1],al - ret -NEWSYM reg3010w - mov [SfxR8],al - ret -NEWSYM reg3011w - mov [SfxR8+1],al - ret -NEWSYM reg3012w - mov [SfxR9],al - ret -NEWSYM reg3013w - mov [SfxR9+1],al - ret -NEWSYM reg3014w - mov [SfxR10],al - ret -NEWSYM reg3015w - mov [SfxR10+1],al - ret -NEWSYM reg3016w - mov [SfxR11],al - ret -NEWSYM reg3017w - mov [SfxR11+1],al - ret -NEWSYM reg3018w - mov [SfxR12],al - ret -NEWSYM reg3019w - mov [SfxR12+1],al - ret -NEWSYM reg301Aw - mov [SfxR13],al - ret -NEWSYM reg301Bw - mov [SfxR13+1],al - ret -NEWSYM reg301Cw - mov [SfxR14],al - ret -NEWSYM reg301Dw - mov [SfxR14+1],al - ret -NEWSYM reg301Ew - mov [SfxR15],al - ret -NEWSYM reg301Fw - mov [SfxR15+1],al - ; start execution - push edx - mov edx,[SfxPBR] - mov edx,[SfxMemTable+edx*4] - add edx,[SfxR15] - mov dl,[edx] - mov [SfxPIPE],dl - pop edx - inc word[SfxR15] - or byte[SfxSFR],20h - or dword [SfxSFR],08000h ; Set IRQ Flag - mov dword[SFXProc],1 -; call StartSFXret - ret - -; Other SFX stuff - -NEWSYM reg3030w - mov [SfxSFR],al -; mov dh,10 - ; Disassemble Flags - test al,20h - jz .noexec - mov dword [NumberOfOpcodes],100 - call StartSFX -.noexec - ret -NEWSYM reg3031w - mov [SfxSFR+1],al - ret -NEWSYM reg3032w ; Unused - ret -NEWSYM reg3033w ; BRAMR Backup Ram Read only on/off (bits 1-15 unused) - and al,0FEh - mov [SfxBRAMR],al - ret -NEWSYM reg3034w ; PBR (Program Bank) - mov [SfxPBR],al - xor ebx,ebx - mov bl,al - mov ebx,[SfxMemTable+ebx*4] - mov [SfxCPB],ebx - ret -NEWSYM reg3035w ; Unused - ret -NEWSYM reg3036w ; ROMBR (Gamepak Rom Bank Register) - mov [SfxROMBR],al - xor ebx,ebx - mov bl,al - mov ebx,[SfxMemTable+ebx*4] - mov [SfxCROM],ebx - ret -NEWSYM reg3037w ; CFGR (Control Flags Register) - mov [SfxCFGR],al - ret -NEWSYM reg3038w ; SCBR (Screen Bank Register) - mov [SfxSCBR],al - call UpdateSCBRCOLR - ret -NEWSYM reg3039w ; CLSR (Clock Speed Register) - and al,0FEh - mov [SfxCLSR],al - call UpdateCLSR - ret -NEWSYM reg303Aw ; SCMR (Screen Mode Register) - mov [SfxSCMR],al - call UpdatePORSCMR - ret -NEWSYM reg303Bw ; VCR (Version Code Register) - ret -NEWSYM reg303Cw ; RAMBR (Ram bank register) - mov bl,[SfxnRamBanks] - dec bl - and al,bl - mov ebx,[SfxnRamBanks] - dec ebx - and eax,ebx - mov [SfxRAMBR],eax - xor ebx,ebx - mov bl,al - shl ebx,16 - add ebx,[sfxramdata] - mov dword [SfxRAMMem],ebx - ret -NEWSYM reg303Dw ; Unused - ret -NEWSYM reg303Ew ; CBR (Cache Base Register), lower byte - mov [SfxCBR],al - ret -NEWSYM reg303Fw ; CBR (Cache Base Register), upper byte - mov [SfxCBR+1],al - ret - -NEWSYM sfxaccessbankr8 - mov ebx,[sfxramdata] - mov al,[ebx+ecx] - xor ebx,ebx - ret - -NEWSYM sfxaccessbankw8 - mov ebx,[sfxramdata] - mov [ebx+ecx],al - xor ebx,ebx - ret - -NEWSYM sfxaccessbankr16 - mov ebx,[sfxramdata] - mov ax,[ebx+ecx] - xor ebx,ebx - ret - -NEWSYM sfxaccessbankw16 - mov ebx,[sfxramdata] - mov [ebx+ecx],ax - xor ebx,ebx - ret - -NEWSYM sfxaccessbankr8b - mov ebx,[sfxramdata] - mov al,[ebx+ecx+65536] - xor ebx,ebx - ret - -NEWSYM sfxaccessbankw8b - mov ebx,[sfxramdata] - mov [ebx+ecx+65536],al - xor ebx,ebx - ret - -NEWSYM sfxaccessbankr16b - mov ebx,[sfxramdata] - mov ax,[ebx+ecx+65536] - xor ebx,ebx - ret - -NEWSYM sfxaccessbankw16b - mov ebx,[sfxramdata] - mov [ebx+ecx+65536],ax - xor ebx,ebx - ret - -NEWSYM sfxaccessbankr8c - mov ebx,[sfxramdata] - mov al,[ebx+ecx+65536*2] - xor ebx,ebx - ret - -NEWSYM sfxaccessbankw8c - mov ebx,[sfxramdata] - mov [ebx+ecx+65536*2],al - xor ebx,ebx - ret - -NEWSYM sfxaccessbankr16c - mov ebx,[sfxramdata] - mov ax,[ebx+ecx+65536*2] - xor ebx,ebx - ret - -NEWSYM sfxaccessbankw16c - mov ebx,[sfxramdata] - mov [ebx+ecx+65536*2],ax - xor ebx,ebx - ret - -NEWSYM sfxaccessbankr8d - mov ebx,[sfxramdata] - mov al,[ebx+ecx+65536*3] - xor ebx,ebx - ret - -NEWSYM sfxaccessbankw8d - mov ebx,[sfxramdata] - mov [ebx+ecx+65536*3],al - xor ebx,ebx - ret - -NEWSYM sfxaccessbankr16d - mov ebx,[sfxramdata] - mov ax,[ebx+ecx+65536*3] - xor ebx,ebx - ret - -NEWSYM sfxaccessbankw16d - mov ebx,[sfxramdata] - mov [ebx+ecx+65536*3],ax - xor ebx,ebx - ret - -NEWSYM SfxProcAsmEnd diff --git a/i386/zsnes.asm b/i386/zsnes.asm deleted file mode 100644 index d1bcd040..00000000 --- a/i386/zsnes.asm +++ /dev/null @@ -1,376 +0,0 @@ -; Snes9x - Portable Super Nintendo Entertainment System (TM) emulator. -; -; Super FX assembler emulator code -; (c) Copyright 1998, 1999 zsKnight and _Demo_. -; -; Permission to use, copy, modify and distribute Snes9x in both binary and -; source form, for non-commercial purposes, is hereby granted without fee, -; providing that this license information and copyright notice appear with -; all copies and any derived work. -; -; This software is provided 'as-is', without any express or implied -; warranty. In no event shall the authors be held liable for any damages -; arising from the use of this software. -; -; Snes9x is freeware for PERSONAL USE only. Commercial users should -; seek permission of the copyright holders first. Commercial use includes -; charging money for Snes9x or software derived from Snes9x. -; -; The copyright holders request that bug fixes and improvements to the code -; should be forwarded to them so everyone can benefit from the modifications -; in future versions. -; -; Super NES and Super Nintendo Entertainment System are trademarks of -; Nintendo Co., Limited and its subsidiary companies. -; -; ZSNES SuperFX emulation code and wrappers -; (C) Copyright 1997-8 zsKnight and _Demo_ - -; Used with the kind permission of the copyright holders. -; - -%include "macros.mac" - -EXTSYM SfxR1,SfxR2,InitFxTables,SfxSFR,SfxSCMR,initsfxregsw,initsfxregsr -EXTSYM SfxPBR,NumberOfOpcodes,SfxCLSR,MainLoop,SfxCROM -EXTSYM SfxRomBuffer,SfxRAMMem,SfxLastRamAdr,SfxR0 -EXTSYM PHnum2writesfxreg, SfxCPB, SfxROMBR, SfxRAMBR, SfxnRamBanks -EXTSYM SfxSignZero - -[BITS 32] -SECTION .data - -NEWSYM flagnz, dd 0 -NEWSYM romdata, dd 0 ; rom data (4MB = 4194304) - -NEWSYM regptr, dd 0 ; pointer to registers -NEWSYM regptw, dd 0 ; pointer to registers -NEWSYM regptra, times 49152 db 0 -NEWSYM regptwa, times 49152 db 0 - -NEWSYM debstop, db 0 -NEWSYM sfxramdata, dd 0 ; SuperFX Ram Data -NEWSYM sfxplottable, dd 0 -NEWSYM FxTable, times 256 dd 0 -NEWSYM FxTableA1, times 256 dd 0 -NEWSYM FxTableA2, times 256 dd 0 -NEWSYM FxTableA3, times 256 dd 0 -NEWSYM FxTableb, times 256 dd 0 -NEWSYM FxTablebA1, times 256 dd 0 -NEWSYM FxTablebA2, times 256 dd 0 -NEWSYM FxTablebA3, times 256 dd 0 -NEWSYM FxTablec, times 256 dd 0 -NEWSYM FxTablecA1, times 256 dd 0 -NEWSYM FxTablecA2, times 256 dd 0 -NEWSYM FxTablecA3, times 256 dd 0 -NEWSYM FxTabled, times 256 dd 0 -NEWSYM FxTabledA1, times 256 dd 0 -NEWSYM FxTabledA2, times 256 dd 0 -NEWSYM FxTabledA3, times 256 dd 0 -NEWSYM SfxMemTable, times 256 dd 0 -NEWSYM fxxand, times 256 dd 0 -NEWSYM fxbit01, times 256 dd 0 -NEWSYM fxbit23, times 256 dd 0 -NEWSYM fxbit45, times 256 dd 0 -NEWSYM fxbit67, times 256 dd 0 -NEWSYM PLOTJmpa, times 64 dd 0 -NEWSYM PLOTJmpb, times 64 dd 0 - -NEWSYM NumberOfOpcodes2, dd 350 -NEWSYM SFXCounter, dd 0 -NEWSYM SfxAC, dd 0 - -;%INCLUDE "fxtable.asm" -;%INCLUDE "sfxproc.asm" -;%INCLUDE "fxemu2.asm" -;%INCLUDE "fxemu2b.asm" -;%INCLUDE "fxemu2c.asm" - -; -; Snes9x wrapper functions for the zsnes SuperFX code -; (C) Copyright 1998 Gary Henderson - -SECTION .data - -EXTSYM SRAM,ROM,RegRAM,SFXPlotTable - -SECTION .text - -NEWSYM StartSFX -NEWSYM StartSFXret - jmp S9xSuperFXExec - -NEWSYM S9xResetSuperFX - push ebx - push esi - push edi - push ebp - - mov dword[SfxR1],0 - mov dword[SfxR2],0 - mov dword[SfxSignZero],1 ; clear z flag - - mov eax,dword[SRAM] - mov dword[sfxramdata],eax - mov eax,dword[ROM] - mov dword[romdata],eax - mov eax,dword[SFXPlotTable] - mov dword[sfxplottable],eax - - call InitFxTables - - mov dword[SfxSFR],0 - mov byte[SfxSCMR],0 - mov dword[regptr],regptra - sub dword[regptr],8000h ; Since register address starts @ 2000h - mov dword[regptw],regptwa - sub dword[regptw],8000h ; Since register address starts @ 2000h - call initsfxregsw - call initsfxregsr - -NEWSYM preparesfx - mov byte[SFXCounter],0 - mov esi,[romdata] - add esi,07FC0h - cmp dword[esi],'FX S' - je .yessfxcounter - cmp dword[esi],'Stun' - jne .nosfxcounter -.yessfxcounter - mov byte[SFXCounter],1 -.nosfxcounter - - ; make table - mov byte[SfxAC],0 - mov eax,[romdata] - cmp dword[eax+02B80h],0AB6CAB6Ch - jne .noac - mov byte[SfxAC],1 -.noac - call UpdateSFX - - pop ebp - pop edi - pop esi - pop ebx - ret - -NEWSYM S9xSuperFXWriteReg - mov eax,dword[esp+4] - mov ecx,dword[esp+8] - push ebx - push esi - push edi - push ebp - test dword[regptwa+ecx*4-8000h], ~0 - jz .skipwrite - call dword[regptwa+ecx*4-8000h] -.skipwrite: - pop ebp - pop edi - pop esi - pop ebx - ret - -NEWSYM S9xSuperFXReadReg - mov ecx,dword[esp+4] - push ebx - push esi - push edi - push ebp - test dword[regptra+ecx*4-8000h], ~0 - jz .skipread - call dword[regptra+ecx*4-8000h] -.skipread: - pop ebp - pop edi - pop esi - pop ebx - and eax, 255 -endfx: - ret - -EXTSYM SCBRrel,SfxSCBR,SfxCOLR,SfxPOR -EXTSYM sfx128lineloc,sfx160lineloc,sfx192lineloc,sfxobjlineloc,sfxclineloc -EXTSYM fxbit01pcal,fxbit23pcal,fxbit45pcal,fxbit67pcal - -NEWSYM S9xSuperFXExec - test byte[SfxSFR],20h - jz endfx - - push ebx - push esi - push edi - push ebp - - xor ebx,ebx - mov bl,[SfxPBR] - mov al,[SfxSCMR] - and bl,7Fh - cmp bl,70h - jae .ram - test al,10h - jz .noaccess - jmp .noram -.ram - test al,08h - jz .noaccess -.noram - mov eax,[NumberOfOpcodes2] - mov [NumberOfOpcodes],eax - call MainLoop -.noaccess - pop ebp - pop edi - pop esi - pop edx - ret - -NEWSYM S9xSuperFXPreSaveState - mov ecx,dword[SfxCROM] - sub dword[SfxRomBuffer],ecx - mov ecx,dword[SfxRAMMem] - sub dword[SfxLastRamAdr],ecx -; Copy num2writesfxreg bytes from SfxR0 to a free area in RegRAM. - push ebx - mov ecx,SfxR0 - mov edx,dword[RegRAM] - add edx,7000h - mov ebx,[PHnum2writesfxreg] -.loop - mov al,[ecx] - mov [edx],al - inc ecx - inc edx - dec ebx - jnz .loop - pop ebx - mov ecx,dword[SfxCROM] - add dword[SfxRomBuffer],ecx - mov ecx,dword[SfxRAMMem] - add dword[SfxLastRamAdr],ecx - ret - -NEWSYM S9xSuperFXPostSaveState - ret - -NEWSYM S9xSuperFXPostLoadState -; Copy num2writesfxreg bytes from a free area in RegRAM to SfxR0 - push ebx - mov ecx,SfxR0 - mov edx,dword[RegRAM] - add edx,7000h - mov ebx,[PHnum2writesfxreg] -.loop - mov al,[edx] - mov [ecx],al - inc ecx - inc edx - dec ebx - jnz .loop - pop ebx - xor ecx,ecx - mov cl,byte[SfxPBR] - mov ecx,dword[SfxMemTable+ecx*4] - mov dword[SfxCPB],ecx - - xor ecx,ecx - mov cl,byte[SfxROMBR] - mov ecx,dword[SfxMemTable+ecx*4] - mov dword[SfxCROM],ecx - - xor ecx,ecx - mov cl,byte[SfxRAMBR] - shl ecx,16 - add ecx,dword[sfxramdata] - mov dword [SfxRAMMem],ecx - - mov ecx,dword[SfxCROM] - add dword[SfxRomBuffer],ecx - mov ecx,dword[SfxRAMMem] - add dword[SfxLastRamAdr],ecx -; Fix for mystery zeroing of SfxnRamBanks, allowing junk RAMBR values to be -; set in turn causing a crash when the code tries to access the junk RAM bank. - mov dword [SfxnRamBanks], 4 - call UpdateSFX - ret - -NEWSYM UpdatePORSCMR - push ebx - push eax - test byte[SfxPOR],10h - jnz .objmode - mov al,[SfxSCMR] - and al,00100100b ; 4 + 32 - cmp al,4 - je .lines160 - cmp al,32 - je .lines192 - cmp al,36 - je .objmode - mov eax,[sfx128lineloc] - jmp .donelines -.lines160 - mov eax,[sfx160lineloc] - jmp .donelines -.lines192 - mov eax,[sfx192lineloc] - jmp .donelines -.objmode - mov eax,[sfxobjlineloc] -.donelines - mov [sfxclineloc],eax - - mov al,[SfxSCMR] - and eax,00000011b - mov bl,[SfxPOR] - and bl,0Fh - shl bl,2 - or al,bl - mov ebx,[PLOTJmpb+eax*4] - mov eax,[PLOTJmpa+eax*4] - mov dword [FxTable+4Ch*4],eax - mov dword [FxTableb+4Ch*4],eax - mov dword [FxTablec+4Ch*4],eax - mov dword [FxTabled+4Ch*4],ebx - pop eax - pop ebx - ret - -NEWSYM UpdateSCBRCOLR - push eax - push ebx - mov ebx,[SfxSCBR] - shl ebx,10 - add ebx,[sfxramdata] - mov [SCBRrel],ebx - mov eax,[SfxCOLR] - mov ebx,[fxbit01+eax*4] - mov [fxbit01pcal],ebx - mov ebx,[fxbit23+eax*4] - mov [fxbit23pcal],ebx - mov ebx,[fxbit45+eax*4] - mov [fxbit45pcal],ebx - mov ebx,[fxbit67+eax*4] - mov [fxbit67pcal],ebx - pop ebx - pop eax - ret - -NEWSYM UpdateCLSR - mov dword [NumberOfOpcodes2],350 ; 0FFFFFFFh;350 - test byte[SfxCLSR],01h - jz .nohighsfx - mov dword [NumberOfOpcodes2],700 ;700 -.nohighsfx - cmp byte[SFXCounter],1 - je .noyi - mov dword [NumberOfOpcodes2],0FFFFFFFh -.noyi - ret - -NEWSYM UpdateSFX - call UpdatePORSCMR - call UpdatePORSCMR - call UpdateCLSR - ret diff --git a/i386/zsnesc4.asm b/i386/zsnesc4.asm deleted file mode 100644 index 9059b5d6..00000000 --- a/i386/zsnesc4.asm +++ /dev/null @@ -1,92 +0,0 @@ -; Snes9x - Portable Super Nintendo Entertainment System (TM) emulator. -; -; Super FX assembler emulator code -; (c) Copyright 1998, 1999 zsKnight and _Demo_. -; -; Permission to use, copy, modify and distribute Snes9x in both binary and -; source form, for non-commercial purposes, is hereby granted without fee, -; providing that this license information and copyright notice appear with -; all copies and any derived work. -; -; This software is provided 'as-is', without any express or implied -; warranty. In no event shall the authors be held liable for any damages -; arising from the use of this software. -; -; Snes9x is freeware for PERSONAL USE only. Commercial users should -; seek permission of the copyright holders first. Commercial use includes -; charging money for Snes9x or software derived from Snes9x. -; -; The copyright holders request that bug fixes and improvements to the code -; should be forwarded to them so everyone can benefit from the modifications -; in future versions. -; -; Super NES and Super Nintendo Entertainment System are trademarks of -; Nintendo Co., Limited and its subsidiary companies. -; -; ZSNES SuperFX emulation code and wrappers -; (C) Copyright 1997-8 zsKnight and _Demo_ - -; Used with the kind permission of the copyright holders. -; - -%include "macros.mac" - -EXTSYM InitC4, C4RegFunction, C4ReadReg, C4WriteReg -EXTSYM romdata - -[BITS 32] -SECTION .data - -NEWSYM C4Ram, dd 0 -NEWSYM C4RamR, dd 0 -NEWSYM C4RamW, dd 0 - -NEWSYM pressed, dd 0 ; used by C4Edit (unused function) -NEWSYM vidbuffer,dd 0 ; used by C4Edit -NEWSYM oamram, times 544 db 0 ; Sprite PPU data used by C4 routines - -; -; Snes9x wrapper functions for the zsnes C4 code -; (C) Copyright 2000 Gary Henderson - -SECTION .data - -EXTSYM ROM,RegRAM - -SECTION .text - -NEWSYM S9xInitC4 - pushad - mov eax,dword[ROM] - mov dword[romdata],eax - call InitC4 -; mov eax,dword[RegRAM] -; add eax,06000h -; mov dword[C4Ram],eax - popad - ret - -NEWSYM S9xSetC4 -NEWSYM S9xSetC4RAM - mov ecx, dword[esp+8] - mov eax, dword[esp+4] - and ecx, 0ffffh - push ebx - push esi - push edi - push ebp - sub ecx, 6000h - call C4RegFunction - pop ebp - pop edi - pop esi - pop ebx - ret - -NEWSYM S9xGetC4 -NEWSYM S9xGetC4RAM - mov ecx, dword[esp+4] - xor eax, eax - and ecx, 0ffffh - sub ecx, 06000h - jmp C4ReadReg diff --git a/memmap.cpp b/memmap.cpp index 995bd7cf..fb640775 100644 --- a/memmap.cpp +++ b/memmap.cpp @@ -1134,21 +1134,11 @@ bool8 CMemory::Init (void) BIOSROM = ROM + 0x300000; // BS BSRAM = ROM + 0x400000; // BS -#if defined(ZSNES_FX) || defined(ZSNES_C4) - ::ROM = ROM; - ::SRAM = SRAM; - ::RegRAM = FillRAM; -#endif - -#ifdef ZSNES_FX - SFXPlotTable = ROM + 0x400000; -#else SuperFX.pvRegisters = FillRAM + 0x3000; SuperFX.nRamBanks = 2; // Most only use 1. 1=64KB=512Mb, 2=128KB=1024Mb SuperFX.pvRam = SRAM; SuperFX.nRomBanks = (2 * 1024 * 1024) / (32 * 1024); SuperFX.pvRom = (uint8 *) ROM; -#endif PostRomInitFunc = NULL; @@ -2263,10 +2253,8 @@ void CMemory::InitROM (void) Settings.SETA = 0; Settings.SRTC = FALSE; Settings.BS = FALSE; -#ifndef ZSNES_FX + SuperFX.nRomBanks = CalculatedSize >> 15; -#endif - SA1.Executing = FALSE; //// Parse ROM header and read ROM informatoin @@ -2392,9 +2380,7 @@ void CMemory::InitROM (void) case 0x1520: case 0x1A20: Settings.SuperFX = TRUE; - #ifndef ZSNES_FX S9xInitSuperFX(); - #endif if (ROM[0x7FDA] == 0x33) SRAMSize = ROM[0x7FBD]; else @@ -3493,7 +3479,6 @@ bool8 CMemory::match_id (const char *str) void CMemory::ApplyROMFixes (void) { - Settings.Shutdown = Settings.ShutdownMaster; Settings.BlockInvalidVRAMAccess = Settings.BlockInvalidVRAMAccessMaster; //// Warnings @@ -3570,6 +3555,7 @@ void CMemory::ApplyROMFixes (void) Timings.HDMAStart = SNES_HDMA_START_HC + Settings.HDMATimingHack - 100; Timings.HBlankStart = SNES_HBLANK_START_HC + Timings.HDMAStart - SNES_HDMA_START_HC; + Timings.IRQTriggerCycles = 10; if (!Settings.DisableGameSpecificHacks) { @@ -3584,14 +3570,6 @@ void CMemory::ApplyROMFixes (void) if (!Settings.DisableGameSpecificHacks) { - // Opcode-based emulators cannot escape from "reading $4211/BPL" infinite loop... - // The true IRQ can be triggered inside an opcode. - if (match_na("TRAVERSE")) // Traverse - Starlight & Prairie - { - Timings.IRQPendCount = 1; - printf("IRQ count hack: %d\n", Timings.IRQPendCount); - } - // An infinite loop reads $4212 and waits V-blank end, whereas VIRQ is set V=0. // If Snes9x succeeds to escape from the loop before jumping into the IRQ handler, the game goes further. // If Snes9x jumps into the IRQ handler before escaping from the loop, @@ -3601,12 +3579,6 @@ void CMemory::ApplyROMFixes (void) Timings.IRQPendCount = 2; printf("IRQ count hack: %d\n", Timings.IRQPendCount); } - - if (match_na("BATTLE BLAZE")) - { - Timings.IRQPendCount = 1; - printf("IRQ count hack: %d\n", Timings.IRQPendCount); - } } if (!Settings.DisableGameSpecificHacks) @@ -3619,242 +3591,6 @@ void CMemory::ApplyROMFixes (void) } } - //// CPU speed-ups (CPU_Shutdown()) - - // Force disabling a speed-up hack - // Games which spool sound samples between the SNES and sound CPU using - // H-DMA as the sample is playing. - if (match_na("EARTHWORM JIM 2") || // Earth Worm Jim 2 - match_na("PRIMAL RAGE") || // Primal Rage - match_na("CLAY FIGHTER") || // Clay Fighter - match_na("ClayFighter 2") || // Clay Fighter 2 - match_na("WeaponLord") || // Weapon Lord - match_nn("WAR 2410") || // War 2410 - match_id("ARF") || // Star Ocean - match_id("A4WJ") || // Mini Yonku Shining Scorpion - Let's & Go!! - match_nn("NHL") || - match_nc("MADDEN")) - { - if (Settings.Shutdown) - printf("Disabled CPU shutdown hack.\n"); - Settings.Shutdown = FALSE; - } - - // SA-1 - SA1.WaitAddress = 0xffffffff; - SA1.WaitByteAddress1 = NULL; - SA1.WaitByteAddress2 = NULL; - - if (Settings.SA1) - { - // Itoi Shigesato no Bass Tsuri No.1 (J) - if (match_id("ZBPJ")) - { - SA1.WaitAddress = 0x0093f1; - SA1.WaitByteAddress1 = FillRAM + 0x304a; - } - - // Daisenryaku Expert WWII (J) - if (match_id("AEVJ")) - { - SA1.WaitAddress = 0x0ed18d; - SA1.WaitByteAddress1 = FillRAM + 0x3000; - } - - // Derby Jockey 2 (J) - if (match_id("A2DJ")) - { - SA1.WaitAddress = 0x008b62; - } - - // Dragon Ball Z - Hyper Dimension (J) - if (match_id("AZIJ")) - { - SA1.WaitAddress = 0x008083; - SA1.WaitByteAddress1 = FillRAM + 0x3020; - } - - // SD Gundam G NEXT (J) - if (match_id("ZX3J")) - { - SA1.WaitAddress = 0x0087f2; - SA1.WaitByteAddress1 = FillRAM + 0x30c4; - } - - // Shougi no Hanamichi (J) - if (match_id("AARJ")) - { - SA1.WaitAddress = 0xc1f85a; - SA1.WaitByteAddress1 = SRAM + 0x0c64; - SA1.WaitByteAddress2 = SRAM + 0x0c66; - } - - // Asahi Shinbun Rensai Katou Hifumi Kudan Shougi Shingiryu (J) - if (match_id("A23J")) - { - SA1.WaitAddress = 0xc25037; - SA1.WaitByteAddress1 = SRAM + 0x0c06; - SA1.WaitByteAddress2 = SRAM + 0x0c08; - } - - // Taikyoku Igo - Idaten (J) - if (match_id("AIIJ")) - { - SA1.WaitAddress = 0xc100be; - SA1.WaitByteAddress1 = SRAM + 0x1002; - SA1.WaitByteAddress2 = SRAM + 0x1004; - } - - // Takemiya Masaki Kudan no Igo Taishou (J) - if (match_id("AITJ")) - { - SA1.WaitAddress = 0x0080b7; - } - - // J. League '96 Dream Stadium (J) - if (match_id("AJ6J")) - { - SA1.WaitAddress = 0xc0f74a; - } - - // Jumpin' Derby (J) - if (match_id("AJUJ")) - { - SA1.WaitAddress = 0x00d926; - } - - // Kakinoki Shougi (J) - if (match_id("AKAJ")) - { - SA1.WaitAddress = 0x00f070; - } - - // Hoshi no Kirby 3 (J), Kirby's Dream Land 3 (U) - if (match_id("AFJJ") || match_id("AFJE")) - { - SA1.WaitAddress = 0x0082d4; - SA1.WaitByteAddress1 = SRAM + 0x72a4; - } - - // Hoshi no Kirby - Super Deluxe (J) - if (match_id("AKFJ")) - { - SA1.WaitAddress = 0x008c93; - SA1.WaitByteAddress1 = FillRAM + 0x300a; - SA1.WaitByteAddress2 = FillRAM + 0x300e; - } - - // Kirby Super Star (U) - if (match_id("AKFE")) - { - SA1.WaitAddress = 0x008cb8; - SA1.WaitByteAddress1 = FillRAM + 0x300a; - SA1.WaitByteAddress2 = FillRAM + 0x300e; - } - - // Super Mario RPG (J), (U) - if (match_id("ARWJ") || match_id("ARWE")) - { - SA1.WaitAddress = 0xc0816f; - SA1.WaitByteAddress1 = FillRAM + 0x3000; - } - - // Marvelous (J) - if (match_id("AVRJ")) - { - SA1.WaitAddress = 0x0085f2; - SA1.WaitByteAddress1 = FillRAM + 0x3024; - } - - // Harukanaru Augusta 3 - Masters New (J) - if (match_id("AO3J")) - { - SA1.WaitAddress = 0x00dddb; - SA1.WaitByteAddress1 = FillRAM + 0x37b4; - } - - // Jikkyou Oshaberi Parodius (J) - if (match_id("AJOJ")) - { - SA1.WaitAddress = 0x8084e5; - } - - // Super Bomberman - Panic Bomber W (J) - if (match_id("APBJ")) - { - SA1.WaitAddress = 0x00857a; - } - - // Pebble Beach no Hatou New - Tournament Edition (J) - if (match_id("AONJ")) - { - SA1.WaitAddress = 0x00df33; - SA1.WaitByteAddress1 = FillRAM + 0x37b4; - } - - // PGA European Tour (U) - if (match_id("AEPE")) - { - SA1.WaitAddress = 0x003700; - SA1.WaitByteAddress1 = FillRAM + 0x3102; - } - - // PGA Tour 96 (U) - if (match_id("A3GE")) - { - SA1.WaitAddress = 0x003700; - SA1.WaitByteAddress1 = FillRAM + 0x3102; - } - - // Power Rangers Zeo - Battle Racers (U) - if (match_id("A4RE")) - { - SA1.WaitAddress = 0x009899; - SA1.WaitByteAddress1 = FillRAM + 0x3000; - } - - // SD F-1 Grand Prix (J) - if (match_id("AGFJ")) - { - SA1.WaitAddress = 0x0181bc; - } - - // Saikousoku Shikou Shougi Mahjong (J) - if (match_id("ASYJ")) - { - SA1.WaitAddress = 0x00f2cc; - SA1.WaitByteAddress1 = SRAM + 0x7ffe; - SA1.WaitByteAddress2 = SRAM + 0x7ffc; - } - - // Shougi Saikyou II (J) - if (match_id("AX2J")) - { - SA1.WaitAddress = 0x00d675; - } - - // Mini Yonku Shining Scorpion - Let's & Go!! (J) - if (match_id("A4WJ")) - { - SA1.WaitAddress = 0xc048be; - } - - // Shin Shougi Club (J) - if (match_id("AHJJ")) - { - SA1.WaitAddress = 0xc1002a; - SA1.WaitByteAddress1 = SRAM + 0x0806; - SA1.WaitByteAddress2 = SRAM + 0x0808; - } - - // rest games: - // Habu Meijin no Omoshiro Shougi (J) - // Hayashi Kaihou Kudan no Igo Taidou (J) - // Shougi Saikyou (J) - // Super Robot Wars Gaiden (J) - // Super Shougi 3 - Kitaihei (J) - } - //// SRAM initial value if (!Settings.DisableGameSpecificHacks) diff --git a/memmap.h b/memmap.h index 30aa4dbd..99dd8f7e 100644 --- a/memmap.h +++ b/memmap.h @@ -357,14 +357,6 @@ struct SMulti extern CMemory Memory; extern SMulti Multi; -#if defined(ZSNES_FX) || defined(ZSNES_C4) -START_EXTERN_C -extern uint8 *ROM; -extern uint8 *SRAM; -extern uint8 *RegRAM; -END_EXTERN_C -#endif - void S9xAutoSaveSRAM (void); bool8 LoadZip(const char *, int32 *, int32 *, uint8 *); diff --git a/ppu.cpp b/ppu.cpp index e1d5c395..a9dc271f 100644 --- a/ppu.cpp +++ b/ppu.cpp @@ -204,9 +204,6 @@ static inline void S9xLatchCounters (bool force) #ifdef DEBUGGER missing.h_v_latch = 1; #endif - #if 0 // #ifdef CPU_SHUTDOWN - CPU.WaitAddress = CPU.PCAtOpcodeStart; - #endif PPU.HVBeamCounterLatched = 1; PPU.VBeamPosLatched = (uint16) CPU.V_Counter; @@ -245,9 +242,6 @@ static inline void S9xTryGunLatch (bool force) #ifdef DEBUGGER missing.h_v_latch = 1; #endif - #if 0 // #ifdef CPU_SHUTDOWN - CPU.WaitAddress = CPU.PCAtOpcodeStart; - #endif PPU.HVBeamCounterLatched = 1; PPU.VBeamPosLatched = (uint16) PPU.GunVLatch; @@ -260,72 +254,16 @@ static inline void S9xTryGunLatch (bool force) } } -void S9xCheckMissingHTimerPosition (int32 hc) -{ - if (PPU.HTimerPosition == hc) - { - if (PPU.HTimerEnabled && (!PPU.VTimerEnabled || (CPU.V_Counter == PPU.VTimerPosition))) - S9xSetIRQ(PPU_IRQ_SOURCE); - else - if (PPU.VTimerEnabled && (CPU.V_Counter == PPU.VTimerPosition)) - S9xSetIRQ(PPU_IRQ_SOURCE); - } -} - -void S9xCheckMissingHTimerHalt (int32 hc_from, int32 range) -{ - if ((PPU.HTimerPosition >= hc_from) && (PPU.HTimerPosition < (hc_from + range))) - { - if (PPU.HTimerEnabled && (!PPU.VTimerEnabled || (CPU.V_Counter == PPU.VTimerPosition))) - CPU.IRQPending = 1; - else - if (PPU.VTimerEnabled && (CPU.V_Counter == PPU.VTimerPosition)) - CPU.IRQPending = 1; - } -} - -void S9xCheckMissingHTimerRange (int32 hc_from, int32 range) -{ - if ((PPU.HTimerPosition >= hc_from) && (PPU.HTimerPosition < (hc_from + range))) - { - if (PPU.HTimerEnabled && (!PPU.VTimerEnabled || (CPU.V_Counter == PPU.VTimerPosition))) - S9xSetIRQ(PPU_IRQ_SOURCE); - else - if (PPU.VTimerEnabled && (CPU.V_Counter == PPU.VTimerPosition)) - S9xSetIRQ(PPU_IRQ_SOURCE); - } -} - void S9xUpdateHVTimerPosition (void) { - if (PPU.HTimerEnabled) + PPU.HTimerPosition = PPU.IRQHBeamPos * ONE_DOT_CYCLE + Timings.IRQTriggerCycles; + if (Timings.H_Max == Timings.H_Max_Master) // 1364 { - #ifdef DEBUGGER - missing.hirq_pos = PPU.IRQHBeamPos; - #endif - if (PPU.IRQHBeamPos != 0) - { - // IRQ_read - PPU.HTimerPosition = PPU.IRQHBeamPos * ONE_DOT_CYCLE; - if (Timings.H_Max == Timings.H_Max_Master) // 1364 - { - if (PPU.IRQHBeamPos > 322) - PPU.HTimerPosition += (ONE_DOT_CYCLE / 2); - if (PPU.IRQHBeamPos > 326) - PPU.HTimerPosition += (ONE_DOT_CYCLE / 2); - } - - PPU.HTimerPosition += 14; - // /IRQ - PPU.HTimerPosition += 4; - // after CPU executing - PPU.HTimerPosition += 6; - } - else - PPU.HTimerPosition = 10 + 4 + 6; + if (PPU.IRQHBeamPos > 322) + PPU.HTimerPosition += (ONE_DOT_CYCLE / 2); + if (PPU.IRQHBeamPos > 326) + PPU.HTimerPosition += (ONE_DOT_CYCLE / 2); } - else - PPU.HTimerPosition = 10 + 4 + 6; PPU.VTimerPosition = PPU.IRQVBeamPos; @@ -338,111 +276,9 @@ void S9xUpdateHVTimerPosition (void) PPU.VTimerPosition = 0; } - if (PPU.HTimerPosition < CPU.Cycles) - { - switch (CPU.WhichEvent) - { - case HC_IRQ_1_3_EVENT: - CPU.WhichEvent = HC_HDMA_START_EVENT; - CPU.NextEvent = Timings.HDMAStart; - break; - - case HC_IRQ_3_5_EVENT: - CPU.WhichEvent = HC_HCOUNTER_MAX_EVENT; - CPU.NextEvent = Timings.H_Max; - break; - - case HC_IRQ_5_7_EVENT: - CPU.WhichEvent = HC_HDMA_INIT_EVENT; - CPU.NextEvent = Timings.HDMAInit; - break; - - case HC_IRQ_7_9_EVENT: - CPU.WhichEvent = HC_RENDER_EVENT; - CPU.NextEvent = Timings.RenderPos; - break; - - case HC_IRQ_9_A_EVENT: - CPU.WhichEvent = HC_WRAM_REFRESH_EVENT; - CPU.NextEvent = Timings.WRAMRefreshPos; - break; - - case HC_IRQ_A_1_EVENT: - CPU.WhichEvent = HC_HBLANK_START_EVENT; - CPU.NextEvent = Timings.HBlankStart; - break; - } - } - else - if ((PPU.HTimerPosition < CPU.NextEvent) || (!(CPU.WhichEvent & 1) && (PPU.HTimerPosition == CPU.NextEvent))) - { - CPU.NextEvent = PPU.HTimerPosition; - - switch (CPU.WhichEvent) - { - case HC_HDMA_START_EVENT: - CPU.WhichEvent = HC_IRQ_1_3_EVENT; - break; - - case HC_HCOUNTER_MAX_EVENT: - CPU.WhichEvent = HC_IRQ_3_5_EVENT; - break; - - case HC_HDMA_INIT_EVENT: - CPU.WhichEvent = HC_IRQ_5_7_EVENT; - break; - - case HC_RENDER_EVENT: - CPU.WhichEvent = HC_IRQ_7_9_EVENT; - break; - - case HC_WRAM_REFRESH_EVENT: - CPU.WhichEvent = HC_IRQ_9_A_EVENT; - break; - - case HC_HBLANK_START_EVENT: - CPU.WhichEvent = HC_IRQ_A_1_EVENT; - break; - } - } - else - { - switch (CPU.WhichEvent) - { - case HC_IRQ_1_3_EVENT: - CPU.WhichEvent = HC_HDMA_START_EVENT; - CPU.NextEvent = Timings.HDMAStart; - break; - - case HC_IRQ_3_5_EVENT: - CPU.WhichEvent = HC_HCOUNTER_MAX_EVENT; - CPU.NextEvent = Timings.H_Max; - break; - - case HC_IRQ_5_7_EVENT: - CPU.WhichEvent = HC_HDMA_INIT_EVENT; - CPU.NextEvent = Timings.HDMAInit; - break; - - case HC_IRQ_7_9_EVENT: - CPU.WhichEvent = HC_RENDER_EVENT; - CPU.NextEvent = Timings.RenderPos; - break; - - case HC_IRQ_9_A_EVENT: - CPU.WhichEvent = HC_WRAM_REFRESH_EVENT; - CPU.NextEvent = Timings.WRAMRefreshPos; - break; - - case HC_IRQ_A_1_EVENT: - CPU.WhichEvent = HC_HBLANK_START_EVENT; - CPU.NextEvent = Timings.HBlankStart; - break; - } - } - #ifdef DEBUGGER - S9xTraceFormattedMessage("--- IRQ settings: H:%d V:%d (%04d, %03d)", PPU.HTimerEnabled, PPU.VTimerEnabled, PPU.HTimerPosition, PPU.VTimerPosition); + S9xTraceFormattedMessage("--- IRQ Timer set HTimer:%d Pos:%04d VTimer:%d Pos:%03d", + PPU.HTimerEnabled, PPU.HTimerPosition, PPU.VTimerEnabled, PPU.VTimerPosition); #endif } @@ -787,7 +623,7 @@ void S9xSetPPU (uint8 Byte, uint16 Address) case 0x2116: // VMADDL PPU.VMA.Address &= 0xff00; PPU.VMA.Address |= Byte; - #ifdef CORRECT_VRAM_READS + if (PPU.VMA.FullGraphicCount) { uint32 addr = PPU.VMA.Address; @@ -797,15 +633,13 @@ void S9xSetPPU (uint8 Byte, uint16 Address) } else IPPU.VRAMReadBuffer = READ_WORD(Memory.VRAM + ((PPU.VMA.Address << 1) & 0xffff)); - #else - IPPU.FirstVRAMRead = TRUE; - #endif + break; case 0x2117: // VMADDH PPU.VMA.Address &= 0x00ff; PPU.VMA.Address |= Byte << 8; - #ifdef CORRECT_VRAM_READS + if (PPU.VMA.FullGraphicCount) { uint32 addr = PPU.VMA.Address; @@ -815,22 +649,14 @@ void S9xSetPPU (uint8 Byte, uint16 Address) } else IPPU.VRAMReadBuffer = READ_WORD(Memory.VRAM + ((PPU.VMA.Address << 1) & 0xffff)); - #else - IPPU.FirstVRAMRead = TRUE; - #endif + break; case 0x2118: // VMDATAL - #ifndef CORRECT_VRAM_READS - IPPU.FirstVRAMRead = TRUE; - #endif REGISTER_2118(Byte); break; case 0x2119: // VMDATAH - #ifndef CORRECT_VRAM_READS - IPPU.FirstVRAMRead = TRUE; - #endif REGISTER_2119(Byte); break; @@ -1382,7 +1208,6 @@ uint8 S9xGetPPU (uint16 Address) return (PPU.OpenBus1 = byte); case 0x2139: // VMDATALREAD - #ifdef CORRECT_VRAM_READS byte = IPPU.VRAMReadBuffer & 0xff; if (!PPU.VMA.High) { @@ -1398,33 +1223,13 @@ uint8 S9xGetPPU (uint16 Address) PPU.VMA.Address += PPU.VMA.Increment; } - #else - if (IPPU.FirstVRAMRead) - byte = Memory.VRAM[(PPU.VMA.Address << 1) & 0xffff]; - else - if (PPU.VMA.FullGraphicCount) - { - uint32 addr = PPU.VMA.Address - 1; - uint32 rem = addr & PPU.VMA.Mask1; - uint32 address = (addr & ~PPU.VMA.Mask1) + (rem >> PPU.VMA.Shift) + ((rem & (PPU.VMA.FullGraphicCount - 1)) << 3); - byte = Memory.VRAM[((address << 1) - 2) & 0xffff]; - } - else - byte = Memory.VRAM[((PPU.VMA.Address << 1) - 2) & 0xffff]; - if (!PPU.VMA.High) - { - PPU.VMA.Address += PPU.VMA.Increment; - IPPU.FirstVRAMRead = FALSE; - } - #endif #ifdef DEBUGGER missing.vram_read = 1; #endif return (PPU.OpenBus1 = byte); case 0x213a: // VMDATAHREAD - #ifdef CORRECT_VRAM_READS byte = (IPPU.VRAMReadBuffer >> 8) & 0xff; if (PPU.VMA.High) { @@ -1440,26 +1245,6 @@ uint8 S9xGetPPU (uint16 Address) PPU.VMA.Address += PPU.VMA.Increment; } - #else - if (IPPU.FirstVRAMRead) - byte = Memory.VRAM[((PPU.VMA.Address << 1) + 1) & 0xffff]; - else - if (PPU.VMA.FullGraphicCount) - { - uint32 addr = PPU.VMA.Address - 1; - uint32 rem = addr & PPU.VMA.Mask1; - uint32 address = (addr & ~PPU.VMA.Mask1) + (rem >> PPU.VMA.Shift) + ((rem & (PPU.VMA.FullGraphicCount - 1)) << 3); - byte = Memory.VRAM[((address << 1) - 1) & 0xffff]; - } - else - byte = Memory.VRAM[((PPU.VMA.Address << 1) - 1) & 0xffff]; - - if (PPU.VMA.High) - { - PPU.VMA.Address += PPU.VMA.Increment; - IPPU.FirstVRAMRead = FALSE; - } - #endif #ifdef DEBUGGER missing.vram_read = 1; #endif @@ -1697,14 +1482,14 @@ void S9xSetCPU (uint8 Byte, uint16 Address) else PPU.HTimerEnabled = FALSE; - S9xUpdateHVTimerPosition(); + if (CPU.IRQLine && !PPU.HTimerEnabled && PPU.VTimerEnabled) + CPU.IRQTransition = TRUE; - // The case that IRQ will trigger in an instruction such as STA $4200. - // FIXME: not true but good enough for Snes9x, I think. - S9xCheckMissingHTimerRange(CPU.PrevCycles, CPU.Cycles - CPU.PrevCycles); - - if (!(Byte & 0x30)) - S9xClearIRQ(PPU_IRQ_SOURCE); + if (!PPU.HTimerEnabled && !PPU.VTimerEnabled) + { + CPU.IRQLine = FALSE; + CPU.IRQTransition = FALSE; + } // NMI can trigger immediately during VBlank as long as NMI_read ($4210) wasn't cleard. if ((Byte & 0x80) && !(Memory.FillRAM[0x4200] & 0x80) && @@ -1712,7 +1497,7 @@ void S9xSetCPU (uint8 Byte, uint16 Address) { // FIXME: triggered at HC+=6, checked just before the final CPU cycle, // then, when to call S9xOpcode_NMI()? - CPU.Flags |= NMI_FLAG; + CPU.NMILine = TRUE; Timings.NMITriggerPos = CPU.Cycles + 6 + 6; } @@ -1826,8 +1611,6 @@ void S9xSetCPU (uint8 Byte, uint16 Address) case 0x420c: // HDMAEN if (CPU.InDMAorHDMA) return; - if (Settings.DisableHDMA) - Byte = 0; Memory.FillRAM[0x420c] = Byte; // Yoshi's Island, Genjyu Ryodan, Mortal Kombat, Tales of Phantasia PPU.HDMA = Byte & ~PPU.HDMAEnded; @@ -1854,17 +1637,7 @@ void S9xSetCPU (uint8 Byte, uint16 Address) break; case 0x4210: // RDNMI - #if 0 - Memory.FillRAM[0x4210] = Model->_5A22; - #endif - return; - case 0x4211: // TIMEUP - #if 0 - S9xClearIRQ(PPU_IRQ_SOURCE); - #endif - return; - case 0x4212: // HVBJOY case 0x4213: // RDIO case 0x4214: // RDDIVL @@ -1980,22 +1753,17 @@ uint8 S9xGetCPU (uint16 Address) switch (Address) { case 0x4210: // RDNMI - #ifdef CPU_SHUTDOWN - CPU.WaitAddress = CPU.PBPCAtOpcodeStart; - #endif byte = Memory.FillRAM[0x4210]; Memory.FillRAM[0x4210] = Model->_5A22; return ((byte & 0x80) | (OpenBus & 0x70) | Model->_5A22); case 0x4211: // TIMEUP - byte = (CPU.IRQActive & PPU_IRQ_SOURCE) ? 0x80 : 0; - S9xClearIRQ(PPU_IRQ_SOURCE); + byte = CPU.IRQLine ? 0x80 : 0; + CPU.IRQLine = FALSE; + CPU.IRQTransition = FALSE; return (byte | (OpenBus & 0x7f)); case 0x4212: // HVBJOY - #ifdef CPU_SHUTDOWN - CPU.WaitAddress = CPU.PBPCAtOpcodeStart; - #endif return (REGISTER_4212() | (OpenBus & 0x3e)); case 0x4213: // RDIO @@ -2189,11 +1957,7 @@ void S9xSoftResetPPU (void) ZeroMemory(IPPU.TileCached[TILE_2BIT_ODD], MAX_2BIT_TILES); ZeroMemory(IPPU.TileCached[TILE_4BIT_EVEN], MAX_4BIT_TILES); ZeroMemory(IPPU.TileCached[TILE_4BIT_ODD], MAX_4BIT_TILES); -#ifdef CORRECT_VRAM_READS IPPU.VRAMReadBuffer = 0; // XXX: FIXME: anything better? -#else - IPPU.FirstVRAMRead = FALSE; -#endif IPPU.Interlace = FALSE; IPPU.InterlaceOBJ = FALSE; IPPU.DoubleWidthPixels = FALSE; diff --git a/ppu.h b/ppu.h index 7f20e897..c5cb9d7a 100644 --- a/ppu.h +++ b/ppu.h @@ -197,11 +197,6 @@ #define CLIP_XOR 2 #define CLIP_XNOR 3 -#define PPU_IRQ_SOURCE (1 << 1) -#define GSU_IRQ_SOURCE (1 << 2) -#define SA1_IRQ_SOURCE (1 << 7) -#define SA1_DMA_IRQ_SOURCE (1 << 5) - struct ClipData { uint8 Count; @@ -218,11 +213,7 @@ struct InternalPPU bool8 DirectColourMapsNeedRebuild; uint8 *TileCache[7]; uint8 *TileCached[7]; -#ifdef CORRECT_VRAM_READS uint16 VRAMReadBuffer; -#else - bool8 FirstVRAMRead; -#endif bool8 Interlace; bool8 InterlaceOBJ; bool8 PseudoHires; @@ -385,9 +376,6 @@ uint8 S9xGetPPU (uint16); void S9xSetCPU (uint8, uint16); uint8 S9xGetCPU (uint16); void S9xUpdateHVTimerPosition (void); -void S9xCheckMissingHTimerPosition (int32); -void S9xCheckMissingHTimerRange (int32, int32); -void S9xCheckMissingHTimerHalt (int32, int32); void S9xFixColourBrightness (void); void S9xDoAutoJoypad (void); diff --git a/sa1.cpp b/sa1.cpp index 813051dc..a35e5537 100644 --- a/sa1.cpp +++ b/sa1.cpp @@ -180,7 +180,6 @@ uint8 SA1OpenBus; -static void S9xSA1Reset (void); static void S9xSA1SetBWRAMMemMap (uint8); static void S9xSetSA1MemMap (uint32, uint8); static void S9xSA1CharConv2 (void); @@ -190,31 +189,37 @@ static void S9xSA1ReadVariableLengthData (bool8, bool8); void S9xSA1Init (void) { - SA1.IRQActive = FALSE; - SA1.WaitingForInterrupt = FALSE; - SA1.Waiting = FALSE; + SA1.Cycles = 0; + SA1.PrevCycles = 0; SA1.Flags = 0; - SA1.Executing = FALSE; + SA1.WaitingForInterrupt = FALSE; + memset(&Memory.FillRAM[0x2200], 0, 0x200); Memory.FillRAM[0x2200] = 0x20; Memory.FillRAM[0x2220] = 0x00; Memory.FillRAM[0x2221] = 0x01; Memory.FillRAM[0x2222] = 0x02; Memory.FillRAM[0x2223] = 0x03; - Memory.FillRAM[0x2228] = 0xff; + Memory.FillRAM[0x2228] = 0x0f; + + SA1.in_char_dma = FALSE; + SA1.TimerIRQLastState = FALSE; + SA1.HTimerIRQPos = 0; + SA1.VTimerIRQPos = 0; + SA1.HCounter = 0; + SA1.VCounter = 0; + SA1.PrevHCounter = 0; + SA1.arithmetic_op = 0; SA1.op1 = 0; SA1.op2 = 0; - SA1.arithmetic_op = 0; SA1.sum = 0; SA1.overflow = FALSE; - SA1.S9xOpcodes = NULL; -} + SA1.VirtualBitmapFormat = 0; + SA1.variable_bit_pos = 0; -static void S9xSA1Reset (void) -{ SA1Registers.PBPC = 0; SA1Registers.PB = 0; - SA1Registers.PCw = Memory.FillRAM[0x2203] | (Memory.FillRAM[0x2204] << 8); + SA1Registers.PCw = 0; SA1Registers.D.W = 0; SA1Registers.DB = 0; SA1Registers.SH = 1; @@ -228,17 +233,20 @@ static void S9xSA1Reset (void) SA1SetFlags(MemoryFlag | IndexFlag | IRQ | Emulation); SA1ClearFlags(Decimal); - SA1.WaitingForInterrupt = FALSE; - SA1.PCBase = NULL; - S9xSA1SetPCBase(SA1Registers.PBPC); + SA1.MemSpeed = SLOW_ONE_CYCLE; + SA1.MemSpeedx2 = SLOW_ONE_CYCLE * 2; + SA1.S9xOpcodes = S9xSA1OpcodesM1X1; SA1.S9xOpLengths = S9xOpLengthsM1X1; + S9xSA1SetPCBase(SA1Registers.PBPC); + S9xSA1UnpackStatus(); S9xSA1FixCycles(); - SA1.Executing = TRUE; + SA1.BWRAM = Memory.SRAM; - Memory.FillRAM[0x2225] = 0; + + CPU.IRQExternal = FALSE; } static void S9xSA1SetBWRAMMemMap (uint8 val) @@ -280,23 +288,6 @@ void S9xSA1PostLoadState (void) SA1.VirtualBitmapFormat = (Memory.FillRAM[0x223f] & 0x80) ? 2 : 4; Memory.BWRAM = Memory.SRAM + (Memory.FillRAM[0x2224] & 7) * 0x2000; S9xSA1SetBWRAMMemMap(Memory.FillRAM[0x2225]); - - SA1.Waiting = (Memory.FillRAM[0x2200] & 0x60) != 0; - SA1.Executing = !SA1.Waiting; -} - -void S9xSA1ExecuteDuringSleep (void) -{ -#if 0 - if (SA1.Executing) - { - while (CPU.Cycles < CPU.NextEvent) - { - S9xSA1MainLoop(); - CPU.Cycles += TWO_CYCLES * 2; - } - } -#endif } static void S9xSetSA1MemMap (uint32 which1, uint8 map) @@ -326,31 +317,48 @@ uint8 S9xGetSA1 (uint32 address) { switch (address) { - case 0x2300: - return ((uint8) ((Memory.FillRAM[0x2209] & 0x5f) | (CPU.IRQActive & (SA1_IRQ_SOURCE | SA1_DMA_IRQ_SOURCE)))); + case 0x2300: // S-CPU flag + return ((Memory.FillRAM[0x2209] & 0x5f) | (Memory.FillRAM[0x2300] & 0xa0)); - case 0x2301: - return ((Memory.FillRAM[0x2200] & 0xf) | (Memory.FillRAM[0x2301] & 0xf0)); + case 0x2301: // SA-1 flag + return ((Memory.FillRAM[0x2200] & 0x0f) | (Memory.FillRAM[0x2301] & 0xf0)); - case 0x2306: + case 0x2302: // H counter (L) + SA1.HTimerIRQPos = SA1.HCounter / ONE_DOT_CYCLE; + SA1.VTimerIRQPos = SA1.VCounter; + return ((uint8) SA1.HTimerIRQPos); + + case 0x2303: // H counter (H) + return ((uint8) (SA1.HTimerIRQPos >> 8)); + + case 0x2304: // V counter (L) + return ((uint8) SA1.VTimerIRQPos); + + case 0x2305: // V counter (H) + return ((uint8) (SA1.VTimerIRQPos >> 8)); + + case 0x2306: // arithmetic result (LLL) return ((uint8) SA1.sum); - case 0x2307: + case 0x2307: // arithmetic result (LLH) return ((uint8) (SA1.sum >> 8)); - case 0x2308: + case 0x2308: // arithmetic result (LHL) return ((uint8) (SA1.sum >> 16)); - case 0x2309: + case 0x2309: // arithmetic result (LLH) return ((uint8) (SA1.sum >> 24)); - case 0x230a: + case 0x230a: // arithmetic result (HLL) return ((uint8) (SA1.sum >> 32)); - case 0x230c: + case 0x230b: // arithmetic overflow + return (SA1.overflow ? 0x80 : 0); + + case 0x230c: // variable-length data read port (L) return (Memory.FillRAM[0x230c]); - case 0x230d: + case 0x230d: // variable-length data read port (H) { uint8 byte = Memory.FillRAM[0x230d]; @@ -360,8 +368,10 @@ uint8 S9xGetSA1 (uint32 address) return (byte); } + case 0x230e: // version code register + return (0x01); + default: - //printf("R: %04x\n", address); break; } @@ -372,337 +382,279 @@ void S9xSetSA1 (uint8 byte, uint32 address) { switch (address) { - case 0x2200: - SA1.Waiting = (byte & 0x60) != 0; - //SA1.Executing = !SA1.Waiting && SA1.S9xOpcodes; + case 0x2200: // SA-1 control + #ifdef DEBUGGER + if (byte & 0x60) + printf("SA-1 sleep\n"); + #endif - if (!(byte & 0x20) && (Memory.FillRAM[0x2200] & 0x20)) - S9xSA1Reset(); + // SA-1 reset + if (!(byte & 0x80) && (Memory.FillRAM[0x2200] & 0x20)) + { + #ifdef DEBUGGER + printf("SA-1 reset\n"); + #endif + SA1Registers.PBPC = 0; + SA1Registers.PB = 0; + SA1Registers.PCw = Memory.FillRAM[0x2203] | (Memory.FillRAM[0x2204] << 8); + S9xSA1SetPCBase(SA1Registers.PBPC); + } + // SA-1 IRQ control if (byte & 0x80) { Memory.FillRAM[0x2301] |= 0x80; if (Memory.FillRAM[0x220a] & 0x80) - { - SA1.Flags |= IRQ_FLAG; - SA1.IRQActive |= SNES_IRQ_SOURCE; - SA1.Executing = !SA1.Waiting && SA1.S9xOpcodes; - } + Memory.FillRAM[0x220b] &= ~0x80; } + // SA-1 NMI control if (byte & 0x10) { Memory.FillRAM[0x2301] |= 0x10; if (Memory.FillRAM[0x220a] & 0x10) + Memory.FillRAM[0x220b] &= ~0x10; + } + + break; + + case 0x2201: // S-CPU interrupt enable + // S-CPU IRQ enable + if (((byte ^ Memory.FillRAM[0x2201]) & 0x80) && (Memory.FillRAM[0x2300] & byte & 0x80)) + { + Memory.FillRAM[0x2202] &= ~0x80; + CPU.IRQExternal = TRUE; + } + + // S-CPU CHDMA IRQ enable + if (((byte ^ Memory.FillRAM[0x2201]) & 0x20) && (Memory.FillRAM[0x2300] & byte & 0x20)) + { + Memory.FillRAM[0x2202] &= ~0x20; + CPU.IRQExternal = TRUE; + } + + break; + + case 0x2202: // S-CPU interrupt clear + // S-CPU IRQ clear + if (byte & 0x80) + Memory.FillRAM[0x2300] &= ~0x80; + + // S-CPU CHDMA IRQ clear + if (byte & 0x20) + Memory.FillRAM[0x2300] &= ~0x20; + + if (!(Memory.FillRAM[0x2300] & 0xa0)) + CPU.IRQExternal = FALSE; + + break; + + case 0x2203: // SA-1 reset vector (L) + case 0x2204: // SA-1 reset vector (H) + case 0x2205: // SA-1 NMI vector (L) + case 0x2206: // SA-1 NMI vector (H) + case 0x2207: // SA-1 IRQ vector (L) + case 0x2208: // SA-1 IRQ vector (H) + break; + + case 0x2209: // S-CPU control + // 0x40: S-CPU IRQ overwrite + // 0x20: S-CPU NMI overwrite + + // S-CPU IRQ control + if (byte & 0x80) + { + Memory.FillRAM[0x2300] |= 0x80; + if (Memory.FillRAM[0x2201] & 0x80) { - SA1.Flags |= NMI_FLAG; - SA1.Executing = !SA1.Waiting && SA1.S9xOpcodes; + Memory.FillRAM[0x2202] &= ~0x80; + CPU.IRQExternal = TRUE; } } break; - case 0x2201: - if (((byte ^ Memory.FillRAM[0x2201]) & 0x80) && (Memory.FillRAM[0x2300] & byte & 0x80)) - S9xSetIRQ(SA1_IRQ_SOURCE); - - if (((byte ^ Memory.FillRAM[0x2201]) & 0x20) && (Memory.FillRAM[0x2300] & byte & 0x20)) - S9xSetIRQ(SA1_DMA_IRQ_SOURCE); - - break; - - case 0x2202: - if (byte & 0x80) - { - Memory.FillRAM[0x2300] &= ~0x80; - S9xClearIRQ(SA1_IRQ_SOURCE); - } - - if (byte & 0x20) - { - Memory.FillRAM[0x2300] &= ~0x20; - S9xClearIRQ(SA1_DMA_IRQ_SOURCE); - } - - break; - - case 0x2203: - //printf("SA1 reset vector: %04x\n", byte | (Memory.FillRAM[0x2204] << 8)); - break; - - case 0x2204: - //printf("SA1 reset vector: %04x\n", (byte << 8) | Memory.FillRAM[0x2203]); - break; - - case 0x2205: - //printf("SA1 NMI vector: %04x\n", byte | (Memory.FillRAM[0x2206] << 8)); - break; - - case 0x2206: - //printf("SA1 NMI vector: %04x\n", (byte << 8) | Memory.FillRAM[0x2205]); - break; - - case 0x2207: - //printf("SA1 IRQ vector: %04x\n", byte | (Memory.FillRAM[0x2208] << 8)); - break; - - case 0x2208: - //printf("SA1 IRQ vector: %04x\n", (byte << 8) | Memory.FillRAM[0x2207]); - break; - - case 0x2209: - Memory.FillRAM[0x2209] = byte; - - if (byte & 0x80) - Memory.FillRAM[0x2300] |= 0x80; - - if (byte & Memory.FillRAM[0x2201] & 0x80) - S9xSetIRQ(SA1_IRQ_SOURCE); - - break; - - case 0x220a: + case 0x220a: // SA-1 interrupt enable + // SA-1 IRQ enable if (((byte ^ Memory.FillRAM[0x220a]) & 0x80) && (Memory.FillRAM[0x2301] & byte & 0x80)) - { - SA1.Flags |= IRQ_FLAG; - SA1.IRQActive |= SNES_IRQ_SOURCE; - //SA1.Executing = !SA1.Waiting; - } + Memory.FillRAM[0x220b] &= ~0x80; + // SA-1 timer IRQ enable if (((byte ^ Memory.FillRAM[0x220a]) & 0x40) && (Memory.FillRAM[0x2301] & byte & 0x40)) - { - SA1.Flags |= IRQ_FLAG; - SA1.IRQActive |= TIMER_IRQ_SOURCE; - //SA1.Executing = !SA1.Waiting; - } + Memory.FillRAM[0x220b] &= ~0x40; + // SA-1 DMA IRQ enable if (((byte ^ Memory.FillRAM[0x220a]) & 0x20) && (Memory.FillRAM[0x2301] & byte & 0x20)) - { - SA1.Flags |= IRQ_FLAG; - SA1.IRQActive |= DMA_IRQ_SOURCE; - //SA1.Executing = !SA1.Waiting; - } + Memory.FillRAM[0x220b] &= ~0x20; + // SA-1 NMI enable if (((byte ^ Memory.FillRAM[0x220a]) & 0x10) && (Memory.FillRAM[0x2301] & byte & 0x10)) - { - SA1.Flags |= NMI_FLAG; - //SA1.Executing = !SA1.Waiting; - } + Memory.FillRAM[0x220b] &= ~0x10; break; - case 0x220b: + case 0x220b: // SA-1 interrupt clear + // SA-1 IRQ clear if (byte & 0x80) - { - SA1.IRQActive &= ~SNES_IRQ_SOURCE; Memory.FillRAM[0x2301] &= ~0x80; - } + // SA-1 timer IRQ clear if (byte & 0x40) - { - SA1.IRQActive &= ~TIMER_IRQ_SOURCE; Memory.FillRAM[0x2301] &= ~0x40; - } + // SA-1 DMA IRQ clear if (byte & 0x20) - { - SA1.IRQActive &= ~DMA_IRQ_SOURCE; Memory.FillRAM[0x2301] &= ~0x20; - } + // SA-1 NMI clear if (byte & 0x10) Memory.FillRAM[0x2301] &= ~0x10; - if (!SA1.IRQActive) - SA1.Flags &= ~IRQ_FLAG; - break; - case 0x220c: - //printf("SNES NMI vector: %04x\n", byte | (Memory.FillRAM[0x220d] << 8)); + case 0x220c: // S-CPU NMI vector (L) + case 0x220d: // S-CPU NMI vector (H) + case 0x220e: // S-CPU IRQ vector (L) + case 0x220f: // S-CPU IRQ vector (H) break; - case 0x220d: - //printf("SNES NMI vector: %04x\n", (byte << 8) | Memory.FillRAM[0x220c]); - break; - - case 0x220e: - //printf("SNES IRQ vector: %04x\n", byte | (Memory.FillRAM[0x220f] << 8)); - break; - - case 0x220f: - //printf("SNES IRQ vector: %04x\n", (byte << 8) | Memory.FillRAM[0x220e]); - break; - - case 0x2210: - #if 0 - printf("Timer %s\n", (byte & 0x80) ? "linear" : "HV"); - printf("Timer H-IRQ %s\n", (byte & 1) ? "enabled" : "disabled"); - printf("Timer V-IRQ %s\n", (byte & 2) ? "enabled" : "disabled"); + case 0x2210: // SA-1 timer control + // 0x80: mode (linear / HV) + // 0x02: V timer enable + // 0x01: H timer enable + #ifdef DEBUGGER + printf("SA-1 timer control write:%02x\n", byte); #endif break; - case 0x2211: - //printf("Timer reset\n"); + case 0x2211: // SA-1 timer reset + SA1.HCounter = 0; + SA1.VCounter = 0; break; - case 0x2212: - //printf("H-Timer %04x\n", byte | (Memory.FillRAM[0x2213] << 8)); + case 0x2212: // SA-1 H-timer (L) + SA1.HTimerIRQPos = byte | (Memory.FillRAM[0x2213] << 8); break; - case 0x2213: - //printf("H-Timer %04x\n", (byte << 8) | Memory.FillRAM[0x2212]); + case 0x2213: // SA-1 H-timer (H) + SA1.HTimerIRQPos = (byte << 8) | Memory.FillRAM[0x2212]; break; - case 0x2214: - //printf("V-Timer %04x\n", byte | (Memory.FillRAM[0x2215] << 8)); + case 0x2214: // SA-1 V-timer (L) + SA1.VTimerIRQPos = byte | (Memory.FillRAM[0x2215] << 8); break; - case 0x2215: - //printf("V-Timer %04x\n", (byte << 8) | Memory.FillRAM[0x2214]); + case 0x2215: // SA-1 V-timer (H) + SA1.VTimerIRQPos = (byte << 8) | Memory.FillRAM[0x2214]; break; - case 0x2220: - case 0x2221: - case 0x2222: - case 0x2223: - //printf("MMC: %02x\n", byte); + case 0x2220: // MMC bank C + case 0x2221: // MMC bank D + case 0x2222: // MMC bank E + case 0x2223: // MMC bank F S9xSetSA1MemMap(address - 0x2220, byte); break; - case 0x2224: - //printf("BWRAM image SNES %02x -> 0x6000\n", byte); + case 0x2224: // S-CPU BW-RAM mapping Memory.BWRAM = Memory.SRAM + (byte & 7) * 0x2000; break; - case 0x2225: - //printf("BWRAM image SA1 %02x -> 0x6000 (%02x)\n", byte, Memory.FillRAM[0x2225]); + case 0x2225: // SA-1 BW-RAM mapping if (byte != Memory.FillRAM[0x2225]) S9xSA1SetBWRAMMemMap(byte); + break; - case 0x2226: - //printf("BW-RAM SNES write %s\n", (byte & 0x80) ? "enabled" : "disabled"); + case 0x2226: // S-CPU BW-RAM write enable + case 0x2227: // SA-1 BW-RAM write enable + case 0x2228: // BW-RAM write-protected area + case 0x2229: // S-CPU I-RAM write protection + case 0x222a: // SA-1 I-RAM write protection break; - case 0x2227: - //printf("BW-RAM SA1 write %s\n", (byte & 0x80) ? "enabled" : "disabled"); + case 0x2230: // DMA control + // 0x80: enable + // 0x40: priority (DMA / SA-1) + // 0x20: character conversion / normal + // 0x10: BW-RAM -> I-RAM / SA-1 -> I-RAM + // 0x04: destinatin (BW-RAM / I-RAM) + // 0x03: source break; - case 0x2228: - //printf("BW-RAM write protect area %02x\n", byte); - break; - - case 0x2229: - //printf("I-RAM SNES write protect area %02x\n", byte); - break; - - case 0x222a: - //printf("I-RAM SA1 write protect area %02x\n", byte); - break; - - case 0x2230: - #if 0 - printf("SA1 DMA %s\n", (byte & 0x80) ? "enabled" : "disabled"); - printf("DMA priority %s\n", (byte & 0x40) ? "DMA" : "SA1"); - printf("DMA %s\n", (byte & 0x20) ? "char conv" : "normal"); - printf("DMA type %s\n", (byte & 0x10) ? "BW-RAM -> I-RAM" : "SA1 -> I-RAM"); - printf("DMA distination %s\n", (byte & 4) ? "BW-RAM" : "I-RAM"); - printf("DMA source %s\n", DMAsource[byte & 3]); - #endif - break; - - case 0x2231: + case 0x2231: // character conversion DMA parameters + // 0x80: CHDEND (complete / incomplete) + // 0x03: color mode + // (byte >> 2) & 7: virtual VRAM width if (byte & 0x80) SA1.in_char_dma = FALSE; - #if 0 - printf("CHDEND %s\n", (byte & 0x80) ? "complete" : "incomplete"); - printf("DMA colour mode %d\n", byte & 3); - printf("virtual VRAM width %d\n", (byte >> 2) & 7); - #endif + break; - case 0x2232: - case 0x2233: - case 0x2234: - Memory.FillRAM[address] = byte; - #if 0 - printf("DMA source start %06x\n", Memory.FillRAM[0x2232] | (Memory.FillRAM[0x2233] << 8) | (Memory.FillRAM[0x2234] << 16)); - #endif + case 0x2232: // DMA source start address (LL) + case 0x2233: // DMA source start address (LH) + case 0x2234: // DMA source start address (HL) break; - case 0x2235: - Memory.FillRAM[0x2235] = byte; + case 0x2235: // DMA destination start address (LL) break; - case 0x2236: + case 0x2236: // DMA destination start address (LH) Memory.FillRAM[0x2236] = byte; if ((Memory.FillRAM[0x2230] & 0xa4) == 0x80) // Normal DMA to I-RAM S9xSA1DMA(); else - if ((Memory.FillRAM[0x2230] & 0xb0) == 0xb0) + if ((Memory.FillRAM[0x2230] & 0xb0) == 0xb0) // CC1 { + SA1.in_char_dma = TRUE; + Memory.FillRAM[0x2300] |= 0x20; if (Memory.FillRAM[0x2201] & 0x20) - S9xSetIRQ(SA1_DMA_IRQ_SOURCE); - SA1.in_char_dma = TRUE; + { + Memory.FillRAM[0x2202] &= ~0x20; + CPU.IRQExternal = TRUE; + } } break; - case 0x2237: + case 0x2237: // DMA destination start address (HL) Memory.FillRAM[0x2237] = byte; if ((Memory.FillRAM[0x2230] & 0xa4) == 0x84) // Normal DMA to BW-RAM S9xSA1DMA(); - #if 0 - printf("DMA dest address %06x\n", Memory.FillRAM[0x2235] | (Memory.FillRAM[0x2236] << 8) | (Memory.FillRAM[0x2237] << 16)); - #endif + break; - case 0x2238: - case 0x2239: - Memory.FillRAM[address] = byte; - #if 0 - printf("DMA length %04x\n", Memory.FillRAM[0x2238] | (Memory.FillRAM[0x2239] << 8)); - #endif + case 0x2238: // DMA terminal counter (L) + case 0x2239: // DMA terminal counter (H) break; - case 0x223f: - //printf("virtual VRAM depth %d\n", (byte & 0x80) ? 2 : 4); + case 0x223f: // BW-RAM bitmap format SA1.VirtualBitmapFormat = (byte & 0x80) ? 2 : 4; break; - case 0x2240: - case 0x2241: - case 0x2242: - case 0x2243: - case 0x2244: - case 0x2245: - case 0x2246: - case 0x2247: - case 0x2248: - case 0x2249: - case 0x224a: - case 0x224b: - case 0x224c: - case 0x224d: - case 0x224e: - #if 0 - if (!(SA1.Flags & TRACE_FLAG)) - { - TraceSA1(); - Trace(); - } - #endif - Memory.FillRAM[address] = byte; + case 0x2240: // bitmap register 0 + case 0x2241: // bitmap register 1 + case 0x2242: // bitmap register 2 + case 0x2243: // bitmap register 3 + case 0x2244: // bitmap register 4 + case 0x2245: // bitmap register 5 + case 0x2246: // bitmap register 6 + case 0x2247: // bitmap register 7 + case 0x2248: // bitmap register 8 + case 0x2249: // bitmap register 9 + case 0x224a: // bitmap register A + case 0x224b: // bitmap register B + case 0x224c: // bitmap register C + case 0x224d: // bitmap register D + case 0x224e: // bitmap register E break; - case 0x224f: + case 0x224f: // bitmap register F Memory.FillRAM[0x224f] = byte; - if ((Memory.FillRAM[0x2230] & 0xb0) == 0xa0) // Char conversion 2 DMA enabled + if ((Memory.FillRAM[0x2230] & 0xb0) == 0xa0) // CC2 { memmove(&Memory.ROM[CMemory::MAX_ROM_SIZE - 0x10000] + SA1.in_char_dma * 16, &Memory.FillRAM[0x2240], 16); SA1.in_char_dma = (SA1.in_char_dma + 1) & 7; @@ -712,58 +664,67 @@ void S9xSetSA1 (uint8 byte, uint32 address) break; - case 0x2250: + case 0x2250: // arithmetic control if (byte & 2) SA1.sum = 0; SA1.arithmetic_op = byte & 3; break; - case 0x2251: - SA1.op1 = (SA1.op1 & 0xff00) | byte; + case 0x2251: // multiplicand / dividend (L) + SA1.op1 = (SA1.op1 & 0xff00) | byte; break; - case 0x2252: - SA1.op1 = (SA1.op1 & 0xff) | (byte << 8); + case 0x2252: // multiplicand / dividend (H) + SA1.op1 = (SA1.op1 & 0x00ff) | (byte << 8); break; - case 0x2253: - SA1.op2 = (SA1.op2 & 0xff00) | byte; + case 0x2253: // multiplier / divisor (L) + SA1.op2 = (SA1.op2 & 0xff00) | byte; break; - case 0x2254: - SA1.op2 = (SA1.op2 & 0xff) | (byte << 8); + case 0x2254: // multiplier / divisor (H) + SA1.op2 = (SA1.op2 & 0x00ff) | (byte << 8); switch (SA1.arithmetic_op) { - case 0: // multiply - SA1.sum = SA1.op1 * SA1.op2; + case 0: // signed multiplication + SA1.sum = (int16) SA1.op1 * (int16) SA1.op2; + SA1.op2 = 0; break; - case 1: // divide + case 1: // unsigned division if (SA1.op2 == 0) - SA1.sum = SA1.op1 << 16; + SA1.sum = 0; else - SA1.sum = (SA1.op1 / (int) ((uint16) SA1.op2)) | ((SA1.op1 % (int) ((uint16) SA1.op2)) << 16); + { + int16 quotient = (int16) SA1.op1 / (uint16) SA1.op2; + uint16 remainder = (int16) SA1.op1 % (uint16) SA1.op2; + SA1.sum = (remainder << 16) | quotient; + } + + SA1.op1 = 0; + SA1.op2 = 0; break; case 2: // cumulative sum default: - SA1.sum += SA1.op1 * SA1.op2; - if (SA1.sum & ((int64) 0xffffff << 32)) - SA1.overflow = TRUE; + SA1.sum += (int16) SA1.op1 * (int16) SA1.op2; + SA1.overflow = (SA1.sum >= (1ULL << 40)); + SA1.sum &= (1ULL << 40) - 1; + SA1.op2 = 0; break; } break; - case 0x2258: // Variable bit-field length/auto inc/start. + case 0x2258: // variable bit-field length / auto inc / start Memory.FillRAM[0x2258] = byte; S9xSA1ReadVariableLengthData(TRUE, FALSE); return; - case 0x2259: // Variable bit-field start address - case 0x225a: - case 0x225b: + case 0x2259: // variable bit-field start address (LL) + case 0x225a: // variable bit-field start address (LH) + case 0x225b: // variable bit-field start address (HL) Memory.FillRAM[address] = byte; // XXX: ??? SA1.variable_bit_pos = 0; @@ -771,7 +732,6 @@ void S9xSetSA1 (uint8 byte, uint32 address) return; default: - //printf("W: %02x->%04x\n", byte, address); break; } @@ -890,14 +850,11 @@ static void S9xSA1DMA (void) } memmove(d, s, len); - Memory.FillRAM[0x2301] |= 0x20; + // SA-1 DMA IRQ control + Memory.FillRAM[0x2301] |= 0x20; if (Memory.FillRAM[0x220a] & 0x20) - { - SA1.Flags |= IRQ_FLAG; - SA1.IRQActive |= DMA_IRQ_SOURCE; - //SA1.Executing = !SA1.Waiting; - } + Memory.FillRAM[0x220b] &= ~0x20; } static void S9xSA1ReadVariableLengthData (bool8 inc, bool8 no_shift) @@ -1096,6 +1053,10 @@ void S9xSA1SetPCBase (uint32 address) SA1Registers.PBPC = address & 0xffffff; SA1.ShiftedPB = address & 0xff0000; + // FIXME + SA1.MemSpeed = memory_speed(address); + SA1.MemSpeedx2 = SA1.MemSpeed << 1; + uint8 *GetAddress = SA1.Map[(address & 0xffffff) >> MEMMAP_SHIFT]; if (GetAddress >= (uint8 *) CMemory::MAP_LAST) diff --git a/sa1.h b/sa1.h index 7849c8c8..eef38a20 100644 --- a/sa1.h +++ b/sa1.h @@ -198,32 +198,33 @@ struct SSA1 uint8 _Zero; uint8 _Negative; uint8 _Overflow; - bool8 CPUExecuting; uint32 ShiftedPB; uint32 ShiftedDB; uint32 Flags; + int32 Cycles; + int32 PrevCycles; uint8 *PCBase; - bool8 IRQActive; - bool8 Waiting; bool8 WaitingForInterrupt; - uint32 WaitAddress; - uint32 WaitCounter; - uint32 PBPCAtOpcodeStart; - uint8 *WaitByteAddress1; - uint8 *WaitByteAddress2; uint8 *Map[MEMMAP_NUM_BLOCKS]; uint8 *WriteMap[MEMMAP_NUM_BLOCKS]; uint8 *BWRAM; - bool8 Executing; - bool8 overflow; bool8 in_char_dma; - int16 op1; - int16 op2; + bool8 TimerIRQLastState; + uint16 HTimerIRQPos; + uint16 VTimerIRQPos; + int16 HCounter; + int16 VCounter; + int16 PrevHCounter; + int32 MemSpeed; + int32 MemSpeedx2; int32 arithmetic_op; - int64 sum; + uint16 op1; + uint16 op2; + uint64 sum; + bool8 overflow; uint8 VirtualBitmapFormat; uint8 variable_bit_pos; }; @@ -263,13 +264,8 @@ uint8 S9xGetSA1 (uint32); void S9xSetSA1 (uint8, uint32); void S9xSA1Init (void); void S9xSA1MainLoop (void); -void S9xSA1ExecuteDuringSleep (void); void S9xSA1PostLoadState (void); -#define SNES_IRQ_SOURCE (1 << 7) -#define TIMER_IRQ_SOURCE (1 << 6) -#define DMA_IRQ_SOURCE (1 << 5) - static inline void S9xSA1UnpackStatus (void) { SA1._Zero = (SA1Registers.PL & Zero) == 0; diff --git a/sa1cpu.cpp b/sa1cpu.cpp index b90092fb..994e240c 100644 --- a/sa1cpu.cpp +++ b/sa1cpu.cpp @@ -221,59 +221,89 @@ #define StackRelative SA1StackRelative #define StackRelativeIndirectIndexed SA1StackRelativeIndirectIndexed -//#undef CPU_SHUTDOWN #define SA1_OPCODES #include "cpuops.cpp" +static void S9xSA1UpdateTimer (void); + void S9xSA1MainLoop (void) { - if (SA1.Flags & NMI_FLAG) + if (Memory.FillRAM[0x2200] & 0x60) { - if (Memory.FillRAM[0x2200] & 0x10) - { - SA1.Flags &= ~NMI_FLAG; - Memory.FillRAM[0x2301] |= 0x10; - - if (SA1.WaitingForInterrupt) - { - SA1.WaitingForInterrupt = FALSE; - SA1Registers.PCw++; - } - - S9xSA1Opcode_NMI(); - } + SA1.Cycles += 6; // FIXME + S9xSA1UpdateTimer(); + return; } - if (SA1.Flags & IRQ_FLAG) + // SA-1 NMI + if ((Memory.FillRAM[0x2200] & 0x10) && !(Memory.FillRAM[0x220b] & 0x10)) { - if (SA1.IRQActive) + Memory.FillRAM[0x2301] |= 0x10; + Memory.FillRAM[0x220b] |= 0x10; + + if (SA1.WaitingForInterrupt) { + SA1.WaitingForInterrupt = FALSE; + SA1Registers.PCw++; + } + + S9xSA1Opcode_NMI(); + } + else + if (!SA1CheckFlag(IRQ)) + { + // SA-1 Timer IRQ + if ((Memory.FillRAM[0x220a] & 0x40) && !(Memory.FillRAM[0x220b] & 0x40)) + { + Memory.FillRAM[0x2301] |= 0x40; + if (SA1.WaitingForInterrupt) { SA1.WaitingForInterrupt = FALSE; SA1Registers.PCw++; } - if (!SA1CheckFlag(IRQ)) - S9xSA1Opcode_IRQ(); + S9xSA1Opcode_IRQ(); } else - SA1.Flags &= ~IRQ_FLAG; + // SA-1 DMA IRQ + if ((Memory.FillRAM[0x220a] & 0x20) && !(Memory.FillRAM[0x220b] & 0x20)) + { + Memory.FillRAM[0x2301] |= 0x20; + + if (SA1.WaitingForInterrupt) + { + SA1.WaitingForInterrupt = FALSE; + SA1Registers.PCw++; + } + + S9xSA1Opcode_IRQ(); + } + else + // SA-1 IRQ + if ((Memory.FillRAM[0x2200] & 0x80) && !(Memory.FillRAM[0x220b] & 0x80)) + { + Memory.FillRAM[0x2301] |= 0x80; + + if (SA1.WaitingForInterrupt) + { + SA1.WaitingForInterrupt = FALSE; + SA1Registers.PCw++; + } + + S9xSA1Opcode_IRQ(); + } } - for (int i = 0; i < 3 && SA1.Executing; i++) + for (int i = 0; i < 3 && !(Memory.FillRAM[0x2200] & 0x60); i++) { #ifdef DEBUGGER if (SA1.Flags & TRACE_FLAG) S9xSA1Trace(); #endif - #ifdef CPU_SHUTDOWN - SA1.PBPCAtOpcodeStart = SA1Registers.PBPC; - #endif - register uint8 Op; register struct SOpcodes *Opcodes; @@ -299,4 +329,71 @@ void S9xSA1MainLoop (void) Registers.PCw++; (*Opcodes[Op].S9xOpcode)(); } + + S9xSA1UpdateTimer(); +} + +static void S9xSA1UpdateTimer (void) // FIXME +{ + SA1.PrevHCounter = SA1.HCounter; + + if (Memory.FillRAM[0x2210] & 0x80) + { + SA1.HCounter += (SA1.Cycles - SA1.PrevCycles); + if (SA1.HCounter >= 0x800) + { + SA1.HCounter -= 0x800; + SA1.PrevHCounter -= 0x800; + if (++SA1.VCounter >= 0x200) + SA1.VCounter = 0; + } + } + else + { + SA1.HCounter += (SA1.Cycles - SA1.PrevCycles); + if (SA1.HCounter >= Timings.H_Max_Master) + { + SA1.HCounter -= Timings.H_Max_Master; + SA1.PrevHCounter -= Timings.H_Max_Master; + if (++SA1.VCounter >= Timings.V_Max_Master) + SA1.VCounter = 0; + } + } + + if (SA1.Cycles >= Timings.H_Max_Master) + SA1.Cycles -= Timings.H_Max_Master; + + SA1.PrevCycles = SA1.Cycles; + + bool8 thisIRQ = Memory.FillRAM[0x2210] & 0x03; + + if (Memory.FillRAM[0x2210] & 0x01) + { + if (SA1.PrevHCounter >= SA1.HTimerIRQPos * ONE_DOT_CYCLE || SA1.HCounter < SA1.HTimerIRQPos * ONE_DOT_CYCLE) + thisIRQ = FALSE; + } + + if (Memory.FillRAM[0x2210] & 0x02) + { + if (SA1.VCounter != SA1.VTimerIRQPos * ONE_DOT_CYCLE) + thisIRQ = FALSE; + } + + // SA-1 Timer IRQ control + if (!SA1.TimerIRQLastState && thisIRQ) + { + Memory.FillRAM[0x2301] |= 0x40; + if (Memory.FillRAM[0x220a] & 0x40) + { + Memory.FillRAM[0x220b] &= ~0x40; + #ifdef DEBUGGER + S9xTraceFormattedMessage("--- SA-1 Timer IRQ triggered prev HC:%04d curr HC:%04d HTimer:%d Pos:%04d VTimer:%d Pos:%03d", + SA1.PrevHCounter, SA1.HCounter, + (Memory.FillRAM[0x2210] & 0x01) ? 1 : 0, SA1.HTimerIRQPos * ONE_DOT_CYCLE, + (Memory.FillRAM[0x2210] & 0x02) ? 1 : 0, SA1.VTimerIRQPos); + #endif + } + } + + SA1.TimerIRQLastState = thisIRQ; } diff --git a/snapshot.cpp b/snapshot.cpp index 67dd55a9..b0d7791e 100644 --- a/snapshot.cpp +++ b/snapshot.cpp @@ -342,7 +342,7 @@ struct SnapshotScreenshotInfo static struct Obsolete { - uint8 reserved; + uint8 CPU_IRQActive; } Obsolete; #define STRUCT struct SCPUState @@ -353,7 +353,7 @@ static FreezeData SnapCPU[] = INT_ENTRY(6, PrevCycles), INT_ENTRY(6, V_Counter), INT_ENTRY(6, Flags), - INT_ENTRY(6, IRQActive), + OBSOLETE_INT_ENTRY(6, 7, CPU_IRQActive), INT_ENTRY(6, IRQPending), INT_ENTRY(6, MemSpeed), INT_ENTRY(6, MemSpeedx2), @@ -366,9 +366,14 @@ static FreezeData SnapCPU[] = INT_ENTRY(6, WhichEvent), INT_ENTRY(6, NextEvent), INT_ENTRY(6, WaitingForInterrupt), - INT_ENTRY(6, WaitAddress), - INT_ENTRY(6, WaitCounter), - INT_ENTRY(6, PBPCAtOpcodeStart) + DELETED_INT_ENTRY(6, 7, WaitAddress, 4), + DELETED_INT_ENTRY(6, 7, WaitCounter, 4), + DELETED_INT_ENTRY(6, 7, PBPCAtOpcodeStart, 4), + INT_ENTRY(7, NMILine), + INT_ENTRY(7, IRQLine), + INT_ENTRY(7, IRQTransition), + INT_ENTRY(7, IRQLastState), + INT_ENTRY(7, IRQExternal) }; #undef STRUCT @@ -576,11 +581,11 @@ static FreezeData SnapTimings[] = INT_ENTRY(6, DMACPUSync), INT_ENTRY(6, NMIDMADelay), INT_ENTRY(6, IRQPendCount), - INT_ENTRY(6, APUSpeedup) + INT_ENTRY(6, APUSpeedup), + INT_ENTRY(7, IRQTriggerCycles), + INT_ENTRY(7, APUAllowTimeOverflow) }; -#ifndef ZSNES_FX - #undef STRUCT #define STRUCT struct FxRegs_s @@ -642,24 +647,22 @@ static FreezeData SnapFX[] = INT_ENTRY(6, vSCBRDirty) }; -#endif - #undef STRUCT #define STRUCT struct SSA1 static FreezeData SnapSA1[] = { - INT_ENTRY(6, CPUExecuting), + DELETED_INT_ENTRY(6, 7, CPUExecuting, 1), INT_ENTRY(6, ShiftedPB), INT_ENTRY(6, ShiftedDB), INT_ENTRY(6, Flags), - INT_ENTRY(6, IRQActive), - INT_ENTRY(6, Waiting), + DELETED_INT_ENTRY(6, 7, IRQActive, 1), + DELETED_INT_ENTRY(6, 7, Waiting, 1), INT_ENTRY(6, WaitingForInterrupt), - INT_ENTRY(6, WaitAddress), - INT_ENTRY(6, WaitCounter), - INT_ENTRY(6, PBPCAtOpcodeStart), - INT_ENTRY(6, Executing), + DELETED_INT_ENTRY(6, 7, WaitAddress, 4), + DELETED_INT_ENTRY(6, 7, WaitCounter, 4), + DELETED_INT_ENTRY(6, 7, PBPCAtOpcodeStart, 4), + DELETED_INT_ENTRY(6, 7, Executing, 1), INT_ENTRY(6, overflow), INT_ENTRY(6, in_char_dma), INT_ENTRY(6, op1), @@ -667,7 +670,17 @@ static FreezeData SnapSA1[] = INT_ENTRY(6, arithmetic_op), INT_ENTRY(6, sum), INT_ENTRY(6, VirtualBitmapFormat), - INT_ENTRY(6, variable_bit_pos) + INT_ENTRY(6, variable_bit_pos), + INT_ENTRY(7, Cycles), + INT_ENTRY(7, PrevCycles), + INT_ENTRY(7, TimerIRQLastState), + INT_ENTRY(7, HTimerIRQPos), + INT_ENTRY(7, VTimerIRQPos), + INT_ENTRY(7, HCounter), + INT_ENTRY(7, VCounter), + INT_ENTRY(7, PrevHCounter), + INT_ENTRY(7, MemSpeed), + INT_ENTRY(7, MemSpeedx2) }; #undef STRUCT @@ -1255,15 +1268,10 @@ bool8 S9xUnfreezeGame (const char *filename) void S9xFreezeToStream (STREAM stream) { char buffer[1024]; - uint8 *soundsnapshot = new uint8[SPC_SAVE_STATE_BLOCK_SIZE]; + uint8 *soundsnapshot = new uint8[SPC_SAVE_STATE_BLOCK_SIZE]; S9xSetSoundMute(TRUE); -#ifdef ZSNES_FX - if (Settings.SuperFX) - S9xSuperFXPreSaveState(); -#endif - sprintf(buffer, "%s:%04d\n", SNAPSHOT_MAGIC, SNAPSHOT_VERSION); WRITE_STREAM(buffer, strlen(buffer), stream); @@ -1298,13 +1306,11 @@ void S9xFreezeToStream (STREAM stream) FreezeStruct(stream, "TIM", &Timings, SnapTimings, COUNT(SnapTimings)); -#ifndef ZSNES_FX if (Settings.SuperFX) { GSU.avRegAddr = (uint8 *) &GSU.avReg; FreezeStruct(stream, "SFX", &GSU, SnapFX, COUNT(SnapFX)); } -#endif if (Settings.SA1) { @@ -1323,11 +1329,7 @@ void S9xFreezeToStream (STREAM stream) FreezeStruct(stream, "DP4", &DSP4, SnapDSP4, COUNT(SnapDSP4)); if (Settings.C4) -#ifndef ZSNES_C4 FreezeBlock (stream, "CX4", Memory.C4RAM, 8192); -#else - FreezeBlock (stream, "CX4", C4Ram, 8192); -#endif if (Settings.SETA == ST_010) FreezeStruct(stream, "ST0", &ST010, SnapST010, COUNT(SnapST010)); @@ -1405,11 +1407,6 @@ void S9xFreezeToStream (STREAM stream) } } -#ifdef ZSNES_FX - if (Settings.SuperFX) - S9xSuperFXPostSaveState(); -#endif - S9xSetSoundMute(FALSE); delete [] soundsnapshot; @@ -1510,11 +1507,9 @@ int S9xUnfreezeFromStream (STREAM stream) if (result != SUCCESS) break; - #ifndef ZSNES_FX result = UnfreezeStructCopy(stream, "SFX", &local_superfx, SnapFX, COUNT(SnapFX), version); if (result != SUCCESS && Settings.SuperFX) break; - #endif result = UnfreezeStructCopy(stream, "SA1", &local_sa1, SnapSA1, COUNT(SnapSA1), version); if (result != SUCCESS && Settings.SA1) @@ -1637,13 +1632,11 @@ int S9xUnfreezeFromStream (STREAM stream) UnfreezeStructFromCopy(&Timings, SnapTimings, COUNT(SnapTimings), local_timing_data, version); - #ifndef ZSNES_FX if (local_superfx) { GSU.avRegAddr = (uint8 *) &GSU.avReg; UnfreezeStructFromCopy(&GSU, SnapFX, COUNT(SnapFX), local_superfx, version); } - #endif if (local_sa1) UnfreezeStructFromCopy(&SA1, SnapSA1, COUNT(SnapSA1), local_sa1, version); @@ -1661,11 +1654,7 @@ int S9xUnfreezeFromStream (STREAM stream) UnfreezeStructFromCopy(&DSP4, SnapDSP4, COUNT(SnapDSP4), local_dsp4, version); if (local_cx4_data) - #ifndef ZSNES_C4 memcpy(Memory.C4RAM, local_cx4_data, 8192); - #else - memcpy(C4Ram, local_cx4_data, 8192); - #endif if (local_st010) UnfreezeStructFromCopy(&ST010, SnapST010, COUNT(SnapST010), local_st010, version); @@ -1688,6 +1677,40 @@ int S9xUnfreezeFromStream (STREAM stream) if (local_bsx_data) UnfreezeStructFromCopy(&BSX, SnapBSX, COUNT(SnapBSX), local_bsx_data, version); + if (version < SNAPSHOT_VERSION) + { + printf("Converting old snapshot version %d to %d\n...", version, SNAPSHOT_VERSION); + + CPU.NMILine = (CPU.Flags & (1 << 7)) ? TRUE : FALSE; + CPU.IRQLine = (CPU.Flags & (1 << 11)) ? TRUE : FALSE; + CPU.IRQTransition = FALSE; + CPU.IRQLastState = FALSE; + CPU.IRQExternal = (Obsolete.CPU_IRQActive & ~(1 << 1)) ? TRUE : FALSE; + + switch (CPU.WhichEvent) + { + case 12: case 1: CPU.WhichEvent = 1; break; + case 2: case 3: CPU.WhichEvent = 2; break; + case 4: case 5: CPU.WhichEvent = 3; break; + case 6: case 7: CPU.WhichEvent = 4; break; + case 8: case 9: CPU.WhichEvent = 5; break; + case 10: case 11: CPU.WhichEvent = 6; break; + } + + if (local_sa1) // FIXME + { + SA1.Cycles = SA1.PrevCycles = 0; + SA1.TimerIRQLastState = FALSE; + SA1.HTimerIRQPos = Memory.FillRAM[0x2212] | (Memory.FillRAM[0x2213] << 8); + SA1.VTimerIRQPos = Memory.FillRAM[0x2214] | (Memory.FillRAM[0x2215] << 8); + SA1.HCounter = 0; + SA1.VCounter = 0; + SA1.PrevHCounter = 0; + SA1.MemSpeed = SLOW_ONE_CYCLE; + SA1.MemSpeedx2 = SLOW_ONE_CYCLE * 2; + } + } + CPU.Flags |= old_flags & (DEBUG_MODE_FLAG | TRACE_FLAG | SINGLE_STEP_FLAG | FRAME_ADVANCE_FLAG); ICPU.ShiftedPB = Registers.PB << 16; ICPU.ShiftedDB = Registers.DB << 16; @@ -1711,16 +1734,11 @@ int S9xUnfreezeFromStream (STREAM stream) S9xControlPostLoadState(&ctl_snap); - #ifndef ZSNES_FX if (local_superfx) { GSU.pfPlot = fx_PlotTable[GSU.vMode]; GSU.pfRpix = fx_PlotTable[GSU.vMode + 5]; } - #else - if (Settings.SuperFX) - S9xSuperFXPostLoadState(); - #endif if (local_sa1 && local_sa1_registers) { diff --git a/snapshot.h b/snapshot.h index b3ead241..55c72d7f 100644 --- a/snapshot.h +++ b/snapshot.h @@ -179,7 +179,7 @@ #define _SNAPSHOT_H_ #define SNAPSHOT_MAGIC "#!s9xsnp" -#define SNAPSHOT_VERSION 6 +#define SNAPSHOT_VERSION 7 #define SUCCESS 1 #define WRONG_FORMAT (-1) diff --git a/snes9x.cpp b/snes9x.cpp index d44a61f6..a4676144 100644 --- a/snes9x.cpp +++ b/snes9x.cpp @@ -467,9 +467,6 @@ void S9xLoadConfigFiles (char **argv, int argc) Settings.DisableGameSpecificHacks = !conf.GetBool("Hack::EnableGameSpecificHacks", true); Settings.BlockInvalidVRAMAccessMaster = !conf.GetBool("Hack::AllowInvalidVRAMAccess", false); - Settings.ShutdownMaster = conf.GetBool("Hack::SpeedHacks", false); - Settings.DisableIRQ = conf.GetBool("Hack::DisableIRQ", false); - Settings.DisableHDMA = conf.GetBool("Hack::DisableHDMA", false); Settings.HDMATimingHack = conf.GetInt ("Hack::HDMATiming", 100); // Netplay @@ -586,10 +583,7 @@ void S9xUsage (void) S9xMessage(S9X_INFO, S9X_USAGE, "-debug Set the Debugger flag"); S9xMessage(S9X_INFO, S9X_USAGE, "-trace Begin CPU instruction tracing"); #endif - S9xMessage(S9X_INFO, S9X_USAGE, "-noirq (Not recommended) Disable IRQ emulation"); - S9xMessage(S9X_INFO, S9X_USAGE, "-nohdma (Not recommended) Disable HDMA emulation"); S9xMessage(S9X_INFO, S9X_USAGE, "-hdmatiming <1-199> (Not recommended) Changes HDMA transfer timings"); - S9xMessage(S9X_INFO, S9X_USAGE, "-cpushutdown (Not recommended) Skip emulation until the next"); S9xMessage(S9X_INFO, S9X_USAGE, " event comes"); S9xMessage(S9X_INFO, S9X_USAGE, "-invalidvramaccess (Not recommended) Allow invalid VRAM access"); S9xMessage(S9X_INFO, S9X_USAGE, ""); @@ -851,12 +845,6 @@ char * S9xParseArgs (char **argv, int argc) else #endif - if (!strcasecmp(argv[i], "-noirq")) - Settings.DisableIRQ = TRUE; - else - if (!strcasecmp(argv[i], "-nohdma")) - Settings.DisableHDMA = TRUE; - else if (!strcasecmp(argv[i], "-hdmatiming")) { if (i + 1 < argc) @@ -869,9 +857,6 @@ char * S9xParseArgs (char **argv, int argc) S9xUsage(); } else - if (!strcasecmp(argv[i], "-cpushutdown")) - Settings.ShutdownMaster = TRUE; - else if (!strcasecmp(argv[i], "-invalidvramaccess")) Settings.BlockInvalidVRAMAccessMaster = FALSE; else diff --git a/snes9x.h b/snes9x.h index a58be71f..ccab8775 100644 --- a/snes9x.h +++ b/snes9x.h @@ -186,8 +186,6 @@ #include "65c816.h" #include "messages.h" -#define S9X_ACCURACY_LEVEL 3 - #ifdef ZLIB #include #define STREAM gzFile @@ -263,8 +261,6 @@ #define TRACE_FLAG (1 << 1) // debugger #define SINGLE_STEP_FLAG (1 << 2) // debugger #define BREAK_FLAG (1 << 3) // debugger -#define NMI_FLAG (1 << 7) // CPU -#define IRQ_FLAG (1 << 11) // CPU #define SCAN_KEYS_FLAG (1 << 4) // CPU #define HALTED_FLAG (1 << 12) // APU #define FRAME_ADVANCE_FLAG (1 << 9) @@ -274,12 +270,16 @@ struct SCPUState { + uint32 Flags; int32 Cycles; int32 PrevCycles; int32 V_Counter; - uint32 Flags; uint8 *PCBase; - bool8 IRQActive; + bool8 NMILine; + bool8 IRQLine; + bool8 IRQTransition; + bool8 IRQLastState; + bool8 IRQExternal; int32 IRQPending; int32 MemSpeed; int32 MemSpeedx2; @@ -293,9 +293,6 @@ struct SCPUState uint8 WhichEvent; int32 NextEvent; bool8 WaitingForInterrupt; - uint32 WaitAddress; - uint32 WaitCounter; - uint32 PBPCAtOpcodeStart; uint32 AutoSaveTimer; bool8 SRAMModified; }; @@ -303,17 +300,11 @@ struct SCPUState enum { HC_HBLANK_START_EVENT = 1, - HC_IRQ_1_3_EVENT = 2, - HC_HDMA_START_EVENT = 3, - HC_IRQ_3_5_EVENT = 4, - HC_HCOUNTER_MAX_EVENT = 5, - HC_IRQ_5_7_EVENT = 6, - HC_HDMA_INIT_EVENT = 7, - HC_IRQ_7_9_EVENT = 8, - HC_RENDER_EVENT = 9, - HC_IRQ_9_A_EVENT = 10, - HC_WRAM_REFRESH_EVENT = 11, - HC_IRQ_A_1_EVENT = 12 + HC_HDMA_START_EVENT = 2, + HC_HCOUNTER_MAX_EVENT = 3, + HC_HDMA_INIT_EVENT = 4, + HC_RENDER_EVENT = 5, + HC_WRAM_REFRESH_EVENT = 6 }; struct STimings @@ -327,12 +318,13 @@ struct STimings int32 HDMAInit; int32 HDMAStart; int32 NMITriggerPos; + int32 IRQTriggerCycles; int32 WRAMRefreshPos; int32 RenderPos; bool8 InterlaceField; int32 DMACPUSync; // The cycles to synchronize DMA and CPU. Snes9x cannot emulate correctly. int32 NMIDMADelay; // The delay of NMI trigger after DMA transfers. Snes9x cannot emulate correctly. - int32 IRQPendCount; // This value is just a hack, because Snes9x cannot emulate any events in an opcode. + int32 IRQPendCount; // This value is just a hack. int32 APUSpeedup; bool8 APUAllowTimeOverflow; }; @@ -405,12 +397,8 @@ struct SSettings char CartBName[PATH_MAX + 1]; bool8 DisableGameSpecificHacks; - bool8 ShutdownMaster; - bool8 Shutdown; bool8 BlockInvalidVRAMAccessMaster; bool8 BlockInvalidVRAMAccess; - bool8 DisableIRQ; - bool8 DisableHDMA; int32 HDMATimingHack; bool8 ForcedPause; diff --git a/unix/Makefile.in b/unix/Makefile.in index 29ce24fd..36cf6050 100644 --- a/unix/Makefile.in +++ b/unix/Makefile.in @@ -1,5 +1,3 @@ -@S9XZSNESFX@ -@S9XZSNESC4@ @S9XDEBUGGER@ @S9XNETPLAY@ @S9XZIP@ @@ -9,26 +7,11 @@ OS = `uname -s -r -m|sed \"s/ /-/g\"|tr \"[A-Z]\" \"[a-z]\"|tr \"/()\" \"___\"` BUILDDIR = . -OBJECTS = ../apu/apu.o ../apu/SNES_SPC.o ../apu/SNES_SPC_misc.o ../apu/SNES_SPC_state.o ../apu/SPC_DSP.o ../apu/SPC_Filter.o ../bsx.o ../cheats.o ../cheats2.o ../clip.o ../conffile.o ../controls.o ../cpu.o ../cpuexec.o ../cpuops.o ../crosshairs.o ../dma.o ../dsp.o ../dsp1.o ../dsp2.o ../dsp3.o ../dsp4.o ../gfx.o ../globals.o ../logger.o ../memmap.o ../movie.o ../obc1.o ../ppu.o ../reader.o ../sa1.o ../sa1cpu.o ../screenshot.o ../sdd1.o ../sdd1emu.o ../seta.o ../seta010.o ../seta011.o ../seta018.o ../snapshot.o ../snes9x.o ../spc7110.o ../srtc.o ../tile.o ../filter/2xsai.o ../filter/blit.o ../filter/epx.o ../filter/hq2x.o ../filter/snes_ntsc.o unix.o x11.o -DEFS = -DMITSHM -DCPU_SHUTDOWN -DSPC700_SHUTDOWN -DCORRECT_VRAM_READS - -ifdef S9XZSNESFX -OBJECTS += ../i386/fxemu2.o ../i386/fxemu2b.o ../i386/fxemu2c.o ../i386/fxtable.o ../i386/sfxproc.o ../i386/zsnes.o -else -OBJECTS += ../fxinst.o ../fxemu.o -ifdef S9XDEBUGGER -OBJECTS += ../fxdbg.o -endif -endif - -ifdef S9XZSNESC4 -OBJECTS += ../i386/c4.o ../i386/zsnesc4.o ../c4.o -else -OBJECTS += ../c4.o ../c4emu.o -endif +OBJECTS = ../apu/apu.o ../apu/SNES_SPC.o ../apu/SNES_SPC_misc.o ../apu/SNES_SPC_state.o ../apu/SPC_DSP.o ../apu/SPC_Filter.o ../bsx.o ../c4.o ../c4emu.o ../cheats.o ../cheats2.o ../clip.o ../conffile.o ../controls.o ../cpu.o ../cpuexec.o ../cpuops.o ../crosshairs.o ../dma.o ../dsp.o ../dsp1.o ../dsp2.o ../dsp3.o ../dsp4.o ../fxinst.o ../fxemu.o ../gfx.o ../globals.o ../logger.o ../memmap.o ../movie.o ../obc1.o ../ppu.o ../reader.o ../sa1.o ../sa1cpu.o ../screenshot.o ../sdd1.o ../sdd1emu.o ../seta.o ../seta010.o ../seta011.o ../seta018.o ../snapshot.o ../snes9x.o ../spc7110.o ../srtc.o ../tile.o ../filter/2xsai.o ../filter/blit.o ../filter/epx.o ../filter/hq2x.o ../filter/snes_ntsc.o unix.o x11.o +DEFS = -DMITSHM ifdef S9XDEBUGGER -OBJECTS += ../debug.o +OBJECTS += ../debug.o ../fxdbg.o endif ifdef S9XNETPLAY @@ -45,14 +28,13 @@ endif CCC = @CXX@ CC = @CC@ -NASM = @S9XNASM@ GASM = @CXX@ INCLUDES = -I. -I.. -I../apu/ -I../unzip/ -I../jma/ -I../filter/ CCFLAGS = @S9XFLGS@ @S9XDEFS@ $(DEFS) CFLAGS = $(CCFLAGS) -.SUFFIXES: .o .cpp .c .cc .h .m .i .s .asm .obj +.SUFFIXES: .o .cpp .c .cc .h .m .i .s .obj all: Makefile configure snes9x @@ -108,9 +90,6 @@ snes9x: $(OBJECTS) @echo Compiling $*.s sh-elf-as -little $*.s -o $@ -.asm.o: - $(NASM) -f elf -DELF @S9XDEFS@ -i../i386/ -o $@ $*.asm - .obj.o: cp $*.obj $*.o diff --git a/unix/configure.ac b/unix/configure.ac index c7f9dab1..75b5bca8 100644 --- a/unix/configure.ac +++ b/unix/configure.ac @@ -1,6 +1,6 @@ AC_PREREQ([2.60]) -AC_INIT([Snes9x], [1.52], [], [snes9x]) -AC_REVISION([$Revision: 1.52 $]) +AC_INIT([Snes9x], [1.53], [], [snes9x]) +AC_REVISION([$Revision: 1.53 $]) AC_CONFIG_SRCDIR([unix.cpp]) @@ -106,52 +106,6 @@ AC_S9X_COMPILER_FLAG([-Wall], [Wall]) AC_S9X_COMPILER_FLAG([-W], [W]) AC_S9X_COMPILER_FLAG([-Wno-unused-parameter], [Wno_unused_parameter]) -# Check if the CPU is x86. - -AC_MSG_CHECKING([whether the CPU is x86]) - -AC_CACHE_VAL([snes9x_cv_x86_cpu], -[ - case "$target" in - i686-*-* | i586-*-* | i486-*-* | i386-*-*) - snes9x_cv_x86_cpu="yes" - ;; - *) - snes9x_cv_x86_cpu="no" - ;; - esac -]) - -AC_MSG_RESULT([$snes9x_cv_x86_cpu]) - -# Enable ZSNES C4 and SuperFX assembler cores if CPU is x86. - -S9XZSNESFX="#S9XZSNESFX=1" -S9XZSNESC4="#S9XZSNESC4=1" -S9XNASM="" - -AC_ARG_ENABLE([zsnes_asm], - [AS_HELP_STRING([--enable-zsnes-asm], - [build with ZSNES C4 and SuperFX assembler cores if available (default: no)])], - [], [enable_zsnes_asm="no"]) - -if test "x$enable_zsnes_asm" = "xyes"; then - if test "x$snes9x_cv_x86_cpu" = "xyes"; then - AC_PATH_PROG([S9XNASM], [nasm], [no]) - if test "x$S9XNASM" != "xno"; then - S9XZSNESFX="S9XZSNESFX=1" - S9XZSNESC4="S9XZSNESC4=1" - S9XDEFS="$S9XDEFS -DZSNES_FX -DZSNES_C4" - else - AC_MSG_WARN([nasm not found. Build without ZSNES assembler cores.]) - enable_zsnes_asm="no" - fi - else - AC_MSG_WARN([Your CPU is not x86. Build without ZSNES assembler cores.]) - enable_zsnes_asm="no" - fi -fi - # Check if the OS is Linux. AC_MSG_CHECKING([whether the OS is Linux]) @@ -464,9 +418,6 @@ S9XLIBS="`echo \"$S9XLIBS\" | sed -e 's/^ *//'`" AC_SUBST(S9XFLGS) AC_SUBST(S9XDEFS) AC_SUBST(S9XLIBS) -AC_SUBST(S9XZSNESFX) -AC_SUBST(S9XZSNESC4) -AC_SUBST(S9XNASM) AC_SUBST(S9XDEBUGGER) AC_SUBST(S9XNETPLAY) AC_SUBST(S9XZIP) @@ -491,7 +442,6 @@ gamepad support...... $enable_gamepad GZIP support......... $enable_gzip ZIP support.......... $enable_zip JMA support.......... $enable_jma -using ZSNES asm...... $enable_zsnes_asm debugger............. $enable_debugger EOF diff --git a/unix/x11.cpp b/unix/x11.cpp index cf509496..abcb3b74 100644 --- a/unix/x11.cpp +++ b/unix/x11.cpp @@ -451,7 +451,6 @@ const char * S9xParseDisplayConfig (ConfigFile &conf, int pass) keymaps.push_back(strpair_t("K00:3", "ToggleBG2")); keymaps.push_back(strpair_t("K00:4", "ToggleBG3")); keymaps.push_back(strpair_t("K00:5", "ToggleSprites")); - keymaps.push_back(strpair_t("K00:0", "ToggleHDMA")); keymaps.push_back(strpair_t("K00:9", "ToggleTransparency")); keymaps.push_back(strpair_t("K00:BackSpace", "ClipWindows")); keymaps.push_back(strpair_t("K00:A+Escape", "Debugger"));