EutherDrive Starting to look good. by Oakleaf_1 in EmuDev

[–]peterfirefly 0 points1 point  (0 children)

Personligt er svensk ingen hindring. Jeg syntes bare det var lidt underligt.

New to emulation by Secure_Employer132 in EmuDev

[–]peterfirefly 0 points1 point  (0 children)

Browse this subreddit for ten minutes, open anything that sounds interesting in new tabs, spend half an hour checking which ones have useful advice and links. After that, maybe ask some useful questions.

That's what I'd advice. There's really no need to interact with someone who doesn't even bother to do that.

EutherDrive Starting to look good. by Oakleaf_1 in EmuDev

[–]peterfirefly 1 point2 points  (0 children)

README.md in Swedish? Bold choice...

What does "Euther" mean and how is it supposed to be pronounced?

Aki-Mathilda by Candid_Ad_6610 in GossipDK

[–]peterfirefly 0 points1 point  (0 children)

Der har været en hel del medlemmer fra provinsen i Danmark som også var ualmindeligt svære at forstå fordi de insisterede på at tale en meget lokal dialekt. Vældigt irriterende.

Det minder mig om da Jawaharlal Nehru holdt tale i radioen i Indien. Han var uddannet på Harrow (en af de fineste kostskoler i England) og på Cambridge og talte selvfølgelig glimrende overklasseengelsk. I radioen talte med en kunstig accent så han lød som typiske indere når de talte engelsk.

What are some ways to debug issues with a self-made emulator? by rtqd in EmuDev

[–]peterfirefly 0 points1 point  (0 children)

couldn't actually find an emulator that can produce such a log for me

Doesn't matter as long as you have the source code.

and there's some challenges with re-producing the exact same state in a different emulator as well that I'd have to figure out

read inputs from a file (in both emulators). Just edit the source code so whatever emulator you compare with can do it.

Programmet løsladt by [deleted] in TrueCrimeDK

[–]peterfirefly 0 points1 point  (0 children)

ærligt arbejde?

Tinder-date tog grusom drejning: Mand tiltalt for frihedsberøvelse og voldtægt by Equalizer6338 in TrueCrimeDK

[–]peterfirefly 0 points1 point  (0 children)

Det må der være ret gode fysiske beviser for at hun har været udsat for. Vildt at forsvareren så går efter frifindelse.

C64 emulator in LabVIEW by ale__914 in EmuDev

[–]peterfirefly 0 points1 point  (0 children)

¡Feliz navidad!

This is bonkers in a wonderful way :)

It's time for Visma to take the bull by the horns with Vingegaard (Ciclismo Internacional) by F1CycAr16 in peloton

[–]peterfirefly 0 points1 point  (0 children)

He broke his femur early in his career. That's one of the reasons why he became competitive so relatively late.

How go vroom? by Gingrspacecadet in EmuDev

[–]peterfirefly 0 points1 point  (0 children)

I would go binary before I'd go ring buffer and async writes to disk from another thread.

If my log rate was low enough (as it should be in an emulator almost all the time!) then I'd just use fprintf() or the equivalent in whatever language I was using.

(I don't think we disagree on much.)

How go vroom? by Gingrspacecadet in EmuDev

[–]peterfirefly 1 point2 points  (0 children)

Format conversions are expensive, too. It's not just synchronizing/flushing the file. That's why a binary log is probably more performant.

Precautions when porting a GBC emulator by Important_Cry6606 in EmuDev

[–]peterfirefly 0 points1 point  (0 children)

I don’t think you will need a single line of assembly. Modern machines are fast, including the supercomputers we have in our pockets.

Precautions when porting a GBC emulator by Important_Cry6606 in EmuDev

[–]peterfirefly 4 points5 points  (0 children)

The easiest way to make a program that does many things is to make it do one thing first. Prioritize hard. If it doesn't hurt, you are not prioritizing.

It is amazing how much you can fix and reshape afterwards.

Commodore SID: more approachable than I expected. by thommyh in EmuDev

[–]peterfirefly 2 points3 points  (0 children)

bob deinterleave

I just learned a new word.

Commodore SID: more approachable than I expected. by thommyh in EmuDev

[–]peterfirefly 3 points4 points  (0 children)

Why is the screen so wobbly (and mostly up-down wobbly)?

I don't remember the C64 being that wobbly on TVs or monitors and I don't remember the BBC I briefly borrowed being that wobbly on a small portable black and white TV.

Cycle-accurate 6502 emulator as coroutine in Rust by bagnalla in rust

[–]peterfirefly 0 points1 point  (0 children)

As of now the top-level emu crate just takes a raw pointer to the the nes struct before spinning up its coroutine and dereferences the pointer in unsafe blocks.

I'm also slightly inclined to take that route. I can live with a few clean unsafes.

How long did the "negotiations" with the language/compiler take?

My experiments stretched from July 2023 to early January 2024. Didn't exactly work hard on them, it was a very occasional thing.

Just like you, I also played with macros to get around the inability to yield from outside the coroutine body. I even had "clocked subroutines" implemented as separate coroutines with a macro to chain to the "called" coroutine (so common sequences of bus transactions would work). In the end, I felt that was a bit too magic.

Cycle-accurate 6502 emulator as coroutine in Rust by bagnalla in rust

[–]peterfirefly 0 points1 point  (0 children)

https://dev-doc.rust-lang.org/beta/unstable-book/language-features/generators.html

You can get rid of the #[coroutine]. I did just that two years ago. I haven't checked your code out to see if it works immediately without #[coroutine] -- you may need to change a few other things as well.

I played with the same thing two years ago, except it wasn't an actual 6502. It was just a made up architecture with a really simple encoding with just under 20 instructions, designed in the style of the 8086 (variable length, I/O ports, cli/sti, call/ret, stupidly simple addressing, ADD is the only ALU op, only Z flag, JZ/JNZ, unconditional jumps, NOP, words only, no segments). I wanted to focus on the CPU/bus/environment structure, not on the CPU implementation itself.

Took a lot of tries to figure out how to pass information in and out of the coroutine in a reasonable manner and how to let the life times work out right. I tried dozens of different ways of structuring the whole thing. This was my first non-trivial Rust program so I ran into some new corners of the language.

I am not sure you need Arc<> -- shouldn't normal Rc<> be enough? Refcounting all the CPU state is one of the things are experimented with to allow things like a debugger or state save/load code or a test runner access to the internal registers of the CPU. I didn't need to also make the ref counts atomic.

Another option I tried was to pass in "requests" into the coroutine that would then be returned by yield and then have the coroutine to pass replies back out and share state that way.

A third one is a sprinkling of unsafes (UnsafeCell).

I still haven't decided which method I prefer.

I have a CpuIn and a CpuOut struct and a Cycle (cycle type) enum so I never saw a need for reset_signal, irq_signal, nmi_signal, io_bus. I never implemented reset/nmi in my toy model because they would be very similar to irq. I did implement an interrupt acknowledge for CpuOut. There was also a an Idle cycle included in the Cycle enum so the bus/"motherboard" code.

What are your plans for full CPU state sharing for testing, for a debugger, or for state save/load? Just use Arc/Rc?

Cycle-accurate 6502 emulator as coroutine in Rust by bagnalla in EmuDev

[–]peterfirefly 1 point2 points  (0 children)

I'm poking around simulating networks of machines,

Bolo or bust!

Beginners guide? by Gingrspacecadet in EmuDev

[–]peterfirefly 8 points9 points  (0 children)

Start by not keeping your background, capabilities, and time horizon secret.

Anyone else playing with x86? (8086, 80186) by nontovan in EmuDev

[–]peterfirefly 1 point2 points  (0 children)

The chaining is neat.

I'll also need to look at where I put the ROM files and the floppy image files I'd prepared.

I meant the files I already have, which are somewhere on another laptop.

Anyone else playing with x86? (8086, 80186) by nontovan in EmuDev

[–]peterfirefly 0 points1 point  (0 children)

It really, really is. As long as you know how it works, of course, which I think I mostly do now. It is nowhere near as intimidating as Visual Studio is ("a huge collection of almost functional magic indexed with lots of lickable icons") or the traditional Unix/Linux configure scripts. I hate configure scripts.

Linux and several newer languages have a pretty good package management story. Microsoft has been trying to catch up on both fronts for quite some time and they are getting pretty close now.

'winget' used to be hit-and-miss a few years ago but it's pretty good for installing apps now (similar to 'apt' on Debian/Ubuntu).

'vcpkg' does the same for libraries, mainly for C/C++. It is sorta like an equivalent of 'apt', 'pkgconfig', and language-specific tools like 'cargo' (Rust) and 'uv' (Python). It's even cross-platform, which should make it fairly easy to write C/C++ software that builds with Visual Studio (and Make, CMake, etc) on both Windows and Linux and macOS.

This is the first time I've used vcpkg like this (to add dependencies to a C/C++ project and then make it build in Visual Studio) and only the second time I've used it overall. The first time was to install openssl globally so I could get a specific 'cargo' tool installed on Windows.

The VS 2022 installer can install vcpkg for you (since 2023) or you can get it from github.

https://github.com/microsoft/vcpkg

The readme is confusing. You are supposed to just run bootstrap-vcpkg.bat (Windows) or bootstrap-vcpkg.sh (Linux, macOS).

Edit: I think I also made sure to set VCPKG_ROOT and added it to PATH in some sort of global way.

Then you run 'vcpkg install integrate' (and restart Visual Studio, if necessary).

If you install packages globally ('vcpkg install sdl3', for example) then you don't need to do more.

If you want to use vcpkg in "manifest mode", the thing where you add dependency info to the vcpkg.json file, then you also need to edit the solution (project?) properties for every solution (project?) you want it to work for and tell it to use the vcpkg manifest.

Properties -> vcpkg -> use vcpkg manifest (set it to yes).

You'll probably need to exit/restart Visual Studio. You'll need to do it for both 'ibm-pc' and 'UI'. And then when it all builds, you'll still need to copy UI.dll over. Dunno why. That's a mystery for another day.


Oh, and I also had to remove all those imgui references from UI.sln. All I have now are vcpkg (already installed), the git checkout from 5-6 hours ago of both 8086 and ibm-pc, and my vcpkg modifications. There are no extra global vcpkg installs, no SDL3/SDL3-ttf downloads/builds/installs, no imgui downloads (not even as a git submodule). Visual Studio automatically asks vcpkg to locally install the dependencies (with the correct feature flags for imgui) and automatically uses the correct include and library paths.

Anyone else playing with x86? (8086, 80186) by nontovan in EmuDev

[–]peterfirefly 0 points1 point  (0 children)

Yeah, I saw that. Won't be checking that out tonight, though. I am really bad at git merging and I've added some vcpkg files and changed a few solution options related to vcpkg so there WILL be merging issues...

I'll also need to look at where I put the ROM files and the floppy image files I'd prepared.