It is currently Mon Dec 18, 2017 9:47 am

All times are UTC - 7 hours





Post new topic Reply to topic  [ 32 posts ]  Go to page 1, 2, 3  Next
Author Message
PostPosted: Sun Apr 06, 2014 9:06 pm 
Offline
User avatar

Joined: Sun Jan 22, 2012 12:03 pm
Posts: 5899
Location: Canada
I thought this might be helpful for people trying to learn NES programming. This is a very minimal program written for the ca65 assembler.

The hope was to provide a starting example for learning to use the NES, something that accepts and responds to input, and demonstrates a straightforward PPU technique. It does not attempt do demonstrate the sound APU at all. Additionally, it is an example of how to set up and build a simple ca65 program.


For an FDS build version, I made an alternative here: post in thread requesting FDS example


Attachments:
File comment: Minimal NES example using ca65
example1.zip [9.43 KiB]
Downloaded 133 times


Last edited by rainwarrior on Fri Sep 22, 2017 11:03 pm, edited 14 times in total.
Top
 Profile  
 
PostPosted: Mon Apr 07, 2014 3:56 am 
Offline
User avatar

Joined: Mon Jan 03, 2005 10:36 am
Posts: 2983
Location: Tampere, Finland
I'm not the one to toot my own horn, but with a tiny change in the linker switches you could add source level debugging support for NintendulatorDX and NESICIDE:
Code:
cc65\bin\ld65 -o example.nes -C example.cfg example.o -m example.map.txt -Ln example.labels.txt --dbgfile example.nes.dbg
I also moved the "-o" switch before "-C" in there, because the latest version of ld65 explicitly requires the switches in that order (unfortunately).

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


Top
 Profile  
 
PostPosted: Mon Apr 07, 2014 4:23 am 
Offline
NESICIDE developer
User avatar

Joined: Mon Oct 13, 2008 7:55 pm
Posts: 1058
Location: Minneapolis, MN
thefox wrote:
I'm not the one to toot my own horn...NESICIDE:

Thanks for tooting mine. :lol:
When did ld65's parameter ordering requirements change?


Top
 Profile  
 
PostPosted: Mon Apr 07, 2014 5:58 am 
Offline
User avatar

Joined: Sun Jan 22, 2012 12:03 pm
Posts: 5899
Location: Canada
Okay, I made the suggested change.

As far as parameter order for ld65, I think the strict requirement has been removed, as I had tested this against the latest cc65 snapshot with no problems.


Top
 Profile  
 
PostPosted: Mon Apr 07, 2014 6:17 am 
Offline
User avatar

Joined: Mon Jan 03, 2005 10:36 am
Posts: 2983
Location: Tampere, Finland
rainwarrior wrote:
As far as parameter order for ld65, I think the strict requirement has been removed, as I had tested this against the latest cc65 snapshot with no problems.

Did you get the warning? Or when was this change made? I have a fairly recent version from some weeks back (ld65 V2.14 - Git eaf4c8c), and it gave the warning and output the ROM in a.out, ignored the -o that came after -C.

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


Top
 Profile  
 
PostPosted: Mon Apr 07, 2014 6:26 am 
Offline
User avatar

Joined: Sun Jan 22, 2012 12:03 pm
Posts: 5899
Location: Canada
No warning. The files in the snapshot are stamped 4/04/2014. (It shouldn't be a warning or an error anyway, there was no good reason to have added such an arbitrary rule to the command line in the first place.)


Top
 Profile  
 
PostPosted: Mon Apr 07, 2014 6:41 am 
Offline
User avatar

Joined: Mon Jan 03, 2005 10:36 am
Posts: 2983
Location: Tampere, Finland
rainwarrior wrote:
No warning. The files in the snapshot are stamped 4/04/2014. (It shouldn't be a warning or an error anyway, there was no good reason to have added such an arbitrary rule to the command line in the first place.)

Yeah I completely agree about the arbitrariness (that's why the "unfortunately" in my original post). It seems like this got fixed about a week ago. Works with the latest snapshot.

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


Top
 Profile  
 
PostPosted: Mon Apr 07, 2014 7:30 am 
Offline
Formerly ~J-@D!~
User avatar

Joined: Sun Mar 12, 2006 12:36 am
Posts: 445
Location: Rive nord de Montréal
Great example. I do believe however that the best would be to supply a NESICIDE project (either along or instead of compile_example) with your example because for a starter, using this IDE is much easier than using a shell "script", in the sense that NESICIDE will do a much better compile-time error reporting and simpler/faster testing of the resulting program, with the free added benefit that the example will be portable and much more scalable (NESICIDE can add files to a project with a few clicks, no script to modify). The downside is that it's possible that the package needs updating as NESICIDE evolves, but I don't think there will be much problems because a .nesproject is a xml file, so except if NESICIDE maintainer(s) change(s) the name of basic properties I don't see why it wouldn't work in the future.

Very minor fix btw: typo on line 9 (example.txt), "A Python 3 program to build debugging symbols for FCUEX is included."


Top
 Profile  
 
PostPosted: Mon Apr 07, 2014 7:38 am 
Offline
User avatar

Joined: Sun Jan 22, 2012 12:03 pm
Posts: 5899
Location: Canada
If you want to create an NESICIDE version of this please go right ahead. I don't use it, so I'm not interested or qualified to do so.

If it's minimal enough I'll add it to the attached zip.


Top
 Profile  
 
PostPosted: Fri May 02, 2014 7:05 am 
Offline
NESICIDE developer
User avatar

Joined: Mon Oct 13, 2008 7:55 pm
Posts: 1058
Location: Minneapolis, MN
rainwarrior wrote:
If it's minimal enough I'll add it to the attached zip.

Compiles, runs. Had to RAR it though since .nesproject file extension is not allowed...


Attachments:
example.rar [1.29 KiB]
Downloaded 296 times
Top
 Profile  
 
PostPosted: Fri May 02, 2014 7:05 am 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19356
Location: NE Indiana, USA (NTSC)
Why use WinRAR ($$$) instead of 7-Zip?


Top
 Profile  
 
PostPosted: Fri May 02, 2014 7:26 am 
Offline
NESICIDE developer
User avatar

Joined: Mon Oct 13, 2008 7:55 pm
Posts: 1058
Location: Minneapolis, MN
tepples wrote:
Why use WinRAR ($$$) instead of 7-Zip?

I dunno. Just what I have. Yeah it keeps asking me to buy it. But I don't. Actually I also have 7-zip but it's not in my context menu so I never use it.


Top
 Profile  
 
PostPosted: Fri May 02, 2014 8:18 am 
Offline
User avatar

Joined: Sun Jan 22, 2012 12:03 pm
Posts: 5899
Location: Canada
WinRAR is still my preferred windows archiver after all these years. I still like its interface better than 7-Zip.

If 7-Zip is your preference, it will unpack RARs just fine, but I'm sure you know that already.


Top
 Profile  
 
PostPosted: Fri May 02, 2014 8:44 am 
Offline
NESICIDE developer
User avatar

Joined: Mon Oct 13, 2008 7:55 pm
Posts: 1058
Location: Minneapolis, MN
rainwarrior wrote:
If 7-Zip is your preference, it will unpack RARs just fine, but I'm sure you know that already.

I lack the energy for a preference here. If you can use the file I attached, great. If not...maybe we could adjust the forum rules to allow .nesproject extensions? Not that I want to blast the forum with a bunch of NESICIDE project files...and maybe it would be best for me to set up my own forum [which tepples has offered to help with several times]. But I'm just too busy for such things.


Top
 Profile  
 
PostPosted: Fri May 02, 2014 11:37 am 
Offline
User avatar

Joined: Sun Jan 22, 2012 12:03 pm
Posts: 5899
Location: Canada
So, we can attach .nesproject files now, but then I realized I should probably just add it to the zip. :P


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

All times are UTC - 7 hours


Who is online

Users browsing this forum: Bing [Bot] and 4 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