News: 11 March 2016 - Forum Rules

Author Topic: Wanting to learn about Roms  (Read 3543 times)

samiejg

  • Jr. Member
  • **
  • Posts: 3
    • View Profile
Wanting to learn about Roms
« on: January 13, 2014, 05:09:03 pm »
Hey Guys,

I'm new to the forums and hoping to learn a lot and also share my knowledge (if it's useful) with the fourm as well.

I've got a quite a bit of experience when it comes to web applications, like using PHP/MySQL/HTML/CSS/JS, but I haven't really gotten into anything computer related.

So from what I understand so far about roms, SMC files are the original file types for SNES games, and they can be ran with some type of emulator, and can only be edited using some type of hex editor. But I was wonder about android/apple apps (containg snes games) and how they work. You don't even need an emulator, so I'm assuming there's one built right into the APK file, along with the SMC file.

I'm just trying to learn here, but would anyone be able to point me in the right direction in regards to trying to learn how to piece together an APP like that? I tried opening the APP with winrar, but a lot of the files are not capable of being opened with notepad. I want to see how everything works together, including the controls, and ads and stuff. Also wouldn't mind seeing if there was a way for me to troubleshoot it because the game I downloaded was having this strange issue where you can no longer move if you jump, until you let go of the joystick for a second.

Any suggestions?

FAST6191

  • Hero Member
  • *****
  • Posts: 3357
    • View Profile
Re: Wanting to learn about Roms
« Reply #1 on: January 13, 2014, 05:33:48 pm »
Having not pulled apart the android versions but having done it on several similarly powerful systems over the years is where I am coming from here.

Generally speaking it is done in one of three ways

Straight emulation. Consider also that many SNES games appeared on the PC, the amiga, the megadrive/genesis, the PCE/TG16, the arcades and so on and so on so it might not be a SNES emulator. Equally it might not be the best version of the game that is used.

Remake/port. The game's assets are ripped, regenerated or otherwise obtained. The game engine is then rewritten and then the game made that way. This was more common for the likes of the GBA and back in the Saturn era where emulation might have been tricky, see similar things happening now for PS1 and PS2 era games. A lot of the time if the game is an RPG it will have been ported, certainly most times you see Final Fantasy, Phantasy Star or anything else really from Square (Enix) it will be a port.

Some combo of the two. This can be enhanced emulator or emulated but large tracts of the ROM rewritten. Not especially common and I would be surprised to see a lot of it happening for android but things like the N64 Zelda games that were emulated on the gamecube are a good example -- several assets and graphics features were changed to accommodate emulation. More common though is music is ripped from a game and stored as a wave rather than track/sequence and played at the appropriate point in the emulator.

On the SMC format then.... popular thought has it that ROMs are direct copies of the contents of the ROM chip. This is true in some cases but systems like the NES and SNES benefit from extra info in headers to cover what sorts of games they are (the carts could and frequently did have a wide array of extras onboard), info that the actual ROM contents would not have had (no need to do such a thing).
On the NES it was largely mappers but the SNES has special chips http://wiki.pocketheaven.com/index.php?title=SNES_games_with_special_chips
Over the years the SNES ROMs pulled out of emulated collections have varied somewhat, I am fairly sure this is not going to be an official Nintendo affair. This can shake things up a bit further.

"I want to see how everything works together, including the controls, and ads and stuff."

There are many ways to do this. The controls are probably just inputs mapped to whatever control methods the emulator it is all wrapped in supports, unless it is a port in which case it is standard controls and programming. Adverts.... personally I would probably make it work like achievements and cheats and read off a value in memory and load my advert function accordingly, of course that is effort* and no programmer wants to make effort so I would imagine it is some kind of timer affair that is hopefully set up to display an advert that does not interrupt too much of the game.

*not to mention it probably violates a patent somewhere.

Troubleshooting means you need to find a way to debug Android programs. It is easy enough if you are actually writing a program but I have never come the other way and wanted to hack an android program outside of a bored 5 minutes when I thought I would try it out on http://www.android-x86.org/
Android emulation of the full CPU and more side of things is happening though, I have even seen android programs have PC ports by trying to use one of the emulators *spits*.

samiejg

  • Jr. Member
  • **
  • Posts: 3
    • View Profile
Re: Wanting to learn about Roms
« Reply #2 on: January 13, 2014, 07:24:28 pm »
Thank you so much for the response :) Definitely some interesting stuff. Some of it I don't quite understand yet but I'm trying.

Do you know of any resources or tutorials that would go into converting a SNES game into an android app? I'm still trying to dissect this APK file but was only able to fins some of the websites details as well as the SMC file. Seems a lot more complex than web applications.

FAST6191

  • Hero Member
  • *****
  • Posts: 3357
    • View Profile
Re: Wanting to learn about Roms
« Reply #3 on: January 13, 2014, 10:47:04 pm »
Tutorials... find an emulator or build one (not an easy task), point it directly at the game within the APK's own filesystem, configure the controls to what you think works well (with android being largely touchscreen then depending upon the game that can be easier said than done), configure emulator options, set any savestate/save game parameters if necessary and package it all up. The big trick (and it is a serious trick) is dealing with any licensing for the emulator (a handful of emulators are quite open, some are decidedly less free with their code and others can be some effort to work through but you can do it) and the game you are emulating (I do not think any of the SNES games have been released as public domain yet, not sure about homebrew).
If you want to add your own adverts to pop up then I already covered that. An example might be if a game has a level counter then you find this counter in the emulated system's memory, when the value changes for instance then chances are you are changing level and you can pause the game and show an advert.

If you are remaking the game then that is standard programming.

If you are doing an enhanced emulator then that varies. It might be that you change the wording of the tutorial to read swipe the screen instead of "press a", it might also be that you do something crazy, mod an emulator to make an impossible to run ROM on hardware but possible with an emulator (quite a few hacks are like this for various reasons).

The licensing thing is a huge deal and I would be quite shocked if you managed to pull it off outside of buying up some rights that would almost qualify as abandonware in places. To that end packaging and selling a ROM without permission will see you kicked off the marketplace in short order and most people that want to run a ROM will already be able to download an emulator (there are many).

VicVergil

  • Hero Member
  • *****
  • Posts: 736
    • View Profile
Re: Wanting to learn about Roms
« Reply #4 on: January 13, 2014, 11:39:10 pm »
I can speak for the Secret of Mana port for iOS: It's all png and bitmaps. The text by itself is a big binary ascii-encoded file with pointers. There is a separate file for font (from what I saw elsewhere I bet it has the headers of a standard windows picture file somewhere inside)
and the sound tracks are neatly ripped as m4a files.


henke37

  • Hero Member
  • *****
  • Posts: 643
    • View Profile
Re: Wanting to learn about Roms
« Reply #5 on: January 14, 2014, 05:03:04 am »
The reason why some of the files aren't text is because the data isn't text. It can be things like music, maps, animations, the game script and what not. And that is excluding the obvious things like media in stock file formats and the executable for the application.

samiejg

  • Jr. Member
  • **
  • Posts: 3
    • View Profile
Re: Wanting to learn about Roms
« Reply #6 on: January 14, 2014, 09:14:38 am »
Thanks again guys. I think I'm starting to go in the right direction here. I'm actually trying to go the route now of editing the existing APK file. I found some software that seems to be helping out a lot of decompressing files and allowing me to view some actual coding :)