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

A92: PROPOSAL: TI-89/92 Screen Library




>
> I don't think that asm progs will be impossible, it'll just be like
> programming for a multisync, or different resolution screens on a computer
> - there'll be a global or 2 somewhere that you can read that'll tell you
> whether or not you're on a 92/92+, or what size the screen is.
>

  I agree, the memory map for the '89 will most likely be just like the '92,
but with a smaller spot for the main LCD buffer.  Also, there will probably be
a pointer or flag telling us (assembly programmers) what the size of the screen
is.  Even if TI did not incude this feature, I believe a library is in order
for this very purpose.  I propose the following functions:


// Structure for describing any type of screen
typedef struct GraphStruct
    {
    char height,width;
    GraphStruct *next;          // Next graph struct on stack.
    short numBitPlanes;         // The number of structures to follow
    struct
       {
       short planeAddrDiv8;
       char *planeAddr;
       } thePlane [];		// This is an array
    } GraphStruct;

GraphStruct *GraphInit()
    It figgures out what calc it's on and returns a set of flags for the
    programmer to use.  These include the current LCD buffer address, height,
    width, and wether grayscale is running, and it's depth.

GraphStruct *GraphNew( short numBitplanes )
// 1 bitplane  = B&W
// 2 bitplanes = 4 grayscale
// 3 bitplanes = 8 grayscale
// etc..
    Creates a new LCD buffer of the correct size and returns a pointer to it's
GraphStruct.

void GraphFree( GraphStruct *theGraph )
    Frees an allocated buffer.  Correctly frees all bitplanes, and also calls
    GraphRestore() if the bitplane given is the current bitplane.

void GraphSwitch( GraphStruct *theGraph )
    Switches the LCD to point to a new LCD buffer.  This function would place
    the old buffer address on a stack for later retrieval.  Also, it would take
    care of installing or uninstalling the grayscale interrupts for the buffer.
    As long as all programs use this function to switch the LCD buffer, there
    will never be a problem!

void GraphRestore()
    Pops off the old GraphStruct and makes it the current one.  This removes
    interrupts, etc.. and also switches the LCD base address.




   Anyone have other ideas/features?  Remember, this has to be able to work on
calcs with different sized screens, and different methods to switch the LCD
buffer address.  I included the baseAddrDiv8 field for TI-92 type interrupts,
although this may change after we find out how the '89 works.

--Bryan
bcturner@eos.ncsu.edu


Follow-Ups: References: