[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Inverse Problem on Contiki - website updated
MagerValp <MagerValp@cling.gu.se> wrote in message news:<p14smghdnet.fsf@panini.cling.gu.se>...
> >>>>> "MJM" == Michael J Mahon <mjmahon@aol.com> writes:
>
> MJM> For example, if C uses an embedded control character in a string
> MJM> to shift from normal to inverse text, independent of case, then
> MJM> your library patch sounds right. If the C programmer is expected
> MJM> to call auxiliary routines to switch character sets, then that's
> MJM> the way to go.
>
> conio uses the revers() call to enable or disable reverse printing.
>
> MJM> A related example is the "high ASCII" issue. If the C programmer
> MJM> expects low ASCII for portable code, then the apple2 library
> MJM> should OR on the high bit (perhaps based on a character set mode
> MJM> variable).
>
> cc65 translates C source ascii strings into whatever the target plat-
> form expects (e.g. PETSCII for CBM machines). If the translation for
> reverse Apple II characters is broken, take a look at:
>
> cc65/libsrc/apple2/cputc.s
>
> and in particular:
>
> putchar:
> ora #$80 ; Turn on high bit
> and TEXTTYP ; Apply normal, inverse, flash
> ldy CH
> ldx RD80COL ; In 80 column mode?
> bpl col40 ; No, in 40 cols
> pha
> tya
> lsr ; Div by 2
> tay
> pla
> bcs col40 ; odd cols go in 40 col memory
> sta PG2ON
> col40: sta (BASL),Y
> sta PG2OFF
> rts
>
> and send Uz a patch to fix it.
I patched putchar to jsr to mypatch, which detemines if it is upper or
lowercase and sets the TEXTTYP flag to inverse or flashing (requires
Alternate character set to be enabled.)
I am working on somthing a little more comprehensive which will (I
hope) handle both 40 and 80 column modes. In 40 column mode it will
force a lowercase inverse request to uppercase inverse and in 80
column mode it will print out upper or lower case inverse as
appropriate.
I will forward a copy to Ullrich to replace the cputc.s in the cc65
Apple library.
I am thinking that maybe longer term we need additional targets in
cc65 - apple2 for the II, II+(80 column videx), apple2e for the
iie,iic,iic+ (apple 80 column) and apple2gs for the iigs. I need to
look at the Apple II technotes that describe system identifcation
..that may help detemine which subsets can be handled within a target.
:O)