[A86] Re: Weird interrupts problem
[Prev][Next][Index][Thread]
[A86] Re: Weird interrupts problem
Well at first I thought it might be caused by switch bounce, basically
pressing a key and releasing it will cycle between the two states slighty
more than twice, due to high sampling rate and vibration of the finger or
metal of the switch.. so it might cause multiple-key presses to be triggered
when reading directly from the ports.
I dont know if thats it though.. I think the ti-86 rom routine does handle
that in some fashion, or perhaps all the code there kinda slows it down
enough so its not aproblem. It was a problem in the gameboy. You had to
sample two values using XOR and the minute it showed it was "released"
twice.
I had the same problem when writing ballistic, so I just used key ports for
the main game routine and the rom routines for the menu portion. I guess
thats cheating, right? :-)
But since it works with di, I bet it might have to do with the key handling
call or whatever in the interrupt routine, basically the interrupt routine
does check for keypresses so that could reset possibly whats in the port..
Im not sure if it preserves it or not..
you can always try putting in a full IM 2 interrupt handler (or hacked IM 1)
and see if that works.. that would probably fix the down-left bug also (how
convenient).
Didn't Joshua have code for getting keys from the keyport?
> I've been working on a TI-86 program that uses ports to read keys, and
> updates the screen whenever a key is released. My key handling
> routine was having lots of really strange bugs, but after about an
> hour of experimenting I discovered it worked only if interrupts were
> disabled. I really don't want to turn interrupts off, but it seems
> that some interrupt routine is altering the flags, and I didn't think
> they were meant to do that.
>
> http://www.btinternet.com/~mike_r/hw.asm is the current code, it's not
> finished but it is working. Try deleting the di on line 56 and see
> what happens.
>
> Is there any way to prevent this problem while keeping interrupts
> enabled?
>
> I'm using rom version 1.5. Thanks for any help.
>
>
>
Follow-Ups:
References: