-
Notifications
You must be signed in to change notification settings - Fork 1
/
test_gui.py
49 lines (40 loc) · 1.29 KB
/
test_gui.py
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
from ruk.classpad import Classpad
from ruk.gui.window import DebuggerWindow
from ruk.tools.elf import ELFFile
# rom =
if __name__ == '__main__':
start_pc = None
# Reading some ELF, for testing
# elf = ELFFile()
# elf.read("elfs/17/00017.elf")
# rom = elf.P
elf = ELFFile()
elf.read("elfs/ifm.elf")
rom = elf.P
# Reading raw bytes
# with open("elfs/rom_01.bin", 'rb') as f:
# rom = f.read()
# with open("elfs/app_template_printf.bin", 'rb') as f:
# rom = f.read()
# start_pc = 0x8cff0000
"""
0xA0000000 to 0xA1FFFFFF - Cached
0x80000000 to 0x81FFFFFF - Same, but non-cached
Addins are executed from the ROM, with the executable code virtually mapped to 0x00300000 by the MMU.
"""
# Reading actual bootrom
# with open("elfs/bootrom_1511.bin", 'rb') as f:
# bootrom = f.read()
# start_pc = 0x0000_0000
# # start_pc = 0x8000_0340
# Reading test opcodes file
# with open("scratches/all_opcodes.bin", 'rb') as f:
# rom = f.read()
cp = Classpad(rom, debug=True, start_pc=start_pc, ram_size=0x0f_0000)
# cp.add_rom(bootrom, 0)
# cp.add_rom(rom, start_pc)
dbg_win = DebuggerWindow()
dbg_win.attach(cp)
dbg_win.show()
# TODO: run trigger cp.run()
# cp.run()