mirror of
				https://github.com/irmen/prog8.git
				synced 2025-10-31 15:16:13 +00:00 
			
		
		
		
	romable comments
This commit is contained in:
		| @@ -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, 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 | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user