Jump to content

Photo

Splitting out Combo Game Carts


15 replies to this topic

#1 bhall408 OFFLINE  

bhall408

    Star Raider

  • 58 posts
  • Location:California

Posted Fri Mar 29, 2019 9:15 AM

Has anyone ever tried/already split out combo game carts into individual games/LNX files?

 

For example, taking the combo Super Asteroids/Missile Command, splitting into two files, and patching each such that only one game is visible/accessible from each of the two LNX files.

 

If not, I'll probably take a try at it myself.

 



#2 Nop90 OFFLINE  

Nop90

    Chopper Commander

  • 110 posts
  • Location:Italy

Posted Fri Mar 29, 2019 9:27 AM

Don't know if it's possible to split the two games, because it's probable that the two shares some functons (sound driver , gfx effect, input handling) to save cart memory.

 

What you could do is to make two copies of the rom and hack each one to make them load automatically on start only one of the two games. Than if you want to go further, you could clean from each rom cart the unused part and then hack the cart directory to remove the not needed sectors and shrink the rome to reduce it's size.

 

But I don't think it's worth the effort.



#3 sage OFFLINE  

sage

    Dragonstomper

  • 994 posts
  • Location:Germany

Posted Fri Mar 29, 2019 12:25 PM

Don't know if it's possible to split the two games, because it's probable that the two shares some functons (sound driver , gfx effect, input handling) to save cart memory.

 

What you could do is to make two copies of the rom and hack each one to make them load automatically on start only one of the two games. Than if you want to go further, you could clean from each rom cart the unused part and then hack the cart directory to remove the not needed sectors and shrink the rome to reduce it's size.

 

But I don't think it's worth the effort.

no problem.

see my battlezone patch which loads the easter egg game automatically.


Edited by sage, Fri Mar 29, 2019 12:25 PM.


#4 bhall408 OFFLINE  

bhall408

    Star Raider

  • Topic Starter
  • 58 posts
  • Location:California

Posted Fri Mar 29, 2019 1:22 PM

Don't know if it's possible to split the two games, because it's probable that the two shares some functons (sound driver , gfx effect, input handling) to save cart memory.

 

What you could do is to make two copies of the rom and hack each one to make them load automatically on start only one of the two games. Than if you want to go further, you could clean from each rom cart the unused part and then hack the cart directory to remove the not needed sectors and shrink the rome to reduce it's size.

 

 

 

I'm not concerned about the size. Just the UX.

 

The goal would be that each file loads and displays one (and only one) of the games. It is fine if that is just by patching the code, and not pruning out the unused assets. Have to cover all the cases where they would both appear and patch around that.

 

That there is a *3rd* option to have a "separate" game that is the bonus, might also be a great idea! (Kudos to Sage!)



#5 Nop90 OFFLINE  

Nop90

    Chopper Commander

  • 110 posts
  • Location:Italy

Posted Fri Mar 29, 2019 5:00 PM

 

The goal would be that each file loads and displays one (and only one) of the games. It is fine if that is just by patching the code,

 

Seems it's not so easy: the addresses where the two games entry points are stored are verified just after the splash screen, and if changed the game halts. The same for the memory range of the function that loads one of the two values in memory before triggering an indirect jump.

 

Obviously the part of code that performs the check is encrypted.

 

I'm not saying it's impossible to hack the rom, but It's not the simple task I hoped.



#6 karri ONLINE  

karri

    River Patroller

  • 2,627 posts
  • Location:Espoo, Finland

Posted Fri Mar 29, 2019 5:35 PM

In case you want to give it a try so I just decrypted the bootloader. It comes in two parts. The disassembled source is here.

 

 

Attached Files


Edited by karri, Fri Mar 29, 2019 5:40 PM.


#7 Nop90 OFFLINE  

Nop90

    Chopper Commander

  • 110 posts
  • Location:Italy

Posted Fri Mar 29, 2019 6:07 PM

Thanks, interesting part to study,

 

Following the bootloder code with the debugger it seesm calculatesome sort of hash of the whole rom. Isn't it?

 

BTW I'll understand better it from your files.



#8 sage OFFLINE  

sage

    Dragonstomper

  • 994 posts
  • Location:Germany

Posted Sat Mar 30, 2019 1:09 AM

 

Seems it's not so easy: the addresses where the two games entry points are stored are verified just after the splash screen, and if changed the game halts. The same for the memory range of the function that loads one of the two values in memory before triggering an indirect jump.

 

Obviously the part of code that performs the check is encrypted.

 

I'm not saying it's impossible to hack the rom, but It's not the simple task I hoped.

just overwrite it with another loader.

i am sure this was discussed here already.


Edited by sage, Sat Mar 30, 2019 1:09 AM.


#9 sage OFFLINE  

sage

    Dragonstomper

  • 994 posts
  • Location:Germany

Posted Sat Mar 30, 2019 1:23 AM

-> check my website, all you need for this is there



#10 Nop90 OFFLINE  

Nop90

    Chopper Commander

  • 110 posts
  • Location:Italy

Posted Sat Mar 30, 2019 1:45 AM

-> check my website, all you need for this is there

Yes I konow, but I'm trying to understand everything step by step.

 

Now I have clear how works the two loaders, alreay was able to replace the first. For the second I have to understand better the cart structure.

 

If I would change only part of the loader, can't find how to re-encode a chink of code (52 bytes if I'm not wrong).



#11 sage OFFLINE  

sage

    Dragonstomper

  • 994 posts
  • Location:Germany

Posted Sat Mar 30, 2019 1:50 AM

as you wish.

all i want to menation is that all that has been done long time ago. it is quite easy. you just have to switch the title pic and first binary address from tghe hardcoded one in the loader to the one which is read from the directory.

if you want to do it again, go ahead. :shrug:



#12 karri ONLINE  

karri

    River Patroller

  • 2,627 posts
  • Location:Espoo, Finland

Posted Sat Mar 30, 2019 3:09 AM

I did write a code using OpenSSL for encoding and decoding the header.

 

It is not so tidy. But it works.

 

 

Attached Files

  • Attached File  pk.zip   5.67KB   5 downloads


#13 Nop90 OFFLINE  

Nop90

    Chopper Commander

  • 110 posts
  • Location:Italy

Posted Sat Mar 30, 2019 12:08 PM

Thanks to the hints of Sage and karri now I understand the two loaders and the encryption, so  I'm able to decrypt / encrrypt the two loaders.

 

For the OP, I have a basic patch to show only one of the two games (that requires more work to have a perfect result).

 

Assuming there is only one type of rom around, here is what you need to do.

 

First the second loader needs to be patched to remove the checksum control changing the hillighted values:

 

orig.png

 

in the red ones:

 

modif.png

 

than it's possible to change one of the game entrypoint to the value of the other, so that always the same game is loaded:

 

patch1.png

 

AD 26 is for Missile Command and 85 27 for super Asteroids.

 

What is missing from this patch:

 

1) the splashscren is unchanged and shows both the titles, it's possible to skip the splashscreen or change the image with another.

2) in the main title pressing left/right still try to change the title, but it loads always the same. This makes restarting the intro. The check for left/right directions should be disabled (yesterday night found the point where to patch it but can't remember it today and don't have time now to trace again te code)

3) the starting intro music is always that of missile command, but left/right changes it (that's a nice feature IMHO). Disabling the left/right check the Asteroids version will require to change the music to load on start.

 

All this things are not difficult, but time consuming, so I think I'll stop here.

 



#14 karri ONLINE  

karri

    River Patroller

  • 2,627 posts
  • Location:Espoo, Finland

Posted Sat Mar 30, 2019 1:55 PM

The value of data grows as it is shared. We seem to have one new specialist who fully understands what makes the Lynx tick :)



#15 sage OFFLINE  

sage

    Dragonstomper

  • 994 posts
  • Location:Germany

Posted Sat Mar 30, 2019 5:15 PM

congrats



#16 bhall408 OFFLINE  

bhall408

    Star Raider

  • Topic Starter
  • 58 posts
  • Location:California

Posted Fri Apr 5, 2019 9:37 PM

Thanks everyone for running with this puzzler!

 

nop90 is right about the additional things you'd want for each of the resulting 2 files to be nice and self-contained (and make sense as stand-alone)

 

I'll come back to it later on...






0 user(s) are browsing this forum

0 members, 0 guests, 0 anonymous users