Skip to content

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

Latest

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.