From c2f6311367327ebc0b5bdfe372ece1f263a9fc2f Mon Sep 17 00:00:00 2001 From: Irmen de Jong Date: Sat, 8 Jun 2024 00:03:02 +0200 Subject: [PATCH] todo --- compiler/res/prog8lib/cx16/verafx.p8 | 4 +++- docs/source/libraries.rst | 9 ++++++++- docs/source/todo.rst | 21 ++++++++++++++++++++- 3 files changed, 31 insertions(+), 3 deletions(-) diff --git a/compiler/res/prog8lib/cx16/verafx.p8 b/compiler/res/prog8lib/cx16/verafx.p8 index 2e3d2a618..47636a6b5 100644 --- a/compiler/res/prog8lib/cx16/verafx.p8 +++ b/compiler/res/prog8lib/cx16/verafx.p8 @@ -1,6 +1,6 @@ ; Somewhat experimental Vera FX support. ; Docs: -; https://github.com/X16Community/x16-docs/blob/101759f3bfa5e6cce4e8c5a0b67cb0f2f1c6341e/X16%20Reference%20-%2010%20-%20VERA%20FX%20Reference.md +; https://github.com/X16Community/x16-docs/blob/fb63156cca2d6de98be0577aacbe4ddef458f896/X16%20Reference%20-%2010%20-%20VERA%20FX%20Reference.md ; https://docs.google.com/document/d/1q34uWOiM3Be2pnaHRVgSdHySI-qsiQWPTo_gfE54PTg verafx { @@ -166,6 +166,8 @@ verafx { } sub transparency(bool enable) { + ; Set transparent write mode for VeraFX cached writes and also for normal writes to DATA0/DATA. + ; If enabled, pixels with value 0 do not modify VRAM when written (so they are "transparent") cx16.VERA_CTRL = 2<<1 ; dcsel = 2 if enable cx16.VERA_FX_CTRL |= %10000000 diff --git a/docs/source/libraries.rst b/docs/source/libraries.rst index 6b191fdbe..352c762b9 100644 --- a/docs/source/libraries.rst +++ b/docs/source/libraries.rst @@ -228,6 +228,12 @@ and to seek in open files. Read the `diskio source code `_ to see what's in there. (Note: slight variations for different compiler targets) +.. note:: + For simplicity sake, this library is designed to work on a *single* open file + for reading, and a *single* open file for writing at any time only. + If you need to load or save to more than one file at a time, you'll have + to write your own I/O routines (or supplement the ones found here) + .. note:: If you are using the X16 emulator with HostFS, and are experiencing weird behavior with these routines, please first try again with an SD-card image instead of HostFs. @@ -765,7 +771,8 @@ the emulators already support it). This routine is about 50% faster as a regular byte-by-byte copy. ``transparency`` - Enable or disable transparent writes (color 0 will be transparent if enabled). + Set transparent write mode for VeraFX cached writes and also for normal writes to DATA0/DATA. + If enabled, pixels with value 0 do not modify VRAM when written (so they are "transparent") Read the `verafx source code `_ to see what's in there. diff --git a/docs/source/todo.rst b/docs/source/todo.rst index f29e652c5..ba8a9f4bc 100644 --- a/docs/source/todo.rst +++ b/docs/source/todo.rst @@ -3,9 +3,28 @@ TODO https://github.com/irmen/prog8/issues/136 (string.find register order issue) -optimize signed byte/word division by powers of 2, it's now using divmod routine. (also % ?) +optimize signed byte/word division by powers of 2 (and shift right?), it's now using divmod routine. (also % ?) see inplacemodificationByteVariableWithLiteralval() and inplacemodificationSomeWordWithLiteralval() and for IR: see divideByConst() in IRCodeGen + 1 shift right of AX signed word: + stx P8ZP_SCRATCH_B1 + cpx #$80 + ror P8ZP_SCRATCH_B1 + ror a + ldx P8ZP_SCRATCH_B1 + + multi shift right: (amount in $22) + sta $4 + txa + ldx $22 + beq end + loop cmp #$80 + ror + ror $4 + dex + bne loop + end: tax + lda $4 Future Things and Ideas