It is currently Sun Oct 22, 2017 7:50 pm

All times are UTC - 7 hours





Post new topic Reply to topic  [ 13 posts ] 
Author Message
PostPosted: Tue Apr 22, 2014 12:12 pm 
Offline

Joined: Fri Apr 29, 2011 9:44 pm
Posts: 267
Stella supports .bin
Genplusgx supports .bin

Stella will erroneously load genesis roms and attempt to run them without any kind of error. =/

Any good way to know which ROM is a atari ROM through file inspection? Or should I just disallow .BIN extension everywhere? (which would suck cause my entire genesis collection is in .BIN)

(Btw, currently making a front-end for libretro)


Top
 Profile  
 
PostPosted: Tue Apr 22, 2014 12:17 pm 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19116
Location: NE Indiana, USA (NTSC)
That used to be a problem for Genesis vs. Game Boy Advance until the GBA community adopted .gba as the standard. Other extensions I've seen:
  • VCS: .a26
  • MD non-interleaved: .gen
UNIX has less of a problem because content-type isn't so tied to the filename; instead, detect content-type by looking for magic numbers. You could mimic this by writing a short program that looks for "SEGA" or the Nintendo logo data in the appropriate place, verifies each platform's header checksum, etc. and launches the appropriate emulator.


Top
 Profile  
 
PostPosted: Tue Apr 22, 2014 12:23 pm 
Offline

Joined: Fri Apr 29, 2011 9:44 pm
Posts: 267
Sounds like I should probably just punt on this for now then and ask people to not use .BIN file roms.


Top
 Profile  
 
PostPosted: Tue Apr 22, 2014 12:27 pm 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19116
Location: NE Indiana, USA (NTSC)
If you're making an emulator front-end, you're in the perfect position to do the sort of magic number detection that I described. Look up each common format's header spec and checksum spec. It's fine to warn the user against .bin, but only if you can't get a positive ID should your program give up and turn this warning into an error.


Top
 Profile  
 
PostPosted: Tue Apr 22, 2014 12:48 pm 
Offline

Joined: Fri Apr 29, 2011 9:44 pm
Posts: 267
stella looks like it just looks at the file size itself and figures out what format it is based on that - which obviously won't work in cross-detection. Genesis has SEGA in certain magic spots which it looks for and so in theory I can create a special check inside of stella to make sure its not actually a genesis rom masquerading as a atari rom. But that doesn't solve all the other emulators out there. I feel this is a losing battle. =/


Top
 Profile  
 
PostPosted: Tue Apr 22, 2014 1:21 pm 
Offline
User avatar

Joined: Wed Feb 13, 2008 9:10 am
Posts: 578
Location: Estonia, Rapla city (50 and 60Hz compatible :P)
Image

_________________
http://www.tmeeco.eu


Top
 Profile  
 
PostPosted: Tue Apr 22, 2014 1:25 pm 
Offline

Joined: Sun Apr 13, 2008 11:12 am
Posts: 6297
Location: Seattle
I'd be really surprised if I found a 2600 ROM bigger than 32KiB, or a Genesis ROM smaller than 64 KiB.

Look on the bright side: you don't have to decode .hex files too.


Top
 Profile  
 
PostPosted: Tue Apr 22, 2014 2:25 pm 
Offline

Joined: Fri Apr 29, 2011 9:44 pm
Posts: 267
lidnariq wrote:
I'd be really surprised if I found a 2600 ROM bigger than 32KiB, or a Genesis ROM smaller than 64 KiB.

Look on the bright side: you don't have to decode .hex files too.


I'll check that. Good idea! :)


Top
 Profile  
 
PostPosted: Tue Apr 22, 2014 3:18 pm 
Offline

Joined: Fri Apr 29, 2011 9:44 pm
Posts: 267
For the most part, atari games are <= 32k, however there is a 32 in 1 rom which is 64k. The smallest genesis game is ~128k (not including game genie roms). so 64k is a good check :) I'll patch stella and upstream it.


Top
 Profile  
 
PostPosted: Tue Apr 22, 2014 7:10 pm 
Offline
User avatar

Joined: Sat Feb 12, 2005 9:43 pm
Posts: 10066
Location: Rio de Janeiro - Brazil
Don't rely so heavily on ROM sizes though, since homebrews can be as small or as large as their creators want.


Top
 Profile  
 
PostPosted: Tue Apr 22, 2014 7:28 pm 
Offline

Joined: Fri Apr 29, 2011 9:44 pm
Posts: 267
tokumaru wrote:
Don't rely so heavily on ROM sizes though, since homebrews can be as small or as large as their creators want.


This is only for .BIN files. Hopefully homebrew uses better file formats.


Top
 Profile  
 
PostPosted: Tue May 06, 2014 4:36 am 
Offline

Joined: Thu Mar 02, 2006 12:30 pm
Posts: 168
The native format for both 2600 and MD ROMs is a raw binary. Homebrews use the exact same type of file formats that commercial games do. The only other viable alternative MD format is .SMD, and...well, just no.

_________________
Read my blog! The Incoherent Ramblings of a Lowly Geek


Top
 Profile  
 
PostPosted: Tue May 06, 2014 6:43 am 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19116
Location: NE Indiana, USA (NTSC)
Same with SFC, Game Boy, GBC, and GBA: the executable format is just the raw binary. This is just about creating the needed infrastructure to distinguish which platform a particular raw binary is for. Most of the time it's metadata in the filename, but this doesn't distinguish Atari 2600, Genesis, and early GBA images, all of whose filenames end with ".bin". Fortunately, Genesis and GBA have constants in the first 320 bytes.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 13 posts ] 

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group