From 91cde072e0aeebec894a5a86cbcc38cee8d1f2ac Mon Sep 17 00:00:00 2001 From: Irmen de Jong Date: Tue, 24 Dec 2024 12:10:02 +0100 Subject: [PATCH] added txt.t256c() on the cx16 to turn 256 color tile mode on or off --- compiler/res/prog8lib/cx16/gfx_hires.p8 | 1 + compiler/res/prog8lib/cx16/gfx_lores.p8 | 1 + compiler/res/prog8lib/cx16/monogfx.p8 | 1 + compiler/res/prog8lib/cx16/textio.p8 | 8 ++++++++ compiler/res/prog8lib/virtual/monogfx.p8 | 1 + 5 files changed, 12 insertions(+) diff --git a/compiler/res/prog8lib/cx16/gfx_hires.p8 b/compiler/res/prog8lib/cx16/gfx_hires.p8 index 78fd73040..ae9a30482 100644 --- a/compiler/res/prog8lib/cx16/gfx_hires.p8 +++ b/compiler/res/prog8lib/cx16/gfx_hires.p8 @@ -588,6 +588,7 @@ gfx_hires { ; Non-recursive scanline flood fill. ; based loosely on code found here https://www.codeproject.com/Articles/6017/QuickFill-An-efficient-flood-fill-algorithm ; with the fixes applied to the seedfill_4 routine as mentioned in the comments. + ; Also see https://lodev.org/cgtutor/floodfill.html word @zp xx = x as word word @zp yy = y as word word x1 diff --git a/compiler/res/prog8lib/cx16/gfx_lores.p8 b/compiler/res/prog8lib/cx16/gfx_lores.p8 index cf82cd78f..3d6032def 100644 --- a/compiler/res/prog8lib/cx16/gfx_lores.p8 +++ b/compiler/res/prog8lib/cx16/gfx_lores.p8 @@ -640,6 +640,7 @@ gfx_lores { ; Non-recursive scanline flood fill. ; based loosely on code found here https://www.codeproject.com/Articles/6017/QuickFill-An-efficient-flood-fill-algorithm ; with the fixes applied to the seedfill_4 routine as mentioned in the comments. + ; Also see https://lodev.org/cgtutor/floodfill.html word @zp xx = x as word word @zp yy = y as word word x1 diff --git a/compiler/res/prog8lib/cx16/monogfx.p8 b/compiler/res/prog8lib/cx16/monogfx.p8 index 0f2b9b550..e36fe3ef5 100644 --- a/compiler/res/prog8lib/cx16/monogfx.p8 +++ b/compiler/res/prog8lib/cx16/monogfx.p8 @@ -739,6 +739,7 @@ invert: ; Non-recursive scanline flood fill. ; based loosely on code found here https://www.codeproject.com/Articles/6017/QuickFill-An-efficient-flood-fill-algorithm ; with the fixes applied to the seedfill_4 routine as mentioned in the comments. + ; Also see https://lodev.org/cgtutor/floodfill.html word @zp xx = x as word word @zp yy = y as word word x1 diff --git a/compiler/res/prog8lib/cx16/textio.p8 b/compiler/res/prog8lib/cx16/textio.p8 index 95e40df6d..b1ac7109e 100644 --- a/compiler/res/prog8lib/cx16/textio.p8 +++ b/compiler/res/prog8lib/cx16/textio.p8 @@ -666,4 +666,12 @@ asmsub print_lit(str text @ AY) clobbers(A,Y) { }} } +sub t256c(bool enable) { + ; set 256 color tile mode on or off + if enable + cx16.VERA_L1_CONFIG |= 8 + else + cx16.VERA_L1_CONFIG &= ~8 +} + } diff --git a/compiler/res/prog8lib/virtual/monogfx.p8 b/compiler/res/prog8lib/virtual/monogfx.p8 index a29c293d6..30e1772ab 100644 --- a/compiler/res/prog8lib/virtual/monogfx.p8 +++ b/compiler/res/prog8lib/virtual/monogfx.p8 @@ -409,6 +409,7 @@ monogfx { ; Non-recursive scanline flood fill. ; based loosely on code found here https://www.codeproject.com/Articles/6017/QuickFill-An-efficient-flood-fill-algorithm ; with the fixes applied to the seedfill_4 routine as mentioned in the comments. + ; Also see https://lodev.org/cgtutor/floodfill.html word @zp xx = x as word word @zp yy = y as word word x1