jurjen.ladeniusandClaude Fable 5 d64cb8b37c Add ayFX sound effects; fix torus strip fills ignoring the orthogonal base
Sound effects (ayFX on the PSG, mixed over the FM music):
- 8-effect bank from sfx/sfx_bank.afb embedded as sfx_bank.h in fixed
  main ROM (interrupt-readable without bank switching). Triggers: random
  cat-paw footstep (0-2) per move, fanfare (4) on reaching the exit, map
  unfold (5) on M, laugh (6) on C, ta-daa (7) when advancing the title/
  hint/win screens. Priorities keep footsteps below UI/finish sounds.
- The H_TIMI hook now also runs ayFX_Update + PSG_Apply each frame;
  PSG switched to indirect (buffered) access with AYFX_BUFFER_DEFAULT.
- Interrupt-safety fixes this surfaced: all joystick reads go through
  ReadJoy() (DI/EI around Joystick_Read, which drives the PSG and raced
  the ISR's PSG_Apply — caused noise, phantom input, minimap-on-move),
  and the PSG mixer is muted at startup (zeroed buffer = all channels
  enabled active-low, which PSG_Apply drove as noise during the logo).

Torus scrolling fix (bug from 7c24daa, exposed by mixed-direction play):
- ScrollDraw's bulk strip fills only honoured the scroll-axis base, so
  with a non-zero orthogonal base the newly revealed edge was drawn
  rotated by 2/4/6 tiles — phantom walls/passages while collision stayed
  correct. Vertical strips are now pre-rotated by g_BaseX in staging;
  horizontal column fills split at the 256-row wrap via FillStripColumns.

CLAUDE.md updated for both (SFX table + ISR rules, both-axis fill rule).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-04 23:33:07 +02:00

MSXgl is a Game Library wrote in C and targeting MSX computers.

The purpose of this library is to provide C programmers with the whole set of functionalities to make a game with high performance. Even though a C program can never be as efficient as a program written entirely in assembler, the goal is to try to get as close as possible.

To achieve this goal, the library is dynamically compiled to allow the user to configure the functionalities to best suit his needs. Also, the most expensive features are written in assembler.

The other goal was to create a library that is totally independent of the BIOS. This makes it much easier to use the 16K of page 0. The library also provides interrupt handling code to create ROMs that always remain on page 0.

Many sample programs are available to demonstrate the different features of the library.

The MSXgl Build Tool allows you to create a final program for a large number of formats with just 1 click:

  • Plain ROM from 8K to 64K (interrupt handler can be installed in page 0),
  • Mapped ROM from 64K to 4096K (ASCII-8, ASCII-16, Konami and Konami SCC mappers),
  • MSX-DOS 1 or 2 binary program,
  • BASIC binary program.

The library supports the following devices:

  • VDP (TMS9918, V9938 and V9958) and V9990,
  • PSG (AY-3-8910), MSX-Music, MSX-Audio, Konami SCC,
  • Keyboard, Joystick, Mouse and Ninja Tap (4 joysticks adaptator),
  • ROM mapper, slot manager, and Real Time Clock (RP-5C01).

Here are also the supported audio formats:

  • Arkos Tracker 2 (AKG, AKY and AKM)
  • Trilo Tracker SCC
  • Vortex Tracker II (PT3)
  • WYZ Tracker (WYZ)
  • ayFX
  • VGM (for all supported audio chip)
  • lVGM (a light-VGM format for for all supported audio chip)
  • PCM-Encoder (aka. Crystal clean PCM 8bit samples on the poor PSG)

Many thanks to the members of the MSX Resource Center and MSX Village who have been very helpful. The library is distributed under the Creative Commons BY-SA license. Tools or sources from other authors may use another free license.

Documentation:

If you have any question, feel free to join the MSXgl Discord server.

This work is licensed under CC BY-SA 4.0

S
Description
No description provided
Readme
134 MiB
Languages
C 86.1%
Assembly 5.4%
HTML 5%
C++ 1.5%
JavaScript 1.4%
Other 0.5%