[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Apple II Graphics Programming (Assembly)
cerebral_monkey wrote:
Hello, I posted here a few months ago asking for help learning
assembly language on the Apple //c (under the handle tomatoes, though
I prefer this one, it is an anagram of my name!). I was hoping that I
might get a little bit more help, specifically where graphics
programming is concerned.
I found a cheetsheet from Beagle Bros that lists useful ROM subroutine
calls, one of these (at $F3F2) is purported to clear the high-
resolution screen that is currently being used. But when I try to use
it, I can't seem to get it to work.
Here is the code that I am trying:
ORG $1000
TXTCLR EQU $C050 ; text mode off (graphics on)
MIXCLR EQU $C052 ; mixed mode off
HISCR EQU $C054 ; use HIRES screen 1
HIRES EQU $C057 ; HIRES mode on
CLEAR EQU $F2F3
LDY #$00 ; set graphics modes
STY TXTCLR
STY MIXCLR
STY HIRES
STY HISCR
JSR CLEAR ; CLEAR the screen
TYA
BRK
Am I doing something wrong here? The screen is still filled with
random data after execution. (I wrote a subroutine to clear the
screen, but the built-in version is probably much faster)
Page zero location $E6 must be preset to the graphics page you
are clearing: $20 for HGR1 and $40 for HGR2.
$F2F3 clears the current page to black, but you can set the page
to any color by placing a "color byte" in the A register and calling
$F3F4, or by setting $1C to the desired color byte and calling $F3F6.
I've got my mind set on re-creating pong, and I noticed that there
were some other useful-looking calls that I might be able to use,
including Hi-Res Collision-Check ($E6). Where might I find more on
these calls and how to use them?
The collision counter is incremented when a DRAW or XDRAW changes a
screen 1 to a 0, so it will be greater than zero after the "draw" if
the shape "collided" with something non-black.
(I've frequently used it to "read" the hi-res screen a pixel at a time
by XDRAWing a single-pixel shape and checking the collision counter.)
If anyone might direct me to some more information about this, it
would be greatly appreciated! (I just ordered a book called "Assembly
Language for Applesoft Programmers" that should give me a little bit
more info, but I'm impatient, hah )
What you really want is "All About Applesoft" from Call-A.P.P.L.E.,
and a commented listing of the Applesoft ROMs is also very helpful.
I believe that both are available on the web, though I find myself using
the Applesoft disassembly produced by Sourcerer (on the back side of
Merlin 8) most often.
-michael
NadaNet 3.0 for Apple II parallel computing!
Home page: http://home.comcast.net/~mjmahon/
"The wastebasket is our most important design
tool--and it's seriously underused."