Glitch City Laboratories Archives

Glitch City Laboratories closed on 1 September 2020 (announcement). This is an archived copy of a thread from Glitch City Laboratories Forums.

You can join Glitch City Research Institute to ask questions or discuss current developments.

You may also download the archive of this forum in .tar.gz, .sql.gz, or .sqlite.gz formats.

Generation I Glitch Discussion

Gen I: How to break the money cap and other glitchy-richness - Page 2

Re: Gen I: How to break the money cap and other glitchy-richness

Posted by: The G-Meister
Date: 2015-10-13 17:19:40
So I just hacked in bgb to prove that I know what I'm going for. I'll use a tad of arbitrary code execution to set the amount of PC Items to 51 (or anything over 50), then buy/collect 93 casino chips.

I also just had a look at the money, and even though it was "99 99 99" in the code, I don't think it's the same way on the actual cartridge… I'll use ACE to set it to 63 (equivalent to 99 in decimal) and see if the result is 63 or 99. If it's 63 there's a discrepancy in the emulator in a perhaps major way. If it's 99… then there's still the capping mystery to be solved :/

If this first option is the case, it's a shame really, as all other aspects of bgb are really good. Also, is it an allowed emulator in speedruns?

I will have some free time tomorrow to test :P

[Edit]: Yeah, BGB's allowed for all Gen I speedruns… could this discovery get it banned? Or might it just be a version discrepancy?

Re: Gen I: How to break the money cap and other glitchy-richness

Posted by: Krys3000
Date: 2015-10-14 04:31:09
Yep, let me know when you did your test! BTW, I am using VBA, not BGB, personally. So if there is really a difference between real cartridge and emulated games, it is not limited to BGB :)

I don't think it could get it banned for the speedruns. But I don't know exactly how speedrunners rule themselves.

Re: Gen I: How to break the money cap and other glitchy-richness

Posted by: The G-Meister
Date: 2015-10-14 10:37:05
Turns out that a decimal of 93 is stored as a hexadecimal of 93… It's probably just the capping error then.

Maybe it's a discrepancy in the ROM rather than the emulator then?

Re: Gen I: How to break the money cap and other glitchy-richness

Posted by: Krys3000
Date: 2015-10-14 13:02:19
I think it's normal that dec:93 is hex:93 even in the cartridge. It should be the normal behavior. The very difference here seems to be that, using an emulator, the value 9F,  for example, is displayed, but changed to 99 if you spend money/lose coins. This prevents the glitcher to cheat by going "above" the cap and get more money he should have.

I mean, maybe when the emulator "reads" an impossible value in those adresses, it recalculates it to bring it to a normal value, but the real game doesn't.

Re: Gen I: How to break the money cap and other glitchy-richness

Posted by: Krys3000
Date: 2015-10-14 14:26:50
On a side note regarding the actual subject of the thread, if you perform Save Abuse and switch Pokémon 1 with Pokémon 11, you will get FF FF FF Pokédollars.

However, when I tried to buy something, it rolled back to 00 00 00. I wonder what would have happened in real cartridge.

Re: Gen I: How to break the money cap and other glitchy-richness

Posted by: The G-Meister
Date: 2015-10-14 14:49:23
Hmm, interesting. I'm for sure not gonna try that because I value my save file like it's my baby, but in case I ever reset for a more important reason I'll bear that in mind :P

Re: Gen I: How to break the money cap and other glitchy-richness

Posted by: pokechu22
Date: 2015-10-14 15:00:48

So I just hacked in bgb to prove that I know what I'm going for. I'll use a tad of arbitrary code execution to set the amount of PC Items to 51 (or anything over 50), then buy/collect 93 casino chips.

I also just had a look at the money, and even though it was "99 99 99" in the code, I don't think it's the same way on the actual cartridge… I'll use ACE to set it to 63 (equivalent to 99 in decimal) and see if the result is 63 or 99. If it's 63 there's a discrepancy in the emulator in a perhaps major way. If it's 99… then there's still the capping mystery to be solved :/


Remember, money is stored as a binary coded decimal - a value of 0x999999 in RAM is $999999.  (A bug in the way binary coded decimals work is the cause of the ZZAZZ glitch).

Re: Gen I: How to break the money cap and other glitchy-richness

Posted by: Krys3000
Date: 2015-10-14 15:06:15
Yep. But it doesn't explain why in his real cartridge, artificially getting 9F behave like a 9F value (meaning losing 2 will give 9D), and in emulated games, 9F is considered 99.

