Guest User

Untitled

a guest
Apr 16th, 2018
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. @EndlessLoop:
  3.     bsr ProcessJoypad
  4. @DontAllowButton:
  5.     Echo_Z80Request
  6.     lea (Echo68K), a0
  7.     lea (EchoZ80), a1
  8.     rept 6
  9.     move.b (a1), (a0)+ ;since z80 can only do byte shits... sucks, man.
  10.     move.b #0, (a1)+
  11.     endr    
  12.     rept 5
  13.     move.b (a1)+, (a0)+ ;since z80 can only do byte shits... sucks, man.
  14.     endr    
  15.     ; We should probably do things with it here. But I'm lazy. Until next time, good bye :D
  16.     Echo_Z80Release
  17.     bsr VUProcess
  18.     bsr ProcessVUTiles
  19.     waitframe
  20.     bra @EndlessLoop
  21.  
  22. ProcessVUTiles:
  23.    lea (VUMeters), a0
  24.     lea (VUTiles), a1
  25.     moveq #10, d2
  26. @That:
  27.     lea (Empty), a3
  28.     lea (normal), a4
  29.     moveq #0, d0
  30.     move.b (a0)+, d0
  31. @Write:
  32.     moveq #38, d1
  33.     sub.b d0, d1
  34. @WriteEmpty:
  35.     move.l (a3)+, (a1)+
  36.     add.l #4, a4
  37.     dbf d1, @WriteEmpty
  38. @WriteNormal:
  39.     move.l (a4)+, (a1)+
  40.     dbf d0, @WriteNormal
  41. @FailSata    
  42.     dbf d2, @That
  43.     rts
  44.    
  45. PaletteCycle:
  46.    rts
  47.    
  48. LoadChassisMaps:
  49.    lea (Chassis_Mappings), a0
  50.     move.l #$44000003, (VDPControl)
  51.     lea (VDPData), a1
  52.     move.l #1792, d0
  53. @Loop:
  54.     move.w (a0)+, (a1)
  55.     dbf d0, @Loop
  56.     rts
  57.  
  58. VUProcess:
  59.    lea (VUMeters), a0
  60.     lea (Echo68K), a1
  61.     moveq #5, d1
  62. @ProcessDecay:
  63.     tst.b (a1)
  64.     beq @NoNewNote
  65.     move.b #38, (a0)+
  66.     clr.b (a1)+
  67.     bra.s @FM_Done
  68. @NoNewNote:
  69.     tst.b (a0)
  70.     bne.s @Bowls
  71.     move.b #1, (a0)
  72. @Bowls:
  73.     subq.b #1, (a0)+
  74.     clr.b (a1)+
  75. @FM_Done:
  76.     dbf d1, @ProcessDecay
  77.     bsr HandlePSG
  78.     rts
  79.    
  80. HandlePSG:
  81.    lea (Echo68K+6), a0
  82.     lea (VUMeters+6), a1
  83.     rept 4
  84.         move.b (a0)+, d1    
  85.         not.b d1
  86.         and.b #$F, d1
  87.         beq *+8
  88.         add.b d1, d1
  89.         addq.b #6, d1
  90.         move.b d1, (a1)+        
  91.     endr    
  92. HandlePCM:
  93.    move.b (Echo68k+10), d0
  94.     cmp.b #$81, d0
  95.     bne @NotZero
  96.     clr.b (VUMeters+10)
  97.     rts
  98. @NotZero
  99.     bcc.s @GreaterSpyer
  100.     not.b d0
  101. @GreaterSpyer:
  102.     and.b #$7F, d0
  103.     lsr.b #2, d0
  104.     addq.b #6, d0
  105.     move.b d0, (VUMeters+10)
  106.     rts
  107.    
  108. ProcessJoypad:
  109.    move.b (Joypad1), d0
  110.     move.b (Timer1), d2
  111.     cmp.b d0, d2
  112.     beq.s @NoButtonsYet
  113.     move.b d0, (Timer1)
  114.     btst #4, d0
  115.     beq.s @Bbtn
  116.     btst #5, d0
  117.     beq.s @Cbtn
  118. @NoButtonsYet:
  119.     rts
  120. @CBtn:
  121.     moveq #0, d0
  122.     jsr PlayBGM
  123.     rts
  124. @BBtn:  
  125.     jsr StopBGM
  126.     rts
Add Comment
Please, Sign In to add comment