Romhacking.net

General Category => News Submissions => Topic started by: RHDNBot on July 25, 2006, 06:24:37 pm

Title: Utilities: NINJA 2.0 July 26 Beta
Post by: RHDNBot on July 25, 2006, 06:24:37 pm
This is an automated message generated by Romhacking.net's RHDNBot.

Update By: D

A new beta has been uploaded for NINJA 2.0. The following changes have been made since the last version archived on ROMHacking.net:


NINJA 2.0 is a new patch format that supports internal display data, file validation, directory patching, and can create patches that will work on any ROM format for NES, SNES, Game Boy, Nintendo 64, TurboGrafx-16, Sega Genesis, Sega Master System and Atari Lynx.

The official NINJA patcher can apply the following patch formats:

If you add xdelta.exe to the NINJA folder, NINJA can also be used as a graphical front end for xdelta format patches.

This will be the final beta. Please report any and all bugs and behavioral issues in either this post's thread on ROMHacking.net's forum or on the NINJA support forum at http://ninja.cinnamonpirate.com/bb/ (http://ninja.cinnamonpirate.com/bb/).

Relevant Link: (http://ninja.cinnamonpirate.com/)
Title: Re: Utilities: NINJA 2.0 July 26 Beta
Post by: D on July 28, 2006, 11:16:57 am
Just a note: the GUI has undergone a rewrite and the final release will now support an asynchronous process for accessing the NINJA back end. This means output will be printed to the screen in realtime and you won't see NINJA completely lock anymore while the patching completes. To take advantage of this, I am making output more verbose so users can know things are still chugging along.

Also, I'm trying to rewrite libPirate this weekend to be a class-based library. If I succeed, the final NINJA release will be what I planned all along, little more than an interface to libPirate (which FEIDIAN 1.0 will also be).
Title: Re: Utilities: NINJA 2.0 July 26 Beta
Post by: RedComet on July 28, 2006, 03:10:52 pm
I've been using Ninja to create the patches during the testing phase of my latest patch, and I was wondering if there's anyway to save a template for the creator? I like to be thorough and fill in every blurb even if it's a private patch and filling in the same fields with same information over and over is a bit tedious. Having the ability to save a template would be a godsend. :)
Title: Re: Utilities: NINJA 2.0 July 26 Beta
Post by: D on July 28, 2006, 07:44:55 pm
I don't really want to write anything that complex, but how about just storing your last used values to the registry then reloading them when you start the patch creator?
Title: Re: Utilities: NINJA 2.0 July 26 Beta
Post by: RedComet on July 28, 2006, 08:19:27 pm
Yeah, that'd work. Maybe a way to toggle it so people who don't want it don't have to deal with it?
Title: Re: Utilities: NINJA 2.0 July 26 Beta
Post by: Nightcrawler on July 28, 2006, 08:28:32 pm
Why it would be much work? You can just save a structure containing the data to a file and call it up again.
Title: Re: Utilities: NINJA 2.0 July 26 Beta
Post by: Kiyoshi Aman on July 29, 2006, 04:44:32 am
...eww.

Please don't advocate using the registry ever again, D. Even Microsoft wants people to stop raping it.
Title: Re: Utilities: NINJA 2.0 July 26 Beta
Post by: D on July 29, 2006, 06:03:28 am
I already use it to store all NINJA's settings because it's easy.

Nightcrawler: I won't add that because I don't care enough.
Title: Re: Utilities: NINJA 2.0 July 26 Beta
Post by: creaothceann on July 29, 2006, 07:00:54 am
Quote from: Dumbledore
... you have to make a choice between what is right and what is easy ...

Title: Re: Utilities: NINJA 2.0 July 26 Beta
Post by: D on July 29, 2006, 09:50:50 am
I have no idea what a Dumbledore is, but I do know registry takes me two lines of code while some stupid system of INI files will take me 20, not to mention a week to implement since I haven't read an INI file with VB since 1997.

The patch creator is very much an afterthought UI. That is why it does not have multiple languages in its interface. The patch applier is what most people will be using, and therefore what gets the most effort.
Title: Re: Utilities: NINJA 2.0 July 26 Beta
Post by: creaothceann on July 29, 2006, 12:38:06 pm
Uhm...

GetPrivateProfileInt - reads integer value
GetPrivateProfileString - reads string value
GetPrivateProfileStruct - reads binary data
WritePrivateProfileString - sets string value
WritePrivateProfileStruct - sets binary data
Title: Re: Utilities: NINJA 2.0 July 26 Beta
Post by: Kiyoshi Aman on July 29, 2006, 05:49:00 pm
I dunno about you, but using the registry makes the app less portable; I could engineer .ini reading in Perl that could take an .ini NINJA made and applied those values when creating patches.

Using the registry requires me to add more functions, including one that's OS-specific, and in the end is pointless addition of code anyway.
Title: Re: Utilities: NINJA 2.0 July 26 Beta
Post by: D on July 30, 2006, 12:47:50 am
Aerdan: Because Visual Basic is a portable language? This is the UI. The UI is VB.
Title: Re: Utilities: NINJA 2.0 July 26 Beta
Post by: Kiyoshi Aman on July 30, 2006, 01:00:30 am
*shrug* I'd support value-saving in the CLI version, too. [In fact, Samurai will support such.]
Title: Re: Utilities: NINJA 2.0 July 26 Beta
Post by: Lilinda on July 30, 2006, 02:32:58 am
I have no idea what a Dumbledore is,

never read/watched harry Potter?

and/or lived in a cave for the past 7 years?
Title: Re: Utilities: NINJA 2.0 July 26 Beta
Post by: RedComet on July 30, 2006, 02:47:31 am
I have no idea what a Dumbledore is,

never read/watched harry Potter?

and/or lived in a cave for the past 7 years?

I had to look it up, too. And for that, I am happy.
Title: Re: Utilities: NINJA 2.0 July 26 Beta
Post by: Lilinda on July 30, 2006, 02:50:28 am
you should actually be really, really sad, as the books are completely awesome.
Title: Re: Utilities: NINJA 2.0 July 26 Beta
Post by: RedComet on July 30, 2006, 03:14:16 am
Well, I'll try not to be. I got about halfway through the first one and put it down.
Title: Re: Utilities: NINJA 2.0 July 26 Beta
Post by: creaothceann on July 30, 2006, 04:26:27 am
The best one is the 3rd...

Aerdan: Because Visual Basic is a portable language? This is the UI. The UI is VB.

It'd be easily portable from one PC to the next.
Title: Re: Utilities: NINJA 2.0 July 26 Beta
Post by: D on July 30, 2006, 05:11:12 am
I'm probably going to make it registry now just to spite you.
Title: Re: Utilities: NINJA 2.0 July 26 Beta
Post by: KaioShin on July 30, 2006, 07:07:53 am
I'm probably going to make it registry now just to spite you.

That's the D we know and love  :D
Title: Re: Utilities: NINJA 2.0 July 26 Beta
Post by: Nightcrawler on July 30, 2006, 11:51:29 am
Aerdan: Because Visual Basic is a portable language? This is the UI. The UI is VB.

You're using VB .NET. That IS somewhat portable and should become more portable as time goes on and .NET support on other platforms gets better. Microsoft themselves are porting .NET to the Mac, and there is more than one .NET projects to run it on Linux which should only get better.

The days of VB not being portable are numbered. VB .NET is vastly different than VB6 which would never be portable to much of anything.
Title: Re: Utilities: NINJA 2.0 July 26 Beta
Post by: D on July 30, 2006, 12:26:24 pm
Because VB is portable when I am not releasing the source code to the --front end--?

It would be a million times smarter and easier for someone to just make a new front end for those systems. For Linux it would be better done with GTK or QT, and for Mac, Carbon or whatever they current thing is.
Title: Re: Utilities: NINJA 2.0 July 26 Beta
Post by: Nightcrawler on July 30, 2006, 12:53:53 pm
Because VB is portable when I am not releasing the source code to the --front end--?

It would be a million times smarter and easier for someone to just make a new front end for those systems. For Linux it would be better done with GTK or QT, and for Mac, Carbon or whatever they current thing is.

YES, the FRONT END will be portable. Winforms is what ALL .NET language use for the GUI and what will be interpreted on other .NET platforms as far as I can tell.

Winforms in Mono(runs .NET on linux) is done via option of GTK or WINE.  On dotGNU, it winforms is done via QT. The Mac .NET initiative from Microsoft will also have some sort of Winforms support, but I have not read up on it to know how it will be done.

So, .NET applications should be fully portable as far as I can tell unless I'm missing something obvious.

VB is merely an interface for .NET for all practical purposes. It's just as portable as managed C++, C# and the other .NET languages from my understanding.
Title: Re: Utilities: NINJA 2.0 July 26 Beta
Post by: D on July 30, 2006, 01:15:08 pm
So there is no need to even recompile it?

That means .NET win32 apps are cross-platform, not portable.
Title: Re: Utilities: NINJA 2.0 July 26 Beta
Post by: Nightcrawler on July 30, 2006, 06:40:18 pm
So there is no need to even recompile it?

That means .NET win32 apps are cross-platform, not portable.

Right, I don't think it needs to be. .NET applications are compiled into an intermediate language known as the Common Language Runtime/Common Intermediate Language. Is essentially .NET virtual machine code for practical purposes, although it's not quite like Java. With .NET before the program executes it is compiled into native machine code.

Yes, the term should be cross-platform, not portable. My mistake. I think the only limitation is what features of .NET are currently supported and to what compatibility level they are in those other programs such as Mono or dotGNU. Obviously Winforms is crucial for the GUI.

I haven't actually used any of them to try them out, so I am no expert. And as of now .NET framework for Macs has not been released yet by MS, but it is coming.

So, it's not totally cross platform yet, but it's definitely getting there quickly.

It might be a good idea if we ask somebody who does use Mono or dotGNU to see if they can run the front end. As I said, I've never actually put this to the test myself and I don't run a linux machine aside from the ROMhacking.net server. ;)

