2002-06-21 12:46:52 +00:00
|
|
|
;
|
|
|
|
; Ullrich von Bassewitz, 21.06.2002
|
|
|
|
;
|
2012-03-04 13:08:54 +00:00
|
|
|
; unsigned char tgi_geterror (void);
|
2002-06-21 16:25:56 +00:00
|
|
|
; /* Return the error code for the last operation. This will also clear the
|
|
|
|
; * error.
|
2002-06-21 13:28:51 +00:00
|
|
|
; */
|
2002-06-21 12:46:52 +00:00
|
|
|
|
|
|
|
.include "tgi-kernel.inc"
|
|
|
|
|
2003-02-11 12:37:46 +00:00
|
|
|
.proc _tgi_geterror
|
2002-06-21 12:46:52 +00:00
|
|
|
|
2002-10-03 13:54:42 +00:00
|
|
|
lda _tgi_drv ; Check if we have a driver
|
|
|
|
ora _tgi_drv+1
|
|
|
|
beq @L1
|
2002-07-07 10:30:31 +00:00
|
|
|
jsr tgi_geterror ; First call driver
|
2002-10-03 13:54:42 +00:00
|
|
|
@L1: ldx #$00 ; Clear high byte
|
2002-07-07 10:30:31 +00:00
|
|
|
ldy _tgi_error ; Test high level error code
|
2002-10-03 13:54:42 +00:00
|
|
|
beq @L2 ; Branch if no high level error code
|
2002-07-07 10:30:31 +00:00
|
|
|
tya ; Use high level code if we have one
|
|
|
|
stx _tgi_error ; Clear high level error code
|
2002-10-03 13:54:42 +00:00
|
|
|
@L2: rts
|
2002-06-21 12:46:52 +00:00
|
|
|
|
2003-02-11 12:37:46 +00:00
|
|
|
.endproc
|