Skip to content

Releases

v0.0.7: Flashback SMS: run the game logic ~2.2× faster, fix scrolling, sprite and input glitches (warpdesign's contribution)

Choose a tag to compare

@haroldo-ok haroldo-ok released this 02 Oct 20:27

What's Changed

  • Run the game logic ~2.2× faster, fix scrolling, sprite and input glitches by @warpdesign in #1

New Contributors

Full Changelog: v0.0.6...v0.0.7

Here is a clear breakdown summarizing the PR #1 changes for Flashback SMS, highlighting the performance gains, rendering fixes, and engine updates introduced by @warpdesign:

1. Engine & Logic Performance

  • ~2.2× Speed Boost (25.3 Ticks/sec): Replaced critical C bottlenecks with Z80 assembly implementations (matching the original C algorithms step-for-step), accelerating:

    • Script interpreter hot paths.

    • Collision detection routines.

    • Sprite rendering routines.

  • Uncompressed Sprite Tiles & Direct Reading: Sprite tile assets are now stored uncompressed in memory, and data structures are read directly in place rather than copied through temporary buffers.

  • Optimized Main Loop Scheduling: Removed forced VBlank waits when logic ticks are due, allowing the game loop to push output closer to the original 16-bit target (25.3 FPS vs. original engine's 30 FPS, up from 11.7 FPS in Level 1).

  • 100% Deterministic Parity: Verified across all 504 recorded demo frames---game logic remains identical to the original engine.

2. Rendering & Scrolling Improvements

  • Smooth Floor-Tracking Camera: The camera now locks onto the height of the floor Conrad is walking on instead of tracking his exact Y-position, eliminating annoying vertical screen-bobbing while running or jumping and smoothly panning during floor transitions.

  • Off-Screen Sprite Clipping Fix: Improved sprite tile clipping so partially visible sprite pieces on screen boundaries render correctly. Conrad's feet no longer disappear when walking along the bottom floor.

3. Input Handling & Polishing

  • Frame-Latched Input (No Dropped Taps): Controller inputs are latched every frame so rapid button presses (kicks, jumps, turns) are always recognized.

  • State & Menu Fixes:

    • Fixed an issue where a queued PAUSE state carried over and quit a newly started level.

    • Prevented fast button-bursts from unintentionally bleeding through the title screen.

    • Configured both action buttons to skip cutscenes.

4. Toolchain & Developer Extras

  • DOS Demo Sprite Support: Build tools can now generate complete sprite sets using the DOS demo files.

  • Repository Cleanup: Added a comprehensive .gitignore to prevent generated game assets and raw binary builds from cluttering git status.

  • On-Screen Controller Overlay: Added an optional input visualization toggle (make DEBUG_PAD=1) to display active controller inputs directly on screen during gameplay testing.

v0.0.6: Flashback SMS: Implement HUD and the inventory.

Choose a tag to compare

@haroldo-ok haroldo-ok released this 01 Oct 10:06

Full Changelog: v0.0.5...v0.0.6

image image

Here is a player-friendly summary of what’s new in Flashback SMS (v0.0.6):


What’s New

  • On-Screen HUD: The item Conrad currently has equipped now appears in the top-right corner of the screen from the moment you start. When you switch items, the icon updates automatically.
  • Item Pickups & Interactive Prompts: Walking over a collectible item, switch, or terminal now displays its icon and name at the top-center of the screen (matching the layout and hand icon from the original 16-bit game). The room background cleans itself up seamlessly when you walk away.
  • Working Inventory Menu: Pressing the PAUSE button now opens your inventory screen:
  • Left / Right: Scroll through your items.
  • Button 2: Equip the selected item and return to the game.
  • Button 1 or PAUSE: Close the menu without changing items.
  • Button 1 + Button 2: Return to the title screen.

Behind the Scenes & Performance Notes

  • Original Assets Included: All 30 item icons, menu fonts, and 128 text strings are now read directly from the original game files (global.icn, fb_txt.fnt, and .tbn tables).
  • Memory Optimization: To fit these new features into the Master System's tight ROM space, internal automated testing data was separated into a developer-only test build.
  • Sprite Budget Adjustments: Rendering the HUD and item names on the background layer required reserving a few tile slots from the sprite cache (down to 22 slots from 32). If extremely busy rooms ever show slight sprite flicker, this is where memory was reallocated.
  • Visual Detail: Item icons currently display with a dark square background box behind them because they use background tile palettes. If the original game rendered these icons with transparent backgrounds, this can be refined in a future update.

v0.0.5: Flashback SMS: Fix elevators and sound effects.

Choose a tag to compare

@haroldo-ok haroldo-ok released this 27 Sep 10:49

Full Changelog: v0.0.4...v0.0.5

This v0.0.5 release represents a crucial shift in the Flashback Sega Master System port: solving the elevator activation mystery and unlocking the game's true audio depth by tying sound triggers directly to the animation subsystem.

Key Architectural Fixes & Technical Findings

                      Flashback Engine Subsystem Integration
                                         │
    ┌────────────────────────────────────┼────────────────────────────────────┐
    ▼                                    ▼                                    ▼
Elevator State & Tile Restoration   Animation-Driven SFX Engine        Input Harness Synchronization
- Opcode 0x72 implemented           - Header-driven sample triggers    - Switched from demo-playback to
- Restores floor markings under lift- Footsteps, gunshots & mechanics    native keyframe input
- Button 1 + Up/Down mechanics      - 108 PSG writes on L1 (vs 0 prior)- 315-frame exact match on L4 lift

1. Level 4 Elevator Execution & Opcode 0x72

  • Root Cause Analysis: In earlier test harnesses, feeding keystrokes via demo playback altered the active room index during level load. Because room objects are instantiated conditionally based on initial room assignment, the Level 4 elevator object remained uninitialized and unresponsive.

  • Opcode 0x72 Implementation: Ported script opcode 0x72, which clears and restores floor geometry underneath the lift platform prior to movement. Without opcode 0x72, the object state transitioned to "moving" but stalled in place due to background grid collision locks.

  • Controls & Verification: Verified against 315 frames of live execution data from the original DOS engine. Lifts are operated by holding Button 1 + Up / Down while positioned on the elevator platform.

2. Animation-Driven PSG Sound Engine

  • Header-Linked Audio Triggers: Rather than relying solely on explicit script opcodes (which only account for ~10% of game audio), sound effect triggers are embedded directly within animation frame headers.

  • Audio Density Jump: Transitioning to animation-linked audio triggers increased Level 1 sound output from zero automatic effects up to 108 PSG register writes during standard movement, running, and weapon-drawing sequences.

Release Verification Matrix

Component Status / Metric Operational Validation
Level 4 Lift Simulation 100% Parity (315 Frames) Conrad boards, descends, and arrives at bottom floor
Level 1 Oracle Verification 100% Parity (504 Frames) Live Z80 interpreter matches DOS engine execution trace
Animation Audio Triggers Functional Footsteps, weapon draws, and mechanics route to PSG
Main Gate Regression Test PASSED End-to-end ROM validation passes across all 7 level parts

v0.0.4: Flashback SMS: add support for music.

Choose a tag to compare

@haroldo-ok haroldo-ok released this 24 Sep 20:15

Full Changelog: v0.0.3...v0.0.4

This is a massive dual milestone for the project. Re-creating the audio architecture for the SN76489 PSG while simultaneously pushing script opcode coverage to 98--99% across all seven level parts brings this 4 MB Master System port remarkably close to a fully feature-complete conversion.

Key Technical Achievements in This Update

                   Dual-Engine Audio & Opcode Pipeline
                                     │
    ┌────────────────────────────────┼────────────────────────────────┐
    ▼                                ▼                                ▼
PSG Music Synthesizer           Analytic SFX Rebuilder           Script Opcode Expansion
- 3-Voice MIDI Downmix          - Noise/Pitch Envelope Matching  - 98--99% Opcodes Implemented
- Voice Pinning (Line Preservation)- Voice 3 & Noise Override     - Elevator Mechanics Supported
- 60 Hz Byte Streams (~0.5 KB/track)- Priority Channel Lockout    - Unported Steps Gracefully Skipped

1. SN76489 Audio Architecture

  • MIDI-to-PSG Dynamic Downmixing: Converting the DOS version's 27 MIDI tracks to the SMS PSG's 3 square wave channels and 1 noise channel uses a dynamic loudness allocation system. By pinning active notes to specific voices across frame transitions, melodic lines remain coherent without jumpy channel swapping.

  • Acoustic SFX Envelope Reconstruction: Rather than attempting raw PCM playback (which would destroy VBlank quotas and CPU time), 56 sampled effects were analyzed for noise ratio, pitch trajectory, and volume envelopes, then re-synthesized into native PSG tone and noise bursts.

  • Audio Channel Prioritization: Sound effects trigger on Tone Voice 3 and the Noise channel. When an SFX plays, music register writes to those specific channels are temporarily suppressed, avoiding register contention and audio garbage.

2. Elevator Mechanics & Opcode Expansion

  • Vertical Traversal Opcodes: Ported isBelowConrad and isAboveConrad, enabling lifts and platforms in Level 2 (New Washington) and Level 3 to evaluate Conrad's relative vertical positioning and trigger movement vectors.

  • Script Engine Coverage: Added direction-relative collision tests, addToCredits, setCollisionState2, and object/grid collision queries. Script execution across all seven level parts now operates at 98--99% native opcode coverage.

Master System Audio & Level 2 Script Matrix

System Component Execution Model Resource Footprint
ROM Space 4,096 KB / 4,096 KB (100% Full) Packed with the 11 reachable music tracks
PSG Music Tracks 11 active tracks (Title + Cutscenes + Levels) 60 Hz pre-rendered byte streams (~0.5 KB / track)
Synthesized SFX 56 active reconstructed effects Plays via Tone Channel 3 + Noise Channel
Level 2 Lifts & Elevator Scripts Driven by isBelowConrad / isAboveConrad Unported opcode rate dropped to 3 hits per 86 frames

Verification & Checksum Log

  • MD5 Build Checksum: cfb638952aca7d47942ba88e8d56a82a

  • Tick-for-Tick Oracle Test: 100% parity retained across the first 504 frames (~17s) of Level 1.

  • Audio Bus Validation: Verified via headless emulator register logging (Title Theme: 60 writes over 37 frames; SFX: 45 writes over 18 frames with expected volume decay and tone latching).

v0.0.3: Flashback SMS: add all the 5 levels from the full version.

Choose a tag to compare

@haroldo-ok haroldo-ok released this 23 Sep 20:18

Full Changelog: v0.0.2...v0.0.3

All of the five levels are now present, even if all of them are just partially playable.

image image image image image image

This is a monumental milestone for the Sega Master System port of Flashback. Fitting all five levels, seven level parts, 193 room backgrounds, and 27 cutscenes into a single 4 MB ROM pushes the standard 8-bit SMS architecture and mapper limits to their absolute breaking point.

Milestone Technical Summary

                       Flashback 4 MB ROM Map (4,080 KB / 4,096 KB)
                                         │
     ┌───────────────────────────────────┼───────────────────────────────────┐
     ▼                                   ▼                                   ▼
Banks 0--1 (32 KB Fixed)              Banks 2--115 (~1.8 MB)               Banks 116--255 (~2.2 MB)
- Core Interpreter Logic            - 193 Rooms & 7 Level Parts         - 27 FMV Cutscene Streams
- Collision & Grid Systems          - 6 Dynamic Sprite Sets (33% Comp)  - Shared Tile Dict (46% Comp)
- Resumable VBlank Player           - RAM Overlay & Modified Spans      - Lossless Delta Buffer

Key Architectural Fixes & Discoveries

  • Room Base Offset Alignment: Resolved the tile noise bug on Level 2 by synchronizing the room converter's base tile calculation with the VRAM loader's dynamic tile placement logic. (Level 1 had masked the bug by hitting the maximum tile capacity threshold).

  • Extended Object Table Indexing: Corrected a 31-byte memory shift caused by Level 2's 256-object table exceeding the 255-entry limit. Addressing pointers now calculate offsets using the real count while clamping active simulation slots to memory bounds, restoring exact checksum parity across all 7 level parts.

  • Aggressive Asset Compression Profile:

    • Cutscene Tiles: 46% savings via shared tile dictionary deduplication.

    • Room Scenery: 31% savings across 193 rooms (including 15-color priority masking for foliage).

    • Sprite Sheets: 33% savings covering all 6 level-specific sprite sets.

Asset & Level Matrix

Level / Section Rooms Status / Verification Mechanics & Known Constraints
Intro & Title --- Pixel-exact vs. DOS original Logos & Title active; 3 longest clips cut for size
Level 1 (Jungle) 38 504 Frames (~17s) Exact Match Verified engine parity; hit detection & items functional
Level 2 (New Washington) 42 Object Table Checksum Verified 255/256 objects simulated; lifts & teleporters unported
Level 3 (Death Tower) 31 Rooms & Data Load Correctly Death Tower game rules & force fields pending script port
Level 4 (Earth) 36 Backgrounds & Sprites Native Approach cutscene omitted; security mechanics unported
Level 5 (Morph Planet) 46 Object Table Checksum Verified Morphing animations & alien mechanics unported

Known Edge Cases & Deferred Mechanics

  1. Cutscene Truncation: To fit within the 4,096 KB boundaries, the three longest cinematic sequences (full intro narrative, Level 4 approach) were removed, leaving the logos and 27 core gameplay/item cutscenes.

  2. Level 2 Object Cap: Object #256 in Level 2 falls outside the active 255-slot simulation array; addressing remains safe, but the 256th object will remain idle.

  3. Unported Level Scripting (Levels 2--5): While levels load and render room geometry/sprites properly, environmental scripts involving elevators, teleporters, force fields, and Death Tower traps require their corresponding opcode implementations to execute correctly.

v0.0.2: Flashback for Sega Master System: port again using Claude Code.

Choose a tag to compare

@haroldo-ok haroldo-ok released this 21 Sep 09:56

Full Changelog: v0.0.1...v0.0.2

The entire player moveset is now working and interacting correctly with the scenario.

image image image image image image

This Milestone 3 update for Flashback (DOS Demo) on the Sega Master System demonstrates impressive technical progress, moving beyond recorded video replays into a true Z80-interpreted live game engine.

Core Milestone 3 Accomplishments

                     Z80 Game Engine & Interpreter Loop
                                     │
    ┌────────────────────────────────┼────────────────────────────────┐
    ▼                                ▼                                ▼
Object Script Interpreter        Collision & Spatial Grid       Hardware Sprite Renderer
- ~60 / 75 Opcodes Ported        - 16x7 Room CT Grid             - 3,820 8x16 Sprites (245 KB)
- Tick-by-tick Oracle Validated  - RAM Modified Spans Overlay    - 32 Dynamic VRAM Slots
- 504 Frames Exact Match (~17s)  - Melee & Gun Hit Detection     - Room-List Spatial Culling

  • Tick-for-Tick Interpreter Accuracy: The Z80 engine accurately executes the first 504 frames (~17 seconds) of live Level 1 gameplay. Every active object's position, room, flags, animation state, and entry points match the original DOS engine's execution trace.

  • Spatial Optimization & Culling: The renderer was converted to walk per-room object lists rather than iterating over all 107 global objects per frame. This reduced the sprite renderer pass from 148k down to 70k cycles per frame.

  • Smart Palette Priority (Foliage Bug Fix): Solved item visibility issues (such as the Holocube hidden in tree canopies) by clearing background tile priority bits on cells hosting collectibles, ensuring items render over background scenery without flickering.

  • Dynamic RAM Grid Overlays: Handled ROM-bound level data constraints by creating a RAM-based overlay for modified grid spans (supporting up to 24 modified spans) and linked lists to track object room assignments accurately.

Performance & Cycle Profiling Breakdown

Sampling profiling on tools/smstest identifies exact Z80 execution costs per 30 Hz step (currently taking ~6.6 frames of CPU time per 30 Hz tick):

Execution Phase Z80 Cycles / Frame Operational Details
Interpreter Core 219k (56%) Script walk, collision prep, animation updates
Object Loops 71k (18%) Per-frame logic_step iterations across active objects
Sprite Renderer 70k (18%) sim_step VRAM pattern streaming & 8x16 sprite layout
Harness Overhead Remainder Diagnostic checksums (disabled in production build)

Memory & System Resource Allocation

Component Allocated Size System Bounds & Optimization Notes
ROM Footprint 2 MB (Demo) / 4 MB (Full) Cutscene tile dictionary merged at 4-pixel sampling, saving ~530 KB
Z80 Main Code Area 5.8 KB Operates inside standard 32 KB fixed window (banks 0--1)
Z80 System RAM 4.2 KB Utilized primarily for the 180-entry live object table (22 bytes/object)
VRAM Sprite Buffer 32 Slots 8x16 hardware sprites reduce per-line overflow and flicker

Player Controls (Demo Runtime)

Input Game Action
D-Pad Left / Right Move Conrad / Change directional orientation
Button 1 Run modifier
Button 2 Action / Interact / Draw & Fire Blaster
Button 1 + Up (Neutral D-Pad) Standing forward jump / Running leap
PAUSE (Console) Return to main title screen

v0.0.1: Flashback for Sega Master System: first prototype; generated with Arena.

Choose a tag to compare

@haroldo-ok haroldo-ok released this 21 Sep 09:37

Full Changelog: https://github.com/haroldo-ok/flashback-sms/commits/v0.0.1

image image image

This version is almost playable.

This merged 4 MB Sega Master System build of Flashback: The Quest for Identity is a technical milestone for the platform, successfully unifying the DOS demo gameplay engine with the cinematic FMV engine on standard 8-bit SMS architecture.

Key Technical Architecture

                       Master System 4 MB Cartridge Map
                                       │
     ┌─────────────────────────────────┼─────────────────────────────────┐
     ▼                                 ▼                                 ▼
Banks 0--1 (Fixed 32 KB)            Banks 2--43 (Level 1 Data)         Banks 44--96 (FMV Stream)
- Core Game Engine Logic           - 38 DOS Demo Rooms & Grids       - 932 Frames (848 KB Stream)
- Resumable Delta Player           - 346 Rotoscoped Conrad Frames    - 20,202 Shared Tile Dict
- SN76489 Sound Drivers            - Item Art & Icon Banks           - 32 Tile Upload VBlank Quota

Core Engineering Highlights

  • Shared Tile Dictionary Encoding: Rather than dedicating distinct VRAM banks to individual videos, encode_shared_dictionary.py builds a single 20,202-tile global dictionary (~631 KB) across all 932 cutscene frames. This deduplication frees enough space to achieve a 0.0000% pixel-error lossless stream within 53 banks (848 KB).

  • VBlank-Quota Resumable Player: The runtime engine (video_player.c) enforces a strict budget of 32 tile uploads per VBlank (~52% of an NTSC frame). Heavier delta frames are automatically split across consecutive VBlanks, adjusting hold-time frame delays to preserve original cinematic pacing without VRAM corruption or screen tearing.

  • Seamless Cutscene Triggering: Floor items and level triggers seamlessly invoke their respective FMV sequences (such as Holocube playback or Object Recovery) and restore Conrad's exact room coordinates, inventory state, and collision bounds upon completion.

Cutscene & Performance Matrix

Cutscene Frame Count Trigger Condition Playback Execution
Delphine Software Logo 153 Cartridge Boot Autoplay → Title Menu
Cinematic Intro (Parts 1 & 2) 640 Title Menu Selection Continuous 2-part sequence
Holocube Message 35 Title Menu or Item Pick-up Plays upon Holocube recovery
Jungle Debut 50 Starting Game Pre-Level 1 Cinematic
Object Recovery 35 Floor Item Pickup Resumable playfield hook
Disintegration 19 Reaching Room 63 Game Over Sequence

Build & Verification Commands

Bash

# Setup devkitSMS toolchain and compile 4 MB ROM
bash <skill>/scripts/setup_toolchain.sh
cd sms
make                # Builds reproducible flashback.sms (md5: d56925c19da83696a1f27aef8b6d05b6)

# Execute automated playtest and video frame verification
$HOME/.devkitsms/bin/smstest flashback.sms tests/playtest.txt
python3 tools/verify_rom_video.py --rom sms/flashback.sms\
        --noi sms/flashback_base.noi --frames /tmp/frames --work /tmp/rv