Chordian / sidfactory2

SID Factory II is a cross-platform editor for composing music that will work on a Commodore 64. It uses the reSID emulator and is currently in open BETA.
http://blog.chordian.net/sf2/
110 stars 13 forks source link

Does packing actually work? #182

Closed robin-raymond closed 6 months ago

robin-raymond commented 6 months ago

Describe the bug I load an example song, e.g. Animal - Nah Na Mah Na.sf2

To Reproduce Steps to reproduce the behavior:

  1. Press F1 (to hear the song) + F1 again to stop
  2. Press F6 (utility)
  3. Select Pack
  4. Use defaults (address $1000 / Zero Page $fc)
  5. Export as .prg file

Load .prg file into C64 (e.g. VICE). if you type:

SYS 4096:FOR I=0TO10000:SYS4099:NEXT

Expected behavior I would expect the song to play, although badly timed. I hear nothing at all. Complete silence. If I use the debugger the A register is $00. If I force the A register to be $01 prior to SYS 4096, it still doesn't work.

TheRealLaxity commented 6 months ago

Yes it works.

The update address is not 4099 ($1003), but rather 4102 ($1006). That is however driver dependent, but for all publicly released drivers for SF2, the vectors are:

1000 init (accumulator denotes which song) 1003 stop 1006 update

robin-raymond commented 6 months ago

Ah okay, that was not clear. I could not find any documentation to this detail. When I look at the .PRG file I only saw the two JMP, instructions at the start of the file so I speculated there was only two entries, init and play not realizing that play entry point was actually located at address+$06.