Skip to content

Commit 41d88cd

Browse files
author
aquanull
committed
Fixed V7/V8 CPUReset(). Some obscure desync problems related to reset now gone.
Fixed v20 GB Frame Timing Hack... though it doesn't seem useful at all. Fixed menu items of some settings. And some more minor fixes/adjustments. TODO: Fix V8 GBA savestate save/load?
1 parent 02023b1 commit 41d88cd

29 files changed

+354
-319
lines changed

src/common/SystemGlobals.cpp

Lines changed: 41 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -17,36 +17,35 @@ EmulatedSystemCounters systemCounters =
1717
true,
1818
};
1919

20-
int emulating = 0;
20+
int emulating = 0;
2121

2222
u8 *bios = NULL;
2323
u8 *pix = NULL;
2424

25-
u16 currentButtons[4] = { 0, 0, 0, 0 }; // constrain: never contains hacked buttons, only the lower 16 bits of each are used
26-
u16 lastKeys = 0;
27-
int32 sensorX = 0;
28-
int32 sensorY = 0;
25+
u16 currentButtons[4] = { 0, 0, 0, 0 }; // constrain: never contains hacked buttons, only the lower 16 bits of each are used
26+
u16 lastKeys = 0;
27+
int32 sensorX = 0;
28+
int32 sensorY = 0;
2929

3030
bool newFrame = true;
3131
bool8 speedup = false;
3232
u32 extButtons = 0;
3333
bool8 capturePrevious = false;
3434
int32 captureNumber = 0;
3535

36-
soundtick_t USE_TICKS_AS = 0;
37-
soundtick_t soundTickStep = soundQuality * USE_TICKS_AS;
38-
soundtick_t soundTicks = 0;
36+
soundtick_t USE_TICKS_AS = 0;
37+
soundtick_t soundTickStep = soundQuality * USE_TICKS_AS;
38+
soundtick_t soundTicks = 0;
3939

40-
u32 soundIndex = 0;
41-
int32 soundPaused = 1;
42-
int32 soundPlay = 0;
43-
u32 soundNextPosition = 0;
44-
45-
u8 soundBuffer[6][735];
46-
u32 soundBufferLen = 1470;
47-
u32 soundBufferTotalLen = 14700;
48-
u32 soundBufferIndex = 0;
40+
u32 soundIndex = 0;
41+
int32 soundPaused = 1;
42+
int32 soundPlay = 0;
43+
u32 soundNextPosition = 0;
4944

45+
u8 soundBuffer[6][735];
46+
u32 soundBufferLen = 1470;
47+
u32 soundBufferTotalLen = 14700;
48+
u32 soundBufferIndex = 0;
5049

5150
u16 soundFinalWave[1470];
5251
u16 soundFrameSound[735 * 30 * 2]; // for avi logging
@@ -57,37 +56,41 @@ int tempSaveID = 0;
5756
int tempSaveAttempts = 0;
5857

5958
// settings
60-
bool8 synchronize = true;
61-
int32 gbFrameSkip = 0;
62-
int32 frameSkip = 0;
59+
bool synchronize = true;
60+
int32 gbFrameSkip = 0;
61+
int32 frameSkip = 0;
6362

64-
bool8 cpuDisableSfx = false;
63+
bool cpuDisableSfx = false;
6564
int32 layerSettings = 0xff00;
6665

6766
#ifdef USE_GB_CORE_V7
68-
bool8 gbNullInputHackEnabled = false;
69-
bool8 gbNullInputHackTempEnabled = false;
67+
bool gbNullInputHackEnabled = false;
68+
bool gbNullInputHackTempEnabled = false;
69+
#else
70+
bool gbV20GBFrameTimingHack = false;
71+
bool gbV20GBFrameTimingHackTemp = false;
7072
#endif
7173

7274
#ifdef USE_GBA_CORE_V7
73-
bool8 memLagEnabled = false;
74-
bool8 memLagTempEnabled = false;
75+
bool memLagEnabled = false;
76+
bool memLagTempEnabled = false;
7577
#endif
7678

