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

Editing VRAM - Page 1

Editing VRAM

Posted by: Aaron1Olson
Date: 2017-08-02 16:03:30
Is there much documentation about editing VRAM memory locations?

In particular, I was wondering if someone can explain how color works on red and blue. Is it preprogrammed in the rom or does the GBC's hardware somehow handle that?

I was curious to see if i could edit the color overlay that changes when going into different towns and routes. 
(Or do anything with a visual effect. Ive managed to remove the player sprite and make him appear to be in grass lol )

Re: Editing VRAM

Posted by: Parzival
Date: 2017-08-02 17:16:31
When in doubt, consult the Good Book of GB. http://gbdev.gg8.se/wiki/articles/Pan_Docs
You'll need to make sure you're only writing during VBlank, and you'll be editing palettes for color changes.

Re: Editing VRAM

Posted by: ISSOtm
Date: 2017-08-02 17:21:53
If you're doing this via ACE, use what Parzival said above.
If you're wondering how to switch VRAM banks, you have to write to the VBK register, located at $FF4F.

If you're doing this via BGB, it's fairly easier due to the VRAM viewer.
Editing VRAM from the memory viewer can be done at any time, even when it's locked. To let you see locked VRAM, right-click locked VRAM or SRAM in the memory viewer and check "Force memory visibility".
To get a VRAM location, you can use the "BG map" tab.
Also, you can edit palettes directly in the VRAM viewer, just click on a color slot and edit the three shades on the right.
Want the memory viewer to go to VRAM bank 1 ? Easy, open the "Goto" box (Ctrl+G, or right-click -> "Goto") and type something like "1:9C00". Same for bank 0.

Re: Editing VRAM

Posted by: Aaron1Olson
Date: 2017-08-02 17:47:38
Thanks to you both for the replies. I'm not really trying to do anything in particular, just explore more of how the gameboy and the pokemon ROM works. That GBdev page will help out Parzival.

and ISSOtm,
I have no preferred method, just trying to learn by tinkering around. I'm taking a assembler course this semester in a few weeks and coincidentally discovered these Pokemon glitches and it piqued my interest to learn more about A.C.E & asm and possibly have a little extra knowledge going into the class! I will try BGB, I wasn't aware it had that feature! Thanks.

Re: Editing VRAM

Posted by: Parzival
Date: 2017-08-02 18:32:46
A good place to start is here: http://tutorials.eeems.ca/ASMin28Days/welcome.html
This is for the stock Z80, so it's a little different, but it'll do as a basic GBz80ASM intro.

Re: Editing VRAM

Posted by: ISSOtm
Date: 2017-08-02 18:43:30
It's also specifically tailored for the TI-8x+ calculators, so it explains a lot of things that don't matter on the GB, such as IO port,s BCALLS, etc.

Re: Editing VRAM

Posted by: Aaron1Olson
Date: 2017-08-02 20:48:52
Sweet, I will check the tutorial out. Is there an easy way to run the assembled programs for these architectures?
maybe an emulator of some sort that shows registers values and etc as I step through?
( I don't have a TI-83+ ;p )

Re: Editing VRAM

Posted by: ISSOtm
Date: 2017-08-03 05:09:25
BGmotherf*inB.

BGB is definitely the way to go if you want to do shtuff of that sort.
You can either run a compiled ROM if that's what you want, or, if trying 8F thingies, the memory edition box supports
- Hex
- Strings
- Direct assembly code (yessss)

You can trace exec, modify registers on-the-fly, re-route exec wherever and whenever you want… and it's free.
(And the dev is a very nice guy)

Re: Editing VRAM

Posted by: Aaron1Olson
Date: 2017-08-03 17:47:18
Gotcha. I will mess around with BGB, still trying to figure out how it all works and get used to the debugger.
I may also try to make a simple hello world!-type ROM (if i can figure it out  :-X )

Thanks again  8)

Re: Editing VRAM

Posted by: ISSOtm
Date: 2017-08-03 20:51:50
I'd recommend you join our Discord server, I'd be able to help more over there.
I'm pretty fluent with BGB and creating GB ROMs, so I could help there. Just make sure you're using RGBDS as your compiler suite, lol