- One-shot cold loader (asm/opl4_loader.asm, overlaid into plugin page 5) uploads embedded PCM sample blocks into ZXM-MoonSound SRAM and compacts the VGM stream in place, letting files over the normal 64-page megabuffer budget play back through the existing pipeline. - instant_abort() was filling only one of the two ISR command buffers with the shutdown chain; the chain (SILENCE_OPL + WAVE_OFF/TL + CMD_ISR_DONE) doesn't fit in one buffer, so after the first CMD_END_BUF the ISR swapped into stale data and never reached CMD_ISR_DONE, hanging at the end of long tracks instead of advancing to the next one. Now fills both buffers while frozen and syncs update_buffer()'s own ready-tracking state. - Switch to 14MHz before the SRAM upload (previously ran at whatever speed WC's file I/O left active) and show "Loading..." for .vgz and files >= 1MB, since the busy-waited upload takes several seconds. - Confirmed on real hardware: long OPL4 tracks (previously stuck looping at the end) now finish and advance normally, ESC exits cleanly.
15 lines
543 B
JavaScript
15 lines
543 B
JavaScript
const fs = require('fs');
|
|
|
|
const [targetPath, overlayPath, offsetText] = process.argv.slice(2);
|
|
if (!targetPath || !overlayPath || !offsetText) process.exit(2);
|
|
|
|
const target = fs.readFileSync(targetPath);
|
|
const overlay = fs.readFileSync(overlayPath);
|
|
const offset = Number(offsetText);
|
|
if (!Number.isInteger(offset) || offset < 0 || offset + overlay.length > target.length)
|
|
process.exit(1);
|
|
|
|
overlay.copy(target, offset);
|
|
fs.writeFileSync(targetPath, target);
|
|
console.log(` overlay: ${overlay.length} bytes at +0x${offset.toString(16)}`);
|