User talk:Háčky: Difference between revisions

No edit summary
Line 30: Line 30:


Great add Háčky. Thanks for sharing. :) May I ask how you found the vending machine glitch? Did you find it by accident, thanks to the Pokémon Red disassembly, or documented somewhere else? If the code is documented in the Pokémon Red disassembly, may you share the relevant assembly please? Thanks in advance. [[User:Chickasaurus|Chickasaurus]] ([[User talk:Chickasaurus|talk]]) 21:55, 22 September 2015 (UTC)
Great add Háčky. Thanks for sharing. :) May I ask how you found the vending machine glitch? Did you find it by accident, thanks to the Pokémon Red disassembly, or documented somewhere else? If the code is documented in the Pokémon Red disassembly, may you share the relevant assembly please? Thanks in advance. [[User:Chickasaurus|Chickasaurus]] ([[User talk:Chickasaurus|talk]]) 21:55, 22 September 2015 (UTC)
:I saw it mentioned on [[Talk:Vending Machine#Buying lemonade with less than $350?]]. The code is disassembled in [https://github.com/iimarckus/pokered/blob/master/engine/menu/vending_machine.asm engine/menu/vending_machine.asm] but not fully documented. The key part is:
xor a
ld [hMoney], a
ld [hMoney + 2], a
ld a, $2
ld [hMoney + 1], a
call HasEnoughMoney
jr nc, .enoughMoney
:This stores the BCD value 00 02 00 in hMoney and checks if you have that amount, rather than the actual price of the item you’ve selected. I’d guess that the vending machine was originally programmed to sell one item for {{pdollar}}200 and someone forgot to change that part of the code when adding the other drinks. —[[User:Háčky|Háčky]] ([[User talk:Háčky|talk]]) 22:43, 22 September 2015 (UTC)
49

edits