Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;== Include memorymap, header info, and SNES initialization routines
- .INCLUDE "header.inc"
- .INCLUDE "InitSNES.asm"
- .include "LoadGraphics.asm"
- ;========================
- ; Start
- ;========================
- .BANK 0
- .ORG 0
- .SECTION "MainCode"
- VBlank:
- RTI ; Perform VBlank
- Main:
- InitializeSNES ; Initialize the SNES hardware
- jsr SetupVideo
- LoadPalette BGPalette, 0, 4
- LoadBlockToVRAM TileData, $0000, $0432
- lda #$FF
- sta $0800 ;Time ones place.
- lda #$00
- sta $0801 ;Time tens place.
- lda #$80
- sta $2115
- ldx #$04B0 ;T
- stx $2116
- lda #20
- sta $2118
- ldx #$04B1 ;I
- stx $2116
- lda #09
- sta $2118
- ldx #$04B2 ;M
- stx $2116
- lda #13
- sta $2118
- ldx #$04B3 ;E
- stx $2116
- lda #05
- sta $2118
- stz $2121
- stz $2122
- stz $2122
- lda #$01
- sta $2121
- lda #%11111111
- sta $2112
- lda #%01111111
- sta $2122
- ldx #$0400
- stx $2116
- lda #$00
- sta $2118
- PlaceTiles:
- inx
- stx $2116
- ina
- cmp #54
- beq Loop
- sta $2118
- jsr wait
- jmp PlaceTiles
- wait:
- .REPT $0A
- wai
- .ENDR
- rts
- Loop:
- lda $0800
- ina
- cmp #10
- beq IncrementTens
- sta $0800
- ldx #$04B5
- stx $2116
- lda $0801
- clc
- adc #27
- sta $2118
- ldx #$04B6
- stx $2116
- lda $0800
- clc
- adc #27
- sta $2118
- jsr wait
- jmp Loop
- IncrementTens:
- lda #$FF
- sta $0800
- lda $0801
- ina
- sta $0801
- jmp Loop
- ;============================================================================
- ; SetupVideo -- Sets up the video mode and tile-related registers
- ;----------------------------------------------------------------------------
- ; In: None
- ;----------------------------------------------------------------------------
- ; Out: None
- ;----------------------------------------------------------------------------
- SetupVideo:
- php
- lda #$00
- sta $2105 ; Set Video mode 0, 8x8 tiles, 4 color BG1/BG2/BG3/BG4
- lda #$04 ; Set BG1's Tile Map offset to $0400 (Word address)
- sta $2107 ; And the Tile Map size to 32x32
- stz $210B ; Set BG1's Character VRAM offset to $0000 (word address)
- lda #$01 ; Enable BG1
- sta $212C
- lda #$FF
- sta $210E
- sta $210E
- lda #$0F
- sta $2100 ; Turn on screen, full Brightness
- plp
- rts
- ;============================================================================
- .ENDS
- .BANK 1
- .ORG 0
- .SECTION "TileData"
- .INCLUDE "tiles.inc"
- .ENDS
Add Comment
Please, Sign In to add comment