From 557cb3f051bcc6033683b05adb5716d79bc125c5 Mon Sep 17 00:00:00 2001 From: Devine Lu Linvega Date: Sun, 25 Aug 2024 18:54:16 -0700 Subject: [PATCH] (m291) Read incoming messages --- gui/m291/src/m291.tal | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/gui/m291/src/m291.tal b/gui/m291/src/m291.tal index 4be27a8..b737826 100644 --- a/gui/m291/src/m291.tal +++ b/gui/m291/src/m291.tal @@ -34,7 +34,9 @@ ;dict/home-path set-path ;on-mouse .Mouse/vector DEO2 ;on-control .Controller/vector DEO2 + ;on-console .Console/vector DEO2 ( | play something ) + ;buffer ;buffer/pos STA2 ;dict/mpg-cmd .Console/addr DEO2 #03 .Console/mode DEO #01 .Console/exec DEO @@ -46,6 +48,26 @@ ( auth ) "By 20 "Devine 20 "Lu 20 "Linvega 0a ( date ) "25 20 "Aug 20 "2024 $2 +@on-console ( -> brk ) + .Console/type DEI #01 EQU ?{ BRK } + .Console/read DEI #0a EQU ?{ + ;buffer/pos LDA2k STH2k .Console/read DEI STH2r STA + INC2 SWP2 STA2 + BRK } + #0000 ;buffer/pos LDA2 STA2 + ( | parse line ) + ;buffer LDAk [ LIT "@ ] EQU ?{ POP2 JMP2r } + ( INC2k LDA LIT "F EQU ?on-frame + | INC2k LDA LIT "H EQU ?on-help + | INC2k LDA LIT "I EQU ?on-id3 + | INC2k LDA LIT "P EQU ?on-paused + | INC2k LDA LIT "R EQU ?on-revision + | INC2k LDA LIT "S EQU ?on-status + | INC2k LDA LIT "T EQU ?on-tag ) + #0a19 DEO + ( reset ) ;buffer ;buffer/pos STA2 + BRK + @on-mouse ( -> ) #c1 ;touch-chr/down ;touch-chr .Mouse/state DEI ?{ SWP2 } POP2 @@ -374,6 +396,11 @@ INC2 & LDAk ? POP2 JMP2r +@ ( str* -- ) + LDAk #19 DEO + INC2 & LDAk ? + POP2 JMP2r + @ ( short* -: ) SWP /b &b ( byte -: )