161in1 understanding its logic.

Razoola

Divine Hand of the UniBIOS,
Staff member
20 Year Member
Joined
Nov 12, 2002
Posts
4,662
I have decided to take a look how the 161in1 multicarts work and post details here. Hopefully this info will be helpful in the event somone works out how to reprogram devices holding game into.

I will update this thread as and when I get new information. I reveived one this morning which I bought from ebay last week, total cost 72.99 euro including the shipping.

Ok, lets get started with the basics. From cold boot the carts NGH is 0x9237

Moving quickly on, decided to first look at how the trigger works once a game is playing. Selected AOF2 and then using PC-2-NEO dumped the sucker and quickly isolated the injected code. It is placed into the game by altering the games vector table and then returns to the games vblank when execution iscomplete.

As follows;

Code:
161vbl	MOVEM.L  D0-D7/A0-A6,-(A7)
	MOVE.B   0x380000,D0
	CMPI.B   #0xFE,D0		; ! this why reset dosen't work !
	BEQ      timer			; ! when a memory card is present ! 
	MOVE.W   #0x0,0x10FF20
	BRA      exit

timer	ADDI.W   #0x1,0x10FF20		; only trigger after 0x12C frames.
	MOVE.W   0x10FF20,D0
	CMPI.W   #0x12C,D0
	BEQ      break
	BRA      exit

break	MOVE.W   #0x0,0x10FF20		; put code in RAM and execute,
	MOVE.W   #0x0,D3		; see RAM routine below for code.
	LEA      0x100200,A4
	MOVEA.L  A4,A5
	MOVE.L   #0x33FC0F0F,(A4)+
	MOVE.L   #0x2FFFF0,(A4)+
	MOVE.L   #0x4E7133C3,(A4)+
	MOVE.L   #0x2FFFF2,(A4)+
	MOVE.L   #0x4E7133C3,(A4)+
	MOVE.L   #0x2FFFF6,(A4)+
	MOVE.L   #0x4E7133C3,(A4)+
	MOVE.L   #0x2FFF00,(A4)+
	MOVE.L   #0x4E714E70,(A4)+
	MOVE.L   #0x4EF900C0,(A4)+
	MOVE.W   #0x402,(A4)
	JMP      (A5)

exit	NOP
	MOVEM.L  (A7)+,D0-D7/A0-A6
	JMP      0x8F84			; original game vbl start.	


/ Generated code in RAM /

ram	MOVE.W   #0x0F0F,0x2FFFF0	; ports controlling multicart, D3=0x0000
	NOP
	MOVE.w   D3,0x2FFFF2
	NOP
	MOVE.w   D3,0x2FFFF6
	NOP
	MOVE.w   D3,0x2FFF00
	NOP
	RESET
	JMP      0x00C00402		; restart neogeo boot cycle.

It is really quite straight forward and its clear what is happening. The custom ports are not currently understood (I only had the cart 10 minutes now) but I suspect they control start offsets in the flash ROM space.

Things to note here is the very poor check of the 1UP start button which breaks when a memory card present and the uneeded storing of some registers to the stack. Only four registers are used but they save them all. In fact the entire code could have been written using only two resgisters easily (or even none).

Who knows what my next post on this multicart will discover. :)
 
Last edited:

Razoola

Divine Hand of the UniBIOS,
Staff member
20 Year Member
Joined
Nov 12, 2002
Posts
4,662
Looking a little deeper selecting a game is really quite simple...

If one wants to select game 04 (KOF 94) then use the following;

Code:
	MOVE.W   #0x0F0F,0x2FFFF0
	NOP
	MOVE.w   #0x0004,0x2FFFF2
	NOP
	MOVE.w   #0x0004,0x2FFFF6
	NOP
	MOVE.w   #0x0004,0x2FFF00
	NOP

To select game 17 (KOF 98);

Code:
	MOVE.W   #0x0F0F,0x2FFFF0
	NOP
	MOVE.w   #0x0011,0x2FFFF2
	NOP
	MOVE.w   #0x0011,0x2FFFF6
	NOP
	MOVE.w   #0x0011,0x2FFF00
	NOP

