[TI-ASM/hardware?] That silly key port
Moderator: MaxCoderz Staff
- driesguldolf
- Extreme Poster
- Posts: 395
- Joined: Thu 17 May, 2007 4:49 pm
- Location: $4080
- Contact:
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
The reason I do things backward is that it allows easy finish detection:
If I would do things "normal" I needed more instructions: (and a different initialization ofcourse)
Ok, because I use this little optimization I do need my own equates tough, but I've no problem with that...
I'm not a guy who thinks alot about that , I have my own conventions
The reason I do things backward is that it allows easy finish detection:
Code: Select all
rrc c
jr c, _grouploop
Code: Select all
rlc c
bit 7, c ; or use a compare instr cp %01111111
jr nz, _grouploop
-
- Calc King
- Posts: 1513
- Joined: Sat 05 Aug, 2006 7:22 am
- Jim e
- Calc King
- Posts: 2457
- Joined: Sun 26 Dec, 2004 5:27 am
- Location: SXIOPO = Infinite lives for both players
- Contact:
He's talking about groups not keys.King Harold wrote: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.bit 7, c ; or use a compare instr cp %01111111
rlc c sets the sign flag, so you can use jp m, to test bit 7.
- driesguldolf
- Extreme Poster
- Posts: 395
- Joined: Thu 17 May, 2007 4:49 pm
- Location: $4080
- Contact:
You're confusing things here:King Harold wrote: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.bit 7, c ; or use a compare instr cp %01111111
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
-
- Calc King
- Posts: 1513
- Joined: Sat 05 Aug, 2006 7:22 am
- driesguldolf
- Extreme Poster
- Posts: 395
- Joined: Thu 17 May, 2007 4:49 pm
- Location: $4080
- Contact:
Hmmm... tought I checked that... Checks again... Oh must have overlooked itJim e wrote:rlc c sets the sign flag, so you can use jp m, to test bit 7
Code: Select all
jr c, label ; 2 bytes, 7/12 clocks
jp m, label ; 3 bytes, 10 clocks