Make your own free website on Tripod.com
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
AT BOTTOM OF PAGE
there are some problems with this code, introduced by me
typing it in.  email me if you want the fixed version on a dsk
image.


table driven HGR access is easy:

make the table:
http://rich12345.tripod.com/prog/lookupgen.html

make the graphics:
http://rich12345.tripod.com/bse/index.html

draw the shapes on screen:
http://rich12345.tripod.com/srccode/graphic.html

SCRN function for HGR screen:
http://rich12345.tripod.com/prog/hirescrn.html 



	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
	clc
dloop 	cmp #7		; this is a cheap division
	bcc ddone	; that can be avoided
	sec
	sbc #7
	iny
	clc
	jmp dloop
ddone 	sta xbit	; division done
	sty xbyte
	ldy #$0e	; get height and width
	lda shape,y
	sta width
	iny
	lda shape,y
	sta height
	lda xbit	; get individual shape
	asl		; offeset and add to start
	tay		; of shape's table
	lda shape,y
	tax
	iny
	lda shape,y
	clc
	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
	rts


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




I RECENTLY GOT AN EMAIL FROM MARK P!
aiiadict@NOWAY.com   Free Newsletters | MSN Featured Offers | Find Message    
 
  
      Save Address(es) Block  Previous   Next | Close  
   
From :    
"STAYAWAY JUNKMAIL"   
    
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
*****************************************8
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
ago!
-Mark