þþ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*B3…START@;;Initial load address for the programL7†DOSINI ;;Vector to the DOS initialization routineV6†POKMSK;;Interupt request enable shadow register`$†SAVMSCX;;Pointer to screen RAMj3†ZMEMLO°;;Work area used by relocation sectiont2‚C0Ë;;Work areas used by print screen section~1‚C1Ì;;Data residing between $CB and $CE willˆ1‚C2Î;;be destroyed when print screen is used’7†VKEYBD;;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 pressÄ8…IRQENÒ;;The real interupt request enable registerÎX*Ø …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 'ƒP01Q†HATABS9;;address table lookingªR> P;;for the printer´FƒP02;;device handler.¾2;;Each handler entryÈ2;;consists of threeÒ 2;;bytes.ÜHƒP01;;Not found, try again.æX*ðƒP02Q†HATABS9;;Found P:.ú#P‚C0;;Move the address of the#Q†HATABS9;;P: vector table toP‚C0;;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!HƒP03;;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*¸#Q†VKEYBD;;Save the address ofÂ!PƒP10;;the current keyboardÌ!Q†VKEYBD;;interupt routine.Ö PƒP10àX*ê#Q†DOSINI;;Save the address ofô"PƒP06;;the current DOS resetþQ†DOSINI;;routine. PƒP06X*,$…MEMLO;;MEMLO points to the last byte&+%…MEMLO;;used by DOS. We need to add0!2;;1 to MEMLO so we don't step:HƒP04;;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>4ƒP09ƒP06;;(section three) so thatž!PƒP08;;we can calculate its¨C;;absolute address.²O>5ƒP09ƒP06¼ PƒP08ÆX*Ð',;;Add MEMLO to the relative addressÚ A;;of the internal to atasciiä$O>4†INTATAƒP06;;conversion tableî$PƒP14;;so we can calculate itsøC;;absolute address.O>5†INTATAƒP06  PƒP14X* ',;;Add MEMLO to the relative address*A;;of the printer code 4$O>4†OUTTBLƒP06;;conversion table>$PƒP15;;so we can calculate itsHC;;absolute address.RO>5†OUTTBLƒP06\ PƒP15fX*p+%>†PGMENDƒP06;;Move sections two andz#ƒP05QƒP068;;three down to MEMLO.„ P@†ZMEMLO7Ž1˜)>ÿ¢HƒP05¬-FƒP07;;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*` 5ƒP06 ÿÿ;;Call the old DOS initialization routine.j X*t 2ƒP07$>ÿ;;Change the DOS initialization routine~ %>ÿ;;vector to point to ourˆ '&†DOSINI;;initialization routine.’ '†DOSINIœ X*¦ (,;;Raise MEMLO so that our program is° Q…MEMLO;;protected.º O>4†PGMENDƒP06Ä P…MEMLOÎ Q…MEMLOØ O>5†PGMENDƒP06â P…MEMLOì 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*¾ =ƒP09Q†KBCODE;;Pick up the code from the keyboard register.È "R>Ê;;Was it P?Ò FƒP11;;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.)" +Q†POKMSK;;We don't have to do this, but , !5;;we want to save POKMSK too.6 X*@ (M>?;;0011 1111 Turn off keyboard andJ !P†POKMSK;;break key interupts.T P…IRQENY .;;Allow SIO Interrupts...^ X*h ,Q>;;C0 holds the index into screen RAM.r P‚C0| X*† $Q>4¿;;C1 holds the counter used #P‚C1;;to tell us when we haveš "Q>5¿;;finished coping all 960¤ 1P‚C1;;bytes from the screen to the printer.® X*¸ $ƒP12Q>(;;C2 counts from 40 to 0. 3P‚C2;;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 ƒP14Lÿÿ9N >X 7ƒP15Qÿÿ9;;Pick up the equilivant printer character.b %(> ;;Was the character < a space?l DƒP16;;YES!v -A;;NO! - bring it back. It was OK before.€ R> |;;Virgule?Š HƒP16;;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.Ð -HƒP18;;If the index rolls from $FF to $00,Ú -#†SAVMSC;;increment the screen address.ä X*î *ƒP18"‚C1;;Decrement our 960 counter.ø HƒP19 "‚C1 X* %ƒP19"‚C2;;Decrement our 40 counter -HƒP21;;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*\ ƒP21Q‚C1f M‚C1p R>ÿ;;Did we hit -1?z #FƒP22;;YES! - We're almost done.„ X*Ž Q‚C2˜ #HƒP13;;Haven't filled a line yet¢ /FƒP12;;UNCONDITIONAL - reset the 40 counter.¬ X*¶ 'ƒP22"†SAVMSC;;Restore the pointerÀ "†SAVMSC;;to screen RAM.Ê "†SAVMSCÔ X*Þ Q>ÿ;;Clear the key press soè *P†KBCODE;;we don't get stuck in a loop.ò X*ü 7;;Restore the interuptP†POKMSK;;request register. P…IRQEN 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***************************************,4†PGMEND A¦PRTSCRN VERSION 1.3 (C) ANTIC MAGAZINEA6 …RUNAD@' …START;;Tell DOS to run the program