Skip to main content

On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines
(+1)

Cool! Usually CHIP-8 games have the scope of a single micrograme, hehe. But it's definitely possible to cram a bunch of stuff into one game, especially if they don't need a lot of graphical assets. Even then, XO-CHIP gives you a lot of space for assets (just not code, easily at least).

Wait, why does XO-CHIP not give you space for code?

(+3)

Well, there's nothing stopping you from putting code beyond the "regular" 4K of CHIP-8 memory, but XO-CHIP doesn't provide a way to jump or call code there. You can set the `i` index register to anywhere in the 64K memory space, however, so it's easy to use for graphics or audio.

(4 edits) (+2)

Right. It's a product of the instruction encoding. The "jump", "jump0", "call" and "i:=NNN" CHIP-8 instructions only have space for a 12-bit immediate address. XO-CHIP expands the RAM available, and provides "i:=long NNNN", which can point to a 16-bit immediate address (and which is 4 bytes long instead of 2). Since jump/jump0/call don't have a "wide" flavor, you can't as easily place code outside the low 4k.

In practice this is still enough for quite elaborate games. It does, however, mean that XO-CHIP programmers should be more aware of where they're locating code and data in the address space.

Low ram is best used for code, high ram can be used for graphics, sound, or working memory. If you're running out of "code ram" for an elaborate game, you could write a small interpreter that executes bytecode from "data ram", at the cost of some speed. My game Business is Contagious used this strategy for most of the game logic, since only a few parts of the UI code were at all performance-sensitive.

(1 edit) (+1)

Oh yikes, how did I miss that? No indirect jump from I (which would make long jumps trivial)… hmmm… :-/ I think that deflates my plans for something really ambitious just a bit. :|