On one side this is very straight forward. On the other it means start offsets (in flash chips) of each games data is stored inside the PCB's ICs and probably cannot be changed without reprogramming it. I was kind of hoping for a table in the menu UI coding so these offsets could be easily manipulated.

There is another custom port 0x2FFFE0 which looks to allow the reading of data from the PCBs IC (which may pull data directly from the flash chips). I have not looked into this properly but it seems to allow the reading of SoftDIPs and backupRAM for stored games without the need to move the entire game into the NeoGeo memory space first. This is entirely speculation on my part but does look about right from what I see so far.
 

Morden

Somewhere in Europe.,
Joined
Jul 5, 2005
Posts
711
Exciting stuff, Raz. I'm assuming the point of this is to figure out exactly how things work and possibly improve upon what's already there. Would be nice if a cheapo multigame could be turned into a mostly bug free multi with a better game selection.
 

Morden

Somewhere in Europe.,
Joined
Jul 5, 2005
Posts
711
Is this simply exploratory, or do you have plans for the 161-in-1, granted its architecture meets your expectations? If it were possible to turn this into a greatly improved multi, with a better game selection and a better menu, this could be a low cost alternative to the currently available flash devices. I wonder if this would be a feasable business model. Buying a stock of these, making the alterations, possibly adding new labels, and re-selling the improved version.
 

Razoola

Divine Hand of the UniBIOS,
Staff member
20 Year Member
Joined
Nov 12, 2002
Posts
4,662
Looking a little more at the custom port 0x2FFFE0, it seems related to SoftDIPs only. From what I can tell thus far, the cart stores and recalls set SoftDIPs using it. I do not know at this point if this means the multicart is able to remember the softdips for all games it holds or if it comes with default softDIPs already stored.

It seems SoftDIPS are only saved when you return to the menu to choose a new game.

I'm not to sure about it at all at the moment, I seem to remember reading somewhere at some point there was a way to set easy, medium or hard levels with the multicart in one go for all games. Is that right?
 
Last edited:

NeoField

Rugal's Thug
Joined
Sep 14, 2017
Posts
91
This is awesome, keep up the great work! People will speak of your contribution to the Neo Geo 100 years from now Razoola!
 

Montatez

Aero Fighters Flyboy
Joined
Jun 7, 2012
Posts
2,078
Is this simply exploratory, or do you have plans for the 161-in-1, granted its architecture meets your expectations? If it were possible to turn this into a greatly improved multi, with a better game selection and a better menu, this could be a low cost alternative to the currently available flash devices. I wonder if this would be a feasable business model. Buying a stock of these, making the alterations, possibly adding new labels, and re-selling the improved version.

Not sure it would be cost effective though. The 161 has some problems but being to replace most of the games for games not on the cart would be nice.
 

Morden

Somewhere in Europe.,
Joined
Jul 5, 2005
Posts
711
Not sure it would be cost effective though. The 161 has some problems but being to replace most of the games for games not on the cart would be nice.

I wonder, though. It's a complete and working PCB with a shell for ~ $55 or $60. NeoSD is $480, and I don't even know how much the Darksoft cartridge goes for. A multi with a more or less permanent selection of games isn't the same as a flash cartridge, but ...

I don't own a 161 in 1, or any other multi cart for that matter. I know they contain hacks, though. The "Plus" versions of certain games, which unlock boss characters, skip levels, etc. The list of hack on 161 in 1 is available here. There are 64 hacks in total, most of them are hacks of large games. Some of these "Plus" titles are available as ROM images online, and can be played using the NeoSD. I'm wondering if the 161 in 1 contains complete hacked images of these games, or does it patch one KoF '98 ROM to get "Plus", "Orochi" and "Ultimate" hacks.

If it does, that's too bad. If it doesn't, we have 2049 Megabits we could possibly use for other titles, leaving only the original KoF '98 ROM. This would apply to all of the hacks if they indeed are complete ROM images, just taking up space.

The problem is, there probably isn't a way of reprogramming the chips without desoldering them, and that's a lot of desoldering. This is what would effectively kill any kind of profitability, as it would be extremely time consuming.

I am hoping though, that while exploring this Chinese beauty, Raz will create the ultimate multi, even if it's only a proof of concept, to show that it can be done, and how it's done. I could see this becoming the ultimate do it yourself project for Neo fans. Buy a 161 in 1, desolder and reprogram everything, and make yourself a all in one, complete Neo cartridge.
 

Razoola

Divine Hand of the UniBIOS,
Staff member
20 Year Member
Joined
Nov 12, 2002
Posts
4,662
I have had some fun with the 161in1 today.. I think I might have to made a video tomorrow :)
 

aha2940

AH, A, COLUMBIAN!,
Joined
Dec 15, 2013
Posts
2,528
I have had some fun with the 161in1 today.. I think I might have to made a video tomorrow :)

Very interesting findings Raz. It owuld be very cool if you found a way to improve the quality of the roms stored in these things (replace Garou rom, fix roms to not start in 8-difficulty by default, maybe remove some unneeded hacks or replace them with missing games), since GadgetUK already helped fixing the sound with some capacitors and stuff.
 

kuze

Akari's Big Brother
10 Year Member
Joined
Apr 20, 2013
Posts
2,549
Would be really cool if the 161-in-1 had some sort of internal functionality to rewrite the flash chips and you could potentially do so using an MVS board and a PC-2-NEO or something.

Looking forward to hearing more of your findings, Raz!
 

Razoola

Divine Hand of the UniBIOS,
Staff member
20 Year Member
Joined
Nov 12, 2002
Posts
4,662
The 161in1 does look to save SoftDIPs on board but I have no idea if its writing them to one of those large flash chips or some internal flash on the large IC... Anyone have any specs on that large IC or thoughts of that? What I have found out is if you do not have the region set to Japan some games can be quite buggy due to the UI always pulling a Japanese created backup RAM store from the UI memory. For example when I'm in EURO region aerofighters 3 goes all weird (static bullets etc), in Japan it is fine. Anyone else get this same issue with this game?

I have a feeling the video I do is gonna get some people hyped :)
 

aha2940

AH, A, COLUMBIAN!,
Joined
Dec 15, 2013
Posts
2,528
For example when I'm in EURO region aerofighters 3 goes all weird (static bullets etc), in Japan it is fine. Anyone else get this same issue with this game?

Yep, it happens on my 161, and IIRC some others posted that same behavior, but I don't remember anybody ever linking it to the region, AFAIK it always has the static bullets. Gotta try again to confirm.
 

geise

Mickey's Coach
Joined
Jul 2, 2011
Posts
582
Might not be much help but on my 161-in 1 cart all games start at level-8. Changing the game level to regular default (4 I believe) remedies most of the "weird issues" with Aerofighters 3.
 

Razoola

Divine Hand of the UniBIOS,
Staff member
20 Year Member
Joined
Nov 12, 2002
Posts
4,662
Is there a list somewhere all games with issues on the 161in1?
 

geise

Mickey's Coach
Joined
Jul 2, 2011
Posts
582
Is there a list somewhere all games with issues on the 161in1?

There was some info in the major 161-in 1 thread that was going on years ago here. As far as I've seen it's mostly some sprite issues in Samurai Spirits 1, sound in intro of Sam Spirits 2 (I can't telll), same with sound in Pulstar which is really only noticeable to people that own the original. If using a US Bios, Metal Slug 3 has corrupt graphics at the warning screen before the title. There is also people saying Last Blade 2 has random resets, but I have yet to have this issue with mine. Even when playing LB2 for more than an hour straight. I use my cart on a MV1-FZ.
 
Last edited:

Gyrian

Hardened Shock Trooper
Joined
Mar 24, 2016
Posts
443
Surprised we haven't seen a deep dive like this until now. Very interesting read, and fantastic work as always Raz. :)
 

Razoola

Divine Hand of the UniBIOS,
Staff member
20 Year Member
Joined
Nov 12, 2002
Posts
4,662
Well I was going to do a video today but some things have come up, hopefully I can do it tomorrow evening or early next week.
 

Morden

Somewhere in Europe.,
Joined
Jul 5, 2005
Posts
711
I have a feeling the video I do is gonna get some people hyped :)

Stop teasing, and tell us if those who don't have a 161 in 1 should consider getting one, with future improvements in mind!
 
Top