Skip to content

Commit 20e4012

Browse files
committed
remove some one-off asm usage, fix turnkey for save/restore
1 parent 10d5400 commit 20e4012

7 files changed

Lines changed: 19 additions & 6 deletions

File tree

Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,11 @@ excursions = $(wildcard tests/excursion*.txt)
4040

4141
tests: $(patsubst %.txt,%.fs.log,$(excursions)) $(patsubst %.txt,%.c.log,$(excursions))
4242

43+
tests/excursion6.fs.log: tests/excursion5.fs.log
44+
tests/excursion5.fs.log: tests/excursion3.fs.log # there is no 4
45+
tests/excursion3.fs.log: tests/excursion2.fs.log
46+
tests/excursion2.fs.log: tests/excursion1.fs.log
47+
4348
.FORCE:
4449

4550
%.fs.log: %.txt .FORCE

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ into high memory from the block device and compiles it, using about 19K.
7171
The source is discarded and the data file is written above the code
7272
aligned to the end of RAM. This leaves the game ready to play.
7373

74-
Currently the loader also dumps the entire 64K memory image back to the block devic
74+
Currently the loader also dumps the entire 64K memory image back to the block device
7575
in order to support simulator play without compilation or block storage.
7676

7777
HOW IT WORKS

data/advent.rom

0 Bytes
Binary file not shown.

src/advent.fs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@
3737
abort
3838
;
3939

40+
: lower ( addr len -- ) bounds ?do i c@ $20 or i c! loop ;
41+
4042
\ database.c:pct
4143
: pct ( n -- flag ) \ true with percent n
4244
100 randint <

src/boot.fs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,6 @@ ADVDAT $fc00 and $400 + {data_blk} 1+ {data_blocks} 1- block-read-n
4747

4848
\ save turnkey entry point and dump image
4949
' play $fff8 !
50-
\ bump reset vector +3 to do warm start
51-
$fffc @ 3 + $fffc !
5250
0 64 64 block-write-n
5351
\ leave the XT to execute once string eval is complete
5452
' play

src/item.fs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
\ each item is simply a concatenated list of 0-terminated terminated
1+
\ each item is simply a concatenated list of 0-terminated compressed strings
22
\ the first string is found in the ITEMS& array,
33
\ subsequent strings are found by skipping past ascii zeros
44

@@ -7,7 +7,15 @@
77
: say-item ( i state -- )
88
1+ swap 1- 2* ITEMS& + @ ITEMS + swap \ first item string
99
( strz state+1 )
10-
begin ?dup while 1- swap asciiz> + 1+ swap repeat \ skip state+1 strings
10+
begin
11+
?dup while
12+
1- swap
13+
( state strz )
14+
begin
15+
dup 1+ swap c@ while
16+
repeat
17+
swap
18+
repeat \ skip state+1 strings
1119
sayz
1220
;
1321

src/message.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
\ english.c:getwords
1212
: user-input ( -- addr n )
13-
." > " $400 dup 127 accept tolower CR
13+
." > " $400 dup 127 accept 2dup lower CR
1414
;
1515

1616
\ optionally prompt user and respond to a yes/no question returning flag

0 commit comments

Comments
 (0)