Page 3 of 4

Re: Out of date tools?

Posted: Thu Mar 30, 2017 6:05 pm
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.

Re: Out of date tools?

Posted: Thu Mar 30, 2017 6:45 pm
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?

Re: Out of date tools?

Posted: Thu Mar 30, 2017 6:54 pm
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

Re: Out of date tools?

Posted: Thu Mar 30, 2017 6:59 pm
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

Re: Out of date tools?

Posted: Thu Mar 30, 2017 7:57 pm
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.

Re: Out of date tools?

Posted: Thu Mar 30, 2017 8:06 pm
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

Re: Out of date tools?

Posted: Thu Mar 30, 2017 8:27 pm
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.

Re: Out of date tools?

Posted: Thu Mar 30, 2017 8:37 pm
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.

Re: Out of date tools?

Posted: Thu Mar 30, 2017 8:50 pm
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:

Re: Out of date tools?

Posted: Thu Mar 30, 2017 8:53 pm
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

Re: Out of date tools?

Posted: Fri Mar 31, 2017 5:12 am
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.

Re: Out of date tools?

Posted: Fri Mar 31, 2017 11:00 am
by AlterAnubis
Wait the masm listing file is correct? I thought I needed a .nes not a .lst file

Re: Out of date tools?

Posted: Fri Mar 31, 2017 11:22 am
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.

Re: Out of date tools?

Posted: Fri Mar 31, 2017 11:39 am
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:

Re: Out of date tools?

Posted: Fri Mar 31, 2017 12:19 pm
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.