Re: A86: Re: Lets Help Me Debug And Optimize


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

Re: A86: Re: Lets Help Me Debug And Optimize




bouncing doesn't seem to be an issue with the keyboard, probably there's
enough time between the interrupt and the point where the port is
actually read for the switch to stabilize.

looks like the debugging's been taken care of, so as for size
optimization, use more rom calls instead of custom routines.  this does
sacrifice quite a bit of speed, but if speed's not really an issue, size
should be.
if you're not disabling or replacing the ti-os interrupts, use _getcsc
(or whatever it's called) or load the key code out of _kbdScanCode.  i
wouldn't recommend using _getkey unless you want to allow remote control,
sqrtkey, or other weird things

also, i don't know why you're using 3 halts.  i suppose that might
decrease power useage a little, but otherwise there's no obvious reason
to have more than 1 that i can see.

that's not a very fast fastclear:
	ld hl,$fc00
	ld de,$fc01
	ld bc,$03ff
	ld (hl),l
	ldir

another thought, possibly more of a hassle than it's worth... you might
consider storing the strings as length byte, string instead of using the
strings & the dw table.  this would take longer to get to the strings
towards the end (unless you're displaying sequencial strings, then you
can just display the string, load b & inc the pointer) but will save a
byte or two per string, use _vputsn and you don't need the terminating 0.
  just another speed/size tradeoff.  consider you've got several million
cycles per second...

-josh

On Wed, 31 May 2000 21:33:41 -0400 "Matt Johnson" <matt2000@dogtech.com>
writes:
> 
> I think what happens is called "switch bouncing". This occurs when 
> you press
> any switch in a digital circuit, it switches from on-off and 
> vise-versa a
> few times initally, which means erranoues results might occur.
> 
> Ports are generally not good for menu routines because its harder to 
> program
> reading a keypress then just a key being held down. I'm not sure a 
> good way
> around this, the ROM has a pretty complex routine behind _getkey. It 
> isn't
> necessary to optimize menu code for speed.
> 
> I think Rabidcow has a good memory-mapped keyboard routine with one 
> of his
> grayscale routines that might work if you don't want to use _getkey. 
> I'd
> e-mail Josh at josh@smileyface.com
> he seems to be the resident expert with key ports.
> 
> - Matt
> 
> >       Here's the code to a small personal project, with a problem- 
> To
> exit,
> > you press exit twice, or some other miscellanious key twice. This 
> is bad.
> I
> > want it to exit with one puss of only the exit key. Also, any 
> other code
> > optomizations you can think of (either speed or SIZE) will be 
> greatly
> > appreciated.
> 
> 
> 

________________________________________________________________
YOU'RE PAYING TOO MUCH FOR THE INTERNET!
Juno now offers FREE Internet Access!
Try it today - there's no risk!  For your FREE software, visit:
http://dl.www.juno.com/get/tagj.