-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdebug_trophy_entity.lua
More file actions
71 lines (55 loc) · 2.3 KB
/
Copy pathdebug_trophy_entity.lua
File metadata and controls
71 lines (55 loc) · 2.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
--This script prints out the name of entry points of Trophy's
--state machine in the console.
require "labels"
MMC3_BANK_SELECT = 0x8000
MMC3_BANK_DATA = 0x8001
MMC3_SELECT_2K_CHR_BANK0 = 0
MMC3_SELECT_2K_CHR_BANK1 = 1
MMC3_SELECT_1K_CHR_BANK0 = 2
MMC3_SELECT_1K_CHR_BANK1 = 3
MMC3_SELECT_1K_CHR_BANK2 = 4
MMC3_SELECT_1K_CHR_BANK3 = 5
MMC3_SELECT_8K_PRG_BANK_8000 = 6
MMC3_SELECT_8K_PRG_BANK_A000 = 7
old_message = ""
mmc3_bank_select_value = 0
mmc3_bank_data_value = 0
function log_message(message)
if message ~= old_message then
print(message)
old_message = message
end
end
function print_if_bank(bank, message)
if mmc3_bank_select_value == MMC3_SELECT_8K_PRG_BANK_A000 then
if mmc3_bank_data_value == bank then
print(message)
end
end
end
memory.registerwrite(MMC3_BANK_SELECT,
function()
mmc3_bank_select_value = memory.getregister("a")
end
)
memory.registerwrite(MMC3_BANK_DATA,
function()
mmc3_bank_data_value = memory.getregister("a")
end
)
memory.registerexecute(trophy_entity_idle, function() print_if_bank(7, "idle") end)
memory.registerexecute(trophy_entity_run_left, function() print_if_bank(7, "run_left") end)
memory.registerexecute(trophy_entity_run_right, function() print_if_bank(7, "run_right") end)
memory.registerexecute(trophy_entity_knockback, function() print_if_bank(7, "knockback") end)
memory.registerexecute(trophy_entity_die, function() print_if_bank(7, "die") end)
memory.registerexecute(trophy_entity_jump, function() print_if_bank(7, "jump") end)
memory.registerexecute(trophy_entity_fall, function() print_if_bank(7, "fall") end)
memory.registerexecute(trophy_entity_step_down, function() print_if_bank(7, "step_down") end)
memory.registerexecute(trophy_entity_step_up, function() print_if_bank(7, "step_up") end)
memory.registerexecute(trophy_entity_step_on, function() print_if_bank(7, "step_on") end)
memory.registerexecute(trophy_entity_step_off, function() print_if_bank(7, "step_off") end)
memory.registerexecute(trophy_entity_climb, function() print_if_bank(7, "climb") end)
memory.registerexecute(trophy_entity_climb_shoot, function() print_if_bank(7, "climb_shoot") end)
while (true) do
FCEU.frameadvance()
end