don't click here

Gens/GS Release 7

Discussion in 'Engineering & Reverse Engineering' started by GerbilSoft, Nov 22, 2009.

  1. Conan Kudo

    Conan Kudo

    「真実はいつも一つ!」工藤新一 Member
    478
    1
    18
    Using ALSA directly is generally not possible anymore, since PulseAudio is usually configured to wrap around ALSA interfaces as well.

    OSS isn't even included in Linux anymore, so that is out of the question.
     
  2. Mad Echidna

    Mad Echidna

    Gone Oldbie
    5,219
    0
    0
    Oh god not a Linux audio discussion <_<

    Any program that uses ALSA will still do so, and that sound will go to the Pulse sound server via the ALSA wrapper. Tweaker's issue proabably has nothing to do with Pulse.
     
  3. Vague Rant

    Vague Rant

    Deceptively cute Oldbie
    Speaking of Linux and audio, although this may affect all builds: run Gens, uncheck Sound > Enable, close Gens, run Gens. The checkbox is enabled again, but sound is still disabled. If you uncheck it, sound stays disabled. Check it again and sound is enabled.
     
  4. LocalH

    LocalH

    roxoring your soxors Tech Member
    3,314
    37
    28
    Nunya
    Rock Band 3 Deluxe
    Gerbil: You need to implement full border emulation - it pisses me off that no major Genesis emulator does so. Just render your 320 pixel wide Genesis window within a 352x240 frame, and fill the unused area with the border color for that scanline. I haven't really played with Gens/GS, so I don't know if you correct the aspect ratio in H32 mode, but if you do, you're still rendering to a 320 pixel wide buffer, which means that it shouldn't be too hard to handle the border.

    I'd also like to see emulation of the CRAM garbage seen in the bottom border on most commercial games - one more step to having an emulator that at least produces authentic-looking output (since full accuracy would take something on the level of Nem's Enigma).
     
  5. GerbilSoft

    GerbilSoft

    RickRotate'd. Administrator
    2,974
    87
    28
    USA
    rom-properties
    The problem with 352x240 is that it probably won't work in fullscreen. However, I suppose I could make it an option, though that won't be done for a while. Specifically, the VDP code needs to be ported to C. (The VDP code right now is hard-coded to assume a pitch of 336 pixels. The extra 16 is for sprite overflow handling or something.)

    With regards to the CRAM garbage, right now the borders are drawn in the video backends, not the actual VDP code. This will be changed once I do the VDP rewrite, so I could potentially add the CRAM garbage functionality there. (I think I know what you're talking about - when I had my MD connected to a VGA projector using RGB, there were some random colored dots at the bottom of the frame.)

    Also, on that note, I currently have an old Mitsubishi 14" RGB monitor available that I can use for MD testing. (Supports composite, RGB [15-36 kHz], and TTL [MDA/CGA/EGA].) My SegaCD isn't exactly in working condition, though. (The tray's messed up - I need to fix that sometime.)
     
  6. LocalH

    LocalH

    roxoring your soxors Tech Member
    3,314
    37
    28
    Nunya
    Rock Band 3 Deluxe
    Idea for that: Render to 352x240 internally, but then bilinear resample it to 320x240. This could be tied to an "NTSC Aspect" option sort of like Snake does (except Snake does it wrong - instead of horizontally shrinking the image, he vertically expands it, breaking those who run in 320x240 and use filtered mode to make H32 mode look good as well). Then you can use that 320x240 image like you normally would.

    You're correct on the CRAM garbage. I'm not actually sure if it's CRAM-only, I think Nem has done some research into this area. You see more of it when games like S1 and S2 fade the palette in or out (see S2 intro sequence on hardware).
     
  7. GerbilSoft

    GerbilSoft

    RickRotate'd. Administrator
    2,974
    87
    28
    USA
    rom-properties
    In progress for Release 7.1:

    [​IMG]

    An external VDP debugger. :) Currently, it only shows the palette, but I will add more stuff later.
     
  8. Hayate

    Hayate

    Tech Member
    I tried this earlier today, and it occured to me there's two things you need to add to make it beat Movie Gens. Obviously, the first one is TAS tools, which I recall someone saying would eventually be made as a plugin. But there's something I believe is more important than that, which is Windowed Fullscreen. If you haven't tried it in Movie Gens or whatever, it's how VisualBoyAdvance does fullscreen, and essentially it means that your current resolution is preserved and the image is nearest-neighbor stretched to fill the screen. That means two useful things. Firstly, menus don't get squashed up in a tiny 320x240 (or 640x480) resolution. Secondly, it doesn't stretch wrongly on widescreen. But most importantly, it doesn't cause things to mess up in obscure setups - like my use of DVI which my graphics card doesn't seem to like, so it switches back to VGA when a program changes resolution. (I also had a monitor that refused to display 640x480, but that sucked, so I don't use it any more. The same point applies though.)
     
  9. nineko

    nineko

    I am the Holy Cat Tech Member
    6,421
    585
    93
    italy
    ew, no please.
    I don't know Gerbil's opinion on this, but preserving your resolution is one of the worst things you can do. For one it would lead to nonintegral resizing almost for sure, with the related consequences: much higher CPU load, and high chance for the image to look like crap.
    I already have problems to accept the 2X filter (if the resolution was 320x224, why should you play it in 640x448?), but more than this is just plain bullshit. I die a little inside each time I see a video on youtube recorded by someone who MAXIMIZES the emulator window and runs a screen capture at a ridiculously high resolution (and of course at ~5 frames per second due to this).

    No thanks.
     
  10. SegaLoco

    SegaLoco

    W)(at did you say? Banned
    2nd'd. If you really want to do that, code it yourself ;). Try to make an mdp if that many people want it, depending on how much freedom an mdp gets that is.
     
  11. Hayate

    Hayate

    Tech Member
    ...what?

    Dude, it's not like the mode would be mandatory. It'd be an OPTION, just like it is in MovieGens. What do you need to do to avoid using it? Absolutely nothing.

    Windowed Fullscreen has never caused lag/slowdown for me. Plus, if you're so bothered about non-integral resizing, there could be another option to make it only scale to the next lowest integral size available - for example, with a resolution of 1920x1080, the scale factor would be 4, which would produce a 1280x960 (or 1280x896 for the purists) image in the center of the screen.

    Also, it seems you're failing to take into account the fact that Gens/GS already can display in this scaling mode, it just doesn't let you display the window in fullscreen without changing the resolution.

    I'm sure MovieGens has this for a reason, and I'm sure I'm not the only one out there with a weird monitor.

    There's another advantage it has that MovieGens doesn't make use of - with windowed fullscreen, you no longer need to revert to non-fullscreen to display dialogs such as the open or preferences dialogs. It always annoyed me when the screen would be black for three seconds just because I wanted to change my controls or somesuch.

    Speaking of changing controls, there's a bug which I've seen in a lot of emulators which only seems to happen on Vista and 7 - the keypresses aren't marked as "handled", so they get processed by the GUI. So if you want to use the space key, it re-presses the "change assignment" button you just pressed. This one can be avoided by holding down the mouse button somewhere else while pressing space, but more annoyingly and specific to Gens/GS is that if you try and use the 'c' key, it presses the Cancel button, which I haven't found a workaround for. Yes, the response to this will probably be "go change the values in the config file", but why even have the configuration dialog if I need to edit the values in the file?
     
  12. GerbilSoft

    GerbilSoft

    RickRotate'd. Administrator
    2,974
    87
    28
    USA
    rom-properties
    Release 7.1 status report:

    I'm probably going to push back the Z80 porting until Release 7.2, since I shifted focus to another aspect: the VDP. I'm currently porting the VDP code from assembler to C. So far, I've finished all the I/O and DMA code, and am almost finished the Mode 5 rendering code. Parts remaining include the render functions for Scroll A / Window and Sprites. (I improved the sprite masking function to properly implement the per-line sprite limit, which is 16 in H32 and 20 in H40. This is configurable using the "Sprite Limit" option in the Graphics menu, which also controls the sprite-dots-per-line limit. [256 in H32, 320 in H40.])

    Another area I'm focusing on is the new VDP Debugger plugin. Currently, it displays the palette and register list in realtime. I plan on adding some more stuff before Release 7.1, possibly including VRAM pattern viewing (already supported by the built-in debugger), scroll plane viewing, hardware sprite viewing (all at once via a GtkTreeView), and Sonic sprite mapping viewing. [Note that the initial release will be Linux/GTK+ only. A Win32 UI will be added in a future release.]

    Other notable improvements:
    - IRC Reporter plugin. (Linux only for r7.1) Reports the currently-loaded ROM via D-BUS to IRC clients, which can then use the information in a script similar to MP3-reporting scripts.
    - mcd_reader_t struct, which cleans up the physical CD-ROM interface and will allow for proper BIN/CUE support in the future.
    - Full Unicode and DPI awareness on Win32. (This unfortunately breaks Gens/GS on Windows 95, since Windows 95 doesn't support UTF-8.)
    - FPS counter and Message now allow any RGB color to be selected instead of just red, green, blue, and white.
    - The internal VDP debugger has improved tile display for Interlaced mode, plus improved line numbering for both MD tiles and SegaCD Word RAM patterns.
    - Lots of bug fixes.

    Hayate: Regarding "windowed fullscreen", Gens/GS kinda does support it right now - at least on Linux with a decent window manager. Disable the menu bar by pressing Ctrl-M, then set the window to No Border using the window manager. Windows unfortunately doesn't provide this functionality, and it'd be a pain for me to figure it out myself, especially because I haven't done any multi-monitor programming in Windows before. If anyone could provide a patch to enable "windowed fullscreen" on the specified monitor, I would appreciate it. (Incidentally, since Gens/GS uses DirectDraw on Win32, resizing the window does not increase CPU load. The rescaling is done in hardware on the video card. Also, DirectDraw only supports nearest-neighbor scaling, so there's no blurring.)

    For the "unhandled" keypresses, I'm pretty sure Gens/GS does throw out all the WM_KEY* messages after waiting for DirectInput to process them. Maybe Vista/7 is sending some other messages that I'm not discarding?
     
  13. TmEE

    TmEE

    Master of OPL3-SA2/3 Tech Member
    1,782
    53
    28
    Norway, Horten
    VFDgame
    Is Gens/GS using SSE2 or something ? I get "this program has tried to execute illegal instruction error" every time I try to run it... I've got a Tualatin Pentium III here, its only got SSE...
     
  14. Hayate

    Hayate

    Tech Member
    Just set the window's border state to "none" and then maximize it; then it'll automatically hide the taskbar/other docked toolbars if people still use those (and, in the case of multi-monitor, the window will simply fill whatever screen it was already visible on). If the window's already maximized, you NEED to restore it before going windowed fullscreen, or it won't work.

    I can't think why it would, but this could well be the case - it's a pretty common problem with all emulators, not just Gens/GS.
     
  15. GerbilSoft

    GerbilSoft

    RickRotate'd. Administrator
    2,974
    87
    28
    USA
    rom-properties
    Gens/GS Release 7 is compiled for i686, and the only optimizations that are available are MMX (which are enabled at runtime)...

    Can you post the faulting address? (Better yet, can you go on #retro so we can debug this? =P)

    Okay, I'll consider adding this in the win32-dlu branch. (This branch has all the Dialog Unit changes for resolution-independence.)

    Do you have a copy of Spy++? If so, can you record a log of all the messages sent to the Controller Configuration window when configuring a key and pastebin it?
     
  16. Hayate

    Hayate

    Tech Member
    I don't have Spy++. I think it came with Visual Studio 6 which I had years ago, but I really don't feel like digging that up again and installing it =P
     
  17. Conan Kudo

    Conan Kudo

    「真実はいつも一つ!」工藤新一 Member
    478
    1
    18
    You can download the Debugging Tools for Windows which includes Spy++ among other debugging tools.
     
  18. GerbilSoft

    GerbilSoft

    RickRotate'd. Administrator
    2,974
    87
    28
    USA
    rom-properties
    Random stuff done just now:
    • Fixed a RAM mirroring issue with Starscream (the 68000 emulator). The instuction fetch table didn't have all the RAM mirrors set up, and Jorge's test ROM has an interrupt handler at $E00000. I reworked it to add all the mirrors, and the test ROM now works. (Eventually, the 68000 emulator will be ported to C and updated to use a more efficient page table system.) [Note that memory fetch had the mirroring system set up properly. Why Starscream uses separate instruction and data fetch functions is beyond me.]
    • SegaCD: Added support for 128 KB, 256 KB, and 512 KB backup RAM cartridges. (default is still 64 KB)
    • SegaCD: The backup RAM cartridge is now automatically formatted if it doesn't exist. This should hopefully eliminate all of the "Why do I get a picture of Eggman when I try running Sonic CD?" problems.
     
  19. Hayate

    Hayate

    Tech Member
    I just installed that, and the only program it seems to have put on the Start menu is "WinDbg". Taking a quick glance at the help file which had a list of "additional tools and utilities", Spy++ isn't in that list either.
     
  20. Conan Kudo

    Conan Kudo

    「真実はいつも一つ!」工藤新一 Member
    478
    1
    18
    Hmm... Well, here is a "substitute" of Spy++, called WinSpy. Perhaps this can help? Binaries and Source code are available for WinSpy, too...