Advertisement
MolSno

mariostart.asm

Dec 20th, 2014
193
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.74 KB | None | 0 0
  1. org $0091B4
  2. autoclean JML main
  3.  
  4. freecode
  5. reset bytes
  6.  
  7. main:
  8. LDA $1425 ;
  9. BEQ + ;
  10. JML $8091BD ; ?????????
  11. +
  12.  
  13. draw_level:
  14. LDX #$04 ;\
  15. LDY #$00 ; | I have no idea what any of this does
  16. LDA #$60 : STA $00 ;/
  17.  
  18. .loop:
  19. LDA.l leveltilemap,x : STA $0302,y ; top tile #
  20. CLC : ADC #$10 : STA $0306,y ; bottom tile #
  21. LDA #$04 : STA $0303,y : STA $0307,y ; tile properties
  22. LDA #$60 : STA $0301,y : LDA #$68 : STA $0305,y ; y position
  23. LDA $00 : CLC : ADC #$08 : STA $00 ; increase x position
  24. STA $0300,y : STA $0304,y ; use x position
  25. TYA : CLC : ADC #$08 : TAY ; inc y for next tile
  26. DEX : BPL .loop ; loop
  27.  
  28. get_number:
  29. LDX $010A ;\ since this is being run before the level number is derived,
  30. LDA $13BF : BNE + ; | we have to derive it ourselves.
  31. LDA #$01 ;/ based on $05D84D
  32. +
  33.  
  34. draw_number:
  35. AND #$0F : TAX ; get level number (???)
  36. LDA #$A0 : STA $0328 : STA $032C ; x position
  37. LDA #$60 : STA $0329 : LDA #$68 : STA $032D ; y postion
  38. LDA.l numbertoptiles,x : STA $032A ; top tile
  39. LDA.l numberbtmtiles,x : STA $032E ; btm tile
  40. LDA.l numbertopprops,x : STA $032B ; top props
  41. LDA.l numberbtmprops,x : STA $032F ; btm props
  42.  
  43. do_sizes:
  44. LDX #$10 ; make sure they're all 8x8 and on screen
  45.  
  46. .loop:
  47. STZ $0460,x ;
  48. DEX : BPL .loop ;
  49.  
  50. ; done!
  51. return:
  52. JML $808494 ; ?????????????
  53.  
  54. leveltilemap:
  55. ; bottom tiles are just tile + $10, props are all $04
  56. db $4E,$4B,$4A,$4B,$4E
  57.  
  58. numbertoptiles:
  59. db $03,$00,$02,$5D,$13,$5B,$02,$5E,$01,$4C
  60. numbertopprops:
  61. db $04,$04,$44,$44,$84,$84,$04,$C4,$04,$44
  62. ; 04 = no change
  63. ; 44 = x-flip
  64. ; 84 = y-flip
  65. ; C4 = xy-flip
  66.  
  67.  
  68. numberbtmtiles:
  69. db $03,$00,$5D,$5D,$4E,$02,$4C,$4E,$01,$02
  70. numberbtmprops:
  71. db $84,$84,$84,$C4,$C4,$C4,$84,$C4,$84,$C4
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement