Make _printf() __fastcall__
git-svn-id: svn://svn.cc65.org/cc65/trunk@507 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
@@ -34,7 +34,7 @@ struct outdesc {
|
|||||||
|
|
||||||
|
|
||||||
/* Internal formatting routine */
|
/* Internal formatting routine */
|
||||||
int _printf (struct outdesc* d, const char* format, va_list ap);
|
int __fastcall__ _printf (struct outdesc* d, const char* format, va_list ap);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -241,16 +241,17 @@ __printf:
|
|||||||
|
|
||||||
; Save the register bank variables into the save area
|
; Save the register bank variables into the save area
|
||||||
|
|
||||||
ldx #5
|
pha ; Save low byte of ap
|
||||||
Save: lda regbank,x
|
ldy #5
|
||||||
sta RegSave,x
|
Save: lda regbank,y
|
||||||
dex
|
sta RegSave,y
|
||||||
|
dey
|
||||||
bpl Save
|
bpl Save
|
||||||
|
|
||||||
; Get the parameters from the stack
|
; Get the parameters from the stack
|
||||||
|
|
||||||
jsr popax ; Argument list pointer
|
pla ; Restore low byte of ap
|
||||||
sta ArgList
|
sta ArgList ; Argument list pointer
|
||||||
stx ArgList+1
|
stx ArgList+1
|
||||||
|
|
||||||
jsr popax ; Format string
|
jsr popax ; Format string
|
||||||
|
|||||||
@@ -60,15 +60,15 @@ _printf:
|
|||||||
lda (ptr1),y
|
lda (ptr1),y
|
||||||
jsr pushax
|
jsr pushax
|
||||||
|
|
||||||
; Push the va_list
|
; Push va_list (last parameter to vfprintf)
|
||||||
|
|
||||||
lda ptr1
|
lda ptr1
|
||||||
ldx ptr1+1
|
ldx ptr1+1
|
||||||
jsr pushax
|
jsr pushax
|
||||||
|
|
||||||
; Call vfprintf
|
; Call vfprintf
|
||||||
|
|
||||||
jsr _vfprintf
|
jsr _vfprintf
|
||||||
|
|
||||||
; Cleanup the stack. We will return what we got from vfprintf
|
; Cleanup the stack. We will return what we got from vfprintf
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user