1. 13 Sep, 2018 1 commit
    • Screwtape's avatar
      Update to v106r64 release. · 336d2012
      Screwtape authored
      byuu says:
      
      Changelog:
      
        - sfc: completed BS Memory Cassette emulation (sans bugs, of course --
          testing appreciated)
        - bsnes: don't strip - on MSU1 track names in game ROM mode
          [hex_usr]
      
      I'm going with "metadata.bml" for the flash metadata filename for the
      time being, but I'll say that it's subject to change. I'll have to make
      a new extension for it to be supported with bsnes.
      336d2012
  2. 11 Sep, 2018 1 commit
    • Screwtape's avatar
      Update to v106r63 release. · c5816994
      Screwtape authored
      byuu says:
      Changelog:
      
        - gb/mbc7: rewrote the 93LCx6 EEPROM emulation
        - sfc/slot/bsmemory: rewrote the flash emulation for Satellaview
          cartridges
      
      As of this release, flash-based BS Memory cartridges will be writable.
      So without the bsnes patch to disable write limits, some games will lock
      out after a few plays.
      c5816994
  3. 10 Sep, 2018 1 commit
    • Screwtape's avatar
      Update to v106r62 release. · c2d0ed4c
      Screwtape authored
      byuu says:
      
      Changelog:
      
        - sfc/cx4: added missing instructions [info from Overload]
        - sfc/cx4: added instruction cache emulation [info from ikari]
        - sfc/sa1: don't let CPU access SA1-only I/O registers, and vice versa
        - sfc/sa1: fixed IRQs that were broken from the recent WIP
        - sfc/sa1: significantly improved bus conflict emulation
            - all tests match hardware now, other than HDMA ROMROM, which
              is 0.5 - 0.8% too fast
        - sfc/cpu: fixed a bug with DMA→CPU alignment timing
        - sfc/cpu: removed the DMA pipe; performs writes on the same cycles as
          reads [info from nocash]
        - sfc/memory: fix a crashing bug due to not clearing Memory size field
          [hex_usr]
        - bsnes/gb: use .rtc for real-time clock file extensions on the Game
          Boy [hex_usr]
        - ruby/cgl: compilation fix [Sintendo]
      
      Now let's see if I can accept being off by ~0.65% on one of twelve SA1
      timing tests for the time being and prioritize much more important
      things or not.
      c2d0ed4c
  4. 04 Sep, 2018 1 commit
    • Screwtape's avatar
      Update to v106r61 release. · 3d34517f
      Screwtape authored
      byuu says:
      
      This release adds ikari's Cx4 notes to bsnes. It fixes the MMX2 intro's
      boss fight sequence to be frame perfect to real hardware. It's also very
      slightly faster than before.
      
      I've also added an option to toggle the CPUcoprocessor cycle
      synchronization to the emulation settings panel, so you don't have to
      recompile to get the more accurate SA1 timings. I'm most likely going to
      default this to disabled in bsnes, and *maybe* enabled in higan out of
      the box.
      
      StaticRAM (wasn't used) and MappedRAM are gone from the Super Famicom
      core. Instead, there's now ReadableMemory, WritableMemory, and
      ProtectedMemory (WritableMemory with a toggle for write protection.)
      Cartridge::loadMap now takes a template Memory object, which bypasses an
      extra virtual function call on memory accesses, but it doesn't really
      impact speed much. Whatever.
      3d34517f
  5. 02 Sep, 2018 1 commit
    • Screwtape's avatar
      Update to v106r60 release. · a3e0f6da
      Screwtape authored
      byuu says:
      
      I added (imperfect) memory conflict timing to the SA1.
      
      Before:
      
        - WRAMROM ran 7% too fast
        - ROMROM ran 100% too fast
        - WRAMIRAM ran 7% too fast
        - ROMIRAM ran 7% too fast
        - IRAMIRAM ran 287% too fast
        - BWRAMBWRAM ran 100% too fast
        - HDMA ROMROM ran 15% too fast
        - HDMA WRAMROM ran 15% too fast
        - DMA ROMROM ran 100% too fast
      
      After:
      
        - ROMROM runs 14% too fast
        - HDMA WRAMROM runs 7% too fast
        - DMA ROMROM runs 4% too fast
      
      If you enable this with the fast PPU + DSP, your framerate in SA1 games
      will drop by 51%. And even if you disable it, you'll still lose 9% speed
      in SA1 games, and 2% speed in non-SA1 games, because of changes needed
      to make this support possible.
      
      By default, I'm leaving this off. Compile with `-DACCURATE_SA1` (or
      uncomment the line in sfc/sfc.hpp) if you want to try it out.
      
      This'll almost certainly cause some SA1 regressions, so I guess we'll
      tackle those as they arise.
      a3e0f6da
  6. 26 Aug, 2018 1 commit
    • Screwtape's avatar
      Update to v106r59 release. · bd814f03
      Screwtape authored
      byuu says:
      
      Changelog:
      
        - fixed bug in Emulator::Game::Memory::operator bool()
        - nall: renamed view<string> back to `string_view`
        - nall:: implemented `array_view`
        - Game Boy: split cartridge-specific input mappings (rumble,
          accelerometer) to their own separate ports
        - Game Boy: fixed MBC7 accelerometer x-axis
        - icarus: Game Boy, Super Famicom, Mega Drive cores output internal
          header game titles to heuristics manifests
        - higan, icarus, hiro/gtk: improve viewport geometry configuration;
          fixed higan crashing bug with XShm driver
        - higan: connect Video::poll(),update() functionality
        - hiro, ruby: several compilation / bugfixes, should get the macOS
          port compiling again, hopefully [Sintendo]
        - ruby/video/xshm: fix crashing bug on window resize
            - a bit hacky; it's throwing BadAccess Xlib warnings, but they're
              not fatal, so I am catching and ignoring them
        - bsnes: removed Application::Windows::onModalChange hook that's no
          longer needed [Screwtape]
      bd814f03
  7. 21 Aug, 2018 1 commit
    • Screwtape's avatar
      Update to v106r58 release. · f9adb4d2
      Screwtape authored
      byuu says:
      
      The main thing I worked on today was emulating the MBC7 EEPROM.
      
      And... I have many things to say about that, but not here, and not now...
      
      The missing EEPROM support is why the accelerometer was broken. Although
      it's not evidently clear that I'm emulating the actual values
      incorrectly. I'll think about it and get it fixed, though.
      
      bsnes went from ~308fps to ~328fps, and I don't even know why. Probably
      something somewhere in the 140KB of changes to other things made in this
      WIP.
      f9adb4d2
  8. 10 Aug, 2018 1 commit
    • Screwtape's avatar
      Update to 20180809 release. · 9a6ae6da
      Screwtape authored
      byuu says:
      
      The Windows port can now run the emulation while navigating menus,
      moving windows, and resizing windows. The main window also doesn't try
      so hard to constantly clear itself. This may leave a bit of unwelcome
      residue behind in some video drivers during resize, but under most
      drivers, it lets you resize without a huge amount of flickering.
      
      On all platforms, I now also run the emulation during MessageWindow
      modal events, where I didn't before.
      
      I'm thinking we should probably mute the audio during modal periods,
      since it can generate a good deal of distortion.
      
      The tooltip timeout was increased to ten seconds.
      
      On Windows, the enter key can now activate buttons, so you can more
      quickly dismiss MessageDialog windows. This part may not actually work
      ... I'm in the middle of trying to get messages out of the global
      `Application_windowProc` hook and into the individual `Widget_windowProc`
      hooks, so I need to do some testing.
      
      I fixed a bug where changing the input driver wouldn't immediately
      reload the input/hotkey settings lists properly.
      
      I also went from disabling the driver "Change" button when the currently
      active driver is selected in the list, to instead setting it to say
      "Reload", and I also added a tool tip to the input driver reload button,
      advising that if you're using DirectInput or SDL, you can hit "Reload"
      to rescan for hotplugged gamepads without needing to restart the
      emulator. XInput and udev have auto hotswap support. If we can ever get
      that into DirectInput and SDL, then I'll remove the tooltip. But
      regardless, the reload functionality is nice to have for all drivers.
      
      I'm not sure what should happen when a user changes their driver
      selection while a game is loaded, gets the warning dialog, chooses not
      to change it, and then closes the emulator. Currently, it will make the
      change happen the next time you start the emulator. This feels a bit
      unexpected, but when you change the selection without a game loaded, it
      takes immediate effect. So I'm not really sure what's best here.
      9a6ae6da
  9. 09 Aug, 2018 1 commit
    • Screwtape's avatar
      Update to 20180808 release. · 1e4affe5
      Screwtape authored
      byuu says:
      
      This release fixes the XAudio 2.1 and WASAPI drivers on Windows, and
      extends XAudio to support device selection (eg headphones, speakers,
      monitor, etc.) It also adds DRC to XAudio, however it's not currently
      working.
      
      The code is courtesy of Talarubi, I just botched it somewhere upon
      porting it to the newer version of ruby.
      1e4affe5
  10. 08 Aug, 2018 1 commit
    • Screwtape's avatar
      Update to v106r57 release. · 93a6a1ce
      Screwtape authored
      byuu says:
      
      I've added tool tips to hiro for Windows, GTK, and Qt. I'm unsure how to
      add them for Cocoa. I wasted am embarrassing ~14 hours implementing tool
      tips from scratch on Windows, because the `TOOLTIPS_CLASS` widget just
      absolutely refused to show up, no matter what I tried. As such, they're
      not quite 100% native, but I would really appreciate any patch
      submissions to help improve my implementation.
      
      I added tool tips to all of the confusing settings in bsnes. And of
      course, for those of you who don't like them, there's a configuration
      file setting to turn them off globally.
      
      I also improved Mega Drive handling of the Game Genie a bit, and
      restructured the way the Settings class works in bsnes.
      
      Starting now, I'm feature-freezing bsnes and higan. From this point
      forward:
      
        - polishing up and fixing bugs caused by the ruby/hiro changes
        - adding DRC to XAudio2, and maybe exclusive mode to WGL
        - correcting FEoEZ (English) to load and work again out of the box
      
      Once that's done, a final beta of bsnes will go out, I'll fix any
      reported bugs that I'm able to, and then v107 should be ready. This time
      with higan being functional, but marked as v107 beta. v108 will restore
      higan to production status again, alongside bsnes.
      93a6a1ce
  11. 06 Aug, 2018 2 commits
    • Screwtape's avatar
      Update to v106r56 release. · 3b4e8b6d
      Screwtape authored
      byuu says:
      
      I fixed all outstanding bugs that I'm aware of, including all of the
      errata I listed yesterday.
      
      And now it's time for lots of regression testing.
      
      After that, I need to add Talarubi's XAudio2 DRC code, and then get a
      new public bsnes WIP out for final testing.
      
      New errata: when setting an icon (nall::image) larger than a Canvas on
      Windows, it's not centering the image, so you end up seeing the overscan
      area in the state manager previews, and the bottom of the image gets cut
      off. I also need to forcefully disable the Xlib screensaver disable
      support. I think I'll remove the GUI option to bypass it as well, and
      just force screensaver disable always on with Windows. I'll improve it
      in the future to toggle the effect between emulator pauses.
      3b4e8b6d
    • Screwtape's avatar
  12. 05 Aug, 2018 1 commit
    • Screwtape's avatar
      Update to v106r55 release. · 5da45327
      Screwtape authored
      byuu says:
      
      Everything *should* be working again, but of course that won't
      actually be the case. Here's where things stand:
      
        - bsnes, higan, icarus, and genius compile and run fine on FreeBSD
          with GTK
        - ruby video and audio drivers are untested on Windows, macOS, and
          Linux
        - hiro is untested on macOS
        - bsnes' status bar is not showing up properly with hiro/qt
        - bsnes and higan's about screen is not showing up properly with
          hiro/qt (1x1 window size)
        - bsnes on Windows crashes often when saving states, and I'm not sure
          why ... it happens inside Encode::RLE
        - bsnes on Windows crashes with ruby.input.windows (unsure why)
        - bsnes on Windows fails to show the verified emblem on the status bar
          properly
        - hiro on Windows flickers when changing tabs
      
      To build the Windows bsnes and higan ports, use
      
          ruby="video.gdi audio.directsound"
      
      Compilation error logs for Linux will help me fix the inevitable list of
      typos there. I can fix the typos on other platforms, I just haven't
      gotten to it yet.
      5da45327
  13. 04 Aug, 2018 4 commits
    • Screwtape's avatar
      Fix ST018 firmware hashes. · 552d3850
      Screwtape authored
      552d3850
    • Screwtape's avatar
      Remove redundant use of "classic". · 0595e9e8
      Screwtape authored
      0595e9e8
    • Screwtape's avatar
      Don't mention console dates in the documentation. · 23da4e4e
      Screwtape authored
      The WonderSwan Color came out in 2000 and the GBA in 2001, so technically
      they're not "video-game consoles of the 1980s and 1990s". Since there's no
      elegant way to talk about the 2000-2009 timespan, let's just not mention
      dates at all.
      23da4e4e
    • Screwtape's avatar
      Update to v106r54 release. · 41e127a0
      Screwtape authored
      byuu says:
      
      Changes to hiro will break all but the GTK target. Not that it matters
      much given that the only ruby drivers that function are all on BSD
      anyway.
      
      But if you are fortunate enough to be able to run this ... you'll find
      lots of polishing improvements to the bsnes GUI. I posted some
      screenshots on Twitter, if anyone were interested.
      41e127a0
  14. 01 Aug, 2018 1 commit
    • Screwtape's avatar
      Update to v106r53 release. · 5d135b55
      Screwtape authored
      byuu says:
      
      Okay, so the WIPs-within-WIPs thing wasn't achieving its desired effect,
      and it ended up causing me to have to redo some work on hiro since my
      last local snapshot was of r52. So, heck it. I'll just do mostly
      non-functional WIPs for a bit, and worry about the fallout years later
      when I'm trying to find an emulation regression and cursing that the
      WIPs aren't compiling.
      
      I ported all of the ruby input drivers to the new syntax, as well as the
      OpenAL driver. If you patch the ruby drivers for Linux with this in
      mind, bsnes should compile and run there again.
      
      Also, the bsnes program icon has returned, now that the new hiro layout
      code is mature enough and I can simply add and remove the icon as a
      Canvas instead of having to try and render into a viewport. The icon
      shows up instantly with the main window.
      5d135b55
  15. 31 Jul, 2018 2 commits
    • Screwtape's avatar
      Update to 20180731 release. · 2335bb0d
      Screwtape authored
      byuu says:
      
      I've completed moving all the class objects from `unique_pointer<T>` to
      just T. The one exception is the Emulator::Interface instance. I can
      absolutely make that a global object, but only in bsnes where there's
      just the one emulation core.
      
      I also moved all the SettingsWindow and ToolsWindow panels out to their
      own global objects, and fixed a very difficult bug with GTK TabFrame
      controls.
      
      The configuration settings panel is now the emulator settings panel. And
      I added some spacing between bold label sections on both the emulator
      and driver settings panels.
      
      I gave fixing ComboButtonItem my best shot, given I can't reproduce the
      crash. Probably won't work, though.
      
      Also made a very slight consistency improvement to ruby and renamed
      driverName() to driver().
      
      ...
      
      An important change ... as a result of moving bsnes to global objects,
      this means that the constructors for all windows run before the
      presentation window is displayed. Before this change, only the
      presentation window was constructed first berore displaying it, followed
      by the construction of the rest of the GUI windows.
      
      The upside to this is that as soon as you see the main window, the GUI
      is ready to go without a period where it's unresponsive.
      
      The downside to this is it takes about 1.5 seconds to show the main
      window, compared to around 0.75 seconds before.
      
      I've no intention of changing that back. So if the startup time becomes
      a problem, then we'll just have to work on optimizing hiro, so that it
      can construct all the global Window objects quicker. The main way to do
      that would be to not do calls to the Layout::setGeometry functions for
      every widget added, and instead wait until the window is displayed. But
      I don't have an easy way to do that, because you want the widget
      geometry values to be sane even before the window is visible to help
      size certain things.
      2335bb0d
    • Screwtape's avatar
      Update to 20180730 release. · 212da0a9
      Screwtape authored
      byuu says:
      
      These WIPs-within-WIPs are getting more and more broken ... this isn't
      going the way I wanted.
      
      But ... this time around, I've revamped the entire ruby API again, to
      solve a bunch of tough problems that have always made using ruby really
      clunky.
      
      But there are *so many* ruby drivers that it's going to take a long
      time to work through them all. This WIP is only going to run bsnes, and
      only on FreeBSD, and only with some drivers.
      
      hiro's Application::initialize() now calls hiro::initialize(), which you
      define inside of your hiro apps. This lets you call
      Application::setName(...) before anything else in hiro runs. This is
      essential on Xorg to set program icons, for instance.
      
      With the ruby rewrite and the change to hiro, I can get away from the
      need to make everything in bsnes/higan pointers to objects, and can now
      just declare them as regular objects.
      212da0a9
  16. 29 Jul, 2018 1 commit
    • Screwtape's avatar
      Update to 20180729 release. · 5deba5cb
      Screwtape authored
      byuu wrote:
      
      Sigh ...
      
      asio.hpp needs #include <nall/windows/registry.hpp>
      
      [Since the last WIP, byuu also posted the following message. -Ed.]
      
      ruby drivers have all been updated (but not tested outside of BSD), and
      I redesigned the settings window. The driver functionality all exists on
      a new "Drivers" panel, the emulator/hack settings go to a
      "Configuration" panel, and the video/audio panels lose driver settings.
      As does the settings menu and its synchronize options.
      
      I want to start pushing toward a v107 release. Critically, I will need
      DirectSound and ALSA to support dynamic rate control. I'd also like to
      eliminate the other system manifest.bml files. I need to update the
      cheat code database format, and bundle at least a few quark shaders --
      although I still need to default to Direct3D on Windows.
      
      Turbo keys would be nice, if it's not too much effort. Aside from
      netplay, it's the last significant feature I'm missing.
      
      I think for v107, higan is going to be a bit rough around the edges
      compared to bsnes. And I don't think it's practical to finish the bsnes
      localization support.
      
      I'm thinking we probably want another WIP to iron out any critical
      issues, but this time there should be a feature freeze with the next
      WIP.
      5deba5cb
  17. 28 Jul, 2018 1 commit
    • Screwtape's avatar
      Update to 20180728 release. · 716c95f2
      Screwtape authored
      byuu says:
      
      Sigh, I seem to be spiraling a bit here ... but the work is very
      important. Hopefully I can get a solid WIP together soon. But for now...
      
      I've integrated dynamic rate control into ruby::Audio via
      setDynamic(bool) for now. It's very demanding, as you would expect. When
      it's not in use, I realized the OSS driver's performance was pretty bad
      due to calling write() for every sample for every channel. I implemented
      a tiny 256-sample buffer and bsnes went from 290fps to 330fps on my
      FreeBSD desktop. It may be possible to do the same buffering with DRC,
      but for now, I'm not doing so, and adjusting the audio input frequency
      on every sample.
      
      I also added ruby::Video::setFlush(bool), which is available only in the
      OpenGL drivers, and this causes glFinish() to be called after swapping
      display buffers. I really couldn't think of a good name for this, "hard
      GPU sync" sounds kind of silly. In my view, flush is what commits queued
      events. Eg fflush(). OpenGL of course treats glFlush differently (I
      really don't even know what the point of it is even after reading the
      manual ...), and then has glFinish ... meh, whatever. It's
      setFlush(bool) until I come up with something better. Also as expected,
      this one's a big hit to performance.
      
      To implement the DRC, I started putting helper functions into the ruby
      video/audio/input core classes. And then the XVideo driver started
      crashing. It took hours and hours and hours to track down the problem:
      you have to clear XSetWindowAttributes to zero before calling
      XCreateWindow. No amount of `--sync`, `gdb break gdk_x_error`, `-Og`,
      etc will make Xlib be even remotely helpful in debugging errors like
      this.
      
      The GLX, GLX2, and XVideo drivers basically worked by chance before. If
      the stack frame had the right memory cleared, it worked. Otherwise it'd
      crash with BadValue, and my changing things broke that condition on the
      XVideo driver. So this has been fixed in all three now.
      
      Once XVideo was running again, I realized that non-power of two video
      sizes were completely broken for the YUV formats. It took a while, but I
      managed to fix all of that as well.
      
      At this point, most of ruby is going to be broken outside of FreeBSD, as
      I still need to finish updating all the drivers.
      716c95f2
  18. 26 Jul, 2018 1 commit
    • Screwtape's avatar
      Update to 20180726 release. · 876b4be1
      Screwtape authored
      byuu says:
      
      Once again, I wasn't able to complete a full WIP revision.
      
      This WIP-WIP adds very sophisticated emulation of the Sega Genesis
      Lock-On and Game Genie cartridges ... essentially, through recursion and
      a linked list, higan supports an infinite nesting of cartridges.
      
      Of course, on real hardware, after you stack more than three or four
      cartridges, the power draw gets too high and things start glitching out
      more and more as you keep stacking. I've heard that someone chained up
      to ten Sonic & Knuckles cartridges before it finally became completely
      unplayable.
      
      And so of course, higan emulates this limitation as well ^-^. On the
      fourth cartridge and beyond, it will become more and more likely that
      address and/or data lines "glitch" out randomly, causing various
      glitches. It's a completely silly easter egg that requires no speed
      impact whatsoever beyond the impact of the new linked list cartridge
      system.
      
      I also designed the successor to Emulator::Interface::cap,get,set. Those
      were holdovers from the older, since-removed ruby-style accessors.
      
      In its place is the new Emulator::Interface::configuration,configure
      API. There's the usual per-property access, and there's also access to
      read and write all configurable options at once. In essence, this
      enables introspection into core-specific features.
      
      So far, you can control processor version#s, PPU VRAM size, video
      settings, and hacks. As such, the .sys/manifest.bml files are no longer
      necessary. Instead, it all goes into .sys/configuration.bml, which is
      generated by the emulator if it's missing.
      
      higan is going to take this even further and allow each option under
      "Systems" to have its own editable configuration file. So if you wanted,
      you could have a 1/1/1 SNES menu option, and a 2/1/3 SNES menu option.
      Or a Model 1 Genesis option, and a Model 2 Genesis option. Or the
      various Game Boy model revisions. Or an "SNES-Fast" and "SNES-Accurate"
      option.
      
      I've not fully settled on the syntax of the new configuration API. I
      feel it might be useful to provide type information, but I really quite
      passionately hate any<T> container objects. For now it's all
      string-based, because strings can hold anything in nall.
      
      I might also change the access rules. Right now it's like:
      emulator→configure("video/blurEmulation", true); but it might be nicer
      as "Video::Blur Emulation", or "Video.BlurEmulation", or something like
      that.
      876b4be1
  19. 25 Jul, 2018 1 commit
    • Screwtape's avatar
      Update to v106r52 release. · 22bd4b92
      Screwtape authored
      byuu says:
      
      I stand corrected, I managed to create and even larger diff than ever.
      This one weighs in at 309KiB `>__>`
      
      I'll have to create a changelog later, I'm too tired right now to go
      through all of that.
      22bd4b92
  20. 24 Jul, 2018 1 commit
    • Screwtape's avatar
      Update to 20180724 release. · f1a4576a
      Screwtape authored
      byuu says:
      
      I failed to complete a WIP, have five of eight cores updated with some
      major changes to Emulator::Interface. I'll just post a quick temporary
      WIP in the off chance someone wants to look over the new interface and
      comment on it.
      
      Also implemented screen saver suppression into hiro/GTK.
      
      I should also add ... a plan of mine is to develop target-bsnes into a
      more generic user interface, with the general idea being that
      target-higan is for multiple Emulator::Interface cores at the same time,
      and target-bsnes is for just one Emulator::Interface core.
      
      The idea being that if one were to compile target-bsnes with the GBA
      core, it'd become bgba, for instance.
      I don't plan on releasing single-core emulators like this, but ... I don't see any downsides to being more flexible.
      f1a4576a
  21. 21 Jul, 2018 2 commits
    • Screwtape's avatar
      Update to v106r51 release. · 0aedb343
      Screwtape authored
      byuu says:
      
      Changelog:
      
        - added `Emulator::Interface::connected(uint port) -> uint device;`
        - higan, bsnes: updated emulators to use the new
          Emulator::Interface::connected() function
        - hiro: fixed Object::cast<T> finally
      
      So, Emulator::Interface::connected() solves two annoying problems at the
      same time.
      
      First, on first run of the emulator when the settings file is blank, it
      will retrieve the default "sane" device ID, which is usually a gamepad
      for a controller port, or nothing for an expansion/extension port.
      
      Second, if you were to select a multi-port device, like the NES Four
      Score, the core will set the other port to the Four Score device as
      well, and the GUIs query connected() right after any call to connect(),
      so it gets updated without needing a system for the emulation core to
      send messages alerting the GUI of changes.
      0aedb343
    • Screwtape's avatar
      Update to v106r50 release. · 35ff15f8
      Screwtape authored
      byuu says:
      
      Changelog:
      
        - emulator/video,audio: various cleanups
        - emulator/audio: removed reverb effect (it breaks very badly on
          high-frequency systems)
        - emulator/audio: the Nyquist anti-aliasing lowpass filter is now
          generated automatically instead of set per-core
            - at 44.1KHz output, it's set to 22KHz; at 48KHz, it's set to
              22KHz; at 96KHz, it's set to 25KHz
            - this filter now takes the bsnes emulation speed setting into
              account
        - all system/video.cpp files removed; inlined in System::power() and
          Interface::set() instead
        - sfc/cpu: pre-compute `HTIME` as `HTIME+1<<2` for faster comparisons of
          HIRQs
        - sfc/cpu: re-add check to block IRQs on the last dot of each frame
          (minor speed hit)
        - hiro/gtk3: fixed headers for Linux compilation finally
        - hiro/gtk,qt: fixed settings.cpp logic so initial values are used
          when no settings.bml file exists
        - hiro/gtk: started a minor experiment to specify theming information
          in settings.bml files
        - nall/dsp: allow the precision type (double) to be overridden (to
          float)
        - nall: add some helpers for generating pre-compiled headers
            - it was a failure to try using them for higan, however ...
        - nall: add some helpers for reading fallback values from empty
          `Markup::Node[search]` statements
      
      Todo:
      
        - CRITICAL: a lot of my IRQ/NMI/HDMA timing tests are failing with the
          fast PPU ... need to figure out why
        - space between Emulator::video functions and Emulator::audio
          functions in gb/system/system.cpp
        - remove Audio/Reverb/Enable from settings.bml in target-bsnes
      35ff15f8
  22. 19 Jul, 2018 1 commit
    • Screwtape's avatar
      Update to v106r49 release. · 65a3e6c6
      Screwtape authored
      byuu says:
      
      This is a fairly radical WIP with extreme changes to lots of very
      important parts.
      
      The result is a ~7% emulation speedup (with bsnes, unsure how much it
      helps higan), but it's quite possible there are regressions. As such, I
      would really appreciate testing as many games as possible ... especially
      the old finnicky games that had issues with DMA and/or interrupts.
      
      One thing to note is that I removed an edge case test that suppresses
      IRQs from firing on the very last dot of every field, which is a
      behavior I've verified on real hardware in the past. I feel that the
      main interrupt polling function (the hottest portion of the entire
      emulator) is not the appropriate place for it, and I should instead
      factor it into assignment of NMITIMEN/VTIME/HTIME using the new
      io.irqEnable (==virqEnable||hirqEnable) flag. But since I haven't done
      that yet ... there's an old IRQ test ROM of mine that'll fail for this
      WIP. No commercial games will ever rely on this, so it's fine for
      testing.
      
      Changelog:
      
        - sfc/cpu.smp: inlined the global status functions
        - sfc/cpu: added readRAM, writeRAM to use a function pointer instead
          of a lambda for WRAM access
        - sfc/cpu,smp,ppu/counter: updated reset functionality to new style
          using class inline initializers
        - sfc/cpu: fixed power(false) to invoke the reset vector properly
        - sfc/cpu: completely rewrote DMA handling to have per-channel
          functions
        - sfc/cpu: removed unused joylatch(), io.joypadStrobeLatch
        - sfc/cpu: cleaned up io.cpp handlers
        - sfc/cpu: simplified interrupt polling code using
          nall::boolean::flip(),raise(),lower() functions
        - sfc/ppu/counter: cleaned up the class significantly and also
          optimized things for efficiency
        - sfc/ppu/counter: emulated PAL 1368-clock long scanline when
          interlace=1, field=1, vcounter=311
        - sfc/smp: factored out the I/O and port handlers to io.cpp
      65a3e6c6
  23. 16 Jul, 2018 1 commit
    • Screwtape's avatar
      Update to v106r48 release. · 393c2395
      Screwtape authored
      byuu says:
      
      The problems with the Windows and Qt4 ports have all been resolved,
      although there's a fairly gross hack on a few Qt widgets to not destruct
      once Application::quit() is called to avoid a double free crash (I'm
      unsure where Qt is destructing the widgets internally.) The Cocoa port
      compiles again at least, though it's bound to have endless problems. I
      improved the Label painting in the GTK ports, which fixes the background
      color on labels inside TabFrame widgets.
      
      I've optimized the Makefile system even further.
      
      I added a "redo state" command to bsnes, which is created whenever you
      load the undo state. There are also hotkeys for both now, although I
      don't think they're really something you want to map hotkeys to.
      
      I moved the nall::Locale object inside hiro::Application, so that it can
      be used to translate the BrowserDialog and MessageDialog window strings.
      
      I improved the Super Game Boy emulation of `MLT_REQ`, fixing Pokemon
      Yellow's custom border and probably more stuff.
      
      Lots of other small fixes and improvements. Things are finally stable
      once again after the harrowing layout redesign catastrophe.
      
      Errata:
      
        - ICD::joypID should be set to 3 on reset(). joypWrite() may as well
          take uint1 instead of bool.
        - hiro/Qt: remove pWindow::setMaximumSize() comment; found a
          workaround for it
        - nall/GNUmakefile: don't set object.path if it's already set (allow
          overrides before including the file)
      393c2395
  24. 14 Jul, 2018 1 commit
    • Screwtape's avatar
      Update to v106r47 release. · 6090c639
      Screwtape authored
      byuu says:
      
      This is probably the largest code-change diff I've done in years.
      
      I spent four days working 10-16 hours a day reworking layouts in hiro
      completely.
      
      The result is we now have TableLayout, which will allow for better
      horizontal+vertical combined alignment.
      
      Windows, GTK2, and now GTK3 are fully supported.
      
      Windows is getting the initial window geometry wrong by a bit.
      
      GTK2 and GTK3 work perfectly. I basically abandoned trying to detect
      resize signals, and instead keep a list of all hiro windows that are
      allocated, and every time the main loop runs, it will query all of them
      to see if they've been resized. I'm disgusted that I have to do this,
      but after fighting with GTK for years, I'm about sick of it. GTK was
      doing this crazy thing where it would trigger another size-allocate
      inside of a previous size-allocate, and so my layouts would be halfway
      through resizing all the widgets, and then the size-allocate would kick
      off another one. That would end up leaving the rest of the first layout
      loop with bad widget sizes. And if I detected a second re-entry and
      blocked it, then the entire window would end up with the older geometry.
      I started trying to build a message queue system to allow the second
      layout resize to occur after the first one completed, but this was just
      too much madness, so I went with the simpler solution.
      
      Qt4 has some geometry problems, and doesn't show tab frame layouts
      properly yet.
      
      Qt5 causes an ICE error and tanks my entire Xorg display server, so ...
      something is seriously wrong there, and it's not hiro's fault. Creating
      a dummy Qt5 application without even using hiro, just int main() {
      TestObject object; } with object performing a dynamic\_cast to a derived
      type segfaults. Memory is getting corrupted where GCC allocates the
      vtables for classes, just by linking in Qt. Could be somehow related to
      the -fPIC requirement that only Qt5 has ... could just be that FreeBSD
      10.1 has a buggy implementation of Qt5. I don't know. It's beyond my
      ability to debug, so this one's going to stay broken.
      
      The Cocoa port is busted. I'll fix it up to compile again, but that's
      about all I'm going to do.
      
      Many optimizations mean bsnes and higan open faster. GTK2 and GTK3 both
      resize windows very quickly now.
      
      higan crashes when you load a game, so that's not good. bsnes works
      though.
      
      bsnes also has the start of a localization engine now. Still a long way
      to go.
      
      The makefiles received a rather substantial restructuring. Including the
      ruby and hiro makefiles will add the necessary compilation rules for
      you, which also means that moc will run for the qt4 and qt5 targets, and
      windres will run for the Windows targets.
      6090c639
  25. 08 Jul, 2018 1 commit
    • Screwtape's avatar
      Update to v106r46 release. · 0c557960
      Screwtape authored
      byuu says:
      
      Changelog:
      
        - bsnes, higan: simplified make output; reordered rules
        - hiro: added Window::set(Minimum,Maximum)Size() [only implemented in
          GTK+ so far]
        - bsnes: only allow the window to be shrunk to the 1x multiplier size
        - bsnes: refactored Integral Scaling checkbox to {Center, Scale,
          Stretch} radio selection
        - nall: call fflush() after nall::print() to stdout or stderr [needed
          for msys2/bash]
        - bsnes, higan: program/interface.cpp renamed to program/platform.cpp
        - bsnes: trim ".shader/" from names in Settings→Shader menu
        - bsnes: Settings→Shader menu updated on video driver changes
        - bsnes: remove missing games from recent files list each time it is
          updated
        - bsnes: video multiplier menu generated dynamically based on largest
          monitor size at program startup
        - bsnes: added shrink window and center window function to video
          multiplier menu
        - bsnes: de-minimize presentation window when exiting fullscreen mode
          or changing video multiplier
        - bsnes: center the load game dialog against the presentation window
          (important for multi-monitor setups)
        - bsnes: screenshots are not immediate instead of delayed one frame
        - bsnes: added frame advance menu option and hotkey
        - bsnes: added enable cheats checkbox and hotkey; can be used to
          quickly enable/disable all active cheats
      
      Errata:
      
        - hiro/Windows: `SW_MINIMIZED`, `SW_MAXIMIZED `=> `SW_MINIMIZE`,
          `SW_MAXIMIZE`
        - hiro/Windows: add pMonitor::workspace()
        - hiro/Windows: add setMaximized(), setMinimized() in
          pWindow::construct()
        - bsnes: call setCentered() after setMaximized(false)
      0c557960
  26. 02 Jul, 2018 1 commit
    • Screwtape's avatar
      Update to v106r45 release. · 372e9ef4
      Screwtape authored
      byuu says:
      
      Changelog:
      
        - sfc/ppu-fast: added hires mode 7 option (doubles the sampling rate
          of mode 7 pixels to reduce aliasing)
        - sfc/ppu-fast: fixed mode 7 horizontal screen flip [hex_usr]
        - bsnes: added capture screenshot function and path selection
            - for now, it saves as BMP. I need a deflate implementation that
              won't add an external dependency for PNG
            - the output resolution is from the emulator: (256 or 512)x(240 or
              480 minus overscan cropping if enabled)
            - it captures the NEXT output frame, not the current one ... but
              it may be wise to change this behavior
            - it'd be a problem if the core were to exit and an image was
              captured halfway through frame rendering
        - bsnes: recovery state renamed to undo state
        - bsnes: added manifest viewer tool
        - bsnes: mention if game has been verified or not on the status bar
          message at load time
        - bsnes, nall: fixed a few missing function return values
          [SuperMikeMan]
        - bsnes: guard more strongly against failure to load games to avoid
          crashes
        - hiro, ruby: various fixes for macOS [Sintendo]
        - hiro/Windows: paint on `WM_ERASEBKGND` to prevent status bar
          flickering at startup
        - icarus: SPC7110 heuristics fixes [hex_usr]
      
      Errata:
      
        - sfc/ppu-fast: remove debug hires mode7 force disable comment from
          PPU::power()
      
      [The `WM_ERASEBKGND` fix was already present in the 106r44 public
      beta -Ed.]
      372e9ef4
  27. 28 Jun, 2018 2 commits
    • Screwtape's avatar
      Update to v106r44 public beta release: · 40a5fbe6
      Screwtape authored
      byuu says (in the public announcement):
      
      I'm releasing a beta version of bsnes, for the purpose of gathering feedback and
      ensuring that the first official release of bsnes is as solid as possible.
      
      With the exception of dynamic rate control for automatic audio/video sync, and
      no pack-in video shaders or cheat code database, it is mostly feature complete.
      However, please do not form a lasting opinion of bsnes based on this beta.
      40a5fbe6
    • Screwtape's avatar
      Update to v106r44 release. · ec960c51
      Screwtape authored
      byuu says:
      
      Changelog:
      
        - hiro/Windows: use `WS_CLIPSIBLINGS` on Label to prevent resize
          drawing issues
        - bsnes: correct viewport resizing
        - bsnes: speed up window resizing a little bit
        - bsnes: fix the cheat editor list enable checkbox
        - bsnes: fix the state manager filename display in game ROM mode
        - bsnes: fix the state manager save/rename/remove functionality in
          game ROM mode
        - bsnes: correct path searching for IPS and BPS patches in game ROM
          mode
        - bsnes: patch BS-X town cartridge to disable play limits
        - bsnes: do not load (program,data,expansion).(rom,flash) from disk in
          game pak mode
            - this is required to support soft-patching and ROM hacks
        - bsnes: added speed mode selection (50%, 75%, 100%, 150%, 200%);
          maintains proper pitch
        - bsnes: added icons to the menubar
            - this is particularly useful to tell game ROMs from game paks in
              the load recent game menu
        - bsnes: added emblem at bottom left of status bar to indicate if a
          game is verified or not
            - verified means it is in the icarus verified game dump database
            - the verified diamond is orange; the unverified diamond is blue
        - bsnes: added an option (which defaults to off) to warn when loading
          unverified games
            - working around a bug in GTK, I have to use the uglier
              MessageWindow instead of MessageDialog
        - bsnes: added (non-functional) link to <https://doc.byuu.org/bsnes/>
          to the help menu
        - bsnes: added GUI setting to toggle memory auto-save feature
        - bsnes: added GUI setting to toggle capturing a backup save state
          when closing the emulator
        - bsnes: made auto-saving states on exit an option
        - bsnes: added an option to auto-load the auto-saved state on load
            - basically, the two combined implements auto-resume
        - bsnes: when firmware is missing, offer to take the user to the
          online help documentation
        - bsnes: added fast PPU option to disable the sprite limit
            - increase from 32 items/line + 34 tiles/line to 128 items/line +
              128 tiles/line
            - technically, 1024 tiles/line are possible with 128 sprites at
              64-width
            - but this is just a waste of cache locality and worst-case
              performance; it'll never happen
      
      Errata:
      
        - hiro/Windows: fallthrough on Canvas `WM_ERASEBKGND` to prevent
          startup flicker
      ec960c51
  28. 27 Jun, 2018 1 commit
    • Screwtape's avatar
      Update to v106r43 release. · b14c6bf1
      Screwtape authored
      byuu says:
      
      Changelog:
      
        - bsnes: added video settings panel
        - bsnes: added audio settings panel
        - bsnes: disable assign/clear buttons at startup for hotkeys panel
        - bsnes: program initialization restructured: drivers initialize last
            - this lets me reinitialize the settings panel values on driver
              changes
            - so eg things like input/hotkey remappings should work after
              input driver changes now
            - ... but I had to disable the window icon for this ... it takes
              too long to show up this way
        - bsnes: added synchronize video/audio options to settings menu
        - bsnes: added audio skew slider for video/audio synchronization
        - bsnes: state manager edit/remove works on game ROM .bsz archives now
        - bsnes: removed View→Color Emulation; default to 150% gamma instead
          (it's a touch brighter but similar)
      
      At this point, I'm pretty much ready to make an initial beta release for
      wider testing.
      
      Please use this WIP to indicate any must-fix issues before I do so.
      b14c6bf1
  29. 26 Jun, 2018 1 commit
    • Screwtape's avatar
      Update to v106r42 release. · 5b97fa24
      Screwtape authored
      byuu says:
      
      Changelog:
      
        - emulator: added `Thread::setHandle(cothread_t)`
        - icarus: added special heuristics support for the Tengai Maykou Zero
          fan translation
            - board identifier is: EXSPC7110-RAM-EPSONRTC (match on SPC7110 +
              ROM size=56mbit)
            - board ROM contents are: 8mbit program, 40mbit data, 8mbit
              expansion (sizes are fixed)
        - bsnes: show messages on game load, unload, and reset
        - bsnes: added support for BS Memory and Sufami Turbo games
        - bsnes: added support for region selection (Auto [default], NTSC,
          PAL)
        - bsnes: correct presentation window size from 223/239 to 224/240
        - bsnes: add SA-1 internal RAM on cartridges with BS Memory slot
        - bsnes: fixed recovery state to store inside .bsz archive
        - bsnes: added support for custom manifests in both game pak and game
          ROM modes
        - bsnes: added icarus game database support (manifest → database →
          heuristics)
        - bsnes: added flexible SuperFX overclocking
        - bsnes: added IPS and BPS soft-patching support to all ROM types
          (sfc,smc,gb,gbc,bs,st)
            - can load patches inside of ZIP archives (matches first “.ips” or
              “.bps” file)
        - bsnes/ppu: cache interlace/overscan/vdisp (277 → 291fps with fast
          PPU)
        - hiro/Windows: faster painting of Label widget on expose
        - hiro/Windows: immediately apply LineEdit::setBackgroundColor changes
        - hiro/Qt: inherit Window backgroundColor when one is not assigned to
          Label
      
      Errata:
      
        - sfc/ppu-fast: remove `renderMode7Hires()` function (the body isn't in
          the codebase)
        - bsnes: advanced note label should probably use a lighter text color
          and/or smaller font size instead of italics
      
      I didn't test the soft-patching at all, as I don't have any patches on
      my dev box. If anyone wants to test, that'd be great. The Tengai Makyou
      Zero fan translation would be a great test case.
      5b97fa24
  30. 24 Jun, 2018 1 commit
    • Screwtape's avatar
      Update to v106r41 release. · f70a20bc
      Screwtape authored
      byuu says:
      
      Changelog:
      
        - hiro: added Label::set(Background,Foreground)Color (not implemented
          on Cocoa backend)
        - hiro: added (Horizontal,Vertical)Layout::setPadding()
            - setMargin(m) is now an alias to setPadding({m, m, m, m})
        - hiro/Windows: update Label rendering to draw to an offscreen canvas
          to prevent flickering
        - sfc: reverted back to 224/240-line height (from 223/239-line height
          in earlier v106 WIPs)
        - bsnes: new multi-segment status bar added
        - bsnes: exiting fullscreen mode will resize and recenter window
            - this is required; the window geometry gets all scrambled when
              toggling fullscreen mode
        - bsnes: updated to a new logo [Ange Albertini]
      
      Errata:
      
        - hiro/Windows: try to paint Label backgroundColor quicker to avoid
          startup flicker
            - `WM_ERASEBKGND` fallthrough to `WM_PAINT` seems to work
        - hiro/Qt: use Window backgroundColor for Label when no Label
          backgroundColor set
        - bsnes: update size multipliers in presentation.cpp to 224/240 (main
          window size is off in this WIP)
      f70a20bc
  31. 11 Jun, 2018 2 commits
    • Screwtape's avatar
      470e2732
    • Screwtape's avatar
      Update to v106r40 release. · 5a8c814e
      Screwtape authored
      byuu says:
      
      Changelog:
      
        - hiro: added BrowserDialog::openObject() [match file *or* folder
          by filters]
        - hiro: BrowserDialog accept button is now disabled when it would
          otherwise do nothing
            - eg openFile without a folder to enter or file to open selected
            - eg saveFile without a file name or with a file name that matches
              a folder name
        - bsnes: added support for gamepaks (game folders)
        - bsnes: store all save states inside per-game .bsz (ZIP) archives
          instead of .bst/ folders
            - this reduces the number of state files from 10+ to 1; without
              having folders sort before files
        - hiro: both gtk2 and gtk3 now use cairo to render Canvas; supports
          sx,sy [BearOso]
        - higan, bsnes: fast PPU/DSP are now run-time options instead of
          compile-time options
        - bsnes: disable fast PPU when loading Air Strike Patrol / Desert
          Fighter
        - bsnes: disable fast DSP when loading Koushien 2
        - bsnes: added options to advanced panel to disable fast PPU and/or
          fast DSP
      5a8c814e
  32. 10 Jun, 2018 1 commit
    • Screwtape's avatar
      Update to v106r39 release. · 91bb781b
      Screwtape authored
      byuu says:
      
      Changelog:
      
        - ruby/video: implement onUpdate() callback to signal when redraws are
          necessary
        - ruby/video/GLX,GLX2,XVideo,XShm: implement onUpdate() support
        - bsnes: implement Video::onUpdate() support to redraw Viewport icon
          as needed
        - bsnes: save RAM before ruby driver changes
        - sfc/sa1: clip signed multiplication to 32-bit [Jonas Quinn]
        - sfc/sa1: handle negative dividends in division [Jonas Quinn]
        - hiro/gtk3: a few improvements
        - bsnes: added empty stub video and audio settings panels
        - bsnes: restructured advanced settings panel
        - bsnes: experiment: input/hotkeys name column bolded and colored for
          increased visual distinction
        - bsnes: added save button to state manager
      91bb781b