77-
bool8 useOldFrameTiming = false;
78-
bool8 useBios = false;
79-
bool8 skipBios = false;
80-
bool8 skipSaveGameBattery = false;
81-
bool8 skipSaveGameCheats = false;
82-
bool8 cheatsEnabled = true;
83-
bool8 mirroringEnable = false;
79+
bool8 useOldFrameTiming = false;
80+
bool8 useBios = false;
81+
bool8 skipBios = false;
82+
bool8 skipSaveGameBattery = false;
83+
bool8 skipSaveGameCheats = false;
84+
bool8 cheatsEnabled = true;
85+
bool8 mirroringEnable = false;
8486

8587
bool8 cpuEnhancedDetection = true;
8688
int32 cpuSaveType = 0;
8789

88-
int32 soundVolume = 0;
89-
int32 soundQuality = 2;
90-
bool8 soundEcho = false;
91-
bool8 soundLowPass = false;
92-
bool8 soundReverse = false;
93-
bool8 soundOffFlag = false;
90+
int32 soundVolume = 0;
91+
int32 soundQuality = 2;
92+
bool8 soundEcho = false;
93+
bool8 soundLowPass = false;
94+
bool8 soundReverse = false;
95+
int32 soundEnableFlag = 0x3ff;
96+
bool8 soundOffFlag = false;

src/common/SystemGlobals.h

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -86,35 +86,39 @@ extern int32 soundPaused;
8686
extern int32 soundPlay;
8787
extern u32 soundNextPosition;
8888

89-
extern u8 soundBuffer[6][735];
90-
extern u32 soundBufferLen;
91-
extern u32 soundBufferTotalLen;
92-
extern u32 soundBufferIndex;
89+
extern u8 soundBuffer[6][735];
90+
extern u32 soundBufferLen;
91+
extern u32 soundBufferTotalLen;
92+
extern u32 soundBufferIndex;
9393

9494
extern u16 soundFinalWave[1470];
9595
extern u16 soundFrameSound[735 * 30 * 2];
9696
extern int32 soundFrameSoundWritten;
9797

98-
extern bool tempSaveSafe;
99-
extern int tempSaveID;
100-
extern int tempSaveAttempts;
98+
extern bool tempSaveSafe;
99+
extern int tempSaveID;
100+
extern int tempSaveAttempts;
101101

102-
//settings
103-
extern bool8 synchronize;
102+
// settings that should have no effect on timing
103+
extern bool synchronize; // ... except this one?
104104
extern int32 gbFrameSkip;
105105
extern int32 frameSkip;
106106

107-
extern bool8 cpuDisableSfx;
107+
extern bool cpuDisableSfx;
108108
extern int32 layerSettings;
109109

110+
// other settings
110111
#ifdef USE_GB_CORE_V7
111-
extern bool8 gbNullInputHackEnabled;
112-
extern bool8 gbNullInputHackTempEnabled;
112+
extern bool gbNullInputHackEnabled;
113+
extern bool gbNullInputHackTempEnabled;
114+
#else
115+
extern bool gbV20GBFrameTimingHack;
116+
extern bool gbV20GBFrameTimingHackTemp;
113117
#endif
114118

115119
#ifdef USE_GBA_CORE_V7
116-
extern bool8 memLagEnabled;
117-
extern bool8 memLagTempEnabled;
120+
extern bool memLagEnabled;
121+
extern bool memLagTempEnabled;
118122
#endif
119123

120124
extern bool8 useOldFrameTiming;
@@ -133,7 +137,7 @@ extern int32 soundQuality;
133137
extern bool8 soundEcho;
134138
extern bool8 soundLowPass;
135139
extern bool8 soundReverse;
136-
extern bool8 soundOffFlag;
137140
extern int32 soundEnableFlag;
141+
extern bool8 soundOffFlag;
138142

139143
#endif

0 commit comments

Comments
 (0)