.ASM into .NES assistance
Moderator: Moderators
Re: .ASM into .NES assistance
You'll need to run "c:\users\whoever\documents\nes maker files\asm6.exe" "c:\users\whoever\documents\nes maker files\input.asm" "c:\users\whoever\documents\nes maker files\output.nes"
Which is to say you'll need to make a file "input.asm" using something like notepad or any other plain text editor.
In that file you put the commands, like ".incbin"
Which is to say you'll need to make a file "input.asm" using something like notepad or any other plain text editor.
In that file you put the commands, like ".incbin"
- caramelpuffpuff
- Posts: 64
- Joined: Sat Feb 23, 2013 4:16 pm
Re: .ASM into .NES assistance
By making file, "input.asm" does it also work on ConTEXT? And then what?lidnariq wrote:You'll need to run "c:\users\whoever\documents\nes maker files\asm6.exe" "c:\users\whoever\documents\nes maker files\input.asm" "c:\users\whoever\documents\nes maker files\output.nes"
Which is to say you'll need to make a file "input.asm" using something like notepad or any other plain text editor.
In that file you put the commands, like ".incbin"
By command, like "c:\users\whoever\documents\nes maker files\asm6.exe"".incbin"? Do I have to put " " everytime I want to command the ASM?
The output.nes means any NES that is blank?
(Gosh, I'm terrible at vocabulary...)
I am thinking of requesting a tutor [free] to learn NES programming in 6502 Assembly, as I am still baffled on the Bunnyboy 6504 lessons. If anyone want to help, I'm happy.
Bear in mind I may act silly or have trouble understanding, so please bear with me.
Bear in mind I may act silly or have trouble understanding, so please bear with me.
Re: .ASM into .NES assistance
The .incbin command goes inside a source code file.
Have you ever written a program in any other programming language?
Have you ever written a program in any other programming language?
- caramelpuffpuff
- Posts: 64
- Joined: Sat Feb 23, 2013 4:16 pm
Re: .ASM into .NES assistance
I don't think so... I read a lot of tutorials about ASM and CMD, and I still can't understand some of those...tepples wrote:The .incbin command goes inside a source code file.
Have you ever written a program in any other programming language?
I am thinking of requesting a tutor [free] to learn NES programming in 6502 Assembly, as I am still baffled on the Bunnyboy 6504 lessons. If anyone want to help, I'm happy.
Bear in mind I may act silly or have trouble understanding, so please bear with me.
Bear in mind I may act silly or have trouble understanding, so please bear with me.
Re: .ASM into .NES assistance
OK, here are the steps for creating a valid NES ROM with ASM6:
1. Go to this post and copy the NROM template;
2. Open Notepad and paste the code you copied;
3. In the last line, change "tiles.chr" to the name of your CHR file;
4. Save the file as "game.asm" to the same folder where ASM6 and the CHR file are;
5. Open another Notepad window ans write the following in it:
6. Save this as "compile.bat", in the same folder as the other files;
7. double click "compile.bat";
OBS: When saving files from Notepad, make sure to select (*.*) in the type field, otherwise it may end up putting ".txt" after the file names, and then it won't work.
This should open a command prompt window, but you don't have to type anything in it, because it will automatically execyte the command that are written inside the .bat file. The "pause" command is there to prevent the window from closing before you can see any messages the assembler outputs.
Anyway, after this you will get a valid NES file, but it won't do anything because there's no code to do anything, since the template was blank. You will need to write 6502 code to initialize the system and display something (tip: this code will go right after the "Reset" label, which is where the program begins - don't bother with NMI and IRQ for now). At least you have a place to start now.
1. Go to this post and copy the NROM template;
2. Open Notepad and paste the code you copied;
3. In the last line, change "tiles.chr" to the name of your CHR file;
4. Save the file as "game.asm" to the same folder where ASM6 and the CHR file are;
5. Open another Notepad window ans write the following in it:
Code: Select all
asm6 game.asm game.nes
pause
7. double click "compile.bat";
OBS: When saving files from Notepad, make sure to select (*.*) in the type field, otherwise it may end up putting ".txt" after the file names, and then it won't work.
This should open a command prompt window, but you don't have to type anything in it, because it will automatically execyte the command that are written inside the .bat file. The "pause" command is there to prevent the window from closing before you can see any messages the assembler outputs.
Anyway, after this you will get a valid NES file, but it won't do anything because there's no code to do anything, since the template was blank. You will need to write 6502 code to initialize the system and display something (tip: this code will go right after the "Reset" label, which is where the program begins - don't bother with NMI and IRQ for now). At least you have a place to start now.
- caramelpuffpuff
- Posts: 64
- Joined: Sat Feb 23, 2013 4:16 pm
Re: .ASM into .NES assistance
Do I have to replace "game.asm" with the file?tokumaru wrote:OK, here are the steps for creating a valid NES ROM with ASM6:
1. Go to this post and copy the NROM template;
2. Open Notepad and paste the code you copied;
3. In the last line, change "tiles.chr" to the name of your CHR file;
4. Save the file as "game.asm" to the same folder where ASM6 and the CHR file are;
5. Open another Notepad window ans write the following in it:6. Save this as "compile.bat", in the same folder as the other files;Code: Select all
asm6 game.asm game.nes pause
7. double click "compile.bat";
OBS: When saving files from Notepad, make sure to select (*.*) in the type field, otherwise it may end up putting ".txt" after the file names, and then it won't work.
This should open a command prompt window, but you don't have to type anything in it, because it will automatically execyte the command that are written inside the .bat file. The "pause" command is there to prevent the window from closing before you can see any messages the assembler outputs.
Anyway, after this you will get a valid NES file, but it won't do anything because there's no code to do anything, since the template was blank. You will need to write 6502 code to initialize the system and display something (tip: this code will go right after the "Reset" label, which is where the program begins - don't bother with NMI and IRQ for now). At least you have a place to start now.
I am thinking of requesting a tutor [free] to learn NES programming in 6502 Assembly, as I am still baffled on the Bunnyboy 6504 lessons. If anyone want to help, I'm happy.
Bear in mind I may act silly or have trouble understanding, so please bear with me.
Bear in mind I may act silly or have trouble understanding, so please bear with me.
Re: .ASM into .NES assistance
Precisely. You should either rename "gametest.asm" to "game.asm", or edit compile.bat to use "gametest" instead of "game"caramelpuffpuff wrote:Do I have to replace "game.asm" with the file?
- caramelpuffpuff
- Posts: 64
- Joined: Sat Feb 23, 2013 4:16 pm
Re: .ASM into .NES assistance
O3O...!?lidnariq wrote:Precisely. You should either rename "gametest.asm" to "game.asm", or edit compile.bat to use "gametest" instead of "game"caramelpuffpuff wrote:Do I have to replace "game.asm" with the file?
I am thinking of requesting a tutor [free] to learn NES programming in 6502 Assembly, as I am still baffled on the Bunnyboy 6504 lessons. If anyone want to help, I'm happy.
Bear in mind I may act silly or have trouble understanding, so please bear with me.
Bear in mind I may act silly or have trouble understanding, so please bear with me.
- caramelpuffpuff
- Posts: 64
- Joined: Sat Feb 23, 2013 4:16 pm
Re: .ASM into .NES assistance
..."Anyway, after this you will get a valid NES file, but it won't do anything because there's no code to do anything, since the template was blank. You will need to write 6502 code to initialize the system and display something (tip: this code will go right after the "Reset" label, which is where the program begins - don't bother with NMI and IRQ for now). At least you have a place to start now."
... Uhh...So this is where I start now...
... Uhh...So this is where I start now...
I am thinking of requesting a tutor [free] to learn NES programming in 6502 Assembly, as I am still baffled on the Bunnyboy 6504 lessons. If anyone want to help, I'm happy.
Bear in mind I may act silly or have trouble understanding, so please bear with me.
Bear in mind I may act silly or have trouble understanding, so please bear with me.
Re: .ASM into .NES assistance
Yep, that's what it shows when you don't do anything to the system. You have to wait for the PPU to be ready, set it up, display graphics, and then make a game.
Re: .ASM into .NES assistance
But at least you have some structure to work on now (a valid NES ROM with a 16 byte header, 16KB PRG-ROM and 8KB CHR-ROM = 24592 bytes), which you couldn't figure out before. Your tiles are there, ready to be used by the program. You should now look into how to initialize the system (tip: don't just copy and paste it - it might not even work because of assembler differences! - try to understand what's going on), setting palettes and showing some tiles.
- caramelpuffpuff
- Posts: 64
- Joined: Sat Feb 23, 2013 4:16 pm
Re: .ASM into .NES assistance
...... Uhhh....can you write the steps like you did on the ASM?tokumaru wrote:But at least you have some structure to work on now (a valid NES ROM with a 16 byte header, 16KB PRG-ROM and 8KB CHR-ROM = 24592 bytes), which you couldn't figure out before. Your tiles are there, ready to be used by the program. You should now look into how to initialize the system (tip: don't just copy and paste it - it might not even work because of assembler differences! - try to understand what's going on), setting palettes and showing some tiles.
I am thinking of requesting a tutor [free] to learn NES programming in 6502 Assembly, as I am still baffled on the Bunnyboy 6504 lessons. If anyone want to help, I'm happy.
Bear in mind I may act silly or have trouble understanding, so please bear with me.
Bear in mind I may act silly or have trouble understanding, so please bear with me.
Re: .ASM into .NES assistance
Not without doing all the work for you... you won't learn anything this way.caramelpuffpuff wrote:...... Uhhh....can you write the steps like you did on the ASM?
- caramelpuffpuff
- Posts: 64
- Joined: Sat Feb 23, 2013 4:16 pm
Re: .ASM into .NES assistance
true...what is @vblankwait1 and 2? Do I put this in a notepad and convert it into ASM.? or bat.?tokumaru wrote:Not without doing all the work for you... you won't learn anything this way.caramelpuffpuff wrote:...... Uhhh....can you write the steps like you did on the ASM?
I am thinking of requesting a tutor [free] to learn NES programming in 6502 Assembly, as I am still baffled on the Bunnyboy 6504 lessons. If anyone want to help, I'm happy.
Bear in mind I may act silly or have trouble understanding, so please bear with me.
Bear in mind I may act silly or have trouble understanding, so please bear with me.
Re: .ASM into .NES assistance
In asm6 and ca65, a label whose name starts with with @ is a "cheap local label" that can't be seen across regular labels. This allows reuse of label names such as "loop" in different parts of a single program.
Yes, you do put the init code in Notepad.
Likewise, the ca65 manual has a section on cheap local labels.In the asm6 manual, loopy wrote:Labels are case sensitive. The special '$' label holds the current program address. Labels beginning with '@' are local labels. They have limited scope, visible only between non-local labels. Names of local labels may be reused.
Code: Select all
label1:
; stuff
@loop:
; stuff
dey
bne loop ; goes to the @loop below label1; can't see @loop below label2
label2:
; ...
@loop:
; stuff
dey
bne loop ; goes to the @loop below label2; can't see @loop below label1