This commit is contained in:
Irmen de Jong 2024-06-08 00:03:02 +02:00
parent 6f00a48772
commit c2f6311367
3 changed files with 31 additions and 3 deletions

View File

@ -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

View File

@ -228,6 +228,12 @@ and to seek in open files.
Read the `diskio source code <https://github.com/irmen/prog8/tree/master/compiler/res/prog8lib/cx16/diskio.p8>`_
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 <https://github.com/irmen/prog8/tree/master/compiler/res/prog8lib/cx16/verafx.p8>`_
to see what's in there.

View File

@ -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