Hacking ndstrim 1.27

Azimuth

Chicken Teriyaki Boy!
OP
Member
Joined
Feb 23, 2006
Messages
637
Trophies
0
Website
Visit site
XP
110
Country
Canada
If you don't know what ndstrim is check it out here

I've been working on a few front-ends for recover's excellent trimmer, the one I have invested most time in is the "daemon".

The daemon watches a directory for nds files(or 7z, zip and rar archives), when one is dropped into the watch directory it trims it and outputs it to the target directory(which could be your flashcart for example) deleting the original(if you want).


v 1.27
-reads input from config file
-added a few options(save original file, error file creation)
-made it more OO, was spaghetti code before


Hmm, this seems tailored to a niche market, *nix users who are proficient in CLI
smile.gif
. A small gui is included, it is very bare though.
Enjoy, any complaints/comments/general bitching are welcomed.

download
 

recover

Well-Known Member
Member
Joined
Aug 6, 2007
Messages
161
Trophies
1
Website
Visit site
XP
252
Country
Really, Azimuth, this is some very good work!
biggrin.gif

Sorry for not helping you so much, my DS is a bit broken and I'm gonna send it in for repair sometime.

I'm gonna link this thread in the first post in the original thread!
smile.gif


P.S: Nice that you're keeping the bowser icon
tongue.gif
 

Azimuth

Chicken Teriyaki Boy!
OP
Member
Joined
Feb 23, 2006
Messages
637
Trophies
0
Website
Visit site
XP
110
Country
Canada
No problem recover, I'm not in a hurry.

Small update for those of you who are interested, after 2 hours of reading gtk+ manuals and manually coding the gui I've come up with this



Still a long way to go but batch trimming is partially working.

I've also added gzip and bzip2 support to the daemon, I doubt anyone tars their roms but its there anyway.

edit: I'll release the source tomorrow, too tired right now.
 

Azimuth

Chicken Teriyaki Boy!
OP
Member
Joined
Feb 23, 2006
Messages
637
Trophies
0
Website
Visit site
XP
110
Country
Canada
There are two parts to ndstrim, the back-end is written in C(by recover) and then there is a GUI and a daemon that I'm working on which use that back-end. Quite confusing I know
tongue.gif
.

The back-end is cross platform(it being writtenin C and all), you can get the windows binary here. I included trim.bat because it's source code and excluded the .exe because I'm developing on Linux.

There is no OSX binary at the moment because no one has compiled it for OSX, so if someone can do that it would be appreciated.

The GUI should be cross platform but you will need to satisfy a few dependencies(Ruby, Ruby/GTK), it's still incomplete so I haven't tested it on other platforms yet.

I hope that answered your question.

----

In other news, I've almost completed the GUI

 

scandal_uk

Not Really There
Member
Joined
Oct 3, 2005
Messages
322
Trophies
0
Location
UK
XP
580
Country
United Kingdom
Hi there,

