[hatari-devel] Re: Hatari SDL2

[ Thread Index | Date Index | More lists.tuxfamily.org/hatari-devel Archives ]


Thomas,

I finally had time to try this again. If you comment out the main function in SDLMain.m, Hatari will compile. However, you are exactly correct that the OS X menu does not work correctly. The Preferences menu item is disabled so you cannot access the Hatari preferences using the OS X interface. Also, command-M is handled by the system as minimizing the window instead of grabbing the mouse. Lastly, the Emulator menu does not appear at all. SDL is not intercepting the system keystrokes like it does under SDL 1.2.

If you go into full-screen mode, Hatari’s menu bar will be gone when you exit full-screen mode.

From the current development code, here is what I have done (in case anyone is interested):

1. In SDLMain.m, I commented out code to workaround bug in SDL 1.2.11. I simply changed the doFullScreen function to call Screen_EnterFullScreen(). It appears the SDL developers fixed the problem in 1.2.15 (if not earlier). I tried my change using 1.2.15 and I had no problems changing between full-screen mode and windowed mode. I gave up trying after 10 times of switching Hatari between full-screen and windowed mode.

2. In PrefsController.m, I commented out SDLK_LSUPER, SDLK_RSUPER, SDLK_COMPOSE, SDLK_BREAK, and SDLK_EURO in Preferences_KeysForJoysticks[]. I did not see where they were used. 

3. In SDLMain.m, I changed the SDL_main call in applicationDidFinishLaunching to status = SDL_Init (SDL_INIT_EVERYTHING); I tried just using SDL_INIT_VIDEO, but it did not make a difference.

I know we cannot leave the main() call in SDLMain.m commented out because that is the code that determines if Hatari was launched from the Finder or not. Based on my testing, I assume I am not correctly initializing SDL since the system keystrokes are still being handled by OS X. I also assume the OS X application is not initialized correctly since the menu bar should not disappear simply because Hatari returns from full-screen mode.


Bob C


On Aug 13, 2014, at 4:31 PM, Thomas Huth <th.huth@xxxxxx> wrote:

> 
> Miguel, Bob, Jerome,
> 
> maybe Andreas Grabher (on CC) can help here: He recently modified the
> Previous emulator to run with SDL2 on Mac OS X - and since Previous is
> based on the Hatari sources, the required changes should be pretty
> similar...
> 
> Looking at
> http://sourceforge.net/p/previous/code/HEAD/tree/branches/branch_mmu/src/gui-osx/SDLMain.m
> he commented out the main function there, so that likely only the main
> function in src/main.c remains. Have you tried that already? ... but I
> wonder whether the OS X menu then still works as expected?
> 
> Andreas: The hg tip Hatari sources now feature SDL2 support, too. But
> there still seem to be trouble with compiling it on OS X. If you've got
> some spare time and motivation, could you maybe try to compile it on
> your OS X system?
> 
> Thomas
> 
> 
> Am Wed, 13 Aug 2014 14:13:49 +0200
> schrieb Miguel Saro <miguel.saro@xxxxxxx>:
> 
>> Bob, Jerome,
>> 
>> in SDL2, in SDL_main.h there is an initialization difference. In SDL1
>> #define main    SDL_main  is validated but not validated in SDL2. in
>> SDL_main.h I changed line 54  #elif defined(__IPHONEOS__) by this
>> #elif defined(__IPHONEOS__) || defined(__MACOSX__) and I compile
>> SDL2.  Now Hatari compile with Xcode and  Hatari main.c  is called .
>> With breakpoints I followed opérations at Hatari start.
>> Initialization does not finish and Hatari exits with error: Could not
>> initialize the SDL library: Application didn't initialize properly,
>> did you include SDL_main.h in the file containing your main()
>> function?
>> 
>> This happens at ligne  636 in main.c (Main_Init()  routine):
>> 636	if (SDL_Init(SDL_INIT_VIDEO | Opt_GetNoParachuteFlag()) <
>> 0) 637	{
>> 638		fprintf(stderr, "Could not initialize the SDL
>> library:\n %s\n", SDL_GetError() ); 639		exit(-1);
>> 640	}
>> It’s an initialization problem.
>> 
>> 
>>> Hatari now compiles with your SDL2 framework, but I cannot get it
>>> to launch. I see the following errors in the Console when Hatari
>>> launches:
>>> 
>>> 8/12/14 8:43:53.692 PM Hatari[1728]: Could not find image named
>>> 'disk’.
>> I join it
>>> 8/12/14 8:43:53.703 PM Hatari[1728]: Could not connect the action
>>> fax: to target of class NSView
>> I think action fax is not used anywhere
>>> 8/12/14 8:43:53.856 PM com.apple.launchd.peruser.502[176]:
>>> (org.tuxfamily.Hatari.242736[1728]) Exited with code: 255
>> Code 255, see up-there exit(-1)
>> 
>> Miguel
>> 
>> 
>> 
>> M et Y Saro
>> Méaudre:  09 53 21 77 32
>> Seyssinet: 09 52 91 16 20
>> Fax: 09 57 91 16 20
>> http://locations.vercors.free.fr/
>> http://cocoa.pod.free.fr/
>> 




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/