Search
lxdream.org :: lxdream/src/loader.h :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/loader.h
changeset 1109:700c5ab26a63
prev1108:305ef2082079
next1296:30ecee61f811
author nkeynes
date Thu Jun 10 22:13:16 2010 +1000 (11 years ago)
permissions -rw-r--r--
last change Integrate executable wrapping into the user interface
- command-line now loads wrapped by default, -e <bin> to run binary
- add support for .bin executables
- Add useful (internal) error codes
file annotate diff log raw
1.1 --- a/src/loader.h Fri Jun 04 09:13:40 2010 +1000
1.2 +++ b/src/loader.h Thu Jun 10 22:13:16 2010 +1000
1.3 @@ -34,37 +34,37 @@
1.4 */
1.5 extern char *file_loader_extensions[][2];
1.6
1.7 -/**
1.8 - * Load the CD bootstrap, aka IP.BIN. Identified by "SEGA SEGAKATANA" at
1.9 - * start of file. IP.BIN is loaded as-is at 8C008000.
1.10 - * This is mainly for testing as it's unlikely anyone would want to do this
1.11 - * for any other reason.
1.12 - * @return TRUE on success, otherwise FALSE and errno
1.13 - */
1.14 -gboolean file_load_bootstrap( const gchar *filename );
1.15 +typedef enum {
1.16 + FILE_ERROR,
1.17 + FILE_BINARY,
1.18 + FILE_ELF,
1.19 + FILE_ISO,
1.20 + FILE_DISC,
1.21 + FILE_ZIP,
1.22 + FILE_SAVE_STATE,
1.23 + FILE_UNKNOWN,
1.24 +} lxdream_file_type_t;
1.25
1.26 /**
1.27 - * Load a miscellaneous .bin file, as commonly used in demos. No magic
1.28 - * applies, file is loaded as is at 8C010000
1.29 + * Attempt to identify the given file as one of the above file types
1.30 */
1.31 -gboolean file_load_binary( const gchar *filename );
1.32 +lxdream_file_type_t file_identify( const gchar *filename, int fd, ERROR *err );
1.33
1.34 /**
1.35 - * Load a "Self Boot Inducer" .sbi file, also commonly used to package
1.36 - * demos. (Actually a ZIP file with a predefined structure
1.37 + * Load any supported file, and return the type of file loaded.
1.38 + * If the file is a disc, the disc is mounted.
1.39 + *
1.40 + * @param filename The file to load
1.41 + * @param wrap_exec If true, load executables as disc images. Otherwise load
1.42 + * directly into RAM
1.43 + * @param err Updated with error message on failure.
1.44 */
1.45 -gboolean file_load_sbi( const gchar *filename );
1.46 +lxdream_file_type_t file_load_magic( const gchar *filename, gboolean wrap_exec, ERROR *err );
1.47
1.48 /**
1.49 - * Load an ELF executable binary file. Origin is file-dependent.
1.50 + * Load an ELF or .bin executable file based on magic.
1.51 */
1.52 -gboolean file_load_elf( const gchar *filename );
1.53 -
1.54 -/**
1.55 - * Load any of the above file types, using the appropriate magic to determine
1.56 - * which is actually applicable
1.57 - */
1.58 -gboolean file_load_magic( const gchar *filename );
1.59 +gboolean file_load_exec( const gchar *filename, ERROR *err );
1.60
1.61 cdrom_disc_t cdrom_wrap_magic( cdrom_disc_type_t type, const gchar *filename, ERROR *err );
1.62
.