Skip to content

Experiment with @wuest's 6502 emulator#14

Draft
olefriis wants to merge 2 commits intomasterfrom
experiment-with-wuest-6502-emulator
Draft

Experiment with @wuest's 6502 emulator#14
olefriis wants to merge 2 commits intomasterfrom
experiment-with-wuest-6502-emulator

Conversation

@olefriis
Copy link
Owner

Currently, sidtool relies on an atrocity of a gem I made for simulating the MOS 6510 CPU: https://github.com/olefriis/mos6510. That gem wraps a piece of JavaScript from https://github.com/jhohertz/jsSID. This is done with the mini_racer gem which wraps a V8 virtual machine. It's clearly overkill for solving this problem.

Additionally, this is causing issues for people installing sidtool. So it would be interesting to try out a pure-Ruby solution. Incidentally my awesome colleague @wuest has implemented a MOS 6502 simulator (which is, for all practical purposes, the same as a MOS 6510 emulator): https://github.com/wuest/livestream-6502-emu

This PR just pastes all of the other repository into this. It's really not nice, but meant for experimenting.

@olefriis olefriis self-assigned this Dec 28, 2022
@olefriis
Copy link
Owner Author

olefriis commented Dec 28, 2022

This PR is very slow compared to master, unfortunately.

master:

$ time ruby -Ilib bin/sidtool ../c64-music-presentation/C64Music/MUSICIANS/D/Daglish_Ben/Last_Ninja.sid -o last_ninja.midi --format midi
Processed 15000 frames
ruby -Ilib bin/sidtool  -o last_ninja.midi --format midi  3.09s user 1.03s system 106% cpu 3.878 total

This branch:

$ time ruby -Ilib bin/sidtool ../c64-music-presentation/C64Music/MUSICIANS/D/Daglish_Ben/Last_Ninja.sid -o last_ninja.midi --format midi
[...]
Processed 15000 frames
ruby -Ilib bin/sidtool  -o last_ninja.midi --format midi  48.73s user 0.19s system 99% cpu 48.986 total

@wuest
Copy link

wuest commented Dec 28, 2022

Yeah it's not a huge surprise that this is way slower - speed absolutely was not one of the primary concerns for this project. It should be easy enough to rewrite with speed in mind (though I wonder if ruby is going to beat V8 regardless)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants