peasant: load game sorta works

This commit is contained in:
Vince Weaver 2021-09-27 00:33:24 -04:00
parent 5f7326d92f
commit 3af233d53e
5 changed files with 34 additions and 21 deletions

View File

@ -17,16 +17,17 @@ $00 Zero Page
$01 Stack
$02 Disk Lookup
$03 Disk Lookup, IRQ vectors
$04-$07 Text/GR page 1 (not used?)
$04-$07 Text/GR page 1 (priority map)
$08-$0B Text/GR page 2. $08=boot, $09-$0A = qboot stage2
$0B-$1F QLOAD disk routines and Mockingboard sound routines here
$0B-$1F QLOAD disk routines and HGR drawing routines
$20-$3F HGR Page 1
$40-$5f HGR Page 2
$60-$?? Programs (roughly 22k available?)
$B8-$BB Hi-res lookup tables
$BC-$BF ???
$BC temp area for load/save files
$BD-$BF ???
$C0-$CF I/O
$D0-$FF ROM
$D0-$DF (BANK2) Mockingboard music/PT3-routines
Disk1 Map (disk has 35 tracks, each 4k in size)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

View File

@ -287,10 +287,19 @@ ls_check_return:
bne ls_done_moving
ls_return:
; do actual load
ldy INVENTORY_Y
cpy #3
bne do_actual_load
; back was hit
rts
; jmp draw_inv_box
do_actual_load:
jmp load_game
ls_done_moving:
@ -401,10 +410,6 @@ overwrite_loop_ls:
rts
.if 0
;===================================
;===================================
; load the game
@ -412,6 +417,8 @@ overwrite_loop_ls:
;===================================
load_game:
; FIXME: print are you sure message
; lda #<load_message
; sta OUTL
; lda #>load_message
@ -422,6 +429,7 @@ load_game:
; bcs done_load
; actually load it
tya
clc
adc #LOAD_SAVE1
sta WHICH_LOAD
@ -432,21 +440,20 @@ load_game:
ldx #0
load_loop:
lda $e00,X
lda $BC00,X
sta WHICH_LOAD,X
inx
cpx #(END_OF_SAVE-WHICH_LOAD+1)
bne load_loop
lda #$ff
sta LEVEL_OVER
sta GAME_OVER
done_load:
bit SET_GR ; turn graphics back on
rts
.if 0
;===================================
;===================================
; save the game

View File

@ -193,7 +193,7 @@ which_disk_array:
.byte 2,2,1,1 ; TROGDOR, ENDING, MUSIC
.byte 1,1,1,1 ;
.byte 1 ;
.byte 1,1,1,1,1 ;
.byte 1,1,1,1,1 ; SAVE1, SAVE2, SAVE3
.byte $f ;
load_address_array:
@ -202,7 +202,7 @@ load_address_array:
.byte $60,$60,$D0,$40 ; TROGDOR, ENDING, MUSIC
.byte $40,$40,$40,$40 ;
.byte $08 ;
.byte $0A,$0A,$0A,$0A ;
.byte $BC,$BC,$BC,$0A ; SAVE1, SAVE2, SAVE3
.byte $0A ;
.byte $08 ;
@ -212,7 +212,7 @@ track_array:
.byte 24,29, 3,20 ; TROGDOR, ENDING, MUSIC
.byte 30,32,28,30 ;
.byte 0 ;
.byte 0, 0, 0, 0, 0 ;
.byte 0, 0, 0, 0, 0 ; SAVE1, SAVE2, SAVE3
.byte 0 ;
sector_array:
@ -221,7 +221,7 @@ sector_array:
.byte 0, 0, 0, 0 ; TROGDOR, ENDING, MUSIC
.byte 0,13, 0, 1 ;
.byte 6 ;
.byte 11,12,13,14,15 ;
.byte 11,12,13,14,15 ; SAVE1, SAVE2, SAVE3
.byte 0 ;
length_array:
@ -230,7 +230,7 @@ length_array:
.byte 80, 80, 16,109 ; TROGDOR, ENDING, MUSIC
.byte 20, 33, 27, 78 ;
.byte 3 ;
.byte 1,1,1,1,1 ;
.byte 1,1,1,1,1 ; SAVE1, SAVE2, SAVE3
.byte 1 ;
.include "qkumba_popwr.s"

View File

@ -11,7 +11,7 @@
.byte PEASANT_DIR_UP ; PEASANT_DIR = $93
.byte 0 ; MAP_X = $94
.byte 1 ; MAP_Y = $95
.byte 5 ; MAP_LOCATION = $96
.byte LOCATION_HAY_BALE ; MAP_LOCATION = $96
.byte $ff ; GAME_STATE_0 = $97
.byte $00 ; GAME_STATE_1 = $98
.byte $00 ; GAME_STATE_2 = $99

View File

@ -167,7 +167,7 @@ INVENTORY_3 = $A2
INVENTORY_1_GONE = $A3 ; had item, but now it's gone
INVENTORY_2_GONE = $A4
INVENTORY_3_GONE = $A5
END_OF_SAVE = $A6
INPUT_X = $C0
BOX_X1L = $C1
@ -216,6 +216,11 @@ LOAD_TROGDOR = 8
LOAD_ENDING = 9
LOAD_MUSIC = 10
LOAD_SAVE1 = 17
LOAD_SAVE2 = 18
LOAD_SAVE3 = 19
VGI_RCOLOR = P0
VGI_RX1 = P1
VGI_RY1 = P2