Skip to content

Instantly share code, notes, and snippets.

@bbayles
Created January 12, 2026 12:59
Show Gist options
  • Select an option

  • Save bbayles/0014b538e87522f311f1cc7ab1c1ea4d to your computer and use it in GitHub Desktop.

Select an option

Save bbayles/0014b538e87522f311f1cc7ab1c1ea4d to your computer and use it in GitHub Desktop.
Newman/Haas Racing cheat code handler
void title_cheat_handler_01(void)
{
int buffer_index_1;
int buffer_index_2;
if ((249 < cheat_timer_01) && (cheat_entry_active == '\0')) goto LAB_80046a18;
if (cheat_timer_01 < 0xfc) {
cheat_timer_01 = cheat_timer_01 + 1;
}
if (cheat_entry_active != '\0') {
if (direction_01 == 'L') {
if ((p1_held_01 & 0x80) == 0) {
if (((p1_held_01 & 0x20) == 0) || (buffer_index_1 = buffer_pos_01 + 1, 99 < buffer_pos_01))
{
LAB_80046960:
cheat_timer_01 = cheat_timer_01 + 1;
}
else {
buffer_pos_01 = (short)buffer_index_1;
(&letter_buffer_00)[buffer_index_1 * 0x10000 >> 0x10] = 1;
direction_01 = 'R';
LAB_80046950:
cheat_timer_01 = 0;
}
}
else {
LAB_800468e0:
(&letter_buffer_00)[buffer_pos_01] = (&letter_buffer_00)[buffer_pos_01] + '\x01';
cheat_timer_01 = 0;
}
}
else if (direction_01 == 'R') {
if ((p1_held_01 & 0x20) == 0) {
if (((p1_held_01 & 0x80) == 0) || (buffer_index_2 = buffer_pos_01 + 1, 99 < buffer_pos_01))
goto LAB_80046960;
buffer_pos_01 = (short)buffer_index_2;
(&letter_buffer_00)[buffer_index_2 * 0x10000 >> 0x10] = 1;
direction_01 = 'L';
goto LAB_80046950;
}
goto LAB_800468e0;
}
}
if (((p1_held_01 & 0x80) == 0) || (cheat_entry_active != '\0')) {
if (((p1_held_01 & 0x20) != 0) && (cheat_entry_active == '\0')) {
direction_01 = 'R';
goto LAB_800469ec;
}
}
else {
direction_01 = 'L';
LAB_800469ec:
cheat_entry_active = cheat_entry_active + '\x01';
letter_buffer_00 = 1;
buffer_pos_01 = 0;
cheat_timer_01 = 0;
}
if (250 < cheat_timer_01) {
cheat_entry_active = '\0';
}
apply_cheat_effects_01();
LAB_80046a18:
if ((p1_held_01 & 0xc00) == 0xc00) {
cheat_timer_01 = 0;
}
return;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment