snes: actually use enemy sprites for the enemy

the enemy still doesn't move
This commit is contained in:
Vince Weaver 2013-01-31 16:30:23 -05:00
parent 05c7b4b101
commit ef8a171a8b
4 changed files with 40 additions and 6 deletions

View File

@ -13,7 +13,7 @@ tb1_snes.o: tb1_snes.s \
svmwgraph.s \
tb1_title.tiles tb1_opening.tiles level1_background.tiles \
star_background.tiles \
level1_pal0.sprites \
level1_pal0.sprites level1_pal2.sprites \
tbfont.inc
$(AS) -t none -o tb1_snes.o -l tb1_snes.lst -c tb1_snes.s
@ -21,6 +21,10 @@ tb1_snes.o: tb1_snes.s \
level1_pal0.sprites: graphics/level1_pal0.pcx tools/pcx_to_tiles_4bpp
./tools/pcx_to_tiles_4bpp level1_pal0 < graphics/level1_pal0.pcx > level1_pal0.sprites
level1_pal2.sprites: graphics/level1_pal2.pcx tools/pcx_to_tiles_4bpp
./tools/pcx_to_tiles_4bpp level1_pal2 < graphics/level1_pal2.pcx > level1_pal2.sprites
level1_background.tiles: graphics/level1_background.pcx ./tools/pcx_to_compressed_tilemap
./tools/pcx_to_compressed_tilemap level1_background 4 0 < graphics/level1_background.pcx > level1_background.tiles

View File

@ -1,2 +1,2 @@
.word $f168 ; Complement of checksum
.word $e97 ; Unsigned 16-bit sum of ROM
.word $186d ; Complement of checksum
.word $e792 ; Unsigned 16-bit sum of ROM

View File

@ -233,6 +233,8 @@ level_1:
; Sprite Palettes start at color 128
; Load palette 0
lda #128 ; start with color 128
sta $2121 ;
ldy #(16*2) ; we have 16 colors
@ -240,6 +242,16 @@ level_1:
ldx #.LOWORD(level1_pal0_palette)
jsr svmw_load_palette
; Load palette 2
lda #160 ; start with color 128
sta $2121 ;
ldy #(16*2) ; we have 16 colors
lda #^level1_pal2_palette
ldx #.LOWORD(level1_pal2_palette)
jsr svmw_load_palette
;=========================
; Load sprite data to VRAM
;=========================
@ -247,6 +259,8 @@ level_1:
lda #$80 ; increment after writing $2119
sta $2115
; Pal0 Sprites
ldx #$0000 ;
stx $2116 ; set adddress for VRAM read/write
; multiply by 2, so 0x0000
@ -257,6 +271,19 @@ level_1:
jsr svmw_load_vram
; Pal2 Sprites
; 0x0000 + 32*0x60 / 2 = 0x600
ldx #$0600 ;
stx $2116 ; set adddress for VRAM read/write
lda #^level1_pal2_data
ldx #.LOWORD(level1_pal2_data)
ldy #$0400 ; 32 bytes * 32 tiles
jsr svmw_load_vram
;=============================
; Init sprites to be offscreen
@ -799,11 +826,13 @@ setup_enemy_defaults:
store_enemy_kind:
; sta (ENEMY_PL),Y
lda #12 ; temp use missile
lda #$60 ; temp use missile
sta $282 ; $200 + $20*4 + 2
lda #$20
sta $283 ; noflip, pal0, priority=2
; Xxxxxxxxx yyyyyyy cccccccc vhoo pppN
lda #$24
sta $283 ; noflip, pal2, priority=2
; determine enemy _x
; if < 0, make random between 2->34
@ -2631,6 +2660,7 @@ end_bss:
; sprite data
.include "level1_pal0.sprites"
.include "level1_pal2.sprites"
.include "level1_background.tiles"
.include "star_background.tiles"