I'm interested to know if it does work and/or what problems there might be.





Title: Re: Utilities: NINJA 2.0 July 26 Beta
Post by: D on July 31, 2006, 12:16:29 am
I would assume this framework must at least emulate the windows registry for data storage then, otherwise a whole lot of applications would be fucked. There's still a lot of stuff that has reason to be stored in the registry that would be lost then.

Since there's no way I'm going to make the August 1st release I was hoping for, I'll consider rewriting the GUI to use an INI file, but the chances of me creating any INI loader for storing templates for the patch creator is still very minimal. That program is already getting cluttered, and adding more will make it difficult for anyone without a widescreen monitor to use.
Title: Re: Utilities: NINJA 2.0 July 26 Beta
Post by: Kiyoshi Aman on July 31, 2006, 06:04:51 am
Uh, no. Only the OS itself should use the registry. Everything else should use per-user configuration files.
Title: Re: Utilities: NINJA 2.0 July 26 Beta
Post by: Nightcrawler on July 31, 2006, 09:25:37 am
I would assume this framework must at least emulate the windows registry for data storage then, otherwise a whole lot of applications would be fucked. There's still a lot of stuff that has reason to be stored in the registry that would be lost then.

Since there's no way I'm going to make the August 1st release I was hoping for, I'll consider rewriting the GUI to use an INI file, but the chances of me creating any INI loader for storing templates for the patch creator is still very minimal. That program is already getting cluttered, and adding more will make it difficult for anyone without a widescreen monitor to use.

