Burn: making .nes rom file from Ruby

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

Moderator: Moderators

Post Reply
remore
Posts: 2
Joined: Thu Apr 03, 2014 9:44 am

Burn: making .nes rom file from Ruby

Post by remore »

Let me please introduce my hobby project, which make .nes application from Ruby.

Burn is a toolkit to create .nes executables. Internally Burn translate Ruby DSL into C source code to make use of cc65.

Kindly visit project page for more detail: https://github.com/remore/burn

Burn is now version 0.1.3 which means still under development, so you might find some bugs or potential problem. Any feedbacks including minor bug report from homebrewers like you is highly appreciated.

Note that burn is designed for entry level 8-bit application developer as well. I'm quite not sure if you like it or not.
lidnariq
Posts: 10677
Joined: Sun Apr 13, 2008 11:12 am
Location: Seattle

Re: Burn: making .nes rom file from Ruby

Post by lidnariq »

A few things you might like to know:

The 6502 is particularly poorly designed for pointer arithmetic, beyond the very specific cases that look like char * const thing; thing[byte] and char ** const thing; thing[byte][0]. As a result, parameter passing on the stack is kinda problematic. CC65 does, at least, provide the optimization flag to not allocate local variables on the stack (and instead allocate them permanently).

A few people around here on the forum have specifically written languages or language extensions that attempt to play to the 6502's strengths, while discouraging programming patterns that don't compile efficiently: qbradq's uc65 and Movax12's ca65hl.

I would be skeptical that any arbitrary new emulator would be particularly accurate: I pulled the jsnes repository and ran it against cpow's very useful archive of NES test roms: it fails most of them. Developing against inaccurate emulators produces programs that won't run on the actual hardware. Some of the tests even cause both firefox and chromium to lock up.

I recommend nestopia, nintendulator, punes, and/or bizhawk for accuracy.
User avatar
Movax12
Posts: 529
Joined: Sun Jan 02, 2011 11:50 am

Re: Burn: making .nes rom file from Ruby

Post by Movax12 »

I scanned over some examples that seemed really cool, but I wouldn't expect the machine code to be very well optimized. Maybe good enough for some simple tasks, but a complex game would be difficult. This idea reminded me of: http://ahefner.livejournal.com/20528.html especially the music code/data.
remore
Posts: 2
Joined: Thu Apr 03, 2014 9:44 am

Re: Burn: making .nes rom file from Ruby

Post by remore »

lidnariq wrote:Developing against inaccurate emulators produces programs that won't run on the actual hardware. Some of the tests even cause both firefox and chromium to lock up.

I recommend nestopia, nintendulator, punes, and/or bizhawk for accuracy.
I was not aware of this at all, thank you so much for kind advice. Totally agreed, sounds like better to choose much accurate one.
Movax12 wrote:I scanned over some examples that seemed really cool, but I wouldn't expect the machine code to be very well optimized. Maybe good enough for some simple tasks, but a complex game would be difficult.
So true as of now, I'm also not content with those incapability. Thanks for your feedback, I will try to improve them in near future.
slobu
Posts: 275
Joined: Tue Jul 12, 2011 10:58 am

Re: Burn: making .nes rom file from Ruby

Post by slobu »

I'm definitely interested in "higher level" languages for NES development. I got as far as installing Ruby 1.9.3 and compiling the main.nes (which failed to run properly in the emulator.)

I'll keep an eye out for new releases and try again. As a side your audience is probably going to be mostly using Windows.
Post Reply