; Switch into graphics mode
jsr HGR
- bit MIXOFF
+ bit MIXOFF
; Done, reset the error code
SETVIEWPAGE:
tax
beq @L1
- bit PG2ON
+ bit PG2ON
rts
-@L1: bit PG2OFF
+@L1: bit PG2OFF
rts
; ------------------------------------------------------------------------
ldy X1+1
lda Y1
jmp HPLOT
-
+
; ------------------------------------------------------------------------
; GETPIXEL: Read the color value of a pixel and return it in A/X. The
; coordinates passed to this function are never outside the visible screen
GETPIXEL:
- ldx X1
- ldy X1+1
- lda Y1
- jsr HPOSN ; 1st pixel
-HBASL = $26
-HMASK = $30
- ldx #0
- lda (HBASL),y
- and HMASK
- beq @L1
- inx
-@L1: stx tmp1
- lda $E0 ; which neighbour
- tax
- and #$01
- bne @odd
- asl tmp1
- inx
- .byte $24
-@odd: dex
- ldy $E1
- lda $E2
- jsr HPOSN ; 2nd pixel
- ldx #0
- lda (HBASL),y
- and HMASK
- beq @L2
- inx
-@L2: txa
- ora tmp1
- ldx #0
- rts
+ ldx X1
+ ldy X1+1
+ lda Y1
+ jsr HPOSN ; 1st pixel
+HBASL = $26
+HMASK = $30
+ ldx #0
+ lda (HBASL),y
+ and HMASK
+ beq @L1
+ inx
+@L1: stx tmp1
+
+ lda $E0 ; which neighbour
+ tax
+ and #$01
+ bne @odd
+ asl tmp1
+ inx
+ .byte $24
+@odd: dex
+
+ ldy $E1
+ lda $E2
+ jsr HPOSN ; 2nd pixel
+ ldx #0
+ lda (HBASL),y
+ and HMASK
+ beq @L2
+ inx
+@L2: txa
+ ora tmp1
+ ldx #0
+ rts
; ------------------------------------------------------------------------
; LINE: Draw a line from X1/Y1 to X2/Y2, where X1/Y1 = ptr1/ptr2 and
;
LINE:
- ldx X1
- ldy X1+1
- lda Y1
- jsr HPOSN
- lda X2
- ldx X2+1
- ldy Y2
- jmp HLIN
+ ldx X1
+ ldy X1+1
+ lda Y1
+ jsr HPOSN
+ lda X2
+ ldx X2+1
+ ldy Y2
+ jmp HLIN
; ------------------------------------------------------------------------
; BAR: Draw a filled rectangle with the corners X1/Y1, X2/Y2, where
; Contrary to most other functions, the graphics kernel will sort and clip
; the coordinates before calling the driver, so on entry the following
; conditions are valid:
-; X1 <= X2
-; Y1 <= Y2
-; (X1 >= 0) && (X1 < XRES)
-; (X2 >= 0) && (X2 < XRES)
-; (Y1 >= 0) && (Y1 < YRES)
-; (Y2 >= 0) && (Y2 < YRES)
+; X1 <= X2
+; Y1 <= Y2
+; (X1 >= 0) && (X1 < XRES)
+; (X2 >= 0) && (X2 < XRES)
+; (Y1 >= 0) && (Y1 < YRES)
+; (Y2 >= 0) && (Y2 < YRES)
;
; Must set an error code: NO
;
abs:
; a/y := abs(a/y)
- dey
- iny
+ cpy #0
bpl @L1
; negay
clc
;
-; Ullrich von Bassewitz, 2003-11-12
+; Ullrich von Bassewitz, 31.05.2002
;
-; Apple ][ mode table for tgi_map_mode
+; Apple II mode table for tgi_map_mode
;
- .export _tgi_mode_table
+ .export _tgi_mode_table
.include "tgi-mode.inc"
.rodata
_tgi_mode_table:
- .byte TGI_MODE_280_192_6, "apple2-280-192-6.tgi", 0
- .byte 0 ; End marker
-
-
+ .byte TGI_MODE_280_192_6, "APPLE2.HI.TGI", 0
+ .byte TGI_MODE_40_40_16, "APPLE2.LO.TGI", 0
+; .byte TGI_MODE_560_192_2, "APPLE2.DHI.TGI", 0
+ .byte 0 ; End marker