Disassembly of Flicky for Sega Genesis/Mega Drive. The source assembles with the AS Macro Assembler to produce a byte-accurate ROM.
This project is based on approaches from alien_soldier_src.
AS Assembler: http://john.ccac.rwth-aachen.de:8000/as/index.html
git clone <repo>
cd flicky_src
# Place original ROM in project root:
# Flicky (UE) [!].bin
make init # Extract data, build ROM, create reference
make compare # Verify build matches referenceflicky_src/
├── bin/ # Assembler tools
│ ├── asw.exe # AS Macro Assembler 1.42 Beta
│ ├── p2bin.exe # Object to binary converter
│ └── *.msg # Assembler message catalogs
├── data/ # Binary data segments (generated by make init)
│ ├── artnem/ # Nemesis-compressed graphics
│ ├── arteni/ # Enigma-compressed tilemaps
│ ├── artunc/ # Uncompressed graphics
│ ├── sound/ # Sound data (Z80, DAC samples)
│ ├── other/ # Other binary data
│ └── data_addrs.txt # Addresses for ROM extraction
├── tools/ # Compression/decompression tools
│ ├── nemesis_dec.c/py # Nemesis decompressor (C and Python)
│ ├── enigma_dec.c/py # Enigma decompressor (C and Python)
│ └── Makefile # Build C tools
├── scripts/ # Python build and analysis tools
├── src/ # Include files
│ ├── macros.inc # Assembler macros
│ ├── ports.inc # Hardware I/O port definitions
│ ├── equals.inc # Constants and equates
│ └── ram_addrs.inc # RAM address definitions
├── workflow/ # Documentation workflow state
├── flicky.s # Main disassembled source (~10k lines)
└── Makefile # Build system
make init # Initialize project (requires original ROM)
make build # Assemble source → fbuilt.bin
make compare # Compare built ROM with reference
make split # Re-extract binary data from original ROM
make tools # Build C decompressor tools
make unpack-data # Decompress Nemesis/Enigma data
make clean # Remove all build artifacts
make help # Show all available targetsAutomated procedure analysis using emulator screenshots:
make reference MOVIE=longplay # Generate reference screenshots
make find-unanalyzed # Find procedures needing analysis
make analyze MOVIE=longplay # Run automated analysis
make report MOVIE=longplay # Generate analysis reportSemi-automated procedure naming with Claude AI:
make set-movie MOVIE=longplay # Set movie type for session
make prepare-batch COUNT=40 # Prepare batch of procedures
# → Claude reads workflow/batch_procedures.txt
# → Claude creates workflow/rename_batch.csv
make rename # Apply renames to source
make build && make compare # Verify ROM unchangedmake show-movie # Display current movie setting
make stop # Kill running Gens emulator instances
make build-gens # Build modified Gens emulator (VS2022)| Script | Purpose |
|---|---|
analyze_procedures.py |
Automated procedure analysis with emulator |
build_rom.py |
Orchestrates ROM assembly (AS → p2bin) |
clean_project.py |
Cross-platform cleanup of build artifacts |
compare_roms.py |
Binary comparison of built vs reference ROM |
extract_data_addrs.py |
Extracts data addresses from source file |
find_unnamed_procedures.py |
Lists procedures still named sub_*, loc_* |
generate_analysis_report.py |
Generates report from analysis data |
init_project.py |
Full project initialization (split → build → reference) |
prepare_batch.py |
Prepares batch of procedures for documentation |
rename_procedures.py |
Applies rename CSV to source file |
split_data_from_rom.py |
Extracts binary data segments from ROM |
unpack_data.py |
Decompresses Nemesis/Enigma data files |
- Python 3.x
- Make (Git Bash / WSL on Windows)
- AS Macro Assembler (included in
bin/) - Original ROM:
Flicky (UE) [!].bin
# 1. Place original ROM in project root
# Flicky (UE) [!].bin
# 2. Initialize project
make initThis will:
- Extract binary data from ROM →
data/*.bin - Build ROM from source →
fbuilt.bin - Create reference ROM →
flicky.bin
make build # Rebuild ROM
make compare # Verify matches reference| Title | FLICKY |
| Platform | Sega Mega Drive / Genesis |
| Release | February 1991 |
| Product Code | GM 00001022-00 |
| ROM Size | 128 KB |
| Regions | Japan, USA, Europe (JUE) |
When adding padding before Sys_GameEntryPoint (address $10000), the game freezes in certain places. This is caused by hardcoded pointer offsets in data/data_z80_part2.bin that don't get recalculated when the ROM layout shifts.
The code in Sound_LoadZ80Table uses suba.l #Sys_GameEntryPoint,a0 to convert offsets, but the offsets stored in the binary data file remain unchanged.
Workaround: Keep Sys_GameEntryPoint at exactly $10000.
- Based on approaches from alien_soldier_src
- AS Macro Assembler by Alfred Arnold
- Original game by Sega (1984/1991)
This is a work of reverse engineering for educational and preservation purposes. The original game is copyright Sega.