I made some stage maps that show where the enemies spawn but only got through two of the stages before the contest ended. Did anyone else do something like this? If not, does anyone want to help finish the project?
Stage 0
Stage 8 (
GIMP file that lets you toggle enemies on and off)
Stage numbering is based on the RAM value at 0x152C.
EDIT:
Each stage is divided into segments/substages. The data is organized as follows in the ROM: Each stage has a four-byte pointer, with stage 0 starting at 0x3CCF68. This points to a group of four-byte pointers for each segment, which then point to the actual enemy spawn locations. The location data consists of 18 bytes for each enemy, with bytes 0-1 indicating X-position, bytes 2-3 indicate Y-position, and byte 6 indicating the type of enemy. The X- and Y-positions are relative to the beginning of each segment.
In case it is more helpful than the above explanation, this is the Lua script I used to dump the data for those maps:
local stage_pointers = 0x3CCF68
local substages = {[0]=5, 8, 11, 11, 10, 11, 8, 11, 12, 1, 1, 1, 3, 3, 1, 1, 3}
local current_stage = 1
local current_stage_address, current_substage_address, next_substage_address, number_of_enemies
local current_enemy_address, current_enemy_x, current_enemy_y, current_enemy_type
memory.usememorydomain("ROM")
do
current_stage_address = memory.read_u24_le(stage_pointers + current_stage * 4)
for i = 0, substages[current_stage] - 1 do
current_substage_address = memory.read_u24_le(current_stage_address + i * 4)
next_substage_address = memory.read_u24_le(current_stage_address + i * 4 + 4)
number_of_enemies = math.floor((next_substage_address - current_substage_address) / 18)
console.writeline("=====================")
console.writeline("Stage " .. current_stage .. ", substage " .. i)
console.writeline("=====================")
for j = 0, number_of_enemies do
current_enemy_address = current_substage_address + j * 18
current_enemy_x = memory.read_u16_le(current_enemy_address)
current_enemy_y = memory.read_u16_le(current_enemy_address + 2)
current_enemy_type = memory.read_u8(current_enemy_address + 6)
console.writeline(" X: " .. current_enemy_x)
console.writeline(" Y: " .. current_enemy_y)
console.writeline("Type: " .. current_enemy_type)
console.writeline("----------")
end
console.writeline("=====================")
end
client.pause()
end