I made a 10 minute GUI once for NDSTrim using .Net (it was stand-alone as I just copied recover's code into VB). I still use it, but the main feature I like is the filenames being passed to the app as parameters.

This way I just keep a shortcut in my "send to" menu and the trimmer also renames the roms so that they don't overwrite anything.

Does your version do this? If so, I'll definitely upgrade as my version doesn't support archived roms!
 

Azimuth

Chicken Teriyaki Boy!
OP
Member
Joined
Feb 23, 2006
Messages
637
Trophies
0
Website
Visit site
XP
110
Country
Canada
I'll add command line arguments to the daemon tomorrow, thanks for the suggestion.

Currently extraction is done externally by calling a variety of programs which are *nix specific. My goal is to use only p7zip for linux and its windows equivalent 7za since they already support extraction of 7z, zip and rar.

As you can tell I'm not a windows dev and making this work on windows has not been a priority but since a few users have expressed interest I will do my best to make this cross platform.
 

recover

Well-Known Member
Member
Joined
Aug 6, 2007
Messages
161
Trophies
1
Website
Visit site
XP
252
Country
As I noted in ndstrim.c, I licensed it under GPLv2.
I guess we can update later revisions to GPLv3...
I noticed before that you chose GPLv3 in Google Project Hosting...
 

recover

Well-Known Member
Member
Joined
Aug 6, 2007
Messages
161
Trophies
1
Website
Visit site
XP
252
Country
Actually I think I do prefer v3, but everyone is entitled to their own opinion
biggrin.gif

I just hadn't authored a GPLv3 program by the time I made ndstrim, so I just copied the header from an old program I made, my newer open source stuff use GPLv3.
I vote to update later revisions to GPLv3.
 

Azimuth

Chicken Teriyaki Boy!
OP
Member
Joined
Feb 23, 2006
Messages
637
Trophies
0
Website
Visit site
XP
110
Country
Canada
Actually I think I do prefer v3, but everyone is entitled to their own opinion
biggrin.gif

I just hadn't authored a GPLv3 program by the time I made ndstrim, so I just copied the header from an old program I made, my newer open source stuff use GPLv3.
I vote to update later revisions to GPLv3.

I second that, GPLv3 it is.
QUOTE said:
Edit: Btw, can you change recover89 to only recover in the first post? Prefer it that way...

done.

Any plans on extending the trimmer?
 

recover

Well-Known Member
Member
Joined
Aug 6, 2007
Messages
161
Trophies
1
Website
Visit site
XP
252
Country
Well.. I guess I can do some stuff with the feedback I received in the original thread.
Let me see... the basic feature you need the trimmer to provide is to be able to give an output filename, right?
The thing I think will be most difficult to code is the command line parsing, it would be preferable to give it the ability to handle both single files (which your GUI might use) and multiple files.

I think the most common syntax for these things are:
Single file: ndstrim -o kaka-trimmed.nds kaka.nds
or ndstrim kaka.nds -o kaka-trimmed.nds
Multiple files: ndstrim kaka.nds blaff.nds blosck.nds
(forgive the unimaginative filenames. FYI kaka is cookie in Swedish)

I have never done any advanced command line parsing in C... ever.
I guess there is no better time to learn it but now.
biggrin.gif
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
  • SylverReZ @ SylverReZ:
    @Sonic Angel Knight, Is that SAK I see. :ninja:
  • BigOnYa @ BigOnYa:
    What a weird game
  • K3Nv2 @ K3Nv2:
    Yeah I wanted to see shards of the titanic
  • BigOnYa @ BigOnYa:
    I kept thinking jaws was gonna come up and attack
  • K3Nv2 @ K3Nv2:
    Jaws is on a diet
  • K3Nv2 @ K3Nv2:
    Damn power went out
  • BigOnYa @ BigOnYa:
    Ok xdqwerty, your little bro prob tripped On the cord and unplugged you
  • K3Nv2 @ K3Nv2:
    Ya I'm afraid of the dark hug me
  • BigOnYa @ BigOnYa:
    Grab and hold close your AncientBoi doll.
  • K3Nv2 @ K3Nv2:
    Damn didn't charge my external battery either
  • BigOnYa @ BigOnYa:
    Take the batteries out of your SuperStabber3000... Or is it gas powered?
  • K3Nv2 @ K3Nv2:
    I stole batteries from your black mamba
    +1
  • K3Nv2 @ K3Nv2:
    My frozen food better hold up for an hour I know that
  • BigOnYa @ BigOnYa:
    Or else gonna be a big lunch and dinner tomorrow.
  • BigOnYa @ BigOnYa:
    Did you pay your power bill? Or give all yo money to my wife, again.
  • K3Nv2 @ K3Nv2:
    Oh good the estimated time is the same exact time they just said
    +1
  • BigOnYa @ BigOnYa:
    Load up your pc and monitor, and head to a McDonalds dining room, they have free WiFi
  • K3Nv2 @ K3Nv2:
    Sir please watch your porn in the bathroom
    +2
  • BigOnYa @ BigOnYa:
    No sir we can not sell you anymore apple pies, after what you did with the last one.
  • K3Nv2 @ K3Nv2:
    We ran out
  • HiradeGirl @ HiradeGirl:
    for your life
    +1
  • K3Nv2 @ K3Nv2:
    My life has no value my fat ass is staying right here
    K3Nv2 @ K3Nv2: My life has no value my fat ass is staying right here