lemm: split off level5 as well

This commit is contained in:
Vince Weaver 2022-03-17 14:33:18 -04:00
parent 5d0e4bd7fd
commit c206b666ee
7 changed files with 99 additions and 50 deletions

View File

@ -18,7 +18,8 @@ all: lemm.dsk
# $(DOS33) -y lemm.dsk BSAVE -a 0x4000 LEMM_TEST
lemm.dsk: QBOOT QLOAD LEMM LEVEL1
lemm.dsk: QBOOT QLOAD LEMM \
LEVEL1 LEVEL5
cp $(EMPTY_DISK) lemm.dsk
$(DOS33_RAW) lemm.dsk 0 0 QBOOT 0 1
$(DOS33_RAW) lemm.dsk 0 2 QBOOT 1 1
@ -26,6 +27,7 @@ lemm.dsk: QBOOT QLOAD LEMM LEVEL1
$(DOS33_RAW) lemm.dsk 1 0 QLOAD 0 0
$(DOS33_RAW) lemm.dsk 3 0 LEMM 0 0
$(DOS33_RAW) lemm.dsk 10 0 LEVEL1 0 0
$(DOS33_RAW) lemm.dsk 18 0 LEVEL5 0 0
###
@ -42,7 +44,8 @@ QLOAD: qload.o
ld65 -o QLOAD qload.o -C $(LINKER_SCRIPTS)/apple2_1200.inc
qload.o: qload.s qboot.inc \
audio.s decompress_fast_v2.s gr_offsets.s
audio.s decompress_fast_v2.s gr_offsets.s \
wait.s wait_a_bit.s
ca65 -o qload.o qload.s -l qload.lst
###
@ -52,6 +55,9 @@ qload.inc: generate_common QLOAD
./generate_common -a 0x1200 -s play_audio qload.lst >> qload.inc
./generate_common -a 0x1200 -s decompress_lzsa2_fast qload.lst >> qload.inc
./generate_common -a 0x1200 -s getsrc_smc qload.lst >> qload.inc
./generate_common -a 0x1200 -s gr_offsets qload.lst >> qload.inc
./generate_common -a 0x1200 -s wait qload.lst >> qload.inc
./generate_common -a 0x1200 -s wait_a_bit qload.lst >> qload.inc
###
@ -81,7 +87,7 @@ lemm.o: lemm.s zp.inc hardware.inc qload.inc \
hgr_hlin.s hgr_vlin.s update_menu.s \
interrupt_handler.s keyboard.s draw_pointer.s \
pointer_sprites.inc particle_hgr.s \
level5.s title.s audio.s letsgo.s
title.s audio.s letsgo.s
ca65 -o lemm.o lemm.s -l lemm.lst
@ -105,14 +111,16 @@ lemm.inc: generate_common LEMM
./generate_common -a 0x6000 -s erase_lemming lemm.lst >> lemm.inc
./generate_common -a 0x6000 -s update_time lemm.lst >> lemm.inc
./generate_common -a 0x6000 -s draw_door lemm.lst >> lemm.inc
./generate_common -a 0x6000 -s draw_door_5 lemm.lst >> lemm.inc
./generate_common -a 0x6000 -s draw_flames lemm.lst >> lemm.inc
./generate_common -a 0x6000 -s draw_pointer lemm.lst >> lemm.inc
./generate_common -a 0x6000 -s erase_pointer lemm.lst >> lemm.inc
./generate_common -a 0x6000 -s handle_keypress lemm.lst >> lemm.inc
./generate_common -a 0x6000 -s wait lemm.lst >> lemm.inc
./generate_common -a 0x6000 -s disable_music lemm.lst >> lemm.inc
./generate_common -a 0x6000 -s outro_level1 lemm.lst >> lemm.inc
./generate_common -a 0x6000 -s update_lemmings_out lemm.lst >> lemm.inc
./generate_common -a 0x6000 -s level_preview_h_smc lemm.lst >> lemm.inc
./generate_common -a 0x6000 -s level_preview_l_smc lemm.lst >> lemm.inc
@ -125,6 +133,16 @@ level1.o: level1.s zp.inc hardware.inc qload.inc lemm.inc \
graphics/graphics_level1.inc
ca65 -o level1.o level1.s -l level1.lst
####
LEVEL5: level5.o
ld65 -o LEVEL5 level5.o -C ../../linker_scripts/apple2_a000.inc
level5.o: level5.s zp.inc hardware.inc qload.inc lemm.inc \
graphics/graphics_level5.inc
ca65 -o level5.o level5.s -l level5.lst
####

View File

@ -24,6 +24,9 @@ Plan:
level data
number of lemmings
number needed to win (percent? percent is hard)
lemming_start_x
lemming_start_y
lemming_start_direction
location of entrance door
entrace door type
location of exit door

View File

@ -9,22 +9,12 @@ intro_level:
jsr clear_all
lda WHICH_LEVEL
cmp #1
bne its_level_5_preview
its_level_1_preview:
lda #<level1_preview_lzsa
sta getsrc_smc+1 ; LZSA_SRC_LO
lda #>level1_preview_lzsa
jmp done_load_preview
its_level_5_preview:
lda #<level5_preview_lzsa
sta getsrc_smc+1 ; LZSA_SRC_LO
lda #>level5_preview_lzsa
done_load_preview:
level_preview_l_smc:
lda #$DD
sta getsrc_smc+1 ; LZSA_SRC_LO
level_preview_h_smc:
lda #$DD
sta getsrc_smc+2 ; LZSA_SRC_HI
lda #$20

View File

@ -13,6 +13,9 @@ lemm_test_start:
lda #0
sta DRAW_PAGE
lda #1
sta WHICH_LEVEL
;====================
; show title message
;====================
@ -224,36 +227,37 @@ zurg:
lda #25
jsr wait_a_bit
;=======================
; do level
;=======================
play_level:
; load level from disk
lda #1
lda WHICH_LEVEL ; FIXME: don't reload if already right
; maybe put level# at $a000?
sta WHICH_LOAD
jsr load_file
;=======================
; do level1
;=======================
play_level1:
jsr do_level1
jsr start_level
lda LEVEL_OVER
cmp #LEVEL_WIN
beq play_level5
bne play_level1
beq level_won
bne level_lost
level_won:
; inc WHICH_LEVEL
;=======================
; do level5
;=======================
lda #5
sta WHICH_LEVEL
play_level5:
jsr do_level5
level_lost:
jmp play_level
lda LEVEL_OVER
cmp #LEVEL_WIN
beq play_level1
bne play_level5
@ -265,10 +269,10 @@ play_level5:
load_song_chunk:
ldx CURRENT_CHUNK
chunk_l_smc:
lda music6_parts_l,X
lda $DDDD,X
sta getsrc_smc+1 ; LZSA_SRC_LO
chunk_h_smc:
lda music6_parts_h,X
lda $DDDD,X
sta getsrc_smc+2 ; LZSA_SRC_HI
bne load_song_chunk_good
@ -294,8 +298,8 @@ load_song_chunk_good:
; includes
;==========================
.include "gr_offsets.s"
; .include "decompress_fast_v2.s"
.include "wait_keypress.s"
@ -327,12 +331,19 @@ load_song_chunk_good:
.include "hgr_hlin.s"
.include "hgr_vlin.s"
.include "update_menu.s"
.include "wait_a_bit.s"
.include "title.s"
; .include "audio.s"
.include "letsgo.s"
.include "particle_hgr.s"
.include "wait.s"
; moved to qload.s
; .include "wait.s"
; .include "wait_a_bit.s"
; .include "audio.s"
; .include "decompress_fast_v2.s"
; .include "gr_offsets.s"
; pt3 player
@ -355,7 +366,8 @@ letsgo:
.incbin "sounds/letsgo.btc.lz4"
; .include "level1.s"
.include "level5.s"
; .include "level5.s"
start_level = $a000
do_level1 = $a000
level1_preview_lzsa = $b06b

View File

@ -7,6 +7,15 @@
do_level1:
;==============
; set up intro
;==============
lda #<level1_preview_lzsa
sta level_preview_l_smc+1
lda #>level1_preview_lzsa
sta level_preview_h_smc+1
;==============
; set up music
;==============
@ -48,8 +57,8 @@ do_level1:
; show title screen
;=======================
lda #1
sta WHICH_LEVEL
; lda #1
; sta WHICH_LEVEL
jsr intro_level
;=======================

View File

@ -1,6 +1,21 @@
.include "zp.inc"
.include "hardware.inc"
.include "lemm.inc"
.include "lemming_status.inc"
.include "qload.inc"
do_level5:
;==============
; set up intro
;==============
lda #<level5_preview_lzsa
sta level_preview_l_smc+1
lda #>level5_preview_lzsa
sta level_preview_h_smc+1
;==============
; set up music
;==============

View File

@ -185,6 +185,8 @@ length_array:
.byte 32, 32, 32, 32 ;
.include "wait.s"
.include "wait_a_bit.s"
.include "audio.s"
.include "decompress_fast_v2.s"
.include "gr_offsets.s"