1
0
mirror of https://github.com/irmen/prog8.git synced 2025-04-28 04:37:46 +00:00

romable comments

This commit is contained in:
Irmen de Jong 2025-04-09 22:33:08 +02:00
parent 0916b943da
commit e2a8bdbdfb
3 changed files with 20 additions and 16 deletions
compiler/res/prog8lib
docs/source

@ -219,7 +219,7 @@ _cb_mod3 jsr $ffff ; modified
inc P8ZP_SCRATCH_W2+1
bcs _loop
_orig_target .word 0
_orig_target .word 0 ; modified
_end
; return w2-orig_target, the size of the decompressed data
lda P8ZP_SCRATCH_W2
@ -239,6 +239,7 @@ _end
; -- Decodes "ByteRun1" (aka PackBits) RLE compressed data. Control byte value 128 ends the decoding.
; Also stops decompressing if the maxsize has been reached.
; Returns the size of the decompressed data.
; TODO: Romable
%asm {{
sta P8ZP_SCRATCH_W1 ; compressed data ptr
sty P8ZP_SCRATCH_W1+1

@ -47,7 +47,6 @@ _loop dey
bne _loop
+ rts
}}
; asmgen.out(" jsr prog8_lib.func_leftstr")
}
asmsub right(uword source @AY, ubyte length @X, uword target @R1) clobbers(A,Y) {
@ -56,16 +55,16 @@ _loop dey
; Also, you have to make sure yourself that length is smaller or equal to the length of the source string.
; Modifies in-place, doesnt return a value (so cant be used in an expression).
%asm {{
; need to copy the the cx16 virtual registers to zeropage to be compatible with C64...
stx P8ZP_SCRATCH_B1
sta cx16.r0
sty cx16.r0+1
jsr length
tya
sec
sbc P8ZP_SCRATCH_B1
clc
adc cx16.r0
; need to copy the the cx16 virtual registers to zeropage to be compatible with C64...
stx P8ZP_SCRATCH_B1
sta cx16.r0
sty cx16.r0+1
jsr length
tya
sec
sbc P8ZP_SCRATCH_B1
clc
adc cx16.r0
sta P8ZP_SCRATCH_W1
lda cx16.r0+1
adc #0
@ -96,7 +95,7 @@ _loop dey
; Also, you have to make sure yourself that start and length are within bounds of the strings.
; Modifies in-place, doesnt return a value (so cant be used in an expression).
%asm {{
; need to copy the the cx16 virtual registers to zeropage to be compatible with C64...
; need to copy the the cx16 virtual registers to zeropage to be compatible with C64...
; substr(source, target, start, length)
sta P8ZP_SCRATCH_B1
lda cx16.r0
@ -178,7 +177,7 @@ _found tya
sec
rts
_str .word 0
_str .word 0 ; modified
; !notreached!
}}
}
@ -333,6 +332,7 @@ _done rts
; Notes: Clobbers A, X, Y. Each * in the pattern uses 4 bytes of stack.
;
; see http://6502.org/source/strings/patmatch.htm
; TODO: Romable (or skip it?)
strptr = P8ZP_SCRATCH_W1

@ -1,14 +1,17 @@
TODO
====
make compiler quiet when running .p8ir files via -vm (also add -quiet flag to suppress output on regular operation?)
romable: check library files for routines that are not yet romable and add "TODO: Romable" comment
romable: fix as many of those issues as possible to improve romability of library code
...
Future Things and Ideas
^^^^^^^^^^^^^^^^^^^^^^^
- make compiler quiet when running .p8ir files via -vm (also add -quiet flag to suppress output on regular operation?)
- romable: fix / add "TODO: Romable" in libraries
- romable: should we have a way to explicitly set the memory address for the BSS area (instead of only the highram bank number on X16, allow a memory address too for the -varshigh option?)
- Kotlin: can we use inline value classes in certain spots?
- add float support to the configurable compiler targets