j%+X***************************************+X* ATARI PRINTSCREEN *+X* This program was written using *+X* MAC65. By Steve Derderian *+X* (c) 1989 ANTIC PUBLISHING, INC. *+X* Date Written: November 2, 1988 *$+X* *.+X***************************************8X*B3START@;;Initial load address for the programL7DOSINI ;;Vector to the DOS initialization routineV6POKMSK;;Interupt request enable shadow register`$SAVMSCX;;Pointer to screen RAMj3ZMEMLO;;Work area used by relocation sectiont2C0;;Work areas used by print screen section~1C1;;Data residing between $CB and $CE will1C2;;be destroyed when print screen is used7VKEYBD;;Vector to the keyboard interupt routine!RUNAD;;DOS run after load#MEMLO;;Everyone knows MEMLO,HATABS;;Device handler address table@KBCODE ;;KBCODE is the register used to store a key press8IRQEN;;The real interupt request enable registerX* START+X***************************************+X* *+X* This program consists of three *+X* sections. The first section is * +X* responsible for loading the program *+X* at START ($4000), modifying the *+X* rest of the program to run at LOMEM *(+X* (actual address unknown until run *2+X* time), and moving the program to *<+X* LOMEM. *F+X* *P+X* The following section of the *Z+X* program is not moved to LOMEM so it *d+X* does not take up any memory in your *n+X* computer. *x+X* *+X***************************************X*$>;;Search the handler'P01QHATABS9;;address table lookingR> P;;for the printerFP02;;device handler.2;;Each handler entry2;;consists of three 2;;bytes.HP01;;Not found, try again.X*P02QHATABS9;;Found P:.#PC0;;Move the address of the#QHATABS9;;P: vector table toPC0;;page 0.X*"%>;;Pick up the address of,#Q@C07;;the P: put byte routine.6>@3J Q@C07T?^$2;;The table contains the addressh!HP03;;of the routine minus 1.r"3;;Add 1 to so we can do a JSR.|X*)P03&P17;;Store the address of the &P20;;put byte routine in!'P17;;section three of the'P20;;program.X*#QVKEYBD;;Save the address of!PP10;;the current keyboard!QVKEYBD;;interupt routine. PP10X*#QDOSINI;;Save the address of"PP06;;the current DOS resetQDOSINI;;routine. PP06X*,$MEMLO;;MEMLO points to the last byte&+%MEMLO;;used by DOS. We need to add0!2;;1 to MEMLO so we don't step:HP04;;on that byte.D3N)P04&ZMEMLO;;Stash the address forX'ZMEMLO;;use later.b(&P07;;Section two of this programl*'P07;;also needs to remember MEMLO.vX*',;;Add MEMLO to the relative address!A;;of the print screen routine(O>4P09P06;;(section three) so that!PP08;;we can calculate itsC;;absolute address.O>5P09P06 PP08X*',;;Add MEMLO to the relative address A;;of the internal to atascii$O>4INTATAP06;;conversion table$PP14;;so we can calculate itsC;;absolute address.O>5INTATAP06  PP14X* ',;;Add MEMLO to the relative address*A;;of the printer code 4$O>4OUTTBLP06;;conversion table>$PP15;;so we can calculate itsHC;;absolute address.RO>5OUTTBLP06\ PP15fX*p+%>PGMENDP06;;Move sections two andz#P05QP068;;three down to MEMLO. P@ZMEMLO71)>HP05-FP07;;UNCONDITIONAL SKIP. 1ST TIME ONLY.X*+X***************************************+X* *+X* This is section two. It is *+X* responsible for protecting our *+X* program and installing (and *+X* reinstalling) the print screen *+X* program each time the system reset * +X* button is pressed. * +X* * +X* This section (except for the first *$ +X* JSR) is also performed when the *. +X* program is initially loaded from *8 +X* DOS. *B +X* *L +X***************************************V X*` 5P06 ;;Call the old DOS initialization routine.j X*t 2P07$>;;Change the DOS initialization routine~ %>;;vector to point to our '&DOSINI;;initialization routine. 'DOSINI X* (,;;Raise MEMLO so that our program is QMEMLO;;protected. O>4PGMENDP06 PMEMLO QMEMLO O>5PGMENDP06 PMEMLO X* )P08$>;;Change the keyboard interupt %>;;vector to point to $&VKEYBD;;our interupt handler 'VKEYBD;;(section three). X*( 0:;;Return to DOS (or the OS if system reset).2 X*< +X***************************************F +X* *P +X* This is section three. It is the *Z +X* part of the program that actually *d +X* performs the screen print function. *n +X* (This is why we did all of that *x +X* stuff above.) * +X* * +X* This section is called each time a * +X* key is pressed. * +X* * +X*************************************** X* =P09QKBCODE;;Pick up the code from the keyboard register. "R>;;Was it P? FP11;;YES! X* (P10!;;NO! - Let the OS handle it. X* +P11A;;Since this is an interupt routine #5;;we are responsible for saving !C;;all of the registers. (The &5;;A-register was saved by the OS.)" +QPOKMSK;;We don't have to do this, but , !5;;we want to save POKMSK too.6 X*@ (M>?;;0011 1111 Turn off keyboard andJ !PPOKMSK;;break key interupts.T PIRQENY .;;Allow SIO Interrupts...^ X*h ,Q>;;C0 holds the index into screen RAM.r PC0| X* $Q>4;;C1 holds the counter used #PC1;;to tell us when we have "Q>5;;finished coping all 960 1PC1;;bytes from the screen to the printer. X* $P12Q>(;;C2 counts from 40 to 0. 3PC2;;When it hits 0, we do a printer line feed. X* P13%C0;;Recall the index. ,Q@SAVMSC7;;Pick up the screen character. #5;;Convert it from internal code U?;;to ATASCII. (Trust me.) U? U? U? M>& >0 7: M>D P14L9N >X 7P15Q9;;Pick up the equilivant printer character.b %(> ;;Was the character < a space?l DP16;;YES!v -A;;NO! - bring it back. It was OK before. R> |;;Virgule? HP16;;NO! - print it Q>;;YES! - change to solid X* P16$>;;For XL/XE machines. !P17 ;;Print the character. X* *#C0;;NO! - Increment our screen index. -HP18;;If the index rolls from $FF to $00, -#SAVMSC;;increment the screen address. X* *P18"C1;;Decrement our 960 counter. HP19 "C1 X* %P19"C2;;Decrement our 40 counter -HP21;;It's not zero. Aren't we done yet?* X*4 %Q>;;It was zero, do a line feed.> $>;;For XL/XE machines.H !P20 ;;Print the character.R X*\ P21QC1f MC1p R>;;Did we hit -1?z #FP22;;YES! - We're almost done. X* QC2 #HP13;;Haven't filled a line yet /FP12;;UNCONDITIONAL - reset the 40 counter. X* 'P22"SAVMSC;;Restore the pointer "SAVMSC;;to screen RAM. "SAVMSC X* Q>;;Clear the key press so *PKBCODE;;we don't get stuck in a loop. X* 7;;Restore the interuptPPOKMSK;;request register. PIRQEN 7;;Restore the CPU registers.$?.78>B7L9;;Return from the interupt.VX*`+X***************************************j+X* *t+X* The following table is used to *~+X* convert the ATASCII graphics *+X* character to the equilivant *+X* IBM printer character. If you have *+X* Panasonic, Epson, or any other *+X* printer that supports IBM graphics *+X* characters, this should work fine. *+X* The table will also protect you *+X* from the escape or other printer *+X* control characters. *+X* *+X* If this program does not work *+X* properly with your printer, you may *+X* have to modify this table. *+X* * +X***************************************"OUTTBL A/\͊A A̬ӿԕA(X*2+X***************************************<+X* *F+X* The following table is used to *P+X* convert screen characters to *Z+X* ATASCII characters. DON'T CHANGE *d+X* IT. *n+X* *x+X***************************************INTATA  =@==`X*+X***************************************+X* *+X* The following message places the *+X* program name and version number in *+X* the object code created by the *+X* Assembler. This is so you can see *+X* if you are running an old version *+X* of the program. *+X* *+X* This message is not copied down to *+X* LOMEM after the program is loaded *+X* so it will not take up any extra *+X* memory in your computer. *+X* *"+X***************************************,4PGMEND APRTSCRN VERSION 1.3 (C) ANTIC MAGAZINEA6 RUNAD@' START;;Tell DOS to run the program