Log In  

New games:

Cart #14478 | 2015-09-22 | Code ▽ | Embed ▽ | No License

Cart #14477 | 2015-09-21 | Code ▽ | Embed ▽ | No License


Cart #14411 | 2015-09-20 | Code ▽ | Embed ▽ | No License

Cart #14384 | 2015-09-20 | Code ▽ | Embed ▽ | No License

Cart #14387 | 2015-09-20 | Code ▽ | Embed ▽ | No License


Cart #14479 | 2015-09-22 | Code ▽ | Embed ▽ | No License

I am back with new experiment - real emulator of my second favorite retro platform for my first favorite retro platform :)

You can show virtual keypad by pressing B on P2 controller, then use P2 arrows and A button to press keys.

Emulator is preloaded with those games:

  • Rush Hour by Hap
  • Astro Dodge (hi-res)
  • Worm V4 (hi-res)
  • Space Invaders by David Winter
  • Tetris.
  • TRIP8 hi-res demo

Rush Hour controls:

  • ARROWS - movement
  • Z - select
    Only code I found: 4A10 :D

Worm V4 controls:

  • ARROWS - movement
  • Z - reset

Astro Doge controls:

  • ARROWS - movement
  • Z - start

Space Invaders controls:

  • LEFT/RIGHT - movement
  • Z - shoot

Tetris controls:

  • LEFT/RIGHT - move
  • UP - rotate
  • DOWN - drop

Some technical details:

  • emulator runs at 1500 cycles per second (successfully tested at 3000 cycles per second)
  • timers are set correctly to 60Hz
  • game rom is stored as map data (currently 1 game per pico rom)
  • screen is stored directly in spritesheet
  • pico keys are custom-mapped to chip8 keys
  • cpu specification: 35 opcodes, 16 8-bit registers, 64x32 b/w screen, 4k rom/ram



  • fixed sprite drawing
  • added emulator restart button (for games that end in loop or halt)
  • fixed clear screen routine
  • added support for hi-res mode
  • fixed key handling
  • added full chip8 keypad (p2 controller)
  • fixed font sprite location to reflect emulator's default font position in memory
  • simple debugger mode easily switchable by variables
  • wait for key-press fixed
  • beep fixed
  • shl and shr instructions fixed

If anyone want to take a look and play, please use RUSH-HOUR rom. Many bugs I found are fixed there ;)

P#14385 2015-09-19 22:34 ( Edited 2015-09-22 20:42)

I swear to god, if this is real, I am going to have a screeching session. AKA 'WEEEE!".

This is purely amazing.
I understand that PICO-8 is running Lua code, but that's like the NES running Atari 2600 games!

P#14388 2015-09-19 22:55 ( Edited 2015-09-20 02:55)

Thanks, it's still not perfect, most problematic thing is that pico uses only 16-bit signed numbers, but chip8 need unsigned ones. I don't know yet what will happen when rom try to work with 16-bit register, but it seems to work on games I tried. Later I will release utility that will compile chip8 rom into pico cartridge, so you can easily add your favorite games.

If you really want to add your games, download first version of this utility that I used. You will have to manually copy map data into .p8 file.

P#14391 2015-09-19 23:51 ( Edited 2015-09-20 03:51)

Very impressive! I was thinking about porting my GB/GBC emulator to pico8 at some point, but figured that there's not enough code space and that even with compression it would only be able to run single bank roms.

I like dark blue as black, adds a little character to it. :P

P#14392 2015-09-20 00:08 ( Edited 2015-09-20 04:09)

This is the first time I hear about CHIP-8. Could you share some good programming tutorials for it and link to some good devtools/emulators? Would love to play with it.

P#14408 2015-09-20 08:41 ( Edited 2015-09-20 12:41)

Chip-8 is pretty limited (4k of rom/ram, 35 opcodes, etc.) so don't expect any high-level language to work with. There is assembler available or you can use any hex editor to create your programs. Try to google for some tutorials or you can jump straight in using Opcode table and emulator.

P#14412 2015-09-20 09:54 ( Edited 2015-09-20 13:54)

Added virtual keypad :D Use B on P2 controller to show it. Available only on 1.3 and never roms.

P#14418 2015-09-20 13:00 ( Edited 2015-09-20 17:00)

Dude, wow. I don't even know what CHIP-8 is, so I'd happily ingest some info on that if you'd want to present some, but even without knowing what it is, playing even more restrictive games on an already very restrictive console is all kinds of cool.

P#14441 2015-09-20 19:41 ( Edited 2015-09-20 23:41)

Nice! I think rush-hour is the best CHIP-8 game, maybe this will inspire me to pick my C++ CHIP-8 emu back up.

P#14443 2015-09-20 20:28 ( Edited 2015-09-21 00:28)

For those who want to try create something for CHIP-8, I have created simple demo with commented source code.

Cart #14497 | 2015-09-22 | Code ▽ | Embed ▽ | No License

You can compile it using chipper:
source code
win64 binary

P#14498 2015-09-22 16:42 ( Edited 2015-09-22 20:42)

Can you do Blinky?

P#65011 2019-06-05 18:44

AfBu - your intro animation on your carts is so fantastic!

P#68380 2019-10-02 18:38

Your function HEX could be updated to smaller code:

function newhex(o)
local p=5
  if (o<=15) p=6
  return sub(tostr(o,1),p,6)

Here is your current code:

function hex(o)
    local hs,h,l = {0,1,2,3,4,5,6,7,8,9,"a","b","c","d","e","f"}

    o = byte(o)

    if (o <= 15)    return hs[o+1]

    h = shr(band(o,0xf0),4)
    l = band(o,0x0f)

    return hs[h+1]..hs[l+1]

 function byte(n)
    while (n>255) do
        n -= 256
    while (n<0) do
        n += 256
    return n

BTW, how do I see the sourcecode for the game ? I know you stored it in maps, but viewing maps does not reveal the sprite # beneath. Wouldn't it be easier to code instead as a hex-string or something ?

P#68381 2019-10-02 20:04 ( Edited 2019-10-02 20:18)

Well, since this thread has been bumped anyway, I'll take this opportunity to plug Octo, a high-level language and IDE that allows you to program CHIP-8 games with a modern toolset. @darkhog, you're probably not very active here on the BBS anymore, but Octo is definitely what you want. It offers many nifty assembling directives that Chipper et al don't give you.

I'll also let everyone know that the sixth annual Octojam is currently going through October. It's a CHIP-8 game jam! I already made a game, it was very fun!

I hope someone will check out CHIP-8, it's very neat and even more restricted than PICO-8.

@dw817: I'm pretty sure the map data is the source code itself, ie. it's the bytecode. If you open one of the carts in eg. Notepad, you'll see the instructions right there. First are the 0x1FF (511) bytes that were traditionally reserved for the CHIP-8 interpreter, which are all 0, except for the hard-coded sprites for the hex numerals. Then the game's actual instructions start at byte number 0x200.

P#69143 2019-10-21 20:25 ( Edited 2019-10-21 20:34)

I could just barely do 6502 assembly years ago so I suspect I'm not going to be very good at this.

Now I MIGHT be able to doodle together a 4-bit fantasy processor, I still have the notes for it. But I suspect it will not be based on an actual and existing system AFAIK.

P#69188 2019-10-23 03:22

Just found your post. I just got my Chip8 emulator working in Pico-8. Can't wait to check your code out. Mine is slow so I have to re-think it. I can drag and drop .ch8 files onto it and run them. I also do code disassembly and it lets your step through code and shows register values and I am putting in code editing. But I have to get the speed going. Nice job!!!

P#118676 2022-10-06 16:57

[Please log in to post a comment]