Out of date tools?

Are you new to 6502, NES, or even programming in general? Post any of your questions here. Remember - the only dumb question is the question that remains unasked.

Moderator: Moderators

User avatar
dougeff
Posts: 3079
Joined: Fri May 08, 2015 7:17 pm

Re: Out of date tools?

Post by dougeff »

When I use cc65.exe and / or ca65.exe, I get nothing in the command prompt, unless there is an error.

Nothing. Nothing seems to happen. It doesn't say a thing. But, it built me a file. I look in the folder. There it is.

That's just how these tools work.
nesdoug.com -- blog/tutorial on programming for the NES
User avatar
rainwarrior
Posts: 8734
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

Re: Out of date tools?

Post by rainwarrior »

dougeff wrote:When I use cc65.exe and / or ca65.exe, I get nothing in the command prompt, unless there is an error.

Nothing. Nothing seems to happen. It doesn't say a thing. But, it built me a file. I look in the folder. There it is.

That's just how these tools work.
That's strange. That's definitely not how they work for me:
cc65_command_line_test.png
No arguments gives me an error for both (and both cases are errorlevel 1).

What file is it supposed to build with no arguments?
User avatar
dougeff
Posts: 3079
Joined: Fri May 08, 2015 7:17 pm

Re: Out of date tools?

Post by dougeff »

I typed a line WITH several arguments. (For cc65) It compiled correctly, but no indication from the command line dialog box.

I think you missed my point. I'm trying to reassure the new guy.

Edit, fixed 1 typo
Last edited by dougeff on Fri Mar 31, 2017 4:14 am, edited 1 time in total.
nesdoug.com -- blog/tutorial on programming for the NES
User avatar
rainwarrior
Posts: 8734
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

Re: Out of date tools?

Post by rainwarrior »

Oh, yes that's what it supposed to do when everything's fine. No comment and errorlevel 0.

I think most compilers are silent when there's no error (or other requested output).

If you do want confirmation though, you can add errorlevel checking and/or a pause to your batch file. Example:

Code: Select all

cc65\bin\ca65 bank0.s       -g -o temp\bank0.o
@IF ERRORLEVEL 1 GOTO badbuild
cc65\bin\ca65 bank1.s       -g -o temp\bank1.o
@IF ERRORLEVEL 1 GOTO badbuild
cc65\bin\ca65 bank2.s       -g -o temp\bank2.o
@IF ERRORLEVEL 1 GOTO badbuild

@echo.
@echo.
@echo Build complete and successful!
@pause
@GOTO endbuild

:badbuild
@echo.
@echo.
@echo Build error!
@pause
:endbuild
User avatar
Jarhmander
Formerly ~J-@D!~
Posts: 569
Joined: Sun Mar 12, 2006 12:36 am
Location: Rive nord de Montréal

Re: Out of date tools?

Post by Jarhmander »

rainwarrior wrote:Oh, yes that's what it supposed to do when everything's fine. No comment and errorlevel 0.

I think most compilers are silent when there's no error (or other requested output).
It goes further than this: most (if not all?) UNIX tools are silent on success, except when being told to be verbose, if that's available. So for example, gcc has most of its warnings deactivated by default, and outputs nothing on success, as expected. Other small commands, like cp, mv, rm, mkdir, etc. print nothing at all on normal circumstances. Note that shell scripts don't echo lines of execution by default, so again, except when errors occur, you may see nothing on the screen upon its execution.

Contrast this with MS-DOS and Windows, where for example copy outputs " X file(s) copied", batch files echo lines by default, and the Microsoft C/C++ compiler prints a banner, unless told otherwise.
((λ (x) (x x)) (λ (x) (x x)))
User avatar
AlterAnubis
Posts: 19
Joined: Wed Mar 29, 2017 3:11 pm

Re: Out of date tools?

Post by AlterAnubis »

I put the test asm in the same folder as the asm6 what do I do from there? I have no clue as to what to put into the cmd
User avatar
tokumaru
Posts: 12427
Joined: Sat Feb 12, 2005 9:43 pm
Location: Rio de Janeiro - Brazil

Re: Out of date tools?

Post by tokumaru »

Then you're not reading the replies. I gave you all the information necessary to create a batch file for ASM6, but you insisted on just clicking the assemblers, after being told that wouldn't work.

If you're not willing to read the replies and spend any effort on learning, people will soon stop responding. I know I felt pretty disappointed to read that you kept double clicking .exe's after after my fairly detailed reply.
User avatar
tokumaru
Posts: 12427
Joined: Sat Feb 12, 2005 9:43 pm
Location: Rio de Janeiro - Brazil

Re: Out of date tools?

Post by tokumaru »

The absolute minimal setup you need to create a working ROM will need asm6.exe, assemble.bat and source.asm in the same folder. The batch file should contain at lest this:

Code: Select all

asm6 source.asm game.nes
pause
The source file should contain a valid NES program made for ASM6. Each assembler has different features and rules that make source code incompatible between them without modifications.

You can search these forums for my ASM6 templates, which have the valid structure to create NES files, but don't contain any code. This means that the assembler will generate a valid ROM file that you can open in emulators, but nothing will happen because there's no program to do anything. You have to write the program yourself.

Note that the NROM template requires an 8kb CHR file. You can make one in YYCHR or rip the CHR-ROM from an existing game.

Then you can just double-click assemble.bat.
User avatar
AlterAnubis
Posts: 19
Joined: Wed Mar 29, 2017 3:11 pm

Re: Out of date tools?

Post by AlterAnubis »

tokumaru wrote:The absolute minimal setup you need to create a working ROM will need asm6.exe, assemble.bat and source.asm in the same folder. The batch file should contain at lest this:

Code: Select all

asm6 source.asm game.nes
pause
The source file should contain a valid NES program made for ASM6. Each assembler has different features and rules that make source code incompatible between them without modifications.

You can search these forums for my ASM6 templates, which have the valid structure to create NES files, but don't contain any code. This means that the assembler will generate a valid ROM file that you can open in emulators, but nothing will happen because there's no program to do anything. You have to write the program yourself.

Note that the NROM template requires an 8kb CHR file. You can make one in YYCHR or rip the CHR-ROM from an existing game.

Then you can just double-click assemble.bat.
Sorry, I am just having a rough day, I just made the bat file and it said pass 1.. nothing to do!
getting excited about it :lol:
User avatar
AlterAnubis
Posts: 19
Joined: Wed Mar 29, 2017 3:11 pm

Re: Out of date tools?

Post by AlterAnubis »

dougeff wrote:With the command box open (for asm6)...

Assuming you have asm6.exe and an assembly file called test.asm, in the same folder...

Simply typing "asm6 test.asm test.nes" would be all you do. If no errors, it would say something like...
pass 1..
pass 2..
test.nes written (16400 bytes).
Then, if you looked in the folder, you will see the output file "test.nes"

EDIT - actual output inserted.

EDIT 2 - if I wanted to make a .bat file do exactly this, I would write a text file (with Notepad++) that said...
asm6 test.asm test.nes
pause
That's it. Save this text file as 'compile.bat'

Or, if you want to get fancy...
set name="test"
asm6 %name%.asm %name%.nes -l
pause
%name%.nes
This would create a listing (-l), and the screen will pause, and wait for a keypress, at which point, it will try to open 'test.nes'...assuming you have .nes files associated with an emulator.
I tried the more technical one and seemed to create the .lst file
User avatar
dougeff
Posts: 3079
Joined: Fri May 08, 2015 7:17 pm

Re: Out of date tools?

Post by dougeff »

I guess that means you figured out .bat files.

Now, to write a source file that actually works. Feel free to read old forum posts for exactly this subject. Search also for "asm6" and "template". And read the wiki. And spend some time over at 6502.org.

Good luck.
nesdoug.com -- blog/tutorial on programming for the NES
User avatar
AlterAnubis
Posts: 19
Joined: Wed Mar 29, 2017 3:11 pm

Re: Out of date tools?

Post by AlterAnubis »

Wait the masm listing file is correct? I thought I needed a .nes not a .lst file
User avatar
FrankenGraphics
Formerly WheelInventor
Posts: 2064
Joined: Thu Apr 14, 2016 2:55 am
Location: Gothenburg, Sweden
Contact:

Re: Out of date tools?

Post by FrankenGraphics »

the .nes (or .bin which is default if you don't name the extension as .nes) is your binary program. the optional .lst is your list file for review.
User avatar
AlterAnubis
Posts: 19
Joined: Wed Mar 29, 2017 3:11 pm

Re: Out of date tools?

Post by AlterAnubis »

FrankenGraphics wrote:the .nes (or .bin which is default if you don't name the extension as .nes) is your binary program. the optional .lst is your list file for review.
For the batch file I put
set name="test"
asm6 %name%.asm %name%.nes -l
pause
%name%.nes

cc65\bin\ca65 bank0.s -g -o temp\bank0.o
@IF ERRORLEVEL 1 GOTO badbuild
cc65\bin\ca65 bank1.s -g -o temp\bank1.o
@IF ERRORLEVEL 1 GOTO badbuild
cc65\bin\ca65 bank2.s -g -o temp\bank2.o
@IF ERRORLEVEL 1 GOTO badbuild

@echo.
@echo.
@echo Build complete and successful!
@pause
@GOTO endbuild

:badbuild
@echo.
@echo.
@echo Build error!
@pause
:endbuild


that in it, I also made a Test.asm file with the tutorial that was made on the forum. I don't really know if I did anything wrong.. I mean I just copied and pasted the code :oops:
User avatar
FrankenGraphics
Formerly WheelInventor
Posts: 2064
Joined: Thu Apr 14, 2016 2:55 am
Location: Gothenburg, Sweden
Contact:

Re: Out of date tools?

Post by FrankenGraphics »

the first paragraph is for using asm6. Place it in your folder containing asm6 and your asm file. Run it from there.

the rest is for error handling specific to ca65 (and not a complete batch file for baking a program with ca65). They shouldn't be written together.
Post Reply