News for hackers. Stuff that matters.
Re:Tiny Emulators by skywal_l on Monday April 28, 2025 @01:51AM (#43818027)
Flooooh's code is also very easy to read so it's a pretty good documentation for these old systems especially as the (some?) emulators are cycle accurate[0]

[0]: https://floooh.github.io/2019/12/13/cycle-stepped-6502.html

Re:Tiny Emulators by devdri on Monday April 28, 2025 @09:26AM (#43821303)
The way it uses pin state (number passed as argument / result) for communicating with the outside world is genius. This way it very clearly matches what happens in hardware each cycle. Typical alternative is that the "cpu" calls read/write on the memory/peripherals - which gets tricky when the exact read/write cycle of the multi-cycle instruction matters for accuracy (e.g. racing the CRT beam).

I wonder if similar approach could realistically be applied to slightly newer generation hardware like GBA with ARM7TDMI.

Re:Tiny Emulators by whstl on Monday April 28, 2025 @10:15AM (#43821748)
Floooh is amazing.

One of my favourite libraries ever is Sokol, which is used for those emulators AFAIR:

https://github.com/floooh/sokol

It hits the spot for me in terms of features, small-size and ease of use/embedding.

Every other library has way too much I don't need and way too little that I do.

It was also a fantastic code reference for me, when I was porting game code between platforms. It has all the answers I need in it, and I know how to navigate it quite well after those years. If one studies it enough it has enough material for a few reference books.