Re: A92: updated keypresses


[Prev][Next][Index][Thread]

Re: A92: updated keypresses




At 18:17 03/09/99 -0400, you wrote:
>In a message dated 9/3/99 7:21:13 AM Eastern Daylight Time, 
>p.c.scherrer@wanadoo.fr writes:
>
>> If it is for a game, the better thing to do would be to
>>  disable interruptions (the game will be really faster)
>>  and to use direct keyboard access.
>
>um, how do you do that?
> 

the code to disable interuptions should be :

move.w	#$500, d0		;$700 should also work
trap		#1
move.l	d0,-(a7)			;save d0 = old sr

(....)

move.l	(a7)+,d0			;restore d0
trap		#1

when intuptions are disabled, the usual idle_loop don't
work anymore. So you have to use direct kb accesss.
And on top of it you will be able to do what you wanted
( how can l use an asm getkey function, so that when holding down an arrow
key it will constantly return its value instead of )

The following code test the PAD and the esc key :


	move.w	#%1111111111111110,($600018)	;set the kb row mask
	nop													;wait a moment...
	nop					;but on a boosted TI, maybe it won't work.
	nop					;so add nop, or use dbra.
	nop					
	nop
	move.b	($60001B),d0	;get the keyboard column mask
	
	btst	#6,d0							;test bits according to lowlevel.txt
	beq	\right
	btst	#4,d0
	beq	\left
	btst	#5,d0
	beq	\up
	btst	#7,d0
	beq	\down


	move.w	#%1111110111111111,($600018)
	nop
	nop
	nop
	nop
	move.b	($60001B),d0
	
	btst	#3,d0
	bne	\exit


to know the row maks and the bits, read the file lowlevel.txt
from the fargo2/DoorsOS doc
the following array is really useful :

Row     +-------+-------+-------+-------+-------+-------+-------+-------+
 V  Col>| Bit 7 | Bit 6 | Bit 5 | Bit 4 | Bit 3 | Bit 2 | Bit 1 | Bit 0 |
+-------+-------+-------+-------+-------+-------+-------+-------+-------+
| Bit 0 |  down | right |   up  |  left |  hand | shift |diamond|  2nd  |
| Bit 1 |   3   |   2   |   1   |   F8  |   W   |   S   |   Z   | unused|
| Bit 2 |   6   |   5   |   4   |   F3  |   E   |   D   |   X   | unused|
| Bit 3 |   9   |   8   |   7   |   F7  |   R   |   F   |   C   |  STO  |
| Bit 4 |   ,   |   )   |   (   |   F2  |   T   |   G   |   V   | space |
| Bit 5 |  TAN  |  COS  |  SIN  |   F6  |   Y   |   H   |   B   |   /   |
| Bit 6 |   P   | ENTER2|   LN  |   F1  |   U   |   J   |   N   |   ^   |
| Bit 7 |   *   |  APPS | CLEAR |   F5  |   I   |   K   |   M   |   =   |
| Bit 8 | unused|  ESC  |  MODE |   +   |   O   |   L   | theta |backspc|
| Bit 9 |  (-)  |   .   |   0   |   F4  |   Q   |   A   | ENTER1|   -   |
+-------+-------+-------+-------+-------+-------+-------+-------+-------+

notice that it may be not the same on a TI-89, so you would have
to discover yourself some keys...

good luck
NeXO





References: