Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Investigate DingusPPC #219

Open
44 of 58 tasks
mihaip opened this issue Aug 31, 2023 · 95 comments
Open
44 of 58 tasks

Investigate DingusPPC #219

mihaip opened this issue Aug 31, 2023 · 95 comments
Labels
Project Bigger projects

Comments

@mihaip
Copy link
Owner

mihaip commented Aug 31, 2023

https://github.com/dingusdev/dingusppc is actively being developed and making progress (thread).

  • Basic boot
  • Video out
  • Sound out
  • Disk image loading
  • Keyboard input
  • Mouse input
  • Pointer lock mode until absolute mouse position is implemented
  • Use alternate exception handling mechanism, setjmp/longjmp appears to have a lot of overhead
  • Add drop-down with CD-ROMs in custom instance
  • Mark machines as experimental in the UI
  • Custom RAM size support
  • Rebase with recent upstream changes
  • Library
    • 7.1.2 HD image
    • G3 Beige ROM machine
    • Add Mac OS X 10.0 Install CD
    • Add Mac OS X 10.1 Install CD
    • Add Mac OS X 10.2 install CDs
    • 8.1 Disk Tools floppy for Beige G3
    • Add Mac OS X 10.3 install CD
    • Add OpenDarwin 6.6.2 install CD
    • 9.1 HD image
    • 9.2 HD image
  • Bugs
    • Colors are offset (channels in the wrong order)?
    • Cursor is not drawn on G3 (missing hardware cursor support?)
    • 10.2 install CD boots on native build, does not build in Emscripten build
    • "Hum" noise after initial boot chime
    • Does not handle sample rate change from 44 KHz to 22 KHz (when playing a system beep after the boot chime)
    • Gossamer cannot boot with 256 MB because it allocates the memory regions twice
    • 8.1 install CD boots in native version but fails here
    • Implement Virtual trackpad for mobile devices #291 to allow mobile mouse movement
    • Add IDE driver to device image so Beige G3 can use hard drives
  • Debugging
    • Add mechanism for capturing stderr and/or stdout
    • Make fatal errors bring up the error UI instead of entering the debugger
  • Performance
    • Profile to see why booting from a CD image is faster than booting from a floppy one -> floppy speed is realistically emulated
    • Experiment with inlining register read/write functions -> does not help
    • Consider a pool for TimerInfos instead of always creating new ones for the all the one-shot timers we go through
    • Track toolbox traps to see when we get the first WaitNextEvent (to measure time-to-boot)
    • Do framebuffer checksumming before lookup table conversion
    • Add UI for counters when profiling is enabled
    • Investigate overhead of logging
  • Missing DingusPPC functionality
    • Implement CUDA_RESTART_SYSTEM support so that we can operate with an empty nvram file
    • 7.1.2 (though not 7.5.3 or 7.6) do not finish booting on a 6100 from an HD (pointer to possible missing functionality). The same system folder does boot from a CD image, could compare SCSI operations
    • No text renders when booting from 7.1.2 CD
    • No text renders when booting from 7.5.3 CD
    • Custom RAM option has no effect on PDM
    • Mouse does not move when booting the Beige G3 from the 8.1 Disk Tools floppy (needs VBL interrupts, present in the https://github.com/joevt/dingusppc/ fork)
    • idlewait equivalent (does a PowerBook do something to go into a low-power/idle state?)
    • Add support for extended mouse protocol and absolute mouse position (tech note)
@mihaip mihaip added the Project Bigger projects label Aug 31, 2023
mihaip added a commit to mihaip/dingusppc that referenced this issue Aug 31, 2023
More correct behavior (and makes the Infinite Mac wrapper not close
the emulated Mac, which it does when it thinks there was a graceful
shutdown).

Updates mihaip/infinite-mac#219
mihaip added a commit to mihaip/dingusppc that referenced this issue Aug 31, 2023
Disable stack traces in loguru (excinfo.h is not available in Emscripten)
and set Emscripten linker flags.

Updates mihaip/infinite-mac#219
mihaip added a commit that referenced this issue Aug 31, 2023
Loads the Emscripten/Wasm build of DingusPPC and uses it with a hidden
System 7.5 Disk Tools/6100 ROM combination.

Does not actually start successfully, since it assumes that we're
using SDL2 (and have some runtime support libraries for it).

Updates #219
@that-ben
Copy link

that-ben commented Aug 31, 2023

What do you believe DingusPPC can bring to the table? I'm really wondering if we'll ever see OpenGL 1.1 or 1.2 support and far in the future perhaps even 3D acceleration on any of those PPC emulator? Probably QEMU but who knows if a new challenger could come and smash this boundary for us?

@mihaip
Copy link
Owner Author

mihaip commented Sep 1, 2023

I briefly looked into QEMU, and it's massive project. Both from a code complexity of adapting it to run on the web and the performance side. The native binary is 17MB, and the qemu.js demo is ~40MB. The performance on the KolibriOS demo is also very slow, and that's a very small and fast OS.

DingusPPC has been making progress, and may be an interesting foundation for more accurate emulation (it has a MMU, so it's not limited to 9.0.4, unlike SheepShaver).

@that-ben
Copy link

that-ben commented Sep 1, 2023

Indeed, QEMU is accurate, but it's slow as F.

mihaip added a commit to mihaip/dingusppc that referenced this issue Sep 4, 2023
While Emscripten has an SDL compabtility layer, it assumes that the
code is executing in the main browser process (and thus has access to
them DOM). The Infinite Mac project runs emulators in a worker thread
(for better performance) and has a custom API for the display, sound,
input, etc. Similarly, we don't need the cross-platform sound support
from cubeb, there there is a sound API as well.

This commit makes SDL (*_sdl.cpp) and cubeb-based (*_cubeb.cpp) code be
skipped when targeting Emscripten, and instead *_js.cpp files are used
instead (this is the cross-platform convention used by Chromium[^1]).

For hostevents.cpp and soundserver.cpp the entire file was replaced,
whereas for videoctrl.cpp there was enough shared logic that it was
kept, and the platform-specific bits were moved behind a Display class
that can have per-platform implementations. For cases where we need
additional private fields in the platform-specific classes, we use
a PIMPL pattern.

For now the _js files are stubs, but they do allow the Emscripten build
to make it further into the startup process.

Updates mihaip/infinite-mac#219

[^1]: https://www.chromium.org/developers/design-documents/conventions-and-patterns-for-multi-platform-development/
mihaip added a commit that referenced this issue Sep 4, 2023
mihaip added a commit to mihaip/dingusppc that referenced this issue Sep 4, 2023
mihaip added a commit to mihaip/dingusppc that referenced this issue Sep 9, 2023
Turns out to be on the critical path to getting boot. If we don't
pull data from the audio DMA channel it appears to fill up and the
boot process hangs very early.

We would have just had a no-op read, but might as well actually
send the data to the JS side. We use a 1khz polling loop, which is
perhaps too frequent, but it works for now.

The 6100 guitar chord startup chime now plays, but there is some
glitching after, and then a continous hum.

Polling for input also turns out to be on the critical path,
since we need to consume the input buffer to get the "audio context
running" flag sent from the browser process to the worker. We don't
actually do anything with the input data yet.

Updates mihaip/infinite-mac#219
mihaip added a commit that referenced this issue Sep 9, 2023
Shipped with the initial set of Power Macs, should be a good test of
DingusPPC's 6100 emulation.

Updates #219
mihaip added a commit that referenced this issue Sep 9, 2023
Includes making stereo audio work, we were only populating the first
channel until now.

Updates #219
mihaip added a commit that referenced this issue Sep 9, 2023
Audio playback requires a gesture to start, and we were immediately
starting the emulator. Since the only thing that DingusPPC can play
is the initial boot chime, it required clicking at just the right time
to be able to hear it. By making emulator start behind a click, we
can more deterministically trigger it.

Updates #219
@mihaip mihaip mentioned this issue Sep 9, 2023
mihaip added a commit that referenced this issue Sep 10, 2023
Extracted from the 7.1.2 CD-ROM image. More interesting as a DingusPPC
testbed, since no emulator can currently run the PowerPC version of
7.1.2.

Updates #219
mihaip added a commit to mihaip/dingusppc that referenced this issue Sep 15, 2023
mihaip added a commit that referenced this issue Sep 15, 2023
It only supports relative mouse movement, so we need to start sending
that to the worker too.

Updates #219
mihaip added a commit that referenced this issue Sep 15, 2023
It defaults to the HiRes12-14in mode, which is 640x480.

Updates #219
mihaip added a commit to mihaip/dingusppc that referenced this issue Sep 16, 2023
Allows different implementations for native (C++ streams) and JS
(workerApi.disks.* functions) versions.

Updates mihaip/infinite-mac#219
mihaip added a commit to mihaip/dingusppc that referenced this issue Sep 16, 2023
Fix red and green channels being swapped due to different assumptions
in channel ordering between DingusPPC and the JS side.

Add content hashing of the frame buffer so that we don't need to
blit to the JS side if the content hasn't changed. Uses xxHash3
since it has the best performance.

Updates mihaip/infinite-mac#219
Updates mihaip/infinite-mac#18
mihaip added a commit that referenced this issue Sep 16, 2023
mihaip added a commit that referenced this issue Sep 16, 2023
mihaip added a commit to mihaip/dingusppc that referenced this issue Sep 21, 2023
Reuses the approach from 95ec7a1
more broadly so that the JS port can provide disk images.

Updates mihaip/infinite-mac#219
mihaip added a commit that referenced this issue Sep 23, 2023
mihaip added a commit that referenced this issue Sep 23, 2023
Does not work with existing system images since they're bare HFS
partitions and DingusPPC expects them to be wrapped in a full disk
image with a partition table. But that can be solved on this side,
without any DingusPPC changes.

Updates #219
mihaip added a commit to mihaip/dingusppc that referenced this issue Sep 23, 2023
The JS side will be using pointer lock to get raw mouse input and not
worry about the cursor moving beyond the bounds of the screen, so we
can assume that the mouse deltas are raw.

Updates mihaip/infinite-mac#219
mihaip added a commit to mihaip/dingusppc that referenced this issue Sep 23, 2023
mihaip added a commit that referenced this issue Apr 12, 2024
mihaip added a commit that referenced this issue Apr 26, 2024
mihaip added a commit that referenced this issue May 15, 2024
@Pierrestro

This comment has been minimized.

@Pierrestro

This comment has been minimized.

@Pierrestro

This comment has been minimized.

@that-ben

This comment has been minimized.

@Pierrestro

This comment has been minimized.

@MaddTheSane

This comment has been minimized.

@that-ben

This comment has been minimized.

@LagLifeYT

This comment has been minimized.

@Pierrestro

This comment has been minimized.

@LagLifeYT

This comment has been minimized.

@Pierrestro

This comment has been minimized.

@LagLifeYT

This comment has been minimized.

@Pierrestro

This comment has been minimized.

@that-ben

This comment has been minimized.

@MaddTheSane

This comment has been minimized.

@Pierrestro

This comment has been minimized.

@that-ben

This comment has been minimized.

@Pierrestro

This comment has been minimized.

@that-ben

This comment has been minimized.

@MaddTheSane

This comment has been minimized.

@Pierrestro

This comment has been minimized.

Repository owner locked and limited conversation to collaborators May 22, 2024
@mihaip mihaip mentioned this issue May 22, 2024
7 tasks
Repository owner unlocked this conversation May 25, 2024
mihaip added a commit that referenced this issue Jun 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Project Bigger projects
Projects
None yet
Development

No branches or pull requests

8 participants