Ramon van Handel wrote:
> >well, I imagine that if an "enduser" configures plex86 to have 16Mb
> >physical memory, he expects 16 Mb to be "available" and doesn't want to
> >be bothered with the fact that he "actually" will have 12 Mb available,
> >because our video driver allocates 4Mb physical memory
> 
> This is a matter of good documentation.  Don't worry about it :)

ok :)
 
> >register a callback for (IS it possible for multiple plugins to register
> >a callback on the SAME ports?) ->
> 
> No, that isn't possible.  That would be a bug, anyway (IO port conflicts are
> not allowed!).  It would also mean lousy performance.

why? where is the performance "problem"?

> However, I guess we
> could reserve a range of I/O ports for plex86 use, but for now it's not so
> important which port you pick (make it a plugin command line option if you
> wish).

ok, I'll have a go at this tonight when I'm home. 

To see if I understand things a bit I collected the information/semi
code that I'll probably end up using:

//TestVIDeo plugin information

#define TVID_PACKET_MAGIC       'TVID'
#define TVID_OUTPUT_PORT        0x2000

typedef enum
{       
        tvid_init,
        tvid_deinit,
        tvid_updatevideo
} tvid_action_t;

typedef struct _tvid_packet_t
{
        int             magic;
        tvid_action_t   action;
        int             xres;                   // x resolution in pixels
        int             yres;                   // y resolution in pixels
        int             *vid_memory_ptr;        // pointer to an ARGB888 video screen
} tvid_packet_t;


// The output port handler for TVID_OUTPUT_PORT that receives a DWORD
pointer that points to a tvid_packet_t structure
int tvid_outp_handler(event_t event,int data, int op_size, int
count,void *loc)
{
        tvid_packet_t packet;

        // event        (should be) EVT_OUTPORT
        // data         (should be) TVID_OUTPUT_PORT
        // op_size      (should be) 4
        // count        (should be) 1
        // loc          (should be) DWORD ptr to tvid_pachet_t structure
        
        // use vm_read_physical(loc,sizeof(tvid_packet_t),&packet) to read the
packet contents
        //
        // verify tvid packet magic
        //
        // based upon (packet->action) perform one of the following actions:
        //
        //      init gfx component
        //      deinit gfx component
        //      based upon resolution settings do a
vm_read_physical(packet->vid_memory_ptr,....) to gfx screen
}

int plugin_init(plugin_t *plugin, int argc, char *argv[])
{
        // save plugin variable
        
        // register tvid_outp_handler
plugin_alloc_outp(plugin,tvid_outp_handler,TVID_OUTPUT_PORT,4);
}

-- 
        Best regards,
                
                Jeroen Janssen

+++
It was hard enough to kill a vampire. You could stake them down and turn
them into dust and ten years later someone drops a drop of blood in the
wrong place and *guess who's back*? They returned more times than raw
broccoli.
        -- (Terry Pratchett, Feet of Clay)
+++


Reply via email to