Programming for The NES using anything other than ASM or C

Are you new to 6502, NES, or even programming in general? Post any of your questions here. Remember - the only dumb question is the question that remains unasked.

Moderator: Moderators

Post Reply
iamrifki
Posts: 3
Joined: Sat Feb 09, 2019 4:30 pm

Programming for The NES using anything other than ASM or C

Post by iamrifki »

Hi there, I want to start making a project for the NES, however I do not have the time to learn ASM nor C, I know about PyNes, but it seems incomplete, is there any other solution to my problem?
User avatar
rainwarrior
Posts: 8734
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

Re: Programming for The NES using anything other than ASM or

Post by rainwarrior »

Assembly is the "standard" way. C is kind of a niche way that several people have found useful (myself included). Every other way to program for the NES is kind of a niche of a niche, and you're probably going to have to find your own way with any of them.

You can use C for NES without learning assembly, or without learning much, but ultimately you can make more effective use of it if you learn assembly too. With other langauges, you will more or less have to learn assembly anyway to figure out how to get what you want out of it. At least with C there are probably several people here that could answer questions for you. With anything else, your support resources will be very slim.


Otherwise there's NESMaker, but I haven't used it personally, and I don't know what your goals are, so I can't tell you whether that's worth $36 to you. The built-in stuff may or may not do what you need, but customizing it definitely requires assembly.


My honest advice is that the best thing is just to learn a new language rather than try to force your ideas into one that doesn't have much support on this platform.
User avatar
koitsu
Posts: 4201
Joined: Sun Sep 19, 2004 9:28 pm
Location: A world gone mad

Re: Programming for The NES using anything other than ASM or

Post by koitsu »

Thread started 3 days ago that may give you some ideas: viewtopic.php?f=2&t=18425

If you don't want to learn assembly or C, then that's fine, your choices are basically the following, but with a major caveat that you have to accept:

1. Consider something like NESmaker (commercial), which will greatly help you get started and let you do some development without having to know the "deep innards",
2. CLISP is a possibility (see aforementioned link),
3. Family BASIC. I believe some emulators have support for this (virtual keyboard, etc.), but I don't know of very many people who have done anything with it. It's also partially in Japanese.

The major caveat you need to accept: debugging is almost certainly going to require that you learn 6502 assembly. With the exception of Nesicide (which is still very heavily WIP, and I think still just an IDE), you're going to use emulators that offer debuggers that only show you 6502 assembly, stepping through things instruction by instruction that can help you find your bug. There is no Visual Studio debugger or pdb for the NES. Otherwise, if you refuse to learn it, then your debugging efforts are going to be spent staring only at code and hope that it's a code-level problem and not something deeper.

I'm sorry to say but Python, Ruby, Go, etc. -- present-day trend-based languages -- are not a possible languages on this platform. The resources all of those require are too excessive for the platform. I'm aware of PyNES but it's obvious it requires the programmer to understand assembly. If these higher-level languages are a requirement for you (keyword: REQUIREMENT), or rephrased, *not* learning a new PL is a REQUIREMENT, then my advice would be to stop considering the NES -- really. Pause, step back, and ask yourself: why is it you want to develop on the NES? Do you like the visual aesthetic (an aesthetic that can be accomplished on other platforms, including present-day computers)? Do you want to program for it because it's the "trendy" thing? Do you want to do it because it's fun and are interested in learning something obscure and thus new to you? And if so, how dedicated are you to what you want to accomplish? These are important questions you should field when researching the limits of a system you want to develop for -- simply saying "I want to make a project on the NES", to me, is identical to me saying "I want to be an astronaut". Classic consoles are not systems which cater to (my words here, no offense intended) whimsical fantasy dreams of development models -- you must always remember the time period during which they were designed/engineered.

