mirror of
https://github.com/deater/dos33fsprogs.git
synced 2025-01-13 22:30:49 +00:00
mist: add load game support
had to move around the ZP a bit. HGR in title messes with $7X addresses
This commit is contained in:
parent
46e173ab8d
commit
299f94ec89
12
linker_scripts/apple2_e00.inc
Normal file
12
linker_scripts/apple2_e00.inc
Normal file
@ -0,0 +1,12 @@
|
||||
MEMORY {
|
||||
ZP: start = $00, size = $1A, type = rw;
|
||||
RAM: start = $E00, size = $8E00, file = %O;
|
||||
}
|
||||
|
||||
SEGMENTS {
|
||||
CODE: load = RAM, type = ro, align = $100;
|
||||
RODATA: load = RAM, type = ro;
|
||||
DATA: load = RAM, type = rw;
|
||||
BSS: load = RAM, type = bss, define = yes;
|
||||
ZEROPAGE: load = ZP, type = zp;
|
||||
}
|
@ -12,7 +12,7 @@ zip: mist.dsk mist_side2.dsk
|
||||
zip mist.zip mist.dsk mist_side2.dsk
|
||||
|
||||
mist.dsk: HELLO LOADER MIST_TITLE MIST OCTAGON VIEWER \
|
||||
MECHE SELENA CABIN CHANNEL STONEY
|
||||
MECHE SELENA CABIN CHANNEL STONEY SAVE0
|
||||
cp empty.dsk mist.dsk
|
||||
$(DOS33) -y mist.dsk SAVE A HELLO
|
||||
$(DOS33) -y mist.dsk BSAVE -a 0x1000 LOADER
|
||||
@ -24,6 +24,7 @@ mist.dsk: HELLO LOADER MIST_TITLE MIST OCTAGON VIEWER \
|
||||
$(DOS33) -y mist.dsk BSAVE -a 0x2000 CABIN
|
||||
# $(DOS33) -y mist.dsk BSAVE -a 0x2000 VIEWER
|
||||
$(DOS33) -y mist.dsk BSAVE -a 0x2000 STONEY
|
||||
$(DOS33) -y mist.dsk BSAVE -a 0xe00 SAVE0
|
||||
$(DOS33) -y mist.dsk BSAVE -a 0x9000 ./audio/link_noise.btc LINK_NOISE.BTC
|
||||
|
||||
mist_side2.dsk: HELLO_DISK2 MECHE SELENA CHANNEL VIEWER ARBOR
|
||||
@ -49,6 +50,15 @@ loader.o: loader.s \
|
||||
|
||||
###
|
||||
|
||||
SAVE0: default_save.o
|
||||
ld65 -o SAVE0 default_save.o -C ../linker_scripts/apple2_e00.inc
|
||||
|
||||
default_save.o: default_save.s
|
||||
ca65 -o default_save.o default_save.s -l default_save.lst
|
||||
|
||||
|
||||
###
|
||||
|
||||
HELLO: hello.bas
|
||||
../asoft_basic-utils/tokenize_asoft < hello.bas > HELLO
|
||||
|
||||
|
@ -41,11 +41,11 @@ change_location =$1ac5
|
||||
move_and_print =$1b5d
|
||||
|
||||
; page_sprites.inc
|
||||
blue_page_sprite =$1cf4
|
||||
red_page_sprite =$1d40
|
||||
white_page_sprite =$1d56
|
||||
blue_page_small_sprite =$1d6c
|
||||
red_page_small_sprite =$1d74
|
||||
blue_page_sprite =$1d21
|
||||
red_page_sprite =$1d6d
|
||||
white_page_sprite =$1d83
|
||||
blue_page_small_sprite =$1d99
|
||||
red_page_small_sprite =$1da1
|
||||
|
||||
; audio files
|
||||
linking_noise = $9000
|
||||
|
63
mist/default_save.s
Normal file
63
mist/default_save.s
Normal file
@ -0,0 +1,63 @@
|
||||
.include "zp.inc"
|
||||
.include "common_defines.inc"
|
||||
|
||||
; want to load this to address $80
|
||||
|
||||
.byte LOAD_OCTAGON ; WHICH_LOAD = $80
|
||||
.byte DIRECTION_S ; DIRECTION = $81
|
||||
.byte OCTAGON_TEMPLE_CENTER ; LOCATION = $82
|
||||
.byte $00 ; RED_PAGES_TAKEN = $83
|
||||
.byte $00 ; BLUE_PAGES_TAKEN = $84
|
||||
.byte $00 ; CLOCK_BRIDGE = $85
|
||||
.byte $00 ; GEAR_OPEN = $86
|
||||
.byte $ff ; MARKER_SWITCHES = $87
|
||||
.byte $00 ; CLOCK_HOUR = $88
|
||||
.byte $00 ; CLOCK_MINUTE = $89
|
||||
.byte $00 ; TREE_FURNACE_ON = $8A
|
||||
.byte $00 ; FIREPLACE_GRID0 = $8B
|
||||
.byte $00 ; FIREPLACE_GRID1 = $8C
|
||||
.byte $00 ; FIREPLACE_GRID2 = $8D
|
||||
.byte $00 ; FIREPLACE_GRID3 = $8E
|
||||
.byte $00 ; FIREPLACE_GRID4 = $8F
|
||||
.byte $00 ; FIREPLACE_GRID5 = $90
|
||||
.byte $00 ; CLOCK_COUNT = $91
|
||||
.byte $00 ; CLOCK_TOP = $92
|
||||
.byte $00 ; CLOCK_MIDDLE = $93
|
||||
.byte $00 ; CLOCK_BOTTOM = $94
|
||||
.byte $00 ; CLOCK_LAST = $95
|
||||
|
||||
.byte $00 ; BREAKER_TRIPPED = $96
|
||||
.byte $00 ; GENERATOR_VOLTS = $97
|
||||
.byte $00 ; ROCKET_VOLTS = $98
|
||||
.byte $00 ; SWITCH_TOP_ROW = $99
|
||||
.byte $00 ; SWITCH_BOTTOM_ROW = $9A
|
||||
.byte $00 ; GENERATOR_VOLTS_DISP = $9B
|
||||
.byte $00 ; ROCKET_VOLTS_DISP = $9C
|
||||
.byte $00 ; ROCKET_HANDLE_STEP = $9D
|
||||
.byte $00 ; ROCKET_NOTE1 = $9E
|
||||
.byte $00 ; ROCKET_NOTE2 = $9F
|
||||
.byte $00 ; ROCKET_NOTE3 = $A0
|
||||
.byte $00 ; ROCKET_NOTE4 = $A1
|
||||
.byte $00 ; MECHE_ELEVATOR = $A2
|
||||
.byte $00 ; MECHE_ROTATION = $A3
|
||||
.byte $00 ; MECHE_LEVERS = $A4
|
||||
.byte $00 ; MECHE_LOCK1 = $A5
|
||||
.byte $00 ; MECHE_LOCK2 = $A6
|
||||
.byte $00 ; MECHE_LOCK3 = $A7
|
||||
.byte $00 ; MECHE_LOCK4 = $A8
|
||||
.byte $00 ; HOLDING_PAGE = $A9
|
||||
.byte $00 ; RED_PAGE_COUNT = $AA
|
||||
.byte $00 ; BLUE_PAGE_COUNT = $AB
|
||||
.byte $00 ; VIEWER_CHANNEL = $AC
|
||||
.byte $00 ; VIEWER_LATCHED = $AD
|
||||
.byte $00 ; TOWER_ROTATION = $AE
|
||||
.byte $00 ; SHIP_RAISED = $AF
|
||||
; stoneship
|
||||
.byte $00 ; PUMP_STATE = $B0
|
||||
.byte $00 ; BATTERY_CHARGE = $B1
|
||||
.byte $00 ; COMPASS_ANGLE = $B2
|
||||
.byte $00 ; CRANK_ANGLE = $B3
|
||||
.byte $00 ; WHITE_PAGE_TAKEN = $B4
|
||||
.byte $00 ; CHANNEL_SWITCHES = $B5
|
||||
.byte $00 ; CHANNEL_VALVES = $B6
|
||||
|
@ -6,10 +6,6 @@
|
||||
|
||||
.include "common_defines.inc"
|
||||
|
||||
; the TITLE program sets $05 with which thing to load
|
||||
; this part of the program stays resident, so when a level ends
|
||||
; it changes $05 (WHICH_LOAD) and this code loads the proper executable
|
||||
|
||||
nibtbl = $300 ; nothing uses the bottom 128 bytes of $300, do they?
|
||||
bit2tbl = $380 ; bit2tbl: .res 86 ; = nibtbl+128
|
||||
filbuf = $3D6 ; filbuf: .res 4 ; = bit2tbl+86
|
||||
@ -20,8 +16,7 @@ filbuf = $3D6 ; filbuf: .res 4 ; = bit2tbl+86
|
||||
; modified to assembled with ca65 -- vmw
|
||||
; added code to patch it to run from current disk slot -- vmw
|
||||
|
||||
|
||||
; WHICH_LOAD = $05 ; thing to load
|
||||
; WHICH_LOAD = $7E ; thing to load
|
||||
; adrlo = $26 ; constant from boot prom
|
||||
; adrhi = $27 ; constant from boot prom
|
||||
; tmpsec = $3c ; constant from boot prom
|
||||
|
@ -32,6 +32,34 @@ wait_load_confirmation:
|
||||
|
||||
bit KEYRESET ; clear keypress
|
||||
|
||||
and #$7f
|
||||
cmp #'Y'
|
||||
bne done_load
|
||||
|
||||
; actually load it
|
||||
|
||||
lda #<save_filename
|
||||
sta OUTL
|
||||
lda #>save_filename
|
||||
sta OUTH
|
||||
|
||||
jsr opendir_filename
|
||||
|
||||
; copy to zero page
|
||||
|
||||
ldx #0
|
||||
load_loop:
|
||||
lda $e00,X
|
||||
sta WHICH_LOAD,X
|
||||
inx
|
||||
cpx END_OF_SAVE
|
||||
bne load_loop
|
||||
|
||||
lda #$ff
|
||||
sta LEVEL_OVER
|
||||
|
||||
done_load:
|
||||
|
||||
bit SET_GR ; turn graphics back on
|
||||
|
||||
rts
|
||||
@ -42,6 +70,8 @@ wait_load_confirmation:
|
||||
;===================================
|
||||
;===================================
|
||||
|
||||
; doesn't do anything yet
|
||||
|
||||
save_game:
|
||||
bit KEYRESET ; clear keyboard buffer
|
||||
|
||||
@ -69,6 +99,16 @@ wait_save_confirmation:
|
||||
|
||||
bit KEYRESET ; clear keypress
|
||||
|
||||
and #$7f
|
||||
cmp #'Y'
|
||||
bne done_load
|
||||
|
||||
; actually load it
|
||||
|
||||
|
||||
done_store:
|
||||
|
||||
|
||||
bit SET_GR ; turn graphics back on
|
||||
|
||||
rts
|
||||
@ -86,3 +126,5 @@ save_message:
|
||||
are_you_sure:
|
||||
.byte 10,7,"ARE YOU SURE? (Y/N)",0
|
||||
|
||||
save_filename:
|
||||
.byte "SAVE0",0
|
||||
|
147
mist/zp.inc
147
mist/zp.inc
@ -2,7 +2,6 @@
|
||||
|
||||
;; LZSA addresses
|
||||
NIBCOUNT = $00
|
||||
WHICH_LOAD = $05
|
||||
|
||||
;; Zero page monitor routines addresses
|
||||
|
||||
@ -30,13 +29,27 @@ XMAX = $50
|
||||
|
||||
; MIST zero page addresses
|
||||
|
||||
FRAMEL = $60
|
||||
FRAMEH = $61
|
||||
CURSOR_X= $62
|
||||
CURSOR_Y= $63
|
||||
XPOS = $64
|
||||
YPOS = $65
|
||||
DIRECTION = $66
|
||||
FRAMEL = $60
|
||||
FRAMEH = $61
|
||||
CURSOR_X = $62
|
||||
CURSOR_Y = $63
|
||||
XPOS = $64
|
||||
YPOS = $65
|
||||
LOCATION_STRUCT_L = $66
|
||||
LOCATION_STRUCT_H = $67
|
||||
IN_SPECIAL = $68
|
||||
CURSOR_VISIBLE = $69
|
||||
IN_LEFT = $6A
|
||||
IN_RIGHT = $6B
|
||||
BTC_L = $6C
|
||||
BTC_H = $6D
|
||||
|
||||
|
||||
; We have to save/restore the following values
|
||||
; when loading/storing from disk
|
||||
|
||||
WHICH_LOAD = $80
|
||||
DIRECTION = $81
|
||||
DIRECTION_N = $1
|
||||
DIRECTION_S = $2
|
||||
DIRECTION_E = $4
|
||||
@ -44,30 +57,19 @@ DIRECTION = $66
|
||||
DIRECTION_ANY=$f
|
||||
DIRECTION_ONLY_POINT = $40 ; do not change pointer to grab
|
||||
DIRECTION_SPLIT = $80 ; split text/graphics
|
||||
LOCATION = $67
|
||||
LOCATION_STRUCT_L = $68
|
||||
LOCATION_STRUCT_H = $69
|
||||
IN_SPECIAL = $6A
|
||||
CURSOR_VISIBLE = $6B
|
||||
IN_LEFT = $6C
|
||||
IN_RIGHT = $6D
|
||||
BTC_L = $6E
|
||||
BTC_H = $6F
|
||||
LOCATION = $82
|
||||
|
||||
; If we ever support save to disk, we'd have to save/restore
|
||||
; the following values
|
||||
|
||||
RED_PAGES_TAKEN = $80
|
||||
RED_PAGES_TAKEN = $83
|
||||
OCTAGON_PAGE = 1
|
||||
MECHE_PAGE = 2
|
||||
SELENA_PAGE = 4
|
||||
STONEY_PAGE = 8
|
||||
CHANNEL_PAGE = 16
|
||||
FINAL_PAGE = 32
|
||||
BLUE_PAGES_TAKEN= $81
|
||||
CLOCK_BRIDGE = $82
|
||||
GEAR_OPEN = $83
|
||||
MARKER_SWITCHES = $84
|
||||
BLUE_PAGES_TAKEN= $84
|
||||
CLOCK_BRIDGE = $85
|
||||
GEAR_OPEN = $86
|
||||
MARKER_SWITCHES = $87
|
||||
MARKER_DOCK = $01
|
||||
MARKER_GEARS = $02
|
||||
MARKER_SPACESHIP = $04
|
||||
@ -77,69 +79,69 @@ MARKER_SWITCHES = $84
|
||||
MARKER_POOL = $40
|
||||
MARKER_DENTIST = $80
|
||||
|
||||
CLOCK_HOUR = $85
|
||||
CLOCK_MINUTE = $86
|
||||
TREE_FURNACE_ON = $87
|
||||
FIREPLACE_GRID0 = $88
|
||||
FIREPLACE_GRID1 = $89
|
||||
FIREPLACE_GRID2 = $8A
|
||||
FIREPLACE_GRID3 = $8B
|
||||
FIREPLACE_GRID4 = $8C
|
||||
FIREPLACE_GRID5 = $8D
|
||||
CLOCK_COUNT = $8E
|
||||
CLOCK_TOP = $8F
|
||||
CLOCK_MIDDLE = $90
|
||||
CLOCK_BOTTOM = $91
|
||||
CLOCK_LAST = $92
|
||||
CLOCK_HOUR = $88
|
||||
CLOCK_MINUTE = $89
|
||||
TREE_FURNACE_ON = $8A
|
||||
FIREPLACE_GRID0 = $8B
|
||||
FIREPLACE_GRID1 = $8C
|
||||
FIREPLACE_GRID2 = $8D
|
||||
FIREPLACE_GRID3 = $8E
|
||||
FIREPLACE_GRID4 = $8F
|
||||
FIREPLACE_GRID5 = $90
|
||||
CLOCK_COUNT = $91
|
||||
CLOCK_TOP = $92
|
||||
CLOCK_MIDDLE = $93
|
||||
CLOCK_BOTTOM = $94
|
||||
CLOCK_LAST = $95
|
||||
|
||||
BREAKER_TRIPPED = $93
|
||||
GENERATOR_VOLTS = $94
|
||||
ROCKET_VOLTS = $95
|
||||
SWITCH_TOP_ROW = $96
|
||||
SWITCH_BOTTOM_ROW = $97
|
||||
GENERATOR_VOLTS_DISP = $98
|
||||
ROCKET_VOLTS_DISP = $99
|
||||
ROCKET_HANDLE_STEP = $9A
|
||||
ROCKET_NOTE1 = $9B
|
||||
ROCKET_NOTE2 = $9C
|
||||
ROCKET_NOTE3 = $9D
|
||||
ROCKET_NOTE4 = $9E
|
||||
MECHE_ELEVATOR = $9F
|
||||
MECHE_ROTATION = $A0
|
||||
MECHE_LEVERS = $A1
|
||||
BREAKER_TRIPPED = $96
|
||||
GENERATOR_VOLTS = $97
|
||||
ROCKET_VOLTS = $98
|
||||
SWITCH_TOP_ROW = $99
|
||||
SWITCH_BOTTOM_ROW = $9A
|
||||
GENERATOR_VOLTS_DISP = $9B
|
||||
ROCKET_VOLTS_DISP = $9C
|
||||
ROCKET_HANDLE_STEP = $9D
|
||||
ROCKET_NOTE1 = $9E
|
||||
ROCKET_NOTE2 = $9F
|
||||
ROCKET_NOTE3 = $A0
|
||||
ROCKET_NOTE4 = $A1
|
||||
MECHE_ELEVATOR = $A2
|
||||
MECHE_ROTATION = $A3
|
||||
MECHE_LEVERS = $A4
|
||||
LEFT_LEVER = 1
|
||||
RIGHT_LEVER = 2
|
||||
MECHE_LOCK1 = $A2
|
||||
MECHE_LOCK2 = $A3
|
||||
MECHE_LOCK3 = $A4
|
||||
MECHE_LOCK4 = $A5
|
||||
HOLDING_PAGE = $A6
|
||||
MECHE_LOCK1 = $A5
|
||||
MECHE_LOCK2 = $A6
|
||||
MECHE_LOCK3 = $A7
|
||||
MECHE_LOCK4 = $A8
|
||||
HOLDING_PAGE = $A9
|
||||
HOLDING_RED_PAGE = $80
|
||||
HOLDING_BLUE_PAGE = $40
|
||||
HOLDING_WHITE_PAGE = $C0
|
||||
RED_PAGE_COUNT = $A7
|
||||
BLUE_PAGE_COUNT = $A8
|
||||
VIEWER_CHANNEL = $A9
|
||||
VIEWER_LATCHED = $AA
|
||||
TOWER_ROTATION = $AB
|
||||
RED_PAGE_COUNT = $AA
|
||||
BLUE_PAGE_COUNT = $AB
|
||||
VIEWER_CHANNEL = $AC
|
||||
VIEWER_LATCHED = $AD
|
||||
TOWER_ROTATION = $AE
|
||||
ROTATION_GEARS = 2
|
||||
ROTATION_DOCK = 3
|
||||
ROTATION_TREE = 4
|
||||
ROTATION_SPACESHIP = 8
|
||||
SHIP_RAISED = $AC
|
||||
SHIP_RAISED = $AF
|
||||
; stoneship
|
||||
PUMP_STATE = $AD
|
||||
BATTERY_CHARGE = $AE
|
||||
COMPASS_ANGLE = $AF
|
||||
CRANK_ANGLE = $B0
|
||||
WHITE_PAGE_TAKEN= $B1
|
||||
CHANNEL_SWITCHES= $B2
|
||||
PUMP_STATE = $B0
|
||||
BATTERY_CHARGE = $B1
|
||||
COMPASS_ANGLE = $B2
|
||||
CRANK_ANGLE = $B3
|
||||
WHITE_PAGE_TAKEN= $B4
|
||||
CHANNEL_SWITCHES= $B5
|
||||
CHANNEL_BRIDGE_UP = $01
|
||||
CHANNEL_PIPE_EXTENDED = $02
|
||||
CHANNEL_BOOK_ELEVATOR_UP= $04
|
||||
CHANNEL_SW_WINDMILL = $40
|
||||
CHANNEL_SW_FAUCET = $80
|
||||
CHANNEL_VALVES = $B3
|
||||
CHANNEL_VALVES = $B6
|
||||
CHANNEL_VALVE1 = $01
|
||||
CHANNEL_VALVE2 = $02
|
||||
CHANNEL_VALVE3 = $04
|
||||
@ -147,6 +149,7 @@ CHANNEL_VALVES = $B3
|
||||
CHANNEL_VALVE5 = $10
|
||||
CHANNEL_VALVE6 = $20
|
||||
|
||||
END_OF_SAVE = $B7
|
||||
|
||||
|
||||
; done game puzzle state
|
||||
|
Loading…
x
Reference in New Issue
Block a user