Skip to content

Commit

Permalink
Added Z80, VDP, and RAM segments to loader
Browse files Browse the repository at this point in the history
  • Loading branch information
Brandon Miller committed Apr 25, 2020
1 parent d4d6157 commit f53d5b9
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 19 deletions.
11 changes: 0 additions & 11 deletions __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@ def assemble(view):
assemble = GenesisAssemble(view)
assemble.start()

def load(view):
load = GenesisLoad(view)
load.start()

def call_table_enum(view):
cte = GenesisCallTableEnum(view)
cte.start()
Expand All @@ -28,13 +24,6 @@ def call_table_enum(view):
'Assemble M68K code and apply blob as patch',
assemble
)

PluginCommand.register(
'genesis: Load ROM',
'Create vector table and start disassembly',
load
)

PluginCommand.register(
'genesis: Enumerate call tables',
'Locate and disassemble call tables',
Expand Down
37 changes: 29 additions & 8 deletions genesis/loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,19 +42,40 @@ def create_segments(self):
self.add_auto_segment(0, len(self.raw), 0,
len(self.raw), SegmentFlag.SegmentReadable|SegmentFlag.SegmentExecutable)

# RAM Segment
self.add_auto_segment(0xff0000, 0xffff, 0,
0, SegmentFlag.SegmentReadable|SegmentFlag.SegmentWritable)

# Z80 Segment
self.add_auto_segment(0xa00000, 0x1ffff, 0,
0, SegmentFlag.SegmentReadable|SegmentFlag.SegmentWritable)

# VDP Segment
self.add_auto_segment(0xc00000, 0x20, 0,
0, SegmentFlag.SegmentReadable|SegmentFlag.SegmentWritable)

def create_sections(self):
self.add_auto_section(
"header", 0, 8,
SectionSemantics.ReadOnlyDataSectionSemantics)
"header", 0, 8,
SectionSemantics.ReadOnlyDataSectionSemantics)
self.add_auto_section(
"ivt", 8, 248,
SectionSemantics.ReadOnlyDataSectionSemantics)
self.add_auto_section(
"info", 256, 256,
SectionSemantics.ReadOnlyDataSectionSemantics)
self.add_auto_section(
"code", 512, len(self.raw)-512,
SectionSemantics.ReadOnlyCodeSectionSemantics)
self.add_auto_section(
"ivt", 8, 248,
SectionSemantics.ReadOnlyDataSectionSemantics)
"ram", 0xff0000, 0xffff,
SectionSemantics.ReadWriteDataSectionSemantics)
self.add_auto_section(
"info", 256, 256,
SectionSemantics.ReadOnlyDataSectionSemantics)
"z80", 0xa00000, 0x1ffff,
SectionSemantics.ReadWriteDataSectionSemantics)
self.add_auto_section(
"code", 512, len(self.raw)-512,
SectionSemantics.ReadOnlyCodeSectionSemantics)
"vdp", 0xc00000, 0x20,
SectionSemantics.ReadWriteDataSectionSemantics)

def create_functions(self):
for idx in range(4, 252, 4):
Expand Down

0 comments on commit f53d5b9

Please sign in to comment.