Advertisement
Guest User

Untitled

a guest
May 29th, 2016
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ; My first asm test
  2.  
  3. .include "Header.inc"
  4. .include "Snes_Init.asm"
  5.  
  6. VBlank:
  7.     lda $4210   ;Reset the VBlank by querrying this
  8.  
  9.     inc $0002   ;Update low byte
  10.     bne NOLOOP
  11.     inc $0003   ;Update high byte
  12. NOLOOP NOP
  13.     stz $2121   ;Force palette indexupdate
  14.     lda $0002   ;Set background color
  15.     sta $2122
  16.     lda $0003
  17.     sta $2122
  18.    
  19.     RTI         ;Return
  20.  
  21. .bank 0
  22. .section "MainCode"
  23.  
  24. Start:
  25.     ;Init
  26.     Snes_Init
  27.     lda #%00001111  ;Enable the screen (bit 7) and force brightness to 100%
  28.     sta $2100
  29.    
  30.     lda #$80        ;Enable VBlank IRQ
  31.     sta $4200
  32.    
  33.     sep #$20    ;Set the A register to 8bit
  34.     stz $0002   ;$0002 = 0
  35.     stz $0003   ;$0003 = 0
  36.  
  37. Forever:
  38.     wai
  39.     jmp Forever
  40.  
  41. .ends
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement