Advertisement
Guest User

Untitled

a guest
Jul 10th, 2017
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     include "pgsdz80_support.asm"
  2.  
  3. ; LoadPGSD [TODO add a0/a1 as DAC tables ptrs]
  4. LoadPGSD:
  5.     movem.l d0/a0/a1,-(sp)
  6.  
  7.     move.w  #$100,($A11100).l           ; bus req on
  8.     move.w  #$100,($A11200).l           ; reset off
  9.    
  10.     lea     __PGSDZ80,a0
  11.     move.l  #$A00000,a1
  12.     move.w  __PGSDZ80End-__PGSDZ80,d0   ; TODO -1?
  13. -
  14.     move.b  (a0)+,(a1)+
  15.     dbf     d0,-
  16.  
  17.     move.b  ($A10001).l,d0              ; get flag state for NTSC/PAL
  18.     move.b  d0,(__PGSD_NewPlaying)
  19.  
  20.     move.w  #0,($A11200).l              ; reset on
  21.     move.w  #0,($A11100).l              ; bus req off
  22.     move.w  #$100,($A11200).l           ; reset off
  23.  
  24.     move.l  (sp)+,d0/a0/a1
  25.     rts
  26.  
  27. ; PlaySong (a0 -- ) - play song at address a0
  28. PlaySong:
  29.     movem.l a0/a1,-(sp)
  30.  
  31.     move.w  #$100,($A11100).l               ; bus req on
  32. -
  33.     btst    #1,($A11100).l
  34.     beq.s   -
  35.  
  36.     move.l  #__PGSD_PointerFrom68000,a1 ; write pointer
  37.     move.b  a0,(a1)-
  38.     REPT 3
  39.     lsr.l   #4,a0
  40.     move.b  a0,(a1)-
  41.     ENDM
  42.     move,b  #1,(__PGSD_NewPlaying).l        ; mark to play music!
  43.  
  44.     move.w  #0,($A11100).l                  ; bus req off
  45.  
  46.     movem.l (sp)+,a0/a1
  47.     rts
  48.  
  49. ; PlaySFX (a0 -- ) - play SFX at address a0
  50. PlaySFX:
  51.     ; TODO
  52.     rts
  53.  
  54. __PGSDZ80:
  55.     binclude    "pgsdz80.bin"
  56. __PGSDZ80End:
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement