NeoGeoX Hacking and Mods

nerdstick

Crossed Swords Squire
Joined
Oct 1, 2012
Posts
183
Would it be possible to use a replacement microSD, and set up identical partitions except for the rom partition which can be expanded to 1.5gigs, then the rest identical for the other necessities? Could be useful to have a different microSD to test on, so the factory stuff is still there.

That's what I had in mind, but the partitions are a linux format so it's a bit out of my league. Although getting all the partitions accessible via USB seems like the main priority. Is there some sort of INI/config that decides what mounts via USB?

Exactly what I was thinking. Which sadly means I'll probably be getting one of the non-SD ones :( I was on the fence for so long...should have just pulled the trigger when I originally wanted to.

To be fair, even if you had you'd have had a good chance of receiving a 370. Breaking the SD's encryption is the best bet anyways.
 

Lee Gray

SSVS Special Plz..., Buying & Selling that, Never
Joined
Sep 21, 2001
Posts
7,506
Man you guys did great :) I'll fiddle with mine as soon as a "SD card soft mod" is available.

I still have every intent of purchasing future card releases :)
Me too, I like the idea of a unibios to play the games but I defo wont put play any non official games on it unless they are not released. as would rather support the company.
 

nerdstick

Crossed Swords Squire
Joined
Oct 1, 2012
Posts
183
Nah, you got it. Just dd the partitions to the new SD, then use GParted to resize. Nice GUI makes it easy.

I'll promise to give it a shot if someone can figure out how to add more games to the binary, then. This is more of a second step until that point, otherwise it's just easier replacing.
 

smasherimp

n00b
Joined
Dec 20, 2012
Posts
5
Nah, you got it. Just dd the partitions to the new SD, then use GParted to resize. Nice GUI makes it easy.

Hmmmm, I might have to get Linux dual booting on my new laptop ASAP. Though I can't do ANYTHING until my system actually comes, I ordered it from the Hong Kong store which shipped on the 22nd. Hoping i get 337 or 357 >.<

Someone mentioned before that the BIOS are inside each individual rom. Would this mean one would have to manually inject the desired BIOS into each rom we decide to put on if we can get these additional roms working instead of the replacement system??
 

nerdstick

Crossed Swords Squire
Joined
Oct 1, 2012
Posts
183
Does anybody know where to buy miniature coil springs? That they use for the trigger buttons. Something tells me that if I keep opening this thing up I'm going to lose one :)
 
Joined
Jun 25, 2011
Posts
47
I'm in way over my head, I'm trying to use RecStudio to decompile "snk_desktop.bin" and get some understanding of how it decides an SD card is worth reading or not.

This may be a related code block that determines when to change the icon. I'm assuming it's referring to the external SD card with "tfcard", even though it's not really MicroSD/TF.

Code:
int get_tfcard_state()
{// addr = 0x00413618  --  defined in 'src/input.c' at line 168
    char[19] tfcard_state;                 // _cfa_ffffffe8
    intOrPtr _v4;                          // _cfa_fffffffc
    intOrPtr _v8;                          // _cfa_fffffff8
    int temp_draw_tf_card;                 // _cfa_ffffffe4
    FILE* _v32;           // _cfa_ffffffe0
    intOrPtr _v40;                         // _cfa_ffffffd8
    intOrPtr _t72;                         // _t72
    _unknown_ _t73;                        // _t73

    __sp = __sp + -56;
    _v4 = __ra;
    _v8 = _t72;
    _t73 = __sp;
    _v40 = 0x32928 + __t9;
    if(tfcard_fp != 0) {
        rewind(tfcard_fp);
        fgets( &temp_draw_tf_card, 20, tfcard_fp);
        if(strstr( &temp_draw_tf_card, 0x42999c) == 0) {
            _v32 = 1;
        } else {
            _v32 = 0;
            tf_card_open = 0;
            if(game_card_init_ok != 0) {
                deinit_game_card_conf();
            }
            fclose(tfcard_fp);
            tfcard_fp = 0;
        }
    }
    _t73 = _t73 + 56;
    return _v32;
}
It looks like it gets the first 20 characters of the card, then does a string comparison of those characters to something in memory, and if there's a match then the icon (maybe) changes.
 

smasherimp

n00b
Joined
Dec 20, 2012
Posts
5
I'm in way over my head, I'm trying to use RecStudio to decompile "snk_desktop.bin" and get some understanding of how it decides an SD card is worth reading or not.

This may be a related code block that determines when to change the icon. I'm assuming it's referring to the external SD card with "tfcard", even though it's not really MicroSD/TF.

Code:
int get_tfcard_state()
{// addr = 0x00413618  --  defined in 'src/input.c' at line 168
    char[19] tfcard_state;                 // _cfa_ffffffe8
    intOrPtr _v4;                          // _cfa_fffffffc
    intOrPtr _v8;                          // _cfa_fffffff8
    int temp_draw_tf_card;                 // _cfa_ffffffe4
    FILE* _v32;           // _cfa_ffffffe0
    intOrPtr _v40;                         // _cfa_ffffffd8
    intOrPtr _t72;                         // _t72
    _unknown_ _t73;                        // _t73

    __sp = __sp + -56;
    _v4 = __ra;
    _v8 = _t72;
    _t73 = __sp;
    _v40 = 0x32928 + __t9;
    if(tfcard_fp != 0) {
        rewind(tfcard_fp);
        fgets( &temp_draw_tf_card, 20, tfcard_fp);
        if(strstr( &temp_draw_tf_card, 0x42999c) == 0) {
            _v32 = 1;
        } else {
            _v32 = 0;
            tf_card_open = 0;
            if(game_card_init_ok != 0) {
                deinit_game_card_conf();
            }
            fclose(tfcard_fp);
            tfcard_fp = 0;
        }
    }
    _t73 = _t73 + 56;
    return _v32;
}
It looks like it gets the first 20 characters of the card, then does a string comparison of those characters to something in memory, and if there's a match then the icon (maybe) changes.

Under the 'else' clause, if you changed the _v32 = 0; to _v32 = 1; and tf_card_open = 0; to tf_card_open = 1; and saved it, it may then open the card even if the prerequisite conditions aren't met. Considering we don't know the prerequisites, we have no chance of getting the correct string comparison on another SD card, so it would default to the else every time anyway? And if something screws up you can always change them back to 0's. Just a thought, as like you I'm way in over my head too. Really awesome find either way :)
 

nerdstick

Crossed Swords Squire
Joined
Oct 1, 2012
Posts
183
I posted something back on Page 6 that may be of use towards this:
card_game_work_path=/mnt/mmc/card_game/
card_game_number=5

I assume card_game is where the rom is located? The number may be related to what image loads for it.
 
Joined
Jun 25, 2011
Posts
47
I saw an interesting block that did figure in that card_game_number (probably just going to serve to obscure things more, but here it is):

Code:
int tf_change_step(int temp_step)
{// addr = 0x0041E424  --  defined in 'src/tfcard_cartoon.c' at line 157
    int _v0;                               // _cfa_0
    intOrPtr _v4;                          // _cfa_fffffffc
    intOrPtr _t83;                         // _t83
    _unknown_ _t84;                        // _t84

    __t9 = __t9;
    __a0 = __a0;
    __sp = __sp + -8;
    _v4 = _t83;
    _t84 = __sp;
    _v0 = __a0;
    if(tfgame_less_than_5 != 0) {
        if(_v0 <  &tfcard_cartoon->card_game_num + -1) {
            if(_v0 < 0) {
                _v0 = 4;
            }
        } else {
            _v0 = 4;
        }
    } else {
        if(_v0 != -2) {
            if(_v0 != -1) {
                if( &tfcard_cartoon->card_game_num != _v0) {
                    if( &tfcard_cartoon->card_game_num + 1 != _v0) {
                        if( &tfcard_cartoon->card_game_num + 2 == _v0) {
                            _v0 = 2;
                        }
                    } else {
                        _v0 = 1;
                    }
                } else {
                    _v0 = 0;
                }
            } else {
                _v0 =  &tfcard_cartoon->card_game_num + -1;
            }
        } else {
            _v0 =  &tfcard_cartoon->card_game_num + -2;
        }
    }
    _t84 = _t84 + 8;
    return _v0;
}

smasherimp, that sounds like a good idea. I think it would just be a matter of changing this line of machine code:

Code:
 0x004136D4: beq v0,zero,L0041375C

To always branch to that address. I'll see if I can get the modified binary made.

Here's another interesting block:

Code:
int tfcard_game_check()
{// addr = 0x0041D6C0  --  defined in 'src/tfcard_cartoon.c' at line 43
    char[255] temp_path;                   // _cfa_fffffed0
    intOrPtr _v4;                          // _cfa_fffffffc
    intOrPtr _v8;                          // _cfa_fffffff8
    char** _v16;                           // _cfa_fffffff0
    char* _v20;                            // _cfa_ffffffec
    int _v24;                              // _cfa_ffffffe8
    struct * _v28;            // _cfa_ffffffe4
    char** _v32;                           // _cfa_ffffffe0
    char* _v36;                            // _cfa_ffffffdc
    int _v40;                              // _cfa_ffffffd8
    struct * _v44;            // _cfa_ffffffd4
    int _v48;                              // _cfa_ffffffd0
    int i;                                 // _cfa_fffffecc
    int _v312;                             // _cfa_fffffec8
    intOrPtr _v320;                        // _cfa_fffffec0
    char* _v324;                           // _cfa_fffffebc
    char _v2360;                           // _cfa_fffff6c8
    intOrPtr _t271;                        // _t271
    _unknown_ _t272;                       // _t272

    __sp = __sp + -2376;
    _v4 = __ra;
    _v8 = _t271;
    _t272 = __sp;
    _v320 = 0x28880 + __t9;
    _v44 =  &card_game_cf;
    _v324 = "card_game_number";
    _v40 = 0;
    _v36 =  &_v2360;
    _v32 =  &(_v44->key[4]);
    while(_v40 < 2036) {
         *(_v36 + _v40) =  *(_v32 + _v40) & 255;
        _v40 = _v40 + 1;
    }
     &tfcard_cartoon->card_game_num = cfg_get_key_value_to_int();
    _v28 =  &card_game_cf;
    _v324 = "card_game_work_path";
    _v24 = 0;
    _v20 =  &_v2360;
    _v16 =  &(_v28->key[4]);
    while(_v24 < 2036) {
         *(_v20 + _v24) =  *(_v16 + _v24) & 255;
        _v24 = _v24 + 1;
    }
     &tfcard_cartoon->card_game_work_path = cfg_get_key_value();
    if( &tfcard_cartoon->card_game_num >= 5) {
        tfgame_less_than_5 = 1;
    }
    _v312 = 0;
    while( &tfcard_cartoon->card_game_num < _v312) {
        memset( &i, 0, 256);
        sprintf( &i, "%sgame%d.fba");
        if(access() == 0) {
            _v312 = _v312 + 1;
            continue;
        } else {
            _v48 = 0;
        }
L19:
        _t272 = _t272 + 2376;
        return _v48;
    }
    _v312 = 0;
    while( &tfcard_cartoon->card_game_num < _v312) {
        memset( &i, 0, 256);
        sprintf( &i, "%sgame%d.png");
        if(access() == 0) {
            _v312 = _v312 + 1;
            continue;
        } else {
            _v48 = 0;
        }
        goto L19;
    }
    _v48 = 1;
    goto L19;
}
 
Last edited:

jslime

n00b
Joined
Dec 23, 2012
Posts
12
Hi guys, signed up just to follow this thread and support. Great work so far!

On a side note can anyone tell me why l can't charge my neo geo x with a standard mircousb/wall charger (used for phones etc) instead of the docking station? It says specifically not to in the manual. Was wondering what the non-gold edition units came with in terms of a charging cable.
 

topher

Tesse's Maintainence Man
Joined
May 8, 2004
Posts
2,904
You can use a micro USB phone charger or hook up to PC for charging.
 
Last edited:

GohanX

Horrible Goose
20 Year Member
Joined
Sep 28, 2001
Posts
12,490
Hi guys, signed up just to follow this thread and support. Great work so far!

On a side note can anyone tell me why l can't charge my neo geo x with a standard mircousb/wall charger (used for phones etc) instead of the docking station? It says specifically not to in the manual. Was wondering what the non-gold edition units came with in terms of a charging cable.

Tommo is probably afraid of people plugging in untested chargers with varying voltages doing something, but truth is it works fine. I've used a Kindle charger with it.
 

Tacitus

Volatile Memory Construct - SN://0467839
Staff member
Joined
Apr 26, 2002
Posts
15,120
its not hard to request shackles on progress. just dont expect any.

did you notice no progress happened since this was introduced into this thread? progress was halted instantly and probly went backwards.

i have not posted any links im just stating what happened no reason to get angry because of my voicing what happened.


:rolleyes:

That was more a function of time zones, obviously.

You have your own blog and site, post the ROMS there.
 

jslime

n00b
Joined
Dec 23, 2012
Posts
12
I saw an interesting block that did figure in that card_game_number (probably just going to serve to obscure things more, but here it is
[...snip...]

Couple interesting things, so it looks like SD cards are limited to a maximum of 5 roms?
Also l'd like to see the access() function referenced in the tfcard_game_check() function and what it does; this may be the function that validates an sd card's validity.
 

GohanX

Horrible Goose
20 Year Member
Joined
Sep 28, 2001
Posts
12,490
Couple interesting things, so it looks like SD cards are limited to a maximum of 5 roms?

5 roms per card is less than ideal, but with SD cards costing lik3 $4 on Newegg I could live with that. I've already considered buying a few dozen in bulk if we were limited to 1 per card. :D
 

jslime

n00b
Joined
Dec 23, 2012
Posts
12
5 roms per card is less than ideal, but with SD cards costing lik3 $4 on Newegg I could live with that. I've already considered buying a few dozen in bulk if we were limited to 1 per card. :D

Well the limitation appears to be programmatic, so altering the tfcard_game_check() function to check for say 10000 instead of 5 would theoretically get around the limit.
 

FA-MAS

Kula's Candy
Joined
Oct 3, 2009
Posts
299
How'd you guys get a dump of the Ninja Masters card. Plugged into my Mac or Linux machine, it doesn't even show up as mountable. I can dd the raw drive, but the resulting img is not mountable/readable.

Code:
$ file internalsd.img
internalsd.img: Linux rev 1.0 ext3 filesystem data, UUID=d0ddb72e-706b-4d15-ab34-5131489cc585

$ file ninjam.img
ninjam.img: data

$ sudo mkfs -n ninjam.img
mke2fs 1.41.12 (17-May-2010)
ninjam.img is not a block special device.
Proceed anyway? (y,n) y

Filesystem label=
OS type: Linux
Block size=1024 (log=0)
Fragment size=1024 (log=0)
Stride=0 blocks, Stripe width=0 blocks
16128 inodes, 64512 blocks
3225 blocks (5.00%) reserved for the super user
First data block=1
Maximum filesystem blocks=66060288
8 block groups
8192 blocks per group, 8192 fragments per group
2016 inodes per group
Superblock backups stored on blocks: 
	8193, 24577, 40961, 57345

The dump of the Internal SD actually has the entries within to be recognized as an ext3 file system.

The Ninja Masters does not. We know the system mounts it as vfat. I tried mounting it with a Superblock backup stored within the file system and I just get kernel crashes. Maybe I'm doing that wrong though.
 
Last edited:
Joined
Jun 25, 2011
Posts
47
Couple interesting things, so it looks like SD cards are limited to a maximum of 5 roms?
Also l'd like to see the access() function referenced in the tfcard_game_check() function and what it does; this may be the function that validates an sd card's validity.

Sure, here's the decompiled block:
Code:
int access(char* __name, int __type)
{// addr = 0x004282F0
    intOrPtr _v4;                          // _cfa_fffffffc
    intOrPtr _v8;                          // _cfa_fffffff8
    intOrPtr _v16;                         // _cfa_fffffff0

     *0();
     *0();
     *0();
     *0();
     *0();
     *0();
     *0();
     *0();
     *0();
     *0();
     *0();
     *0();
     *0();
     *0();
     *0();
     *0();
     *0();
     *0();
     *0();
     *0();
     *0();
     *0();
     *0();
     *0();
     *0();
     *0();
     *0();
     *0();
     *0();
     *0();
     *0();
     *0();
     *0();
     *0();
     *0();
     *0();
     *0();
     *0();
     *0();
     *0();
     *0();
     *0();
     *0();
     *0();
     *0();
     *0();
     *0();
    __sp = __sp + -32;
    _v16 = 131072;
    _v4 = __ra;
    _v8 = 0x1d950;
    asm("bgezal zero,0x8");
     *((intOrPtr*)(0x404380))();
    __sp = __sp + 32;
    return;
}

How'd you guys get a dump of the Ninja Masters card. Plugged into my Mac or Linux machine, it doesn't even show up as mountable. I can dd the raw drive, but the resulting img is not mountable/readable.

Code:
$ file internalsd.img
internalsd.img: Linux rev 1.0 ext3 filesystem data, UUID=d0ddb72e-706b-4d15-ab34-5131489cc585

$ file ninjam.img
ninjam.img: data

$ sudo mkfs -n ninjam.img
mke2fs 1.41.12 (17-May-2010)
ninjam.img is not a block special device.
Proceed anyway? (y,n) y

Filesystem label=
OS type: Linux
Block size=1024 (log=0)
Fragment size=1024 (log=0)
Stride=0 blocks, Stripe width=0 blocks
16128 inodes, 64512 blocks
3225 blocks (5.00%) reserved for the super user
First data block=1
Maximum filesystem blocks=66060288
8 block groups
8192 blocks per group, 8192 fragments per group
2016 inodes per group
Superblock backups stored on blocks: 
	8193, 24577, 40961, 57345

The dump of the Internal SD actually has the entries within to be recognized as an ext3 file system.

The Ninja Masters does not. We know the system mounts it as vfat. I tried mounting it with a Superblock backup stored within the file system and I just get kernel crashes. Maybe I'm doing that wrong though.
I've tried mounting it as vfat too with no luck. I had dumped an image of the card using the Windows dd, later I tried in Ubuntu and I got a slightly bigger resulting image, but it still wouldn't mount.

But you're definitely right, something about the dumps is incomplete, because neither image has produced a working card in the Neo Geo X when I write them back to a different SD card.

I think mr_e had uploaded what burningtoys dumped, which was also done with the Windows version of dd.
 
Last edited:
Top