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 II Glitch Discussion

Programming the Snake game in Pokemon Crystal in real hardware! - Page 1

Programming the Snake game in Pokemon Crystal in real hardware!

Posted by: Crystal_
Date: 2017-01-02 10:02:34
During the part 2 weeks I picked up my Game Boy Advance SP and my spanish Pokemon Crystal cart and was determined to do something cool with them now that we know so much about how to exploit ACE in these games. So I thought I'd pick up the code of my Snake program that I once implemented in Pokemon Silver using an emulator and ported it to spanish Crystal. Obviously, doing this stuff in real hardware isn't the same story since you can't memory hack your way into whatever you want to achieve, so I had to come up with more efficient ways to do different things.

So yeah, if you want to see how I did it, just follow this link! It includes a demonstration video and covers all the process with a lot of details. The end will seem familiar, since it's mostly what TheZZAZZGlitch did in order to implement Pong into Pokemon Blue. It was a bit harder considering that ACE in Gen 2 isn't as accessible though.

Or if you prefer, here's just the video with a ligher explanation:

https://www.youtube.com/watch?v=g2mCyh7Y2xM

Re: Programming the Snake game in Pokemon Crystal in real hardware!

Posted by: Torchickens
Date: 2017-01-04 19:05:42
Very cool document! :)

Re: Programming the Snake game in Pokemon Crystal in real hardware!

Posted by: andr2535
Date: 2017-03-20 12:03:22
Hi, I thought this was very interesting, but it doesn't work for the english version, so I thought I would make some sort of port.

I started on the assumption that the user already has an item pointing to the first box name.

So since some of the opcodes required for Crystal_'s implementation is missing from the english version I thought that since there is already a ram editor for the silver/gold coin case glitch
I could just edit that and make the box names point to the PC's first item.
http://pastebin.com/AEALLsqR

The assembled code:
p0'd0IéJ5
p0'm0(mn)éI5
'm55

Now that we can point to the PC's first item we need to get an item setup that can edit an arbitrary ram location, I have modified Crystal_'s
implementation of the RAM editor, such that it operates the same way as the coin case glitch one, except that you don't need specific move patterns
and it uses the BOX 4 name instead of BOX 9 name.(I hope it's alright me more or less copying the code…)
http://pastebin.com/YjZ4xEi5

it's probably easier to read the item requirement in the pastebin, so I won't copy them here :P
You can test that the code works with this code:
't9&/AC
should make your character green.

I made some item modifying codes to make it possible/easier to get some of the requirements:
http://pastebin.com/GWXC1u2Q

the only code of those that are really necessary are the code for the amount of items in the first spot in the item bag, this is the assembled version of the x144 code:
p0QéU2'd

I haven't tried yet, but I think that it would be trivial to do the rest of what is done in Crystal_'s implementation from here on.

I used a list of all the letters available in box names that I compiled myself because I couldn't find a similar list, I have thrown that on pastebin here:
http://pastebin.com/jxLY31kq
I also edited a list of opcodes for the game boy to only include those accessible using box names an image of it is attached,
hopefully they will be of use to someone :)