Live data from Hacker News

Tiny Emulators

floooh.github.io

21–30 of 34 posts

Re: Tiny Emulators

#21
post #3

I love the pin level emulation model of this. The self contained modular behaviour of components has real flexibility. For a long time I have wondered if extremely thin but explicitly defined interfaces are an under-explored domain for interoperability. Beyond simple chip emulation, any set of values that are sampled on each side of the interface at defined times, and a small set of signals to provided temporal acces…

> modular components with explicit conformance requirements would allow people to not care what happens inside the black box That's the whole idea of software libraries, no AI needed for that ;) It just takes some disciplines and not listening to the DRY crowd too much to create actually self-contained libraries.

Libraries rypicly have an interface of function calls.

That is different from an interface of set of polled values with a few signals.

Any library that can write to memory through provided pointers, or can return non primitive data has a potentially unlimited interface.

Re: Tiny Emulators

#22

FYI this is a heavily outdated URL (the one with '-preview' in it, last updated in 2021) which I had created at some point to test some things. The proper and uptodate URL is: https://floooh.github.io/tiny8bit/ Apart from the 'pin-emulation' the other interesting feature is that the CPUs are 'cycle stepped', e.g. the CPU no longer has a special 'controller role' in the system but is just 'ticked along' with all the o…

Browsing the repo linked on the page: https://github.com/floooh/chips-test

I see references to files in a "chips" directory. For example "chips/m6502.h". But those are missing? Where can they be found?

Like the concept! Reminds me somewhat of simulating a design in a hardware description language (eg. Verilator). Or the concept of 'drivers' in MAME (dunno if those emulate cycle-by-cycle btw).

So I'd welcome the opportunity to dive into how it's done on a code level.

Re: Tiny Emulators

#23

FYI this is a heavily outdated URL (the one with '-preview' in it, last updated in 2021) which I had created at some point to test some things. The proper and uptodate URL is: https://floooh.github.io/tiny8bit/ Apart from the 'pin-emulation' the other interesting feature is that the CPUs are 'cycle stepped', e.g. the CPU no longer has a special 'controller role' in the system but is just 'ticked along' with all the o…

Browsing the repo linked on the page: https://github.com/floooh/chips-test I see references to files in a "chips" directory. For example "chips/m6502.h". But those are missing? Where can they be found? Like the concept! Reminds me somewhat of simulating a design in a hardware description language (eg. Verilator). Or the concept of 'drivers' in MAME (dunno if those emulate cycle-by-cycle btw). So I'd welcome the oppor…

The actual emulator code lives here (all in STB-style headers):

https://github.com/floooh/chips

The chips-test repo has the 'integration' code which assembles the headers into executables:

https://github.com/floooh/chips-test

There's also a similar project in Zig (but less complete, it's more like an experiment what the same implementation ideas would look like in Zig) that might be a bit more readable and with everything in one place:

https://github.com/floooh/chipz

E.g. start reading the top-level emulator executables:

https://github.com/floooh/chipz/tree/main/emus

...and then move your way down to the system implementations:

https://github.com/floooh/chipz/tree/main/src/systems

...and finally to the chip emulators:

https://github.com/floooh/chipz/tree/main/src/chips

Re: Tiny Emulators

#24

Earlier quoted context omitted.

Browsing the repo linked on the page: https://github.com/floooh/chips-test I see references to files in a "chips" directory. For example "chips/m6502.h". But those are missing? Where can they be found? Like the concept! Reminds me somewhat of simulating a design in a hardware description language (eg. Verilator). Or the concept of 'drivers' in MAME (dunno if those emulate cycle-by-cycle btw). So I'd welcome the oppor…

The actual emulator code lives here (all in STB-style headers): https://github.com/floooh/chips The chips-test repo has the 'integration' code which assembles the headers into executables: https://github.com/floooh/chips-test There's also a similar project in Zig (but less complete, it's more like an experiment what the same implementation ideas would look like in Zig) that might be a bit more readable and with every…

Thx for those links!

Re: Tiny Emulators

#25

FYI this is a heavily outdated URL (the one with '-preview' in it, last updated in 2021) which I had created at some point to test some things. The proper and uptodate URL is: https://floooh.github.io/tiny8bit/ Apart from the 'pin-emulation' the other interesting feature is that the CPUs are 'cycle stepped', e.g. the CPU no longer has a special 'controller role' in the system but is just 'ticked along' with all the o…

Unrelated, but thanks for your chips project! We've used it in BizHawk as part of our CPC emulator core.

Re: Tiny Emulators

#26
post #21

Earlier quoted context omitted.

> modular components with explicit conformance requirements would allow people to not care what happens inside the black box That's the whole idea of software libraries, no AI needed for that ;) It just takes some disciplines and not listening to the DRY crowd too much to create actually self-contained libraries.

Libraries rypicly have an interface of function calls. That is different from an interface of set of polled values with a few signals. Any library that can write to memory through provided pointers, or can return non primitive data has a potentially unlimited interface.

that mangled word is 'typically' btw.

but while I'm here I should point out I wasn't thinking you need AI for this. I was thinking maybe you need this for AI. As a testable way to insulate yourself from AI overreach.

Re: Tiny Emulators

#30

FYI this is a heavily outdated URL (the one with '-preview' in it, last updated in 2021) which I had created at some point to test some things. The proper and uptodate URL is: https://floooh.github.io/tiny8bit/ Apart from the 'pin-emulation' the other interesting feature is that the CPUs are 'cycle stepped', e.g. the CPU no longer has a special 'controller role' in the system but is just 'ticked along' with all the o…

Sokol is the best, thank you for your ongoing work :) And please open a patreon or something!
Post reply on HN