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.

Arbitrary Code Execution Discussion

Coding program in Pokemon Blue? - Page 1

Coding program in Pokemon Blue?

Posted by: joshuarpl
Date: 2018-11-27 19:10:22
Could you do an ASM hack where you added a menu that let you program arbitrary code by hex or by ASM programming with an item in the PC?
Controls: In hexadecimal, A to create a value, B to delete a value, D-pad to move the cursor, Up and Down while holding Select to set the value, up increases the value and down decreases it.
In ASM launguage, A to create a new line, B to delete selected line, D-pad to move the cursor, switch between Function and Arguement with Left and Right. Up and down to select a line.


If you could, please send me a hacked Pokemon Blue ROM that allows you to do this.
Also, Select and Up to execute the code, and Select and Down to clear it!

Re: Coding program in Pokemon Blue?

Posted by: Couldntthinkofaname
Date: 2018-11-27 20:37:48

Could you do an ASM hack where you added a menu that let you program arbitrary code by hex or by ASM programming with an item in the PC?


Yes, you very well could do that. As for actually doing it, well you seem apt at programming in LR35902 ASM, so why not do it yourself? Make friends with pokered.

In regards to "things that already exist", try ZZAZZ glitch's memory editor for Pokemon Yellow. It's not quite what you're looking for, but it's a very fluent hex editor, and it gets the job done. It isn't a ROM hack, you load the code directly into memory and then execute it via ACE.

ZZAZZ also made a "Debug Yellow" ROM hack and uploaded it on his youtube a few years ago. It's a ROM hack as opposed to his memory editor, but it's much,much more extensive, and packed with features

As for Pokemon Blue, a while back I made a port of ZZAZZ's memory editor for R/B. It's buried somewhere on the forums, so if you want it, go find it.

If you could, please send me a hacked Pokemon Blue ROM that allows you to do this.
Also, Select and Up to execute the code, and Select and Down to clear it!


Asking someone to make an entire ROM hack for you was your first mistake, requesting it to be exclusively for you was your second.

GBZ80 guides are out there. Pick up Pokered and be the difference you want to see in glitching.

Re: Coding program in Pokemon Blue?

Posted by: joshuarpl
Date: 2018-11-28 10:58:27
I unfortunately do not know ASM on a Gameboy, but are there notes that make it easy to program?
Plus, there is no EXE file I could find, I searched EXE in File Explorer and all I got was a bunch of pictures of Exeggutor.
Thanks for saying assembly guides are out there lol  ::)

Re: Coding program in Pokemon Blue?

Posted by: Couldntthinkofaname
Date: 2018-11-28 11:42:43

I unfortunately do not know ASM on a Gameboy, but are there notes that make it easy to program?



There are plenty.To get you started, here on the forums we have this lovely guide by ISSOTM. It isn't much, but it's definitely a start.

GBZ80 is very closely related to the z80 processor, and there are plenty of websites to assist you with that. There's also the
Gameboy CPU manual
Refer here instead. As mentioned, by ISSO, it is much more extensive and to-date.


There are numerous people here on the forums who can answer GBZ80 questions as well.

RGBDS is an amazing tool for GB development. It's got an assembler, a linker, the whole nine yards and a bit more.



Plus, there is no EXE file I could find, I searched EXE in File Explorer and all I got was a bunch of pictures of Exeggutor.











No comment.

Re: Coding program in Pokemon Blue?

Posted by: ISSOtm
Date: 2018-11-28 12:33:17
Please do not refer to the GB CPU Manual - this document is bad and outdated. Please instead use the wikified Pan Docs instead.
For a better GB ASM tutorial, check out this more recent tutorial I made.

That's also all that you will find. You can find tutorials to program the Game Boy in C, but that won't help you for Pokémon.


By the way, the tutorial I mentioned last is third on Google when you ask "Game Boy ASM tutorial". If you don't have the skill to use Google, give up GB programming now. You won't grasp it.
You didn't even try.

Re: Coding program in Pokemon Blue?

Posted by: Couldntthinkofaname
Date: 2018-11-28 13:46:42

Please do not refer to the GB CPU Manual - this document is bad and outdated. Please instead use the wikified Pan Docs instead.


Edited to reflect.


You didn't even try.


OP Approached us with the assumption that one of us would make a ROM hack with these capabilities for him. When told otherwise, OP expressed disdain for the resources I provided with some good ol' fashioned sarcasm and eyerolling:

Thanks for saying assembly guides are out there lol  ::)


Because of this, i'm going to assume OP is unwilling to learn LR35902. And that would be fine, if you weren't asking for a ROM hack written in LR35902 that writes… well… LR35902.

OP, have you ever written anything in x86-64 or other forms of assembly? Having that knowledge will help miles when writing LR35902.

Hell, even running a basic bare-minimum C program through Compilier Explorer can assist in learning some basic fundamentals of low-level programming, although maybe less-so for the Gameboy (especially considering that C uses Call stacks… good freakin' luck trying to implement a call stack in LR35902!)


Re: Coding program in Pokemon Blue?

Posted by: Sherkel
Date: 2018-11-28 13:58:26
Locking as this isn't going anywhere. The request was over-the-top, it's fine that joshuarpl didn't know why, and responses linking to resources similar to what he was asking about were helpful. The rest was not called for and I don't see this going in any other direction.