Git Product home page Git Product logo

Comments (6)

ducalex avatar ducalex commented on June 26, 2024 1

On the esp32, if I overclock to 320Mhz I can achieve full speed (ntsc fs:1, so 30fps) in Sonic with YFM enabled and Z80 disabled.

But overclocking isn't as well documented as it is on the PICO, I have no idea what the average ESP32 chip can sustain. 280Mhz seems to be ok on all chips, 320 works on most of my devices, 360 on some, and 400Mhz always crashes.

I'll likely look into your NGPC port, I always wanted to support that in retro-go! I'll ping you when I get there, thanks again :).

Edit: BTW I tried a few other Z80 implementations, like the one from my smsplus fork that I optimized a fair amount. It helped but not that much. I tried other random Z80 but again it wasn't magical. Though in your case you might be able to find a Z80 implemented in thumb assembly!

from retro-go.

ducalex avatar ducalex commented on June 26, 2024

Thanks for tracking down the problem! I think the actual bug would be on line 539 PCE.VCE.reg |= V << 8. Raiden probably uses a value greater than 1 because the value is already in a register, expecting the hardware to discard the upper 7 bits. The documentation says:

 $0402 - Color table address (LSB)
 $0403 - Color table address (MSB)
 (Both are write-only, reads return $FF)
 These two registers form a 16-bit value, of which the lower 9 bits are
 used as an index into the color table for subsequent reads and writes
 by the data register. The remaining upper 7 bits are ignored.

So changing line 539 to PCE.VCE.reg |= (V & 1) << 8; should be the correct behavior, I think.

The other option would be to mask PCE.VCE.reg every time it's accessed (eg instead of your return it'd be PCE.VCE.reg &= 0x1FF;) but that's a bit cumbersome.

What do you think?

from retro-go.

xrip avatar xrip commented on June 26, 2024

Looks like discarding upper 7 bits from V would not broke anything and will have minimum performance impact.

Madnafen PCE emulator did the same:

https://github.com/libretro/beetle-supergrafx-libretro/blob/e41f864c0abb36aef20f8e37cd9d9a92c00a9221/mednafen/pce_fast/vdc.cpp#L292

Checked some other games after that patch and it seems theres no glitches or so on.

Btw, i have bunch of intersting emulators for RP2040 you might be intersting in.
For example Watara Supervision, Wonderswan Color, Neogeo Pocket Color :) May be you want to port them to retro-go :)

from retro-go.

ducalex avatar ducalex commented on June 26, 2024

Looks like discarding upper 7 bits from V would not broke anything and will have minimum performance impact.

Madnafen PCE emulator did the same:

https://github.com/libretro/beetle-supergrafx-libretro/blob/e41f864c0abb36aef20f8e37cd9d9a92c00a9221/mednafen/pce_fast/vdc.cpp#L292

Checked some other games after that patch and it seems theres no glitches or so on.

Thanks for testing. Since you did all the work do you want to create a PR to get credited as contributor? Otherwise I'll commit the fix in a few days/weeks when I get back to the project, we can keep this issue open until then.


Btw, i have bunch of intersting emulators for RP2040 you might be intersting in.
For example Watara Supervision, Wonderswan Color, Neogeo Pocket Color :) May be you want to port them to retro-go :)

I'll definitely check your ports, thanks!

How's your Gwenesis performance? I never could get my port to full speed with a reasonable frameskip despite trying so many things, but I believe the PICO is a fair amount faster (when running at equal clock).

from retro-go.

xrip avatar xrip commented on June 26, 2024

I'll definitely check your ports, thanks!

You're welcome :)

How's your Gwenesis performance? I never could get my port to full speed with a reasonable frameskip despite trying so many things, but I believe the PICO is a fair amount faster (when running at equal clock).

RP2040 not strong as you think, i belive ESP32 outplays RP2040 with raw cpu performance at same CPU speed. Also, there's only 256Kb ram. But, pico have great ability to overclock to >= x3.0 of stock CPU speed (125Mhz => 378Mhz stable for 99.99(9)% of SoC's and 416Mhz for 90%). Also Pico always has 2nd core overwhelming cause of software Video output (my ports have Composite TV, VGA, HDMI, TFT outputs)

Regarding Gwenesis (which is very cpu MHZ depended), the only way to achieve good performance (50 stable fps for UMK3) is

  1. 416Mhz
  2. Completly disable sound
  3. Frameskip every third frame
  4. Interlace scanlines between frames

Some games works greate with full sound enabled with Z80 disabled, but most of games requires Z80 to work. Maybe other Z80 engine will increase performance.

Platformers like Boogerman works good with overclocking, interlace and frameskip, but with sound.

from retro-go.

xrip avatar xrip commented on June 26, 2024

I'll likely look into your NGPC port, I always wanted to support that in retro-go! I'll ping you when I get there, thanks again :).

You're welcome to contact me directly. Site with contacts in my github profile.

Edit: BTW I tried a few other Z80 implementations, like the one from my smsplus fork that I optimized a fair amount. It helped but not that much. I tried other random Z80 but again it wasn't magical. Though in your case you might be able to find a Z80 implemented in thumb assembly!

It wouldn't do the magic, just 1-3 fps. Cause there is very limited usage of Z80, mainly for pushing samples to YM chip in a loop, nothing more.
Also, i dont think theres Cortext-M0 Z80 realisation :)

from retro-go.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.