Is there any way to compile a NES rom without ASM?

Discuss technical or other issues relating to programming the Nintendo Entertainment System, Famicom, or compatible systems.

Moderator: Moderators

Post Reply
User avatar
Marscaleb
Posts: 222
Joined: Fri Sep 11, 2015 10:39 am
Contact:

Is there any way to compile a NES rom without ASM?

Post by Marscaleb »

I just had a stray thought.
Is it possible to create a new NES rom without learning assembly to do it?

Well I suppose of course it is *technically* possible, but I mean with existing tools. Like, has anyone made a program that can create a new ROM from modern code or custom scripts or such thing?
User avatar
dougeff
Posts: 2875
Joined: Fri May 08, 2015 7:17 pm
Location: DIGDUG
Contact:

Re: Is there any way to compile a NES rom without ASM?

Post by dougeff »

Yes. I feel like my tutorial proves that. Cc65 can be done entirely in C code. And, you probably don't need to follow all the restrictions that I recommended.

Also recommended is Shiru's library, and/or thefox's library... also for cc65.
nesdoug.com -- blog/tutorial on programming for the NES
User avatar
rainwarrior
Posts: 8062
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

Re: Is there any way to compile a NES rom without ASM?

Post by rainwarrior »

There's a whole lot of past threads about C and the NES, and there's a lot of other ones about various other high level languages in use on the NES. Here's a couple off the top of my head:

Shiru's C tutorial: https://shiru.untergrund.net/articles/p ... s_in_c.htm

Python for the NES: http://gutomaia.net/pyNES/

There's also Family BASIC for the Famicom. Some people make things with that.
User avatar
DRW
Posts: 2070
Joined: Sat Sep 07, 2013 2:59 pm

Re: Is there any way to compile a NES rom without ASM?

Post by DRW »

Despite the fact that it's possible, I would still advice to do some stuff in Assembly, namely the initialization and NMI updates.
NMI because of the limited time frame during vblank.

Additionally, sprite updates (turning the meta sprites into the actual sprites data) might be good in Assembly as well, but not necessary since they are done during the regular game logic and not in NMI.

Likewise, some general purpose functions, like stuff akin to memcpy.

For the rest of the game logic, you can basically use C exclusively. (The compiler would be CC65.)

And don't let anybody tell you that you will only be able to do very simple games with C because of the speed.
I did a jump 'n' run sidescrolling platformer, i.e. a game where the movement functions are a bit more complicated than a simple

Code: Select all

if (ButtonUpIsPressed()
 && !LevelIsWall(X, Y - 1))
{
    --Y;
}
And I still have tons of time between two vblanks, so that I could extend my game logic with all kinds of stuff and still wouldn't encounter a slowdown.
Last edited by DRW on Wed Jul 27, 2016 4:25 am, edited 1 time in total.
Available now: My game "City Trouble".
Website: https://megacatstudios.com/products/city-trouble
Trailer: https://youtu.be/IYXpP59qSxA
Gameplay: https://youtu.be/Eee0yurkIW4
German Retro Gamer article: http://i67.tinypic.com/345o108.jpg
na_th_an
Posts: 558
Joined: Mon May 27, 2013 9:40 am

Re: Is there any way to compile a NES rom without ASM?

Post by na_th_an »

I've made several side scrolling platformers in C (yet to be finished and published, but hey!). You can make great games if you know what you are doing.

Knowing some assembly, or at least being able to read it and alter some bits is quite useful. If you use Shiru's neslib all the "dirty work" is done for you, but if you know how to tweat it a bit further to meet your requirements, all you have to do is win :)
User avatar
Bregalad
Posts: 8036
Joined: Fri Nov 12, 2004 2:49 pm
Location: Caen, France

Re: Is there any way to compile a NES rom without ASM?

Post by Bregalad »

I wrote a detailed post about which high-level alternatives exists for 6502 development. (No, CC65 is not the only option). Probably some further options are missing from my post.

Unfortuantely I didn't try to do anything "deep" in any of those solutions, so I cannot tell you my opinion on them and how realistic they would be to write a full game. Many of them will still require some assembly for, say, interrupt routines and PPU updates, maybe the sound engine, raster effects, things like that.

This particular post doesn't mention back then didn't include UCSD pacal and it's p-code, which were very popular back when the NES was a contemporary platform. It got a GNU compatible clone in between, and I made a whole thread to discuss the matter.

Again, I never developed actual code (other than simple hellos) with any of those tools but I wouldn't underestimate non-C solutions.
User avatar
Marscaleb
Posts: 222
Joined: Fri Sep 11, 2015 10:39 am
Contact:

Re: Is there any way to compile a NES rom without ASM?

Post by Marscaleb »

I'm... honestly surprised at this. I thought that *maybe* someone might have something that is enough for a proof-of-concept but with no weight behind it.
User avatar
DRW
Posts: 2070
Joined: Sat Sep 07, 2013 2:59 pm

Re: Is there any way to compile a NES rom without ASM?

Post by DRW »

Marscaleb wrote:I thought that *maybe* someone might have something that is enough for a proof-of-concept but with no weight behind it.
Huh? I don't really understand what you mean with this statement.
Available now: My game "City Trouble".
Website: https://megacatstudios.com/products/city-trouble
Trailer: https://youtu.be/IYXpP59qSxA
Gameplay: https://youtu.be/Eee0yurkIW4
German Retro Gamer article: http://i67.tinypic.com/345o108.jpg
User avatar
Myask
Posts: 965
Joined: Sat Jul 12, 2014 3:04 pm

Re: Is there any way to compile a NES rom without ASM?

Post by Myask »

Technically, you can't compile a NES ROM with only assembly.
Also technically, one can create a NES ROM with a hex-editor without knowing assembly, as one is working in machine code, not assembly mnemonics…but lower-level was not the direction you were interested in, it seems.
User avatar
rainwarrior
Posts: 8062
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

Re: Is there any way to compile a NES rom without ASM?

Post by rainwarrior »

Marscaleb wrote:I'm... honestly surprised at this. I thought that *maybe* someone might have something that is enough for a proof-of-concept but with no weight behind it.
Shiru in particular has released a number of good quality games made in C: https://shiru.untergrund.net/software.shtml#nes

His Alter Ego port is probably the best of the bunch, and it's even open source.

I think that goes well beyond "proof of concept".
na_th_an
Posts: 558
Joined: Mon May 27, 2013 9:40 am

Re: Is there any way to compile a NES rom without ASM?

Post by na_th_an »

All our NES games are coded in C (cc65+neslib+famitone2). We have released a number of them. They show us learning how to do things properly, but you can peek at the sources. The games are Sir Ababol (although we have recoded this game from scratch and it's yet to be released you can play the buggy original), Sgt. Helmet: Training Day, Jet Paco and Yun.

Our latest game (almost finished) takes part in this year's compo:
viewtopic.php?f=32&t=14589

Short video showing the first level:
viewtopic.php?f=32&t=14589
freetress
Posts: 1
Joined: Thu Nov 10, 2016 2:35 am

Re: Is there any way to compile a NES rom without ASM?

Post by freetress »

Interesting form :)
slobu
Posts: 275
Joined: Tue Jul 12, 2011 10:58 am

Re: Is there any way to compile a NES rom without ASM?

Post by slobu »

There is nbasic by Bob Rost:
http://bobrost.com/nes/resources.php

Also Aatlan:
http://atalan.kutululu.org/

I'd honestly wait until Joe Granato releases his game maker for NES.
http://www.thenew8bitheroes.com/
Post Reply