This commit is contained in:
neauoire 2021-05-01 08:58:42 -07:00
parent baa2f2450f
commit 5323e5b750
1 changed files with 20 additions and 31 deletions

View File

@ -1,26 +1,15 @@
( polycat ) ( polycat )
%RTN { JMP2r } %RTN { JMP2r }
%8+ { #0008 ADD2 } %+ { ADD2 } %- { SUB2 }
%2/ { #0002 DIV2 } %* { MUL2 } %/ { DIV2 }
%MOD { DUP2 DIV MUL SUB } %> { GTH2 }
%INC { #01 ADD }
%TOS { #00 SWP }
( devices ) ( devices )
|00 @System [ &vector $2 &wst $1 &rst $1 &pad $4 &r $2 &g $2 &b $2 ] |00 @System [ &vector $2 &wst $1 &rst $1 &pad $4 &r $2 &g $2 &b $2 ]
|10 @Console [ &pad $8 &char $1 &byte $1 &short $2 &string $2 ]
|20 @Screen [ &vector $2 &width $2 &height $2 &pad $2 &x $2 &y $2 &addr $2 &color $1 ] |20 @Screen [ &vector $2 &width $2 &height $2 &pad $2 &x $2 &y $2 &addr $2 &color $1 ]
|30 @Audio0 [ &vector $2 &position $2 &output $1 &pad $3 &adsr $2 &length $2 &addr $2 &volume $1 &pitch $1 ]
|40 @Audio1 [ &vector $2 &position $2 &output $1 &pad $3 &adsr $2 &length $2 &addr $2 &volume $1 &pitch $1 ]
|50 @Audio2 [ &vector $2 &position $2 &output $1 &pad $3 &adsr $2 &length $2 &addr $2 &volume $1 &pitch $1 ]
|60 @Audio3 [ &vector $2 &position $2 &output $1 &pad $3 &adsr $2 &length $2 &addr $2 &volume $1 &pitch $1 ]
|70 @Midi [ &vector $2 &channel $1 &note $1 &velocity $1 ]
|80 @Controller [ &vector $2 &button $1 &key $1 ]
|90 @Mouse [ &vector $2 &x $2 &y $2 &state $1 &chord $1 ] |90 @Mouse [ &vector $2 &x $2 &y $2 &state $1 &chord $1 ]
|a0 @File [ &vector $2 &success $2 &offset $2 &pad $2 &name $2 &length $2 &load $2 &save $2 ]
|b0 @DateTime [ &year $2 &month $1 &day $1 &hour $1 &minute $1 &second $1 &dotw $1 &doty $2 &isdst $1 ]
( variables ) ( variables )
@ -39,8 +28,8 @@
#0caf .System/b DEO2 #0caf .System/b DEO2
( find center ) ( find center )
.Screen/width DEI2 2/ #0008 SUB2 .cat/x POK2 .Screen/width DEI2 #0002 / #0008 - .cat/x POK2
.Screen/height DEI2 #0004 DIV2 #0003 MUL2 #0018 SUB2 .cat/y POK2 .Screen/height DEI2 #0004 / #0003 * #0018 - .cat/y POK2
( place polycat ) ( place polycat )
@ -57,8 +46,8 @@ BRK
;draw-cursor JSR2 ;draw-cursor JSR2
.Mouse/x DEI2 .cat/x PEK2 GTH2 #20 MUL .Mouse/x DEI2 .cat/x PEK2 > #20 MUL
.Mouse/y DEI2 .cat/y PEK2 GTH2 #40 MUL .Mouse/y DEI2 .cat/y PEK2 > #40 MUL
ADD #00 SWP ;draw-eye JSR2 ADD #00 SWP ;draw-eye JSR2
BRK BRK
@ -81,11 +70,11 @@ BRK
( ears ) ( ears )
.cat/y PEK2 .Screen/y DEO2 .cat/y PEK2 .Screen/y DEO2
.cat/x PEK2 #0008 SUB2 .Screen/x DEO2 .cat/x PEK2 #0008 - .Screen/x DEO2
;ears .Screen/addr DEO2 ;ears .Screen/addr DEO2
#41 .Screen/color DEO #41 .Screen/color DEO
.cat/x PEK2 .Screen/x DEO2 .cat/x PEK2 .Screen/x DEO2
;ears #0010 ADD2 .Screen/addr DEO2 ;ears #0010 + .Screen/addr DEO2
#41 .Screen/color DEO #41 .Screen/color DEO
#0000 ;draw-eye JSR2 #0000 ;draw-eye JSR2
@ -95,26 +84,26 @@ RTN
@draw-eye ( quad* -- ) @draw-eye ( quad* -- )
.cat/y PEK2 #0008 ADD2 .Screen/y DEO2 .cat/y PEK2 #0008 + .Screen/y DEO2
.cat/x PEK2 #0008 SUB2 .Screen/x DEO2 .cat/x PEK2 #0008 - .Screen/x DEO2
DUP2 ;eye ADD2 .Screen/addr DEO2 DUP2 ;eye + .Screen/addr DEO2
#41 .Screen/color DEO #41 .Screen/color DEO
.cat/x PEK2 .Screen/x DEO2 .cat/x PEK2 .Screen/x DEO2
;eye #0010 ADD2 ADD2 .Screen/addr DEO2 ;eye #0010 + + .Screen/addr DEO2
#41 .Screen/color DEO #41 .Screen/color DEO
RTN RTN
@draw-tail ( frame* -- ) @draw-tail ( frame* -- )
.cat/y PEK2 #0010 ADD2 .Screen/y DEO2 .cat/y PEK2 #0010 + .Screen/y DEO2
.cat/x PEK2 #0008 SUB2 .Screen/x DEO2 .cat/x PEK2 #0008 - .Screen/x DEO2
;body .Screen/addr DEO2 ;body .Screen/addr DEO2
#41 .Screen/color DEO #41 .Screen/color DEO
.cat/x PEK2 .Screen/x DEO2 .cat/x PEK2 .Screen/x DEO2
#0010 MUL2 ;body #0010 ADD2 ADD2 .Screen/addr DEO2 #0010 * ;body #0010 + + .Screen/addr DEO2
#41 .Screen/color DEO #41 .Screen/color DEO
RTN RTN
@ -140,15 +129,15 @@ RTN
@draw-ground ( -- ) @draw-ground ( -- )
.cat/y PEK2 #0018 ADD2 .Screen/y DEO2 .cat/y PEK2 #0018 + .Screen/y DEO2
.cat/x PEK2 #0010 SUB2 .Screen/x DEO2 .cat/x PEK2 #0010 - .Screen/x DEO2
;ground .Screen/addr DEO2 ;ground .Screen/addr DEO2
#00 #10 #00 #10
&loop &loop
#21 .Screen/color DEO #21 .Screen/color DEO
.Screen/addr DEI2 #0008 ADD2 .Screen/addr DEO2 .Screen/addr DEI2 #0008 + .Screen/addr DEO2
.Screen/x DEI2 #0008 ADD2 .Screen/x DEO2 .Screen/x DEI2 #0008 + .Screen/x DEO2
SWP #01 ADD SWP SWP #01 ADD SWP
DUP2 LTH ,&loop JNZ DUP2 LTH ,&loop JNZ
POP2 POP2