1
0
mirror of https://github.com/cc65/cc65.git synced 2025-01-27 09:33:42 +00:00

Reverted 'Used more mundane addressing in some of the instructions in "zlib/inflatemem.s".'

This reverted some of commit e7e65044e607f15b7d5b4e55abf7cdcb123993a8.
This commit is contained in:
Greg King 2017-02-07 07:33:27 -05:00
parent e581ad3633
commit 69e3bbea7e

View File

@ -1,10 +1,15 @@
; ;
; 2003-09-21, Piotr Fusik ; 2003-09-21, Piotr Fusik
; 2016-07-19, Greg King ; 2017-02-07, Greg King
; ;
; unsigned __fastcall__ inflatemem (char* dest, const char* source); ; unsigned __fastcall__ inflatemem (char* dest, const char* source);
; ;
; Two "lda (0,x)" instructions can't be assembled for the PC-Engine library
; because an implied ".setdp $2000" changes $00 into a non-zero-page address.
; Therefore, this file isn't assembled for that target.
.ifndef __PCE__
.export _inflatemem .export _inflatemem
.import incsp2 .import incsp2
@ -139,8 +144,8 @@ inflateCopyBlock:
ldy #1 ldy #1
sty getBit_hold sty getBit_hold
; Get 16-bit length ; Get 16-bit length
ldx #0 ldx #inputPointer
lda (inputPointer,x) lda (0,x)
sta moveBlock_len sta moveBlock_len
lda (inputPointer),y lda (inputPointer),y
sta moveBlock_len+1 sta moveBlock_len+1
@ -165,15 +170,15 @@ moveBlock:
.endif .endif
inc moveBlock_len+1 inc moveBlock_len+1
moveBlock_1: moveBlock_1:
lda (inputPointer,x) lda (0,x)
.if (.cpu & CPU_ISET_65SC02) .if (.cpu & CPU_ISET_65SC02)
sta (outputPointer) sta (outputPointer)
.else .else
sta (outputPointer),y sta (outputPointer),y
.endif .endif
inc inputPointer inc 0,x
bne moveBlock_2 bne moveBlock_2
inc inputPointer+1 inc 1,x
moveBlock_2: moveBlock_2:
inc outputPointer inc outputPointer
bne moveBlock_3 bne moveBlock_3
@ -671,3 +676,5 @@ bitsPointer_h:
; Sorted codes. ; Sorted codes.
sortedCodes: sortedCodes:
.res 256+1+29+30+2 .res 256+1+29+30+2
.endif