News:

Don't forget to visit the main site! There's lots of helpful docs, patches, and more!

Main Menu

ejrtq disasm

Started by MarioFan2468, July 15, 2024, 04:11:37 PM

Previous topic - Next topic

MarioFan2468

ejrtq colorization v1.3 is a really cool hack made by azurelore korrigan (credited as "ejr tairne") and improved upon by quantam
its the best m2 colorization by far
it was made by directly editing the hex/asm of vanilla though, so there was no way to use the improvements of this hack in other hacks that are based on the disasm
that is, until now

i have reverse-engineered the code of ejrtq v1.3, using alex-west's metroid 2 disassembly and mgbdis
then, i have made a version of ejrtq that is meant to be used as a base for future hacks
it is up to the standards of rgbds 0.7.0
here is what i have changed in this new version

first of all, and most obvious, i have added the ability to use multiple palettes, instead of having only one palette for the whole game
a new door transition opcode was added for the purpose of changing the color palette
i have recolored the game in order to showcase the benefits of having multiple palettes
this unfortunately means that ejrtq's colors are not used
which is why out of respect for the original hack, i will not put an ips patch for this because i do not want to claim that my colors are superior
the point of this disasm is not my colors, it is the functionality i have added and made available

second, i have removed the bank 20+ "overlay" system for tile color id data in favor of having that data coexist in the same bank as the gfx they are for
the previous system wasted 15 bytes per tile, which added up to a lot of unnecessarily unused space
i added color id pointer to the gfxInfo data structure and adjusted the functions that use gfxInfo to also load the color id into its wram buffer

third, i have changed how blocks are assigned color id
previously, color id was assigned per vram tile, much like for all other gfx
i have changed this to assigning color id per block tile
this allows for two blocks using the same vram tiles to have different colors
because the color id byte also includes the h-flip and v-flip flags, it also allows flipped metatiles without needing a pre-flipped duplicate vram tile
i have showcased this by removing pre-flipped tiles from the surface tileset, making the surface tileset no longer overflow into surfaceSPR
to modify the blockset, use the edit_blockset.py script

fourth, i have applied my previously published resource "m2 on the fly"
samus's tiles are loaded on demand, rather than all of them being loaded at once
this frees up a lot of space in sprite-only vram

and finally, i make use of the gameboy color's vram dma to greatly accelerate graphics transfer
barring exceptions such as the varia acquisition animation, all graphics are loaded via vram dma
as such, the vanilla method of transferring data during vblank has been removed
the h-blank vram dma, used during door transitions among others, is capable of speeds of almost $90 tiles per frame, which is much greater than vanilla's 4 tiles per frame

these are the major changes i made
there are other minor changes such as making the title screen graphics and tilemap be derived from an image, using 8x16 sprite mode for the credits, updating azurelore's name, and adding a proper "gbc only" screen if using a system that does not support gameboy color








ShadowOne333

#1
Just gave this a quick test after compiling, and wow, not only is the disassembly really well put together, but the slight changes done so far where things I wanted to implement into EJRTQ and wasn't able to due to my lack of knowledge with Game Boy assembly language.
You got the green from the visor to look properly in all frames, while the original EJRTQ did miss quite a few in several instances.

I only got around to the 2nd Metroid so far, but the disassembly so far is outstanding, great job with it!

Btw, do you happen to have a GitHub account? So you could host the disassembly there, if not I'm open to hosting it on my own account with all due credit to you for its creation, of course. Just let me know if you want me to host it or if you will.

I'll continue checking it out and will post if I find anything odd, thanks for this!