10-17-2011, 02:54 PM
i found this version from http://www.msx.org/forumtopic5246p16.html, which the only difference would be the i/o port and the used bit flag for 1bit sound - this version seems to be simpler, and playing the sample in a straight direction, instead of that previous YourSinclair reversed example - i only couldn't understand how the 8 bits of each byte are being readed to be performed as 1bit sound (i think some instructions are missing there, and the 7 bits else from each byte are being wasted?)
Code:
DEFB #FE
DEFW BEGIN
DEFW END
DEFW BEGIN
ORG #D000
BEGIN:
LD HL,PLAY
LD (#F39A),HL
RET
PLAY:
DI
LD HL,#C000
LD BC,#1000
PLAYLOOP:
LD A,(HL)
INC HL
ADD A,A
LD A,0
ADC A,14
OUT (#AB),A
EXX
LD B,60
WAIT: DJNZ WAIT
EXX
DEC BC
LD A,B
OR C
JP NZ,PLAYLOOP
RET
END: