custom firmware for sega flashback 2018

dcuk7

Developer
Developer
Joined
Dec 17, 2018
Messages
122
Trophies
0
Age
40
XP
370
Country
United Kingdom
@rrifonas Have you tried replacing and/or adding games to the roms partition and flashing that?

I was going to have a go at the weekend as I'm thinking I could make my own perfect version with all the games I love (complete with box art) and just use the SD card for the games I'd only rarely play.
 

dcuk7

Developer
Developer
Joined
Dec 17, 2018
Messages
122
Trophies
0
Age
40
XP
370
Country
United Kingdom
Would anyone know if the official firmware update (Just giving SD Card access) turns the Mega Drive into a Genesis (Just curious)?

No it doesn't. I have one of these on stock firmware and the latest update from the AtGames only changes a few files and doesn't touch any of the graphics relating to the model.

I assume they will do that with all updates (if indeed we get any more) so that one file can apply to both Genesis and Mega Drive models.
 
  • Like
Reactions: D-an-W

rrifonas

Well-Known Member
Member
Joined
Jan 28, 2009
Messages
258
Trophies
1
XP
1,265
Country
United States
@rrifonas Have you tried replacing and/or adding games to the roms partition and flashing that?

I was going to have a go at the weekend as I'm thinking I could make my own perfect version with all the games I love (complete with box art) and just use the SD card for the games I'd only rarely play.

Yes, it's possible to that but it's not so easy as this device is running Linux (no ADB support) and the partitions as read-only:
1) You will need to create your own rom partition and update file, or flash it using AndroidTool
2) The partition is SquashFS, this is a compressed read-only format for Linux. You will need to have a Linux machine or install the Linux subsystem for Windows 10 to create a new partition using mksquashfs
3) The new partition should not exceed 60MB. Since it's a compressed format, it may be larger, but the .img file to create the upload for flash should not exceed 60MB (61,440KB). If the partition is larger, it will break the 'next' partition, which is the /emulator, soft-bricking the device. You can fix it flashing back the original rom and emulator partitions using the right parameters
4) Add or remove games is quite simple. There is a all-games.ini file, you only need to edit it

This is only an overview of the process but it's not that difficult to do if you have the tools and some patience.

Replying @D-an-W and @kublai:
This device has several partitions, being the following the most significant:
/rootfs -> Base OS files (14MB). It's the same for all consoles (Genesis FB, MD FB, Legends FB)
/rom -> Where the ROMs, box arts and gamelist are stored (60MB)
/emulator -> Menu (retromenu), Emulator (retroplayer) and cores are stored in this partition (8MB in Genesis FB/MD FB, 10MB in Legends FB). My custom firmware replaces this partition. It has a change in retromenu to read all extensions, and/or replace Genesis Plus GX core with Picodrive from ModMyClassic
/data -> Has control files (retroplayer.ini, bgm_config.ini, play-data-recent.ini and sdcard_config.ini) and save states/sram files. Atgames update replaces this partition, writing a new sdcard_config.ini to enable SD Card. This partition is the same for Genesis /MD FB. The size for this partition should be around 160MB but it looks like Atgames made it smaller inside the OS; The explanation is that the OS creates a /tempfs partition for temporary cache. I didn't see the actual size in Genesis / MD FB but in Legends FB this partition has only 4MB and the rest of the NAND space is available as 'tempfs' to decompress the ROMs.

This thread have the links for the EU/UK firmware. I edited the other thread with all links but I will do the same with the post in this thread as well.

Sorry for the lengthy post.
 
Last edited by rrifonas,

Steve_Rose

Member
Newcomer
Joined
Dec 26, 2018
Messages
13
Trophies
0
Age
40
XP
79
Country
United Kingdom
@rrifonas those instructions are amazing :) 60MB should be a fair few roms compressed :)
I do wonder if there is a way we can create a symlink? (or remount the SD card to \rom) (my knowledge of Linux is limited) to the SD card from the rom partition allowing us to add roms with images etc to the SD?
I don't know enough to implement anything like this but its tempting to investigate... I already have a Snes Classic too so doing this is unnecessary but I cant help being tempted to do some learning lol
 
  • Like
Reactions: fixingmytoys

rrifonas

Well-Known Member
Member
Joined
Jan 28, 2009
Messages
258
Trophies
1
XP
1,265
Country
United States
These ideas would work if the root partition could be written.
The best I could do was to move the game list to the /data partition (another hex-editor hack in the menu executable) running a script before the menu loads. If all-games.ini is in the SD Card, the script copies this file to /data and load the games from SD Card. If the file is not there, the script will copy the original all-games.ini from the /rom partition.

The problem with this approach is that I don't have any idea how large all-games.ini can be.
 

Steve_Rose

Member
Newcomer
Joined
Dec 26, 2018
Messages
13
Trophies
0
Age
40
XP
79
Country
United Kingdom
The problem with this approach is that I don't have any idea how large all-games.ini can be.
It's only a text file so I can't imagine it would be that big?
If you can repoint the loader to read the ini from data, is it not possible to do the same but point it to the SD Card? I appreciate no sd = no games in this instance but extracting the games to the sd is no biggie :/ I'm gonna get myself a Linux setuo so I can have a play this weekend (now I have a backup :))
 
  • Like
Reactions: image45

Steve_Rose

Member
Newcomer
Joined
Dec 26, 2018
Messages
13
Trophies
0
Age
40
XP
79
Country
United Kingdom
OK I have done some digging, I don't have time right now to do anything but.. Within root.img you can access /etc/fstab (this is where mount points are set for the underlying OS. I rekon, I'm you updated /rom to mount to /dev/mmcblk0p1 with an fs type of auto and repack and flash, the device will try to boot the sd card as /rom
 

Steve_Rose

Member
Newcomer
Joined
Dec 26, 2018
Messages
13
Trophies
0
Age
40
XP
79
Country
United Kingdom
Does anyone know where I can find the unpack and repack tools for playing with the img files, Ive managed to mount them in Ubuntu, Ive managed to extract the squashfs image for root fs and modify it, I'm struggling to find instructions on repacking... maybe i'm not searching hard enough but the one repack I did do had errors and the resulting image was significantly smaller.

I tried to access http://mdfbrew.org but the site is offline.


Thanks Steve
 

rrifonas

Well-Known Member
Member
Joined
Jan 28, 2009
Messages
258
Trophies
1
XP
1,265
Country
United States
Does anyone know where I can find the unpack and repack tools for playing with the img files, Ive managed to mount them in Ubuntu, Ive managed to extract the squashfs image for root fs and modify it, I'm struggling to find instructions on repacking... maybe i'm not searching hard enough but the one repack I did do had errors and the resulting image was significantly smaller.

I tried to access http://mdfbrew.org but the site is offline.


Thanks Steve
You can unpack the .img files using 7-zip in Windows.
You will need a Linux computer or install Linux on Windows 10 to repack the partition. You can use mksquashfs /tmp/rom /tmp/rom.img

If you can access the device using the rockchip tool you just need to flash the partition with the correct addresses.

If you want to create an update file, you will need ImgRepackerRk and a config file I can share later today.
I did not mess with rootfs or the partition tables, but your idea is good for what you want.

Regarding my concern with All-games.ini, this file has around 70Kb but it can easily increase to more than 200Kb. My concern is if a larger file can cause issues with the menu (slow to load or do not load everything).
 
  • Like
Reactions: Steve_Rose

subcon959

@!#?@!
Member
Joined
Dec 24, 2008
Messages
5,845
Trophies
4
XP
10,108
Country
United Kingdom
If anyone does manage to properly replace roms with artwork then please provide some step-by-step instructions, as I'm really only looking to add a couple of my favourite games to the default list rather than a whole romset on SD.

I did already bridge the pins and add a recovery switch to the back so I could easily use RK tools whenever needed.
 
Last edited by subcon959,
  • Like
Reactions: Casey-Strange

Steve_Rose

Member
Newcomer
Joined
Dec 26, 2018
Messages
13
Trophies
0
Age
40
XP
79
Country
United Kingdom
If you want to create an update file, you will need ImgRepackerRk and a config file I can share later today.
I did not mess with rootfs or the partition tables, but your idea is good for what you want.
Cheers, let me know where I can get the config stuff and I'll give it a go.. It's easy enough to extract the existing rom partition so can throw that on SD with any additionals :) once I have that working, I have other enhancement ideas (but need to prove this first)

Thanks
Steve
 

rrifonas

Well-Known Member
Member
Joined
Jan 28, 2009
Messages
258
Trophies
1
XP
1,265
Country
United States
While mounting the SD Card in fstab is a clever idea, it's a permanent solution.
I've found a better way to do that using the script to load the menu and adding a control file in the SD Card.
Code:
#!/bin/sh
if [ -e /media/usbhd-mmcblk0p1/mount_sd.ini ]
then
    su -
    umount /rom
    mount /media/usbhd-mmcblk0p1/rom /rom
fi
while :
do
 cd /emulator
 startx ./retromenu
done
This script is already in /emulator partition so you are not touching the OS at all. My mod looks for the control file mount_sd.ini in the root of the SD Card and reload the /rom partition to a rom folder in your SD Card. If you delete the control file or boot the console without SD Card, you will have the original rom partition.

Now you just need to create a mount_sd.ini file and a rom folder in the root of the SD Card, copy the contents from the original "rom" partition to this folder, copy your favorite games and edit all-games.ini to include them in the game list.
Here is an example for all-games.ini:

Code:
[Aladdin]
File=/rom/Aladdin(USA).md
Platform=Genesis
Sort=Aladdin
Year=1992
Genre=bonus
Description=
Dpad=Directional movement
Start=Start, pause
A=Throw apple
B=Attack
C=Jump
X=No function
Y=No function
Z=No function
"Genre" can be anything, but if you use "sonic" or "bonus" you will move the games to these categories. "sonic" genre supports only 10 games. I haven't seen if "bonus" has a limit.

Box art must be in .png format, and you need to have 2 files: Aladdin(USA).md.png and Aladdin(USA).md.s.png. The png file is the box art when you open the details, and the .s.png is the smaller thumbnail.
 
Last edited by rrifonas,

Steve_Rose

Member
Newcomer
Joined
Dec 26, 2018
Messages
13
Trophies
0
Age
40
XP
79
Country
United Kingdom
This is the other option I noticed :) I figured that either way is just as permanant as you are flashing the img file.. But your way avoids doing anything to the rootfs (which is obviously a little safer) could you pm me the config stuff or share it anyway as there are 2 other things I want to try :)
 

rrifonas

Well-Known Member
Member
Joined
Jan 28, 2009
Messages
258
Trophies
1
XP
1,265
Country
United States
This method has the advantage it is not permanent besides the fact the script is running. Removing the control file or removing the SD Card will reload the original partition.

I've sent the config file by PM to avoid mess this topic (which is already a mess) :D

You don't need any config file if you are using Android Tool, just rebuild the partitions using mksquashfs and you are good to reflash them. The config file is only used to create the Rockchip update file.
 
Last edited by rrifonas,

dcuk7

Developer
Developer
Joined
Dec 17, 2018
Messages
122
Trophies
0
Age
40
XP
370
Country
United Kingdom
Great work guys. I started work on a rudimentary app to manage the all-games.ini (including automatic box art resizing) for the 2017 flashback so I may pick this back up and finish it for this model.

@rrifonas will you be making a picodrive version of those latest updates? I think I prefer how picodrive runs on this hardware now.
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    Xdqwerty @ Xdqwerty: yawn