[TI-ASM/hardware?] That silly key port

Got questions? Got answers? Go here for both.

Moderator: MaxCoderz Staff

User avatar
Jim e
Calc King
Posts: 2457
Joined: Sun 26 Dec, 2004 5:27 am
Location: SXIOPO = Infinite lives for both players
Contact:

Post by Jim e »

You should definitely reset that initially. Also I find it odd that chose to go in reverse of generally convention. Getcsc starts with the arrow group.
Image
User avatar
driesguldolf
Extreme Poster
Posts: 395
Joined: Thu 17 May, 2007 4:49 pm
Location: $4080
Contact:

Post by driesguldolf »

Thanx, I'll reset it initially (strange it has always worked...),

I'm not a guy who thinks alot about that :) , I have my own conventions :D
The reason I do things backward is that it allows easy finish detection:

Code: Select all

	rrc c
	jr c, _grouploop
If I would do things "normal" I needed more instructions: (and a different initialization ofcourse)

Code: Select all

	rlc c
	bit 7, c ; or use a compare instr cp %01111111
	jr nz, _grouploop
Ok, because I use this little optimization I do need my own equates tough, but I've no problem with that... :P
King Harold
Calc King
Posts: 1513
Joined: Sat 05 Aug, 2006 7:22 am

Post by King Harold »

bit 7, c ; or use a compare instr cp %01111111
that is not the same though, bit 7 also works when other keys are pressed as well, the CP only works if exactly that combination of keys is pressed.
User avatar
Jim e
Calc King
Posts: 2457
Joined: Sun 26 Dec, 2004 5:27 am
Location: SXIOPO = Infinite lives for both players
Contact:

Post by Jim e »

King Harold wrote:
bit 7, c ; or use a compare instr cp %01111111
that is not the same though, bit 7 also works when other keys are pressed as well, the CP only works if exactly that combination of keys is pressed.
He's talking about groups not keys.


rlc c sets the sign flag, so you can use jp m, to test bit 7.
Image
User avatar
driesguldolf
Extreme Poster
Posts: 395
Joined: Thu 17 May, 2007 4:49 pm
Location: $4080
Contact:

Post by driesguldolf »

King Harold wrote:
bit 7, c ; or use a compare instr cp %01111111
that is not the same though, bit 7 also works when other keys are pressed as well, the CP only works if exactly that combination of keys is pressed.
You're confusing things here:
I was talking about the group not the key
My routine (previous page) starts at group %10111111 and rotates right:

Code: Select all

;I check groups in this sequence:
%10111111	; 1st
%11011111	; 2nd
%11101111	; 3rd
%11110111	; 4th
%11111011	; 5th
%11111101	; 6th
%11111110	; 7th
;When I reached the final group (7th here) one more rrc c will reset the carry
;When I do things the other way around (7th to 1st) I need an additional check because there's no group %01111111
King Harold
Calc King
Posts: 1513
Joined: Sat 05 Aug, 2006 7:22 am

Post by King Harold »

You're confusing things here:
I was talking about the group not the key
oh.

so why not use the sign flag like Jim E said?
User avatar
driesguldolf
Extreme Poster
Posts: 395
Joined: Thu 17 May, 2007 4:49 pm
Location: $4080
Contact:

Post by driesguldolf »

Jim e wrote:rlc c sets the sign flag, so you can use jp m, to test bit 7
Hmmm... tought I checked that... Checks again... Oh must have overlooked it

Code: Select all

jr c, label ; 2 bytes, 7/12 clocks
jp m, label ; 3 bytes, 10 clocks
and it's even faster, thanx
Post Reply