ThomasSpeedrunner

zSetChanVol

Sep 21st, 2014
577
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. ;zsub_E8A
  2. zSetChanVol:
  3. bit 7,(ix+1) ; a PSG track
  4. ret nz ; If so, quit!
  5. bit 2,(ix+0) ; If playback control byte "SFX is overriding this track" bit set...
  6. ret nz ; ... then quit!
  7. ld e,(ix+1Ah) ; zVolTLMaskTbl value from last voice setting (marks which specific TL operators need updating)
  8. ld a,(ix+1) ; Load current voice control byte
  9. and 3 ; Keep only bits 0-2
  10. add a,40h ; Add 40h -- appropriate TL register
  11. ld d,(ix+6) ; Get channel volume
  12. bit 7,d ; If bit 7 (80h) is set...
  13. ret nz ; ... then quit!
  14. push hl ; Save 'hl'
  15. ld l,(ix+1Eh) ; low byte of where TL bytes begin (set during last voice setting)
  16. ld h,(ix+1Fh) ; high byte of where TL bytes begin (set during last voice setting)
  17. call zSetFMTLs ; Set the appropriate Total Levels
  18. pop hl ; Restore 'hl'
  19. ret
  20. ; End of function zSetChanVol
Advertisement
Add Comment
Please, Sign In to add comment