Path: news.weeg.uiowa.edu!news.uiowa.edu!hobbes.physics.uiowa.edu!math.ohio-state.edu!cs.utexas.edu!swrinde!elroy.jpl.nasa.gov!decwrl!waikato.ac.nz!comp.vuw.ac.nz!actrix.gen.nz!dempson Newsgroups: comp.sys.apple2.programmer Subject: Re: Apple II Rom Card Message-ID: <1993Jul15.120804.23380@actrix.gen.nz> From: dempson@swell.actrix.gen.nz (David Empson) Date: Thu, 15 Jul 1993 12:08:04 GMT Sender: dempson@actrix.gen.nz (David Empson) References: <1993Jul14.032051.19432@vicstoy.UUCP> <1993Jul14.125855.18573@actrix.gen.nz> <1993Jul14.194759.25666@vicstoy.UUCP> Organization: Actrix Information Exchange Lines: 228 In article <1993Jul14.194759.25666@vicstoy.UUCP> aphelps@vicstoy.UUCP (Austin Phelps) writes: > In article <1993Jul14.125855.18573@actrix.gen.nz> dempson@swell.actrix.gen.nz (David Empson) writes: > > > >$D0 contains an optional ROM, called "Programmer's Aid #1". It > > That what I figure. I have no docs for this. I do (possibly even two copies, but I can't find the second one at the moment). The documentation includes complete assembly source code listings of the ROM. I'll summarise the instructions. Some of them are too complicated to describe briefly. Please note that these commands will only work from Integer Basic, _not_ Applesoft! Renumber ======== Load your Integer Basic program. CLR START=nnnn (the first line number to use in your renumbered program) STEP=nn (the increment between line numbers) If you want to renumber the entire program: CALL -10531 If you want to renumber only part of the program also enter: FROM=nnnn (first line number in existing program to renumber) TO=nnnn (last line number in existing program to renumber) CALL -10521 Note: the variable names are not important. The renumber utility uses the first two or four variables defined to specify the parameters. GOTO and GOSUB with an expression will not be renumbered. You cannot use the renumber facility to rearrange the order of the lines. If you try this, you'll get a *** RANGE ERR. I won't describe the Append or Tape Verify utilities unless you really need them (Append only works with Tape). Machine Code Relocator ====================== This is pretty difficult to describe briefly, but I'll try. To install the relocator, get into the monitor and type D4D5G. This installs a Ctrl-Y handler. Next define the source and destination blocks. These are the addresses where the program originally ran, and where it will run after relocation. Note: don't type any spaces in this or the following commands! DEST < SOURCE_START . SOURCE_END ctrl-Y * This is the same syntax as the "move" command, but replace the "M" with a ctrl-Y followed by an asterisk. After defining the blocks, you can start the relocation. For code areas, use: DEST < SOURCE_START . SOURCE_END ctrl-Y (Same as before, but no asterisk after the ctrl-Y). This will move the code, relocating any references in the previously defined "source block" so that they refer to the "destination block". For data areas, use: DEST < SOURCE_START . SOURCE_END M If you are moving/relocating adjacent areas, you can use a shortcut for commands after the first. Just enter: .. SOURCE_END ctrl-Y or .. SOURCE_END M Here is an example given in the manual. The original code runs at $800, and we want to relocate it to $A00. The segments are as follows: $800-$88F Code $890-$8AF Data $8B0-$90F Code $910-$93F Data $940-$97F Code Here is the command sequence to relocate the program. I've used a caret (^) to represent the Control-Y key sequence. D4D5G Install the relocator A00<800.97F^* Define the blocks A00<800.88F^ Relocate first code block ..8AFM Move first data block ..90F^ Relocate next code block ..93FM Move next data block ..97F^ Relocate next code block There are several more complicated examples. RAM Tester ========== This is rather messy. It also uses a Ctrl-Y handler, installed by D5BCG. You can now test a range of memory by entering commands of the form: a . p ctrl-Y where A is the starting address, and P is the number of pages. The number of pages times $100 must be less than or equal to A. You can't use this to test memory below $400, or the language card space. Don't try to test DOS's memory space, unless you've completely un-hooked it. The memory test is destructive. A reasonably full memory test requires 6 commands. 400.4 ctrl-Y 800.8 ctrl-Y 1000.10 ctrl-Y 2000.20 ctrl-Y 4000.40 ctrl-Y 8000.40 ctrl-Y Music ===== POKE 767,pitch POKE 766,duration POKE 765,timbre CALL -10473 Hi-Res Graphics =============== These are the basic of Applesoft's Hi-Res graphics routines, so there are many similarities. There are also many differences. The first line of an INTBASIC program using these routines must be: 0 X0 = Y0 = COLR = SHAPE = ROT = SCALE The last three can be omitted if you aren't using the shape table routines. The order of definition and length of each variable name is critical. If you need to set HIMEM or LOMEM, do that first. Just make sure these are the first variables defined or referenced by the program. The colours are defined using bit patterns: BLACK 0 GREEN 42 (note: you must use LET GREEN=42 if setting up a variable) VIOLET 85 WHITE 127 BLACK2 128 ORANGE 170 BLUE 213 WHITE2 255 The entry points are as follows: INIT -12288 Must be called before anything else! Equivalent of HGR. CLEAR -12274 Clears the current plotting page to black BKGND -11471 Clears the current plotting page to COLR POSN -11527 Position drawing point at X0, Y0 PLOT -11506 Plot single point in colour COLR at X0, Y0 LINE -11500 Draw line from last point to X0, Y0 in colour COLR DRAW -11465 Draw SHAPE using SCALE and ROT at X0, Y0 in COLR DRAW1 -11462 As DRAW, but starts at current drawing point XDRAW -11452 XOR Draw SHAPE using SCALE and ROT at X0, Y0 XDRAW1 -11449 As XDRAW, but starts at current drawing point SHLOAD -11335 Load shape table from tape to $800 and set LOMEM They also mention a FIND routine (-11780) in the list of entry points, but don't document it. It seems to recalculate the current drawing position based on temporary variables containing the base address of the current line and horizontal index and bit mask. Useful memory locations for PEEK and POKE (in hex): Uses $1A-$1D, $26, $27, $30, $53. $320-$321 Most recent X position (PLOT, POSN, LINE, DRAW, DRAW1) $322 Most recent Y position (PLOT, POSN, LINE, DRAW, DRAW1) $323-$325 Temporaries $326 Base address of screen ($20 or $40) - set to $20 by INIT $327 Temporary $328-$329 Base address of shape table (must set before DRAW/DRAW1) $32A Shape table collision counter The XDRAW routines aren't listed in the entry points given in the text, but are in the assembly listing. As far as I can tell from a quick glance, the shape table definition is the same as in Applesoft. Returning to the questions in the message to which I'm replying: > >Don't try to use 80 columns, though. :-) > > With the Slot 3 in a unknown status who know what it will do It won't work. The IIe 80 column routines are in the motherboard monitor ROM. 80-columns should work on a II+, though. > Does the card use the INH line to gain control of the ROMS? Yes. -- David Empson dempson@swell.actrix.gen.nz Snail mail: P.O. Box 27-103, Wellington, New Zealand