You may also want to take a gander at JoeGtake2's film, The New 8-Bit Heroes, which documents his adventures (and pains) of learning to program on the NES to make a game he came up with a kid. Or you might find some of his vlogs and what not (I forget where these are, Facebook? Youtube?) talking about the development process in general. He might read this thread and be able to chime in with advice/tips as well. :-)
User avatar
gravelstudios
Posts: 159
Joined: Mon Mar 13, 2017 5:21 pm
Contact:

Re: Programming for The NES using anything other than ASM or

Post by gravelstudios »

For me, most of the pleasure I get from NES programming is learning to do things in assembly, and working within and around the hardware's limitations. If you're a programmer in another language, then learning assembly probably won't be that hard for you. if you are not a programmer at all, then maybe a tool like NESmaker is the right option for you (I've never used it myself, but I think it looks good).
Pokun
Posts: 2681
Joined: Tue May 28, 2013 5:49 am
Location: Hokkaido, Japan

Re: Programming for The NES using anything other than ASM or

Post by Pokun »

koitsu wrote: 3. Family BASIC. I believe some emulators have support for this (virtual keyboard, etc.), but I don't know of very many people who have done anything with it. It's also partially in Japanese.
BASIC mode has no Japanese. Also the manuals has been translated for years (look here). Family BASIC is probably the easiest way to program your NES and see what it can do. Many of us started here, including some developers of commercial games back in the day, and I think Koji Kondo used it as a tool to compose music for games with. The biggest limitation is probably that it uses CHR-ROM (instead of CHR-RAM), which means you are stuck with Mario, Lady and other the characters in the ROM. There are hacks with CHR-RAM though.
User avatar
koitsu
Posts: 4201
Joined: Sun Sep 19, 2004 9:28 pm
Location: A world gone mad

Re: Programming for The NES using anything other than ASM or

Post by koitsu »

Pokun wrote:BASIC mode has no Japanese.
Right. (Additional evidence). It's clearly katakana, but the point stands. If it's been translated, awesome.
Pokun
Posts: 2681
Joined: Tue May 28, 2013 5:49 am
Location: Hokkaido, Japan

Re: Programming for The NES using anything other than ASM or

Post by Pokun »

That's the "talk-to-the-computer-mode", not what I call the BASIC mode. You can quickly get to BASIC mode by holding the T key while resetting (V2.0 and up).
If you have V3 (which I recommend) you only have BASIC mode and the only Japanese in that ROM is some text in the built-in sample games. The V3 manual isn't fully translated but the basic operations and the reference pages for the new commands are.

I translated it years ago when I was still quite new to Japanese, and the English is maybe a bit strange as well, but I don't think it contains any real mistakes and it should be fully usable to learn Family BASIC with. Maybe I will proof-read and update the translation one day.
User avatar
nin-kuuku
Posts: 67
Joined: Tue Jan 24, 2017 1:23 am

Re: Programming for The NES using anything other than ASM or

Post by nin-kuuku »

Starting a NES project without ASM is like starting a band without learning how to play any instruments. ASM is not hard. I figured it out in a week (for GameBoy but 6502 is also easy).
User avatar
Bregalad
Posts: 8056
Joined: Fri Nov 12, 2004 2:49 pm
Location: Divonne-les-bains, France

Re: Programming for The NES using anything other than ASM or

Post by Bregalad »

No matter what you do, you WILL need assembly for the most time-critical parts of your engine, such as the VBLank/NMI routine and possibly scanline IRQ routines if you use such a feature, and probably the music driver.

As for languages potentially suitable for progamming the NES other than assembly and C, I made a comprehensive list in this post. I hope it's helpful.
User avatar
tokumaru
Posts: 12427
Joined: Sat Feb 12, 2005 9:43 pm
Location: Rio de Janeiro - Brazil

Re: Programming for The NES using anything other than ASM or

Post by tokumaru »

Unless you use someone else's library/framework that abstracts the low level stuff. Atari 2600 folks have batari Basic, for example, that allows them to code entire games in a Basic-like language, without ever dealing with assembly. The low level stuff (display kernels, the part where you have to "race the beam") has been completely abstracted, in favor of a few pre-defined configurations, which are not incredibly versatile but can still provide visuals for a great variety of game styles.

I don't see why something similar to batari Basic can't be made for the NES, where the low level PPU stuff is abstracted with a more generic model of backgrounds and sprites, along with a simpler language to control the game logic. Of course it would be more restrictive than pure assembly, but for most beginners that are not looking into breaking the system's limits, that'd be more than enough.
Pokun
Posts: 2681
Joined: Tue May 28, 2013 5:49 am
Location: Hokkaido, Japan

Re: Programming for The NES using anything other than ASM or

Post by Pokun »

How is what you describe any different from Family BASIC? It was made in 1984 by Hudson and Nintendo, and works on flashcarts and emulators alike. It has no restrictions except for the hardware interface it comes with. The language is like normal Dartmouth BASIC with NES-specific commands for sprites, palettes and such, and an MML designed for the APU. Many things that's not supported by commands, like scrolling for instance, can be done by POKEing hardware registers or by CALLing 6502 machine language subroutines.

An open-source and compatible version of Family BASIC V3 with CHR-RAM and more WRAM, would be pretty cool though.


Edit: Oh I see, Batari BASIC is a cross-compiler, so you are talking about a BASIC cross-compiler for NES? That would be pretty cool too.
User avatar
gauauu
Posts: 779
Joined: Sat Jan 09, 2016 9:21 pm
Location: Central Illinois, USA
Contact:

Re: Programming for The NES using anything other than ASM or

Post by gauauu »

tokumaru wrote:Unless you use someone else's library/framework that abstracts the low level stuff. Atari 2600 folks have batari Basic, for example, that allows them to code entire games in a Basic-like language, without ever dealing with assembly. The low level stuff (display kernels, the part where you have to "race the beam") has been completely abstracted, in favor of a few pre-defined configurations, which are not incredibly versatile but can still provide visuals for a great variety of game styles.

I don't see why something similar to batari Basic can't be made for the NES, where the low level PPU stuff is abstracted with a more generic model of backgrounds and sprites, along with a simpler language to control the game logic. Of course it would be more restrictive than pure assembly, but for most beginners that are not looking into breaking the system's limits, that'd be more than enough.
I think both NESMaker and Nova's new micrograme creation project follow this model somewhat. Provide tools for making the game, abstracting away the difficult parts, and using stock framework for the core of the game.

That said, I think Nova's project has a lot more potential. With NESMaker, you can turn a lot of knobs, but if you want to actually program any logic, you're stuck going back to assembly (if I understand correctly? I haven't used it). With Nova's project, you can actually define your own logic for your actors, which really adds a lot more freedom in making a new game.
User avatar
tokumaru
Posts: 12427
Joined: Sat Feb 12, 2005 9:43 pm
Location: Rio de Janeiro - Brazil

Re: Programming for The NES using anything other than ASM or

Post by tokumaru »

With NESMaker I think you're too restricted by the available game engines unless you're good with assembly. NovaSquirrel's project on the other hand does sound like something that makes it easier to code custom game logic.
na_th_an
Posts: 558
Joined: Mon May 27, 2013 9:40 am

Re: Programming for The NES using anything other than ASM or

Post by na_th_an »

This is my experience: I code my games in C, using neslib. When I got to create my first game for the NES, I was proficient coding games for other platforms, so when I found neslib all I had to do is learn some hardware specifics and soon had my game going. As I coded more and more games, I began undestanding the inner workings of the NES more in depth, began fiddling with assembly by modifying neslib first, then rewrite very simple routines. I've reached a point where I can read and write 6502 with ease and that helps me punching in my own code when the compiler is not behaving the way I'd like. Once you learn how the compiler outputs the code, you first write your code in the way you know the compiler will produce the best results - that's the first step, then you start replacing sections for your own hand-written assembly.

This way my learning curve has been quite manageable, I have produced quite a number of games in the meanwhile, and have learned lots.

So in case you already know C and have created games for 8 bits systems, getting neslib to do your first simple game is a good idea.
Post Reply