uc65, a Mid-Level Language Compiler READY FOR USE!

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

Moderator: Moderators

Post Reply
User avatar
qbradq
Posts: 951
Joined: Wed Oct 15, 2008 11:50 am

Re: uc65, a Mid-Level Language Compiler READY FOR USE!

Post by qbradq » Sat Nov 16, 2013 11:18 am

I also looked at NESHLA prior to starting this project. It's a big reason that documentation is the first listed feature, and is this first step in feature development. Nothing in uc65 was developed prior to being documented. The source code also contains complete JavaDoc documentation of all methods to help anyone that wants to contribute.

I do understand the skepticism. I think it's very well deserved. I'll be making open source demos and a game based on the compiler to help demonstrate its usefulness, and I hope interested community members will do the same.

darkhog
Posts: 192
Joined: Tue Jun 28, 2011 2:39 pm

Re: uc65, a Mid-Level Language Compiler READY FOR USE!

Post by darkhog » Sat Nov 16, 2013 11:57 am

Well, I'm not sceptic at all, I only questioned why you didn't revive some old "high level" project that showed promise but was abandoned :).

Sorry if you took it this way. Anyway, once I'll learn nes assembly well enough (for now I'm just playing around with NESICIDE's Hello World example/template), I'll learn this one as it is promising (though probably still some assembly will be required, pardon a pun, so it's better I'll learn asm first).

User avatar
qbradq
Posts: 951
Joined: Wed Oct 15, 2008 11:50 am

Re: uc65, a Mid-Level Language Compiler READY FOR USE!

Post by qbradq » Sat Nov 16, 2013 12:55 pm

LOL, I like that line, "Some assembly required". I may make that the moto for the language :) in general you can do anything in uc65 that you could in assembly, but one of the goals for uc65 was to inter-operate very well with inline assembly.

Just as an FYI, I noticed that the JAR I uploaded does not have the import directory and auto-deps features mentioned above due to a versioning mishap. I've merged the other changes back into trunk so nothing has been lost, but it's not in a state right now I can make another RC release as I'm working on a few features that I've realized are needed now that I've started on the example demo.

The import statement is however still usable.

darkhog
Posts: 192
Joined: Tue Jun 28, 2011 2:39 pm

Re: uc65, a Mid-Level Language Compiler READY FOR USE!

Post by darkhog » Sat Nov 16, 2013 2:44 pm

qbradq wrote:LOL, I like that line, "Some assembly required". I may make that the moto for the language :) in general you can do anything in uc65 that you could in assembly, but one of the goals for uc65 was to inter-operate very well with inline assembly.
Be my guest :D.
qbradq wrote:Just as an FYI, I noticed that the JAR I uploaded does not have the import directory and auto-deps features mentioned above due to a versioning mishap. I've merged the other changes back into trunk so nothing has been lost, but it's not in a state right now I can make another RC release as I'm working on a few features that I've realized are needed now that I've started on the example demo.

The import statement is however still usable.
Nice. Anyway, could you make some changes to the syntax so it won't look like BASIC so much? Perhaps use Pascal-like syntax (with declaring variables in runtime instead of var section)? This is purely cosmetic change that would help people who feel aversion to BASIC (I don't, made share of VBA, VB and FreeBASIC code and it was clean - though I admit it is easy to make spaghetti code if you don't know what you are doing and are fan of On Error Resume Next. I guess that's the price for entry-level language) be more at home with uc65. Though as this has subjective nature, feel free to ignore this suggestion if you wish.

User avatar
qbradq
Posts: 951
Joined: Wed Oct 15, 2008 11:50 am

Re: uc65, a Mid-Level Language Compiler READY FOR USE!

Post by qbradq » Sat Nov 16, 2013 5:02 pm

Variables do not have to be declared in any specific section. Global variables may be declared anywhere outside of a subroutine or other block statement such as a type definition. Local variables may be declared at any point in a subroutine and will have non-lexical scope.

Can you help me understand where you got the impression that you had to have your variable declerations in a certain position in the source code? This understanding could help me make this more clear for other users.

