Fantasy console based on 6502 and rendered using Raylib.
Mostly inspired by things like Uxn but uses 6502 as the underlying base VM. The environment your ROMs are running in is completely made up and doesn't correspond to any real hardware that ever existed (hense the "fantasy" part).
$ cc -o nob nob.c
$ ./nob
$ ./build/r8 ./build/examples/checker.romWe have only tested on Linux so far. But Windows and MacOS supports are coming eventually.
| Key | Desciption |
|---|---|
| Ctrl+R | Reload the current ROM |
You can Drag&Drop ROM files onto the window.
ROMs are just binary files consisted of 6502 machine code instructions. Produce them with whatever assembler your heart desire (even manually if you feel spicy). We supply some binaries of vasm that we stole from http://www.compilers.de/vasm.html. You can use them as a starting point. Check out examples for some ROM assemblies.
The ROMs are loaded at address $8000 and start executing at $8000. So a basic ROM that does nothing and exits in vasm would look like:
org $8000
init:
rtsUpdate Vector is executed by r8 at a constant FPS. It is usually set in the Entry Point:
org $8000
init:
; Set the Update Vector
lda #<update
sta $FFFE
lda #>update
sta $FFFE+1
rts
update:
; Render a frame
rtsBy default the Update Vector is ran at 5 FPS, but the ROMs can configure it:
org $8000
init:
; Set the Update Vector
lda #<update
sta $FFFE
lda #>update
sta $FFFE+1
; Run the Update Vector at 30 FPS
lda #30
sta $FFFD
update:
; This should be run at 30 FPS
rtsLower 5 bits of $FFFD set the FPS the 6502 emulator is running at. The upper high bits are ignored for now.
Canvas is a grayscale 8-bit 64 by 64 pixels image located at $1000. It is what's displayed by the main window of r8.
org $8000
init:
; Set the Update Vector
lda #<update
sta $FFFE
lda #>update
sta $FFFE+1
; Draw something on the Canvas
lda #$FF
sta $1000+1
sta $1000+3
sta $1000+64*2+0
sta $1000+64*2+4
sta $1000+64*3+1
sta $1000+64*3+2
sta $1000+64*3+3
rts
update:
rtsTBD
TBD
Special Thanks goes to codecat69, sushi, and many other chatters in the Twitch chat who were patient with me and provided invaluable help as I was impatiently familiarizing myself with the wonders of 6502 raw assembly programming ^^"
