Hi Roger,
At 12:00am -0800 00-02-21, Palm Developer Forum digest wrote:
>Subject: Re: Help with International/Text
>From: "Roger Chaplin" <[EMAIL PROTECTED]>
>Date: Sun, 20 Feb 2000 18:43:31 -0500
>X-Message-Number: 22
>
>Ken Krugler <[EMAIL PROTECTED]> wrote:
>
> > I'm not sure of the status of the GCC-based development environment,
> > though, so perhaps somebody else (John?) could better understand and
> > answer your questions. I know there were some issues with getting an
> > appropriate version of the Palm OS Glue library released for
> > PRC-tools.
>
>Interesting that you mention this. Just today I've been working on
>getting TxtGlue incorporated into my app, using prc-tools 2.0 and SDK
>3.5, and have run into trouble. I get a bus error in TxtGlueCharAttr(),
>running in POSE using either the 2.0 or 3.0 ROM (haven't tried it with
>any others, don't think it will matter). Apparently TxtGlueCharAttr()
>is attempting to use the character value to index into a table of 16-
>bit character attributes. When I display memory at the calculated
>address of this table (using Debuffer, a wonderful tool), I see all
>ones (0xFFFF).
>
>Here's the assembler code:
>
> link.l a6, #$0
> move.w $8(a6), d0 ;chr in d0 now
> cmp.w #$00ff, d0
> bhi.s #$a
> and.l #$0000ffff, d0
> bra #$14
> cmp.w #$ff7f, d0
> bhi.s #$6
> clr.w d0
> bra #$12
> and.l #$000000ff, d0
> lea.l $4efc(a5), a0 ;base of table must be a5 + $4efc
This instruction is the actual source of the problem. The character
attribute table (an array of 256 16-bit values) should be retrieved
by a call to the GetCharAttr() trap. The GCC version of the
PalmOSGlue is getting built with a direct link attribute table;
that's only valid for code going into the ROM.
It also looks like the GCC build isn't using PC-relative data
(different setting than PC-relative strings), and thus it's assuming
that the character attribute data table is in the app's global space.
Hmm, maybe GCC doesn't support PC-relative data; I know that
functionality was only recently added to CodeWarrior. But in that
case it should have added the 512 bytes to your apps global space &
initialized it at launch time. Odd.
Regardless, what I think this means is that the TxtGlueCharAttr,
TxtGlueFindString, and TxtGlueWordBounds routines in the GCC version
of the PalmOSGlue library are currently busted. I'll see when Palm
can generate a new version and post something once I know more.
Thanks for helping track this down...
-- Ken
Ken Krugler
TransPac Software, Inc.
<http://www.transpac.com>
+1 530-470-9200
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palm.com/devzone/mailinglists.html