mirror of
https://github.com/forth-ev/VolksForth.git
synced 2024-11-22 05:32:28 +00:00
Port taskdemo.fth to the X16, directly writing to VERA's VRAM.
This commit is contained in:
parent
1575422ca7
commit
083ed795ec
33
6502/C64/src/taskdemo-x16.fth
Normal file
33
6502/C64/src/taskdemo-x16.fth
Normal file
@ -0,0 +1,33 @@
|
||||
\ Taskdemo for X16
|
||||
|
||||
: taskmark ; \needs cbm>scr : cbm>scr ;
|
||||
|
||||
\ This method of writing directly into the X16's screen memory
|
||||
\ is a bit hacky and relies on the default settings that the
|
||||
\ Kernal uses for text mode.
|
||||
: scrstart ( -- adr) $b000 ;
|
||||
: ctrl@ ( -- b ) $9f25 c@ ;
|
||||
: addr-sel@ ( -- 0/1 ) ctrl@ 1 and ;
|
||||
: datax! ( c -- ) $9f23 addr-sel@ + c! ;
|
||||
: addrx-l/m! ( u -- ) $9f20 ! ;
|
||||
: scr! ( scrcode vram-addr -- )
|
||||
addrx-l/m! datax! ;
|
||||
|
||||
Variable counter counter off
|
||||
|
||||
$100 $100 Task Background
|
||||
|
||||
: >count ( n -)
|
||||
Background 1 pass
|
||||
counter !
|
||||
BEGIN counter @ -1 counter +! ?dup
|
||||
WHILE pause 0 <# #s #> dup >r
|
||||
0 DO pause dup I + c@ cbm>scr
|
||||
scrstart I 2* + scr! LOOP drop
|
||||
bl r> 2* scrstart + scr!
|
||||
REPEAT
|
||||
BEGIN stop REPEAT ; \ stop's forever
|
||||
: wait Background sleep ;
|
||||
: go Background wake ;
|
||||
|
||||
multitask $1000 >count page
|
Loading…
Reference in New Issue
Block a user