Thank you for the input!

User avatar
qbradq
Posts: 951
Joined: Wed Oct 15, 2008 11:50 am

Re: uc65, a Mid-Level Language Compiler READY FOR USE!

Post by qbradq » Sat Nov 16, 2013 10:08 pm

Due to critical defects with no work-arounds the current release candidate has been retracted. I have them patched but am working on final testing. Expect a new release to be available within 24 hours.

User avatar
Bregalad
Posts: 7890
Joined: Fri Nov 12, 2004 2:49 pm
Location: Chexbres, VD, Switzerland

Re: uc65, a Mid-Level Language Compiler READY FOR USE!

Post by Bregalad » Sun Nov 17, 2013 4:08 am

I only questioned why you didn't revive some old "high level" project that showed promise but was abandoned :).
I dont understand your critism. You are criticizing dbraq to do something from scratch instad of reviving some old rotten failed project that was never proven any useful in the first place. How is this any constructive ? The goals and rationale behind uc65 as far I can tell are completely different, and making it from scratch was probably a better solution else he would have chosen otherwise.
Anyway, could you make some changes to the syntax so it won't look like BASIC so much? Perhaps use Pascal-like syntax (with declaring variables in runtime instead of var section)? This is purely cosmetic change that would help people who feel aversion. This is purely cosmetic change that would help people who feel aversion to BASIC [...]
Seriously what does this mean ? You want to make him changes to the syntax just because you don't like BASIC ? Why not let him choose his favourite syntax since he's the guy behind the language ?
Over the years I learnt that syntax really doesn't matter much in programming, is more about how you understand the scementics behind it.

I think that instead of doing foolish suggetions that are completely out placed you'd rather stay on subject.
I just asked a comparison with ATALAN because both seems to follow the same goal : Mid level languages to target specifically 6502 processors (and work around the problems that implementing C in 6502 is).

User avatar
qbradq
Posts: 951
Joined: Wed Oct 15, 2008 11:50 am

Re: uc65, a Mid-Level Language Compiler READY FOR USE!

Post by qbradq » Sun Nov 17, 2013 7:41 pm

Uploaded new build, Release Candidate 3, which fixed the afore-mentioned critical defects. I've also added two features that were found to be needed for practical development: binary file inclusion and compiler command-line constant definitions. Both features are well documented in the user guide.

darkhog
Posts: 192
Joined: Tue Jun 28, 2011 2:39 pm

Re: uc65, a Mid-Level Language Compiler READY FOR USE!

Post by darkhog » Sun Nov 17, 2013 9:25 pm

Bregalad wrote:Seriously what does this mean ? You want to make him changes to the syntax just because you don't like BASIC ?
You misunderstood me. *I* like BASIC, written many code in that language, as previously stated. Most programmers I know, however, hate this and would be put off by basic-like syntax if I'd show them uc65.

Also you jumped the gun with that post. If you'd read last sentence, you'd see:
Though as this has subjective nature, feel free to ignore this suggestion if you wish.

User avatar
qbradq
Posts: 951
Joined: Wed Oct 15, 2008 11:50 am

Re: uc65, a Mid-Level Language Compiler READY FOR USE!

Post by qbradq » Mon Nov 18, 2013 7:24 am

Honestly I had considered using a more C-like syntax. Considered is too soft a word. The first draft of the user manual had the syntax of C :) But in the end I chose to base it on the BASIC syntax to avoid some confusion. I felt that if the language had the syntax of C people would get confused when some of the most basic functionality of C was unavailable. Couple that with targeting a compiler suite that already has a C compiler, and things get very complicated very quickly.

Please understand that I am open to feature requests. My goal right now is to get this thing useful and stable prior to the NESDev 2014 competition so that I and other community members can use it for their entries. If there's a feature missing that would make this more useful for you, please let me know!

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

Re: uc65, a Mid-Level Language Compiler READY FOR USE!

Post by slobu » Mon Nov 25, 2013 10:08 am

