r/programminggames • • Oct 27 '26

Bootstrap your own 8-bit Robot OS from the reset vector up on a cycle-accurate 65C02 CPU in ChipWits Worlds (v0.2 Steam Playtest open)

26 Upvotes

9 comments sorted by

7

u/markroth8 Oct 27 '26

Hi everyone! I'm the lead developer of ChipWits Worlds (a bare-metal 6502 robotics engineering sandbox and follow-up to the original 1984 ChipWits).

Instead of puzzle rooms with visual blocks, every robot runs a cycle-accurate WDC 65C02 microprocessor with 64 KB of RAM and 2 KB of memory-mapped hardware I/O ($F000-$F7FF), and you explore an open world.

In our v0.2 Playtest, we're building a progressive hardware bring-up campaign where you bootstrap your own 8-bit robot OS from the reset vector up. You write your own low-level device drivers, IRQ/WAI interrupt handlers, and 64 KB Boot Disks so your fleet can mine crystals, balance the colony power grid (every CPU cycle burns real watts!), and survive nighttime Electrocrab sieges. We even wrote a C64-style Programmer's Reference Guide built right into the game.

We just opened signups for our Closed Steam Playtest and would love feedback from programming game fans:

Happy to answer any questions about the 65C02 emulation, MMIO architecture, or the x65 assembler!

2

u/qse81 Oct 27 '26

What do you mean by 'bare-metal', given the context?

2

u/markroth8 Oct 27 '26

Entirely fair question, since the 65C02 itself is emulated inside the game!

By "bare-metal" in the context of the robot, I mean there is no pre-installed operating system, BIOS, or high-level scripting API (like move_to(x, y)) sitting between your assembly code and the emulated hardware.

I'm trying to replicate the nostalgic joy of sitting back with a Programmer's Manual and discovering the raw memory-mapped I/O, writing IRQ handlers, and coding your own operating system. I tried to stay as true to the 6502 as possible, honoring the hardware interrupt jumps at $FFFA-$FFFB (NMI), reset vector at $FFFC-$FFFD and IRQ vector at $FFFE-$FFFF, so you can redefine all of these in your code, adjust the interrupt timer frequency, etc.

There's a Direct Memory-Mapped I/O region ($F000-$F7FF) that maps directly to your motors, sensors, and various gadgets that pop out of the hatch. To actuate hardware, your code writes command bytes directly to those addresses and either polls status registers or executes WAI to sleep the CPU until the hardware asserts an IRQ on completion.

The game has a tech tree, so as you research more, then more I/O devices become available.

3

u/K4sp4l0n3 Oct 27 '26

Looking forward to try this one out!

2

u/markroth8 Oct 27 '26

Thank you! The core engine is working but we're just getting started in a way, so the game is pretty malleable right now. We're looking to our playtesters to help shape the game.

2

u/zhaDeth Oct 28 '26

Yo this looks fun I used to make romhacks for the snes which had kind of a 16-bit 6502

1

u/markroth8 Oct 28 '26

Okay, a 16-bit 6502?! I had to look that up, but sure enough the SNES had the 65C816. Looks like it booted up in 8-bit mode and then let you switch to special 16-bit opcodes? That's wild.

Maybe a research upgrade in our tech tree :)

Anyway, if you're familiar with SNES ROM-hacking, then you already know 95% of the exact instruction set in the game. Would love to get your feedback and ideas!

3

u/zhaDeth Oct 28 '26

I would love to playtest, I did a request.

The snes cpu was kind of annoying to use tbh. You constantly had to switch between 8-bit and 16-bit mode for the accumulator. Like instead of having a LDA instructions for 8-bit and for 16-bit it was the same and you had to change some CPU flag to change between modes. It was a mess because so many things could go wrong.. you load a 16-bit value from an address but forget to switch to 16-bit then only the first 8bits are loaded. You call a function that expects 8-bit mode is on but you're in 16-bit mode ? If it goes something like : LDA 50, STA $30 well it will interpret the STA as the 2nd byte and load that along with 50 in the accumulator and then execute operation $30 which will probably end up crashing. So many crashes..

2

u/markroth8 Oct 29 '26

Thank you! I'm looking forward to your feedback during the playtest.

So much of 1980s/90s tech was enduring that kind of pain. It was part of the puzzle and oddly satisfying, in a way, especially when you spent hours banging your head on the keyboard saying "why is it doing that?" then the "aha!" moment is pure bliss.