--- uae/src/uaelib.c 2018/04/24 17:14:28 1.1.1.11 +++ uae/src/uaelib.c 2018/04/24 17:18:34 1.1.1.13 @@ -14,7 +14,6 @@ #include #include -#include "config.h" #include "options.h" #include "threaddep/thread.h" #include "uae.h" @@ -22,18 +21,23 @@ #include "custom.h" #include "newcpu.h" #include "xwin.h" +#include "traps.h" #include "autoconf.h" #include "disk.h" #include "debug.h" #include "gensound.h" #include "picasso96.h" +/* We don't get a numerical version from autoconf, but this is the only place + that wants it, and it doesn't matter - so cheat. */ +#define UAEVERSION 0x0826 + /* * Returns UAE Version */ static uae_u32 emulib_GetVersion (void) { - return version; + return UAEVERSION; } /* @@ -137,7 +141,7 @@ static uae_u32 emulib_ChgCMemSize (uae_u memsize = 0x200000; write_log ("Unsupported chipmem size!\n"); } - m68k_dreg(regs, 0) = 0; + m68k_dreg (regs, 0) = 0; currprefs.chipmem_size = memsize; uae_reset(0); @@ -156,7 +160,7 @@ static uae_u32 emulib_ChgSMemSize (uae_u write_log ("Unsupported bogomem size!\n"); } - m68k_dreg(regs, 0) = 0; + m68k_dreg (regs, 0) = 0; currprefs.bogomem_size = memsize; uae_reset (0); return 1; @@ -173,7 +177,7 @@ static uae_u32 emulib_ChgFMemSize (uae_u memsize = 0; write_log ("Unsupported fastmem size!\n"); } - m68k_dreg(regs, 0) = 0; + m68k_dreg (regs, 0) = 0; currprefs.fastmem_size = memsize; uae_reset (0); return 0; @@ -217,7 +221,7 @@ static uae_u32 emulib_GetUaeConfig (uaec { int i,j; - put_long (place, version); + put_long (place, UAEVERSION); put_long (place + 4, allocated_chipmem); put_long (place + 8, allocated_bogomem); put_long (place + 12, allocated_fastmem); @@ -309,47 +313,47 @@ static uae_u32 FindFunctionInObject (uae return 0; } -#define CREATE_NATIVE_FUNC_PTR uae_u32 (* native_func)( uae_u32, uae_u32, uae_u32, uae_u32, uae_u32, uae_u32, uae_u32, \ +#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 ) +#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) { #if 0 - 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 ); + 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 (get_mem_bank (object_AAM).check( object_AAM, 1)) + object_UAM = get_mem_bank (object_AAM).xlateaddr (object_AAM); - if( object_UAM ) + 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); + 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 return 0; } -static uae_u32 uaelib_demux (void) +static uae_u32 uaelib_demux (TrapContext *dummy) { #define ARG0 (get_long (m68k_areg (regs, 7) + 4)) #define ARG1 (get_long (m68k_areg (regs, 7) + 8))