qbradq wrote:Honestly I had considered using a more C-like syntax. Considered is too soft a word. The first draft of the user manual had the syntax of C :) But in the end I chose to base it on the BASIC syntax to avoid some confusion. I felt that if the language had the syntax of C people would get confused when some of the most basic functionality of C was unavailable. Couple that with targeting a compiler suite that already has a C compiler, and things get very complicated very quickly.

Please understand that I am open to feature requests. My goal right now is to get this thing useful and stable prior to the NESDev 2014 competition so that I and other community members can use it for their entries. If there's a feature missing that would make this more useful for you, please let me know!
I really, REALLY appreciate this move. Anything that lets me focus on creation instead of syntax is a godsend.

What kind of boards should I order from infinitelives to put games made in this onto a real cart?

User avatar
qbradq
Posts: 951
Joined: Wed Oct 15, 2008 11:50 am

Re: uc65, a Mid-Level Language Compiler READY FOR USE!

Post by qbradq » Mon Nov 25, 2013 2:32 pm

Slobu,

Great to see interest in the compiler! I have provided memory configurations for NROM and MMC3, but if you know your way around ca65 (and that is recommended as uc65 targets this toolchain) then you can target any mapper you want. My personal choice was to get an MMC3 board with 32KB CHR-RAM and 512KB PRG-ROM Flash pre-assembled. I think this is the most versatile of the mapper choices provided with the board.

If you dislike CHR-RAM you can choose a CHR-ROM option. I highly recommend the pre-assembled Flash versions in either case.

INL's boards have several mapper options. As of this post you can order Color Dreams (#11), MMC1, MMC3 or FME7. FME7 is a more capable mapper than MMC3 on paper, but I just prefer MMC3's scan-line counter interrupt over FME7's CPU cycle counter interrupt.

As I said, with a little tinkering you can make the compiler target any of these mappers. And if that's a bit over your head, just let me know what mapper you want to target and I'll create the mapper support for it. Just remember that you'll still have to understand the behavior of the mapper and use it correctly in your code.

Thanks!

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

Re: uc65, a Mid-Level Language Compiler READY FOR USE!

Post by slobu » Mon Nov 25, 2013 4:09 pm

I guess it also depends on what the first example game is going to be. Most experience newbies (ha!) start by hacking the provided examples and work there way towards original code.

I assume the first example would be something like scrolling a happy face around a single screen? Or maybe something a little more grand like a side-scrolling level? In that case all that's needed is MMC1.. right? *shrugs*

User avatar
qbradq
Posts: 951
Joined: Wed Oct 15, 2008 11:50 am

Re: uc65, a Mid-Level Language Compiler READY FOR USE!

Post by qbradq » Mon Nov 25, 2013 5:19 pm

The mapper does not maketh the game. See Super Mario Brothers, implemented with no mapper at all. It's got 32 levels of side-scrolling awesome :) Castlevania and Mega Man 1 and 2 were implemented with UxROM, which has nothing special in it at all. Just one PRG bank and CHR-RAM.

The first example shows a star field with a sprite-based cursor that can be moved around the screen with the controller. This uses the MMC3 mapper for no other reason than it was the only dev cart I had at the time :) You can find it in the exampes/nes/simple directory in the zip file. The next example is supposed to be some sort of variation on Conway's Game of Life, will target NROM and may end up being my compo entry if I can't get some better inspiration :)

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

Re: uc65, a Mid-Level Language Compiler READY FOR USE!

Post by lidnariq » Mon Nov 25, 2013 5:26 pm

qbradq wrote:As of this post you can order Color Dreams (#11)
To be fair, he says he can make any of the discrete mappers. He's just only had demand so far for the color dreams board. And there's only 50¢ difference between what he charges for the MMC1 and discrete logic reproductions.
slobu wrote:I assume the first example would be something like scrolling a happy face around a single screen? Or maybe something a little more grand like a side-scrolling level? In that case all that's needed is MMC1.. right? *shrugs*
Remember that SMB1 and all of Shiru's homebrews were plain NROM. It's not that mappers are a difficult concept (they're not), but they are largely irrelevant to the first 3/4 of "learning how to program for the NES"

Post Reply