[A86] Re: TI-86 Menu Routine
[Prev][Next][Index][Thread]
[A86] Re: TI-86 Menu Routine
rabidcow@juno.com wrote:
>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
>
No, I don't mind suggestions at all, in fact, if you think my code can
be changed in any way, please let me know.
>
>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.)
>
What is the address for _copycharmaps? My include files don't have it.
>
>
>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.
>
What does this mean? I don't quite get what this does.
>
>
>Passing the input strings on the stack is interesting, have you been
>writing asm code to interface with C programs?
>
No, I havent actually done that, but I read about it once. My other
thought would be to do this:
ld hl,table
call Do_Menu
table:
.db $05 ;# of entries
.dw Text5 ;slot #5
.dw Text4 ;slot #4
.dw Text3 ;slot #3
.dw Text2 ;slot #2
.dw Text1 ;slot #1
Which way do you think is better?
Thanks for all the help!!!
Michael Williams
Follow-Ups:
References: