Extended write hooks and debugged sound
This commit is contained in:
@@ -1,9 +1,55 @@
|
||||
( ESOP stdlib )
|
||||
|
||||
|00 @Control [ &framevec $2 &input $2 &random $1 &status $1 &sound $1 &syscall $1 ]
|
||||
|
||||
( byte to short )
|
||||
( x -- 00 x )
|
||||
%BTS { #00 SWP }
|
||||
|
||||
( screen is #54 x #30 )
|
||||
|
||||
%SETSCRVEC { .Control/framevec DEO2 }
|
||||
%RND { .Control/random DEI }
|
||||
%STACKTRACE { #ff .Control/random DEO }
|
||||
%SYS { .Control/syscall DEO }
|
||||
%INKEY { .Control/input DEI2 }
|
||||
%DBG { #20 SYS SYS }
|
||||
%SND { .Control/sound DEO }
|
||||
|
||||
( x y -- ref* )
|
||||
%COORD { BTS ROT BTS SWP2 #0054 MUL2 ADD2 }
|
||||
( x y -- bitshift byteptr* )
|
||||
%PXLOFFSET { COORD DUP2 #03 SFT2 DUP2 #30 SFT2 ROT2 SWP2 SUB2 SWP POP ROT #fe00 ADD2 }
|
||||
|
||||
( x y -- )
|
||||
%PXL { PXLOFFSET DUP2 LDA #01 ROT #40 SFT SFT ORA ROT ROT STA }
|
||||
|
||||
( subtract #20 from the ASCII code and you get the offset from the nanofont label )
|
||||
%CHAR-TO-NF { #20 SUB ;nanofont ADD }
|
||||
|
||||
|0100
|
||||
#03 #02 #01
|
||||
ROT
|
||||
DBG DBG DBG
|
||||
;on-frame SETSCRVEC
|
||||
#30
|
||||
BRK
|
||||
|
||||
@on-frame
|
||||
DUP SND
|
||||
INC
|
||||
( #10 #12 PXL )
|
||||
BRK
|
||||
|
||||
|
||||
@putc
|
||||
|
||||
JMP2r
|
||||
|
||||
@draw-str ( s* -> )
|
||||
&loop LDAk #00 EQU ,&eof JCN ( did we reach \0 ? )
|
||||
LDAk ;putc JSR2 INC2 ,&loop JMP ( no so emit a char and repeat )
|
||||
&eof POP2 JMP2r ( yes so return )
|
||||
|
||||
( nanofont glyphs for ESOP, courtesy of Michaelangel007 )
|
||||
|
||||
|
||||
Reference in New Issue
Block a user