firmware and file selection

https://github.com/mist-devel/mist-board/wiki

Moderators: Mug UK, Zorro 2, Greenious, spiny, Moderator Team

User avatar
Newsdee
Atari God
Atari God
Posts: 1461
Joined: Fri Sep 19, 2014 8:40 am

firmware and file selection

Postby Newsdee » Wed Nov 02, 2016 4:41 pm

Moved from firmware thread:

uchristo wrote:Hi there!
I'm quite unsure whether questions are allowed in this special Thread....
To make it short: I'm from the other side :D
I'm mainly using the MiniMig AGA Core. I'd like to expand the firmware to safe the configured ADF-Images as well as. Unfortunately, I'm stuck and need help.

What I did:
Expand the configTYPE to include an Array of 4 fileTYPE for storing the loaded Images.
In menu.c, right before the call of InsertFloppy, I save file to the the respective Slot in my config-Array.

I expanded ApplyConfiguration() in config.c to insert my Floppy-Images from the Array into the active drives. I therefore added a function InsertFloppyByName() which indeed only writes the supplied fileTYPE to the global fileTYPE <file> and afterwards calls InsertFloppy with the respective drive....I included my files (unfortunately included the compiled Object-Files, please ignore them), can you point me to my error?

I guess, the problem has something to do with the use of fileTYPE which may be unique on each boot. I'd rather use the path of the image to point to the files, but was unable to isolate the path from SelectFile (due to insufficient intelligence).


Had a quick look, but I'm not sure exactly what you are after or what the code is supposed to do.
What are you planning to do with the file names, and would it be enough to save the name of the last loaded file? (which could be generic beyond the AGA core)

User avatar
Newsdee
Atari God
Atari God
Posts: 1461
Joined: Fri Sep 19, 2014 8:40 am

Re: firmware and file selection

Postby Newsdee » Wed Nov 02, 2016 4:56 pm

Is the intention to save a list of floppies in the config so that they load on startup?

There's this comment in config.h; that second line seems to answer your question:

Code: Select all

extern fileTYPE file;   // Temporary file available for use by other modules, to avoid repeated memory usage.
                  // Shouldn't be considered persistent.


You should probably save file names as string instead.
Look inside MENU_FILE_SELECT2, under the case (select) part, that's where the actual file is chosen and it should be possible to grab the full filename from there.

Code: Select all

strncpy(file.long_name, DirEntryLFN[sort_table[iSelectedEntry]], len);

uchristo
Retro freak
Retro freak
Posts: 13
Joined: Wed Sep 28, 2016 3:22 pm

Re: firmware and file selection

Postby uchristo » Tue Nov 15, 2016 7:52 am

Hi Newsdee!

Thanks for your responses. Sorry for the late answer, I do not poll this forum so often.... (not yet, at least ;-) )
Yes, I'd like to save the whole Path of the selected Disk-Image to the config to reload the file (after probing with fileopen()) while loading a config.

Additionally, I'd like to add support for additional Config-Filenames. Actually, minimig.cfg, minimig1.cfg....minimig4.cfg are generated. I'd like to place the files like minimigBubbleBobble.cfg, minimigTurrican.cfg and so on....

User avatar
Newsdee
Atari God
Atari God
Posts: 1461
Joined: Fri Sep 19, 2014 8:40 am

Re: firmware and file selection

Postby Newsdee » Tue Nov 15, 2016 4:32 pm

I think the core saves HDD path, but maybe only for files on root. You can check what it does.

uchristo
Retro freak
Retro freak
Posts: 13
Joined: Wed Sep 28, 2016 3:22 pm

Re: firmware and file selection

Postby uchristo » Thu Nov 17, 2016 3:46 pm

Well, it indeed saves the filename, but does not include the full path (which makes sense, because the hdf has to reside in the root of the FS)
Nevertheless, I'll proceed using the FILE-Selection-Menu


Return to “MiST”

Who is online

Users browsing this forum: No registered users and 2 guests