Programming the NES with a high level programming language

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

Moderator: Moderators

Post Reply
User avatar
Secamline
Posts: 44
Joined: Sat Aug 15, 2020 4:25 pm

Programming the NES with a high level programming language

Post by Secamline » Wed Nov 18, 2020 5:07 am

Hi everyone!

A few years ago, I read a blog from a former developer working at Color Dreams in the late 80s/early 90s. Unfortunately I can't find his website anymore, but I remember he mentioned the fact that they used a custom programming language similar to BASIC to write their games. This seems quite astonishing to me. Writing an NES game in C seems reasonable, but in BASIC? I assume they made simple engine in assembly, while the game logic was written in that other language but I'm not sure.

I'd like to know if other companies also used proprietary languages or other high level languages to make their game?
Thanks!

nocash
Posts: 1291
Joined: Fri Feb 24, 2012 12:09 pm
Contact:

Re: Programming the NES with a high level programming language

Post by nocash » Wed Nov 18, 2020 8:21 am

C is the same as BASIC, with the english keywords replaced by punctuation marks (back then - after the 8bit era - those punctuation marks were considered to be refreshing, cool, funny, and more much innovative than BASIC keywords).

Historically, BASIC was often implemented as Interpreter language. I guess that is what you wanted to say? Which, yes, many games were using Interpreter languages (no matter if they were inspired on BASIC, C, Pascal, Forth, or whatever).
Last edited by nocash on Wed Nov 18, 2020 10:11 am, edited 1 time in total.
homepage - patreon - you can think of a bit as a bottle that is either half full or half empty

Pokun
Posts: 1688
Joined: Tue May 28, 2013 5:49 am
Location: Hokkaido, Japan

Re: Programming the NES with a high level programming language

Post by Pokun » Wed Nov 18, 2020 10:04 am

Family BASIC was probably used for testing or simple prototyping by some developers.
The guys at Game Freak supposedly used it to learn with and possibly made their own tools using the Family BASIC hardware and homemade EPROM cartridges, made from cheap games.
I think some composers like Koji Kondo used Family BASIC's MML a lot to hear how the music sounds directly on the hardware. Others used a computer such as an MSX, which has a somewhat similar sound chip, to compose on.

User avatar
Secamline
Posts: 44
Joined: Sat Aug 15, 2020 4:25 pm

Re: Programming the NES with a high level programming language

Post by Secamline » Wed Nov 18, 2020 11:23 am

nocash wrote:
Wed Nov 18, 2020 8:21 am
C is the same as BASIC, with the english keywords replaced by punctuation marks (back then - after the 8bit era - those punctuation marks were considered to be refreshing, cool, funny, and more much innovative than BASIC keywords).

Historically, BASIC was often implemented as Interpreter language. I guess that is what you wanted to say? Which, yes, many games were using Interpreter languages (no matter if they were inspired on BASIC, C, Pascal, Forth, or whatever).
I wasn't referring to interpreted BASIC, but rather to BASIC code compiled into 6502 assembly code. I can't see the similarity between C and BASIC though.
Pokun wrote:
Wed Nov 18, 2020 10:04 am
Family BASIC was probably used for testing or simple prototyping by some developers.
The guys at Game Freak supposedly used it to learn with and possibly made their own tools using the Family BASIC hardware and homemade EPROM cartridges, made from cheap games.
I think some composers like Koji Kondo used Family BASIC's MML a lot to hear how the music sounds directly on the hardware. Others used a computer such as an MSX, which has a somewhat similar sound chip, to compose on.
Nice, I didn't know that!

lidnariq
Posts: 10067
Joined: Sun Apr 13, 2008 11:12 am
Location: Seattle

Re: Programming the NES with a high level programming language

Post by lidnariq » Wed Nov 18, 2020 12:03 pm

Many many years ago, I found a compiler for a BASIC-like language. https://en.wikipedia.org/wiki/ASIC_programming_language

A lot - but not all - of BASIC's operations can be mapped tidily to 6502 instructions.

nocash
Posts: 1291
Joined: Fri Feb 24, 2012 12:09 pm
Contact:

Re: Programming the NES with a high level programming language

Post by nocash » Wed Nov 18, 2020 3:38 pm

Secamline wrote:
Wed Nov 18, 2020 11:23 am
I can't see the similarity between C and BASIC though.
For, if, else, while, return? Or asking the other way around: Can you see any differences between C and BASIC?
homepage - patreon - you can think of a bit as a bottle that is either half full or half empty

tepples
Posts: 22220
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: Programming the NES with a high level programming language

Post by tepples » Wed Nov 18, 2020 3:51 pm

Old BASIC from the line number era didn't have anything like a C struct. This encouraged developers to use the structure-of-arrays memory paradigm, storing each property of an entity in a separate array indexed by the entity's ID within a pool. You might notice that's exactly the memory layout that 6502 prefers. Nor did old BASIC have automatic local variables. Instead, variables were global, which corresponds well to zero page variables on a 6502, and recursion was poorly supported if at all.

QBasic had TYPE, a direct counterpart to C struct, as well as local variables. This and other QuickBASIC/QBasic concepts made their way into Visual Basic. In fact, Visual Basic version 7 rebooted the language to become C# with different syntax, even though VB6 diehards called VB7 "Visual Fred" for resembling VB6 allegedly less than Python 3 resembles Python 2.

User avatar
Gilbert
Posts: 430
Joined: Sun Dec 12, 2010 10:27 pm
Location: Hong Kong
Contact:

Re: Programming the NES with a high level programming language

Post by Gilbert » Wed Nov 18, 2020 6:18 pm

Hudson Soft had developed a high level scripting system called iv that was used by a large number of games on their console PC-Engine, especially the CD RPG games which were less speed critical.
I don't know whether this is true, but it is possible that a number of their late Famicom releases also used similar system, as they practically used the same tool chains to develop on the two systems.

(Also, they developed Family Basic.)

Oziphantom
Posts: 1014
Joined: Tue Feb 07, 2017 2:03 am

Re: Programming the NES with a high level programming language

Post by Oziphantom » Wed Nov 18, 2020 8:27 pm

There are lots of high level programming languages from that era. How similar to BASIC depends on "how you define BASIC". COMAL, COBAL, FORTRAN, PASCAL, LISP, FORTH, ADA et cetera
There are even a few modern HLL 6502s which range from "syntax sugar" to "complete language compiler"

The Kemco strategy games used some HLL and a byte code runtime as well. search this forum for details.

Basically in most games you end up making a Scripting language of some form, guess they just took it one step further.

It would be interesting to dissasemble some of their games and see if there is a common runtime of it was fully compiled.

tepples
Posts: 22220
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: Programming the NES with a high level programming language

Post by tepples » Wed Nov 18, 2020 8:54 pm

Kemco too? I thought it was just Koei.

See topic: Koei bytecode

Oziphantom
Posts: 1014
Joined: Tue Feb 07, 2017 2:03 am

Re: Programming the NES with a high level programming language

Post by Oziphantom » Wed Nov 18, 2020 9:07 pm

No Koei not Kemco, thanks. Not sure why I get those two mixed up, vastly different game libraries.

Post Reply