It is currently Sat Oct 21, 2017 4:18 pm

All times are UTC - 7 hours





Post new topic Reply to topic  [ 62 posts ]  Go to page Previous  1, 2, 3, 4, 5  Next

What assembler would you recommend to a new NES developer?
Poll ended at Tue Jun 07, 2016 12:47 am
ASM6 49%  49%  [ 19 ]
CA65 36%  36%  [ 14 ]
MagicKit 3%  3%  [ 1 ]
NBASIC 0%  0%  [ 0 ]
NESASM 10%  10%  [ 4 ]
NESHLA 0%  0%  [ 0 ]
WLA-DX 0%  0%  [ 0 ]
OTHER (Please leave comment) 3%  3%  [ 1 ]
Total votes : 39
Author Message
PostPosted: Wed Jun 01, 2016 11:11 am 
Offline
User avatar

Joined: Fri Nov 12, 2004 2:49 pm
Posts: 7233
Location: Chexbres, VD, Switzerland
@tokumaru : I was going to object when I suddenly noticed this was sarcasm... oh well. At least it was funny.


Top
 Profile  
 
PostPosted: Wed Jun 01, 2016 11:59 am 
Offline
User avatar

Joined: Mon Oct 01, 2012 3:47 pm
Posts: 152
Location: freemland (NTSC-U)
I'm going to quote a relevant section of the first post before I continue:

darryl.revok wrote:
This question is different for one specific reason: This question does not concern what you use. This question concerns what you would most recommend to someone just beginning NES development, and possibly programming in general.

The answer should reflect a weighing of features between options, as well as short-term learning curve vs. long-term ease of use.


Knowing this, I've chosen ASM6 based on the following assumptions (which may or may not be true in every situation):
  • The person in question has a small amount of experience with at least one higher level programming language and is willing to learn 6502 assembly language. (This leaves out the "beginning programming in general," for which I would not recommend NES development at all.)
  • The person in question doesn't want to fumble with linker scripts, but would like to be able to define a NES 2.0 header in case their project needs a non-standard configuration. (This second part removes standard NESASM, but may include NESASM from Unofficial MagicKit.)
  • The person in question isn't planning on moving towards consoles with similar CPUs (PC Engine/TG16, SNES/SFC). (If this is true, my answer changes to the cc65 suite, since default ASM6 isn't equipped to handle the 65816 or HuC6280.)

ASM6 pros
  • No fumbling with linker scripts. (uses .org $xxxx for defining sections)
  • Relatively simple program code. (program is a single C file, easily compiled)
  • Can program for any 6502 machine; not limited/targeted to NES.
  • Supports macros.
  • Supports both @localLabels and cheap nameless labels (+/-).
(Of course, a number of the poll options share some of these pros.)

ASM6 cons
  • Doesn't support using absolute zero page addresses $0000-$00FF without manually encoding the opcodes (ca65 uses e.g. a:$00FF for this; I've only really found this to be a problem when reverse engineering commercial ROMs though, so your opinion will vary if this is actually a con or not.)
  • Original version doesn't support any undocumented opcodes (I still need to make/test a patch for this) (not particularly a big deal, IMO, unless you really want to use them.)
  • The flip side of ASM6 being able to program for any 6502 machine: not many "unique" features for NES development (I personally don't see this as a con, but others might.)


Top
 Profile  
 
PostPosted: Wed Jun 01, 2016 12:16 pm 
Offline
User avatar

Joined: Sat Feb 16, 2013 11:52 am
Posts: 218
Anti-NESASMism is at an all-time high here. Yes let's scare total begginers with stuff unrelated to actual 6502 or NES programming.

Quote:
;
; NES 2.0 header generator for ca65 (nes2header.inc)
;
; Copyright 2016 Damian Yerrick
; Copying and distribution of this file, with or without
; modification, are permitted in any medium without royalty provided
; the copyright notice and this notice are preserved in all source
; code copies. This file is offered as-is, without any warranty.
;

;;
; Puts ceil(log2(sz / 64)) in logsz, which should be
; local to the calling macro. Used for NES 2 RAM sizes.


If you want new people to read two (3?) paragraphs of text and then give up CA65 is the best, but I'm not so sure about actually doing anything with it. You're all underestimating "NES development beginner". I still don't understand how to set up other assemblers, hell it might not even be as difficult as I think it is but it ceirtainly looks like it. Maybe someday I'll take some time to learn how to set them up but for now NESASM suits me well besides annoying silent cross page errors.

As said by our buddy here:
Banshaku wrote:
Any tool is good as long you can accomplish your goal.

_________________
This is a block of text that can be added to posts you make. There is a 255 character limit.


Top
 Profile  
 
PostPosted: Wed Jun 01, 2016 12:24 pm 
Offline
Formerly WheelInventor

Joined: Thu Apr 14, 2016 2:55 am
Posts: 908
Location: Gothenburg, Sweden
As a beginner, i'm more interested in interface and the amount of interfacing required. As such, ca65 is a bit much to chew, while asm6 seems pretty ideal. NESICIDE as a studio layer above ca65 might change my mind. 'Naked' ca65 could do with a better config library bundled with the distribution. I think qbasic for dos was a very good example of how to introduce programming. Everything you need is built into the interface of the editor. You can run, compile, debug and consult a very well written reference at the convenience of a key press, and there's nothing you need to set up before you've got your first program running.

I've tried nbasic a couple of years ago and didn't fall for it, but i can't remember the exact reasons.

I've used LAX a bit in hacks to help make room for new hooks, but that's it for unofficial opcodes. I don't view them as necessary otherwise. Nevertheless, i think assemblers should support them and make it the programmer's choice to use them or not.

_________________
http://www.frankengraphics.com - personal NES blog


Top
 Profile  
 
PostPosted: Wed Jun 01, 2016 1:15 pm 
Offline
User avatar

Joined: Fri Nov 12, 2004 2:49 pm
Posts: 7233
Location: Chexbres, VD, Switzerland
freem wrote:
I'm going to quote a relevant section of the first post before I continue:

darryl.revok wrote:
This question is different for one specific reason: This question does not concern what you use. This question concerns what you would most recommend to someone just beginning NES development, and possibly programming in general.

The answer should reflect a weighing of features between options, as well as short-term learning curve vs. long-term ease of use.


I've taken that quote in account. That is why I recommend ASM6 despite using WLA-DX myself. For several reasons I wouldn't recommand WLA-DX to the newcommer.

Your 3 ASM6 cons really doesn't sounds like cons at all for me. ASM6 might not support full-length access to ZP which could be bothering if you use indexed addressing to go past the ZP into the stack page, but honestly this case is *very* rare. However, assemblers which does require you to specify whether you are using ZP or not, such as NESASM and to a lesser extent WLA-DX, are a major annoyance.

@Tokumaru: In your NESASM apology you forgot to mention it is great to define variable location directly instead of having them assigned by the assembler, because this makes it easier to debug your code in FCEUX, and because array sizes never changes, period :)


Top
 Profile  
 
PostPosted: Wed Jun 01, 2016 2:08 pm 
Offline
User avatar

Joined: Sun Jan 22, 2012 12:03 pm
Posts: 5729
Location: Canada
I started with NESASM, myself, but only because I came in through bunnyboy's legendary tutorial. The tutorial itself has problems, and NESASM is probably the worst assembler I have ever used, but it did the job. :P

Similarly, I learned to program in BASIC many years ago. It's rather obsolete now, and there are a lot of drawbacks to it as a language, but it was available to me, and it worked, and I learned. I wouldn't recommend it to anybody at this point, but at the time there were great books, tutorials, and code listings in BASIC available to me. It's not really a "good" language, but it had fantastic learning resources.


If you ask me what I'd recommend for NES, I'll always say ca65. I've got little sympathy for complaints about header/cfg, because beginner templates for these are both trivial and readily available, and on top of that you've got people here on the line ready to help you with both those things any time you ask. This community is a bizarrely nice one in that respect; people rarely give you grief about asking a question that's been asked 100 times before, they usually just politely answer it for the 101st time.

But... it doesn't matter at all. NESASM is OK for beginners. So is ASM6. So is ca65. They're all good. If you learn one it's really not that hard to learn another. Pick the one that seems easy-- which probably means: use the one that has examples you want to learn from. NESASM is still the King of n00bs for this reason.


I do have an actual recommendation for beginners, but it has nothing to do with language: keep your goals very small as you begin. Don't expect to be able to make a Blaster Master with your first project. You have a lot of learning to do before you even get to Flappy Bird, or 2048.

Worry about which language to use when you're ready for something bigger.

...and worry about which language someone else will use for their project never. ;)


Top
 Profile  
 
PostPosted: Wed Jun 01, 2016 2:44 pm 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19115
Location: NE Indiana, USA (NTSC)
Punch wrote:
Quote:
[The license of a library file]

If you want new people to read two (3?) paragraphs of text and then give up CA65 is the best, but I'm not so sure about actually doing anything with it. You're all underestimating "NES development beginner".

The intent inherent in my vote for ca65 is that the beginner would download a project template for NROM, unzip it to a new folder, and start putting code in main.s. The project template would contain a bunch of library-type source code files for things like disabling IRQ sources and waiting 2 vblanks upon reset, but lesson 1 that just turns the screen green and beeps the speaker wouldn't need to explain the functionality and design rationale behind every line of code in each library file.

Quote:
As said by our buddy here:
Banshaku wrote:
Any tool is good as long you can accomplish your goal.

Then the question becomes one of what goals a beginner is likely to have for his or her first half dozen projects.

rainwarrior wrote:
This community is a bizarrely nice one in that respect; people rarely give you grief about asking a question that's been asked 100 times before, they usually just politely answer it for the 101st time.

Thank you. Perhaps it's that I see re-asked questions as a chance to find things that are missing, wrong, or poorly explained on the existing wiki pages.

Snapshot: At this point, it's 12 (44%) for ASM6, 10 (37%) for ca65, and 5 (19%) between NESASM and MagicKit.


Top
 Profile  
 
PostPosted: Wed Jun 01, 2016 4:18 pm 
Offline
User avatar

Joined: Sat Jul 25, 2015 1:22 pm
Posts: 501
Okay, I think I see where this poll is going. I'd like to add a time limit at this point, (another week or so) but I'm afraid adding a time limit may erase the current votes. Can anyone confirm or deny this?

I'll start a thread in the wiki board when I get ready to post a draft for the entire page, but for the time being, I'd like to get feedback on the assembler portion. The community is the authority on this so please post any suggestions/corrections/etc.

I would like to try to keep the terminology non-intimidating for a beginner. I'd also like to keep it objective, and I do feel that currently it has a hint of subjectivity that needs to be tweaked out. Also, concise is very important, but it also needs to give enough information to be useful. As this is likely one of the first sites a person will see when looking into NES development, I think that from beginning to end, it should explain any information contained within itself.

So before the assembler part, there's an introductory paragraph at least. I'll save those parts for another thread and keep this about assemblers, so let's assume at this point our reader:

1. Wants to develop for NES. (Really we don't know more specifically than that.)
2. Has been introduced to the idea that they are writing in assembly code for a processor called the 6502

Assembler:

The assembler is what will take your programmed code and create a ROM which you can play on a NES console or emulator. It translates assembly code into machine code, and formats your program in the way you define. There are various options for assemblers targetting the 6502 processor, but two main options recommended by the NESdev community:

1. ASM6 - According to a NESdev community poll, ASM6 is the most recommended assembler for a beginner. (http://forums.nesdev.com/viewtopic.php?f=2&t=14330) It is not lacking features required for the general workload of 6502 assembly programming. It is missing some more advanced features, which can be seen as a positive for beginners as it helps to keep the learning curve low. The way the language is programmed for ASM6 follows general accepted standards, and there is a large community of users for this assembler.

Download ASM6

2. CA65 - CA65 is a 6502 assembler included with the CC65 suite, and use of it permits the highest range of features. It is the second most recommended assembler for a beginner, by a narrow margin. For a non-programmer, it will have the highest learning curve, as you will have to learn to create a linker file from the start. It could be argued, however, that the practices associated with formatting your program with a linker file may be more easily maintained in the long run.

CA65 will allow for some options not available through other assemblers, such as integrating the C programming language into an NES program, and source level debugging. The methodology for working in CA65 will be the most familiar to those with experience in C, so prior programming experience may factor into your decision.

Download CA65 (as part of the CC65 package)

Other Assemblers Targetting 6502:

NESASM - NESASM is an assembler most notable for its use in the popular "Nerdy Nights" tutorial series. It has a small number of loyal users, but many who have used the assembler in the past would recommend against it. Of the three most popular assemblers for NES development, this one uses a syntax least in accordance with assembly standards. It is also very particular about the way code is spaced, which is not an issue with the previous two assemblers mentioned.

Download NESASM

It is also worth noting if you wish to follow the Nerdy Nights tutorial, that members of the NESdev community have created examples of the tutorial files written for ASM6 and CA65, so your choice of assembler is not required to match that of your first tutorial.

Nerdy Nights ASM6 Example Link
Nerdy Nights CA65 Example Link

(Consider adding some sort of cheat sheet for Nerdy Nights to ASM6/CA65 conversion, just covering directives used in the tutorial)

(I don't know much about these other assemblers ATM)
MagicKit - Download (Description?)
NBASIC - Download (Description?)
NESASM - Download (Description?)
NESHLA - Download (Description?)
WLA-DX - Download (Description?)


Top
 Profile  
 
PostPosted: Wed Jun 01, 2016 4:31 pm 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19115
Location: NE Indiana, USA (NTSC)
I combined MagicKit and NESASM in my snapshot because they are the same product. MagicKit has that name because it appears to be produced by the same team behind MagicEngine, an early TurboGrafx-16 emulator. NESASM is a version of PCEAS, the assembler in MagicKit, modified to add an iNES header, and its MMC3-oriented bank size matches that of the built-in mapper in the TG16's HuC6280 CPU. Unofficial MagicKit is a fork of NESASM with more features.

NBASIC and NESHLA aren't really assemblers as much as attempts to make a language higher level than 6502 assembly but with less overhead than C.


Top
 Profile  
 
PostPosted: Wed Jun 01, 2016 5:11 pm 
Offline
User avatar

Joined: Fri May 08, 2015 7:17 pm
Posts: 1784
Location: DIGDUG
The source code for NESASM is on github. I was wondering if the bank size limit could be easily changed, thus making it not such a pain to have banks over $2000 bytes.

https://github.com/thentenaar/nesasm/tree/master/source

5 minutes of looking at the code, and I didn't spot the bank size definitions. I thought it might be bank_limit in main.c, but that seems to define how many banks a project can have.

Maybe it's this line...

if (loccnt > 0x2000) {
if (proc_ptr == NULL)
fatal_error("Bank overflow, offset > $1FFF!");

Anybody out there want to tackle this easy task of editing the code and recompiling?

_________________
nesdoug.com -- blog/tutorial on programming for the NES


Top
 Profile  
 
PostPosted: Wed Jun 01, 2016 9:36 pm 
Offline
User avatar

Joined: Mon Jan 03, 2005 10:36 am
Posts: 2963
Location: Tampere, Finland
darryl.revok wrote:
2. CA65 - ... For a non-programmer, it will have the highest learning curve, as you will have to learn to create a linker file from the start. ...

Well, in this thread it has been argued that beginners shouldn't be making linker files, and should use ready-made templates instead. (Note that all assemblers have this burden to some extent: a beginner is not going to easily understand vectors, or NESASM's banking system (and how it relates to iNES banks), or how to use .org properly. So they will need some kind of a template to start with.)

_________________
Download STREEMERZ for NES from fauxgame.com! — Some other stuff I've done: kkfos.aspekt.fi


Top
 Profile  
 
PostPosted: Wed Jun 01, 2016 10:19 pm 
Offline
User avatar

Joined: Sat Feb 12, 2005 9:43 pm
Posts: 10066
Location: Rio de Janeiro - Brazil
Bregalad wrote:
@Tokumaru: In your NESASM apology you forgot to mention it is great to define variable location directly instead of having them assigned by the assembler, because this makes it easier to debug your code in FCEUX, and because array sizes never changes, period :)

Oh well... I guess this is probably how tutorials do it, but reading the documentation I see it actually has 3 directives that seem very useful for declaring variables and structures: DS, RSSET and RS. Still, I don't trust NESASM as a whole... mostly because of the baffling quirks (things like line length limitations, indentation, silent failures, and so on) that are discovered from time to time.

I'm perfectly happy with ca65 right now. I've been using a lot of its features (mainly its macro system, backed up by the many built-in commands and functions) to automate things in my current project. And I still think that ASM6 is the best assembler to get things done quickly and without hassle, so that's the one I'd recommend for beginners.

thefox wrote:
Well, in this thread it has been argued that beginners shouldn't be making linker files, and should use ready-made templates instead. (Note that all assemblers have this burden to some extent: a beginner is not going to easily understand vectors, or NESASM's banking system (and how it relates to iNES banks), or how to use .org properly. So they will need some kind of a template to start with.)

I've never been very fond of using other people's code without understanding what exactly is going on. And when I do get what's going on, I often prefer to write my own version of it, to make sure I really got it. The memory layout of an NROM program (which is what every newbie should be going for) is really simple, and I think both ASM6 and NESASM get points for being able to easily assemble a single ASM file directly into an NES ROM without any code hidden from the programmer. The amount of "magic" code that gets thrown at the aspiring programmer's face is minimal (a few DBs for the header, an ORG for the start of the program and another for the vectors, in the case of ASM6), and since it's always there, in the middle of the program, it should naturally start to make sense as the programmer continues to mess with the code, because he's directly dealing with it all the time.

Config files, on the other hand, are hiding the memory layout from the programmer, and assembling scripts are also hiding the way the ROM is built (assembling + linking). A person will never learn naturally about things that are hidden, they'll have to deliberately study those things to make any sense out of them. To me, studying this wasn't particularly hard because of my previous knowledge of memory mapping I acquired from dealing with ORG statements, something I wouldn't have if I had used someone else's hidden code when I got started.

Templates containing config files, assembling scripts, macro packages, whatever, make something that's dead simple (NROM) appear complicated as shit. With ASM6 or NESASM you can start simple, as someone's first programs should be. Writing the contents of the ROM linearly also helps with understanding the memory layout, before a person is comfortable to freely mix segments and such.


Top
 Profile  
 
PostPosted: Thu Jun 02, 2016 12:59 am 
Offline
User avatar

Joined: Sat Jul 25, 2015 1:22 pm
Posts: 501
I have some thoughts on this matter, and I'd like to share some of my beginner experiences.

At some point eary in my exploration, I downloaded tepples's example project file. I remembered my days as a kid beginning qBasic by monkeying around with the Gorilla banana toss game. I thought I could get some grasp of what's going on by just looking at it. I have to say though it was a bit much for me at the time. First thing I notice is, "Woah! this is a lot of files!" but I didn't give up immediately. I believe I most likely went into main.s first. Now something like, ".include", i can gather from context. I'm knowing at this point that I'm going to have to reference most of the instructions to understand them, but I believe the point at which I realized that this was beyond me is when the highly descriptive comments went over my head.

Now this experience is not meant in any way to reflect poorly against the template created by tepples. It is obviously something intended for someone with enough experience to at least know what an NMI is. I will probably use this template if/when I transition to ca65. The point that I aim to make is that without appropriate hand-holding, templates can be intimidating to a beginner.

I believe this intimidation can be amplified by templates with a lot of files, and arguably by better written code, but isn't exclusive to it. I feel that things like the setup code can be very confusing to a beginner and are really better of left alone for a while. If that stuff EVER needs to be messed with, odds are you'll feel comfortable doing so when it's needed.

Really I believe the benefit to Nerdy Nights was the separation of steps and the fact that I could pretty much skip to the part where I'm putting graphics on the screen. From there, I was able to identify a single element of NES development from which I could see immediate results. The sort of thing I'd wanted to see since I was a child; my graphics displayed on screen by a Nintendo Entertainment System.

I believe being able to separate a single sandbox from the complex parts was what made it work for me.

Also, before any of this, before I even downloaded the NES template, I went to the Easy 6502 tutorial. I have to say, I've thought about it, and I believe this may be the best very first tutorial for a beginner. No tools are required; the web page has an embedded emulator. You're not messing with complex hardware idiosyncrasies but basic assembly concepts and opcodes. Using this tutorial was the first point at which I thought, "So this IS possible..."

thefox wrote:
Well, in this thread it has been argued that beginners shouldn't be making linker files, and should use ready-made templates instead. (Note that all assemblers have this burden to some extent: a beginner is not going to easily understand vectors, or NESASM's banking system (and how it relates to iNES banks), or how to use .org properly. So they will need some kind of a template to start with.)
I've thought about this too and I feel the wording should reflect the option to use a template. Also though, considering that (currently at least) a majority of users have preference for ASM6 as a first assembler, I think it would be unfair to not, in some way, briefly describe why this assembler may have a higher learning curve.

