// SNES Interlace Font Demo by krom (Peter Lemon): arch snes.cpu output "InterlaceFont.sfc", create macro seek(variable offset) { origin ((offset & $7F0000) >> 1) | (offset & $7FFF) base offset } seek($8000); fill $8000 // Fill Upto $7FFF (Bank 0) With Zero Bytes include "LIB/SNES.INC" // Include SNES Definitions include "LIB/SNES_HEADER.ASM" // Include Header & Vector Table include "LIB/SNES_GFX.INC" // Include Graphics Macros seek($8000); Start: SNES_INIT(SLOWROM) // Run SNES Initialisation Routine LoadPAL(BGPal, $00, 32, 0) // Load Background Palette (BG Palette Uses 16 Colors) LoadVRAM(BGMap, $4000, $2000, 0) // Load Background Tile Map To VRAM LoadVRAM(BGTiles, $8000, $1640, 0) // Load Background Tiles To VRAM // Setup Video lda.b #%00001101 // DCBAPMMM: M = Mode, P = Priority, ABCD = BG1,2,3,4 Tile Size sta.w REG_BGMODE // $2105: BG Mode 5, Priority 1, BG1 16x8 Tiles lda.b #%00000001 // Interlace Mode On sta.w REG_SETINI // $2133: Screen Mode Select // Setup BG1 16 Color Background lda.b #%00100010 // AAAAAASS: S = BG Map Size, A = BG Map Address sta.w REG_BG1SC // $2107: BG1 64x32, BG1 Map Address = $8000 (VRAM Address / $400) lda.b #%00000100 // BBBBAAAA: A = BG1 Tile Address, B = BG2 Tile Address sta.w REG_BG12NBA // $210B: BG1 Tile Address = $4000 (VRAM Address / $1000) lda.b #$01 // Enable BG1 sta.w REG_TM // $212C: BG1 To Main Screen Designation sta.w REG_TS // $212D: BG1 To Sub Screen Designation (Needed To Show Interlace GFX) stz.w REG_BG1HOFS // Store Zero To BG1 Horizontal Scroll Position Lo Byte stz.w REG_BG1HOFS // Store Zero To BG1 Horizontal Scroll Position Hi Byte stz.w REG_BG1VOFS // Store Zero To BG1 Vertical Scroll Position Lo Byte stz.w REG_BG1VOFS // Store Zero To BG1 Vertical Scroll Position Hi Byte FadeIN() // Screen Fade In Loop: jmp Loop // Character Data // BANK 0 include "GFX/BG.asm" // Include BG