Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

Octo Programming Questions Sticky

A topic by Internet Janitor created Aug 29, 2022 Views: 255 Replies: 5
Viewing posts 1 to 4
HostSubmitted

This thread is for short questions about Chip8 programming and the Octo assembly language. If you have a more involved question, feel free to start a separate thread.

Last year's thread can be found here.

Many common tricks and pitfalls are addressed in the Octo FAQ.

Remind us again what cycles per frame setting is more/most “realistic” to best emulate older devices?

HostSubmitted

CHIP-8 on the COSMAC VIP ran at something resembling 7-15 cycles/frame and forced a vsync after every 'sprite' instruction, which places severe limits on maximum framerate in inverse proportion to the number of sprites being updated at any given time.

SCHIP on the HP-48 is closer to 20-30 cycles/frame.

The "normal" speed of XO-CHIP is 1000 cycles/frame, though it can be a satisfying challenge to create responsive programs in less.

Do jumps outside the first 4k work as long PROVIDED they are jumps back into the first 4k? IE, could one locate a jump table at 0xFFF?

HostSubmitted

Yes. Quoting the FAQ:

One subroutine can dangle off the 0x1000 code RAM boundary if it doesn't contain any jumpjump0, or :call targets- try placing your longest branchless/loopless subroutine there!

I might make a PR, I personally don’t find that wording clear. It seems jump (and likely call) ARE allowed, so long as the targets are in the first 4kb… I just tested jump and it works just fine.

Not sure how useful this is - except for a jump table where the entries were pretty spaced out (think VM opcode decoding from high bits of instructions)… Feels like a nice place to stuff an opcode jump table, to save the low 4k for the VM and opcodes.