--- uae/src/uaelib.c 2018/04/24 16:42:13 1.1.1.4 +++ uae/src/uaelib.c 2018/04/24 17:05:46 1.1.1.10 @@ -16,11 +16,10 @@ #include "config.h" #include "options.h" -#include "threaddep/penguin.h" +#include "threaddep/thread.h" #include "uae.h" #include "include/memory.h" #include "custom.h" -#include "readcpu.h" #include "newcpu.h" #include "xwin.h" #include "autoconf.h" @@ -69,7 +68,8 @@ static uae_u32 emulib_EnableSound (uae_u */ static uae_u32 emulib_EnableJoystick (uae_u32 val) { - currprefs.fake_joystick = val; + currprefs.jport0 = val & 255; + currprefs.jport1 = (val >> 8) & 255; return 1; } @@ -83,7 +83,7 @@ static uae_u32 emulib_SetFrameRate (uae_ else if (val > 20) return 0; else { - currprefs.framerate = val; + currprefs.gfx_framerate = val; return 1; } } @@ -93,7 +93,7 @@ static uae_u32 emulib_SetFrameRate (uae_ */ static uae_u32 emulib_ChangeLanguage (uae_u32 which) { - if (which > 5) + if (which > 6) return 0; else { switch (which) { @@ -101,18 +101,21 @@ static uae_u32 emulib_ChangeLanguage (ua currprefs.keyboard_lang = KBD_LANG_US; break; case 1: - currprefs.keyboard_lang = KBD_LANG_DE; + currprefs.keyboard_lang = KBD_LANG_DK; break; case 2: - currprefs.keyboard_lang = KBD_LANG_SE; + currprefs.keyboard_lang = KBD_LANG_DE; break; case 3: - currprefs.keyboard_lang = KBD_LANG_FR; + currprefs.keyboard_lang = KBD_LANG_SE; break; case 4: - currprefs.keyboard_lang = KBD_LANG_IT; + currprefs.keyboard_lang = KBD_LANG_FR; break; case 5: + currprefs.keyboard_lang = KBD_LANG_IT; + break; + case 6: currprefs.keyboard_lang = KBD_LANG_ES; break; default: @@ -132,7 +135,7 @@ static uae_u32 emulib_ChgCMemSize (uae_u if (memsize != 0x80000 && memsize != 0x100000 && memsize != 0x200000) { memsize = 0x200000; - fprintf (stderr, "Unsupported chipmem size!\n"); + write_log ("Unsupported chipmem size!\n"); } m68k_dreg(regs, 0) = 0; @@ -150,7 +153,7 @@ static uae_u32 emulib_ChgSMemSize (uae_u if (memsize != 0x80000 && memsize != 0x100000 && memsize != 0x180000 && memsize != 0x1C0000) { memsize = 0; - fprintf (stderr, "Unsupported bogomem size!\n"); + write_log ("Unsupported bogomem size!\n"); } m68k_dreg(regs, 0) = 0; @@ -168,7 +171,7 @@ static uae_u32 emulib_ChgFMemSize (uae_u if (memsize != 0x100000 && memsize != 0x200000 && memsize != 0x400000 && memsize != 0x800000) { memsize = 0; - fprintf (stderr, "Unsupported fastmem size!\n"); + write_log ("Unsupported fastmem size!\n"); } m68k_dreg(regs, 0) = 0; currprefs.fastmem_size = memsize; @@ -218,9 +221,9 @@ static uae_u32 emulib_GetUaeConfig (uaec put_long (place + 4, allocated_chipmem); put_long (place + 8, allocated_bogomem); put_long (place + 12, allocated_fastmem); - put_long (place + 16, currprefs.framerate); + put_long (place + 16, currprefs.gfx_framerate); put_long (place + 20, currprefs.produce_sound); - put_long (place + 24, currprefs.fake_joystick); + 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); @@ -286,6 +289,13 @@ static uae_u32 emulib_Debug (void) * 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) { @@ -307,6 +317,7 @@ static uae_u32 FindFunctionInObject (uae /* 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 ); @@ -334,6 +345,8 @@ static uae_u32 emulib_ExecuteNativeCode 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) @@ -395,7 +408,7 @@ static uae_u32 uaelib_demux (void) void emulib_install (void) { uaecptr a = here (); - org (0xF0FF60); + org (RTAREA_BASE + 0xFF60); calltrap (deftrap (uaelib_demux)); dw (RTS); org (a);