4
« on: March 14, 2013, 02:17:36 pm »
I wanted to extend compatibility of my Mapper program to support GBC games, so I decided to use this game for testing, even though it already has maps made for it. The area I chose was Chapter 2: Story 1.
First and foremost: The memory layout in GBC games is atrocious. It's an absolute hassle to move between the two Window RAM banks and the Hi-RAM bank.
This game has two modes of scrolling (that I have found in the first level). Horizontal scrolling, in which the camera will follow you horizontally and only allows vertical scrolling in increments, such as when you reach a certain point, the screen scrolls up/down an entire screen at once. Then, there is vertical scrolling, in which the camera will follow you vertically and horizontal scrolling is forbidden. These modes can be changed in real time. An example of each scrolling mode: Horizontal scrolling is used in the very first area of the level. When you go through the door, the next area uses vertical scrolling.
Changing between scrolling modes helps a bit when moving around, mostly because of this reason: The entire level is a single map. The doors don't take you to different maps, just different locations of the same map. Also, the vertical shift during horizontal scrolling can be done in real-time as well.
Another ball-buster is how locations are stored: In a DWORD in big-endian format. Yay. I am so used to reading hex in little-endian that it really slowed my progress. I constantly changed the wrong byte.
I couldn't find a spot that stored which coins were collected or which blocks were busted, which had me restarting when I collected a coin or broke a block accidentally. I only spent about an hour implementing GBC support into Mapper and mapping out this area, but I am pleased with the results. Anywho, I have included the map of the area in this post.
Notable Offsets
C6DB: Bit 6 cause the screen to shift up during horizontal scrolling, and vice versa for bit 7.
C6F2: Bit 4 enables horizontal scrolling, bit 5 enables vertical scrolling.
D53A: Actor location (DWORD, big-endian)
FFAD: Camera location (DWORD, big-endian, misaligned)