This was requested, and apparently there's a
route of it for a TAS, so I'll use this thread to put some findings here.
Known glitches:
*New game stat smuggle
https://www.youtube.com/watch?v=DyDmD-ocSPs
*Getting Ron to the last boss
https://www.youtube.com/watch?v=Dv4hFya5wsE
*Burrow cutscene skip
https://www.youtube.com/watch?v=R40BX0YzPY0
*Nick cutscene skip
https://www.youtube.com/watch?v=wD78ZgszSBs
*McGonagall cutscene skip
https://www.youtube.com/watch?v=Ta_Rjz2cOo8
*Cutscene thing
https://www.youtube.com/watch?v=GjufoyTP8b8
*Pausing before a cutscene still messes things up (opening menus causes softlock)
*If the enemy is faster than you, you can skip their turn by attempting to run, fail, then press "A" on their turn. Turboing allows you to even skip your partners turn.
Addresses:
System Bus:
CD54 - Unsigned 2 byte big endian - Message countdown (0 allows you to press A)
CE4B to 0xCE56 - Binary, Flags for Folio Bruti unlocks
FFD0 - Game state? Similar to the prequel, changing to certain values gives a CHEAT menu.
https://tcrf.net/Harry_Potter_and_the_Chamber_of_Secrets_(Game_Boy_Color)#CHEAT_menus
FFD8 - Unsigned 1 byte, Map ID
WRAM:
0B56 - Unsigned 2 byte - First minigame timer
0E3E - Unsigned 2 byte little? endian - RNG
0C36 - Unsigned 1 byte - Counter to next enemy spawn
06AE - Unsigned 1 byte - Hitsplat digit color (can be either 1's or 10's digit)
0692 - Unsigned 1 byte - Hitsplat digit number corresponding to above
065E - Unsigned 1 byte - Hitsplat digit color (can be either 1's or 10's digit)
063E - Unsigned 1 byte - Hitsplat digit number corresponding to above
05EA - Unsigned 1 byte - Hitsplat digit color (can be either 1's or 10's digit)
0606 - Unsigned 1 byte - Hitsplat digit number corresponding to above
5050 - Hp1 NPC. Also exists in 0572 WRAM, and C572, E572 in System Bus, but changing them don't seem to do anything.
Note: Digit colors can be used for scripts to detect if a crit or miss has landed. Crits are red colored with value of 2, and miss has value of 3. To get the actual number, use either 0BCA, 061A in WRAM instead.
The X/Y addresses seems to be all over the place. A simple search for Y in system bus gave: C2D8, C2DC, C2E6, CABB, CABD, CD74, CDBB, E2D8, E2DC, E2E6, EABB, EABD, ED74, EDBB. Changing any one of them all work for some reason. For partners maybe?
Edit: Thanks for SuperMonkeypotato for providing details on routes, some addresses, glitches, etc.
Download hpcs.luaLanguage: lua
memory.usememorydomain("System Bus")
local addresses =
{
--WRAM
npc_top_id = 0x504B,
npc_top_max_hp = 0x504C,
npc_top_cur_hp = 0x5050,
npc_mid_id = 0x5064,
npc_mid_max_hp = 0x5065,
npc_mid_cur_hp = 0x5069,
npc_bottom_id = 0x507D,
npc_bottom_max_hp = 0x507E,
npc_bottom_cur_hp = 0x5082,
--System Bus
x = 0xC2D4,
y = 0xC2D7,
rng = 0x0E3E,
message_countdown = 0xCD54,
folio_bruti_start = 0xCE4B,
folio_bruti_end = 0xCE56,
frame = 0xFFC3,
second = 0xFFC4,
minute = 0xFFC5,
game_state = 0xFFD0,
area = 0xFFD8
}
local drawtext = gui.drawText
function text(x, y, message, font)
local font = (font == nil) and 10 or font
drawtext(x, y, message,nil,nil,font,nil,nil)
end
local npc_offset = 0x19
function display_battle()
--[[
Game states for battle:
25 using cards
26 choose action (spell, thing, item, run, folio bruti)
27 choose spell
28 choose spell version
29 choose item
30 using an item
31 run
32 pack rat?
33 npc attacking
34 select npc + attack
35 win screen
36 select team mate
39 scabbers attack
47 card attack
]]--
local line = ""
local start_adr = addresses.npc_top_id
local offset = 10
for i = 0,2 do
local id = memory.read_u8(start_adr+(npc_offset*i),"WRAM")
local max_hp = memory.read_s16_le(start_adr+(npc_offset*i)+1,"WRAM")
local current_hp = memory.read_s16_be(start_adr+(npc_offset*i)+4,"WRAM")
line = "E"..(i+1).." ".." ID:"..id.." HP:"..current_hp.."/"..max_hp
text(0,offset,line)
offset = offset + 10
end
end
while true do
local x = string.format('%.6f',memory.read_u24_le(addresses.x)/4096.0)
local y = string.format('%.6f',memory.read_u24_le(addresses.y)/4096.0)
local game_state = memory.read_u8(addresses.game_state)
text(0,50,"State "..memory.readbyte(addresses.game_state))
text(0,60,"RNG"..memory.read_u16_le(addresses.rng,"WRAM"))
text(0,80,memory.readbyte(addresses.minute)..":"..memory.readbyte(addresses.second)..":"..memory.readbyte(addresses.frame))
if game_state >= 25 or game_state <= 47 then
display_battle()
else
text(0,30,"X"..x.."Y"..y)
text(0,40,"MSG"..memory.read_s16_be(addresses.message_countdown))
end
emu.frameadvance()
end