💾 Archived View for mirrors.apple2.org.za › archive › ground.icaen.uiowa.edu › apple8 › Pgms › ZBLOC… captured on 2024-07-09 at 03:22:36.

View Raw

More Information

⬅️ Previous capture (2023-01-29)

-=-=-=-=-=-=-


TBLSTART EQU $06 ;START OF SHAPE
COUNTER EQU $08 ;# LINES COMPLETED
PNTR EQU $0B ;SCREEN POINTER
YNOW EQU $0D ;CURRENT LINE
SCREEN EQU $26 ;HPOSN RETURNS THIS
WIDTH EQU $FB
HEIGHT EQU $FC
XSTART EQU $FD
YSTART EQU $FE
MODE EQU $FF ;TRANSFER MODE

 ORG $9F00

DRAW JMP DRAW1 ;CALL TABLE
XDRAW JMP XDRAW1 ;AVOIDS AN EXTRA
ADRAW JMP ADRAW1 ;POKE THIS WAY
ODRAW JMP ODRAW1 ;
CLIP JMP CLIP1 ;
POINT JMP POINT1 ;COLUMN BASED PNTR

DRAW1 LDA #209 ;SET DRAW MODE
 STA MODE ;& CONT. SETUP
 CLC
 BCC SETUP

XDRAW1 LDA #81 ;SET XDRAW MODE
 STA MODE ;& CONT. SETUP
 CLC
 BCC SETUP

ADRAW1 LDA #49 ;SET AND MODE
 STA MODE ;& CONT. SETUP
 CLC
 BCC SETUP

ODRAW1 LDA #17 ;SET OR MODE
 STA MODE
 CLC
 BCC SETUP

CLIP1 LDA #$91 ;SET MODE VALUE
 STA MODE
 INC TBLSTART ;SKIP STR LEN
 LDY #0 ;STORE SHAPE
 LDA WIDTH ;WIDTH & HEIGHT
 STA (TBLSTART),Y ;IN ICON BUFFER
 INY
 LDA HEIGHT
 STA (TBLSTART),Y
 LDA #PNTR
 STA COLUMN+1
 LDA #TBLSTART
 STA COLUMN+3
 CLC
 BCC BEGIN

POINT1 LDA #81 ;EOR MODE FOR THIS
 STA MODE
 LDA #>ARROW ;POINT TO ICON
 STA TBLSTART
 LDA #<ARROW
 STA TBLSTART+1

SETUP INC TBLSTART ;SKIP STR LEN
 LDY #0
 LDA (TBLSTART),Y ;SET WIDTH
 STA WIDTH
 INY
 LDA (TBLSTART),Y ;SET HEIGHT
 STA HEIGHT
 LDA MODE ;RESTORE MODE AND CONTINUE

 STA COLUMN+2 ;STORE MODE
 LDA #TBLSTART ;AND SETUP
 STA COLUMN+1 ;DISP. MODULE
 LDA #PNTR
 STA COLUMN+3
 BNE BEGIN ;ALWAYS TAKEN

BEGIN LDA YSTART ;GET LINE TO START ON
 STA YNOW ;AND PRESERVE
 LDA #$00
 STA COUNTER ;INIT COUNTER

ROW LDA YNOW ;CURRENT Y VALUE
 LDX #$00 ;XLSB
 LDY #$00 ;XMSB
 JSR HPOSN ;CALC ADDR

 CLC
 LDA SCREEN ;ADJUST FOR X POS.
 ADC XSTART
 STA PNTR
 LDA SCREEN+1
 ADC #$00
 STA PNTR+1
 LDY #$00

COLUMN LDA (TBLSTART),Y
 ORA (PNTR),Y
 STA (PNTR),Y

 INY
 CPY WIDTH ;FINISHED ROW
 BCC COLUMN ;NO, DO NEXT COLUMN

 CLC ;INC PNTRS TO NEXT ROW
 LDA TBLSTART
 ADC WIDTH
 STA TBLSTART
 LDA #$00
 ADC TBLSTART+1
 STA TBLSTART+1

 INC YNOW ;NEXT ROW #
 INC COUNTER
 LDA COUNTER
 CMP HEIGHT
 BNE ROW

 RTS

HPOSN TAY
 LDA TABLE.LO,Y
 STA SCREEN
 LDA TABLE.HI,Y
 STA SCREEN+1
 RTS

ARROW DB 0
 DB 1
;WIDT
 DB 8 ;HEIGHT
 DB %01100000
 DB %01110000
 DB %01111000
 DB %01111100
 DB %01111110
 DB %00001100
 DB %00000110
 DB %00000011

TABLE.HI DB $20,$24,$28,$2C,$30,$34,$38,$3C,$20
 DB $24,$28,$2C,$30,$34,$38,$3C,$21,$25,$29
 DB $2D,$31,$35,$39,$3D,$21,$25,$29,$2D,$31,$35
 DB $39,$3D,$22,$26,$2A,$2E,$32,$36,$3A,$3E,$22
 DB $26,$2A,$2E,$32,$36,$3A,$3E,$23,$27,$2B,$2F
 DB $33,$37,$3B,$3F,$23,$27,$2B,$2F,$33,$37,$3B
 DB $3F,$20,$24,$28,$2C,$30,$34,$38,$3C,$20,$24
 DB $28,$2C,$30,$34,$38,$3C,$21,$25,$29,$2D,$31
 DB $35,$39,$3D,$21,$25,$29,$2D,$31,$35,$39,$3D
 DB $22,$26,$2A,$2E,$32,$36,$3A,$3E,$22,$26,$2A
 DB $2E,$32,$36,$3A,$3E,$23,$27,$2B,$2F,$33,$37
 DB $3B,$3F,$23,$27,$2B,$2F,$33,$37,$3B,$3F,$20
 DB $24,$28,$2C,$30,$34,$38,$3C,$20,$24,$28,$2C
 DB $30,$34,$38,$3C,$21,$25,$29,$2D,$31,$35,$39
 DB $3D,$21,$25,$29,$2D,$31,$35,$39,$3D,$22,$26
 DB $2A,$2E,$32,$36,$3A,$3E,$22,$26,$2A,$2E,$32
 DB $36,$3A,$3E,$23,$27,$2B,$2F,$33,$37,$3B,$3F
 DB $23,$27,$2B,$2F,$33,$37,$3B,$3F

TABLE.LO DB $00,$00,$00,$00,$00,$00,$00,$00,$80
 DB $80,$80,$80,$80,$80,$80,$80,$00,$00,$00
 DB $00,$00,$00,$00,$00,$80,$80,$80,$80,$80,$80
 DB $80,$80,$00,$00,$00,$00,$00,$00,$00,$00,$80
 DB $80,$80,$80,$80,$80,$80,$80,$00,$00,$00,$00
 DB $00,$00,$00,$00,$80,$80,$80,$80,$80,$80,$80
 DB $80,$28,$28,$28,$28,$28,$28,$28,$28,$A8,$A8
 DB $A8,$A8,$A8,$A8,$A8,$A8,$28,$28,$28,$28,$28
 DB $28,$28,$28,$A8,$A8,$A8,$A8,$A8,$A8,$A8,$A8
 DB $28,$28,$28,$28,$28,$28,$28,$28,$A8,$A8,$A8
 DB $A8,$A8,$A8,$A8,$A8,$28,$28,$28,$28,$28,$28
 DB $28,$28,$A8,$A8,$A8,$A8,$A8,$A8,$A8,$A8,$50
 DB $50,$50,$50,$50,$50,$50,$50,$D0,$D0,$D0,$D0
 DB $D0,$D0,$D0,$D0,$50,$50,$50,$50,$50,$50,$50
 DB $50,$D0,$D0,$D0,$D0,$D0,$D0,$D0,$D0,$50,$50
 DB $50,$50,$50,$50,$50,$50,$D0,$D0,$D0,$D0,$D0
 DB $D0,$D0,$D0,$50,$50,$50,$50,$50,$50,$50,$50
 DB $D0,$D0,$D0,$D0,$D0,$D0,$D0,$D0