.include "tgi-error.inc"
.include "apple2.inc"
- .macpack generic
-
; ------------------------------------------------------------------------
; Zero page stuff
; Must set an error code: NO
LINE:
; nx = abs (x2 - x1)
+ sec
lda X2
- sub X1
+ sbc X1
sta NX
lda X2+1
sbc X1+1
sty NX+1
; ny = abs (y2 - y1)
+ sec
lda Y2
- sub Y1
+ sbc Y1
sta NY
lda Y2+1
sbc Y1+1
: jsr SETPIXEL
; pb = err + ny
+ clc
lda ERR
- add NY
+ adc NY
sta PB
lda ERR+1
adc NY+1
tax
; ub = pb + nx
+ clc
lda PB
- add NX
+ adc NX
sta UB
txa
adc NX+1
lda DX
bpl :+
dex
-: add X1
+: clc
+ adc X1
sta X1
txa
adc X1+1
lda AY
bpl :+
dex
-: add Y1
+: clc
+ adc Y1
sta Y1
txa
adc Y1+1
lda AX
bpl :+
dex
-: add X1
+: clc
+ adc X1
sta X1
txa
adc X1+1
lda DY
bpl :+
dex
-: add Y1
+: clc
+ adc Y1
sta Y1
txa
adc Y1+1
; } (--count)
lda COUNT
- sub #$01
+ sec
+ sbc #$01
sta COUNT
bcc :+
jmp for
tax
tya ; X/A - arg1 (a = high)
- sub TEMP2
+ sec
+ sbc TEMP2
bne :++
cpx TEMP
beq :+
.include "em-kernel.inc"
.include "em-error.inc"
-
- .macpack generic
-
-
; ------------------------------------------------------------------------
; Header. Includes jump table
MAP: sta curpage ; Remember the new page
- add #>BASE
+ clc
+ adc #>BASE
sta ptr1+1
ldy #$00
sty ptr1
cmp #$FF
beq done ; Jump if no page mapped
- add #>BASE
+ clc
+ adc #>BASE
sta ptr2+1
ldy #$00
sty ptr2
transfer:
php
+ clc
lda ptr1
sta $3C
- add ptr4
+ adc ptr4
sta $3E
lda ptr1+1
sta $3D
sta ptr1
ldy #EM_COPY::PAGE
lda (ptr3),y
- add #>BASE
+ clc
+ adc #>BASE
sta ptr1+1 ; From
ldy #EM_COPY::BUF
sta ptr2
ldy #EM_COPY::PAGE
lda (ptr3),y
- add #>BASE
+ clc
+ adc #>BASE
sta ptr2+1 ; To
ldy #EM_COPY::BUF
.include "joy-error.inc"
.include "apple2.inc"
- .macpack generic
-
; ------------------------------------------------------------------------
; Constants