This source code is copyrighted and in order to view, 
download, or use it you must be the owner of the
Graphically speaking book by Mark Pelczarski.  SEE NOTE
there are some problems with this code, introduced by me
typing it in.  email me if you want the fixed version on a dsk

table driven HGR access is easy:

make the table:

make the graphics:

draw the shapes on screen:

SCRN function for HGR screen: 

	org $6000
xbyte 	equ 0
xbit 	equ 1
yloc 	equ 2
xcount 	equ 3
scx 	equ $4		; screenx
slo 	equ $06		; screenline address
shi 	equ $07
width 	equ $08
height 	equ $09
thi 	equ $7000	; y lookup table
tlo 	equ $70c0
shape  	equ $8000	; shape location
start 	ldy #0
	lda scx
dloop 	cmp #7		; this is a cheap division
	bcc ddone	; that can be avoided
	sbc #7
	jmp dloop
ddone 	sta xbit	; division done
	sty xbyte
	ldy #$0e	; get height and width
	lda shape,y
	sta width
	lda shape,y
	sta height
	lda xbit	; get individual shape
	asl		; offeset and add to start
	tay		; of shape's table
	lda shape,y
	lda shape,y
	adc #shape
	sta block1+2
	ldx #0		; to start shape
loop1 	lda width 	; # of hor. bytes
	sta xcount
	ldy yloc
	cpy #$c0	; check if off screen
	bcc ytable
	ldy #$29	; off screen, end line
	bcs loop2
ytable 	lda tlo,y
	sta slo
	lda thi,y
	sta shi
	ldy xbyte
loop2 	cpy #$28	; check if off screen
	bcs cont
block1 	lda shape,x	; this code gets modified
	sta (slo),y	; put it on screen
cont 	inx 		; next shape byte
	iny		; next screen location
	dec xcount	; keep track of width
	bne loop2
	inc yloc	; next y
	dec height	; keep track of height
	bne loop1

you must BLOAD YLOOKUP,A$7000 before you call this code, as well as 

I RECENTLY GOT AN EMAIL FROM MARK P!   Free Newsletters | MSN Featured Offers | Find Message    
      Save Address(es) Block  Previous   Next | Close  
From :    
To :    
Subject :    
Apple II source code  
Date :    
Thu, 31 Jul 2003 19:26:49 -0500  
  Reply  Reply All  Forward    Delete  Put in Folder...InboxSent MessagesDraftsTrash Can   Printer Friendly Version  
I appreciate that you listed the credit for the Apple II source code from
Graphically Speaking, but it's okay with me if you omit the part that says
that people have to own the book to use it.
- Mark Pelczarski
To :    
"richard jackson"   
Subject :    
Re: Apple II source code  
Date :    
Fri, 1 Aug 2003 20:38:50 -0500  
  Reply  Reply All  Forward    Delete  Put in Folder...InboxSent MessagesDraftsTrash Can   Printer Friendly Version  
OK to include original e-mail.
I think I had an XOR version of that same code that was non-destructive to
the background. But the image does get weird coloration when going over a
color background....
We had some background preservation code, too, but that was a loooong time