Re: A82: Porting (85)


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

Re: A82: Porting (85)




Yes, Direct Input [what we 83 ppl called it] is a LOT faster than GET_KEY
or whatever... here is the way I do it... maybe if you have questions,
send me a msg...

Routine from DuckHunt 82
-------------------------------------
GetKeyLoop:
	ld 	a,0ffh		;Reset keyport
	out 	(1),a		;Clear Port
	ld 	a,0feh		;Load desired port
	out   (1),a			;Clear Keys
	in 	a,(1)		;Input Key
	cp	251		;If key is right
	jp 	z,GunRight	;Goto Right
	cp 	253		;If key is left
	jp 	z,GunLeft		;Goto Left
	cp	247		;Is it key Up
	jp	z,GunUp		;Move Up
	cp	254		;Is it Down
	jp	z,GunDown	;Move Down	
	ld 	a,0ffh		;Reset keyport
	out 	(1),a		;Clear Port
	ld 	a,0bfh		;Load desired port
	out   (1),a			;Clear Keys
	in 	a,(1)		;Input Key
	cp 	223		;Is it 2nd
	jp 	z,shoot		;Shoot if so
	cp	127		;Is it delete
	call	z,Pause		;Pause
	cp	191		;Is it Quit?
	ret	z		;Return from Program if so
	jp	nz,NoKey		;NoKey Otherwise

					-Ahmed

Ahmed El-Helw
http://asm86.home.ml.org
asm86@juno.com [Temporarily]
ICQ UIN : 3350394 [When I re-get my net connection]
Ahmed_ on IRC #ti [When I re-get my net connection]


On Sun, 25 Jan 1998 15:22:54 -0800 "Cory Crooks" <badman@velocity.net>
writes:
>
>Zetris 1.12 reads direct from mem to get the key (this may be why i've 
>heard
>it crashes with CrAsh), increasing your block drop speed. But would 
>port
>reads be even faster?
>
>-- Cory R. Crooks
>badman@velocity.net
>
>-----Original Message-----
>From: GeradS711 <GeradS711@aol.com>
>To: assembly-82@lists.ticalc.org <assembly-82@lists.ticalc.org>
>Date: Sunday, January 25, 1998 11:21 AM
>Subject: Re: A82: Porting (85)
>
>
>>
>>In a message dated 98-01-24 12:48:31 EST, you write:
>>
>>> Wouldn't a direct input routine make Solytare a heck of a lot 
>faster?
>>>  -Ahmed
>>and a direct output routine...
>>Yes a direct input routine is three or four times as fast as a call 
>getkey
>>routine. Zetris could be faster too, and then the block wouldn't have 
>to
>drop
>>all of the way when you pressed down, it would just drop a little 
>very
>fast,
>>which is better
>
>


References: