Compare commits

...

6 Commits

Author SHA1 Message Date
Vince Weaver 5eb3f4fa4b keen: start at starting point on mars 2024-04-14 01:40:45 -04:00
Vince Weaver abc06c0a9d keen: work on level2 2024-04-14 01:30:46 -04:00
Vince Weaver 6271105aa6 keen: can actually enter level1 again
it's currently broken though
2024-04-13 12:24:35 -04:00
Vince Weaver 7edd5d75f3 keen: can now enter locations 2024-04-13 12:13:36 -04:00
Vince Weaver 62c01b77c4 keen: fix fade-in 2024-04-13 11:16:43 -04:00
Vince Weaver be968a1ad1 keen: updated mars map
no unknown pixels
2024-04-13 11:11:41 -04:00
6 changed files with 269 additions and 58 deletions

View File

@ -1,7 +1,25 @@
title
~~~~~
+ menu
+ load/save game
+ credits?
mars map
~~~~~~~~
+ enforce collision detection
+ proper smooth movement
+ transporters
+ start at starting point
+ show keens left at start, also when press ??
+ mark completed levels
level1
~~~~~~
+ fix so works again
sound effects sound effects
~~~~~~~~~~~~~ ~~~~~~~~~~~~~
+ shorten item pickup noise + effect for transporter
+ game over noise if you quit too?
movement: movement:
~~~~~~~~~ ~~~~~~~~~
@ -9,28 +27,27 @@ movement:
enemies enemies
~~~~~~~ ~~~~~~~
+ allow stepping on head
+ disable when not on screen? + disable when not on screen?
+ enemies besides yorps
shooting
~~~~~~~~
+ collision with enemies
+ shoot enemies
pogo
~~~~
+ implement
lo-res version lo-res version
~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~
+ improve keyboard handling on Apple IIe
+ walk behind some sprites (columns on level1) + walk behind some sprites (columns on level1)
+ fix keybindings/help menu + better animations
+ better start/stop level music
+ animate death
+ game over screen if out of lives + game over screen if out of lives
hi-res version hi-res version
~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~
+ +
mars
~~~~
+ convert to full tilemap
+ mark completed levels
title
~~~~~
+ actual menu?

View File

@ -5,7 +5,9 @@ ZX02 = ~/research/6502_compression/zx02.git/build/zx02 -f
PNG2GR = ../../../utils/gr-utils/png2gr PNG2GR = ../../../utils/gr-utils/png2gr
all: level1_map.zx02 png2map mars_map.gr.zx02 mars_new.zx02 all: png2map \
level1_map.zx02 level2_map.zx02 \
mars_map.gr.zx02 mars_new.zx02
### ###
@ -15,6 +17,15 @@ level1_map.zx02: level1_map.inc
level1_map.inc: level1_map.png png2map level1_map.inc: level1_map.png png2map
./png2map level1_map.png level1_map.inc ./png2map level1_map.png level1_map.inc
###
level2_map.zx02: level2_map.inc
$(ZX02) level2_map.inc level2_map.zx02
level2_map.inc: level2_map.png png2map
./png2map level2_map.png level2_map.inc
### ###

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 9.8 KiB

View File

