randyrossi / bmc64

A bare metal Commodore 64 emulator for the Raspberry Pi with true 50hz/60hz smooth scrolling, low input latency and better audio/video sync.
GNU General Public License v3.0
488 stars 59 forks source link

[question][feature] What prevents Plus4emu for RP2? Just speed? #87

Closed Fabrizio-Caruso closed 4 years ago

Fabrizio-Caruso commented 4 years ago

I wonder why Plus4emu is only possible on RP3 because the RP2 can be overlclocked and be almost as fast as a stock RP3 but, of course, it does not support the 64-bit instruction set. I suppose you compile Plus4emu for the specific 64-bit instruction set available on RP3. Don't you? Have you tried compiling in 32-bit mode? RP2 has a larger overclock margin than the RP3.

randyrossi commented 4 years ago

Y, it's speed. Both Rpi3 and Rpi2 BMC64 builds are 32bit actually.

I haven't tried overclocking the Pi2 but I'd prefer not to rely on it.

Fabrizio-Caruso commented 4 years ago

Then, let us users decide. I have safely overclocked my Pi2 to speeds very close to the Pi3. How can I configure bmc64 so that I can run Plus4Emu on Pi2? Which config file do I have to touch?

randyrossi commented 4 years ago

Can you send me your overclock settings for the Rpi2? There's no config that will activate it. I'd have to change some code and produce a build. There is no kernel released for the 2.

Fabrizio-Caruso commented 4 years ago

I see. Please do not hard-code any overclock. This should be decided by the user. My RP2 overclock is safe and below the warranty threshold values, i.e., you do not void the warranty by using it. My values are not the highest stable values. I choose lower values to be extra safe. Even higher values do not void the warranty. This overclock brings the RP2 close to RP3 (still slower, though). You can raise the over_voltage to 6 and/or lower arm_freq to 1000 if it is unstable on your RP2 and you are still within the allowed values.

##     0        1.2   V (Default)
##     1        1.225 V
##     2        1.25  V
##     3        1.275 V
##     4        1.3   V
##     5        1.325 V
##     6        1.35  V
##     7        1.375 V (requires force_turbo=1 or current_limit_override)
##     8        1.4   V (requires force_turbo=1 or current_limit_override)
##
over_voltage=4

## arm_freq
##     Frequency of ARM in MHz.
##
##     Default 700.
##
arm_freq=1050

## gpu_freq
##     Sets core_freq, h264_freq, isp_freq, v3d_freq together.
##
##     Default 250.
##
gpu_freq=500

## core_freq
##     Frequency of GPU processor core in MHz. It has an impact on ARM
##     performance since it drives L2 cache.
##
##     Default 250.
##
core_freq=500
randyrossi commented 4 years ago

Tried overclocking. Unfortunately, performance is still very bad on the Pi2. It's the drive emulation that pushes it over the edge. It's more than just clock speed, the instruction set is different and simd instructions are different. Short of optimizing the code for arm, I doubt I'll be able to run it with any acceptable performance on the Pi2 (or below).

Fabrizio-Caruso commented 4 years ago

Ok! At least we know why now. Thanks for trying! How do you overclock BMC64? The usual config.txt?

randyrossi commented 4 years ago

Yes, the same params in config.txt will work.

On Wed, Dec 18, 2019 at 4:15 PM Fabrizio Caruso notifications@github.com wrote:

Ok! At least we know why now. Thanks for trying! How do you overclock BMC64? The usual config.txt?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/randyrossi/bmc64/issues/87?email_source=notifications&email_token=AAI3HKFXP7QNHAU7FMLR5LDQZKHH7A5CNFSM4J3XSQPKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEHHQSPQ#issuecomment-567216446, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAI3HKHJ5E57DJ5D3T6KZ3LQZKHH7ANCNFSM4J3XSQPA .

-- Randy Rossi

C:(+1)416-605-5112 (Canada)

Fabrizio-Caruso commented 4 years ago

Thanks a lot for trying! What was the result of the test? Can you share more details? Was only loading very slow? Were the games playable at least 90% of the real speed?

randyrossi commented 4 years ago

BMC64 never drops frames so if it misses the vsync deadline, it waits for the next one. Nothing is playable, really. It can't emulate 20ms worth of cycles in under 20ms. I can't really tell how close it was unless I measured it.