Look for NULL pointer more efficiently.
This commit is contained in:
@@ -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-06-17, Greg King
|
; 2013-07-01, Greg King
|
||||||
;
|
;
|
||||||
|
|
||||||
.include "zeropage.inc"
|
.include "zeropage.inc"
|
||||||
@@ -148,14 +148,13 @@ INSTALL:
|
|||||||
ldx LIBREF+1
|
ldx LIBREF+1
|
||||||
sta ptr1 ; Point to mouse_adjuster
|
sta ptr1 ; Point to mouse_adjuster
|
||||||
stx ptr1+1
|
stx ptr1+1
|
||||||
ldy #0
|
ldy #1
|
||||||
lda (ptr1),y
|
lda (ptr1),y
|
||||||
sta Calibrate+1 ; Point to function
|
bze @L1 ; Don't call pointer if it's NULL
|
||||||
iny
|
sta Calibrate+2 ; Point to function
|
||||||
|
dey
|
||||||
lda (ptr1),y
|
lda (ptr1),y
|
||||||
sta Calibrate+2
|
sta Calibrate+1
|
||||||
ora Calibrate+1 ; Don't call pointer if it's NULL
|
|
||||||
bze @L1
|
|
||||||
lda #<XOffset ; Function will set this variable
|
lda #<XOffset ; Function will set this variable
|
||||||
ldx #>XOffset
|
ldx #>XOffset
|
||||||
jsr Calibrate
|
jsr Calibrate
|
||||||
@@ -164,7 +163,8 @@ INSTALL:
|
|||||||
; It needs to be done here because the lightpen interrupt handler doesn't
|
; It needs to be done here because the lightpen interrupt handler doesn't
|
||||||
; set the lightpen position if it hasn't changed.
|
; set the lightpen position if it hasn't changed.
|
||||||
|
|
||||||
@L1: jsr CHIDE
|
@L1: sei
|
||||||
|
jsr CHIDE
|
||||||
|
|
||||||
lda #<(SCREEN_HEIGHT / 2)
|
lda #<(SCREEN_HEIGHT / 2)
|
||||||
ldx #>(SCREEN_HEIGHT / 2)
|
ldx #>(SCREEN_HEIGHT / 2)
|
||||||
@@ -172,6 +172,7 @@ INSTALL:
|
|||||||
lda #<(SCREEN_WIDTH / 2)
|
lda #<(SCREEN_WIDTH / 2)
|
||||||
ldx #>(SCREEN_WIDTH / 2)
|
ldx #>(SCREEN_WIDTH / 2)
|
||||||
jsr MoveX
|
jsr MoveX
|
||||||
|
cli
|
||||||
|
|
||||||
; Done, return zero.
|
; Done, return zero.
|
||||||
|
|
||||||
|
|||||||
@@ -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-06-17, Greg King
|
; 2013-07-01, Greg King
|
||||||
;
|
;
|
||||||
|
|
||||||
.include "zeropage.inc"
|
.include "zeropage.inc"
|
||||||
@@ -133,14 +133,13 @@ INSTALL:
|
|||||||
ldx LIBREF+1
|
ldx LIBREF+1
|
||||||
sta ptr1 ; Point to mouse_adjuster
|
sta ptr1 ; Point to mouse_adjuster
|
||||||
stx ptr1+1
|
stx ptr1+1
|
||||||
ldy #0
|
ldy #1
|
||||||
lda (ptr1),y
|
lda (ptr1),y
|
||||||
sta Calibrate+1 ; Point to function
|
bze @L1 ; Don't call pointer if it's NULL
|
||||||
iny
|
sta Calibrate+2 ; Point to function
|
||||||
|
dey
|
||||||
lda (ptr1),y
|
lda (ptr1),y
|
||||||
sta Calibrate+2
|
sta Calibrate+1
|
||||||
ora Calibrate+1 ; Don't call pointer if it's NULL
|
|
||||||
bze @L1
|
|
||||||
lda #<XOffset ; Function will set this variable
|
lda #<XOffset ; Function will set this variable
|
||||||
ldx #>XOffset
|
ldx #>XOffset
|
||||||
jsr Calibrate
|
jsr Calibrate
|
||||||
@@ -149,7 +148,8 @@ INSTALL:
|
|||||||
; It needs to be done here because the lightpen interrupt handler doesn't
|
; It needs to be done here because the lightpen interrupt handler doesn't
|
||||||
; set the lightpen position if it hasn't changed.
|
; set the lightpen position if it hasn't changed.
|
||||||
|
|
||||||
@L1: jsr CHIDE
|
@L1: sei
|
||||||
|
jsr CHIDE
|
||||||
|
|
||||||
lda #<(SCREEN_HEIGHT / 2)
|
lda #<(SCREEN_HEIGHT / 2)
|
||||||
ldx #>(SCREEN_HEIGHT / 2)
|
ldx #>(SCREEN_HEIGHT / 2)
|
||||||
@@ -157,6 +157,7 @@ INSTALL:
|
|||||||
lda #<(SCREEN_WIDTH / 2)
|
lda #<(SCREEN_WIDTH / 2)
|
||||||
ldx #>(SCREEN_WIDTH / 2)
|
ldx #>(SCREEN_WIDTH / 2)
|
||||||
jsr MoveX
|
jsr MoveX
|
||||||
|
cli
|
||||||
|
|
||||||
; Done, return zero.
|
; Done, return zero.
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user