Podule API

This only deals with Windows DLLs at the moment. Support for dynamic libraries on other
systems could probably be implemented.


typedef struct
{
        void (*writeb)(podule *p, int easi, uint32_t addr, uint8_t val);
        void (*writew)(podule *p, int easi, uint32_t addr, uint16_t val);
        void (*writel)(podule *p, int easi, uint32_t addr, uint32_t val);
        uint8_t  (*readb)(podule *p, int easi, uint32_t addr);
        uint16_t (*readw)(podule *p, int easi, uint32_t addr);
        uint32_t (*readl)(podule *p, int easi, uint32_t addr);
        int (*timercallback)(podule *p);
	void (*reset)(podule *p);
        int irq,fiq;
        int msectimer;
} podule;

This is the basic podule structure that is used for everything. This is filled out at
startup by RPCEmu, don't set any of the functions yourself.


Functions that must be exported from DLL :

InitDll() - do any initialisation stuff. Since no real work can be done in DllMain 
            (apparently), do any ROM loading / timer/interrupt initialisation here.
RPCEmu will ignore your DLL if this function is not present.


Functions that may be exported :

read*/write* - These deal with IO read/writes. There are three word sizes - longwords
               are from EASI space, words are from IOMD space, and bytes are from both.
               The current podule structure is passed in case reads/writes affect IRQs or
               timers at all.

timercallback - This is called when msectimer underflows. It must return the time until the
                next call.
                Due to timing granulinity, calls may not happen exactly when desired, and
                RPCEmu may burst calls.

reset - Resets the podule when RPCEmu is reset.

Variables in podule struct :

irq,fiq - These deal with podule interrupts. Simply set to raise an interrupt, clear to
          lower. RPCEmu deals with everything else.

msectimer - This is the millisecond timer. This is decremented every millisecond (roughly)
            and timercallback is called when it underflows. timercallback will return the
            reload value for this counter. 
            msectimer is only counted if timercallback is exported.
