From 6902834568dc99c9c95cc67eee26c388e27672f6 Mon Sep 17 00:00:00 2001 From: Irmen de Jong Date: Sun, 6 Dec 2020 00:19:47 +0100 Subject: [PATCH] remove dummy argument for txt.scroll_XXXX() functions on cx16 --- compiler/res/prog8lib/cx16/textio.p8 | 12 +++------ examples/test.p8 | 38 +++++++++++++++++----------- 2 files changed, 27 insertions(+), 23 deletions(-) diff --git a/compiler/res/prog8lib/cx16/textio.p8 b/compiler/res/prog8lib/cx16/textio.p8 index b0e74fa92..f0a45e851 100644 --- a/compiler/res/prog8lib/cx16/textio.p8 +++ b/compiler/res/prog8lib/cx16/textio.p8 @@ -154,10 +154,9 @@ sub uppercase() { cx16.screen_set_charset(2, 0) ; uppercase charset } -asmsub scroll_left (ubyte dummy @ Pc) clobbers(A, Y) { +asmsub scroll_left() clobbers(A, Y) { ; ---- scroll the whole screen 1 character to the left ; contents of the rightmost column are unchanged, you should clear/refill this yourself - ; Carry flag is a dummy on the cx16 %asm {{ phx jsr c64.SCREEN @@ -198,10 +197,9 @@ _lx ldx #0 ; modified }} } -asmsub scroll_right (ubyte dummy @ Pc) clobbers(A) { +asmsub scroll_right() clobbers(A) { ; ---- scroll the whole screen 1 character to the right ; contents of the leftmost column are unchanged, you should clear/refill this yourself - ; Carry flag is a dummy on the cx16 %asm {{ phx jsr c64.SCREEN @@ -250,10 +248,9 @@ _lx ldx #0 ; modified }} } -asmsub scroll_up (ubyte dummy @ Pc) clobbers(A, Y) { +asmsub scroll_up() clobbers(A, Y) { ; ---- scroll the whole screen 1 character up ; contents of the bottom row are unchanged, you should refill/clear this yourself - ; Carry flag is a dummy on the cx16 %asm {{ phx jsr c64.SCREEN @@ -300,10 +297,9 @@ _nextline }} } -asmsub scroll_down (ubyte dummy @ Pc) clobbers(A, Y) { +asmsub scroll_down() clobbers(A, Y) { ; ---- scroll the whole screen 1 character down ; contents of the top row are unchanged, you should refill/clear this yourself - ; Carry flag is a dummy on the cx16 %asm {{ phx jsr c64.SCREEN diff --git a/examples/test.p8 b/examples/test.p8 index 02c1d3998..24e3159b4 100644 --- a/examples/test.p8 +++ b/examples/test.p8 @@ -5,24 +5,32 @@ main { sub start() { - uword foo - uword bar + txt.fill_screen('.',2) - uword[] arra = [1,2,3] - str nom = "omnom" + ubyte xx + ubyte yy = 0 + for xx in 0 to txt.DEFAULT_WIDTH-1 { + txt.setcc(xx, 0, xx, 1) + txt.setcc(xx, txt.DEFAULT_HEIGHT-1, xx, 1) + } + for yy in 0 to txt.DEFAULT_HEIGHT-1 { + txt.setcc(0, yy, yy,1) + txt.setcc(txt.DEFAULT_WIDTH-1, yy, yy, 1) + } - foo = &arra - foo++ - foo = &nom - foo++ - - ding(nom) - ding("sdfsdfd") - - txt.print("hello\n") + repeat { + delay() + txt.scroll_left(false) + } } - sub ding(uword ss) { - txt.print(ss) + + sub delay () { + ubyte tt + repeat 255 { + repeat 255 { + tt++ + } + } } }