Awesome
smd_ida_tools2
The IDA Pro tools for the Sega Genesis/MegaDrive romhackers
Contains
- ROM files loader
- Z80 sound drivers loader
- IDA Pro debugger for Sega Mega Drive/Genesis roms and Z80 sound drivers
How to compile
- Edit paths to your IDA/SDK installation according to your real paths (
IDA_DIR
,IDA_SDK
) - Install
vcpkg
as described in the Tutorial: Install and use packages with MSBuild in Visual Studio step 1. - Download and unpack IDA Pro QT distro: qt-5.15.2-full-IDA83.tar.bz2
- Install Perl from: https://strawberryperl.com/
- Edit
build.py
from IDA Pro QT distro. Add:"-nomake", "examples",
after"-nomake", "tests",
- Install and add to PATH
jom
from: https://ftp.funet.fi/pub/mirrors/download.qt-project.org/official_releases/jom/jom_1_1_4.zip - Build IDA Pro QT (using Visual Studio Developement Command Prompt):
python build.py -j 16 -v
- Compile solution with Visual Studio 2022 or newer
How to use
- Put files from the
loaders
dir into the corresponding IDA folder - Put files from the
plugins
dir into the corresponding IDA folder - Open ROM in IDA
- Choose
GensIDA debugger plugin
orZ80 debugger plugin
debugger - Press
F9
to start a debugging process - Run
gens_68k.exe
orgens_z80.exe
fromgens
folder, choose a ROM - Debug!
Available assemblers
How to produce a compilable asm listing
- Press
Shift+J
to choose how to mark your data range. Or mark it by yourself using available methods (listed below) - Press
File->Produce file->Create LST file...
. Save.lst
listing file - Use any of AS/VASM/ASM68K assemblers to compile your
.lst
file. You can also useassemble_as.bat
,assemble_vasm.bat
orassemble_asm68k.bat
for that
Data marking methods
All methods are specified like START_TAG
- END_TAG
(except ORG
tag), where START_TAG
must be specified using Anterior comment (Ins
) at the first line of your data, and END_TAG
must be inserted using Posterior comment (Shift+Ins
).
Available TAGS:
BIN "relative/path.bin"
. This tag allows you to save some data array (or even code) to the"relative/path.bin"
during the extraction. It also insertsbinclude "relative/path.bin"
line to your listing.INC_START "relative/path.inc"
-INC_END
. The same as the previous item, except it just stores copies all lines between these tags as is and inserts the following line:include "relative/path.inc"
.DEL_START
-DEL_END
. These tags can be used if you want to cut some lines from the resulting asm listing.ORG $SIZE
. This tag insertsorg $size
directive line in the output.
How To Set Read Write Breakpoints On VDP VRAM
, VDP CRAM
, VDP VSRAM
NOTE: this works for DMA operations as well.
Once you are debugging, in the IDA View click 'g' and go to either:
Memory type | Address | Alternative address |
---|---|---|
VRAM | 0x00D00000 | DBG_VDP_VRAM:00D00000 |
CRAM | 0x00D10000 | DBG_VDP_CRAM:00D10000 |
VSRAM | 0x00D20000 | DBG_VDP_VSRAM:00D20000 |
Find the address or addresses you want, offsetted from the above. Then select it / them . Right click. a prompt will come up. Click "Add Beakpoint" , or press F2 after selecting. A "Breakpoint Settings" window will come up. Select either read or write or both under Hardware breakpoint mode and set the size. You can enable other settings like actions etc.
Debugger in IDA PRO
General Registers can be seen while running the debugger in IDA Pro by going to Debugger -> Debugger Windows -> General Registers.
D0-D7
, A0-A7
, PC
, SP
, SR
, DMA_LEN
, DMA_SRC
and VDP_DST
are all shown here
VDP Registers can be seen while running the debugger in IDA pro by doign to Debugger -> Debugger Windows -> VDP Registers
Launch without debugging
Pass -nodebug 1
to gens_xxx.exe
.