From nathan%cco.caltech.edu@caen.engin.umich.edu Tue Jan 19 19:02:57 1993 Received: from srvr2.engin.umich.edu by caen.engin.umich.edu (5.64/1.35) id 5daaf46b6.001024b; Tue, 19 Jan 93 19:02:52 -0500 Received: from geech.gnu.ai.mit.edu by srvr2.engin.umich.edu (5.64/1.35) id AA12824; Tue, 19 Jan 93 19:02:49 -0500 Received: from punisher.cco.caltech.edu by geech.gnu.ai.mit.edu (5.65/4.0) with SMTP id ; Tue, 19 Jan 93 18:59:27 -0500 Received: from scratchy.cco.caltech.edu by punisher.caltech.edu (4.1/DEI:4.41) id AA19402; Tue, 19 Jan 93 15:58:37 PST From: nathan@cco.caltech.edu (Nathan Mates) Received: by scratchy.cco.caltech.edu (NX5.67c/UGCS:4.26) id AA00823; Tue, 19 Jan 93 15:58:16 -0800 Date: Tue, 19 Jan 93 15:58:16 -0800 Message-Id: <9301192358.AA00823@scratchy.cco.caltech.edu> Received: by NeXT.Mailer (1.87.1) Received: by NeXT Mailer (1.87.1) To: freetool-gs-programming-list@gnu.ai.mit.edu Subject: Are we still up and running? Status: R I haven't gotten any email from the group for some time now; did it die without a trace? Anyway, I've seen a bunch of tricks posted here, and I'd like to post something that people may want, a 16-bit joystick mode routine, and a request for a fast line- drawing routine (such as in Modulae?). The following is a 16-bit assembley routine to read both paddles at once sent to my by Jim Maricondo, the author of Twilight II. In 2.8 MHz mode, it works almost exactly like the // Rom code PRead called thru FWEntry, which is a nice feature. I'm not too sure of the copyright on the code, so if anyone could clarify it for me, I'd be glad to acknowledge it. Path: Assembly (6502/65816)/Asm65816 Code Wanted... Subj: My code... 92-10-21 22:48:08 EST >From: AFL GaryJ Posted on: America Online > Here's the code I used. There are a few things to keep in mind with > this code: Because I'm using wide registers, the X and Y values of > the joystick may come back with values greater than $FF. The size of > the number returned depends (in part) upon the speed of the machine > that the code is running on. Accellerated IIGS's will return greater > values than stock 2.8 MHz machines. Having the user do a joystick > calibration at the start of the program would be one way of solving > this problem. > > Also, because the maximum joystick value returned is not "clipped off" (i.e. maxed out at $FF), the X and Y maximum returned values may > differ, depending on the model and wear of your joystick. > > And one last thing: The timing cycles of my routine are greater than > the sum of the cycles required to execute the standard paddle reading > routine built into the II+ ROM. But, since my routine will execute > at speeds greater than 1 MHz, the net difference results in a faster > joystick read. That, coupled with the fact that both paddles are > read at the same time, makes this routine much faster than the standard ROM call. > > I haven't looked at this code for a long time, and I'm sure there are > ways to improve it. Anyone, feel free to post possible enhancements! > ; > ; Read the joystick controls: > PRead anop > php > sei > lda >$00C070 ; trigger paddles (6) > ldy #0 ; (3) > ldx #3 ; (3) > PRtime dex ; (2) > bne PRtime ; timing loop for 1st count (2,3) > PRead2 lda >$00C064 ; check paddle 0,1 status (6) > and #$8080 ; check high bits of each (3) > beq PRXit ; exit if both are done (2) > cmp #$0080 ; see if X only is active (3) > bmi PRBoth ; > no, do both (2,3) > beq PRXOnly ; > X axis only (2,3) > PRYonly iny ; (2) > bpl PRYmore ; (just for timing) (3) > bmi PRXit ; (prevent endless loop) > PRYmore bra PRead2 ; go back for more (3) > PRXOnly inx ; (2) > bmi PRXit ; (prevent endless loop) (2) > bra PRead2 ; go back for more (3) > PRBoth inx ; (2) > iny ; (2) > nop ; match timing of others (2) > bpl PRead2 ; (3) > PRXit plp > rts ; x = pdl(0), y = pdl(1) > > Nathan Mates nathan@cco.caltech.edu ********************************************************************* *I ALSO HAVE: (NeXTMail or Text Format) * *Political Incorrectness: * * Bill Clinton Jokes Lawyer Jokes * * 35 Truths Of Life Blonde Jokes * *Outright Plagarism (Scripts to) * * Monty Python & The Holy Grail Meaning of Life * * Life of Brian (Incomplete, as far as I know) * * Airplane 1 * *Computer Humor: * * Bastard Operator From Hell-- Computer series * * Computer Jokes Hacker Test 1.1 * * Real Programmers... Nerd Tests * *Other Stuff: * * Lightbulb Jokes Car Acronyms * * Murphy's Law stuff Answering Machine Messages * * Deep Thoughts Steven Wright Quotes * * Taglines Sexual Job Descriptions * * Joke Forms Chicken Cross Road Explanations * * Various Insults Lists of Everything * * Mommy^2 Jokes Star Trek Parodies * * ASCII Cows Religous Shit Explanations * * Aeronautical Jokes Physics Product Disclaimers * * Bad World History Insurance Form Messups * ********************************************************************* * A .sig designed to keep me busy for quite a while * * YES! It's bigger and better than it was a few days ago! And * * it'll keep on growing until I hit 5 Megs! * ********************************************************************* * <<< My other account is a super-user >>> * ********************************************************************* * Nathan Mates nathan@cco.caltech.edu * *********************************************************************