Skip to content

Commit f412427

Browse files
Disable room skipper by default
1 parent 111fc17 commit f412427

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

src/classic.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1282,8 +1282,8 @@ void _update() {
12821282
}
12831283
}
12841284

1285-
if(kb_IsDown(kb_KeyYequ)) {
1286-
next_room();
1285+
if(has_cheats()) {
1286+
if(kb_IsDown(kb_KeyYequ) && !is_title()) next_room();
12871287
}
12881288

12891289
profiler_add(obj_update);

src/emu.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ static struct {
3131

3232
static int gameFrame = 0;
3333
static int timerOffset = 0;
34+
static int cheatState = 0;
3435

3536
const uint8_t mask[] = {
3637
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
@@ -95,8 +96,11 @@ void update() {
9596
gfx_SwapDraw();
9697
}
9798
profiler_end(total);
99+
if(kb_IsDown(kb_KeyGraph)) profiler_print();
100+
if(cheatState == 0 && kb_IsDown(kb_KeyPower)) cheatState++;
101+
if(cheatState == 1 && kb_IsDown(kb_KeyMath)) cheatState++;
102+
if(cheatState == 2 && kb_IsDown(kb_KeySto)) cheatState++;
98103
do {
99-
if(kb_IsDown(kb_KeyGraph)) profiler_print();
100104
if(kb_IsDown(kb_KeyClear)) return;
101105
} while(FRAMESKIP && (int)(timerOffset + timer_Get(1)) < 0);
102106
profiler_tick();
@@ -280,6 +284,10 @@ int max(int a, int b) {
280284
return a >= b ? a : b;
281285
}
282286

287+
bool has_cheats() {
288+
return cheatState == 3;
289+
}
290+
283291
int sin_table[TRIG_PRECISION / 4];
284292

285293
void gen_lookups() {

src/emu.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ int rnd(int max);
4040
int min(int a, int b);
4141
int max(int a, int b);
4242

43+
bool has_cheats();
44+
4345
void gen_lookups();
4446

4547
#define DEGREES_TO_ANGLE(deg) ((unsigned)((float)(deg) * (1 << (24 - 3)) / 45))

0 commit comments

Comments
 (0)