If you are Accessing the Registry with the .NET Framework and not the standard VB functions, I'd assume it would HAVE to be emulated or handled with some equivalant in the .NET framework for other platforms. I couldn't really find any information on this. I can't imagine only selected classes in the framework would be supported. That sounds stupid. That kills the whole idea of using on other platforms effectively. However, I did find that there are two ways to access the registry in VB .NET. One is with VB functions, and the other is with the .NET framework.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dv_vstechart/html/vbtchAccessingRegistryWithVisualBasicNET.asp
Title: Re: Utilities: NINJA 2.0 July 26 Beta
Post by: D on July 31, 2006, 09:58:23 am
I'll assure you I already access within the .NET framework.

Quote
Conclusions

The registry is an optimal location for saving information about your application as well as individual user settings. You may also need to check information about system hardware, or applications with which yours will interact.

Microsoft agrees that my use of the registry is appropriate. Aerdan, back the fuck off.
Title: Re: Utilities: NINJA 2.0 July 26 Beta
Post by: Kiyoshi Aman on July 31, 2006, 12:42:08 pm
This article was written over four years ago. Since then, I'm pretty sure Microsoft has started telling people to back off. I'm also pretty certain that Microsoft has disabled the Windows technology that sucks any .ini files it finds into the registry. [Unfortunately, however, a quick Google search didn't turn up any articles about it, but writing to the registry is still A Bad Idea for cross-platform apps.]

EDIT: Also, for *really* cross-platform config stuff, consider using Elektra.

Quote from: IRC
[11:36:57] <@LeoNerd> Elektra == library for using GConf on GNOME, Registry on Win32, K[whatever] on KDE, ini / XML / whatever files otherwise..
[11:37:08] <@LeoNerd> Abstracted out so program Doesn't{Know,Mind,Care} what's going on
Title: Re: Utilities: NINJA 2.0 July 26 Beta
Post by: Kitsune Sniper on July 31, 2006, 06:40:37 pm
D, if you do go the registry route, could you at least include some sort of switch that nukes all Ninja-related registry entries? I ask because I've had quite a few problems with programs that use the registry, and if the keys are damaged, they won't even start up. :)
Title: Re: Utilities: NINJA 2.0 July 26 Beta
Post by: Nightcrawler on August 01, 2006, 09:43:58 am
D, if you do go the registry route, could you at least include some sort of switch that nukes all Ninja-related registry entries? I ask because I've had quite a few problems with programs that use the registry, and if the keys are damaged, they won't even start up. :)

