From b2ce1e8029dea482af28d81499ddd4035f077fd7 Mon Sep 17 00:00:00 2001 From: Irmen de Jong Date: Thu, 31 Mar 2022 18:51:54 +0200 Subject: [PATCH] x16 r39: fix gfx2.text() charset rendering due to new Vera mem layout --- compiler/res/prog8lib/cx16/gfx2.p8 | 9 +-------- compiler/res/prog8lib/cx16/syslib.p8 | 2 +- docs/source/todo.rst | 4 ++-- 3 files changed, 4 insertions(+), 11 deletions(-) diff --git a/compiler/res/prog8lib/cx16/gfx2.p8 b/compiler/res/prog8lib/cx16/gfx2.p8 index 2fc4174f3..4aedd261e 100644 --- a/compiler/res/prog8lib/cx16/gfx2.p8 +++ b/compiler/res/prog8lib/cx16/gfx2.p8 @@ -754,21 +754,14 @@ _done }} } - const ubyte charset_orig_bank = $0 - const uword charset_orig_addr = $f800 ; in bank 0, so $0f800 const ubyte charset_bank = $1 const uword charset_addr = $f000 ; in bank 1, so $1f000 sub text_charset(ubyte charset) { - ; -- make a copy of the selected character set to use with text() + ; -- select the text charset to use with the text() routine ; the charset number is the same as for the cx16.screen_set_charset() ROM function. ; 1 = ISO charset, 2 = PETSCII uppercase+graphs, 3= PETSCII uppercase+lowercase. cx16.screen_set_charset(charset, 0) - cx16.vaddr(charset_orig_bank, charset_orig_addr, 0, 1) - cx16.vaddr(charset_bank, charset_addr, 1, 1) - repeat 256*8 { - cx16.VERA_DATA1 = cx16.VERA_DATA0 - } } sub text(uword @zp x, uword y, ubyte color, uword sctextptr) { diff --git a/compiler/res/prog8lib/cx16/syslib.p8 b/compiler/res/prog8lib/cx16/syslib.p8 index 093f1c7a8..b2d9e5753 100644 --- a/compiler/res/prog8lib/cx16/syslib.p8 +++ b/compiler/res/prog8lib/cx16/syslib.p8 @@ -373,7 +373,7 @@ romsub $ff1a = FB_filter_pixels(uword pointer @ R0, uword count @R1) clobbers(A romsub $ff1d = FB_move_pixels(uword sx @R0, uword sy @R1, uword tx @R2, uword ty @R3, uword count @R4) clobbers(A,X,Y) ; misc -romsub $fec6 = i2c_read_byte(ubyte device @X, ubyte offset @Y) clobbers (A,X,Y) -> ubyte @A, ubyte @Pc +romsub $fec6 = i2c_read_byte(ubyte device @X, ubyte offset @Y) clobbers (X,Y) -> ubyte @A, ubyte @Pc romsub $fec9 = i2c_write_byte(ubyte device @X, ubyte offset @Y, ubyte data @A) clobbers (A,X,Y) -> ubyte @Pc romsub $fef0 = sprite_set_image(uword pixels @R0, uword mask @R1, ubyte bpp @R2, ubyte number @A, ubyte width @X, ubyte height @Y, ubyte apply_mask @Pc) clobbers(A,X,Y) -> ubyte @Pc romsub $fef3 = sprite_set_position(uword x @R0, uword y @R1, ubyte number @A) clobbers(A,X,Y) diff --git a/docs/source/todo.rst b/docs/source/todo.rst index 8287211c3..f63dbff7e 100644 --- a/docs/source/todo.rst +++ b/docs/source/todo.rst @@ -3,8 +3,8 @@ TODO For next release ^^^^^^^^^^^^^^^^ -- x16: new vera memory layout https://github.com/commanderx16/x16-rom/issues/185 this may break certain things in gfx2 and elsewhere. Such as font rendering - broken examples: amiga, colorbars, cube3d, highresbitmap, rasterbars, tehtriz, testgfx2, testvtui +- x16: new vera memory layout https://github.com/commanderx16/x16-rom/issues/185 + this breaks setcc() and other things. broken examples: colorbars, cube3d, rasterbars, tehtriz, testvtui can we make the code read the new layout from vera registers instead of hardcoding it? - x16: optimize diskio load_raw because headerless files are now supported https://github.com/commanderx16/x16-rom/pull/216 note: must still work on c64/c128 that don't have this!