don't click here

Gens/GS Milestone 6

Discussion in 'Engineering & Reverse Engineering' started by GerbilSoft, Aug 24, 2008.

  1. GerbilSoft

    GerbilSoft

    RickRotate'd. Administrator
    2,971
    76
    28
    USA
    rom-properties
    Ok, I implemented a bunch of OS X build fixes.

    - Host systems matching I?86*darwin* are interpreted as OS X. [filterpwned - that's supposed to be a lowercase "I"]
    - GENS_OS_LINUX has been renamed to GENS_OS_UNIX. GENS_OS_LINUX and GENS_OS_MACOSX are now used for OS-specific functionality. GENS_OS_UNIX is defined on all Unix systems, including Linux and MacOS X.
    - nasm now uses Mach-O binary format on OS X.
    - All the underscore problems are fixed. I added a new preprocessor macro that's passed to nasm to specify the output format, and the asm only applies the underscore fixes if the output format is ELF.

    I'll release Milestone 5.1 sometime later this week, which will contain these fixes and some others.
     
  2. GerbilSoft

    GerbilSoft

    RickRotate'd. Administrator
    2,971
    76
    28
    USA
    rom-properties
    Milestone 5.1 version bump, with a bunch of bugfixes!
     
  3. Sappharad

    Sappharad

    Oldbie
    1,415
    70
    28
    Suggested fixes needed for building with CD-ROM disabled:

    In gens_menu_callbacks.cpp, GensWindow_MenuItemCallback_OptionsMenu(uint16_t menuID, uint16_t state):
    Code (Text):
    1. #ifdef GENS_CDROM      
    2.         case IDM_OPTIONS_CURRENT_CD_DRIVE:
    3.             Open_Select_CDROM();
    4.             break;
    5. #endif
    In gens_menu.c, static struct GensMenuItem_t gmiFile[]:
    Code (Text):
    1. #ifdef GENS_CDROM
    2.     {IDM_FILE_BOOTCD,   GMF_ITEM_NORMAL,    "&Boot CD",     NULL,   GMAM_CTRL, 'B', IDIM_CDROM},
    3. #endif
    Aside from that, it now builds on OS X without any other changes. I'll need to talk to you sometime about what I planned to do for the Cocoa UI, because after seeing how you've unified the menu code for Linux and Win32 it would be stupid of me to make something completely separate. (I had already done a few of the settings windows though, so it'll kind of suck to scrap that although it's the right thing to do.)

    I'll post a new OS X binary tomorrow or sometime this week. I found out that the previous one I posted only works if you have GTK and SDL installed, so I want to figure out how to link them with the app or include them in the package.
     
  4. GerbilSoft

    GerbilSoft

    RickRotate'd. Administrator
    2,971
    76
    28
    USA
    rom-properties
    You might want to hold off on that. I'm probably going to release m5.2 today or tomorrow with some fixes, including the CD-ROM fixes you posted above. Also, a user on the Ubuntu Forums reported that PWM is broken in m5.1, so I need to fix that.
     
  5. AamirM

    AamirM

    Tech Member
    Hi,

    I used Gens/GS today (both on Linux and Windows) and it works very well though OpenGL doesn't work on Linux (emu just crashes). Anyways, I just wanted to ask that does the GTK+ port work correctly on MacOSX or does it needs any modifications or has any limitations compared to Linux?

    stay safe,

    AamirM
     
  6. roxahris

    roxahris

    Everyone's a hypocrite. Take my word for it. Member
    1,224
    0
    0
    Doing anything at all
    In the Controller Configuration dialog on Vista, the text in the "Note" part runs a bit out of it's box. Also, when the "Configuration complete, press enter to continue" message is displayed, clicking OK makes it freeze for a long while.
     
  7. GerbilSoft

    GerbilSoft

    RickRotate'd. Administrator
    2,971
    76
    28
    USA
    rom-properties
    What video card do you have? Usually if the GL renderer crashes, that means the GL driver isn't installed properly. (I need to implement a fallback so that it doesn't crash, but instead switches back to plain SDL.) Also yes, the GTK+ port does work on MacOS X, though it isn't optimal. (Requires X11, etc.)

    I don't support Windows Vista.
     
  8. Skaarg

    Skaarg

    Member
    3,683
    0
    16
    To fix the freezing after clicking okay try running Gens/GS as Administrator. I tested it under Windows 7, and there was no freezing when running as Administrator. The text ran out of room in the box, but that looks like that could easily since the "which" in (games which... has been brought down to a new line and there is just space until the next line.
     
  9. GerbilSoft

    GerbilSoft

    RickRotate'd. Administrator
    2,971
    76
    28
    USA
    rom-properties
    !??!!?!?!?!?!! (Please don't follow this advice - running games as Administrator is bad.)

    Actually, the freezing is caused by Gens/GS ignoring all messages except for keypresses. I'm going to redesign the controller configuration dialog to work better later on.
     
  10. Skaarg

    Skaarg

    Member
    3,683
    0
    16
    I understand the running as administrator is bad, I was just stating that was the only way it was working at the moment. Glad though you'll be fixing it so eventually I'll be able to use Gens/GS.
     
  11. AamirM

    AamirM

    Tech Member
    Hi,

    OpenGL works correctly under other emulators like Snes9x/GKT+, bsnes and I also recently added OpenGL support to my Regen/GTK+ port and it works correctly under there as well so I think its not a problem with drivers. I'll admit I didn't gave more details about the problem. If I get some time today, I'll try to debug it and may even fix it if I can.

    Btw, doesn't X11 comes pre-installed with OS X?

    EDIT:
    I have onboard intel 915GM or something video card which I think is supported well.

    stay safe,

    AamirM
     
  12. LazloPsylus

    LazloPsylus

    Buried under SSRG Somewhere Tech Member
    154
    0
    0
    Academy City
    SSRG, world domination, a billion and one research projects...
    Depending on which version of OS X, X11 may or may not be pre-installed. All versions prior to 10.5 do not Pre-install X11, although there is an option in 10.4 to install it on the OS X installer, whereas 10.5 automatically installs it.

    As for GTK+, it would be nice if it comes with the package. I have serious problems with installing it, and it would be just more convenient for users if it is pre-packaged.
     
  13. GerbilSoft

    GerbilSoft

    RickRotate'd. Administrator
    2,971
    76
    28
    USA
    rom-properties
    If possible, can you get a backtrace using gdb? That would help to figure out where it's crashing.
     
  14. AamirM

    AamirM

    Tech Member
    Hi,

    Here is the backtrace:

    Code (Text):
    1. #0  0x02388850 in ?? ()
    2. #1  0x41dd37f8 in __cxa_pure_virtual () from /usr/lib/libGL.so.1
    3. #2  0x41dd3d7f in __cxa_pure_virtual () from /usr/lib/libGL.so.1
    4. #3  0x41dd07cd in __cxa_pure_virtual () from /usr/lib/libGL.so.1
    5. #4  0x41dd0e08 in glXCreateContext () from /usr/lib/libGL.so.1
    6. #5  0x427ab5d2 in _ConvertX86p32_8RGB332 () from /usr/lib/libSDL-1.2.so.0
    7. #6  0x427b0ff9 in _ConvertX86p32_8RGB332 () from /usr/lib/libSDL-1.2.so.0
    8. #7  0x4279e133 in SDL_SetVideoMode () from /usr/lib/libSDL-1.2.so.0
    9. #8  0x080bdc94 in VDraw_SDL_GL::Init_SDL_GL_Renderer (this=0xa988a90, w=640,
    10.     h=480, reinitSDL=true) at ../../../src/gens/video/v_draw_sdl_gl.cpp:137
    11. #9  0x080be226 in VDraw_SDL_GL::Init_Video (this=0xa988a90)
    12.     at ../../../src/gens/video/v_draw_sdl_gl.cpp:109
    13. #10 0x080a4b90 in Change_OpenGL (newOpenGL=1)
    14.     at ../../../src/gens/emulator/g_main_linux.cpp:162
    15. #11 0x415950f9 in g_cclosure_marshal_VOID__VOID ()
    16.    from /lib/libgobject-2.0.so.0
    17. #12 0x41587d9b in g_closure_invoke () from /lib/libgobject-2.0.so.0
    18. #13 0x41598433 in __cxa_pure_virtual () from /lib/libgobject-2.0.so.0
    19. #14 0x41599957 in g_signal_emit_valist () from /lib/libgobject-2.0.so.0
    20. #15 0x41599b19 in g_signal_emit () from /lib/libgobject-2.0.so.0
    21. #16 0x5004afa4 in gtk_widget_activate () from /usr/lib/libgtk-x11-2.0.so.0
    22. #17 0x4ff3e948 in gtk_menu_shell_activate_item ()
    23.    from /usr/lib/libgtk-x11-2.0.so.0
    24. #18 0x4ff3ff12 in __cxa_pure_virtual () from /usr/lib/libgtk-x11-2.0.so.0
    25. #19 0x4ff37ad5 in __cxa_pure_virtual () from /usr/lib/libgtk-x11-2.0.so.0
    26. #20 0x4ff31c90 in __cxa_pure_virtual () from /usr/lib/libgtk-x11-2.0.so.0
    27. #21 0x41586589 in __cxa_pure_virtual () from /lib/libgobject-2.0.so.0
    28. #22 0x41587d9b in g_closure_invoke () from /lib/libgobject-2.0.so.0
    29. #23 0x41598a83 in __cxa_pure_virtual () from /lib/libgobject-2.0.so.0
    30. #24 0x4159971f in g_signal_emit_valist () from /lib/libgobject-2.0.so.0
    31. #25 0x41599b19 in g_signal_emit () from /lib/libgobject-2.0.so.0
    32. #26 0x50046bf8 in __cxa_pure_virtual () from /usr/lib/libgtk-x11-2.0.so.0
    33. #27 0x4ff2b053 in gtk_propagate_event () from /usr/lib/libgtk-x11-2.0.so.0
    34. #28 0x4ff2c257 in gtk_main_do_event () from /usr/lib/libgtk-x11-2.0.so.0
    35. #29 0x4fd6d15a in __cxa_pure_virtual () from /usr/lib/libgdk-x11-2.0.so.0
    36. #30 0x4fbc8622 in g_main_context_dispatch () from /lib/libglib-2.0.so.0
    37. #31 0x4fbcb5ff in __cxa_pure_virtual () from /lib/libglib-2.0.so.0
    38. #32 0x4fbcbb65 in g_main_context_iteration () from /lib/libglib-2.0.so.0
    39. #33 0x4ff2c4d3 in gtk_main_iteration_do () from /usr/lib/libgtk-x11-2.0.so.0
    40. #34 0x080a8ec4 in GensUI::update ()
    41.     at ../../../src/gens/ui/gtk/gens_ui_gtk.cpp:87
    42. #35 0x0804efe8 in GensMainLoop () at ../../../src/gens/emulator/g_main.cpp:482
    43. #36 0x080a4e04 in main (argc=1, argv=0xbfe3b9f4)
    44.     at ../../../src/gens/emulator/g_main_linux.cpp:136
    In my short testing, I have some other bug reports :) . Disregard them if they are already mentioned somewhere in the docs provided. First, stretch option doesn't work if renderer is set to double. Secondly, selecting 16 bpp from bit depth also crashes the emulator. Third, sound stutters/crackles quite a lot.

    stay safe,

    AamirM
     
  15. GerbilSoft

    GerbilSoft

    RickRotate'd. Administrator
    2,971
    76
    28
    USA
    rom-properties
    1. On the Linux version, Stretch doesn't work at all unless you're using OpenGL. On Windows, it only works in Normal. I will get around to fixing these eventually.

    2. I'll take a look at that. It seems that video mode changing in general is a bit problematic. I should probably rework the whole system.

    3. Make sure you're using 44.1 kHz stereo.

    From the backtrace, it looks like it's libGL is calling a C++ pure virtual function (__cxa_pure_virtual()), which isn't supposed to happen. What version of Mesa do you have installed?

    EDIT: Even weirder, __cxa_pure_virtual() is being called from some C-only libraries (GLib, GTK+). Something's screwed up here.
     
  16. roxahris

    roxahris

    Everyone's a hypocrite. Take my word for it. Member
    1,224
    0
    0
    Doing anything at all
    That's a retarded excuse.
    You could have, you know, said this earlier on instead of being a LOLVISTASUX fag.
    (Oh, by the way, any criticisms you might make of Vista are rendered invalid until you have used it.)
     
  17. AamirM

    AamirM

    Tech Member
    Hi,
    I don't think he said Vista sucks anywhere. But yeah, it does. Slow, half-assed crap, that. And yes, I've used it and even have it installed right now just to fix problems Vista users, if any, are having.

    stay safe,

    AamirM
     
  18. MarzSyndrome

    MarzSyndrome

    Everything is going to the beat. Member
    With the latest version at least (5.1), it appears one is unable to drag & drop roms onto the executable to have it start the game automatically, citing an "invalid argument". The file extension doesn't seem to matter in this case.

    Dragging & dropping roms into an already active Gens/GS window, however, does work.
     
  19. GerbilSoft

    GerbilSoft

    RickRotate'd. Administrator
    2,971
    76
    28
    USA
    rom-properties
    I assume this is on Windows. I'll have to check the Win32 command line parser to see if it's parsing everything correctly or not.

    Unlike Unix systems, which provide argc and argv[] in the main() function (argv[] is an array of all parameters specified), Windows provides a single lpCmdLine parameter in the WinMain() function, which contains the entire command line. So it's possible that the code I'm using to separate lpCmdLine into argc and argv[] isn't functioning correctly for that particular case (which I didn't test).

    EDIT: Actually, I do remember testing that case, and I'm pretty sure it worked properly. I'll test it again later today.
     
  20. Overlord

    Overlord

    Now playable in Smash Bros Ultimate Moderator
    19,239
    972
    93
    Long-term happiness
    Why should he have to buy an OS he doesn't want just to test a free emulator on it?

    Also, I use Vista on a daily basis at work. It chugs wang, but that's a discussion for another time.