Agreed. Number one on that list is LunarAddress. For some damn reason is constantly gets corrupt keys and fails to start. It's a nice utility, but I still brand it crap since it hardly works.
Title: Re: Utilities: NINJA 2.0 July 26 Beta
Post by: D on August 01, 2006, 10:54:57 am
Kitsune: I am not sure it can actually be a problem ... The only things stored in the registry are yes/no values for whether or not to associate a file with ninja, a yes/no whether to associate at all, your UI language (which if it doesn't exist or corrupted would just default to English, and switching again would reset the value), and which style icons to use.

If any of the values corrupted, you'd just end up going down an if/else path to either the default action or no action. But the program would still run just fine ... and changing the config option would reset the value to work anew.
Title: Re: Utilities: NINJA 2.0 July 26 Beta
Post by: FuSoYa on August 01, 2006, 04:39:28 pm
Agreed. Number one on that list is LunarAddress. For some damn reason is constantly gets corrupt keys and fails to start. It's a nice utility, but I still brand it crap since it hardly works.

That's strange...  did you get any sort of error message from windows to indicate that it was a registry problem?

And would you mind using regedit to export the program's registry keys to a file and sending it to me (or just posting the contents)?  You can find the keys in [HKEY_CURRENT_USER\Software\LunarianConcepts\LunarAddress].
Title: Re: Utilities: NINJA 2.0 July 26 Beta
Post by: Nightcrawler on August 01, 2006, 06:41:19 pm
Agreed. Number one on that list is LunarAddress. For some damn reason is constantly gets corrupt keys and fails to start. It's a nice utility, but I still brand it crap since it hardly works.

That's strange...  did you get any sort of error message from windows to indicate that it was a registry problem?

And would you mind using regedit to export the program's registry keys to a file and sending it to me (or just posting the contents)?  You can find the keys in [HKEY_CURRENT_USER\Software\LunarianConcepts\LunarAddress].

No, this is the problem I reported to you a long long time ago(a few years now) that you completely ignored my e-mail of. :P

It pretends to start and shows up in the task bar, but the actual window never displays.

I know it is the registry because if I delete the registry keys for your program and try again after that, everything works again. It's done this on THREE different computers now over the course of the last few years.

I know where to find the keys. ;) I usually have to delete them anytime I want your program to run.

