nesdev.com
http://forums.nesdev.com/

what about forking Boriel’s ZX-Basic Compiler for 6502/NES?
http://forums.nesdev.com/viewtopic.php?f=2&t=15448
Page 1 of 1

Author:  nitrofurano [ Thu Jan 26, 2017 1:37 pm ]
Post subject:  what about forking Boriel’s ZX-Basic Compiler for 6502/NES?

since years ago i were trying to extend Boriel’s ZX-Basic Compiler ( http://www.boriel.com/wiki/en/index.php/ZX_BASIC ) to most of existing Z80-based hardware ( http://www.boriel.com/wiki/en/index.php ... R_HARDWARE )

and since Boriel’s ZX-Basic Compiler is coded in Python (relatively simple to analyze, adapt, and start using without compiling), and quite simple to use, i imagined how simple it would be to adapt it to use 6502 instead of Z80, replacing all the Z80 routines to their 6502 equivalence - it uses ix register and stack quite intensively on routines, allows inline assembly and libraries, calculations with float points, 8, 16 and 32 bit variables ( http://www.boriel.com/wiki/en/index.php/ZX_BASIC:Types ) , and the code is released in a gpl-compatible software-libre licensing

how simple it would be? and how soon could we expect such fork being released to the public?
(i think it is worth seeing how it works, at least...)

thanks in advance! :)

Author:  slobu [ Mon Feb 06, 2017 1:25 pm ]
Post subject:  Re: what about forking Boriel’s ZX-Basic Compiler for 6502/N

Not many people are fans of BASIC here. Your best bet is to get into contact with people who have tried to get high level / beginner friendly compilers going.

Here's Atalan. I'd look at the source and examples for NES:
http://atalan.kutululu.org/

Here's PyNES:
https://gutomaia.net/pyNES/

Another option is to take an approach similar to rebootBASIC for the Atari Jaguar. Something like: use BCX to convert BASIC to C then tweak the output into something cc65 will like.

http://bcx-basic.sourceforge.net/

http://shiru.untergrund.net/articles/pr ... s_in_c.htm


Yet another option is to study the source code for batari BASIC. It works by using canned graphic engines in conjunction with converting BASIC into 6502 assembly:
http://bataribasic.com/download.html

Author:  gauauu [ Tue Feb 07, 2017 10:40 am ]
Post subject:  Re: what about forking Boriel’s ZX-Basic Compiler for 6502/N

slobu wrote:
Yet another option is to study the source code for batari BASIC. It works by using canned graphic engines in conjunction with converting BASIC into 6502 assembly:
http://bataribasic.com/download.html


That's what I came to say. A lot of people have success with that in Atari development. With the canned display kernels, it's not fully flexible, but also avoids having to worry about timing-critical code. I could see something like that working well for nes -- you provide standard libraries for handing nametable updates, etc, and let basic handle the simple parts of game logic.

Page 1 of 1 All times are UTC - 7 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/