NEW NES BASIC

Programming the 6502 microprocessor and its relatives in assembly and other languages.
Post Reply
halkun
Posts: 45
Joined: 26 Nov 2012

NEW NES BASIC

Post 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$()
Attachments
realh.jpg
charpic.png
charpic.png (10.14 KiB) Viewed 879 times
baspic.png
baspic.png (5.89 KiB) Viewed 879 times
WillisBlackburn
Posts: 51
Joined: 14 Aug 2021

Re: NEW NES BASIC

Post by WillisBlackburn »

That's cool. Is it a port of MS BASIC or something new? Is the project posted anywhere (GitHub etc.)?
Post Reply