+  RHDN Forum Archive
|-+  Romhacking
| |-+  General Romhacking
| | |-+  Is this useful to anyone?
Pages: [1]
Author Topic: Is this useful to anyone?  (Read 887 times)
RedComet
Guest
« on: October 13, 2006, 11:46:33 am »

I wrote a program called Insert ASM to help when I'm doing NES work (I use x816 for that). With a little cleverness and a batch file, I can get something similar to xkas' ability to compile directly to the file.

I wasn't sure if I should submit this to the site or not, though, since it's more-or-less an automated copy and paste program. What do you guys think?
magusneo
Guest
« Reply #1 on: October 13, 2006, 10:58:04 pm »

Yeah,It's useful.Thanks.
What do you think of adding write HEX directly to the rom?For instance,"insert_asm dbz4.nes $00ffab00 3d809"will write $00ffab00 into the rom at $3d809.
RedComet
Guest
« Reply #2 on: October 13, 2006, 11:41:58 pm »

Yeah, that's doable. I actually could find a use for that when changing JMP instructions to point to new code. Thanks for the idea! Cheesy
RedComet
Guest
« Reply #3 on: October 16, 2006, 03:33:48 pm »

http://www.rpgclassics.com/subsites/twit/progs/insert_asm_101.zip

It now supports both file insertion and raw hex (supplied at the command prompt in place of the file to insert). I fed it $200 bytes and didn't have a problem. Anything larger I can't guarantee, but $200 should be more than enough. Wink

I also added a little documentation for the hidden stop address argument. It was in the first release, but you'd only know about it if you ran the program without the proper number of arguments.

Let me know if you have any problems with it.
magusneo
Guest
« Reply #4 on: October 16, 2006, 11:53:13 pm »

Thank you!

But it seems insert_asm1.01 can't work properly here,even this command"insert_asm test.bin $1337bead 2" got a crash. Undecided\

And I often got an error "Encountered an invalid character in the hexadecimal string" if I typed something like"insert_asm test.bin $1337bead1413121f 2". Roll Eyes
RedComet
Guest
« Reply #5 on: October 17, 2006, 08:49:55 am »

Well this is interesting. I get the same error if I run it from the command line, but if I feed it the arguments from within Visual C++ it runs fine. Huh

Might take me a little bit to figure this one out.

EDIT: I recompiled the source with Dev-C++ and it works perfectly. I think Visual C++ throws a lot of extra shit in the .exe because version 1.02 is nearly 1/4 the size of the others. Anyway, here it is. Let me know if you have any more troubles.

I'm gonna see what exactly was pissing Visual C++ off, though, in the meantime.
« Last Edit: October 17, 2006, 09:00:50 am by RedComet »
magusneo
Guest
« Reply #6 on: October 17, 2006, 09:40:07 am »

Thanks.
But I still got crash when inserting 8 or 12 or 16 or more(multiple of 4) bytes' HEX into the rom. Undecided\
RedComet
Guest
« Reply #7 on: October 17, 2006, 09:46:23 am »

Quote from: magusneo on October 17, 2006, 09:40:07 am
Thanks.
But I still got crash when inserting 8 or 12 or 16 or more(multiple of 4) bytes' HEX into the rom. Undecided\

Could you be a little more specific? I just tried the following and had no problems: insert_asm test.smc $1337bead2766889abf 2
magusneo
Guest
« Reply #8 on: October 17, 2006, 11:39:00 am »

I tried"insert_asm test.smc $1337bead2766889a 2","insert_asm test.smc $1337bead2766889a11111111 2" and "insert_asm test.smc $1337bead2766889a1111111122222222 2",both commands got crash.
Nightcrawler
Guest
« Reply #9 on: October 17, 2006, 11:53:43 am »

RedComet:

Visual C++ builds in 'Debug' mode by default. This will compile the output to contain a bunch of extra debugging stuff to run with the Visual C++ debugger. You can change this to 'Release' Build. You're output exe will be MUCH smaller.

What version of Visual C++ are you using by the way? I hope it's not the old Visual C++ 6.0. That's pretty crappy compared to newer versions as far as supporting standards, being less buggy, and working on newer platforms. I just ask because I've seen some weird crap like that before where running from within will work, but running it externally would crash.
RedComet
Guest
« Reply #10 on: October 17, 2006, 12:05:39 pm »

NC: I compiled the builds under Release and they were 80kb (the Debug build is around 170kb or so), and
the  exe compiled with Dev-C++ is 27kb.

I'm using the latest Visual C++ Express 2005 because it's free and it's debugger rocks. Smiley

I have no idea why this is crashing, but it does for me too, but again, not from within the IDE. I wonder if it's because there's no set limit on the size of the hex string.
Nightcrawler
Guest
« Reply #11 on: October 17, 2006, 02:46:54 pm »

Hmm.. that's strange. The size difference between VC and DevC++ is also quite interesting. I wonder what is being done differently.

Well, if you really want to know what's going on, you can write some debugging code in your application to print out some things along the way and catch exactly where it crashes. Strings and buffers without limits can certainly lend themselves to unexpected crashes. It sounds like some sort of memory bounds thing like that, but that's just a guess.

That's the problem with these blasted high level language compilers. Unless you REALLY get into it, you don't know what the compiler is doing.

SOMETIMES I prefer assembly where you have full control and nothing happens unless you tell it to. Of course, then when it takes me 20x more code to do a task that takes 1 line in C, I quickly remember to appreciate high level languages. Smiley
RedComet
Guest
« Reply #12 on: October 17, 2006, 03:05:02 pm »

Quote from: Nightcrawler on October 17, 2006, 02:46:54 pm
SOMETIMES I prefer assembly where you have full control and nothing happens unless you tell it to.

Amen.
Pages: [1]  


Powered by SMF 1.1.4 | SMF © 2006-2007, Simple Machines LLC