-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdebug.lua
More file actions
58 lines (43 loc) · 1.23 KB
/
Copy pathdebug.lua
File metadata and controls
58 lines (43 loc) · 1.23 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
--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
)
while (true) do
FCEU.frameadvance()
print("enemies: "..memory.readbyteunsigned(enemy_entity_indices_count))
end