From b93d9ecd7ed5fb6fed161a0fa00cf75d11be23cc Mon Sep 17 00:00:00 2001 From: Irmen de Jong Date: Wed, 23 Sep 2020 02:34:49 +0200 Subject: [PATCH] memtop cx16 --- compiler/res/prog8lib/cx16/syslib.p8 | 2 +- examples/cx16/simplegraphics.p8 | 13 ++++++------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/compiler/res/prog8lib/cx16/syslib.p8 b/compiler/res/prog8lib/cx16/syslib.p8 index bb53d4769..f15777339 100644 --- a/compiler/res/prog8lib/cx16/syslib.p8 +++ b/compiler/res/prog8lib/cx16/syslib.p8 @@ -24,7 +24,7 @@ romsub $FF8D = VECTOR(uword userptr @ XY, ubyte dir @ Pc) clobbers(A,Y) ; r romsub $FF90 = SETMSG(ubyte value @ A) ; set Kernal message control flag romsub $FF93 = SECOND(ubyte address @ A) clobbers(A) ; (alias: LSTNSA) send secondary address after LISTEN romsub $FF96 = TKSA(ubyte address @ A) clobbers(A) ; (alias: TALKSA) send secondary address after TALK -romsub $FF99 = MEMTOP(uword address @ XY, ubyte dir @ Pc) -> uword @ XY ; read/set top of memory pointer +romsub $FF99 = MEMTOP(uword address @ XY, ubyte dir @ Pc) -> ubyte @A, uword @ XY ; read/set top of memory pointer, returns number of banks in A romsub $FF9C = MEMBOT(uword address @ XY, ubyte dir @ Pc) -> uword @ XY ; read/set bottom of memory pointer romsub $FF9F = SCNKEY() clobbers(A,X,Y) ; scan the keyboard romsub $FFA2 = SETTMO(ubyte timeout @ A) ; set time-out flag for IEEE bus diff --git a/examples/cx16/simplegraphics.p8 b/examples/cx16/simplegraphics.p8 index 35f6c05f6..9e3e574e3 100644 --- a/examples/cx16/simplegraphics.p8 +++ b/examples/cx16/simplegraphics.p8 @@ -11,18 +11,17 @@ main { cx16.r0=0 cx16.FB_init() + cx16.GRAPH_init() cx16.r0 = 0 cx16.r1 = 0 cx16.FB_cursor_position() - uword xx - ubyte yy - for yy in 199 downto 0 { - for xx in 319 downto 0 { - cx16.FB_set_pixel( yy+lsb(xx)) - } + ubyte color + repeat 320*199 { + cx16.FB_set_pixel(color) + color++ } - ; cx16.GRAPH_init() + uword xx for xx in 0 to 319 step 32 { ubyte q for q in 0 to 31 {