ff snapshot

This commit is contained in:
~d6 2022-08-25 23:36:56 -04:00
parent 1cb81a2605
commit 29f28985a4
1 changed files with 51 additions and 33 deletions

84
ff.tal
View File

@ -33,34 +33,34 @@
#0cd5 .System/g DEO2
#0b66 .System/b DEO2
#0000 #0000 #1e #0c ;draw-box JSR2
#0000 #0070 #09 #0c ;draw-box JSR2
#0058 #0070 #08 #0c ;draw-box JSR2
#00a8 #0070 #09 #0c ;draw-box JSR2
#0000 #0000 #1e #10 ;draw-box JSR2
#0000 #0090 #09 #08 ;draw-box JSR2
#0058 #0090 #08 #08 ;draw-box JSR2
#00a8 #0090 #09 #08 ;draw-box JSR2
#00e0 #0008 ;goto JSR2 #03 ;draw-sprite-23 JSR2
#00e0 #0020 ;goto JSR2 #07 ;draw-sprite-23 JSR2
#00e0 #0038 ;goto JSR2 #11 ;draw-sprite-23 JSR2
#00e0 #0050 ;goto JSR2 #0a ;draw-sprite-23 JSR2
#00d8 #0028 ;goto JSR2 #03 ;draw-sprite-23 JSR2
#00d8 #0040 ;goto JSR2 #07 ;draw-sprite-23 JSR2
#00d8 #0058 ;goto JSR2 #11 ;draw-sprite-23 JSR2
#00d8 #0070 ;goto JSR2 #0a ;draw-sprite-23 JSR2
#0060 #0080 ;goto JSR2 #1e ;draw-tile JSR2
#0068 #0080 ;goto JSR2 ;fight ;draw-string JSR2
#0068 #0090 ;goto JSR2 ;run ;draw-string JSR2
#0068 #00a0 ;goto JSR2 ;magic ;draw-string JSR2
#0060 #0098 ;goto JSR2 #1e ;draw-tile JSR2
#0068 #0098 ;goto JSR2 ;fight ;draw-string JSR2
#0068 #00a0 ;goto JSR2 ;run ;draw-string JSR2
#0068 #00a8 ;goto JSR2 ;magic ;draw-string JSR2
#0068 #00b0 ;goto JSR2 ;drink ;draw-string JSR2
#0068 #00c0 ;goto JSR2 ;item ;draw-string JSR2
#0068 #00b8 ;goto JSR2 ;item ;draw-string JSR2
#0008 #0078 ;goto JSR2 ;imp ;draw-string JSR2
#0008 #0080 ;goto JSR2 ;wolf ;draw-string JSR2
#0008 #0098 ;goto JSR2 ;imp ;draw-string JSR2
#0008 #00a0 ;goto JSR2 ;wolf ;draw-string JSR2
#00b0 #0078 ;goto JSR2 ;asta ;draw-string JSR2
#00b0 #0080 ;goto JSR2 ;asta-2 ;draw-string JSR2
#00b0 #0090 ;goto JSR2 ;brek ;draw-string JSR2
#00b0 #0098 ;goto JSR2 ;brek-2 ;draw-string JSR2
#00b0 #00a8 ;goto JSR2 ;dain ;draw-string JSR2
#00b0 #00b0 ;goto JSR2 ;dain-2 ;draw-string JSR2
#00b0 #00c0 ;goto JSR2 ;garl ;draw-string JSR2
#00b0 #00c8 ;goto JSR2 ;garl-2 ;draw-string JSR2
#00b0 #0098 ;goto JSR2 ;asta ;draw-string JSR2
#00b0 #00a0 ;goto JSR2 ;asta-2 ;draw-string JSR2
#00b0 #00a8 ;goto JSR2 ;brek ;draw-string JSR2
#00b0 #00b0 ;goto JSR2 ;brek-2 ;draw-string JSR2
#00b0 #00b8 ;goto JSR2 ;dain ;draw-string JSR2
#00b0 #00c0 ;goto JSR2 ;dain-2 ;draw-string JSR2
#00b0 #00c8 ;goto JSR2 ;garl ;draw-string JSR2
#00b0 #00d0 ;goto JSR2 ;garl-2 ;draw-string JSR2
BRK
@load-tile ( offset* -> )
@ -156,20 +156,22 @@
JMP2r
( draw the screen )
@randomize
@randomize ( x0* y0* x1* y1* )
,&y1 STR2 ,&x1 STR2 ,&y0 STR2 ,&x0 STR2
#01 .Screen/auto DEO ( ; auto update x pos )
#0008 ( row )
,&y0 LDR2 ( row )
&rows ( row )
DUP2 .Screen/y DEO2 ( row ; y=row )
#0008 DUP2 .Screen/x DEO2 ( row col ; x=0 )
,&x0 LDR2 DUP2 .Screen/x DEO2 ( row col ; x=0 )
&cols ( row col )
;draw-random-sprite JSR2 ( ; random sprite/style )
#0008 ADD2 ( row col+8 )
DUP2 #0078 LTH2 ,&cols JCN ( row col+8 )
DUP2 ,&x1 LDR2 ( #0078 ) LTH2 ,&cols JCN ( row col+8 )
POP2 #0008 ADD2 ( row+8 )
DUP2 #0068 LTH2 ,&rows JCN ( row+8 )
DUP2 ,&y1 LDR2 ( #0068 ) LTH2 ,&rows JCN ( row+8 )
POP2 #00 .Screen/auto DEO ( )
JMP2r ( )
[ &x0 $2 &y0 $2 &x1 $2 &y1 $2 ]
( draw a random sprite with a random style )
@draw-random-sprite
@ -179,11 +181,16 @@
( redraw the screen )
@redraw
( LIT &count 00 ,&skip JCN
#0008 #0008 #00f8 #0028 ;randomize JSR2
&skip
,&count LDR INC #03 AND ,&count STR )
BRK
( respond to key-presses and controllers )
@on-key
;randomize JSR2
( #0008 #0008 #0078 #0068 ;randomize JSR2 )
#0008 #0008 #00f8 #0028 ;randomize JSR2
BRK
( initialize the rng seed )
@ -205,13 +212,13 @@
( string constants )
@asta "asta 00
@asta-2 "hp 20 "36/ 20 "37 00
@asta-2 20 20 20 "36/ 20 "37 00
@brek "brek 00
@brek-2 "hp 20 "17/ 20 "21 00
@brek-2 20 20 20 "17/ 20 "21 00
@dain "dain 00
@dain-2 "hp 20 "28/ 20 "31 00
@dain-2 20 20 20 "28/ 20 "31 00
@garl "garl 00
@garl-2 "hp 20 "16/ 20 "16 00
@garl-2 20 20 20 "16/ 20 "16 00
@fight "fight 00
@run "run 00
@ -222,7 +229,18 @@
@imp "imp 00
@wolf "wolf 00
( pc stats: )
( - 1 byte: class )
( - 5 bytes: name )
( - 2 bytes: cur hp )
( - 2 bytes: max hp )
@pc1 01 "asta 00 0024 0025
@pc2 01 "brek 00 0011 0015
@pc3 01 "dain 00 001c 001f
@pc4 01 "garl 00 0010 0010
( PETSCII tiles, 2-bit binary data )
( TODO: these could be 1-bit instead )
@petscii
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
18 18 18 18 18 00 18 00 00 00 00 00 00 00 00 00