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>
30 lines
2.3 KiB
C
30 lines
2.3 KiB
C
#include "msxgl.h"
|
|
|
|
// ayFX sound-effect bank (8 effects, PSG). Lives in fixed main ROM so the
|
|
// H_TIMI music/SFX interrupt can read it without any bank switching.
|
|
// ids: 0-2 catpaws (movement), 4 fanfare (finish), 5 mapunfold (M),
|
|
// 6 manilaugh (C), 7 tadaaa (screen keypress). See sfx/sfx_bank.txt.
|
|
const u8 g_SFXBank[330] = {
|
|
0x08, 0x0F, 0x00, 0x27, 0x00, 0x3F, 0x00, 0x57, 0x00, 0x7B, 0x00, 0xA0, 0x00, 0xD0, 0x00, 0x14,
|
|
0x01, 0x56, 0x12, 0x13, 0x90, 0x90, 0x90, 0x55, 0x14, 0x12, 0x90, 0x90, 0x90, 0x57, 0x13, 0x13,
|
|
0x90, 0x90, 0x90, 0x55, 0x15, 0x11, 0x90, 0x90, 0x90, 0xD0, 0x20, 0x56, 0x0C, 0x13, 0x90, 0x90,
|
|
0x90, 0x55, 0x0E, 0x12, 0x90, 0x90, 0x90, 0x57, 0x0B, 0x13, 0x90, 0x90, 0x90, 0x55, 0x0D, 0x11,
|
|
0x90, 0x90, 0x90, 0xD0, 0x20, 0x56, 0x08, 0x13, 0x90, 0x90, 0x90, 0x55, 0x0A, 0x12, 0x90, 0x90,
|
|
0x90, 0x57, 0x09, 0x13, 0x90, 0x90, 0x90, 0x55, 0x0B, 0x11, 0x90, 0x90, 0x90, 0xD0, 0x20, 0xAD,
|
|
0x76, 0x05, 0xAF, 0xF2, 0x07, 0x8F, 0xAC, 0x51, 0x09, 0xA9, 0xED, 0x0A, 0xAC, 0xF9, 0x03, 0xAE,
|
|
0xD3, 0x05, 0x8E, 0xAB, 0x4F, 0x07, 0xA8, 0x2B, 0x09, 0xA6, 0x80, 0x0B, 0x86, 0x85, 0x84, 0x83,
|
|
0x82, 0x81, 0x80, 0xD0, 0x20, 0xAC, 0xD6, 0x00, 0x8D, 0x8E, 0xAE, 0xAA, 0x00, 0x8E, 0x8E, 0xAE,
|
|
0x8F, 0x00, 0x8E, 0x8E, 0xAF, 0x6B, 0x00, 0x8F, 0x8F, 0x8E, 0x8D, 0x8C, 0x8B, 0xAF, 0x55, 0x00,
|
|
0x8F, 0x8F, 0x8F, 0x8D, 0x8B, 0x89, 0x86, 0x84, 0x82, 0x80, 0xD0, 0x20, 0x58, 0x03, 0x1B, 0x1B,
|
|
0x59, 0x05, 0x56, 0x06, 0x55, 0x05, 0x16, 0x18, 0x19, 0x59, 0x04, 0x57, 0x06, 0x55, 0x07, 0x56,
|
|
0x06, 0x57, 0x07, 0x58, 0x08, 0x19, 0x5A, 0x09, 0x5A, 0x08, 0x58, 0x09, 0x56, 0x0B, 0x54, 0x0C,
|
|
0x14, 0x53, 0x0E, 0x53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