[A86] Re: TI-86 Menu Routine


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

[A86] Re: TI-86 Menu Routine




Well, it's possible to use the rom routine for this, but this would be
cleaner if you need to do background processing or something.

I hope you don't mind some suggestions...  The code to crop the text when
it won't fit should be done with a lookup table (actually, some of the
other bits might do well as a table too), but there's an easier way than
that.  You can use the ROM call _copycharmaps, which will copy the bitmap
for the char in a to some fixed location and leave hl pointing the the
char width in pixels.  So you can do:
  ld a,char
  call _copycharmaps
  ld a,(hl)
and a will be the width of the char.  (I forget if this includes the
space between chars.)

Another possibility would be to use _STATED_CUT_COL, but it's a little
sloppy (having to change _CXCURAPP for it to work...) and I don't know if
you're centering the strings, but it wouldn't let you do that.

The code to draw the lines should probably use ldir, at least for the
long bit with ld (hl),a\inc hl.  The ROM draws this bit using a table:
4df8  fffffffffffffffffffffffffffffffe
4e08  c000006000003000001800000c000006
4e18  ffffffe000003000001800000c000006
4e28  c000007ffffff000001800000c000006
4e38  c000006000003ffffff800000c000006
4e48  c000006000003000001ffffffc000006
4e58  c000006000003000001800000ffffffe
The first line is for the horizontal bar across, the second for the
separator bars between menu items, and the rest are for selecting a menu
item.  (for submenus?  I forget...)  Parts of it could probably be done
more efficiently than the ROM does.

Passing the input strings on the stack is interesting, have you been
writing asm code to interface with C programs?

-rabidcow


On Mon, 02 Sep 2002 01:23:01 +0100 Michael Williams
<spacex@williams-net.org> writes:
> 
> Hey All!
>     I finally got my menu routine working.  Here it is in case any 
> of 
> y'all want to try it out.  All it does is output the menu bar and 
> the 
> text you supply on the screen.  When you jump to Do_Menu (you have 
> to 
> jump, otherwise this function will get really messed up), the stack 
> must 
> look like this:

________________________________________________________________
GET INTERNET ACCESS FROM JUNO!
Juno offers FREE or PREMIUM Internet access for less!
Join Juno today!  For your FREE software, visit:
http://dl.www.juno.com/get/web/.



Follow-Ups: