Skip to content

Releases

v0.0.2: Fix naming screen and the build-time screen capturing (Progress Quest for SMS)

Choose a tag to compare

@haroldo-ok haroldo-ok released this 30 Aug 12:36

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

image

Key Fixes & Technical Summary

1. Missing Naming Keyboard Row (User-Facing Bug)

  • The Visual Impact: On the character creation screen, the first row of the keyboard (A–N) was completely invisible. Players only saw the second row (O–Z and ' -), making it impossible to type half the alphabet normally.
  • Root Cause & Fix: SDCC 4.5.0's peephole optimizer miscompiled the hardcoded shadow-buffer row index 8. Because 8 << 5 = 256 (0x0100), the optimizer tried to simplify the address math using inc h, but pulled a stale value from h and wrote the A–N tile row into invalid ROM space (~0x7600).
  • The Solution: Wrapped the row offset math into a name_row(u8 y, ...) helper. Passing y as a runtime parameter breaks SDCC's constant-folding pass and forces clean Z80 index generation.
       Broken State (Optimizer Bug)             Fixed State (name_row Helper)
  ┌─────────────────────────────────┐        ┌─────────────────────────────────┐
  │ [Invisible / Missing Row A-N]   │ ─────> │ A B C D E F G H I J K L M N     │
  │ O P Q R S T U V W X Y Z ' -     │        │ O P Q R S T U V W X Y Z ' -     │
  └─────────────────────────────────┘        └─────────────────────────────────┘


2. Screen Capture Pipeline (scripts/ppm2png.py)

  • The Issue: Screenshots generated for documentation appeared duplicated side-by-side because the previous converter repeated whole scanlines of raw bytes rather than scaling individual pixels horizontally.
  • The Solution: Replaced with a pure Python converter (scripts/ppm2png.py) that handles exact $2\times$ nearest-neighbor pixel replication and proper PNG filtering.

v0.0.1: Perform initial port of Progress Quest to Sega Master System using Arena

Choose a tag to compare

@haroldo-ok haroldo-ok released this 30 Aug 12:20

Full Changelog: https://github.com/haroldo-ok/progress-quest-sms/commits/v0.0.1
00_title
04_main
05_char

The initial port of Progress Quest for the Sega Master System is a zero-player RPG design on constrained 8-bit hardware. By stripping floating-point math and non-power-of-two divisions from the hot paths, Grumdrig's idle game translates smoothly into pure Z80 architecture using standard SDCC and devkitSMS conventions.

System Architecture & Engine Breakdown

                       Cartridge ROM (64 KB / 4 Banks)
                                       │
  ┌────────────────────────┬───────────┴───────────┬────────────────────────┐
  │ Low 32 KB Fixed        │ Bank 2 (0x28000)      │ Bank 3 (0x38000)       │
  │  - Main Loop & Input   │  - folder2c Data      │  - gamedata.rel (Data) │
  │  - Simulation Engine   │  - Tiles & Palettes   │  - strings.rel (Text)  │
  │  - SMSlib & crt0_sms   │  - Logomap Payload    │  * Fixed at 0x8000     │
  └───────────┬────────────┴───────────────────────┴───────────┬────────────┘
              │                                                │
              ▼                                                ▼
  ┌─────────────────────────────────────────────────────────────────────────┐
  │                            SMS Hardware & VRAM                          │
  │  - VRAM: 768-cell Shadow Tilemap Diff (Committed 4 rows / VBlank frame) │
  │  - SRAM (Cartridge RAM): Auto-writes template IDs (No raw pointers)    │
  └─────────────────────────────────────────────────────────────────────────┘

1. Memory Allocation & Banking Discipline

  • Low 32 KB (Fixed): Reserved for core execution logic (crt0, SMSlib, main.c, sim.c, ui.c, and text.c). This ensures interruption-free execution of simulation ticks and input handlers.

  • Bank 2 (0x28000): Holds pure graphical data (tiles.bin, palette arrays, logo maps) converted via folder2c.

  • Bank 3 (0x38000 mapped at 0x8000): Dedicated to all game strings, item names, monster tables, spell lists, and race/class definition arrays.

  • SRAM Safety: Save operations page in cartridge SRAM without corrupting string references. The save routine stores u8 template indices rather than raw RAM pointers, eliminating dangling reference issues across resets or software revisions.

2. VDP Rendering & Frame-Budgeted Updates

To prevent frame drops during simulation updates at high speed multipliers ($\times 16 / \times 64$), the engine decouples UI rendering from game logic:

                  Simulation Tick (100ms Fixed-Point Integer)
                                       │
                                       ▼
                     Shadow Tilemap Composition (768 Cells)
                     Runs every 8th to 32nd frame depending on speed
                                       │
                                       ▼
                      Incremental VRAM Diff Commit
                     Applies max 4 rows per VBlank interrupt

  • Mode 4 Tile Packing: Each $8 \times 8$ tile uses 32 bytes arranged as 4 bit-planes.

  • Fixed-Point Engine: All progress bars, task durations, and experience increments scale by integer constants ($\times 1000$).

  • Input Responsiveness: High simulation multipliers skip UI composition passes while maintaining regular hardware input sampling.

3. Navigation & System Control

Controls Reference

Button Character Creation In-Game Simulation
D-Pad (Up / Down) Move Cursor Cycle Active Views
D-Pad (Left / Right) Move Cursor Cycle Active Views
Button 1 Pick / Confirm Selection Open Pause Menu
Button 2 Delete / Back Jump to Next View
Pause / Start --- Hardware Pause (Toggles Menu)

Views Overview

 [1. Main View]     ──> [2. Character Sheet] ──> [3. Equipment]
      │                                                │
 [6. Adventure Log] <── [5. Spell Book]      <── [4. Inventory]