@ -15,8 +15,7 @@ TILE_COLS = 20 ; define this elsewhere?
mars_start: mars_start:
;=================== ;===================
; init screen ; init screen
; jsr TEXT
; jsr HOME
bit KEYRESET bit KEYRESET
bit SET_GR bit SET_GR
@ -24,12 +23,14 @@ mars_start:
bit LORES bit LORES
bit FULLGR bit FULLGR
jsr clear_all ; avoid grey stripes at load lda #0 ; clear screens
sta clear_all_color+1
jsr clear_all
lda KEENS lda KEENS ; check if out of lives
bpl plenty_of_keens bpl plenty_of_keens
jmp return_to_title jmp return_to_title ; if none, game over
plenty_of_keens: plenty_of_keens:
@ -38,25 +39,27 @@ plenty_of_keens:
;===================== ;=====================
lda #0 lda #0
sta ANIMATE_FRAME
sta FRAMEL sta FRAMEL
sta FRAMEH sta FRAMEH
lda #4 lda #4
sta DRAW_PAGE sta DRAW_PAGE
; see if returning and it game over ; see if returning and if game over
lda LEVEL_OVER lda LEVEL_OVER
cmp #GAME_OVER cmp #GAME_OVER
beq return_to_title
bne not_game_over
jmp return_to_title
not_game_over:
; TODO: set this in title, don't over-write ; TODO: set this in title, don't over-write
lda #1 lda #10
sta MARS_TILEX sta MARS_TILEX
lda #6 lda #34
sta MARS_TILEY sta MARS_TILEY
lda #0 lda #0
@ -81,15 +84,42 @@ plenty_of_keens:
; FIXME: start values ; FIXME: start values
; center around MARS_TILEX, MARS_TILEY ; center around MARS_TILEX, MARS_TILEY
lda MARS_TILEX lda #0 ; default at 0,0
sta TILEMAP_X sta TILEMAP_X
lda MARS_TILEY
sta TILEMAP_Y sta TILEMAP_Y
lda MARS_TILEX
cmp #10
bcc mars_tilex_fine
sec
sbc #10
sta TILEMAP_X
mars_tilex_fine:
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
pha
lda #8
sta DRAW_PAGE
jsr draw_tilemap
pla
sta DRAW_PAGE
lda #1 lda #1
sta INITIAL_SOUND sta INITIAL_SOUND
@ -129,14 +159,17 @@ mars_loop:
inc FRAMEH inc FRAMEH
no_frame_oflo: no_frame_oflo:
lda FRAMEL
lsr ; rotate star colors
lsr
lsr ; lda FRAMEL
and #$7 ; lsr
tay ; lsr
lda star_colors,Y ; lsr
sta $F28 ; 0,28 ; and #$7
; tay
; lda star_colors,Y
; sta $F28 ; 0,28
;=========================== ;===========================
; check end of level ; check end of level
@ -183,7 +216,11 @@ done_with_keen:
jsr fade_out jsr fade_out
lda #LOAD_KEEN1 ; set up proper level to load
clc
lda CURRENT_LEVEL
adc #2 ; skip title and mars
sta WHICH_LOAD sta WHICH_LOAD
rts ; exit back rts ; exit back
@ -371,48 +408,193 @@ done_parts:
;==================================== ;====================================
;==================================== ;====================================
; Mars action ; Mars action (enter pressed on map)
;==================================== ;====================================
;==================================== ;====================================
; if enter pressed on map ; if enter pressed on map
; off by one so the levels can fit in a two byte bitmap
;
; location tilex,tiley size
; 0 level1 (Border Town) 19,37 2
; 1 level2 (First Shrine) 22,28 1
; 2 level3 (Treasury) 9,21 2
; 3 level4 (Capital City) 22,23 2
; 4 level5 (Pogo Shrine) 13,16 1
; 5 level6 (Second Shrine) 16,11 1
; 6 level7 (Emerald City) 25,8 2
; 7 level8 (Ice City) 38,3 2
; 8 level9 (Third Shrine) 36,13 1
; 9 level10 (Ice Shrine 1) 43,5 1
; 10 level11 (Fourth Shrine) 52,16 1
; 11 level12 (Fifth Shrine) 36,21 1
; 12 level13 (Red Maze City) 44,24 2
; 13 level14 (Secret City) 60,28 2
; 14 level15 (Ice Shrine 2) 38,60 1
; 15 level16 (Vorticon Castle) 29,59 2
; 16 spaceship 10,37 1
; 17 left transporter 26,4 1
; 18 right transporter 34,3 1
; 19 secret transporter 60,35 1
NUM_LOCATIONS = 20
do_action: do_action:
lda MARS_X ldx #NUM_LOCATIONS
cmp #15
bcc do_nothing ; blt
cmp #20 do_action_loop:
bcc maybe_ship
cmp #35 ; mtx-ltx
bcs maybe_exit ; -1 0 1 2
; 1234 1234 1234 1234
; XYY XY YX YYX
; YY YY YY YY
check_location_x:
sec
lda MARS_TILEX
sbc location_x,X
bmi check_location_nomatch
cmp location_size,X
bcs check_location_nomatch
check_location_y:
; mty-lty
; -2 -1 0 1 2
; 0 X
; 1 X X
; 2 YY YX YX YY YY
; 3 YY YY YX YX YY
; 4 X X
; 5 X
clc
lda MARS_TILEY
adc #1
sec
sbc location_y,X
bmi check_location_nomatch
cmp location_size,X
bcc check_location_match
; bcs check_location_nomatch
check_location_nomatch:
dex
bpl do_action_loop
do_nothing:
; TODO: make sound?
rts rts
maybe_ship: check_location_match:
; jump table
lda location_actions_high,X
pha
lda location_actions_low,X
pha
rts ; jump
lda MARS_Y ; lda MARS_X
cmp #16 ; cmp #15
bcc do_nothing ; bcc do_nothing ; blt
cmp #24 ; cmp #20
bcs do_nothing ; 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
jmp do_parts ; tail call
maybe_exit:
;=====================================
;=====================================
; placeholder until action imlpemented
;=====================================
;=====================================
dummy_action:
rts
;=====================================
;=====================================
; enter level
;=====================================
;=====================================
; level number is in X
enter_level:
stx CURRENT_LEVEL
inc LEVEL_OVER inc LEVEL_OVER
rts rts
location_x:
.byte 19,22, 9,22,13,16,25,38
.byte 36,43,52,36,44,60,38,29
.byte 10,26,34,60
star_colors: location_y:
.byte $05,$07,$07,$0f .byte 37,28,21,23,16,11, 8, 3
.byte $0f,$07,$05,$0a .byte 13, 5,16,21,24,28,60,59
.byte 37, 4, 3,35
location_size:
.byte 2,1,2,2,1,1,2,2
.byte 1,1,1,1,2,2,1,2
.byte 1,1,1,1
location_actions_low:
.byte <(enter_level-1),<(dummy_action-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)
.byte <(dummy_action-1),<(dummy_action-1)
.byte <(do_parts-1),<(dummy_action-1) ; ship, l transport
.byte <(dummy_action-1),<(dummy_action-1) ; r trans, secret
location_actions_high:
.byte >(enter_level-1),>(dummy_action-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)
.byte >(dummy_action-1),>(dummy_action-1)
.byte >(do_parts-1),>(dummy_action-1) ; ship, l transport
.byte >(dummy_action-1),>(dummy_action-1) ; r trans, secret
;star_colors:
; .byte $05,$07,$07,$0f
; .byte $0f,$07,$05,$0a

View File

@ -143,6 +143,7 @@ MARS_TILEY = $A3
INITIAL_SOUND = $A4 INITIAL_SOUND = $A4
PLAY_END_SOUND = $A5 PLAY_END_SOUND = $A5
APPLEII_MODEL = $A6 APPLEII_MODEL = $A6
CURRENT_LEVEL = $A7
WHICH_SLOT = $DA WHICH_SLOT = $DA
JS_BUTTON_STATE = $DB JS_BUTTON_STATE = $DB