[A86] Re: TI-86 Menu Routine


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

[A86] Re: TI-86 Menu Routine





On Mon, 02 Sep 2002 11:21:22 +0100 Michael Williams
<spacex@williams-net.org> writes:
> >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.

You should look for a copy of "asm86.inc", which has all the rom calls
defined.  Should be on ticalc, I'd think.

_copycharmapl                    equ            569Dh
_copycharmaps                    equ            56A1h

For large and small font versions, tho the large font doesn't specify a
width, so yeah.


> >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.

Well, if you look at the table, each row is one entire row of the
display.  The first one has every pixel set except the last one, and the
second has 2 pixels set every so often.  (The rest aren't important for
what you're doing.)  The rom draws this one row at a time instead of
copying by columns the way you are doing.

As for using ldir, you could draw the two solid rows like:
  ld hl,$ff80
  ld de,$ff81
  ld bc,2*16-2 ; don't need to draw the first or last
  ld (hl),h ; draw the first separately, h = %11111111 from the addr
  ldir ; copy that first byte to the rest
and then store the two $fe/%11111110 bytes to the end.


> >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?

This is the more common way, which is a little less prone to error, but
I'm not sure it's necessarily better.

Pushing everything on the stack ahead of time is less efficient, but the
way you get the parameters off the stack is probably slightly more
efficient.  I personally would stick to the "normal" way, if only because
it would confuse people less and speed usually isn't an issue with user
interface code.

-rabidcow




  

________________________________________________________________
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: