Merge pull request #132 from greg-king5/high-zero
Change "#>0" into "#>$0000".
This commit is contained in:
commit
d75f9c2051
16 changed files with 75 additions and 69 deletions
|
@ -1,9 +1,9 @@
|
||||||
;
|
;
|
||||||
; 2003-03-07, Ullrich von Bassewitz
|
; 2003-03-07, Ullrich von Bassewitz
|
||||||
; 2011-01-28, Stefan Haubenthal
|
; 2011-01-28, Stefan Haubenthal
|
||||||
; 2013-12-22, Greg King
|
; 2014-09-10, Greg King
|
||||||
;
|
;
|
||||||
; Setup arguments for main
|
; Set up arguments for main
|
||||||
;
|
;
|
||||||
|
|
||||||
.constructor initmainargs, 24
|
.constructor initmainargs, 24
|
||||||
|
@ -80,7 +80,7 @@ setterm:sta term ; Set end of argument marker
|
||||||
txa ; Get low byte
|
txa ; Get low byte
|
||||||
add #<args
|
add #<args
|
||||||
sta argv,y ; argv[y]= &arg
|
sta argv,y ; argv[y]= &arg
|
||||||
lda #>0
|
lda #>$0000
|
||||||
adc #>args
|
adc #>args
|
||||||
sta argv+1,y
|
sta argv+1,y
|
||||||
iny
|
iny
|
||||||
|
@ -99,7 +99,7 @@ argloop:lda BASIC_BUF,x
|
||||||
; A contains the terminating character. To make the argument a valid C string,
|
; A contains the terminating character. To make the argument a valid C string,
|
||||||
; replace the terminating character by a zero.
|
; replace the terminating character by a zero.
|
||||||
|
|
||||||
lda #0
|
lda #$00
|
||||||
sta args-1,x
|
sta args-1,x
|
||||||
|
|
||||||
; Check if the maximum number of command line arguments is reached. If not,
|
; Check if the maximum number of command line arguments is reached. If not,
|
||||||
|
@ -130,4 +130,4 @@ args: .res SCREEN_XSIZE * 2 - 1
|
||||||
|
|
||||||
.data
|
.data
|
||||||
argv: .addr name
|
argv: .addr name
|
||||||
.res MAXARGS * 2, 0
|
.res MAXARGS * 2, $00
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
; Graphics driver for the 228x200x3 palette mode on the Atmos
|
; Graphics driver for the 228x200x3 palette mode on the Atmos
|
||||||
;
|
;
|
||||||
; Stefan Haubenthal <polluks@sdf.lonestar.org>
|
; Stefan Haubenthal <polluks@sdf.lonestar.org>
|
||||||
; 2013-07-15, Greg King <gregdk@users.sf.net>
|
; 2014-09-10, Greg King <gregdk@users.sf.net>
|
||||||
;
|
;
|
||||||
|
|
||||||
.include "zeropage.inc"
|
.include "zeropage.inc"
|
||||||
|
@ -275,7 +275,7 @@ mymode: sta PARAM3
|
||||||
lda X1
|
lda X1
|
||||||
add #2 * XSIZE ; Skip screen attribute columns
|
add #2 * XSIZE ; Skip screen attribute columns
|
||||||
sta PARAM1
|
sta PARAM1
|
||||||
lda #0
|
lda #>$0000
|
||||||
sta PARAM1+1
|
sta PARAM1+1
|
||||||
sta PARAM2+1
|
sta PARAM2+1
|
||||||
sta PARAM3+1
|
sta PARAM3+1
|
||||||
|
@ -291,13 +291,13 @@ GETPIXEL:
|
||||||
sta PARAM1
|
sta PARAM1
|
||||||
lda Y1
|
lda Y1
|
||||||
sta PARAM2
|
sta PARAM2
|
||||||
lda #0
|
lda #>$0000
|
||||||
sta PARAM1+1
|
sta PARAM1+1
|
||||||
sta PARAM2+1
|
sta PARAM2+1
|
||||||
jsr POINT
|
jsr POINT
|
||||||
lda PARAM1
|
lda PARAM1
|
||||||
and #%00000001
|
and #%00000001
|
||||||
ldx #0
|
ldx #>$0000
|
||||||
rts
|
rts
|
||||||
|
|
||||||
; ------------------------------------------------------------------------
|
; ------------------------------------------------------------------------
|
||||||
|
@ -323,7 +323,7 @@ LINE:
|
||||||
sta PARAM2+1
|
sta PARAM2+1
|
||||||
lda MODE
|
lda MODE
|
||||||
sta PARAM3
|
sta PARAM3
|
||||||
ldx #>0
|
ldx #>$0000
|
||||||
stx PARAM3+1
|
stx PARAM3+1
|
||||||
jmp DRAW
|
jmp DRAW
|
||||||
|
|
||||||
|
@ -359,7 +359,7 @@ BAR:
|
||||||
|
|
||||||
; ------------------------------------------------------------------------
|
; ------------------------------------------------------------------------
|
||||||
; TEXTSTYLE: Set the style used when calling OUTTEXT. Text scaling in the x
|
; TEXTSTYLE: Set the style used when calling OUTTEXT. Text scaling in the x
|
||||||
; and y directions is passend in X/Y, the text direction is passed in A.
|
; and y directions is passed in X/Y, the text direction is passed in A.
|
||||||
;
|
;
|
||||||
; Must set an error code: NO
|
; Must set an error code: NO
|
||||||
;
|
;
|
||||||
|
@ -369,7 +369,7 @@ TEXTSTYLE:
|
||||||
|
|
||||||
|
|
||||||
; ------------------------------------------------------------------------
|
; ------------------------------------------------------------------------
|
||||||
; OUTTEXT: Output text at X/Y = ptr1/ptr2 using the current color and the
|
; OUTTEXT: Output text at x/y = ptr1/ptr2, using the current color and the
|
||||||
; current text style. The text to output is given as a zero-terminated
|
; current text style. The text to output is given as a zero-terminated
|
||||||
; string with its address in ptr3.
|
; string with its address in ptr3.
|
||||||
;
|
;
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
; Graphics driver for the 240x200x2 monochrome mode on the Atmos
|
; Graphics driver for the 240x200x2 monochrome mode on the Atmos
|
||||||
;
|
;
|
||||||
; Stefan Haubenthal <polluks@sdf.lonestar.org>
|
; Stefan Haubenthal <polluks@sdf.lonestar.org>
|
||||||
; 2013-07-16, Greg King <gregdk@users.sf.net>
|
; 2014-09-10, Greg King <gregdk@users.sf.net>
|
||||||
;
|
;
|
||||||
|
|
||||||
.include "zeropage.inc"
|
.include "zeropage.inc"
|
||||||
|
@ -254,7 +254,7 @@ SETPIXEL:
|
||||||
mymode: sta PARAM3
|
mymode: sta PARAM3
|
||||||
lda X1
|
lda X1
|
||||||
sta PARAM1
|
sta PARAM1
|
||||||
lda #0
|
lda #>$0000
|
||||||
sta PARAM1+1
|
sta PARAM1+1
|
||||||
sta PARAM2+1
|
sta PARAM2+1
|
||||||
sta PARAM3+1
|
sta PARAM3+1
|
||||||
|
@ -270,13 +270,13 @@ GETPIXEL:
|
||||||
sta PARAM1
|
sta PARAM1
|
||||||
lda Y1
|
lda Y1
|
||||||
sta PARAM2
|
sta PARAM2
|
||||||
lda #0
|
lda #>$0000
|
||||||
sta PARAM1+1
|
sta PARAM1+1
|
||||||
sta PARAM2+1
|
sta PARAM2+1
|
||||||
jsr POINT
|
jsr POINT
|
||||||
lda PARAM1
|
lda PARAM1
|
||||||
and #%00000001
|
and #%00000001
|
||||||
ldx #0
|
ldx #>$0000
|
||||||
rts
|
rts
|
||||||
|
|
||||||
; ------------------------------------------------------------------------
|
; ------------------------------------------------------------------------
|
||||||
|
@ -302,7 +302,7 @@ LINE:
|
||||||
sta PARAM2+1
|
sta PARAM2+1
|
||||||
lda MODE
|
lda MODE
|
||||||
sta PARAM3
|
sta PARAM3
|
||||||
ldx #>0
|
ldx #>$0000
|
||||||
stx PARAM3+1
|
stx PARAM3+1
|
||||||
jmp DRAW
|
jmp DRAW
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
.proc _toascii
|
.proc _toascii
|
||||||
|
|
||||||
; .X must be zero, on return.
|
; .X must be zero, on return.
|
||||||
ldx #>0
|
ldx #>$0000
|
||||||
rts
|
rts
|
||||||
|
|
||||||
.endproc
|
.endproc
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
; Driver for the Inkwell Systems 170-C and 184-C lightpens.
|
; Driver for the Inkwell Systems 170-C and 184-C lightpens.
|
||||||
;
|
;
|
||||||
; 2014-04-26, Christian Groessler
|
; 2014-04-26, Christian Groessler
|
||||||
; 2014-05-01, Greg King
|
; 2014-09-10, Greg King
|
||||||
;
|
;
|
||||||
|
|
||||||
.include "zeropage.inc"
|
.include "zeropage.inc"
|
||||||
|
@ -118,6 +118,8 @@ old_irq: .res 2
|
||||||
; Default Inkwell calibration.
|
; Default Inkwell calibration.
|
||||||
; The first number is the width of the left border;
|
; The first number is the width of the left border;
|
||||||
; the second number is the actual calibration value.
|
; the second number is the actual calibration value.
|
||||||
|
; See a comment below (at "Calculate the new X co-ordinate")
|
||||||
|
; for the reason for the third number.
|
||||||
|
|
||||||
XOffset: .byte (24 + 24) / 2 ; x-offset
|
XOffset: .byte (24 + 24) / 2 ; x-offset
|
||||||
|
|
||||||
|
@ -190,11 +192,11 @@ INSTALL:
|
||||||
; Because it's called via "rts", we must decrement it by one.
|
; Because it's called via "rts", we must decrement it by one.
|
||||||
iny
|
iny
|
||||||
lda old_irq
|
lda old_irq
|
||||||
sub #<1
|
sub #<$0001
|
||||||
sta (ptr3),y
|
sta (ptr3),y
|
||||||
iny
|
iny
|
||||||
lda old_irq+1
|
lda old_irq+1
|
||||||
sbc #>1
|
sbc #>$0001
|
||||||
sta (ptr3),y
|
sta (ptr3),y
|
||||||
cli
|
cli
|
||||||
|
|
||||||
|
@ -334,7 +336,7 @@ MOVE: sei ; No interrupts
|
||||||
|
|
||||||
BUTTONS:
|
BUTTONS:
|
||||||
lda Buttons
|
lda Buttons
|
||||||
ldx #>0
|
ldx #>$0000
|
||||||
|
|
||||||
; Make the lightpen buttons look like a 1351 mouse.
|
; Make the lightpen buttons look like a 1351 mouse.
|
||||||
|
|
||||||
|
@ -434,7 +436,7 @@ IRQ: jsr CPREP
|
||||||
|
|
||||||
sub #50
|
sub #50
|
||||||
tay ; Remember low byte
|
tay ; Remember low byte
|
||||||
ldx #>0
|
ldx #>$0000
|
||||||
|
|
||||||
; Limit the Y co-ordinate to the bounding box.
|
; Limit the Y co-ordinate to the bounding box.
|
||||||
|
|
||||||
|
@ -475,7 +477,7 @@ IRQ: jsr CPREP
|
||||||
|
|
||||||
asl a
|
asl a
|
||||||
tay ; Remember low byte
|
tay ; Remember low byte
|
||||||
lda #>0
|
lda #>$0000
|
||||||
rol a
|
rol a
|
||||||
tax ; Remember high byte
|
tax ; Remember high byte
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
;
|
;
|
||||||
; Driver for the Inkwell Systems 170-C and 184-C lightpens.
|
; Driver for the Inkwell Systems 170-C and 184-C lightpens.
|
||||||
;
|
;
|
||||||
; 2013-07-01, Greg King
|
; 2014-09-10, Greg King
|
||||||
;
|
;
|
||||||
|
|
||||||
.include "zeropage.inc"
|
.include "zeropage.inc"
|
||||||
|
@ -102,6 +102,8 @@ OldPenY: .res 1
|
||||||
; Default Inkwell calibration.
|
; Default Inkwell calibration.
|
||||||
; The first number is the width of the left border;
|
; The first number is the width of the left border;
|
||||||
; the second number is the actual calibration value.
|
; the second number is the actual calibration value.
|
||||||
|
; See a comment below (at "Calculate the new X co-ordinate")
|
||||||
|
; for the reason for the third number.
|
||||||
|
|
||||||
XOffset: .byte (24 + 24) / 2 ; x-offset
|
XOffset: .byte (24 + 24) / 2 ; x-offset
|
||||||
|
|
||||||
|
@ -260,7 +262,7 @@ MOVE: sei ; No interrupts
|
||||||
|
|
||||||
BUTTONS:
|
BUTTONS:
|
||||||
lda Buttons
|
lda Buttons
|
||||||
ldx #>0
|
ldx #>$0000
|
||||||
|
|
||||||
; Make the lightpen buttons look like a 1351 mouse.
|
; Make the lightpen buttons look like a 1351 mouse.
|
||||||
|
|
||||||
|
@ -360,7 +362,7 @@ IRQ: jsr CPREP
|
||||||
|
|
||||||
sub #50
|
sub #50
|
||||||
tay ; Remember low byte
|
tay ; Remember low byte
|
||||||
ldx #>0
|
ldx #>$0000
|
||||||
|
|
||||||
; Limit the Y co-ordinate to the bounding box.
|
; Limit the Y co-ordinate to the bounding box.
|
||||||
|
|
||||||
|
@ -401,7 +403,7 @@ IRQ: jsr CPREP
|
||||||
|
|
||||||
asl a
|
asl a
|
||||||
tay ; Remember low byte
|
tay ; Remember low byte
|
||||||
lda #>0
|
lda #>$0000
|
||||||
rol a
|
rol a
|
||||||
tax ; Remember high byte
|
tax ; Remember high byte
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
; 2003-03-07, Ullrich von Bassewitz,
|
; 2003-03-07, Ullrich von Bassewitz,
|
||||||
; based on code from Stefan A. Haubenthal, <polluks@web.de>
|
; based on code from Stefan A. Haubenthal, <polluks@web.de>
|
||||||
; 2005-02-26, Ullrich von Bassewitz
|
; 2005-02-26, Ullrich von Bassewitz
|
||||||
; 2014-04-02, Greg King
|
; 2014-09-10, Greg King
|
||||||
;
|
;
|
||||||
; Scan a group of arguments that are in BASIC's input-buffer.
|
; Scan a group of arguments that are in BASIC's input-buffer.
|
||||||
; Build an array that points to the beginning of each argument.
|
; Build an array that points to the beginning of each argument.
|
||||||
|
@ -106,7 +106,7 @@ setterm:sta term ; Set end-of-argument marker
|
||||||
txa ; Get low byte
|
txa ; Get low byte
|
||||||
add #<BASIC_BUF
|
add #<BASIC_BUF
|
||||||
sta argv,y ; argv[y]= &arg
|
sta argv,y ; argv[y]= &arg
|
||||||
lda #>0
|
lda #>$0000
|
||||||
adc #>BASIC_BUF
|
adc #>BASIC_BUF
|
||||||
sta argv+1,y
|
sta argv+1,y
|
||||||
iny
|
iny
|
||||||
|
@ -125,7 +125,7 @@ argloop:lda BASIC_BUF,x
|
||||||
; A contains the terminating character. To make the argument a valid C string,
|
; A contains the terminating character. To make the argument a valid C string,
|
||||||
; replace the terminating character by a zero.
|
; replace the terminating character by a zero.
|
||||||
;
|
;
|
||||||
lda #0
|
lda #$00
|
||||||
sta BASIC_BUF-1,x
|
sta BASIC_BUF-1,x
|
||||||
|
|
||||||
; Check if the maximum number of command-line arguments is reached. If not,
|
; Check if the maximum number of command-line arguments is reached. If not,
|
||||||
|
@ -153,4 +153,4 @@ name: .res NAME_LEN + 1
|
||||||
|
|
||||||
.data
|
.data
|
||||||
argv: .addr name
|
argv: .addr name
|
||||||
.res MAXARGS * 2, 0
|
.res MAXARGS * 2, $00
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
;
|
;
|
||||||
; This driver reads only the main button on the 184-C.
|
; This driver reads only the main button on the 184-C.
|
||||||
;
|
;
|
||||||
; 2013-09-05, Greg King
|
; 2014-09-10, Greg King
|
||||||
;
|
;
|
||||||
|
|
||||||
.include "zeropage.inc"
|
.include "zeropage.inc"
|
||||||
|
@ -103,6 +103,8 @@ OldPenY: .res 1
|
||||||
; Default Inkwell calibration.
|
; Default Inkwell calibration.
|
||||||
; The first number is the width of the left border;
|
; The first number is the width of the left border;
|
||||||
; the second number is the actual calibration value.
|
; the second number is the actual calibration value.
|
||||||
|
; See a comment below (at "Calculate the new X co-ordinate")
|
||||||
|
; for the reason for the third number.
|
||||||
|
|
||||||
XOffset: .byte (24 + 24) / 2 ; x-offset
|
XOffset: .byte (24 + 24) / 2 ; x-offset
|
||||||
|
|
||||||
|
@ -280,7 +282,7 @@ BUTTONS:
|
||||||
asl a ; ... to fire-button bit
|
asl a ; ... to fire-button bit
|
||||||
eor #MOUSE_BTN_LEFT
|
eor #MOUSE_BTN_LEFT
|
||||||
and #MOUSE_BTN_LEFT
|
and #MOUSE_BTN_LEFT
|
||||||
ldx #>0
|
ldx #>$0000
|
||||||
rts
|
rts
|
||||||
|
|
||||||
;----------------------------------------------------------------------------
|
;----------------------------------------------------------------------------
|
||||||
|
@ -362,7 +364,7 @@ IRQ: jsr CPREP
|
||||||
|
|
||||||
sub #50
|
sub #50
|
||||||
tay ; Remember low byte
|
tay ; Remember low byte
|
||||||
ldx #>0
|
ldx #>$0000
|
||||||
|
|
||||||
; Limit the Y co-ordinate to the bounding box.
|
; Limit the Y co-ordinate to the bounding box.
|
||||||
|
|
||||||
|
@ -408,7 +410,7 @@ IRQ: jsr CPREP
|
||||||
|
|
||||||
asl a
|
asl a
|
||||||
tay ; Remember low byte
|
tay ; Remember low byte
|
||||||
lda #>0
|
lda #>$0000
|
||||||
rol a
|
rol a
|
||||||
tax ; Remember high byte
|
tax ; Remember high byte
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
; Driver for a "joystick mouse".
|
; Driver for a "joystick mouse".
|
||||||
;
|
;
|
||||||
; 2009-09-26, Ullrich von Bassewitz
|
; 2009-09-26, Ullrich von Bassewitz
|
||||||
; 2013-09-05, Greg King
|
; 2014-09-10, Greg King
|
||||||
;
|
;
|
||||||
|
|
||||||
.include "zeropage.inc"
|
.include "zeropage.inc"
|
||||||
|
@ -266,7 +266,7 @@ BUTTONS:
|
||||||
; Bits go up when buttons go down.
|
; Bits go up when buttons go down.
|
||||||
|
|
||||||
eor #MOUSE_BTN_LEFT | MOUSE_BTN_RIGHT
|
eor #MOUSE_BTN_LEFT | MOUSE_BTN_RIGHT
|
||||||
ldx #>0
|
ldx #>$0000
|
||||||
rts
|
rts
|
||||||
|
|
||||||
;----------------------------------------------------------------------------
|
;----------------------------------------------------------------------------
|
||||||
|
@ -358,11 +358,11 @@ IRQ: jsr CPREP
|
||||||
|
|
||||||
and #JOY::RIGHT << 4 ; Check RIGHT bit
|
and #JOY::RIGHT << 4 ; Check RIGHT bit
|
||||||
bnz @Right
|
bnz @Right
|
||||||
lda #<-1
|
lda #<-$0001
|
||||||
tax
|
tax
|
||||||
bnz @AddX ; Branch always
|
bnz @AddX ; Branch always
|
||||||
@Right: lda #<1
|
@Right: lda #<$0001
|
||||||
ldx #>1
|
ldx #>$0001
|
||||||
|
|
||||||
; Calculate the new x co-ordinate (--> .YA).
|
; Calculate the new x co-ordinate (--> .YA).
|
||||||
|
|
||||||
|
@ -401,11 +401,11 @@ IRQ: jsr CPREP
|
||||||
|
|
||||||
and #JOY::UP << 4 ; Check UP bit
|
and #JOY::UP << 4 ; Check UP bit
|
||||||
bze @Down
|
bze @Down
|
||||||
lda #<-1
|
lda #<-$0001
|
||||||
tax
|
tax
|
||||||
bnz @AddY
|
bnz @AddY
|
||||||
@Down: lda #<1
|
@Down: lda #<$0001
|
||||||
ldx #>1
|
ldx #>$0001
|
||||||
|
|
||||||
; Calculate the new y co-ordinate (--> .YA).
|
; Calculate the new y co-ordinate (--> .YA).
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
; 2003-03-07, Ullrich von Bassewitz,
|
; 2003-03-07, Ullrich von Bassewitz,
|
||||||
; based on code from Stefan A. Haubenthal, <polluks@web.de>
|
; based on code from Stefan A. Haubenthal, <polluks@web.de>
|
||||||
; 2005-02-26, Ullrich von Bassewitz
|
; 2005-02-26, Ullrich von Bassewitz
|
||||||
; 2014-04-02, Greg King
|
; 2014-09-10, Greg King
|
||||||
;
|
;
|
||||||
; Scan a group of arguments that are in BASIC's input-buffer.
|
; Scan a group of arguments that are in BASIC's input-buffer.
|
||||||
; Build an array that points to the beginning of each argument.
|
; Build an array that points to the beginning of each argument.
|
||||||
|
@ -106,7 +106,7 @@ setterm:sta term ; Set end-of-argument marker
|
||||||
txa ; Get low byte
|
txa ; Get low byte
|
||||||
add #<BASIC_BUF
|
add #<BASIC_BUF
|
||||||
sta argv,y ; argv[y]= &arg
|
sta argv,y ; argv[y]= &arg
|
||||||
lda #>0
|
lda #>$0000
|
||||||
adc #>BASIC_BUF
|
adc #>BASIC_BUF
|
||||||
sta argv+1,y
|
sta argv+1,y
|
||||||
iny
|
iny
|
||||||
|
@ -125,7 +125,7 @@ argloop:lda BASIC_BUF,x
|
||||||
; A contains the terminating character. To make the argument a valid C string,
|
; A contains the terminating character. To make the argument a valid C string,
|
||||||
; replace the terminating character by a zero.
|
; replace the terminating character by a zero.
|
||||||
;
|
;
|
||||||
lda #0
|
lda #$00
|
||||||
sta BASIC_BUF-1,x
|
sta BASIC_BUF-1,x
|
||||||
|
|
||||||
; Check if the maximum number of command-line arguments is reached. If not,
|
; Check if the maximum number of command-line arguments is reached. If not,
|
||||||
|
@ -153,4 +153,4 @@ name: .res NAME_LEN + 1
|
||||||
|
|
||||||
.data
|
.data
|
||||||
argv: .addr name
|
argv: .addr name
|
||||||
.res MAXARGS * 2, 0
|
.res MAXARGS * 2, $00
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
** _scanf.c
|
** _scanf.c
|
||||||
**
|
**
|
||||||
** (c) Copyright 2001-2005, Ullrich von Bassewitz <uz@cc65.org>
|
** (c) Copyright 2001-2005, Ullrich von Bassewitz <uz@cc65.org>
|
||||||
** 2005-01-24, Greg King <greg.king5@ver5z6n.net>
|
** 2014-09-10, Greg King <greg.king5@verizon.net>
|
||||||
**
|
**
|
||||||
** This is the basic layer for all scanf-type functions. It should be
|
** This is the basic layer for all scanf-type functions. It should be
|
||||||
** rewritten in assembly, at some time in the future. So, some of the code
|
** rewritten in assembly, at some time in the future. So, some of the code
|
||||||
|
@ -275,7 +275,7 @@ static void __fastcall__ Error (unsigned char /* Code */)
|
||||||
(char*) __AX__ = JumpBuf;
|
(char*) __AX__ = JumpBuf;
|
||||||
asm ("jsr pushax");
|
asm ("jsr pushax");
|
||||||
asm ("pla");
|
asm ("pla");
|
||||||
asm ("ldx #>0");
|
asm ("ldx #>$0000");
|
||||||
asm ("jmp %v", longjmp);
|
asm ("jmp %v", longjmp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -474,7 +474,7 @@ static char GetFormat (void)
|
||||||
++format;
|
++format;
|
||||||
asm ("ldy #0");
|
asm ("ldy #0");
|
||||||
asm ("lda (regsave),y");
|
asm ("lda (regsave),y");
|
||||||
asm ("ldx #>0");
|
asm ("ldx #>$0000");
|
||||||
return (F = (char) __AX__);
|
return (F = (char) __AX__);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
;
|
;
|
||||||
; 1998-06-02, Ullrich von Bassewitz
|
; 1998-06-02, Ullrich von Bassewitz
|
||||||
; 2013-05-01, Greg King
|
; 2014-09-10, Greg King
|
||||||
;
|
;
|
||||||
; int isgraph (int c);
|
; int isgraph (int c);
|
||||||
;
|
;
|
||||||
|
@ -9,7 +9,7 @@
|
||||||
.include "ctype.inc"
|
.include "ctype.inc"
|
||||||
|
|
||||||
_isgraph:
|
_isgraph:
|
||||||
cpx #>0 ; Char range OK?
|
cpx #>$0000 ; Char range OK?
|
||||||
bne @L1 ; Jump if no
|
bne @L1 ; Jump if no
|
||||||
tay
|
tay
|
||||||
lda __ctype,y ; Get character classification
|
lda __ctype,y ; Get character classification
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
;
|
;
|
||||||
; 1998-06-02, Ullrich von Bassewitz
|
; 1998-06-02, Ullrich von Bassewitz
|
||||||
; 2013-05-01, Greg King
|
; 2014-09-10, Greg King
|
||||||
;
|
;
|
||||||
; int ispunct (int c);
|
; int ispunct (int c);
|
||||||
;
|
;
|
||||||
|
@ -9,7 +9,7 @@
|
||||||
.include "ctype.inc"
|
.include "ctype.inc"
|
||||||
|
|
||||||
_ispunct:
|
_ispunct:
|
||||||
cpx #>0 ; Char range OK?
|
cpx #>$0000 ; Char range OK?
|
||||||
bne @L1 ; Jump if no
|
bne @L1 ; Jump if no
|
||||||
tay
|
tay
|
||||||
lda __ctype,y ; Get character classification
|
lda __ctype,y ; Get character classification
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
; /* Standard C function */
|
; /* Standard C function */
|
||||||
;
|
;
|
||||||
; 2004-11-28, Ullrich von Bassewitz
|
; 2004-11-28, Ullrich von Bassewitz
|
||||||
; 2004-12-21, Greg King
|
; 2014-09-10, Greg King
|
||||||
;
|
;
|
||||||
|
|
||||||
.export _vsscanf
|
.export _vsscanf
|
||||||
|
@ -65,7 +65,7 @@
|
||||||
; Return EOF if we are at the end of the string
|
; Return EOF if we are at the end of the string
|
||||||
|
|
||||||
bne L1
|
bne L1
|
||||||
lda #$FF
|
lda #<-1
|
||||||
tax
|
tax
|
||||||
rts
|
rts
|
||||||
|
|
||||||
|
@ -74,17 +74,17 @@
|
||||||
L1: tax ; Save return value
|
L1: tax ; Save return value
|
||||||
tya ; Low byte of index
|
tya ; Low byte of index
|
||||||
ldy #SSCANFDATA::INDEX
|
ldy #SSCANFDATA::INDEX
|
||||||
add #<1
|
add #<$0001
|
||||||
sta (ptr1),y
|
sta (ptr1),y
|
||||||
iny
|
iny
|
||||||
lda (ptr1),y
|
lda (ptr1),y
|
||||||
adc #>1
|
adc #>$0001
|
||||||
sta (ptr1),y
|
sta (ptr1),y
|
||||||
|
|
||||||
; Return the char just read
|
; Return the char just read
|
||||||
|
|
||||||
txa
|
txa
|
||||||
ldx #>0
|
ldx #>$0000
|
||||||
rts
|
rts
|
||||||
|
|
||||||
.endproc
|
.endproc
|
||||||
|
@ -111,11 +111,11 @@ L1: tax ; Save return value
|
||||||
|
|
||||||
ldy #SSCANFDATA::INDEX
|
ldy #SSCANFDATA::INDEX
|
||||||
lda (ptr1),y
|
lda (ptr1),y
|
||||||
sub #<1
|
sub #<$0001
|
||||||
sta (ptr1),y
|
sta (ptr1),y
|
||||||
iny
|
iny
|
||||||
lda (ptr1),y
|
lda (ptr1),y
|
||||||
sbc #>1
|
sbc #>$0001
|
||||||
sta (ptr1),y
|
sta (ptr1),y
|
||||||
|
|
||||||
; Return c
|
; Return c
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
;
|
;
|
||||||
; int fastcall vcscanf(const char* format, va_list ap);
|
; int fastcall vcscanf(const char* format, va_list ap);
|
||||||
;
|
;
|
||||||
; 2005-01-02, Greg King
|
; 2014-09-10, Greg King
|
||||||
;
|
;
|
||||||
|
|
||||||
.export _vcscanf
|
.export _vcscanf
|
||||||
|
@ -44,7 +44,7 @@ get: ldx pushed
|
||||||
|
|
||||||
; Return the old, pushed-back character (instead of getting a new one).
|
; Return the old, pushed-back character (instead of getting a new one).
|
||||||
;
|
;
|
||||||
dex ; ldx #>0
|
dex ; ldx #>$0000
|
||||||
stx pushed
|
stx pushed
|
||||||
lda back
|
lda back
|
||||||
rts
|
rts
|
||||||
|
@ -58,7 +58,7 @@ L1: jsr _cgetc
|
||||||
pha
|
pha
|
||||||
jsr _cputc
|
jsr _cputc
|
||||||
pla
|
pla
|
||||||
ldx #>0
|
ldx #>$0000
|
||||||
rts
|
rts
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
;
|
;
|
||||||
; 2010-11-02, Ullrich von Bassewitz
|
; 2010-11-02, Ullrich von Bassewitz
|
||||||
; 2014-05-10, Greg King
|
; 2014-09-10, Greg King
|
||||||
;
|
;
|
||||||
; CC65 runtime: 8x8 => 16 signed multiplication
|
; CC65 runtime: 8x8 => 16 signed multiplication
|
||||||
;
|
;
|
||||||
|
@ -23,13 +23,13 @@ imul8x8r16:
|
||||||
sta ptr3
|
sta ptr3
|
||||||
|
|
||||||
imul8x8r16m:
|
imul8x8r16m:
|
||||||
ldx #>0
|
ldx #>$0000
|
||||||
bit ptr3
|
bit ptr3
|
||||||
bpl @L7
|
bpl @L7
|
||||||
dex
|
dex
|
||||||
@L7: stx ptr3+1 ; Extend sign of Left-Hand Side
|
@L7: stx ptr3+1 ; Extend sign of Left-Hand Side
|
||||||
ldy #<0 ; Clear .XY accumulator
|
ldy #<$0000 ; Clear .XY accumulator
|
||||||
ldx #>0
|
ldx #>$0000
|
||||||
lda ptr1
|
lda ptr1
|
||||||
bmi NegMult
|
bmi NegMult
|
||||||
bpl @L2 ; Branch always
|
bpl @L2 ; Branch always
|
||||||
|
|
Loading…
Add table
Reference in a new issue