don't click here

Gens/GS II now runs ROMs!

Discussion in 'Engineering & Reverse Engineering' started by GerbilSoft, Aug 11, 2010.

  1. GerbilSoft

    GerbilSoft

    RickRotate'd. Administrator
    2,971
    76
    28
    USA
    rom-properties
    Over the past few days, I got the 68000 emulation core working and added P1 controller support. As of today, it's possible to play ROMs in Gens/GS II.

    Known issues:
    • No frame limiting. Games only run at the correct speed if you're using a 60 Hz display and have GL VSync turned on.
    • No sound or Z80 emulation yet.
    • Controls are currently hardcoded, as is the filename.

    How to run a ROM in Gens/GS II:
    • First, build a copy of Gens/GS II from source. If you need help, ask me in #retro. (I'm not providing precompiled binaries at this stage, since the UI isn't really user-friendly.)
    • Put a ROM in the Gens/GS II binary directory and name it test.bin. The ROM must be uncompressed!
    • Start Gens/GS. Select File, Blit. A message showing the filesize of the ROM should be printed to the console.
    • Select File, Start/Stop EmuThread. The emulation should start.

    Once emulation is started, you can connect a controller. Select CtrlTest, and then pick a controller to use.

    Controller keymap:
    • Up: Up
    • Down: Down
    • Left: Left
    • Right: Right
    • A: A
    • B: S
    • C: D
    • Start: Enter
    • X: Q
    • Y: W
    • Z: E
    • Mode: Shift (either shift; it doesn't distinguish between left and right yet)

    If you select the 2-button controller (SMS), then button 1 is mapped to B and button 2 is mapped to C.

    Let me know the results of any testing you all do. :)
     
  2. Conan Kudo

    Conan Kudo

    「真実はいつも一つ!」工藤新一 Member
    478
    1
    18
    Awesome! :thumbsup:

    Keep up the great work!
     
  3. GerbilSoft

    GerbilSoft

    RickRotate'd. Administrator
    2,971
    76
    28
    USA
    rom-properties
    [​IMG]

    Here's the initial Controller Configuration UI. Nothing's saved yet, but it does show the controller plugged into Port 1 (selected via the CtrlTest menu before opening the dialog).

    The DE-9 connector icon on Port 2 indicates that no controller is plugged in. The ability to have no controller connected to a port is a new feature compared to Gens/GS and the original Gens, and it was quite easy to implement, too. When no controller's plugged in, all lines are floating (I.e. they read as '1'). So, the readData() function simply returns $FF (masked with any output bits from the tristate buffer).

    The Genesis 3-button and 6-button gamepad icons were provided by ts230, aka theocas.
     
  4. Overlord

    Overlord

    Now playable in Smash Bros Ultimate Moderator
    19,218
    965
    93
    Long-term happiness
    Will there be PAL variants on the pad icons? ;P You should set that if EUR is set as the region in Gens/GS...

    Looking nice, though!
     
  5. theocas

    theocas

    Tech Member
    346
    0
    16
    Yes, I already saw it on IRC, but I like it. I only have one concern - that giant drop-down menu will likely not display correctly on Mac OS X, or look pixelized. Maybe if you're on OS X scale the icons down to 16x16 and make the drop-down 22 pixels high. Wish you lots of luck with Gens/GS II!

    Overlord: I might design and draw them, depends on how lazy I am. But I'll definitely consider the suggestion.
     
  6. Andlabs

    Andlabs

    「いっきまーす」 Wiki Sysop
    2,175
    1
    0
    Writing my own MD/Genesis sound driver :D
    [​IMG]
    Judge it yourself (and yes, I turned off the magnification for this, so it's the size most users would see it at).
     
  7. GerbilSoft

    GerbilSoft

    RickRotate'd. Administrator
    2,971
    76
    28
    USA
    rom-properties
    Today I ported the EEPROM functionality from Genesis Plus to Gens/GS II. This means that NBA Jam TE works without hacks, and around 20 other games that use EEPROM for saves instead of SRAM also work properly.

    Also, I tracked down a stupid Z80 bug that was causing issues with Sonic 1 SAGE 2010 and Micro Machines Turbo Tournament '96. When writing the Z80 bus arbitration code, I inverted the RESET line logic because the normal version broke S1SAGE. Turns out it was because I was calling Z80::Reset() when the RESET line was asserted, and this function actually reinitialized the Z80 emulator (e.g. clearing RAM and resetting the banking register). I renamed the function to Z80::ReInit() and added a real Z80::Reset() that only resets the Z80 CPU, and un-inverted the RESET logic. It all works correctly now. :)

    EDIT: SSF2 bankswitching has been reimplemented, so SSF2 works.
     
  8. GerbilSoft

    GerbilSoft

    RickRotate'd. Administrator
    2,971
    76
    28
    USA
    rom-properties
    [​IMG]

    ROMs can now be opened and closed using the "Open ROM" and "Close ROM" items in the File menu. The "Blit!" and "Start/Stop EmuThread" menu items are gone.

    Also, the game title is displayed in the title bar. (The space elimination code from Gens/GS is implemented in the Rom class, so the extra spaces in the titles of Sonic games are removed.)

    In case you're wondering, the ROM running in the above screenshot is "NBA Jam Tournament Edition (W) (REV01) [!].gen". This ROM doesn't run in older versions of Gens/GS or regular Gens due to the lack of EEPROM emulation. (Note that Rev00 has broken EEPROM code, so that version won't save properly even with working EEPROM emulation.)
     
  9. Black Squirrel

    Black Squirrel

    no reverse gear Wiki Sysop
    8,543
    2,465
    93
    Northumberland, UK
    steamboat wiki
    But then you'd have to call it Megs/GS II!

    though you could start running into issues if you start recolouring the controllers to match the region. Several changed colours mid-way through the console's lifespan and if turbo features are implemented things could get messy.
     
  10. GerbilSoft

    GerbilSoft

    RickRotate'd. Administrator
    2,971
    76
    28
    USA
    rom-properties
    Some updates since the last posting:
    • ROMs can now be loaded by selecting File, Open ROM. This is a bit of an important addition, so I'm not sure why I forgot to mention it before. :v:
    • Added a Credits tab to the About dialog, which lists everyone who has contributed to Gens, Gens/GS, and Gens/GS II. (If I missed anyone, let me know!)
    • Use the VGA character set for onscreen text instead of standard text rendering. This improves performance, but only allows us to display Unicode characters U+0000 - U+00FF.
    • Initial audio support. There's some issues with audio stuttering if the framerate can't keep up, so I'll have to work on that.
    • Added PNG screenshot support.
    • Moved the Keyboard device handler out of libgens and into gens-qt4. This will allow for, among other things, OS-specific multiple keyboard support.
    • Initial EA 4-Way Play support. (Currently broken due to key remapping issues.)
    • SRam/EEPRom autosave. If SRam or EEPRom is modified, and then is left alone for a certain amount of time (currently around 1000 ms), it's automatically saved to disk. I'll add configuration for this later, as well as activating autosave if the emulator is paused using the Escape key.
    • Fixed several Mac OS X-specific crashes caused by stack alignment problems.
    • Added an ARB fragment program version of the Fast Blur effect. (Paused effect takes priority, so if Paused is enabled, Fast Blur will fall back to software.)
    • GZip, Zip, 7z, and RAR archives are now supported. (RAR requires /usr/bin/unrar on Unix systems and UnRAR.dll on Windows systems. The pathname will be customizable later on.) I'm using the latest LZMA SDK (9.12 as of this posting), so newer 7-Zip archives compressed using LZMA2 should work.
    • Full Unicode support for Zip and RAR.
    • Full Unicode support for 7-Zip on Windows; partial on Unix. (It's in progress.)
    • Multiple file selection from ROM archives with multiple files.

    EDIT: Added File, Open ROM.
     
  11. theocas

    theocas

    Tech Member
    346
    0
    16
    Yay. No, seriously, good job with Gens/G II so far. I hope to see a somewhat-complete OS X version soon! Also, if you need me to test anything on OS X, I'll most likely be on #retro.
     
  12. Mad Echidna

    Mad Echidna

    Gone Oldbie
    5,219
    0
    0
    Blah blah blah Haiku