custom firmware for sega flashback 2018

Discussion in 'Other Consoles & Oldies' started by WD_GASTER2, Nov 17, 2018.

  1. dcuk7

    dcuk7 Advanced Member

    Newcomer
    2
    Dec 17, 2018
    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.
     
  2. D-an-W

    D-an-W GBAtemp Regular

    Member
    4
    Nov 13, 2002
    Would anyone know if the official firmware update (Just giving SD Card access) turns the Mega Drive into a Genesis (Just curious)?
     
  3. kublai

    kublai GBAtemp Fan

    Member
    6
    May 29, 2008
    United States
    I'm kind of confused, Are the Eu/UK/USA versions all the same? All the regions can use the same firmware?
     
  4. D-an-W

    D-an-W GBAtemp Regular

    Member
    4
    Nov 13, 2002
    This post cleared it up for me, I hadn't seen it had been edited.
     
  5. dcuk7

    dcuk7 Advanced Member

    Newcomer
    2
    Dec 17, 2018
    United Kingdom
    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.
     
    D-an-W likes this.
  6. rrifonas

    rrifonas GBAtemp Regular

    Member
    5
    Jan 28, 2009
    United States
    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, Jan 18, 2019
    Steve_Rose and D-an-W like this.
  7. D-an-W

    D-an-W GBAtemp Regular

    Member
    4
    Nov 13, 2002
    @dcuk7 @rrifonas some excellent info there, I have learnt a lot in the last 12 hours about this device!
     
  8. Steve_Rose

    Steve_Rose Member

    Newcomer
    1
    Dec 26, 2018
    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
     
    fixingmytoys likes this.
  9. rrifonas

    rrifonas GBAtemp Regular

    Member
    5
    Jan 28, 2009
    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 likes this.
  10. Steve_Rose

    Steve_Rose Member

    Newcomer
    1
    Dec 26, 2018
    United Kingdom
    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 :))
     
  11. Steve_Rose

    Steve_Rose Member

    Newcomer
    1
    Dec 26, 2018
    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
     
  12. Steve_Rose

    Steve_Rose Member

    Newcomer
    1
    Dec 26, 2018
    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
     
  13. dcuk7

    dcuk7 Advanced Member

    Newcomer
    2
    Dec 17, 2018
    United Kingdom
    rrifonas likes this.
  14. rrifonas

    rrifonas GBAtemp Regular

    Member
    5
    Jan 28, 2009
    United States
    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).
     
    Steve_Rose likes this.
  15. subcon959

    subcon959 teh retro

    Member
    12
    Dec 24, 2008
    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, Jan 19, 2019
    Casey-Strange likes this.
  16. Steve_Rose

    Steve_Rose Member

    Newcomer
    1
    Dec 26, 2018
    United Kingdom
    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
     
  17. rrifonas

    rrifonas GBAtemp Regular

    Member
    5
    Jan 28, 2009
    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.

    I've created the update file to both US and EU versions to avoid using Android Tool. Both updates are using the original core:
    Genesis Flashback - Support to load games from SD card with box art
    Mega Drive Flashback - Support to load games from SD card with box art

    And if anyone prefer Picodrive:
     
    Last edited by rrifonas, Feb 2, 2019
  18. Steve_Rose

    Steve_Rose Member

    Newcomer
    1
    Dec 26, 2018
    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 :)
     
  19. rrifonas

    rrifonas GBAtemp Regular

    Member
    5
    Jan 28, 2009
    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, Jan 19, 2019
  20. dcuk7

    dcuk7 Advanced Member

    Newcomer
    2
    Dec 17, 2018
    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.
     
Loading...