Removed (pretty inconsistently used) tab chars from source code base.
This commit is contained in:
@@ -5,12 +5,12 @@
|
||||
; 2005-02-08, Ullrich von Bassewitz
|
||||
; 2005-02-11, Greg King
|
||||
|
||||
.export _vfprintf
|
||||
.import push1, pushwysp, incsp6
|
||||
.import _fwrite, __printf
|
||||
.importzp sp, ptr1
|
||||
.export _vfprintf
|
||||
.import push1, pushwysp, incsp6
|
||||
.import _fwrite, __printf
|
||||
.importzp sp, ptr1
|
||||
|
||||
.macpack generic
|
||||
.macpack generic
|
||||
|
||||
|
||||
.data
|
||||
@@ -19,10 +19,10 @@
|
||||
; Static data for the _vfprintf routine
|
||||
;
|
||||
outdesc: ; Static outdesc structure
|
||||
ccount: .res 2
|
||||
.word out ; Output function pointer
|
||||
ptr: .res 2 ; Points to output file
|
||||
.res 2 ; (Not used by this function)
|
||||
ccount: .res 2
|
||||
.word out ; Output function pointer
|
||||
ptr: .res 2 ; Points to output file
|
||||
.res 2 ; (Not used by this function)
|
||||
|
||||
.code
|
||||
|
||||
@@ -57,21 +57,21 @@ out: ldy #5
|
||||
jsr pushwysp ; Push count
|
||||
lda ptr
|
||||
ldx ptr+1
|
||||
jsr _fwrite
|
||||
sta ptr1 ; Save function result
|
||||
stx ptr1+1
|
||||
jsr _fwrite
|
||||
sta ptr1 ; Save function result
|
||||
stx ptr1+1
|
||||
|
||||
; Check the return value.
|
||||
|
||||
ora ptr1+1
|
||||
bne @Ok
|
||||
bne @Ok
|
||||
|
||||
; We had an error. Store -1 into ccount
|
||||
|
||||
.ifp02
|
||||
lda #<-1
|
||||
lda #<-1
|
||||
.else
|
||||
dec a
|
||||
dec a
|
||||
.endif
|
||||
sta ccount
|
||||
bne @Done ; Branch always
|
||||
@@ -109,37 +109,37 @@ out: ldy #5
|
||||
; }
|
||||
;
|
||||
_vfprintf:
|
||||
pha ; Save low byte of ap
|
||||
pha ; Save low byte of ap
|
||||
|
||||
; Setup the outdesc structure
|
||||
|
||||
lda #0
|
||||
sta ccount
|
||||
sta ccount+1 ; Clear character-count
|
||||
lda #0
|
||||
sta ccount
|
||||
sta ccount+1 ; Clear character-count
|
||||
|
||||
; Reorder the stack. Replace f on the stack by &d, so the stack frame is
|
||||
; exactly as _printf expects it. Parameters will get dropped by _printf.
|
||||
|
||||
ldy #2
|
||||
lda (sp),y ; Low byte of f
|
||||
sta ptr
|
||||
lda #<outdesc
|
||||
sta (sp),y
|
||||
ldy #2
|
||||
lda (sp),y ; Low byte of f
|
||||
sta ptr
|
||||
lda #<outdesc
|
||||
sta (sp),y
|
||||
iny
|
||||
lda (sp),y ; High byte of f
|
||||
sta ptr+1
|
||||
lda #>outdesc
|
||||
sta (sp),y
|
||||
lda (sp),y ; High byte of f
|
||||
sta ptr+1
|
||||
lda #>outdesc
|
||||
sta (sp),y
|
||||
|
||||
; Restore low byte of ap and call _printf
|
||||
|
||||
pla
|
||||
jsr __printf
|
||||
jsr __printf
|
||||
|
||||
; Return the number of bytes written
|
||||
|
||||
lda ccount
|
||||
ldx ccount+1
|
||||
lda ccount
|
||||
ldx ccount+1
|
||||
rts
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user