Coincidentally, it happens to be working now. I haven't bothered to use it in a long while.





Title: Re: Utilities: NINJA 2.0 July 26 Beta
Post by: FuSoYa on August 02, 2006, 12:38:51 am
Sorry, but I probably didn't get that email.  My old moon.co.jp address turned out to be somewhat unreliable, which is why I stopped using it.  ;)

Anyway, I've never heard of that problem before, nor have I ever experienced it myself (and I've used the program quite frequently over the years...  I'm on my second machine and third version of windows).

If the program's X/Y screen coordinate settings from the registry were set outside your current desktop area, that could cause what you're describing.  Except there are already checks in the program for this, in case someone switches screen resolutions between program sessions.  Although it might not be checking for negative coordinates...

But if this happened pretty much every time you ran the program and you always had to delete the keys to get it to display again, I would suspect possible interference from any extra window management software you may have installed.  Deleting LA's X/Y registry keys will cause the program not to even try setting it's own position the next time it runs.
Title: Re: Utilities: NINJA 2.0 July 26 Beta
Post by: RedComet on August 02, 2006, 03:58:53 am
It pretends to start and shows up in the task bar, but the actual window never displays.

Yeah, I had the same thing happen to me, except it would start minimized in the task bar, but when I went to maximize it, it would maximize outside my desktop area. Restarting the program didn't help. This was on WinXP. I don't think I ever had this problem on Win98SE, but I can't remember.
Title: Re: Utilities: NINJA 2.0 July 26 Beta
Post by: FuSoYa on August 02, 2006, 05:33:50 am
*mulls the problem over for a while, then starts LA, minimizes it, closes it while minimized, and starts it again*

Ah... umm... guess I should have checked for negative coordinates after all.  Looks like a new version will have to be released.

Title: Re: Utilities: NINJA 2.0 July 26 Beta
Post by: Tauwasser on August 02, 2006, 11:50:50 am
Sorry to interrupt, but heck...

According to this (http://ninja.cinnamonpirate.com/files/filespec20.txt). The first sector of the patch should be only 1024 Bytes... right? Well, considering that I actually made a patch today with no other information in it except changes, the header is 0x800 Bytes long, which is double of what the specs say ... It matches only if all the data is present to the last byte, even if unused. Couldn't that be reduced to a "00" byte for no content? That way, you can still input 256 Bytes or whatever in a single read, just that it would stop printing on the first "00" in the read data. Well, I know it's final Beta and I apologize for not noticing earlier, but that seems like a whole lot of data in there for nothing. The actual patching data is 0xD8 bytes long... This doesn't compare quality/quantity-wise :-/

cYa,

Tauwasser
Title: Re: Utilities: NINJA 2.0 July 26 Beta
Post by: Kiyoshi Aman on August 02, 2006, 01:20:59 pm
D hasn't updated the file specs yet, apparently. :p

Read format.html; it's in the NINJA zipfile.
Title: Re: Utilities: NINJA 2.0 July 26 Beta
Post by: D on August 02, 2006, 09:28:20 pm
My apologies. I updated the specs but somehow missed that line. if you look at the specs and add up all the values it is 2048.
Title: Re: Utilities: NINJA 2.0 July 26 Beta
Post by: D on August 06, 2006, 06:20:01 am
Hey guys, here is what is probably the final version of the UI. You can copy this over what came in the last release.

This should take care of the GUI lockup issues people were having now that the program is spawned as an asynchronous process.

This also includes an update to have Aqua style icons and associations for UPS files (the next release of the patcher backend will have support for byuu and Nach's UPS format.

I'm hoping to have the real final out next some time after the 15th.

I am not going to add support for autoloading values in the patch creator. I can think of very few cases where this would be necessary, because even if you were reusing it again and again to build the same patch, you'd still be changing the release date. If there are enough people who ask for it to remember last values, I will use the registry. I am not going to add INI files, so if you want that: write your own front end or use the command line which just depends on a plaintext file for that info anyway.

(http://ninja.cinnamonpirate.com/img/aqua-icons.png)

[attachment deleted by admin]