OK great it works! Thanks a bunch for all your help it would have taken me too long on my own to figure this out. There was something happening that I wasn't aware of at first: ASM6 compiles it into .bin and I thought it was compiling it into .nes like NESASM3 does.

What I want to do before doing more programming is to make use of the features of ASM6 and jazz up my code. Does anybody have an example .asm file that I can look at that has a good mix of things in it so I know the types of things I can implement in my program? I have seen the README for ASM6 and it would be easier to compare that to some code.

ASM6 compiles it into .bin and I thought it was compiling it into .nes like NESASM3 does.

These are just file names. ASM6 defaults to .bin because it isn't NES-only, but if you can define your own output file name with the .nes extension.

Quote:

What I want to do before doing more programming is to make use of the features of ASM6 and jazz up my code.

Looking at your source file, there are some things you can do to improve maintainability, but they aren't necessarily ASM6 exclusives. The first thing you should do is declare your variables dynamically, rather than manually assigning the address of each one of them. This is how you should define variables in ASM6:

Instead of manually writing the address of each variable, you start a block somewhere in RAM and just specify how long each variable is. This way you can easily shuffle variables around or change their size, without having to edit tens of addresses by hand, which is not only tedious but also error-prone.

Another thing that could potentially increase readability and maintainability is to break up the code into separate files and arrange everything using includes in a "master" .asm file, rather than using a monolithic .asm file with everything.

OK I changed my variables definitions to the .dsb 1 format and I can see how helpful it is. There is a lot of syntax that I am unfamiliar with or not aware of its existence so it's good to learn these things. Any good links for a comprehensive explanation of all that asm6 has to offer?

I'm just wondering what you would suggest for a compiling batch file. I am using the following:

Code:

@echo offcmd /k asm6 NFL.asm

There are problems with this batch file:1) It doesn't open up the game right after the .bin file is produced and so I have to do two actions: run the batch then open the file it produces.2) When there is an error in my code, it deletes the old .bin file.

This is what I would like my batch file to do every time I use it to compile:1) It produces a .nes file instead of .bin. Notice I didn't select the file extension .bin; ASM6 produces that on its own. Still runs, but... ya know.2) It deletes all open occurrences of the previous emulator and command prompt when I run the batch file so that at most one of each will be on the screen at a time.3) When there are no errors compiling, it exits the command prompt. When there is an error compiling, the command prompt stays open and doesn't delete the previous .bin file (or .nes if the file extension is fixed)

This one should do everything except for "deletes all open occurrences of the previous emulator". In the case of a successful build, the command prompt window will close when the emulator finishes. In the case of an unsuccessful build, the command prompt window will close when the pause command detects that the user has pressed a key.

Code:

@echo offasm6 NFL.asmif errorlevel 1 goto Failed

copy /Y NFL.bin NFL.nesC:\path\to\fceux.exe NFL.nesgoto :End

:Failedpause:End

Say you're developing your NFL game, and you're taking a break by playing some Thwaite. then you pause the game with the intent of coming back to it later. Do you want the Thwaite session to be closed just because your NFL build succeeded?

Who is online

Users browsing this forum: No registered users and 2 guests

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