Skip to content

oranguthang/flicky_src

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Flicky (Genesis) Disassembly

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

Quick Start

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 reference

Project Structure

flicky_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 Targets

Basic Commands

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 targets

Analysis Workflow

Automated 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 report

Documentation Workflow

Semi-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 unchanged

Utility Commands

make show-movie     # Display current movie setting
make stop           # Kill running Gens emulator instances
make build-gens     # Build modified Gens emulator (VS2022)

Scripts

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

How to Build

Prerequisites

  • Python 3.x
  • Make (Git Bash / WSL on Windows)
  • AS Macro Assembler (included in bin/)
  • Original ROM: Flicky (UE) [!].bin

First Time Setup

# 1. Place original ROM in project root
#    Flicky (UE) [!].bin

# 2. Initialize project
make init

This will:

  1. Extract binary data from ROM → data/*.bin
  2. Build ROM from source → fbuilt.bin
  3. Create reference ROM → flicky.bin

Regular Development

make build      # Rebuild ROM
make compare    # Verify matches reference

Game Information

Title FLICKY
Platform Sega Mega Drive / Genesis
Release February 1991
Product Code GM 00001022-00
ROM Size 128 KB
Regions Japan, USA, Europe (JUE)

Known Issues

Pointer Hardcoding at $10000

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.

Credits

  • Based on approaches from alien_soldier_src
  • AS Macro Assembler by Alfred Arnold
  • Original game by Sega (1984/1991)

License

This is a work of reverse engineering for educational and preservation purposes. The original game is copyright Sega.

About

Flicky source code (assemble with AS)

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors