It is currently Tue Nov 21, 2017 1:24 am

All times are UTC - 7 hours





Post new topic Reply to topic  [ 7 posts ] 
Author Message
PostPosted: Sun Oct 01, 2017 9:55 am 
Offline

Joined: Mon May 25, 2009 2:20 pm
Posts: 38
Hello, im having a pretty annoying problem with how to include the NES header on my Megaman 3 romhack "megaman odyssey" without adding it at all from the NESASM assembler using that "-raw" command.

For now i just have the NESASM add a header for me like normal since things are fine but, it does not support editing the 8th byte of the header, the SaveRAM size. which must be an 04 in my game, cause i use 32 KB SRAM, with MMC5 mapper. but the assembler always sets it to 0.

The problem is, if i do the -raw command, then the rom is always missing the header. i've tried everything i could think of to manually add it in myself like ".bank 0 .org $0000 [header stuff here] [rom stuff here]" but it never gets added. :( and the rom size will repeatedly get 16 bytes cut off or shorter every single time i assemble rom unless i take off that dumb -raw command.

This is all solely "just" because i need byte 8 with 04...because the NESASM doesnt allow editing that byte. Im not sure what other information i need to provide, but i'll try if asked


Top
 Profile  
 
PostPosted: Sun Oct 01, 2017 10:37 am 
Offline
User avatar

Joined: Wed Sep 07, 2005 9:55 am
Posts: 304
Location: Phoenix, AZ
Could you have your header in file1, output the headerless rom to file2, and then merge them into file3? All of this in a batch file with your actual file names, something like this:

Code:
copy /b file1 + file2 file3


Top
 Profile  
 
PostPosted: Sun Oct 01, 2017 11:12 am 
Offline

Joined: Mon May 25, 2009 2:20 pm
Posts: 38
oh wow, so just a 16 byte file with the header alone ? wow i never even thought of that. i'll show what my compile thing looks like just in case ? i use a little program called "dd" which acts a failsafe so the NESASM can never delete the rom whenever there's any "compile errors" of any kind. Since assemblers to like to delete the roms ..i stopped that from happening heh

this is how my things look currently at the momment

Code:
dd if="MMC5 EXAtt MegaMan3.nes" of="testrom.nes" bs=16 skip=1
nesasm_x86 ody_kai.asm -autozp
rename "ody_kai.nes" "MMC5 EXAtt MegaMan3.nes"
move "MMC5 EXAtt MegaMan3.nes" "C:\My Documents\Backup clean rom\"
del "C:\My Documents\Backup clean rom\testrom.nes"


and this is the actual main NESASM file... whatever stuff
Code:
;ody_kai.asm
;nesasm3 script
   .db "NES", $1A ;nes header
   .inesprg $20   ;code
   .ineschr $40   ;graphics
   .inesmir 2     ;mirroring
   .inesmap 5     ;MMC5 mapper
;WARNING! byte 8 in header MUST be 4, it's not working!!
   .db $4         ;max SRAM size

   .bank 0
   .org $0000

   .incbin "C:\My Documents\Backup clean rom\testrom.nes"
   .include "src\main.asm"


Top
 Profile  
 
PostPosted: Sun Oct 01, 2017 12:07 pm 
Offline

Joined: Tue May 28, 2013 5:49 am
Posts: 872
Location: Sweden
There are forks of NESASM that supports NES 2.0 header directives I think. This one seems to do that, haven't tried it though.


Top
 Profile  
 
PostPosted: Sun Oct 01, 2017 12:32 pm 
Offline

Joined: Mon May 25, 2009 2:20 pm
Posts: 38
i umm, dont use anything about nes 2.0 though. the 32 KB saveRAM is the "only" thing i used, that i mentioned, because the MMC5 mapper supports it natrually.

and i kinda need to use this specific nesasm 2.51 autozp from a japanese site i got it off of, cause i have hundreds of labels names or addresses or whatever that "dont" use the little > thing next to them, cause of the autozp feature i wanted.

and no other "fork" i ever seen through countless hours and days of google searches ever had the autozp :(

http://www.2a03.jp/~minachun/nesasm/nesasm_x86.html
that's the one i use. So i cant really switch to anything else personally.

anyway back to the original point... i just have like a 16 byte .nes file with the header... and umm ... i guess put it "before" the "nesasm_x86 ody_kai.asm -raw -autozp"
line ?? or after ?


Top
 Profile  
 
PostPosted: Mon Oct 02, 2017 12:54 am 
Offline

Joined: Tue May 28, 2013 5:49 am
Posts: 872
Location: Sweden
I see, byte 8 of the iNES header isn't supported by NESASM, nor does emulators honor it in general (because ROMs tend to not set it correctly according to the wiki). This is why I don't like NESASM and its required bank directives (if it weren't for the banks you could probably implement the header manually without using those useless header directives).
If I were you I'd switch to an assembler that wasn't so limiting on things like this (like ASM6) and implement a NES 2.0 header ("Byte 10 of the NES 2.0 header should be reliable"). But I guess you are too far into the project to just switch assembler like that.

Quote:
anyway back to the original point... i just have like a 16 byte .nes file with the header... and umm ... i guess put it "before" the "nesasm_x86 ody_kai.asm -raw -autozp"
line ?? or after ?
It should be after that line. You would need to merge the header file with the NES file, and you can't do that until the NES file has been assembled/exists.


Top
 Profile  
 
PostPosted: Tue Oct 10, 2017 12:48 pm 
Offline

Joined: Mon May 25, 2009 2:20 pm
Posts: 38
awesome i did it. :) thank you.
I'll show a pastebin of what the batch file looks like now.

https://pastebin.com/GWXby7AS

I know it probably looks way too long and overly complex, but this just ensures that the NESASM will never delete the rom on compile errors since assemblers like doing that. -- the mmc5 exatt megaman3.nes (for reloading in FCEUX emu)

And whenever an error does happen like this for example, then it wont ever modify the rom or delete it. (the NES header is now always showing 04 on byte 8, perfect :)

-------------------------------
NES Assembler (v2.51+autozp beta3)

#[4] src/Level Events/Rapid Events.asm
7 20:9993 ldz cur_screen
Unknown instruction!
# 1 error(s)
The system cannot find the file specified.
The system cannot find the file specified.
Could Not Find ody_kai.nes
-------------------
alright, so thank you :)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

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