Page 1 of 1

NEW NES BASIC

Posted: Sat Jan 03, 2026 10:06 am
by halkun
Hi All!
So I've been working with porting BASIC to the NES and I recently released an alpha version in the wild. Even runs on real hardware!
Sadly, I tried to attach the ROM here, but it didn't like it. I can change the extension.. I mean.. I own the rights to the ROM :)

Here is a rundown of what I have...
BASIC commands implemented.
END, FOR, NEXT, DATA, INPUT, DIM, READ, LET, GOTO, RUN, IF, RESTORE, GOSUB, RETURN, REM, STOR, ON, WAIT, DEF, POKE, PRINT, CONT, LIST, CLEAR, GET, NEW, TAB, TO, FN, SPC, THEN, NOT, STEP, +, -, *, /, ^, AND, OR, >, =, <, SGN, INT, ABS, USR, FRE, POS, SQR, RND, LOG, EXP, COS, SIN, TAN, ATN, PEEK, LEN, STR$, VAL, ASC, CHR$, LEFT$, RIGHT$, MID$, GO

Extended commands:
BEEP - Beeps
CALL ($address) - call a machine language routine at $address
CLS - (clear screen)
HEX$(n) - print hex of integer n
LOCATE x,y - move cursor to a place on screen
PALETB 0,a,b,c,d Sets palette to NES colors (a,b,c,d are the NES colors, a = background color and d = text color. Since I don't have sprites yet, only slot zero ("0") does anything.
STICK(n) - returns the d-pad position of controller n (0,1)
STRIG(n) - returns if start, select, a, or b has been pushed on controller n (0,1)
PCKEY - flips between famicom keybaord and PC keyboard layout.

&H hex literals are supported along with also 9 decimal floating point

Things to note. Right shift and control doesn't work yet... also you press the "stop" button to stop (Break) the program(Mapped to "DELETE" in Mesen - I have not tested with other emulators)

I attached a character map (0-255) printable when you use CHR$()

Re: NEW NES BASIC

Posted: Thu Mar 05, 2026 9:47 pm
by WillisBlackburn
That's cool. Is it a port of MS BASIC or something new? Is the project posted anywhere (GitHub etc.)?