Skip to content

Commit

Permalink
Fixed Slide Code cheat type
Browse files Browse the repository at this point in the history
Address increment is a u8 and value increment is a u16. The changes will make this work correctly:-

50000AA4 FFFF
801CC760 0400
which is a example slide code representing:-
801CC760 0400
801CC804 03FF
801CC8A8 03FE
801CC94C 03FD
801CC9F0 03FC
801CCA94 03FB
801CCB38 03FA
801CCBDC 03F9
801CCC80 03F8
801CCD24 03F7
  • Loading branch information
PugsyMAME authored and stenzek committed Dec 25, 2020
1 parent b468f64 commit c0cc0a3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/core/cheats.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1144,8 +1144,8 @@ void CheatCode::Apply() const
}

const u32 slide_count = (inst.first >> 8) & 0xFFu;
const u32 address_increment = SignExtendN<8>(inst.first & 0xFFu);
const u16 value_increment = SignExtendN<8>(Truncate16(inst.second & 0xFFu));
const u32 address_increment = inst.first & 0xFFu;
const u16 value_increment = Truncate16(inst.second);
const Instruction& inst2 = instructions[index + 1];
const InstructionCode write_type = inst2.code;
u32 address = inst2.address;
Expand Down

0 comments on commit c0cc0a3

Please sign in to comment.