CompuServe Thread

right mouse button(s)

4 messages in this thread
#42536From: jackSep 7, 1994 1:11 AM
Can anyone inform me as to why the following code does not work on the Amiga 1000? LEA $DFF000,A0 MOVE.W $16(A0),D0 ;read pot port data AND.W #%0100010000000000,D0 ;MASK RIGHT BUTTON(S) CMP.W #%0100010000000000,D0 ;0=BUTTON PRESSED ON BNE MEN? ;BIT 10 OR 14 While code has been successfully tested on a Rev6 (2.0)Amiga 2000, it cannot obtain accurate readings from a stock Amiga1000. As there will obviously be no more Amiga revisions, I would like to directly access the hardware with assembler. Jack
#42539From: ShraddhanSep 7, 1994 5:06 PM
Jack, I'm unable to locate my copy of the hardware reference manual at the moment. However, looking at your code, I wonder if the problem is the CMP.W instruction. Do you need it? Can it be left out? It seems that you are looking for either or both of bits 10 and 14 being ON, but the CMP.W only works if BOTH are on, whereas it might be (I'm guessing here) that you only need to check for the presence of either of these bits. If this is the case, the AND.W instruction will set the processor flags appropriately for the BNE instruction. What values get read into D0 in the MOVE.W instruction? Regards, Shraddhan (via AP from Hertfordshire, England)
#42540From: jackSep 8, 1994 12:57 AM
Thanks for the prompt response, Shraddhan. Bits 10 & 14 correspond to the right mouse buttons, and will be cleared if the respective button is depressed(closing the circuit). The cmp.w is unnecessary, and could be replaced with a BTST.W instruction. However, I was uncertain as to whether the BTST.W could be used on $Dff016 (a read-only location).
#42545From: Werner KazmierzakSep 8, 1994 4:48 PM
Jack, hmm… I looked the thing up in both the RKM Hardware Manuals, 1986 edition (KS/WB 1.0) and 1991 (KS/WB 2.0) edition. There seem te be no changes in reading POTINP. You are sure you set POTGO OUTRY/OUTLY to 1 and drive the lines high by setting DATRY/DATLY to 1 during each VB period before re-reading POTINP? Maybe this is not performed automatically on an A1000. Sorry I haven't got an A1000 anymore, so I can't duplicate the problem. – wkc – … via AP from Hamburg, Germany