Re: Gen I: How to break the money cap and other glitchy-richness

Posted by: The G-Meister
Date: 2015-10-14 15:23:10

Also, each number seems to be capped in the code, but I can't remember where I saw this in the code…


Do you remember anything about that? Can someone else help us out here? If we can get the capping code on the ROM we might be able to look a bit further. Sadly, I'm rather inexperienced when it comes to how the ROM works :/

Re: Gen I: How to break the money cap and other glitchy-richness

Posted by: ISSOtm
Date: 2015-10-15 05:44:16
Okay, I can give you some info (I've been looking quite far into Pokéred for my recent ROM Hacking Suite).

I currently don't know how the game deals with money internally, but I can tell you so far that the game must be using TX_BCD (that is, character $02) to display money. We'd need to check for any graphical vs. internal inconsistencies (I mean, maybe it is really 9F but looks like 99)
That should be checked on an emulator.

I've got a Pokémon Rouge cartridge, if you tell me what I should do to get 9F $, I'll do it ASAP (that is, during the same week #IhaveNoLife)

Re: Gen I: How to break the money cap and other glitchy-richness

Posted by: Krys3000
Date: 2015-10-15 07:07:31
Well, "9F" Pokédollars is always displayed as 9[tile] with this tile being the one matching with F quantities (see [img=http://www.prama-initiative.com/RBJ/iug5.png]http://TheZZAZZGlitch's index[/img]). The differences that seem to occur is that on real cartridge, spending 2 will get you 9D, displayed as 9[tile] with the tile now being the D one. Which somehow is a normal behaviour, I guess.

In VBA and BGB however, when you spend 2, the game "understand" 9F being a wrong value, changes it to 99 and lowers by 2. In the end you get 97, graphically and internally (as value for this address).

Anyway if you want to try, you can get a lettered amount of money with either Item Underflow, GC RAM Manipulation or 8F.

Re: Gen I: How to break the money cap and other glitchy-richness

Posted by: The G-Meister
Date: 2015-10-15 10:35:37

The differences that seem to occur is that on real cartridge, spending 2 will get you 9D, displayed as 9[tile] with the tile now being the D one. Which somehow is a normal behaviour, I guess.


Or it's normal until proved otherwise. More testing needs be done :P


I've got a Pokémon Rouge cartridge, if you tell me what I should do to get 9F $, I'll do it ASAP (that is, during the same week #IhaveNoLife)


That's what this thread's all about! There's some instructions on the first page, first post. The GC RAM Manipulation version is hard to pull off with a normal "haven't-done-any-other-glitches-before" save file, because it requires a hefty amount of money to start off. The item underflow method on the other hand, while it may require you to have a x255 stack of items, it requires you to have less than 10000 Pokémon Dollars. The nugget method won't get you a glitched symbol.

Hope this helped

Re: Gen I: How to break the money cap and other glitchy-richness

Posted by: Krys3000
Date: 2015-10-15 11:38:29
The item underflow method on the other hand, while it may require you to have a x255 stack of items, it requires you to have less than 10000 Pokémon Dollars. The nugget method won't get you a glitched symbol.


Just to mention that the underflow might be complicated or impossible to get without GC RAM Manipulation if ISSOtm doesn't have an available trainer anymore. In french games, it's impossible to encounter any MissingNo. other than the fossil/ghost forms so the chances he has those specific letters for the Old Man Trick are probably low  ;D

Re: Gen I: How to break the money cap and other glitchy-richness

Posted by: ISSOtm
Date: 2015-10-15 11:42:27
That's what this thread's all about! There's some instructions on the first page, first post. The GC RAM Manipulation version is hard to pull off with a normal "haven't-done-any-other-glitches-before" save file, because it requires a hefty amount of money to start off.

No, having 34XX is sufficient for GC RAM manipulation (I used it to get 6F).
So, the game still displayed a wrong letter after buying a 250$ Anti-Para (I had 6FXX, now it's 6<glich tile>XX).

I'll look up in the code to see how money works.

Re: Gen I: How to get a decent amount of Pokédollars (money)

Posted by: SatoMew
Date: 2015-10-15 11:59:21

Amount of money is stored in binary-coded decimal, if I remember correctly.


Yup, the Generation I games use BCD for storing monetary values. IIMarckus says the Generation II games use regular binary integers but that Teru-sama prices are still stored using BCD, which is another hint at them being early development stuff (after all, two of the Teru-sama are leftover Generation I items).