--- uae/src/uaelib.c 2018/04/24 16:39:14 1.1.1.2 +++ uae/src/uaelib.c 2018/04/24 16:47:30 1.1.1.6 @@ -1,48 +1,11 @@ /* * UAE - The U*nix Amiga Emulator - * + * * UAE Library v0.1 - * + * * (c) 1996 Tauno Taipaleenmaki * - * Change UAE parameters and other stuff from inside the emulation. Creates - * a library called "uae.library" before the boot-up. To check if emulation - * is running we simply try to open the library. - * - * NOTE: The VERY FIRST attempt to open the library will actually create - * it, so you should always try to open it twice. - * - * Functions: Offset Purpose Arguments - * ---------- - * D0 = GetVersion() -0x1E Returns UAE version - - * D0 = GetUaeConfig(A0) -0x24 Get UAE Configuration Pointer to memory - * block with the size - * of sizeof(UaeCfg) - *!D0 = SetUaeConfig(A0) -0x2A Sets UAE Configuration Pointer to struct - * UAE_CONFIG - *!D0 = HardReset() -0x30 Resets the Amiga - - *!D0 = Reset() -0x36 -- "" -- - - * D0 = EjectDisk(D0) -0x3C Ejects a disk D0 = Drive Number - * D0 = InsertDisk(A0,D0) -0x42 Inserts a disk D0 = drive number, - * A0 = ptr to name - * D0 = EnableSound() -0x48 Enables SOUND (if it was - - * compiled in) - * D0 = DisableSound() -0x4E Disables SOUND - - * D0 = EnableJoystick() -0x54 Enables FAKE_JOYSTICK - - * D0 = DisableJoystick() -0x5A Disables FAKE_JOYSTICK - - * D0 = SetFrameRate(D0) -0x60 Changes frame rate D0 = Framerate - *!D0 = ChgCMemSize(D0) -0x66 Changes ChipMemSize D0 = New Mem Size - * (DOES A HARD RESET!) - *!D0 = ChgSMemSize(D0) -0x6C Changes SlowMemSize D0 = New Mem Size - * (DOES A HARD RESET!) - *!D0 = ChgFMemSize(D0) -0x72 Changes FastmemSize D0 = New Mem Size - * (DOES A HARD RESET!) - * D0 = ChangeLanguage(D0)-0x78 Changes kbd lang. D0 = Language - * D0 = ExitEmu() -0x7E Exits the emulator - - * D0 = GetDisk(D0,A0) -0x84 Gets the disks name D0 = Drive - * A0 = Space for name - * D0 = Debug() -0x8A Enters internal debugger - - * ! means not implemented yet + * Change UAE parameters and other stuff from inside the emulation. */ #include "sysconfig.h" @@ -53,133 +16,75 @@ #include "config.h" #include "options.h" - -#include "memory.h" +#include "threaddep/penguin.h" +#include "uae.h" +#include "include/memory.h" #include "custom.h" #include "readcpu.h" #include "newcpu.h" #include "xwin.h" #include "autoconf.h" #include "disk.h" -#include "os.h" - -extern int quit_program; - -static ULONG LibBase; - -static ULONG opencount=0; -static ULONG emulibname, functable,resname,resid, datatable; -static CPTR GetVersion,HardReset,Reset,EnableSound,DisableSound, - EnableJoystick,DisableJoystick,SetFrameRate,ChangeLanguage, - ChgCMemSize,ChgSMemSize,ChgFMemSize,EjectDisk,InsertDisk, - ExitEmu, GetUaeConfig, SetUaeConfig,Open,Close,Expunge,Null, - GetDisk,FakeInit,segList,DebugFunc; - -/* - * Library "open" - */ -static ULONG emulib_Open(void) -{ - opencount++; - put_word( LibBase + 32, get_word( LibBase + 32) + 1 ); - return LibBase; -} - -static ULONG emulib_Close(void) -{ - if (opencount <= 1) - return 0; - else { - opencount--; - put_word( LibBase + 32, get_word( LibBase + 32) - 1 ); - return 0; - } -} -static ULONG emulib_Expunge(void) -{ - return 0; -} - -static ULONG emulib_Null(void) -{ - return 0; -} +#include "debug.h" +#include "gensound.h" +#include "picasso96.h" /* * Returns UAE Version */ -static ULONG emulib_GetVersion(void) +static uae_u32 emulib_GetVersion (void) { - return version; + return version; } /* * Resets your amiga - * - * DOES NOT WORK YET ! It obviously crashes when this routine returns().. ? */ -static ULONG emulib_HardReset(void) +static uae_u32 emulib_HardReset (void) { - m68k_reset(); - return 0; + uae_reset(); + return 0; } -static ULONG emulib_Reset(void) +static uae_u32 emulib_Reset (void) { - m68k_reset(); - return 0; + uae_reset(); + return 0; } /* * Enables SOUND */ -static ULONG emulib_EnableSound(void) +static uae_u32 emulib_EnableSound (uae_u32 val) { - if (!sound_available || produce_sound == 2) + if (!sound_available || currprefs.produce_sound == 2) return 0; - produce_sound = 2; - return 1; -} - -/* - * Disables SOUND - */ -static ULONG emulib_DisableSound(void) -{ - produce_sound = 1; + currprefs.produce_sound = val; return 1; } /* * Enables FAKE JOYSTICK */ -static ULONG emulib_EnableJoystick(void) +static uae_u32 emulib_EnableJoystick (uae_u32 val) { - fake_joystick = 1; + currprefs.jport0 = val & 255; + currprefs.jport1 = (val >> 8) & 255; return 1; } /* - * Disables FAKE JOYSTICK - */ -static ULONG emulib_DisableJoystick(void) -{ - fake_joystick = 0; - return 1; -} - -/* * Sets the framerate */ -static ULONG emulib_SetFrameRate(void) +static uae_u32 emulib_SetFrameRate (uae_u32 val) { - if (m68k_dreg(regs, 0) == 0) + if (val == 0) return 0; - else if (m68k_dreg(regs, 0) > 20) + else if (val > 20) return 0; else { - framerate = m68k_dreg(regs, 0); + currprefs.gfx_framerate = val; return 1; } } @@ -187,29 +92,29 @@ static ULONG emulib_SetFrameRate(void) /* * Changes keyboard language settings */ -static ULONG emulib_ChangeLanguage(void) +static uae_u32 emulib_ChangeLanguage (uae_u32 which) { - if (m68k_dreg(regs, 0) > 5) + if (which > 5) return 0; else { - switch( m68k_dreg(regs, 0) ) { + switch (which) { case 0: - keyboard_lang = KBD_LANG_US; + currprefs.keyboard_lang = KBD_LANG_US; break; case 1: - keyboard_lang = KBD_LANG_DE; + currprefs.keyboard_lang = KBD_LANG_DE; break; case 2: - keyboard_lang = KBD_LANG_SE; + currprefs.keyboard_lang = KBD_LANG_SE; break; case 3: - keyboard_lang = KBD_LANG_FR; + currprefs.keyboard_lang = KBD_LANG_FR; break; case 4: - keyboard_lang = KBD_LANG_IT; + currprefs.keyboard_lang = KBD_LANG_IT; break; case 5: - keyboard_lang = KBD_LANG_ES; + currprefs.keyboard_lang = KBD_LANG_ES; break; default: break; @@ -218,221 +123,153 @@ static ULONG emulib_ChangeLanguage(void) } } +/* The following ones don't work as we never realloc the arrays... */ /* - * Changes CHIPMEMORY Size + * Changes chip memory size * (reboots) - * - * DOES NOT WORK YET ! - The m68k_reset does not work from here */ -static ULONG emulib_ChgCMemSize(void) +static uae_u32 emulib_ChgCMemSize (uae_u32 memsize) { - ULONG memsize = m68k_dreg(regs, 0); - - if (memsize != 0x80000 && memsize != 0x100000 && + if (memsize != 0x80000 && memsize != 0x100000 && memsize != 0x200000) { memsize = 0x200000; - fprintf(stderr, "Unsupported chipmem size!\n"); + fprintf (stderr, "Unsupported chipmem size!\n"); } m68k_dreg(regs, 0) = 0; - - chipmem_size = memsize; - m68k_reset(); + + currprefs.chipmem_size = memsize; + uae_reset(); return 1; } /* - * Changes SLOWMEMORY Size + * Changes slow memory size * (reboots) - * - * DOES NOT WORK YET! - the m68k_reset does not work from here */ -static ULONG emulib_ChgSMemSize(void) +static uae_u32 emulib_ChgSMemSize (uae_u32 memsize) { - ULONG memsize = m68k_dreg(regs, 0); - - if (memsize != 0x80000 && memsize != 0x100000 && - memsize != 0x180000 && memsize != 0x1C0000) { - memsize = 0; - fprintf(stderr, "Unsupported bogomem size!\n"); - } - - m68k_dreg(regs, 0) = 0; - bogomem_size = memsize; - m68k_reset(); - return 1; -} + if (memsize != 0x80000 && memsize != 0x100000 && + memsize != 0x180000 && memsize != 0x1C0000) { + memsize = 0; + fprintf (stderr, "Unsupported bogomem size!\n"); + } -/* - * Changes FASTMEMORY Size - * (reboots) - * - * DOES NOT WORK YET! - the m68k_reset() does not work from here - */ -static ULONG emulib_ChgFMemSize(void) -{ - ULONG memsize = m68k_dreg(regs, 0); - - if (memsize != 0x100000 && memsize != 0x200000 && - memsize != 0x400000 && memsize != 0x800000) { - memsize = 0; - fprintf(stderr, "Unsupported fastmem size!\n"); - } - m68k_dreg(regs, 0) = 0; - fastmem_size = memsize; - m68k_reset(); - return 0; + m68k_dreg(regs, 0) = 0; + currprefs.bogomem_size = memsize; + uae_reset (); + return 1; } /* - * Ejects a disk + * Changes fast memory size + * (reboots) */ -static ULONG emulib_EjectDisk(void) +static uae_u32 emulib_ChgFMemSize (uae_u32 memsize) { - ULONG drive = m68k_dreg(regs, 0); - - if (drive > 3) - return 0; - - disk_eject( drive ); - return 1; + if (memsize != 0x100000 && memsize != 0x200000 && + memsize != 0x400000 && memsize != 0x800000) { + memsize = 0; + fprintf (stderr, "Unsupported fastmem size!\n"); + } + m68k_dreg(regs, 0) = 0; + currprefs.fastmem_size = memsize; + uae_reset (); + return 0; } /* * Inserts a disk */ -static ULONG emulib_InsertDisk(void) +static uae_u32 emulib_InsertDisk (uaecptr name, uae_u32 drive) { - int quit = 0,i=0,j; - char real_name[256]; - UBYTE abyte; - ULONG drive = m68k_dreg(regs, 0); - CPTR name = m68k_areg(regs, 0); - FILE *file; - + int i = 0; + char real_name[256]; + if (drive > 3) return 0; - if (!disk_empty( drive )) { - disk_eject( drive ); - } - - while( quit == 0 ) { - abyte = get_byte(name + i); - if (abyte == '\0') { - real_name[i++] = '\0'; - quit = 1; - } else { - real_name[i++] = abyte; - } - } - j = strlen( real_name ); - if (j <= 0 || j > 255) - return 0; + while ((real_name[i] = get_byte (name + i)) != 0 && i++ != 254) + ; - if (!(file = fopen(real_name, "r"))) - return 0; + if (i == 255) + return 0; /* ENAMETOOLONG */ - fclose(file); - disk_insert(drive, real_name); - return 1; + strcpy (changed_prefs.df[drive], real_name); + return 1; } /* * Exits the emulator */ -static ULONG emulib_ExitEmu(void) +static uae_u32 emulib_ExitEmu (void) { - broken_in = 1; - regs.spcflags |= SPCFLAG_BRK; - quit_program = 1; - return 1; + uae_quit (); + return 1; } /* * Gets UAE Configuration */ -static ULONG emulib_GetUaeConfig(void) +static uae_u32 emulib_GetUaeConfig (uaecptr place) { - int i,j; - CPTR place = m68k_areg(regs, 0); + int i,j; - put_long(place , version); - put_long(place + 4, chipmem_size); - put_long(place + 8, bogomem_size); - put_long(place + 12, fastmem_size); - put_long(place + 16, framerate); - put_long(place + 20, produce_sound); - put_long(place + 24, fake_joystick); - put_long(place + 28, keyboard_lang); - if (disk_empty(0)) - put_byte(place + 32, 0); - else - put_byte(place + 32, 1); - if (disk_empty(1)) - put_byte(place + 33, 0); - else - put_byte(place + 33, 1); - if (disk_empty(2)) - put_byte(place + 34, 0); - else - put_byte(place + 34, 1); - if (disk_empty(3)) - put_byte(place + 35, 0); - else - put_byte(place + 35, 1); - - for(i=0;i<256;i++) { - put_byte((place + 36 + i), df0[i]); - put_byte((place + 36 + i + 256), df1[i]); - put_byte((place + 36 + i + 512), df2[i]); - put_byte((place + 36 + i + 768), df3[i]); - } - return 1; + put_long (place, version); + put_long (place + 4, allocated_chipmem); + put_long (place + 8, allocated_bogomem); + put_long (place + 12, allocated_fastmem); + put_long (place + 16, currprefs.gfx_framerate); + put_long (place + 20, currprefs.produce_sound); + put_long (place + 24, currprefs.jport0 | (currprefs.jport1 << 8)); + put_long (place + 28, currprefs.keyboard_lang); + if (disk_empty (0)) + put_byte (place + 32, 0); + else + put_byte (place + 32, 1); + if (disk_empty (1)) + put_byte (place + 33, 0); + else + put_byte (place + 33, 1); + if (disk_empty(2)) + put_byte (place + 34, 0); + else + put_byte (place + 34, 1); + if (disk_empty(3)) + put_byte (place + 35, 0); + else + put_byte (place + 35, 1); + + for (i = 0; i < 256; i++) { + put_byte ((place + 36 + i), currprefs.df[0][i]); + put_byte ((place + 36 + i + 256), currprefs.df[1][i]); + put_byte ((place + 36 + i + 512), currprefs.df[2][i]); + put_byte ((place + 36 + i + 768), currprefs.df[3][i]); + } + return 1; } /* * Sets UAE Configuration - * + * * NOT IMPLEMENTED YET */ -static ULONG emulib_SetUaeConfig(void) +static uae_u32 emulib_SetUaeConfig (uaecptr place) { - return 1; + return 1; } /* * Gets the name of the disk in the given drive */ -static ULONG emulib_GetDisk(void) +static uae_u32 emulib_GetDisk (uae_u32 drive, uaecptr name) { int i; - if (m68k_dreg(regs, 0) > 3) + if (drive > 3) return 0; - switch( m68k_dreg(regs, 0) ) { - case 0: - for(i=0;i<256;i++) { - put_byte( m68k_areg(regs, 0) + i, df0[i] ); - } - break; - case 1: - for(i=0;i<256;i++) { - put_byte( m68k_areg(regs, 0) + i, df1[i] ); - } - break; - case 2: - for(i=0;i<256;i++) { - put_byte( m68k_areg(regs, 0) + i, df2[i] ); - } - break; - case 3: - for(i=0;i<256;i++) { - put_byte( m68k_areg(regs, 0) + i, df3[i] ); - } - break; - default: - break; + for (i = 0;i < 256; i++) { + put_byte (name + i, currprefs.df[drive][i]); } return 1; } @@ -440,247 +277,137 @@ static ULONG emulib_GetDisk(void) /* * Enter debugging state */ -static ULONG emulib_Debug(void) +static uae_u32 emulib_Debug (void) { - broken_in = 1; - regs.spcflags |= SPCFLAG_BRK; + activate_debugger (); return 1; } -static ULONG emulib_FakeInit(void) -{ - segList = m68k_areg(regs, 0); - return m68k_dreg(regs, 0); +/* We simply find the first "text" hunk, get the offset of its actual code segment (20 bytes away) + * and add that offset to the base address of the object. Now we've got code to execute. + * + * @@@ Brian: does anything actually use this yet? + * @@@ Bernd: Not yet. It needs to get much better. Should spawn off a seperate task to handle the + * function, and then somehow "signal" the Amiga caller that completion or error has + * occurred. I don't know how to do that, so right now it is a synchronous call. Yuck! + * Would be nice to implement jpg decompression functionality for the Amiga which used + * the UAE Host to do all the work, for example. + * @@@ Brian: I disabled it to prevent people from starting to use it - if that happens, we're + * stuck with this. + */ +static uae_u32 FindFunctionInObject (uae_u8 *objectptr) +{ + uae_u8 *text_hdr; + uae_u8 offset; + text_hdr = (uae_u8 *)strstr ("text", (char *)objectptr); + if (text_hdr != 0) { + offset = *(text_hdr + 19); + return (uae_u32)(objectptr + offset); + } + return 0; } -/* - * Creates the UAE.library in memory - */ -static ULONG emulib_Init(void) +#define CREATE_NATIVE_FUNC_PTR uae_u32 (* native_func)( uae_u32, uae_u32, uae_u32, uae_u32, uae_u32, uae_u32, uae_u32, \ + uae_u32, uae_u32, uae_u32, uae_u32, uae_u32, uae_u32) +#define SET_NATIVE_FUNC(x) native_func = (uae_u32 (*)(uae_u32, uae_u32, uae_u32, uae_u32, uae_u32, uae_u32, uae_u32, uae_u32, uae_u32, uae_u32, uae_u32, uae_u32, uae_u32))(x) +#define CALL_NATIVE_FUNC( d1,d2,d3,d4,d5,d6,d7,a1,a2,a3,a4,a5,a6 ) if(native_func) native_func( d1,d2,d3,d4,d5,d6,d7,a1,a2,a3,a4,a5,a6 ) +/* A0 - Contains a ptr to the native .obj data. This ptr is Amiga-based. */ +/* We simply find the first function in this .obj data, and execute it. */ +static uae_u32 emulib_ExecuteNativeCode (void) { - ULONG tmp1, quit,i; - UBYTE bitti; - ULONG dosbase; - - if (LibBase != 0) - return 0; - - m68k_areg(regs, 0) = functable; - m68k_areg(regs, 1) = datatable; - m68k_areg(regs, 2) = FakeInit; - m68k_dreg(regs, 0) = 1024; - m68k_dreg(regs, 1) = 0; - tmp1 = CallLib(m68k_areg(regs, 6), -0x54); - if (tmp1 == 0) { - fprintf(stderr, "Cannot create UAE.library! "); - return 0; - } - m68k_areg(regs, 1) = tmp1; - CallLib(m68k_areg(regs, 6), -0x18c); - LibBase = tmp1; #if 0 - m68k_areg(regs, 1) = ds("dos.library"); - m68k_dreg(regs, 0) = 0; - dosbase = CallLib(m68k_areg(regs, 6), -552); - printf("%08lx\n", dosbase); + uaecptr object_AAM = m68k_areg( regs, 0 ); + uae_u32 d1 = m68k_dreg( regs, 1 ); + uae_u32 d2 = m68k_dreg( regs, 2 ); + uae_u32 d3 = m68k_dreg( regs, 3 ); + uae_u32 d4 = m68k_dreg( regs, 4 ); + uae_u32 d5 = m68k_dreg( regs, 5 ); + uae_u32 d6 = m68k_dreg( regs, 6 ); + uae_u32 d7 = m68k_dreg( regs, 7 ); + uae_u32 a1 = m68k_areg( regs, 1 ); + uae_u32 a2 = m68k_areg( regs, 2 ); + uae_u32 a3 = m68k_areg( regs, 3 ); + uae_u32 a4 = m68k_areg( regs, 4 ); + uae_u32 a5 = m68k_areg( regs, 5 ); + uae_u32 a6 = m68k_areg( regs, 6 ); + + uae_u8* object_UAM = NULL; + CREATE_NATIVE_FUNC_PTR; + + if( get_mem_bank( object_AAM ).check( object_AAM, 1 ) ) + object_UAM = get_mem_bank( object_AAM).xlateaddr( object_AAM ); + + if( object_UAM ) + { + SET_NATIVE_FUNC( FindFunctionInObject( object_UAM ) ); + CALL_NATIVE_FUNC( d1, d2, d3, d4, d5, d6, d7, a1, a2, a3, a4, a5, a6); + } + return 1; #endif - m68k_dreg(regs, 0) = 1; return 0; } +static uae_u32 uaelib_demux (void) +{ +#define ARG0 (get_long (m68k_areg (regs, 7) + 4)) +#define ARG1 (get_long (m68k_areg (regs, 7) + 8)) +#define ARG2 (get_long (m68k_areg (regs, 7) + 12)) +#define ARG3 (get_long (m68k_areg (regs, 7) + 16)) + + switch (ARG0) { + case 0: return emulib_GetVersion (); + case 1: return emulib_GetUaeConfig (ARG1); + case 2: return emulib_SetUaeConfig (ARG1); + case 3: return emulib_HardReset (); + case 4: return emulib_Reset (); + case 5: return emulib_InsertDisk (ARG1, ARG2); + case 6: return emulib_EnableSound (ARG1); + case 7: return emulib_EnableJoystick (ARG1); + case 8: return emulib_SetFrameRate (ARG1); + case 9: return emulib_ChgCMemSize (ARG1); + case 10: return emulib_ChgSMemSize (ARG1); + case 11: return emulib_ChgFMemSize (ARG1); + case 12: return emulib_ChangeLanguage (ARG1); + /* The next call brings bad luck */ + case 13: return emulib_ExitEmu (); + case 14: return emulib_GetDisk (ARG1, ARG2); + case 15: return emulib_Debug (); + +#ifdef PICASSO96 + case 16: return picasso_FindCard (); + case 17: return picasso_FillRect (); + case 18: return picasso_SetSwitch (); + case 19: return picasso_SetColorArray (); + case 20: return picasso_SetDAC (); + case 21: return picasso_SetGC (); + case 22: return picasso_SetPanning (); + case 23: return picasso_CalculateBytesPerRow (); + case 24: return picasso_BlitPlanar2Chunky (); + case 25: return picasso_BlitRect (); + case 26: return picasso_SetDisplay (); + case 27: return picasso_BlitTemplate (); + case 28: return picasso_BlitRectNoMaskComplete (); + case 29: return picasso_InitCard (); + case 30: return picasso_BlitPattern (); + case 31: return picasso_InvertRect (); + case 32: return picasso_BlitPlanar2Direct (); + case 34: return picasso_WaitVerticalSync (); + case 35: return allocated_gfxmem ? 1 : 0; +#endif + + case 69: return emulib_ExecuteNativeCode (); + } + return 0; +} /* * Installs the UAE LIBRARY */ -void emulib_install(void) +void emulib_install (void) { - ULONG begin, end, inittable, initroutine; - ULONG jotain, func_place, data_place, init_place; - - resname = ds("uae.library"); - resid = ds("UAE library 0.1"); - - begin = here(); - dw(0x4AFC); - dl(begin); - dl(0); - dw(0x8001); - dw(0x0988); - dl(resname); - dl(resid); - dl(here() + 4); - - dl(1024); - func_place = here(); - dl(0); - data_place = here(); - dl(0); - init_place = here(); - dl(0); - -/* Code to set up our library */ - - initroutine = here(); - calltrap(deftrap(emulib_Init)); - dw(RTS); - - /* Function table */ - Open = here(); - calltrap(deftrap(emulib_Open)); - dw(RTS); - - Close = here(); - calltrap(deftrap(emulib_Close)); - dw(RTS); - - Expunge = here(); - calltrap(deftrap(emulib_Expunge)); - dw(RTS); - - Null = here(); - dw(0x203c); dl(1); - dw(RTS); - - GetVersion = here(); - calltrap(deftrap(emulib_GetVersion)); - dw(RTS); - - GetUaeConfig = here(); - calltrap(deftrap(emulib_GetUaeConfig)); - dw(RTS); - - SetUaeConfig = here(); - calltrap(deftrap(emulib_SetUaeConfig)); - dw(RTS); - - HardReset = here(); - calltrap(deftrap(emulib_HardReset)); - dw(RTS); - - Reset = here(); - calltrap(deftrap(emulib_Reset)); - dw(RTS); - - EjectDisk = here(); - calltrap(deftrap(emulib_EjectDisk)); - dw(RTS); - - InsertDisk = here(); - calltrap(deftrap(emulib_InsertDisk)); - dw(RTS); - - EnableSound = here(); - calltrap(deftrap(emulib_EnableSound)); - dw(RTS); - - DisableSound = here(); - calltrap(deftrap(emulib_DisableSound)); - dw(RTS); - - EnableJoystick = here(); - calltrap(deftrap(emulib_EnableJoystick)); - dw(RTS); - - DisableJoystick = here(); - calltrap(deftrap(emulib_DisableJoystick)); - dw(RTS); - - SetFrameRate = here(); - calltrap(deftrap(emulib_SetFrameRate)); - dw(RTS); - - ChgCMemSize = here(); - calltrap(deftrap(emulib_ChgCMemSize)); - dw(RTS); - - ChgSMemSize = here(); - calltrap(deftrap(emulib_ChgSMemSize)); - dw(RTS); - - ChgFMemSize = here(); - calltrap(deftrap(emulib_ChgFMemSize)); - dw(RTS); - - ChangeLanguage = here(); - calltrap(deftrap(emulib_ChangeLanguage)); - dw(RTS); - - ExitEmu = here(); - calltrap(deftrap(emulib_ExitEmu)); - dw(RTS); - - GetDisk = here(); - calltrap(deftrap(emulib_GetDisk)); - dw(RTS); - - DebugFunc = here(); - calltrap(deftrap(emulib_Debug)); - dw(RTS); - - FakeInit = here(); - calltrap(deftrap(emulib_FakeInit)); - dw(RTS); - - functable = here(); - dl(Open); - dl(Close); - dl(Expunge); - dl(Null); - dl(GetVersion); - dl(GetUaeConfig); - dl(SetUaeConfig); - dl(HardReset); - dl(Reset); - dl(EjectDisk); - dl(InsertDisk); - dl(EnableSound); - dl(DisableSound); - dl(EnableJoystick); - dl(DisableJoystick); - dl(SetFrameRate); - dl(ChgCMemSize); - dl(ChgSMemSize); - dl(ChgFMemSize); - dl(ChangeLanguage); - dl(ExitEmu); - dl(GetDisk); - dl(DebugFunc); - dl(0xFFFFFFFF); - - datatable = here(); - dw(0xE000); - dw(0x0008); - dw(0x0900); - dw(0xC000); - dw(0x000A); - dl(resname); - dw(0xE000); - dw(0x000E); - dw(0x0600); - dw(0xD000); - dw(0x0014); - dw(0x0001); - dw(0xD000); - dw(0x0000); - dw(0x0000); - dw(0xC000); - dw(0x0018); - dl(resid); - dl(0x00000000); - - end = here(); - - org(begin + 6); /* Load END value */ - dl(end); - - org(data_place); - dl(datatable); - - org(func_place); - dl(functable); - - org(init_place); - dl(initroutine); - - org(end); + uaecptr a = here (); + org (0xF0FF60); + calltrap (deftrap (uaelib_demux)); + dw (RTS); + org (a); }