Advertisement
MolSno

statusbar.asm

Jan 3rd, 2015
229
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.20 KB | None | 0 0
  1. org $008E1A
  2. autoclean JSL Main
  3. NOP
  4.  
  5. org $00C547
  6. BRA +
  7. NOP #6
  8. +
  9.  
  10. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  11.  
  12. !pow_bar_loc = $0F0B
  13.  
  14. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  15.  
  16. freecode
  17. reset bytes
  18.  
  19. Main:
  20. PHB : PHK : PLB
  21. JSR Pow_Meter
  22. Return:
  23. PLB
  24. LDA $1493
  25. ORA $9D
  26. RTL
  27.  
  28. Pow_Text:
  29. db $19,$18,$20,$78
  30.  
  31. Pow_Meter:
  32. LDA $14AD : BEQ Pow_Off
  33.  
  34. .Pow_On:
  35. Draw_Meter:
  36. ; the "POW:" text
  37. LDX #$03
  38. - LDA Pow_Text,x : STA !pow_bar_loc,x
  39. DEX : BPL -
  40.  
  41. ; the bar
  42. LDX #$03
  43. LDA $14AD : STA $4205 : STZ $4204
  44. LDA #$B0 : STA $4206
  45. JSR Divwait
  46. LDA $4214
  47. LSR : LSR : LSR
  48. PHA : AND #$18 : STA $00
  49. PLA : AND #$07 : CLC : ADC #$E1 : STA $01
  50. LDA #$20
  51. - SEC : SBC #$08 : CMP $00 : PHA
  52. BCC +1 ; ??????
  53. BNE +2 ; ????????????????????????????????
  54. LDA $01 : STA !pow_bar_loc+5,x
  55. BRA dmloopend
  56. LDA #$E8 : STA !pow_bar_loc+5,x : BRA dmloopend
  57. LDA #$E0 : STA !pow_bar_loc+5,x
  58.  
  59. dmloopend:
  60. PLA : DEX : BPL -3
  61. LDA #$D0 : STA !pow_bar_loc+4 : INC : STA !pow_bar_loc+9
  62. RTS
  63.  
  64. Pow_Off:
  65. Remove_Meter:
  66. LDX #$09
  67. LDA #$FC
  68. - STA !pow_bar_loc,x : DEX : BPL -
  69. RTS
  70.  
  71. Math:
  72. Divwait:
  73. NOP #2
  74. Multwait:
  75. NOP #4
  76. RTS
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement