ต้องแปลงเป็น format : PCX แล้ว convert เป็น data ที่ snes อ่านง่าย ด้วยโปรแกรม pcx2snesWIN
;============================================================================
; Includes
;============================================================================
;== Include MemoryMap, Vector Table, and HeaderInfo ==
.INCLUDE "header.inc"
;== Include SNES Initialization routines ==
.INCLUDE "InitSNES.asm"
.INCLUDE "LoadGraphics.asm"
;============================================================================
; Main Code
;============================================================================
.BANK 0 SLOT 0
.ORG 0
.SECTION "MainCode"
Start:
InitSNES ; Clear registers, etc.
; Load Palette for our tiles
LoadPalette BG_Palette, 0, 16
; Load Tile data to VRAM
LoadBlockToVRAM Tiles, $0000, $0C60 ; 99 tiles = 3168 bytes
; Address Tiles Map BG1 setting
lda #$00
sta $2115
; Input Tiles Map
ldx #$3000 ; $6000 line = 1
stx $2116
lda #$00
- sta $2118
inc a
cmp #$9
bne -
ldx #$3020 ; $6000 line = 2
stx $2116
lda #$09
- sta $2118
inc a
cmp #$12
bne -
ldx #$3040 ; $6000 line = 3
stx $2116
lda #$12
sta $2118
lda #$13
sta $2118
lda #$14
sta $2118
lda #$15
sta $2118
lda #$16
sta $2118
lda #$17
sta $2118
lda #$18
sta $2118
lda #$19
sta $2118
lda #$1A
sta $2118
ldx #$3060 ; $6000 line = 4
stx $2116
lda #$1B
- sta $2118
inc a
cmp #$24
bne -
ldx #$3080 ; $6000 line = 5
stx $2116
lda #$24
- sta $2118
inc a
cmp #$2D
bne -
ldx #$30A0 ; $6000 line = 6
stx $2116
lda #$2D
- sta $2118
inc a
cmp #$36
bne -
ldx #$30C0 ; $6000 line = 7
stx $2116
lda #$36
- sta $2118
inc a
cmp #$3F
bne -
ldx #$30E0 ; $6000 line = 8
stx $2116
lda #$3F
- sta $2118
inc a
cmp #$48
bne -
ldx #$3100 ; $6000 line = 9
stx $2116
lda #$48
- sta $2118
inc a
cmp #$51
bne -
ldx #$3120 ; $6000 line = 10
stx $2116
lda #$51
- sta $2118
inc a
cmp #$5A
bne -
ldx #$3140 ; $6000 line = 11
stx $2116
lda #$5A
- sta $2118
inc a
cmp #$63
bne -
; Setup Video modes and other stuff, then turn on the screen
jsr SetupVideo
Infinity:
jmp Infinity ; bwa hahahahaha
;============================================================================
; SetupVideo -- Sets up the video mode and tile-related registers
;----------------------------------------------------------------------------
; In: None
;----------------------------------------------------------------------------
; Out: None
;----------------------------------------------------------------------------
SetupVideo:
php
lda #$01
sta $2105 ; Set Video mode 1, 8x8 tiles, 16 color BG1/BG2/ ,4 color BG3
lda #$30 ; Set BG1's Tile Map offset to $6000 (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
;============================================================================
; Character Data
;============================================================================
.BANK 1 SLOT 0
.ORG 0
.SECTION "CharacterData"
.INCLUDE "man1.inc"
.ENDS