Skip to content

Commit

Permalink
Disable room skipper by default
Browse files Browse the repository at this point in the history
  • Loading branch information
commandblockguy committed Nov 18, 2021
1 parent 111fc17 commit f412427
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/classic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1282,8 +1282,8 @@ void _update() {
}
}

if(kb_IsDown(kb_KeyYequ)) {
next_room();
if(has_cheats()) {
if(kb_IsDown(kb_KeyYequ) && !is_title()) next_room();
}

profiler_add(obj_update);
Expand Down
10 changes: 9 additions & 1 deletion src/emu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ static struct {

static int gameFrame = 0;
static int timerOffset = 0;
static int cheatState = 0;

const uint8_t mask[] = {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
Expand Down Expand Up @@ -95,8 +96,11 @@ void update() {
gfx_SwapDraw();
}
profiler_end(total);
if(kb_IsDown(kb_KeyGraph)) profiler_print();
if(cheatState == 0 && kb_IsDown(kb_KeyPower)) cheatState++;
if(cheatState == 1 && kb_IsDown(kb_KeyMath)) cheatState++;
if(cheatState == 2 && kb_IsDown(kb_KeySto)) cheatState++;
do {
if(kb_IsDown(kb_KeyGraph)) profiler_print();
if(kb_IsDown(kb_KeyClear)) return;
} while(FRAMESKIP && (int)(timerOffset + timer_Get(1)) < 0);
profiler_tick();
Expand Down Expand Up @@ -280,6 +284,10 @@ int max(int a, int b) {
return a >= b ? a : b;
}

bool has_cheats() {
return cheatState == 3;
}

int sin_table[TRIG_PRECISION / 4];

void gen_lookups() {
Expand Down
2 changes: 2 additions & 0 deletions src/emu.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ int rnd(int max);
int min(int a, int b);
int max(int a, int b);

bool has_cheats();

void gen_lookups();

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

0 comments on commit f412427

Please sign in to comment.