From 16fd44d0ae76b2b22ed4a0e4677c1b94cec76028 Mon Sep 17 00:00:00 2001 From: Vince Weaver Date: Wed, 23 Jan 2013 12:00:55 -0500 Subject: [PATCH] snes: cleanup the opening screen code a bit Some other misc minor cleanups. --- tb1_snes/TODO | 3 --- tb1_snes/checksum.inc | 4 ++-- tb1_snes/opening.s | 30 ++++++++++-------------------- tb1_snes/tb1_snes.s | 2 +- tb1_snes/title_screen.s | 30 +++++++++++++++++------------- 5 files changed, 30 insertions(+), 39 deletions(-) diff --git a/tb1_snes/TODO b/tb1_snes/TODO index 3eecd71..f969726 100644 --- a/tb1_snes/TODO +++ b/tb1_snes/TODO @@ -1,5 +1,2 @@ -Tile compressor. Look for flipped too. Compare new tilemap size to - size w/o compress. - Sort out how to best get colored fonts. diff --git a/tb1_snes/checksum.inc b/tb1_snes/checksum.inc index 313441f..3b006bd 100644 --- a/tb1_snes/checksum.inc +++ b/tb1_snes/checksum.inc @@ -1,2 +1,2 @@ - .word $702f ; Complement of checksum - .word $8fd0 ; Unsigned 16-bit sum of ROM + .word $7a38 ; Complement of checksum + .word $85c7 ; Unsigned 16-bit sum of ROM diff --git a/tb1_snes/opening.s b/tb1_snes/opening.s index 2d0ef9c..ac68ace 100644 --- a/tb1_snes/opening.s +++ b/tb1_snes/opening.s @@ -56,40 +56,30 @@ display_opening: jsr svmw_load_vram - - - ; we want the BG1 Tilemap to start at VRAM $F000 (60k) + ;===================================== + ; Set the BG1 and BG2 Tilemap Location + ;===================================== ; Format is ; aaaa aass a is shifted by 10 for address ; ss = size of screen in tiles 00 = 32x32 ; - ; 1111 0000 - lda #$78 ; BG1 Tilemap starts at VRAM $F000 + lda #$78 ; BG1 Tilemap starts at VRAM $F000 (/2) sta $2107 ; bg1 src - - ; we want the BG2 Tilemap to start at VRAM $F800 - ; Format is - ; aaaa aass a is shifted by 10 for address - ; ss = size of screen in tiles 00 = 32x32 - ; - ; 1111 1000 - - lda #$7c ; BG2 Tilemap starts at VRAM $F800 + lda #$7c ; BG2 Tilemap starts at VRAM $F800 (/2) sta $2108 ; bg2 src + ;======================================== + ; Set the BG1 and BG2 Tile Data Locations + ;======================================== ; aaaa bbbb a= BG2 tiles, b= BG1 tiles ; bbbb<<13 - ; 0000 0000 - ; our BG1 tiles are stored starting in VRAM $0000 - ; our BG2 tiles are stored starting in VRAM $e000 lda #$70 - sta $210b ; bg1 tile data starts at VRAM 0000 - - + sta $210b ; BG1 tile data starts at VRAM 0000 + ; BG2 tile data starts at VRAM e000 diff --git a/tb1_snes/tb1_snes.s b/tb1_snes/tb1_snes.s index 2a48a6b..728ebda 100644 --- a/tb1_snes/tb1_snes.s +++ b/tb1_snes/tb1_snes.s @@ -43,7 +43,7 @@ start_program: jsr display_title - jsr level_1 +; jsr level_1 .include "title_screen.s" .include "opening.s" diff --git a/tb1_snes/title_screen.s b/tb1_snes/title_screen.s index 46a2c27..14458db 100644 --- a/tb1_snes/title_screen.s +++ b/tb1_snes/title_screen.s @@ -115,24 +115,28 @@ title_setup_video: ; lda #$81 ; Enable NMI (VBlank Interrupt) and joypads - lda #$01 ; Enable joypad +; lda #$01 ; Enable joypad + lda #$00 sta $4200 ; -title_joypad_read: - lda $4212 ; get joypad status - and #%00000001 ; if joy is not ready - bne title_joypad_read ; wait +big: + bra big - lda $4219 ; read joypad (BYSTudlr) +;title_joypad_read: + ; lda $4212 ; get joypad status + ; and #%00000001 ; if joy is not ready + ; bne title_joypad_read ; wait +; + ; lda $4219 ; read joypad (BYSTudlr) +; + ; and #%11110000 ; see if a button pressed - and #%11110000 ; see if a button pressed +; beq title_joypad_read +; + ; lda #$80 + ; sta $2100 ; Turn off screen - beq title_joypad_read - - lda #$80 - sta $2100 ; Turn off screen - - rts + ; rts ;============================================================================