Compare commits
12 Commits
5eb3f4fa4b
...
05a7ad5c1e
Author | SHA1 | Date |
---|---|---|
Vince Weaver | 05a7ad5c1e | |
Vince Weaver | 1eed019e50 | |
Vince Weaver | bc6f040d71 | |
Vince Weaver | 2c2d0cf017 | |
Vince Weaver | fbaec2928b | |
Vince Weaver | 95fc2febff | |
Vince Weaver | 0ec8efc1be | |
Vince Weaver | ed5053bb1e | |
Vince Weaver | 17ed65c383 | |
Vince Weaver | f43edf23ea | |
Vince Weaver | 26fb4f3c6a | |
Vince Weaver | eea7d9ec5c |
|
@ -11,15 +11,14 @@ EMPTY_DISK = ../../empty_disk/empty.dsk
|
||||||
|
|
||||||
all: keen1_lores.dsk
|
all: keen1_lores.dsk
|
||||||
|
|
||||||
keen1_lores.dsk: HELLO LOADER TITLE MARS LEVEL1
|
keen1_lores.dsk: HELLO LOADER TITLE MARS LEVEL1 LEVEL2
|
||||||
#LEVEL2
|
|
||||||
cp $(EMPTY_DISK) keen1_lores.dsk
|
cp $(EMPTY_DISK) keen1_lores.dsk
|
||||||
$(DOS33) -y keen1_lores.dsk SAVE A HELLO
|
$(DOS33) -y keen1_lores.dsk SAVE A HELLO
|
||||||
$(DOS33) -y keen1_lores.dsk BSAVE -a 0x1000 LOADER
|
$(DOS33) -y keen1_lores.dsk BSAVE -a 0x1000 LOADER
|
||||||
$(DOS33) -y keen1_lores.dsk BSAVE -a 0x4000 TITLE
|
$(DOS33) -y keen1_lores.dsk BSAVE -a 0x4000 TITLE
|
||||||
$(DOS33) -y keen1_lores.dsk BSAVE -a 0x2000 MARS
|
$(DOS33) -y keen1_lores.dsk BSAVE -a 0x2000 MARS
|
||||||
$(DOS33) -y keen1_lores.dsk BSAVE -a 0x2000 LEVEL1
|
$(DOS33) -y keen1_lores.dsk BSAVE -a 0x2000 LEVEL1
|
||||||
# $(DOS33) -y keen1_lores.dsk BSAVE -a 0x2000 LEVEL2
|
$(DOS33) -y keen1_lores.dsk BSAVE -a 0x2000 LEVEL2
|
||||||
|
|
||||||
|
|
||||||
###
|
###
|
||||||
|
@ -54,8 +53,8 @@ mars.o: mars.s zp.inc hardware.inc game_over.s \
|
||||||
gr_fade.s \
|
gr_fade.s \
|
||||||
mars_keyboard.s draw_tilemap.s \
|
mars_keyboard.s draw_tilemap.s \
|
||||||
mars_sfx.s longer_sound.s \
|
mars_sfx.s longer_sound.s \
|
||||||
text_help.s \
|
text_help.s tilemap_lookup.s \
|
||||||
maps/mars_new.zx02 graphics/parts.gr.zx02
|
maps/mars_map.zx02 graphics/parts.gr.zx02
|
||||||
ca65 -o mars.o mars.s -l mars.lst
|
ca65 -o mars.o mars.s -l mars.lst
|
||||||
|
|
||||||
####
|
####
|
||||||
|
@ -67,10 +66,10 @@ level1.o: level1.s zp.inc hardware.inc \
|
||||||
text_help.s gr_fast_clear.s text_quit_yn.s text_drawbox.s \
|
text_help.s gr_fast_clear.s text_quit_yn.s text_drawbox.s \
|
||||||
level1_enemies.s level1_items.s \
|
level1_enemies.s level1_items.s \
|
||||||
graphics/keen_graphics.inc sprites/keen_sprites.inc \
|
graphics/keen_graphics.inc sprites/keen_sprites.inc \
|
||||||
maps/level1_map.lzsa \
|
maps/level1_map.zx02 \
|
||||||
status_bar.s draw_keen.s move_keen.s gr_putsprite_crop.s \
|
status_bar.s draw_keen.s move_keen.s gr_putsprite_crop.s \
|
||||||
draw_tilemap.s \
|
draw_tilemap.s tilemap_lookup.s \
|
||||||
level1_sfx.s longer_sound.s \
|
level1_sfx.s longer_sound.s level1_data.inc \
|
||||||
keyboard.s handle_laser.s
|
keyboard.s handle_laser.s
|
||||||
ca65 -o level1.o level1.s -l level1.lst
|
ca65 -o level1.o level1.s -l level1.lst
|
||||||
|
|
||||||
|
@ -81,16 +80,15 @@ LEVEL2: level2.o
|
||||||
|
|
||||||
level2.o: level2.s zp.inc hardware.inc \
|
level2.o: level2.s zp.inc hardware.inc \
|
||||||
text_help.s gr_fast_clear.s text_quit_yn.s text_drawbox.s \
|
text_help.s gr_fast_clear.s text_quit_yn.s text_drawbox.s \
|
||||||
enemies_level2.s actions_level2.s item_level2.s \
|
level1_enemies.s level1_items.s \
|
||||||
graphics/keen_graphics.inc keen_sprites.inc \
|
graphics/keen_graphics.inc sprites/keen_sprites.inc \
|
||||||
maps/level2_map.lzsa \
|
maps/level2_map.zx02 \
|
||||||
status_bar.s draw_keen.s move_keen.s gr_putsprite_crop.s \
|
status_bar.s draw_keen.s move_keen.s gr_putsprite_crop.s \
|
||||||
draw_tilemap.s \
|
draw_tilemap.s tilemap_lookup.s \
|
||||||
sound_effects.s longer_sound.s \
|
level1_sfx.s longer_sound.s level2_data.inc \
|
||||||
keyboard.s handle_laser.s
|
keyboard.s handle_laser.s
|
||||||
ca65 -o level2.o level2.s -l level2.lst
|
ca65 -o level2.o level2.s -l level2.lst
|
||||||
|
|
||||||
|
|
||||||
####
|
####
|
||||||
|
|
||||||
graphics/keen1_title.hgr.zx02:
|
graphics/keen1_title.hgr.zx02:
|
||||||
|
@ -108,7 +106,7 @@ maps/level1_map.lzsa:
|
||||||
####
|
####
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f *~ *.o *.lst HELLO LOADER TITLE MARS LEVEL1
|
rm -f *~ *.o *.lst HELLO LOADER TITLE MARS LEVEL1 LEVEL2
|
||||||
cd graphics && make clean
|
cd graphics && make clean
|
||||||
cd maps && make clean
|
cd maps && make clean
|
||||||
# cd title && make clean
|
# cd title && make clean
|
||||||
|
|
|
@ -6,20 +6,21 @@ title
|
||||||
|
|
||||||
mars map
|
mars map
|
||||||
~~~~~~~~
|
~~~~~~~~
|
||||||
|
+ make tiles for first level and green level impassable
|
||||||
|
+ animate stars
|
||||||
+ enforce collision detection
|
+ enforce collision detection
|
||||||
+ proper smooth movement
|
+ proper smooth movement
|
||||||
+ transporters
|
|
||||||
+ start at starting point
|
|
||||||
+ show keens left at start, also when press ??
|
+ show keens left at start, also when press ??
|
||||||
+ mark completed levels
|
+ mark completed levels
|
||||||
|
at start, over-write finished levels with blue tiles
|
||||||
level1
|
check completed levels when action and not let you re-enter
|
||||||
~~~~~~
|
level engine
|
||||||
+ fix so works again
|
~~~~~~~~~~~~~
|
||||||
|
+ make generic
|
||||||
|
|
||||||
sound effects
|
sound effects
|
||||||
~~~~~~~~~~~~~
|
~~~~~~~~~~~~~
|
||||||
+ effect for transporter
|
|
||||||
|
|
||||||
movement:
|
movement:
|
||||||
~~~~~~~~~
|
~~~~~~~~~
|
||||||
|
@ -32,7 +33,7 @@ enemies
|
||||||
|
|
||||||
shooting
|
shooting
|
||||||
~~~~~~~~
|
~~~~~~~~
|
||||||
+ collision with enemies
|
+ FIX collision with enemies
|
||||||
+ shoot enemies
|
+ shoot enemies
|
||||||
|
|
||||||
pogo
|
pogo
|
||||||
|
|
|
@ -6,5 +6,5 @@ LOAD_KEEN2 = 3
|
||||||
|
|
||||||
tiles = $9000
|
tiles = $9000
|
||||||
big_tilemap = $9400
|
big_tilemap = $9400
|
||||||
tilemap = $BC00
|
small_tilemap = $BC00
|
||||||
|
|
||||||
|
|
|
@ -4,62 +4,64 @@
|
||||||
; tilemap is 20x12 grid with 2x4 (well, 2x2) tiles
|
; tilemap is 20x12 grid with 2x4 (well, 2x2) tiles
|
||||||
|
|
||||||
draw_tilemap:
|
draw_tilemap:
|
||||||
ldy #0 ; current screen Ypos to draw at
|
ldx #0 ; offset in current tilemap ; 2
|
||||||
sty TILEY ; (we draw two at a time as lores
|
stx TILEMAP_OFFSET ; ; 3
|
||||||
; is two blocks per byte)
|
|
||||||
|
|
||||||
ldx #0 ; offset in current tilemap
|
; ldy #0 ; current screen Ypos to draw at ; 2
|
||||||
stx TILEMAP_OFFSET ;
|
stx TILEY ; (we draw two at a time as lores ; 3
|
||||||
|
; is two blocks per byte)
|
||||||
|
|
||||||
lda #0 ; init odd/even
|
|
||||||
sta TILE_ODD ; (tiles are two rows tall)
|
|
||||||
|
; lda #0 ; init odd/even ; 2
|
||||||
|
stx TILE_ODD ; (tiles are two rows tall) ; 3
|
||||||
|
|
||||||
tilemap_outer_loop:
|
tilemap_outer_loop:
|
||||||
ldy TILEY ; setup output pointer to current Ypos
|
ldy TILEY ; setup output pointer to current Ypos ; 3
|
||||||
|
|
||||||
lda gr_offsets,Y ; get address of start of row
|
lda gr_offsets,Y ; get address of start of row ; 4+
|
||||||
sta GBASL
|
sta GBASL ; 3
|
||||||
lda gr_offsets+1,Y
|
lda gr_offsets+1,Y ; 4+
|
||||||
clc
|
clc ; 2
|
||||||
adc DRAW_PAGE ; adjust for page
|
adc DRAW_PAGE ; adjust for page ; 3
|
||||||
sta GBASH
|
sta GBASH ; 3
|
||||||
|
|
||||||
|
|
||||||
ldy #0 ; draw row from 0..39
|
ldy #0 ; draw row from 0..39 ; 2
|
||||||
; might be faster to count backwards
|
; might be faster to count backwards
|
||||||
; but would have to adjust a lot
|
; but would have to adjust a lot
|
||||||
|
|
||||||
tilemap_loop:
|
tilemap_loop:
|
||||||
ldx TILEMAP_OFFSET ; get actual tile number
|
ldx TILEMAP_OFFSET ; get actual tile number ; 3
|
||||||
lda tilemap,X ; from tilemap
|
lda small_tilemap,X ; from tilemap ; 4
|
||||||
|
|
||||||
asl ; *4 ; point to tile to draw (4 bytes each)
|
asl ; *4 ; point to tile to draw (4 bytes each) ; 2
|
||||||
asl
|
asl ; 2
|
||||||
tax
|
tax ; 2
|
||||||
|
|
||||||
lda TILE_ODD ; check to see if top or bottom
|
lda TILE_ODD ; check to see if top or bottom ; 3
|
||||||
beq not_odd_line
|
beq not_odd_line ; 2/3
|
||||||
inx ; point to bottom half of tile
|
inx ; point to bottom half of tile ; 2
|
||||||
inx
|
inx ; 2
|
||||||
not_odd_line:
|
not_odd_line:
|
||||||
|
|
||||||
; draw two blocks
|
; draw two blocks
|
||||||
; note we don't handle transparency in the keen engine
|
; note we don't handle transparency in the keen engine
|
||||||
|
|
||||||
lda tiles,X
|
lda tiles,X ; 4
|
||||||
sta (GBASL),Y ; draw upper right
|
sta (GBASL),Y ; draw upper right ; 6
|
||||||
|
|
||||||
iny
|
iny ; 2
|
||||||
|
|
||||||
lda tiles+1,X
|
lda tiles+1,X ; 4
|
||||||
sta (GBASL),Y ; draw upper left
|
sta (GBASL),Y ; draw upper left ; 6
|
||||||
|
|
||||||
iny
|
iny ; 2
|
||||||
|
|
||||||
inc TILEMAP_OFFSET ; point to next tile
|
inc TILEMAP_OFFSET ; point to next tile ; 5
|
||||||
|
|
||||||
cpy #40 ; until done
|
cpy #40 ; until done ; 2
|
||||||
bne tilemap_loop
|
bne tilemap_loop ; 2/3
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -126,25 +128,38 @@ copy_tilemap_subset:
|
||||||
lda #0
|
lda #0
|
||||||
sta tilemap_count_smc+1
|
sta tilemap_count_smc+1
|
||||||
|
|
||||||
|
; original worse case: 23 cycles
|
||||||
|
; lookup table: 19 cycles
|
||||||
|
|
||||||
; set start
|
; set start
|
||||||
lda TILEMAP_Y
|
|
||||||
lsr
|
ldx TILEMAP_Y ; 3
|
||||||
|
lda tilemap_lookup_high,X ; 4
|
||||||
|
sta cptl1_smc+2 ; set proper row in big tilemap ; 4
|
||||||
|
lda tilemap_lookup_low,X ; 4
|
||||||
|
sta cptl1_smc+1 ; set proper row in big tilemap ; 4
|
||||||
|
|
||||||
|
|
||||||
|
; set start
|
||||||
|
; lda TILEMAP_Y ; 3
|
||||||
|
; lsr ; 2
|
||||||
|
|
||||||
; set odd/even
|
; set odd/even
|
||||||
ldx #0
|
; ldx #0 ; 2
|
||||||
bcc skip_odd_row
|
; bcc skip_odd_row ; 2/3
|
||||||
ldx #$80
|
; ldx #$80 ; 2
|
||||||
skip_odd_row:
|
;skip_odd_row:
|
||||||
stx cptl1_smc+1
|
; stx cptl1_smc+1 ; 4
|
||||||
|
|
||||||
clc ; set start
|
; clc ; set start ; 2
|
||||||
adc #>big_tilemap ; each even row is a page, so adding
|
; adc #>big_tilemap ; each even row is a page, so adding ; 2
|
||||||
; Y to top byte is indexing to row
|
; Y to top byte is indexing to row
|
||||||
|
|
||||||
sta cptl1_smc+2 ; set proper row in big tilemap
|
; sta cptl1_smc+2 ; set proper row in big tilemap ; 4
|
||||||
|
|
||||||
|
|
||||||
lda #<tilemap
|
|
||||||
|
lda #<small_tilemap
|
||||||
sta cptl2_smc+1 ; reset small tilemap to row0
|
sta cptl2_smc+1 ; reset small tilemap to row0
|
||||||
|
|
||||||
cp_tilemap_outer_loop:
|
cp_tilemap_outer_loop:
|
||||||
|
@ -153,14 +168,15 @@ cp_tilemap_outer_loop:
|
||||||
ldy #0
|
ldy #0
|
||||||
cp_tilemap_inner_loop:
|
cp_tilemap_inner_loop:
|
||||||
|
|
||||||
|
; FIXME: make cptl1 take into account X offset and use one index?
|
||||||
; TODO: optimize, totally unroll?
|
; TODO: optimize, totally unroll?
|
||||||
|
|
||||||
cptl1_smc:
|
cptl1_smc:
|
||||||
lda $9400,X
|
lda $9400,X ; 4
|
||||||
cptl2_smc:
|
cptl2_smc:
|
||||||
sta $BC00,Y
|
sta $BC00,Y ; 5
|
||||||
iny
|
iny ; 2
|
||||||
inx
|
inx ; 2
|
||||||
cpy #TILEMAP_X_COPY_SIZE
|
cpy #TILEMAP_X_COPY_SIZE
|
||||||
bne cp_tilemap_inner_loop
|
bne cp_tilemap_inner_loop
|
||||||
|
|
||||||
|
@ -187,9 +203,11 @@ tilemap_count_smc:
|
||||||
|
|
||||||
done_tilemap_subset:
|
done_tilemap_subset:
|
||||||
|
|
||||||
|
;==========================
|
||||||
; activate yorps
|
; activate yorps
|
||||||
|
;==========================
|
||||||
|
|
||||||
ldx NUM_ENEMIES
|
ldx #NUM_ENEMIES
|
||||||
beq done_yorps
|
beq done_yorps
|
||||||
|
|
||||||
clc
|
clc
|
||||||
|
|
|
@ -22,11 +22,21 @@ laser_check_tiles:
|
||||||
|
|
||||||
clc
|
clc
|
||||||
lda LASER_TILEY
|
lda LASER_TILEY
|
||||||
adc #>big_tilemap
|
tay
|
||||||
sta INH
|
|
||||||
lda LASER_TILEX
|
lda tilemap_lookup_high,Y
|
||||||
|
sta INH
|
||||||
|
lda tilemap_lookup_low,Y
|
||||||
|
clc
|
||||||
|
adc LASER_TILEX
|
||||||
sta INL
|
sta INL
|
||||||
|
|
||||||
|
|
||||||
|
; adc #>big_tilemap
|
||||||
|
; sta INH
|
||||||
|
; lda LASER_TILEX
|
||||||
|
; sta INL
|
||||||
|
|
||||||
ldy #0
|
ldy #0
|
||||||
lda (INL),Y
|
lda (INL),Y
|
||||||
cmp #ALLHARD_TILES
|
cmp #ALLHARD_TILES
|
||||||
|
@ -105,9 +115,12 @@ laser_sideways_sprite:
|
||||||
; laser enemies
|
; laser enemies
|
||||||
;=======================
|
;=======================
|
||||||
; see if laser hits any enemies
|
; see if laser hits any enemies
|
||||||
|
|
||||||
|
; FIXME: this is broken
|
||||||
|
|
||||||
laser_enemies:
|
laser_enemies:
|
||||||
|
|
||||||
ldy #0
|
ldy #0 ; which enemy
|
||||||
laser_enemies_loop:
|
laser_enemies_loop:
|
||||||
|
|
||||||
; see if out
|
; see if out
|
||||||
|
@ -118,7 +131,7 @@ laser_enemies_loop:
|
||||||
; get local tilemap co-ord
|
; get local tilemap co-ord
|
||||||
sec
|
sec
|
||||||
lda enemy_data_tilex,Y
|
lda enemy_data_tilex,Y
|
||||||
sbc TILEMAP_X
|
sbc TILEMAP_X ; compare enemy size?
|
||||||
|
|
||||||
sta TILE_TEMP
|
sta TILE_TEMP
|
||||||
|
|
||||||
|
@ -151,13 +164,10 @@ hit_something:
|
||||||
jmp exit_laser_enemy
|
jmp exit_laser_enemy
|
||||||
|
|
||||||
done_laser_enemy:
|
done_laser_enemy:
|
||||||
|
iny
|
||||||
tya
|
cpy #NUM_ENEMIES
|
||||||
clc
|
|
||||||
adc #8
|
|
||||||
tay
|
|
||||||
cpy #(NUM_ENEMIES*8)
|
|
||||||
bne laser_enemies_loop
|
bne laser_enemies_loop
|
||||||
|
|
||||||
exit_laser_enemy:
|
exit_laser_enemy:
|
||||||
rts
|
rts
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
5 HOME
|
5 HOME
|
||||||
10 PRINT "LOADING KEEN V0.04"
|
10 PRINT "LOADING KEEN V0.06"
|
||||||
20 PRINT " KEEN1 PROOF-OF-CONCEPT DEMAKE"
|
20 PRINT " KEEN1 PROOF-OF-CONCEPT DEMAKE"
|
||||||
30 PRINT:PRINT
|
30 PRINT:PRINT
|
||||||
70 PRINT "BASED ON KEEN1 BY ID"
|
70 PRINT "BASED ON KEEN1 BY ID"
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
; Keen PoC Level 1
|
; Keen PoC Level 1 (Border Town)
|
||||||
|
|
||||||
; by deater (Vince Weaver) <vince@deater.net>
|
; by deater (Vince Weaver) <vince@deater.net>
|
||||||
|
|
||||||
|
@ -7,15 +7,12 @@
|
||||||
.include "hardware.inc"
|
.include "hardware.inc"
|
||||||
.include "common_defines.inc"
|
.include "common_defines.inc"
|
||||||
|
|
||||||
|
.include "level1_data.inc"
|
||||||
|
|
||||||
MAX_TILE_X = 96 ; 116 - 20
|
level1_start:
|
||||||
MAX_TILE_Y = 5 ; (34 - 24)/2 (maybe?)
|
|
||||||
|
|
||||||
keen_start:
|
|
||||||
;===================
|
;===================
|
||||||
; init screen
|
; init screen
|
||||||
; jsr TEXT
|
|
||||||
; jsr HOME
|
|
||||||
bit KEYRESET
|
bit KEYRESET
|
||||||
|
|
||||||
bit SET_GR
|
bit SET_GR
|
||||||
|
@ -50,14 +47,11 @@ keen_start:
|
||||||
lda #4
|
lda #4
|
||||||
sta DRAW_PAGE
|
sta DRAW_PAGE
|
||||||
|
|
||||||
; Level 1
|
; set starting location
|
||||||
; start at 2,24 (remember tiles 2 bytes high even though 4 pixels)
|
|
||||||
; but with reference to starting tilemap (0,5) should be
|
|
||||||
; 2,8?
|
|
||||||
|
|
||||||
lda #1
|
lda #START_KEEN_TILEX
|
||||||
sta KEEN_TILEX
|
sta KEEN_TILEX
|
||||||
lda #13
|
lda #START_KEEN_TILEY
|
||||||
sta KEEN_TILEY
|
sta KEEN_TILEY
|
||||||
|
|
||||||
lda #0 ; offset from tile location
|
lda #0 ; offset from tile location
|
||||||
|
@ -67,19 +61,6 @@ keen_start:
|
||||||
lda #RIGHT ; direction
|
lda #RIGHT ; direction
|
||||||
sta KEEN_DIRECTION
|
sta KEEN_DIRECTION
|
||||||
|
|
||||||
;====================================
|
|
||||||
; load level1 background
|
|
||||||
;====================================
|
|
||||||
|
|
||||||
; lda #<level1_bg_zx02
|
|
||||||
; sta ZX0_src
|
|
||||||
; lda #>level1_bg_zx02
|
|
||||||
; sta ZX0_src+1
|
|
||||||
|
|
||||||
; lda #$c ; load to page $c00
|
|
||||||
|
|
||||||
; jsr full_decomp
|
|
||||||
|
|
||||||
|
|
||||||
;====================================
|
;====================================
|
||||||
; load level1 tilemap
|
; load level1 tilemap
|
||||||
|
@ -98,9 +79,9 @@ keen_start:
|
||||||
; we copy in full screen, 40x48 = 20x12 tiles
|
; we copy in full screen, 40x48 = 20x12 tiles
|
||||||
; we start out assuming position is 0,5
|
; we start out assuming position is 0,5
|
||||||
|
|
||||||
lda #0
|
lda #START_TILEMAP_X
|
||||||
sta TILEMAP_X
|
sta TILEMAP_X
|
||||||
lda #5
|
lda #START_TILEMAP_Y
|
||||||
sta TILEMAP_Y
|
sta TILEMAP_Y
|
||||||
|
|
||||||
jsr copy_tilemap_subset
|
jsr copy_tilemap_subset
|
||||||
|
@ -129,10 +110,6 @@ keen_loop:
|
||||||
|
|
||||||
jsr draw_keen
|
jsr draw_keen
|
||||||
|
|
||||||
; handle door opening
|
|
||||||
|
|
||||||
; jsr check_open_door
|
|
||||||
|
|
||||||
jsr page_flip
|
jsr page_flip
|
||||||
|
|
||||||
jsr handle_keypress
|
jsr handle_keypress
|
||||||
|
@ -250,10 +227,7 @@ skip_end_sound:
|
||||||
|
|
||||||
level1_gameover:
|
level1_gameover:
|
||||||
|
|
||||||
; mars plays this
|
; mars plays the sound
|
||||||
|
|
||||||
; ldy #SFX_GAMEOVERSND
|
|
||||||
; jsr play_sfx
|
|
||||||
|
|
||||||
lda #GAME_OVER
|
lda #GAME_OVER
|
||||||
sta LEVEL_OVER
|
sta LEVEL_OVER
|
||||||
|
@ -270,10 +244,6 @@ level1_levelover:
|
||||||
; includes
|
; includes
|
||||||
;==========================
|
;==========================
|
||||||
|
|
||||||
; level graphics
|
|
||||||
;level1_bg_zx02:
|
|
||||||
; .incbin "graphics/level1_bg.gr.zx02"
|
|
||||||
|
|
||||||
.include "text_print.s"
|
.include "text_print.s"
|
||||||
.include "gr_offsets.s"
|
.include "gr_offsets.s"
|
||||||
.include "gr_fast_clear.s"
|
.include "gr_fast_clear.s"
|
||||||
|
@ -302,5 +272,9 @@ level1_levelover:
|
||||||
|
|
||||||
.include "random16.s"
|
.include "random16.s"
|
||||||
|
|
||||||
|
.include "tilemap_lookup.s"
|
||||||
|
|
||||||
level1_data_zx02:
|
level1_data_zx02:
|
||||||
.incbin "maps/level1_map.zx02"
|
.incbin "maps/level1_map.zx02"
|
||||||
|
|
||||||
|
oracle_message:
|
||||||
|
|
|
@ -0,0 +1,15 @@
|
||||||
|
; Level 1 (Border Town)
|
||||||
|
|
||||||
|
MAX_TILE_X = 116 ; 116 wide
|
||||||
|
MAX_TILE_Y = 16 ; 16 tall
|
||||||
|
|
||||||
|
START_KEEN_TILEX = 1
|
||||||
|
START_KEEN_TILEY = 13
|
||||||
|
|
||||||
|
START_TILEMAP_X = 0
|
||||||
|
START_TILEMAP_Y = 5
|
||||||
|
|
||||||
|
NUM_ENEMIES = 8
|
||||||
|
|
||||||
|
HARDTOP_TILES = 32 ; start at 32
|
||||||
|
ALLHARD_TILES = 40 ; start at 40
|
|
@ -1,5 +1,3 @@
|
||||||
NUM_ENEMIES = 8
|
|
||||||
|
|
||||||
|
|
||||||
;=======================
|
;=======================
|
||||||
; move enemies
|
; move enemies
|
||||||
|
@ -35,13 +33,18 @@ enemy_is_out:
|
||||||
lda enemy_data_tiley,X
|
lda enemy_data_tiley,X
|
||||||
adc #2 ; point below feet
|
adc #2 ; point below feet
|
||||||
|
|
||||||
adc #>big_tilemap
|
tay
|
||||||
|
lda tilemap_lookup_high,Y
|
||||||
|
; adc #>big_tilemap
|
||||||
sta load_foot1_smc+2
|
sta load_foot1_smc+2
|
||||||
|
|
||||||
|
lda tilemap_lookup_low,Y
|
||||||
|
sta load_foot1_smc+1
|
||||||
|
|
||||||
ldy enemy_data_tilex,X
|
ldy enemy_data_tilex,X
|
||||||
load_foot1_smc:
|
load_foot1_smc:
|
||||||
|
|
||||||
lda tilemap,Y
|
lda small_tilemap,Y
|
||||||
cmp #HARDTOP_TILES
|
cmp #HARDTOP_TILES
|
||||||
bcs no_enemy_fall ; if hardtop tile, don't fall
|
bcs no_enemy_fall ; if hardtop tile, don't fall
|
||||||
|
|
||||||
|
@ -128,14 +131,19 @@ enemy_facing_right:
|
||||||
clc
|
clc
|
||||||
lda enemy_data_tiley,X
|
lda enemy_data_tiley,X
|
||||||
adc #1 ; point to feet
|
adc #1 ; point to feet
|
||||||
|
tay
|
||||||
|
|
||||||
adc #>big_tilemap
|
; adc #>big_tilemap
|
||||||
|
lda tilemap_lookup_high,Y
|
||||||
sta load_right_foot_smc+2
|
sta load_right_foot_smc+2
|
||||||
|
lda tilemap_lookup_low,Y
|
||||||
|
sta load_right_foot_smc+1
|
||||||
|
|
||||||
|
|
||||||
ldy enemy_data_tilex,X
|
ldy enemy_data_tilex,X
|
||||||
iny ; to the right
|
iny ; to the right
|
||||||
load_right_foot_smc:
|
load_right_foot_smc:
|
||||||
lda tilemap,Y
|
lda small_tilemap,Y
|
||||||
cmp #ALLHARD_TILES
|
cmp #ALLHARD_TILES
|
||||||
bcc no_right_barrier ; skip if no right barrier
|
bcc no_right_barrier ; skip if no right barrier
|
||||||
|
|
||||||
|
@ -182,13 +190,18 @@ enemy_facing_left:
|
||||||
lda enemy_data_tiley,X
|
lda enemy_data_tiley,X
|
||||||
adc #1 ; point to feet
|
adc #1 ; point to feet
|
||||||
|
|
||||||
adc #>big_tilemap
|
tay
|
||||||
|
|
||||||
|
; adc #>big_tilemap
|
||||||
|
lda tilemap_lookup_high,Y
|
||||||
sta load_left_foot_smc+2
|
sta load_left_foot_smc+2
|
||||||
|
lda tilemap_lookup_low,Y
|
||||||
|
sta load_left_foot_smc+1
|
||||||
|
|
||||||
ldy enemy_data_tilex,X
|
ldy enemy_data_tilex,X
|
||||||
dey ; look to the left
|
dey ; look to the left
|
||||||
load_left_foot_smc:
|
load_left_foot_smc:
|
||||||
lda tilemap,Y
|
lda small_tilemap,Y
|
||||||
cmp #ALLHARD_TILES
|
cmp #ALLHARD_TILES
|
||||||
bcc no_left_barrier ; skip if no right barrier
|
bcc no_left_barrier ; skip if no right barrier
|
||||||
|
|
||||||
|
|
|
@ -13,13 +13,20 @@ check_items:
|
||||||
; if X==0, check TILEX and TILEX+1
|
; if X==0, check TILEX and TILEX+1
|
||||||
; if X==1, check TILEX+1
|
; if X==1, check TILEX+1
|
||||||
|
|
||||||
clc
|
ldx KEEN_TILEY
|
||||||
lda KEEN_TILEY
|
|
||||||
adc #>big_tilemap
|
lda tilemap_lookup_high,X
|
||||||
sta INH
|
sta INH
|
||||||
lda KEEN_TILEX
|
lda tilemap_lookup_low,X
|
||||||
|
ora KEEN_TILEX
|
||||||
sta INL
|
sta INL
|
||||||
|
|
||||||
|
; clc
|
||||||
|
; adc #>big_tilemap
|
||||||
|
; sta INH
|
||||||
|
; lda KEEN_TILEX
|
||||||
|
; sta INL
|
||||||
|
|
||||||
lda KEEN_X
|
lda KEEN_X
|
||||||
bne check_head_tilex1
|
bne check_head_tilex1
|
||||||
|
|
||||||
|
@ -50,7 +57,26 @@ check_head_tilex1:
|
||||||
;========================
|
;========================
|
||||||
; check feet
|
; check feet
|
||||||
check_feet:
|
check_feet:
|
||||||
inc INH ; point to next row
|
; inc INH ; point to next row
|
||||||
|
|
||||||
|
lda INL ; blurgh much longer
|
||||||
|
clc
|
||||||
|
adc #$80
|
||||||
|
sta INL
|
||||||
|
lda #$0
|
||||||
|
adc INH
|
||||||
|
sta INH
|
||||||
|
|
||||||
|
|
||||||
|
; won't work, maybe not faster
|
||||||
|
; lda INL
|
||||||
|
; eor #$80
|
||||||
|
; sta INL
|
||||||
|
; asl
|
||||||
|
; adc INH
|
||||||
|
; sta INH
|
||||||
|
|
||||||
|
|
||||||
dec INL ; restore tile pointer
|
dec INL ; restore tile pointer
|
||||||
|
|
||||||
lda KEEN_X
|
lda KEEN_X
|
||||||
|
@ -97,6 +123,9 @@ check_item:
|
||||||
lda (INL),Y
|
lda (INL),Y
|
||||||
|
|
||||||
do_check_item:
|
do_check_item:
|
||||||
|
cmp #26
|
||||||
|
beq was_oracle
|
||||||
|
|
||||||
cmp #27
|
cmp #27
|
||||||
bcc done_check_item ; not an item
|
bcc done_check_item ; not an item
|
||||||
cmp #32
|
cmp #32
|
||||||
|
@ -171,6 +200,37 @@ at_door:
|
||||||
done_check_door:
|
done_check_door:
|
||||||
rts
|
rts
|
||||||
|
|
||||||
|
was_oracle:
|
||||||
|
lda ORACLE_SPOKEN
|
||||||
|
bne done_oracle
|
||||||
|
|
||||||
|
inc ORACLE_SPOKEN
|
||||||
|
|
||||||
|
bit TEXTGR
|
||||||
|
|
||||||
|
jsr clear_bottom
|
||||||
|
|
||||||
|
lda #<oracle_message
|
||||||
|
sta OUTL
|
||||||
|
lda #>oracle_message
|
||||||
|
sta OUTH
|
||||||
|
|
||||||
|
jsr move_and_print
|
||||||
|
jsr move_and_print
|
||||||
|
jsr move_and_print
|
||||||
|
|
||||||
|
jsr page_flip
|
||||||
|
|
||||||
|
wait_oracle:
|
||||||
|
lda KEYPRESS
|
||||||
|
bpl wait_oracle
|
||||||
|
bit KEYRESET
|
||||||
|
|
||||||
|
bit FULLGR
|
||||||
|
|
||||||
|
done_oracle:
|
||||||
|
|
||||||
|
rts
|
||||||
|
|
||||||
|
|
||||||
;=============================
|
;=============================
|
||||||
|
|
|
@ -0,0 +1,287 @@
|
||||||
|
; Keen PoC Level 2 (First Shrine)
|
||||||
|
|
||||||
|
; by deater (Vince Weaver) <vince@deater.net>
|
||||||
|
|
||||||
|
; Zero Page
|
||||||
|
.include "zp.inc"
|
||||||
|
.include "hardware.inc"
|
||||||
|
.include "common_defines.inc"
|
||||||
|
|
||||||
|
.include "level2_data.inc"
|
||||||
|
|
||||||
|
|
||||||
|
level2_start:
|
||||||
|
;===================
|
||||||
|
; init screen
|
||||||
|
|
||||||
|
bit KEYRESET
|
||||||
|
|
||||||
|
bit SET_GR
|
||||||
|
bit PAGE1
|
||||||
|
bit LORES
|
||||||
|
bit FULLGR
|
||||||
|
|
||||||
|
jsr clear_top ; avoid grey stripes at load
|
||||||
|
|
||||||
|
;=====================
|
||||||
|
; init vars
|
||||||
|
;=====================
|
||||||
|
|
||||||
|
lda #0
|
||||||
|
sta ANIMATE_FRAME
|
||||||
|
sta FRAMEL
|
||||||
|
sta FRAMEH
|
||||||
|
sta KEEN_WALKING
|
||||||
|
sta KEEN_JUMPING
|
||||||
|
sta LEVEL_OVER
|
||||||
|
sta LASER_OUT
|
||||||
|
sta KEEN_XL
|
||||||
|
sta KEEN_FALLING
|
||||||
|
sta KEEN_SHOOTING
|
||||||
|
sta KEYCARDS
|
||||||
|
sta ORACLE_SPOKEN
|
||||||
|
|
||||||
|
; debug
|
||||||
|
|
||||||
|
; lda #9
|
||||||
|
; sta RAYGUNS
|
||||||
|
|
||||||
|
lda #4
|
||||||
|
sta DRAW_PAGE
|
||||||
|
|
||||||
|
; set starting location
|
||||||
|
|
||||||
|
lda #START_KEEN_TILEX
|
||||||
|
sta KEEN_TILEX
|
||||||
|
lda #START_KEEN_TILEY
|
||||||
|
sta KEEN_TILEY
|
||||||
|
|
||||||
|
lda #0 ; offset from tile location
|
||||||
|
sta KEEN_X
|
||||||
|
sta KEEN_Y
|
||||||
|
|
||||||
|
lda #RIGHT ; direction
|
||||||
|
sta KEEN_DIRECTION
|
||||||
|
|
||||||
|
|
||||||
|
;====================================
|
||||||
|
; load level1 tilemap
|
||||||
|
;====================================
|
||||||
|
|
||||||
|
lda #<level1_data_zx02
|
||||||
|
sta ZX0_src
|
||||||
|
lda #>level1_data_zx02
|
||||||
|
sta ZX0_src+1
|
||||||
|
lda #$90 ; load to page $9000
|
||||||
|
jsr full_decomp
|
||||||
|
|
||||||
|
;====================================
|
||||||
|
; copy in tilemap subset
|
||||||
|
;====================================
|
||||||
|
; we copy in full screen, 40x48 = 20x12 tiles
|
||||||
|
; we start out assuming position is 0,5
|
||||||
|
|
||||||
|
lda #START_TILEMAP_X
|
||||||
|
sta TILEMAP_X
|
||||||
|
lda #START_TILEMAP_Y
|
||||||
|
sta TILEMAP_Y
|
||||||
|
|
||||||
|
jsr copy_tilemap_subset
|
||||||
|
|
||||||
|
;====================================
|
||||||
|
;====================================
|
||||||
|
; Main loop
|
||||||
|
;====================================
|
||||||
|
;====================================
|
||||||
|
|
||||||
|
keen_loop:
|
||||||
|
|
||||||
|
; draw tilemap
|
||||||
|
|
||||||
|
jsr draw_tilemap
|
||||||
|
|
||||||
|
; draw enemies
|
||||||
|
|
||||||
|
jsr draw_enemies
|
||||||
|
|
||||||
|
; draw laser
|
||||||
|
|
||||||
|
jsr draw_laser
|
||||||
|
|
||||||
|
; draw keen
|
||||||
|
|
||||||
|
jsr draw_keen
|
||||||
|
|
||||||
|
jsr page_flip
|
||||||
|
|
||||||
|
jsr handle_keypress
|
||||||
|
|
||||||
|
jsr move_keen
|
||||||
|
|
||||||
|
jsr move_enemies
|
||||||
|
|
||||||
|
jsr move_laser
|
||||||
|
|
||||||
|
|
||||||
|
;========================
|
||||||
|
; increment frame count
|
||||||
|
;========================
|
||||||
|
|
||||||
|
inc FRAMEL
|
||||||
|
bne no_frame_oflo
|
||||||
|
inc FRAMEH
|
||||||
|
no_frame_oflo:
|
||||||
|
|
||||||
|
;===========================
|
||||||
|
; check end of level
|
||||||
|
;===========================
|
||||||
|
|
||||||
|
lda LEVEL_OVER
|
||||||
|
bne done_with_keen
|
||||||
|
|
||||||
|
;===========================
|
||||||
|
; delay
|
||||||
|
;===========================
|
||||||
|
|
||||||
|
; lda #200
|
||||||
|
; jsr WAIT
|
||||||
|
|
||||||
|
|
||||||
|
jmp keen_loop
|
||||||
|
|
||||||
|
|
||||||
|
done_with_keen:
|
||||||
|
bit KEYRESET ; clear keypress
|
||||||
|
|
||||||
|
; three reasons we could get here
|
||||||
|
; NEXT_LEVEL = finished level by exiting door
|
||||||
|
; GAME_OVER = hit ESC and said Y to QUIT
|
||||||
|
; TOUCHED_ENEMY = touched an enemy
|
||||||
|
|
||||||
|
lda LEVEL_OVER
|
||||||
|
cmp #NEXT_LEVEL
|
||||||
|
beq level1_levelover
|
||||||
|
|
||||||
|
cmp #GAME_OVER
|
||||||
|
beq level1_gameover
|
||||||
|
|
||||||
|
; got here, touched enemy
|
||||||
|
|
||||||
|
|
||||||
|
;============================
|
||||||
|
; end animation
|
||||||
|
;============================
|
||||||
|
|
||||||
|
lda #1
|
||||||
|
sta PLAY_END_SOUND
|
||||||
|
|
||||||
|
inc KEEN_TILEY ; move down
|
||||||
|
|
||||||
|
sec
|
||||||
|
lda KEEN_TILEX
|
||||||
|
sbc TILEMAP_X
|
||||||
|
asl
|
||||||
|
clc
|
||||||
|
adc KEEN_X
|
||||||
|
sta XPOS
|
||||||
|
|
||||||
|
sec
|
||||||
|
lda KEEN_TILEY
|
||||||
|
sbc TILEMAP_Y
|
||||||
|
asl
|
||||||
|
asl
|
||||||
|
clc
|
||||||
|
adc KEEN_Y
|
||||||
|
sta YPOS
|
||||||
|
|
||||||
|
level_end_animation:
|
||||||
|
jsr draw_tilemap
|
||||||
|
|
||||||
|
ldx #<keen_sprite_squish
|
||||||
|
lda #>keen_sprite_squish
|
||||||
|
stx INL
|
||||||
|
sta INH
|
||||||
|
jsr put_sprite_crop
|
||||||
|
|
||||||
|
jsr page_flip
|
||||||
|
|
||||||
|
lda PLAY_END_SOUND
|
||||||
|
beq skip_end_sound
|
||||||
|
|
||||||
|
ldy #SFX_KEENDIESND
|
||||||
|
jsr play_sfx
|
||||||
|
|
||||||
|
dec PLAY_END_SOUND
|
||||||
|
skip_end_sound:
|
||||||
|
|
||||||
|
|
||||||
|
lda #50
|
||||||
|
jsr WAIT
|
||||||
|
|
||||||
|
dec YPOS
|
||||||
|
dec YPOS
|
||||||
|
|
||||||
|
bpl level_end_animation
|
||||||
|
|
||||||
|
|
||||||
|
dec KEENS
|
||||||
|
bpl level1_levelover
|
||||||
|
|
||||||
|
level1_gameover:
|
||||||
|
|
||||||
|
; mars plays the sound
|
||||||
|
|
||||||
|
lda #GAME_OVER
|
||||||
|
sta LEVEL_OVER
|
||||||
|
|
||||||
|
level1_levelover:
|
||||||
|
|
||||||
|
lda #LOAD_MARS
|
||||||
|
sta WHICH_LOAD
|
||||||
|
|
||||||
|
rts ; exit back
|
||||||
|
|
||||||
|
|
||||||
|
;==========================
|
||||||
|
; includes
|
||||||
|
;==========================
|
||||||
|
|
||||||
|
.include "text_print.s"
|
||||||
|
.include "gr_offsets.s"
|
||||||
|
.include "gr_fast_clear.s"
|
||||||
|
.include "gr_pageflip.s"
|
||||||
|
.include "gr_putsprite_crop.s"
|
||||||
|
.include "zx02_optim.s"
|
||||||
|
|
||||||
|
.include "status_bar.s"
|
||||||
|
.include "keyboard.s"
|
||||||
|
.include "joystick.s"
|
||||||
|
|
||||||
|
.include "text_drawbox.s"
|
||||||
|
.include "text_help.s"
|
||||||
|
.include "text_quit_yn.s"
|
||||||
|
|
||||||
|
.include "draw_keen.s"
|
||||||
|
.include "sprites/keen_sprites.inc"
|
||||||
|
.include "move_keen.s"
|
||||||
|
.include "handle_laser.s"
|
||||||
|
.include "draw_tilemap.s"
|
||||||
|
.include "level1_enemies.s"
|
||||||
|
.include "level1_items.s"
|
||||||
|
|
||||||
|
.include "level1_sfx.s"
|
||||||
|
.include "longer_sound.s"
|
||||||
|
|
||||||
|
.include "random16.s"
|
||||||
|
|
||||||
|
.include "tilemap_lookup.s"
|
||||||
|
|
||||||
|
level1_data_zx02:
|
||||||
|
.incbin "maps/level2_map.zx02"
|
||||||
|
|
||||||
|
|
||||||
|
oracle_message:
|
||||||
|
; 012345678901234567890123456789012345678
|
||||||
|
.byte 2,21,"YOU HEAR IN YOUR MIND:",0
|
||||||
|
.byte 2,22,"IT IS TOO BAD THAT YOU CANNOT READ",0
|
||||||
|
.byte 2,23,"THE STANDARD GALACTIC ALPHABET, HUMAN",0
|
|
@ -0,0 +1,16 @@
|
||||||
|
; Level 2 (First Shrine)
|
||||||
|
|
||||||
|
MAX_TILE_X = 20 ; 20 wide
|
||||||
|
MAX_TILE_Y = 26 ; 26 high
|
||||||
|
|
||||||
|
START_KEEN_TILEX = 1
|
||||||
|
START_KEEN_TILEY = 13
|
||||||
|
|
||||||
|
START_TILEMAP_X = 0
|
||||||
|
START_TILEMAP_Y = 5
|
||||||
|
|
||||||
|
NUM_ENEMIES = 8
|
||||||
|
|
||||||
|
HARDTOP_TILES = 32 ; start at 32
|
||||||
|
ALLHARD_TILES = 40 ; start at 40
|
||||||
|
|
|
@ -7,7 +7,7 @@ PNG2GR = ../../../utils/gr-utils/png2gr
|
||||||
|
|
||||||
all: png2map \
|
all: png2map \
|
||||||
level1_map.zx02 level2_map.zx02 \
|
level1_map.zx02 level2_map.zx02 \
|
||||||
mars_map.gr.zx02 mars_new.zx02
|
mars_map.zx02
|
||||||
|
|
||||||
###
|
###
|
||||||
|
|
||||||
|
@ -29,11 +29,11 @@ level2_map.inc: level2_map.png png2map
|
||||||
|
|
||||||
###
|
###
|
||||||
|
|
||||||
mars_new.zx02: mars_new.inc
|
mars_map.zx02: mars_map.inc
|
||||||
$(ZX02) mars_new.inc mars_new.zx02
|
$(ZX02) mars_map.inc mars_map.zx02
|
||||||
|
|
||||||
mars_new.inc: mars_new.png png2map
|
mars_map.inc: mars_map.png png2map
|
||||||
./png2map mars_new.png mars_new.inc
|
./png2map mars_map.png mars_map.inc
|
||||||
|
|
||||||
|
|
||||||
###
|
###
|
||||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 6.6 KiB After Width: | Height: | Size: 6.6 KiB |
Binary file not shown.
Before Width: | Height: | Size: 873 B After Width: | Height: | Size: 9.8 KiB |
Binary file not shown.
Before Width: | Height: | Size: 9.8 KiB |
Binary file not shown.
After Width: | Height: | Size: 873 B |
|
@ -55,17 +55,6 @@ plenty_of_keens:
|
||||||
|
|
||||||
not_game_over:
|
not_game_over:
|
||||||
|
|
||||||
; TODO: set this in title, don't over-write
|
|
||||||
|
|
||||||
lda #10
|
|
||||||
sta MARS_TILEX
|
|
||||||
lda #34
|
|
||||||
sta MARS_TILEY
|
|
||||||
|
|
||||||
lda #0
|
|
||||||
sta MARS_X
|
|
||||||
sta MARS_Y
|
|
||||||
|
|
||||||
;====================================
|
;====================================
|
||||||
; load mars tilemap
|
; load mars tilemap
|
||||||
;====================================
|
;====================================
|
||||||
|
@ -81,48 +70,19 @@ not_game_over:
|
||||||
;====================================
|
;====================================
|
||||||
; copy in tilemap subset
|
; copy in tilemap subset
|
||||||
;====================================
|
;====================================
|
||||||
; FIXME: start values
|
|
||||||
; center around MARS_TILEX, MARS_TILEY
|
|
||||||
|
|
||||||
lda #0 ; default at 0,0
|
; first center map around current location
|
||||||
sta TILEMAP_X
|
|
||||||
sta TILEMAP_Y
|
|
||||||
|
|
||||||
lda MARS_TILEX
|
jsr recenter_map
|
||||||
cmp #10
|
|
||||||
bcc mars_tilex_fine
|
|
||||||
sec
|
|
||||||
sbc #10
|
|
||||||
sta TILEMAP_X
|
|
||||||
|
|
||||||
mars_tilex_fine:
|
; copy mini tileset
|
||||||
|
|
||||||
lda MARS_TILEY
|
|
||||||
cmp #6
|
|
||||||
bcc mars_tiley_fine
|
|
||||||
sec
|
|
||||||
sbc #6
|
|
||||||
sta TILEMAP_Y
|
|
||||||
|
|
||||||
mars_tiley_fine:
|
|
||||||
|
|
||||||
jsr copy_tilemap_subset
|
jsr copy_tilemap_subset
|
||||||
|
|
||||||
; make a copy in $c00 for fade-in purposes
|
|
||||||
|
|
||||||
lda DRAW_PAGE ; necssary
|
; snapshot current tileset for fade purposes
|
||||||
pha
|
|
||||||
|
|
||||||
lda #8
|
jsr snapshot_tilemap
|
||||||
sta DRAW_PAGE
|
|
||||||
|
|
||||||
jsr draw_tilemap
|
|
||||||
|
|
||||||
pla
|
|
||||||
sta DRAW_PAGE
|
|
||||||
|
|
||||||
lda #1
|
|
||||||
sta INITIAL_SOUND
|
|
||||||
|
|
||||||
jsr fade_in
|
jsr fade_in
|
||||||
|
|
||||||
|
@ -214,6 +174,8 @@ done_with_keen:
|
||||||
ldy #SFX_WLDENTRSND
|
ldy #SFX_WLDENTRSND
|
||||||
jsr play_sfx
|
jsr play_sfx
|
||||||
|
|
||||||
|
jsr snapshot_tilemap
|
||||||
|
|
||||||
jsr fade_out
|
jsr fade_out
|
||||||
|
|
||||||
; set up proper level to load
|
; set up proper level to load
|
||||||
|
@ -395,17 +357,39 @@ done_parts:
|
||||||
|
|
||||||
bit FULLGR
|
bit FULLGR
|
||||||
|
|
||||||
; lda #<mars_zx02
|
rts
|
||||||
; sta ZX0_src
|
|
||||||
; lda #>mars_zx02
|
|
||||||
; sta ZX0_src+1
|
|
||||||
|
|
||||||
; lda #$c ; load to page $c00
|
|
||||||
|
|
||||||
; jsr full_decomp ; tail call
|
;===============================
|
||||||
|
;===============================
|
||||||
|
; snapshot tile map
|
||||||
|
;===============================
|
||||||
|
;===============================
|
||||||
|
; copy current tilemap graphics
|
||||||
|
; to $c00 for fade-in/fade-out
|
||||||
|
|
||||||
|
snapshot_tilemap:
|
||||||
|
|
||||||
|
; make a copy in $c00 for fade-in purposes
|
||||||
|
|
||||||
|
lda DRAW_PAGE ; necssary
|
||||||
|
pha
|
||||||
|
|
||||||
|
lda #8
|
||||||
|
sta DRAW_PAGE
|
||||||
|
|
||||||
|
jsr draw_tilemap
|
||||||
|
|
||||||
|
pla
|
||||||
|
sta DRAW_PAGE
|
||||||
|
|
||||||
|
lda #1
|
||||||
|
sta INITIAL_SOUND
|
||||||
|
|
||||||
rts
|
rts
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
;====================================
|
;====================================
|
||||||
;====================================
|
;====================================
|
||||||
; Mars action (enter pressed on map)
|
; Mars action (enter pressed on map)
|
||||||
|
@ -441,7 +425,7 @@ NUM_LOCATIONS = 20
|
||||||
|
|
||||||
do_action:
|
do_action:
|
||||||
|
|
||||||
ldx #NUM_LOCATIONS
|
ldx #(NUM_LOCATIONS-1)
|
||||||
|
|
||||||
do_action_loop:
|
do_action_loop:
|
||||||
|
|
||||||
|
@ -505,28 +489,6 @@ check_location_match:
|
||||||
rts ; jump
|
rts ; jump
|
||||||
|
|
||||||
|
|
||||||
; lda MARS_X
|
|
||||||
; cmp #15
|
|
||||||
; bcc do_nothing ; blt
|
|
||||||
; cmp #20
|
|
||||||
; bcc maybe_ship
|
|
||||||
; cmp #35
|
|
||||||
; bcs maybe_exit
|
|
||||||
;do_nothing:
|
|
||||||
; ; TODO: make sound?
|
|
||||||
; rts
|
|
||||||
;maybe_ship:
|
|
||||||
; lda MARS_Y
|
|
||||||
; cmp #16
|
|
||||||
; bcc do_nothing
|
|
||||||
; cmp #24
|
|
||||||
; bcs do_nothing
|
|
||||||
; jmp do_parts ; tail call
|
|
||||||
;maybe_exit:
|
|
||||||
; inc LEVEL_OVER
|
|
||||||
; rts
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
;=====================================
|
;=====================================
|
||||||
;=====================================
|
;=====================================
|
||||||
|
@ -542,6 +504,9 @@ dummy_action:
|
||||||
;=====================================
|
;=====================================
|
||||||
;=====================================
|
;=====================================
|
||||||
; level number is in X
|
; level number is in X
|
||||||
|
|
||||||
|
; FIXME: make sure level is not completed
|
||||||
|
|
||||||
enter_level:
|
enter_level:
|
||||||
|
|
||||||
stx CURRENT_LEVEL
|
stx CURRENT_LEVEL
|
||||||
|
@ -550,6 +515,89 @@ enter_level:
|
||||||
|
|
||||||
rts
|
rts
|
||||||
|
|
||||||
|
;=====================================
|
||||||
|
;=====================================
|
||||||
|
; transport_to_right
|
||||||
|
;=====================================
|
||||||
|
;=====================================
|
||||||
|
transport_right:
|
||||||
|
|
||||||
|
lda #34
|
||||||
|
sta MARS_TILEX
|
||||||
|
lda #3
|
||||||
|
|
||||||
|
transport_common:
|
||||||
|
sta MARS_TILEY
|
||||||
|
|
||||||
|
ldy #SFX_TELEPORTSND
|
||||||
|
jsr play_sfx
|
||||||
|
|
||||||
|
jsr recenter_map
|
||||||
|
|
||||||
|
jsr copy_tilemap_subset
|
||||||
|
|
||||||
|
rts
|
||||||
|
|
||||||
|
;=====================================
|
||||||
|
;=====================================
|
||||||
|
; transport_to_left
|
||||||
|
;=====================================
|
||||||
|
;=====================================
|
||||||
|
transport_left:
|
||||||
|
|
||||||
|
lda #26
|
||||||
|
sta MARS_TILEX
|
||||||
|
lda #4
|
||||||
|
|
||||||
|
bne transport_common ; bra
|
||||||
|
|
||||||
|
;=====================================
|
||||||
|
;=====================================
|
||||||
|
; transport_to_secret
|
||||||
|
;=====================================
|
||||||
|
;=====================================
|
||||||
|
transport_secret:
|
||||||
|
; TODO: verify we are transporting back to the right place
|
||||||
|
|
||||||
|
lda #44
|
||||||
|
sta MARS_TILEX
|
||||||
|
lda #24
|
||||||
|
|
||||||
|
bne transport_common ; bra
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
;=====================================
|
||||||
|
; recenter map around current location
|
||||||
|
;=====================================
|
||||||
|
; center around MARS_TILEX, MARS_TILEY
|
||||||
|
|
||||||
|
recenter_map:
|
||||||
|
lda #0 ; default at 0,0
|
||||||
|
sta TILEMAP_X
|
||||||
|
sta TILEMAP_Y
|
||||||
|
|
||||||
|
lda MARS_TILEX
|
||||||
|
cmp #10
|
||||||
|
bcc mars_tilex_fine ; if MARS_TILEX < 10, leave tilemap 0
|
||||||
|
|
||||||
|
sec ; otherwise tilemap=mars_tilex-10
|
||||||
|
sbc #10
|
||||||
|
sta TILEMAP_X
|
||||||
|
|
||||||
|
mars_tilex_fine:
|
||||||
|
|
||||||
|
lda MARS_TILEY
|
||||||
|
cmp #6
|
||||||
|
bcc mars_tiley_fine ; if MARS_TILEY < 6 leave tilemap 0
|
||||||
|
|
||||||
|
sec ; otherwise tilemap_y=mars_tiley-6
|
||||||
|
sbc #6
|
||||||
|
sta TILEMAP_Y
|
||||||
|
|
||||||
|
mars_tiley_fine:
|
||||||
|
|
||||||
|
rts
|
||||||
|
|
||||||
location_x:
|
location_x:
|
||||||
.byte 19,22, 9,22,13,16,25,38
|
.byte 19,22, 9,22,13,16,25,38
|
||||||
|
@ -567,7 +615,7 @@ location_size:
|
||||||
.byte 1,1,1,1
|
.byte 1,1,1,1
|
||||||
|
|
||||||
location_actions_low:
|
location_actions_low:
|
||||||
.byte <(enter_level-1),<(dummy_action-1) ; level1, level2
|
.byte <(enter_level-1),<(enter_level-1) ; level1, level2
|
||||||
.byte <(dummy_action-1),<(dummy_action-1)
|
.byte <(dummy_action-1),<(dummy_action-1)
|
||||||
.byte <(dummy_action-1),<(dummy_action-1)
|
.byte <(dummy_action-1),<(dummy_action-1)
|
||||||
.byte <(dummy_action-1),<(dummy_action-1)
|
.byte <(dummy_action-1),<(dummy_action-1)
|
||||||
|
@ -575,11 +623,11 @@ location_actions_low:
|
||||||
.byte <(dummy_action-1),<(dummy_action-1)
|
.byte <(dummy_action-1),<(dummy_action-1)
|
||||||
.byte <(dummy_action-1),<(dummy_action-1)
|
.byte <(dummy_action-1),<(dummy_action-1)
|
||||||
.byte <(dummy_action-1),<(dummy_action-1)
|
.byte <(dummy_action-1),<(dummy_action-1)
|
||||||
.byte <(do_parts-1),<(dummy_action-1) ; ship, l transport
|
.byte <(do_parts-1),<(transport_right-1) ; ship, l transport
|
||||||
.byte <(dummy_action-1),<(dummy_action-1) ; r trans, secret
|
.byte <(transport_left-1),<(transport_secret-1) ; r trans, secret
|
||||||
|
|
||||||
location_actions_high:
|
location_actions_high:
|
||||||
.byte >(enter_level-1),>(dummy_action-1) ; level1, level2
|
.byte >(enter_level-1),>(enter_level-1) ; level1, level2
|
||||||
.byte >(dummy_action-1),>(dummy_action-1)
|
.byte >(dummy_action-1),>(dummy_action-1)
|
||||||
.byte >(dummy_action-1),>(dummy_action-1)
|
.byte >(dummy_action-1),>(dummy_action-1)
|
||||||
.byte >(dummy_action-1),>(dummy_action-1)
|
.byte >(dummy_action-1),>(dummy_action-1)
|
||||||
|
@ -587,8 +635,8 @@ location_actions_high:
|
||||||
.byte >(dummy_action-1),>(dummy_action-1)
|
.byte >(dummy_action-1),>(dummy_action-1)
|
||||||
.byte >(dummy_action-1),>(dummy_action-1)
|
.byte >(dummy_action-1),>(dummy_action-1)
|
||||||
.byte >(dummy_action-1),>(dummy_action-1)
|
.byte >(dummy_action-1),>(dummy_action-1)
|
||||||
.byte >(do_parts-1),>(dummy_action-1) ; ship, l transport
|
.byte >(do_parts-1),>(transport_right-1) ; ship, l transport
|
||||||
.byte >(dummy_action-1),>(dummy_action-1) ; r trans, secret
|
.byte >(transport_left-1),>(transport_secret-1) ; r trans, secret
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -605,8 +653,6 @@ location_actions_high:
|
||||||
|
|
||||||
; level graphics
|
; level graphics
|
||||||
|
|
||||||
mars_zx02:
|
|
||||||
.incbin "maps/mars_map.gr.zx02"
|
|
||||||
parts_zx02:
|
parts_zx02:
|
||||||
.incbin "graphics/parts.gr.zx02"
|
.incbin "graphics/parts.gr.zx02"
|
||||||
|
|
||||||
|
@ -615,7 +661,7 @@ parts_zx02:
|
||||||
.include "gr_fast_clear.s"
|
.include "gr_fast_clear.s"
|
||||||
.include "gr_copy.s"
|
.include "gr_copy.s"
|
||||||
.include "gr_pageflip.s"
|
.include "gr_pageflip.s"
|
||||||
; .include "gr_putsprite_crop.s"
|
.include "gr_putsprite_crop.s"
|
||||||
.include "zx02_optim.s"
|
.include "zx02_optim.s"
|
||||||
.include "gr_fade.s"
|
.include "gr_fade.s"
|
||||||
|
|
||||||
|
@ -630,10 +676,11 @@ parts_zx02:
|
||||||
|
|
||||||
.include "mars_sfx.s"
|
.include "mars_sfx.s"
|
||||||
.include "longer_sound.s"
|
.include "longer_sound.s"
|
||||||
.include "gr_putsprite_crop.s"
|
|
||||||
|
.include "tilemap_lookup.s"
|
||||||
|
|
||||||
mars_data_zx02:
|
mars_data_zx02:
|
||||||
.incbin "maps/mars_new.zx02"
|
.incbin "maps/mars_map.zx02"
|
||||||
|
|
||||||
; dummy
|
; dummy
|
||||||
enemy_data_out:
|
enemy_data_out:
|
||||||
|
|
|
@ -111,6 +111,26 @@ check_left:
|
||||||
|
|
||||||
left_pressed:
|
left_pressed:
|
||||||
|
|
||||||
|
; check if allowed to move left
|
||||||
|
|
||||||
|
ldx MARS_TILEY
|
||||||
|
dex ; look one up
|
||||||
|
|
||||||
|
lda tilemap_lookup_high,X
|
||||||
|
sta INH
|
||||||
|
lda tilemap_lookup_low,X
|
||||||
|
sta INL
|
||||||
|
|
||||||
|
ldy MARS_TILEX
|
||||||
|
dey
|
||||||
|
|
||||||
|
lda (INL),Y
|
||||||
|
|
||||||
|
cmp #32
|
||||||
|
bcs done_left_pressed
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
lda TILEMAP_X
|
lda TILEMAP_X
|
||||||
beq keen_walk_left
|
beq keen_walk_left
|
||||||
|
|
||||||
|
@ -152,6 +172,45 @@ check_right:
|
||||||
|
|
||||||
right_pressed:
|
right_pressed:
|
||||||
|
|
||||||
|
; check if allowed to move right
|
||||||
|
|
||||||
|
ldx MARS_TILEY
|
||||||
|
dex ; look one up
|
||||||
|
|
||||||
|
lda tilemap_lookup_high,X
|
||||||
|
sta INH
|
||||||
|
lda tilemap_lookup_low,X
|
||||||
|
sta INL
|
||||||
|
|
||||||
|
ldy MARS_TILEX
|
||||||
|
iny
|
||||||
|
|
||||||
|
lda (INL),Y
|
||||||
|
|
||||||
|
cmp #32
|
||||||
|
bcs done_right_pressed
|
||||||
|
|
||||||
|
|
||||||
|
lda MARS_TILEY
|
||||||
|
sta INH
|
||||||
|
lda #$0
|
||||||
|
lsr INH
|
||||||
|
ror
|
||||||
|
sta INL
|
||||||
|
|
||||||
|
lda INH
|
||||||
|
clc
|
||||||
|
adc #>big_tilemap
|
||||||
|
sta INH
|
||||||
|
ldy MARS_TILEX
|
||||||
|
iny
|
||||||
|
|
||||||
|
lda (INL),Y
|
||||||
|
|
||||||
|
cmp #32
|
||||||
|
bcs done_right_pressed
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
move_right:
|
move_right:
|
||||||
lda TILEMAP_X
|
lda TILEMAP_X
|
||||||
|
@ -202,14 +261,33 @@ check_up:
|
||||||
bne check_down
|
bne check_down
|
||||||
|
|
||||||
up_pressed:
|
up_pressed:
|
||||||
|
|
||||||
|
; check if allowed to move up
|
||||||
|
|
||||||
|
ldx MARS_TILEY
|
||||||
|
dex ; look one up
|
||||||
|
|
||||||
|
lda tilemap_lookup_high,X
|
||||||
|
sta INH
|
||||||
|
lda tilemap_lookup_low,X
|
||||||
|
sta INL
|
||||||
|
|
||||||
|
ldy MARS_TILEX
|
||||||
|
|
||||||
|
lda (INL),Y
|
||||||
|
|
||||||
|
cmp #32
|
||||||
|
bcs done_up_pressed
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
lda MARS_TILEY
|
lda MARS_TILEY
|
||||||
cmp #0 ; not needed
|
cmp #0 ; not needed
|
||||||
beq move_keen_up
|
beq move_keen_up
|
||||||
|
|
||||||
sec
|
sec
|
||||||
lda TILEMAP_Y
|
lda MARS_TILEY
|
||||||
sbc MARS_TILEY
|
sbc TILEMAP_Y
|
||||||
|
|
||||||
cmp #4
|
cmp #4
|
||||||
bcc scroll_keen_up
|
bcc scroll_keen_up
|
||||||
|
|
||||||
|
@ -251,6 +329,24 @@ check_down:
|
||||||
bne check_space
|
bne check_space
|
||||||
down_pressed:
|
down_pressed:
|
||||||
|
|
||||||
|
; check if allowed to move down
|
||||||
|
|
||||||
|
ldx MARS_TILEY
|
||||||
|
inx ; look one down
|
||||||
|
|
||||||
|
lda tilemap_lookup_high,X
|
||||||
|
sta INH
|
||||||
|
lda tilemap_lookup_low,X
|
||||||
|
sta INL
|
||||||
|
|
||||||
|
ldy MARS_TILEX
|
||||||
|
|
||||||
|
lda (INL),Y
|
||||||
|
|
||||||
|
cmp #32
|
||||||
|
bcs done_down_pressed
|
||||||
|
|
||||||
|
|
||||||
sec
|
sec
|
||||||
lda MARS_TILEY
|
lda MARS_TILEY
|
||||||
sbc TILEMAP_Y
|
sbc TILEMAP_Y
|
||||||
|
@ -324,4 +420,3 @@ no_keypress:
|
||||||
bit KEYRESET
|
bit KEYRESET
|
||||||
rts
|
rts
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
SFX_KEENSLEFT = 0
|
SFX_KEENSLEFT = 0
|
||||||
SFX_WLDENTRSND = 1
|
SFX_WLDENTRSND = 1
|
||||||
SFX_GAMEOVERSND = 2
|
SFX_GAMEOVERSND = 2
|
||||||
|
SFX_TELEPORTSND = 3
|
||||||
|
|
||||||
;==========================
|
;==========================
|
||||||
; plays soundfx
|
; plays soundfx
|
||||||
|
@ -47,10 +48,10 @@ play_done:
|
||||||
|
|
||||||
|
|
||||||
sounds_low:
|
sounds_low:
|
||||||
.byte <keensleft, <WLDENTERSND, <GAMEOVERSND
|
.byte <keensleft, <WLDENTERSND, <GAMEOVERSND, <TELEPORTSND
|
||||||
|
|
||||||
sounds_high:
|
sounds_high:
|
||||||
.byte >keensleft, >WLDENTERSND, >GAMEOVERSND
|
.byte >keensleft, >WLDENTERSND, >GAMEOVERSND, >TELEPORTSND
|
||||||
|
|
||||||
|
|
||||||
WLDENTERSND:
|
WLDENTERSND:
|
||||||
|
@ -253,3 +254,186 @@ GAMEOVERSND:
|
||||||
.byte 0,11 ; 0.0
|
.byte 0,11 ; 0.0
|
||||||
.byte 133,10 ; 184.1
|
.byte 133,10 ; 184.1
|
||||||
.byte 255,255
|
.byte 255,255
|
||||||
|
TELEPORTSND:
|
||||||
|
.byte 165,1 ; 148.4
|
||||||
|
.byte 82,1 ; 296.8
|
||||||
|
.byte 159,1 ; 154.2
|
||||||
|
.byte 28,1 ; 864.6
|
||||||
|
.byte 163,1 ; 150.7
|
||||||
|
.byte 166,1 ; 147.3
|
||||||
|
.byte 40,2 ; 602.6
|
||||||
|
.byte 186,1 ; 131.7
|
||||||
|
.byte 185,1 ; 132.6
|
||||||
|
.byte 0,1 ; 0.0
|
||||||
|
.byte 30,1 ; 795.5
|
||||||
|
.byte 86,1 ; 284.1
|
||||||
|
.byte 191,1 ; 128.3
|
||||||
|
.byte 66,1 ; 368.3
|
||||||
|
.byte 67,1 ; 361.6
|
||||||
|
.byte 88,1 ; 276.2
|
||||||
|
.byte 0,1 ; 0.0
|
||||||
|
.byte 88,1 ; 276.2
|
||||||
|
.byte 0,1 ; 0.0
|
||||||
|
.byte 189,1 ; 130.0
|
||||||
|
.byte 89,2 ; 272.4
|
||||||
|
.byte 0,1 ; 0.0
|
||||||
|
.byte 89,1 ; 272.4
|
||||||
|
.byte 22,1 ; 1104.8
|
||||||
|
.byte 89,1 ; 272.4
|
||||||
|
.byte 189,1 ; 130.0
|
||||||
|
.byte 27,1 ; 903.9
|
||||||
|
.byte 0,1 ; 0.0
|
||||||
|
.byte 83,1 ; 292.4
|
||||||
|
.byte 89,1 ; 272.4
|
||||||
|
.byte 91,1 ; 268.7
|
||||||
|
.byte 71,1 ; 342.9
|
||||||
|
.byte 188,1 ; 130.8
|
||||||
|
.byte 91,1 ; 268.7
|
||||||
|
.byte 0,1 ; 0.0
|
||||||
|
.byte 92,1 ; 265.2
|
||||||
|
.byte 83,1 ; 292.4
|
||||||
|
.byte 194,1 ; 126.7
|
||||||
|
.byte 22,1 ; 1104.8
|
||||||
|
.byte 0,1 ; 0.0
|
||||||
|
.byte 83,1 ; 292.4
|
||||||
|
.byte 59,1 ; 414.3
|
||||||
|
.byte 92,1 ; 265.2
|
||||||
|
.byte 60,1 ; 405.8
|
||||||
|
.byte 0,1 ; 0.0
|
||||||
|
.byte 51,1 ; 473.5
|
||||||
|
.byte 89,2 ; 272.4
|
||||||
|
.byte 0,1 ; 0.0
|
||||||
|
.byte 89,1 ; 272.4
|
||||||
|
.byte 38,1 ; 641.5
|
||||||
|
.byte 0,3 ; 0.0
|
||||||
|
.byte 89,1 ; 272.4
|
||||||
|
.byte 188,1 ; 130.8
|
||||||
|
.byte 89,1 ; 272.4
|
||||||
|
.byte 186,1 ; 131.7
|
||||||
|
.byte 190,1 ; 129.1
|
||||||
|
.byte 186,1 ; 131.7
|
||||||
|
.byte 0,1 ; 0.0
|
||||||
|
.byte 185,1 ; 132.6
|
||||||
|
.byte 83,1 ; 292.4
|
||||||
|
.byte 89,1 ; 272.4
|
||||||
|
.byte 0,1 ; 0.0
|
||||||
|
.byte 83,1 ; 292.4
|
||||||
|
.byte 89,2 ; 272.4
|
||||||
|
.byte 188,1 ; 130.8
|
||||||
|
.byte 0,1 ; 0.0
|
||||||
|
.byte 71,1 ; 342.9
|
||||||
|
.byte 188,1 ; 130.8
|
||||||
|
.byte 81,1 ; 301.3
|
||||||
|
.byte 189,2 ; 130.0
|
||||||
|
.byte 92,1 ; 265.2
|
||||||
|
.byte 89,1 ; 272.4
|
||||||
|
.byte 86,1 ; 284.1
|
||||||
|
.byte 91,1 ; 268.7
|
||||||
|
.byte 89,2 ; 272.4
|
||||||
|
.byte 86,1 ; 284.1
|
||||||
|
.byte 0,2 ; 0.0
|
||||||
|
.byte 72,1 ; 337.1
|
||||||
|
.byte 91,1 ; 268.7
|
||||||
|
.byte 92,1 ; 265.2
|
||||||
|
.byte 0,1 ; 0.0
|
||||||
|
.byte 94,1 ; 258.3
|
||||||
|
.byte 188,1 ; 130.8
|
||||||
|
.byte 194,1 ; 126.7
|
||||||
|
.byte 87,2 ; 280.1
|
||||||
|
.byte 0,1 ; 0.0
|
||||||
|
.byte 87,1 ; 280.1
|
||||||
|
.byte 188,1 ; 130.8
|
||||||
|
.byte 88,1 ; 276.2
|
||||||
|
.byte 0,1 ; 0.0
|
||||||
|
.byte 88,1 ; 276.2
|
||||||
|
.byte 188,1 ; 130.8
|
||||||
|
.byte 36,1 ; 662.9
|
||||||
|
.byte 197,2 ; 124.3
|
||||||
|
.byte 127,1 ; 193.1
|
||||||
|
.byte 0,1 ; 0.0
|
||||||
|
.byte 88,1 ; 276.2
|
||||||
|
.byte 0,2 ; 0.0
|
||||||
|
.byte 66,1 ; 368.3
|
||||||
|
.byte 0,2 ; 0.0
|
||||||
|
.byte 57,1 ; 423.1
|
||||||
|
.byte 78,1 ; 310.7
|
||||||
|
.byte 88,2 ; 276.2
|
||||||
|
.byte 189,1 ; 130.0
|
||||||
|
.byte 43,1 ; 568.2
|
||||||
|
.byte 166,1 ; 147.3
|
||||||
|
.byte 0,1 ; 0.0
|
||||||
|
.byte 188,1 ; 130.8
|
||||||
|
.byte 88,2 ; 276.2
|
||||||
|
.byte 194,1 ; 126.7
|
||||||
|
.byte 186,1 ; 131.7
|
||||||
|
.byte 0,1 ; 0.0
|
||||||
|
.byte 52,1 ; 462.5
|
||||||
|
.byte 89,1 ; 272.4
|
||||||
|
.byte 186,1 ; 131.7
|
||||||
|
.byte 91,2 ; 268.7
|
||||||
|
.byte 73,1 ; 331.4
|
||||||
|
.byte 91,3 ; 268.7
|
||||||
|
.byte 0,1 ; 0.0
|
||||||
|
.byte 91,1 ; 268.7
|
||||||
|
.byte 0,3 ; 0.0
|
||||||
|
.byte 33,1 ; 736.5
|
||||||
|
.byte 0,2 ; 0.0
|
||||||
|
.byte 59,1 ; 414.3
|
||||||
|
.byte 78,1 ; 310.7
|
||||||
|
.byte 0,1 ; 0.0
|
||||||
|
.byte 49,1 ; 497.2
|
||||||
|
.byte 48,1 ; 509.9
|
||||||
|
.byte 46,1 ; 523.3
|
||||||
|
.byte 12,3 ; 1988.6
|
||||||
|
.byte 0,3 ; 0.0
|
||||||
|
.byte 38,1 ; 641.5
|
||||||
|
.byte 36,1 ; 662.9
|
||||||
|
.byte 191,2 ; 128.3
|
||||||
|
.byte 113,1 ; 216.2
|
||||||
|
.byte 17,1 ; 1420.5
|
||||||
|
.byte 191,1 ; 128.3
|
||||||
|
.byte 0,1 ; 0.0
|
||||||
|
.byte 96,1 ; 255.0
|
||||||
|
.byte 27,1 ; 903.9
|
||||||
|
.byte 25,2 ; 947.0
|
||||||
|
.byte 13,1 ; 1807.8
|
||||||
|
.byte 0,1 ; 0.0
|
||||||
|
.byte 12,1 ; 1988.6
|
||||||
|
.byte 9,1 ; 2485.8
|
||||||
|
.byte 0,1 ; 0.0
|
||||||
|
.byte 20,1 ; 1169.8
|
||||||
|
.byte 123,1 ; 198.9
|
||||||
|
.byte 19,1 ; 1242.9
|
||||||
|
.byte 192,1 ; 127.5
|
||||||
|
.byte 0,1 ; 0.0
|
||||||
|
.byte 18,1 ; 1325.8
|
||||||
|
.byte 138,1 ; 177.6
|
||||||
|
.byte 17,1 ; 1420.5
|
||||||
|
.byte 11,1 ; 2209.6
|
||||||
|
.byte 0,2 ; 0.0
|
||||||
|
.byte 67,1 ; 361.6
|
||||||
|
.byte 153,1 ; 160.4
|
||||||
|
.byte 0,1 ; 0.0
|
||||||
|
.byte 11,1 ; 2209.6
|
||||||
|
.byte 0,2 ; 0.0
|
||||||
|
.byte 9,2 ; 2485.8
|
||||||
|
.byte 8,1 ; 2840.9
|
||||||
|
.byte 0,2 ; 0.0
|
||||||
|
.byte 7,1 ; 3314.4
|
||||||
|
.byte 0,2 ; 0.0
|
||||||
|
.byte 195,2 ; 125.9
|
||||||
|
.byte 0,3 ; 0.0
|
||||||
|
.byte 2,1 ; 9943.2
|
||||||
|
.byte 0,1 ; 0.0
|
||||||
|
.byte 169,1 ; 145.2
|
||||||
|
.byte 0,4 ; 0.0
|
||||||
|
.byte 4,1 ; 4971.6
|
||||||
|
.byte 186,1 ; 131.7
|
||||||
|
.byte 190,2 ; 129.1
|
||||||
|
.byte 0,1 ; 0.0
|
||||||
|
.byte 50,1 ; 485.0
|
||||||
|
.byte 190,1 ; 129.1
|
||||||
|
.byte 0,2 ; 0.0
|
||||||
|
.byte 101,1 ; 242.5
|
||||||
|
.byte 109,1 ; 223.4
|
||||||
|
.byte 255,255
|
||||||
|
|
|
@ -2,9 +2,6 @@ KEEN_SPEED = $80
|
||||||
|
|
||||||
YDEFAULT = 20
|
YDEFAULT = 20
|
||||||
|
|
||||||
HARDTOP_TILES = 32 ; start at 32
|
|
||||||
ALLHARD_TILES = 40 ; start at 40
|
|
||||||
|
|
||||||
TILE_COLS = 20
|
TILE_COLS = 20
|
||||||
|
|
||||||
|
|
||||||
|
@ -40,11 +37,11 @@ move_keen_early_out:
|
||||||
;==============================
|
;==============================
|
||||||
; Move Keen Right
|
; Move Keen Right
|
||||||
;==============================
|
;==============================
|
||||||
; if (keen_tilex-tilemap_x<11) || (tilemap_x>96) walk
|
; if (keen_tilex-tilemap_x<11) || (tilemap_x> (maxtile-20) ) walk
|
||||||
; otherwise, scroll
|
; otherwise, scroll
|
||||||
move_right:
|
move_right:
|
||||||
lda TILEMAP_X
|
lda TILEMAP_X
|
||||||
cmp #96 ; 540-80 = 460/4 = 115-20 = 95
|
cmp #(MAX_TILE_X-20)
|
||||||
bcs keen_walk_right
|
bcs keen_walk_right
|
||||||
|
|
||||||
sec
|
sec
|
||||||
|
@ -180,12 +177,22 @@ keen_check_head:
|
||||||
sec
|
sec
|
||||||
lda KEEN_TILEY
|
lda KEEN_TILEY
|
||||||
sbc #1
|
sbc #1
|
||||||
adc #>big_tilemap
|
; bmi offscreen?
|
||||||
|
|
||||||
|
tay
|
||||||
|
lda tilemap_lookup_high,Y
|
||||||
sta INH
|
sta INH
|
||||||
lda #0
|
lda tilemap_lookup_low,Y
|
||||||
sta INL
|
sta INL
|
||||||
|
|
||||||
|
; adc #>big_tilemap
|
||||||
|
; sta INH
|
||||||
|
; lda #0
|
||||||
|
; sta INL
|
||||||
|
|
||||||
ldy KEEN_TILEX
|
ldy KEEN_TILEX
|
||||||
|
|
||||||
|
lda KEEN_X
|
||||||
bne collide_head_r
|
bne collide_head_r
|
||||||
|
|
||||||
collide_head_l:
|
collide_head_l:
|
||||||
|
@ -195,6 +202,8 @@ collide_head_l:
|
||||||
cmp #ALLHARD_TILES
|
cmp #ALLHARD_TILES
|
||||||
bcc collide_left_right ; blt
|
bcc collide_left_right ; blt
|
||||||
|
|
||||||
|
; fallthrough to get other
|
||||||
|
|
||||||
collide_head_r:
|
collide_head_r:
|
||||||
iny
|
iny
|
||||||
lda (INL),Y
|
lda (INL),Y
|
||||||
|
@ -221,14 +230,23 @@ collide_left_right:
|
||||||
; collide left/right
|
; collide left/right
|
||||||
;===================
|
;===================
|
||||||
|
|
||||||
|
|
||||||
clc
|
clc
|
||||||
lda KEEN_TILEY
|
lda KEEN_TILEY
|
||||||
adc #1
|
adc #1 ; look at feet
|
||||||
adc #>big_tilemap
|
|
||||||
|
tay
|
||||||
|
lda tilemap_lookup_high,Y
|
||||||
sta INH
|
sta INH
|
||||||
lda KEEN_TILEX
|
lda tilemap_lookup_low,Y
|
||||||
|
ora KEEN_TILEX
|
||||||
sta INL
|
sta INL
|
||||||
|
|
||||||
|
; adc #>big_tilemap
|
||||||
|
; sta INH
|
||||||
|
; lda KEEN_TILEX
|
||||||
|
; sta INL
|
||||||
|
|
||||||
lda KEEN_DIRECTION
|
lda KEEN_DIRECTION
|
||||||
beq done_keen_collide ; can this happen?
|
beq done_keen_collide ; can this happen?
|
||||||
|
|
||||||
|
@ -236,6 +254,12 @@ collide_left_right:
|
||||||
|
|
||||||
check_right_collide:
|
check_right_collide:
|
||||||
|
|
||||||
|
lda KEEN_TILEY
|
||||||
|
cmp #(MAX_TILE_X-1) ; stop at right edge of screen
|
||||||
|
beq keen_stop
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
; if KEEN_X=0, collide +1
|
; if KEEN_X=0, collide +1
|
||||||
; if KEEN_X=1, collide +2
|
; if KEEN_X=1, collide +2
|
||||||
|
|
||||||
|
@ -251,12 +275,17 @@ right_collide_noextra:
|
||||||
cmp #ALLHARD_TILES
|
cmp #ALLHARD_TILES
|
||||||
bcc done_keen_collide ; blt
|
bcc done_keen_collide ; blt
|
||||||
|
|
||||||
lda #1 ;
|
bcs keen_stop
|
||||||
sta SUPPRESS_WALK
|
; lda #1 ;
|
||||||
jmp done_keen_collide
|
; sta SUPPRESS_WALK
|
||||||
|
; jmp done_keen_collide
|
||||||
|
|
||||||
check_left_collide:
|
check_left_collide:
|
||||||
|
|
||||||
|
lda KEEN_TILEX ; stop at left edge of screen
|
||||||
|
beq keen_stop
|
||||||
|
|
||||||
|
|
||||||
ldy #0
|
ldy #0
|
||||||
lda (INL),Y
|
lda (INL),Y
|
||||||
|
|
||||||
|
@ -265,6 +294,7 @@ check_left_collide:
|
||||||
cmp #ALLHARD_TILES
|
cmp #ALLHARD_TILES
|
||||||
bcc done_keen_collide ; blt
|
bcc done_keen_collide ; blt
|
||||||
|
|
||||||
|
keen_stop:
|
||||||
lda #1
|
lda #1
|
||||||
sta SUPPRESS_WALK
|
sta SUPPRESS_WALK
|
||||||
jmp done_keen_collide
|
jmp done_keen_collide
|
||||||
|
@ -293,16 +323,17 @@ actually_jumping:
|
||||||
; check if hit top of screen (shouldn't happen if collision working)
|
; check if hit top of screen (shouldn't happen if collision working)
|
||||||
|
|
||||||
lda KEEN_TILEY ;
|
lda KEEN_TILEY ;
|
||||||
cmp #1 ; if hit top of screen, start falling
|
cmp #0 ; if hit top of screen, start falling
|
||||||
bcc start_falling
|
beq start_falling
|
||||||
|
|
||||||
lda TILEMAP_Y ; if tilemap==0, scroll keen
|
lda TILEMAP_Y ; if tilemap==0, move keen
|
||||||
cmp #0 ; instead of scrolling screen
|
cmp #0 ; instead of scrolling screen
|
||||||
beq keen_rising
|
beq keen_rising
|
||||||
|
|
||||||
sec
|
sec
|
||||||
lda TILEMAP_Y
|
lda KEEN_TILEY
|
||||||
sbc KEEN_TILEY
|
sbc TILEMAP_Y
|
||||||
|
|
||||||
|
|
||||||
cmp #4 ; compare to middle of screen
|
cmp #4 ; compare to middle of screen
|
||||||
bcc scroll_rising ; blt
|
bcc scroll_rising ; blt
|
||||||
|
@ -365,9 +396,14 @@ check_falling:
|
||||||
lda KEEN_TILEY
|
lda KEEN_TILEY
|
||||||
adc #2 ; point below feet
|
adc #2 ; point below feet
|
||||||
|
|
||||||
adc #>big_tilemap
|
tax
|
||||||
|
lda tilemap_lookup_high,X
|
||||||
|
|
||||||
|
; adc #>big_tilemap
|
||||||
sta INH
|
sta INH
|
||||||
lda #0
|
|
||||||
|
lda tilemap_lookup_low,X
|
||||||
|
; lda #0
|
||||||
sta INL
|
sta INL
|
||||||
|
|
||||||
ldy KEEN_TILEX
|
ldy KEEN_TILEX
|
||||||
|
@ -423,7 +459,7 @@ do_full_falling_check:
|
||||||
|
|
||||||
; if tilemap_y >= max_tile, keen_fall
|
; if tilemap_y >= max_tile, keen_fall
|
||||||
lda TILEMAP_Y
|
lda TILEMAP_Y
|
||||||
cmp #MAX_TILE_Y
|
cmp #(MAX_TILE_Y-6)
|
||||||
bcs keen_fall ; bge
|
bcs keen_fall ; bge
|
||||||
|
|
||||||
|
|
||||||
|
|
Binary file not shown.
|
@ -0,0 +1,57 @@
|
||||||
|
|
||||||
|
|
||||||
|
; we could calculate this if necessary
|
||||||
|
|
||||||
|
tilemap_lookup_high:
|
||||||
|
.byte (>big_tilemap)+ 0,(>big_tilemap)+ 0 ; 0,1
|
||||||
|
.byte (>big_tilemap)+ 1,(>big_tilemap)+ 1 ; 2,3
|
||||||
|
.byte (>big_tilemap)+ 2,(>big_tilemap)+ 2 ; 4,5
|
||||||
|
.byte (>big_tilemap)+ 3,(>big_tilemap)+ 3 ; 6,7
|
||||||
|
.byte (>big_tilemap)+ 4,(>big_tilemap)+ 4 ; 8,9
|
||||||
|
.byte (>big_tilemap)+ 5,(>big_tilemap)+ 5 ; 10,11
|
||||||
|
.byte (>big_tilemap)+ 6,(>big_tilemap)+ 6 ; 12,13
|
||||||
|
.byte (>big_tilemap)+ 7,(>big_tilemap)+ 7 ; 14,15
|
||||||
|
.byte (>big_tilemap)+ 8,(>big_tilemap)+ 8 ; 16,17
|
||||||
|
.byte (>big_tilemap)+ 9,(>big_tilemap)+ 9 ; 18,19
|
||||||
|
.byte (>big_tilemap)+10,(>big_tilemap)+10 ; 20,21
|
||||||
|
.byte (>big_tilemap)+11,(>big_tilemap)+11 ; 22,23
|
||||||
|
.byte (>big_tilemap)+12,(>big_tilemap)+12 ; 24,25
|
||||||
|
.byte (>big_tilemap)+13,(>big_tilemap)+13 ; 26,27
|
||||||
|
.byte (>big_tilemap)+14,(>big_tilemap)+14 ; 28,29
|
||||||
|
.byte (>big_tilemap)+15,(>big_tilemap)+15 ; 30,31
|
||||||
|
.byte (>big_tilemap)+16,(>big_tilemap)+16 ; 32,33
|
||||||
|
.byte (>big_tilemap)+17,(>big_tilemap)+17 ; 34,35
|
||||||
|
.byte (>big_tilemap)+18,(>big_tilemap)+18 ; 36,37
|
||||||
|
.byte (>big_tilemap)+19,(>big_tilemap)+19 ; 38,39
|
||||||
|
.byte (>big_tilemap)+20,(>big_tilemap)+20 ; 40,41
|
||||||
|
.byte (>big_tilemap)+21,(>big_tilemap)+21 ; 42,43
|
||||||
|
.byte (>big_tilemap)+22,(>big_tilemap)+22 ; 44,45
|
||||||
|
.byte (>big_tilemap)+23,(>big_tilemap)+23 ; 46,47
|
||||||
|
.byte (>big_tilemap)+24,(>big_tilemap)+24 ; 48,49
|
||||||
|
.byte (>big_tilemap)+25,(>big_tilemap)+25 ; 50,51
|
||||||
|
.byte (>big_tilemap)+26,(>big_tilemap)+26 ; 52,53
|
||||||
|
.byte (>big_tilemap)+27,(>big_tilemap)+27 ; 54,55
|
||||||
|
.byte (>big_tilemap)+28,(>big_tilemap)+28 ; 56,57
|
||||||
|
.byte (>big_tilemap)+29,(>big_tilemap)+29 ; 58,59
|
||||||
|
.byte (>big_tilemap)+30,(>big_tilemap)+30 ; 60,61
|
||||||
|
.byte (>big_tilemap)+31,(>big_tilemap)+31 ; 62,63
|
||||||
|
.byte (>big_tilemap)+32,(>big_tilemap)+32 ; 64,65
|
||||||
|
.byte (>big_tilemap)+33,(>big_tilemap)+33 ; 66,67
|
||||||
|
.byte (>big_tilemap)+34,(>big_tilemap)+34 ; 68,69
|
||||||
|
.byte (>big_tilemap)+35,(>big_tilemap)+35 ; 70,71
|
||||||
|
.byte (>big_tilemap)+36,(>big_tilemap)+36 ; 72,73
|
||||||
|
.byte (>big_tilemap)+37,(>big_tilemap)+37 ; 74,75
|
||||||
|
.byte (>big_tilemap)+38,(>big_tilemap)+38 ; 76,77
|
||||||
|
.byte (>big_tilemap)+39,(>big_tilemap)+39 ; 78,79
|
||||||
|
|
||||||
|
tilemap_lookup_low:
|
||||||
|
.byte $00,$80,$00,$80,$00,$80,$00,$80,$00,$80,$00,$80,$00,$80,$00,$80
|
||||||
|
.byte $00,$80,$00,$80,$00,$80,$00,$80,$00,$80,$00,$80,$00,$80,$00,$80
|
||||||
|
.byte $00,$80,$00,$80,$00,$80,$00,$80,$00,$80,$00,$80,$00,$80,$00,$80
|
||||||
|
.byte $00,$80,$00,$80,$00,$80,$00,$80,$00,$80,$00,$80,$00,$80,$00,$80
|
||||||
|
.byte $00,$80,$00,$80,$00,$80,$00,$80,$00,$80,$00,$80,$00,$80,$00,$80
|
||||||
|
.byte $00,$80,$00,$80,$00,$80,$00,$80,$00,$80,$00,$80,$00,$80,$00,$80
|
||||||
|
.byte $00,$80,$00,$80,$00,$80,$00,$80,$00,$80,$00,$80,$00,$80,$00,$80
|
||||||
|
.byte $00,$80,$00,$80,$00,$80,$00,$80,$00,$80,$00,$80,$00,$80,$00,$80
|
||||||
|
.byte $00,$80,$00,$80,$00,$80,$00,$80,$00,$80,$00,$80,$00,$80,$00,$80
|
||||||
|
.byte $00,$80,$00,$80,$00,$80,$00,$80,$00,$80,$00,$80,$00,$80,$00,$80
|
|
@ -203,13 +203,17 @@ init_vars:
|
||||||
;============================
|
;============================
|
||||||
; set up initial location
|
; set up initial location
|
||||||
|
|
||||||
lda #18
|
lda #10
|
||||||
|
sta MARS_TILEX
|
||||||
|
lda #34
|
||||||
|
sta MARS_TILEY
|
||||||
|
|
||||||
|
lda #0
|
||||||
sta MARS_X
|
sta MARS_X
|
||||||
lda #11
|
|
||||||
sta MARS_Y
|
sta MARS_Y
|
||||||
|
|
||||||
lda #LOAD_MARS
|
lda #LOAD_MARS
|
||||||
sta WHICH_LOAD ; start at first level
|
sta WHICH_LOAD ; assume new game (mars map)
|
||||||
|
|
||||||
rts
|
rts
|
||||||
|
|
||||||
|
|
|
@ -144,6 +144,7 @@ INITIAL_SOUND = $A4
|
||||||
PLAY_END_SOUND = $A5
|
PLAY_END_SOUND = $A5
|
||||||
APPLEII_MODEL = $A6
|
APPLEII_MODEL = $A6
|
||||||
CURRENT_LEVEL = $A7
|
CURRENT_LEVEL = $A7
|
||||||
|
ORACLE_SPOKEN = $A8
|
||||||
|
|
||||||
WHICH_SLOT = $DA
|
WHICH_SLOT = $DA
|
||||||
JS_BUTTON_STATE = $DB
|
JS_BUTTON_STATE = $DB
|
||||||
|
|
Loading…
Reference in New Issue