Are there any SB100 experts out there? I'm adding SB100 sound support to my Bally/Stern OS, and I'm trying to decipher how original Stern games made calls to the SB100. I think I've found the sound data for the game I'm working with (Trident), and I've pasted the data below. It appears that 0x00 is the terminator, and that most of the sounds turn on only a single bit at a time, engaging just one of the tones on the card at once. I'm confused by the 84, 81, and such. The top bit (D7) of the data byte is not used on the SB100. It goes to U4-1D, but 1Q isn't hooked up. I would assume that maybe the code uses D7 to insert silence or do some branching or something, but I can't figure out where. Here's the data:
*17CE: 01
*17CF: 00
*17D0: 02
*17D1: 00
*17D2: 04
*17D3: 00
*17D4: 08
*17D5: 00
*17D6: 10
*17D7: 00
*17D8: 20 00
*17DA: 08
*17DB: 84 00
*17DD: 08
*17DE: 04
*17DF: 02
*17E0: 81 08
*17E2: 04
*17E3: 02
*17E4: 81 00
*17E6: 01
*17E7: 02
*17E8: 04
*17E9: 88 01
*17EB: 02
*17EC: 04
*17ED: 88 00
*17EF: 85 81
*17F1: 01
*17F2: 82 02
*17F4: 01
*17F5: 81 84
*17F7: 84 82
*17F9: 82 84
*17FB: 84 88
*17FD: 88 88
*17FF: 00
For the code, it appears to me that these sounds are sent to the SB100 (0x00A0) at the end of the 120Hz ISR, after the switch reads. Here's what I *think* is the sound code, and my attempt at comments after:
LDAA M000A *1FCF: 96 0A '..' ; Pull A from 0x000A,
BEQ Z1FF4 *1FD1: 27 21 ''!' ; and if it's zero, skip sound
LDAA M001B *1FD3: 96 1B '..' ; Load Current sound byte from 0x001B (??)
BNE Z1FF4 *1FD5: 26 1D '&.' ; If we're still playing something, skip to the end
CLRA *1FD7: 4F 'O' ; A = 0
STAA M00A0 *1FD8: 97 A0 '..' ; Stop sound
LDX M0008 *1FDA: DE 08 '..' ; Load sound pointer from 0x0008
LDAA ,X *1FDC: A6 00 '..' ; Load X from sound pointer
BEQ Z1FF1 *1FDE: 27 11 ''.' ; If it's zero, jump
STAA M00A0 *1FE0: 97 A0 '..' ; Store sound command on sound card
LDAB #$09 *1FE2: C6 09 '..' ; B = 0x09
LDAA ,X *1FE4: A6 00 '..' ; Re-load A from X?
BEQ Z1FEA *1FE6: 27 02 ''.' ; If it's zero, don't put 0x0C in B
LDAB #$0C *1FE8: C6 0C '..' ; B = 0x0C
Z1FEA STAB M001B *1FEA: D7 1B '..' ; Put B in 0x001B
INX *1FEC: 08 '.' ; Increment X (move to next sound byte)
STX M0008 *1FED: DF 08 '..' ; Store X as sound pointer
BRA Z1FF4 *1FEF: 20 03 ' .' ; Jump to 0x1FF4
Z1FF1 CLR >M000A *1FF1: 7F 00 0A '...' ; Clear 0x000A (end sound?)
Z1FF4 JMP Z107C *1FF4: 7E 10 7C '~.|' ; Jump back to an RTI (why not RTI here?)
To be honest, I have no idea how this is timing out the sound data to the card, or if that's even what's happening. When I code some of the data strings and send it out to the SB100, it makes sounds, but they're not quite what the game sounds like.
Anyone have information/insight?
Thanks!