diff --git a/compiler/res/prog8lib/shared_compression.p8 b/compiler/res/prog8lib/shared_compression.p8 index aeaf52993..fe663741d 100644 --- a/compiler/res/prog8lib/shared_compression.p8 +++ b/compiler/res/prog8lib/shared_compression.p8 @@ -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 diff --git a/compiler/res/prog8lib/strings.p8 b/compiler/res/prog8lib/strings.p8 index 3b1934a8a..8f5bf936b 100644 --- a/compiler/res/prog8lib/strings.p8 +++ b/compiler/res/prog8lib/strings.p8 @@ -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, doesn’t return a value (so can’t 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, doesn’t return a value (so can’t 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 diff --git a/docs/source/todo.rst b/docs/source/todo.rst index 14f04e195..9d9ddfabc 100644 --- a/docs/source/todo.rst +++ b/docs/source/todo.rst @@ -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