tepples wrote:
I combined MagicKit and NESASM in my snapshot because they are the same product. MagicKit has that name...
Can you explain a little more about the snapshot? Should I integrate your changes into my next draft or add my changes to your snapshot?


Another thing that I am unsure about on the draft is the amount of content dedicated to the Nerdy Nights tutorial. Now, this currently being the defacto tutorial, I feel like it's kind of a obligatory service to not necessarily guide a person there, but to consolidate information to help a person make an informed choice on acquiring tools before approaching it. However, I think there are a few issues with having arrows pointing toward that tutorial. For one, it's not a part of NESdev and won't be perpetually updated by the community; two, it targets a non-recommended assembler, and three, I believe most experienced 6502 coders would agree that it doesn't always teach the best practices. For the sake of doing what works for now, it seems the simplest method to provide links for Nerdy Nights related info. The problem with this I see though, to easily direct a beginner in using ca65 or (to a lesser extent) asm6, pretty much requires a tutorial for the tutorial. It's probably the easiest, as most of this work has already been done, it just needs to be consolidated. However, it's surely not the cleanest solution.


Top
 Profile  
 
PostPosted: Thu Jun 02, 2016 1:36 am 
Offline
User avatar

Joined: Fri Feb 27, 2009 2:35 pm
Posts: 211
Location: Fort Wayne, Indiana
I've attached the tutorial that tepples started writing at one point, that he sent me to get me started on NES development. While it's very incomplete (never covers sprites, doesn't clear the nametable, doesn't initialize RAM) I think it does a good job of showing off how a ca65-targeted tutorial can be very approachable to a beginner.

Each of the steps gets their own folder with just one source code file to look at each, and it's a lot less overwhelming than trying to make sense of a project template that's aimed at more advanced developers. Instead of a makefile it just uses batch files, which are right in the folders for the steps and which have comments explaining what they're doing if the person wants to know. Instead of Python scripts for converting tiles they're just already in the correct format.

It was very easy for me to figure out what was going on and extend the "Hello World" text demo into a crude text scroller.


Attachments:
ex.zip [14.04 KiB]
Downloaded 50 times
Top
 Profile  
 
PostPosted: Thu Jun 02, 2016 3:24 am 
Offline

Joined: Thu Aug 20, 2015 3:09 am
Posts: 284
I use xa. It's as simple as it gets, and that's the way I like it. The only reason I wouldn't recommend it to a[nother] beginner is its habit of treating anything it doesn't understand as a label - typos silently assemble to nothing. But I've only run into that problem once myself, and I do think that less is more when you're getting started.

I've half a mind to write my own, but that wouldn't help anyone.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 62 posts ]  Go to page Previous  1, 2, 3, 4, 5  Next

All times are UTC - 7 hours


Who is online

Users browsing this forum: qfwfq, samwise970 and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group