/[gxemul]/trunk/src/file/file.c
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/src/file/file.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 42 by dpavlin, Mon Oct 8 16:22:32 2007 UTC revision 44 by dpavlin, Mon Oct 8 16:22:56 2007 UTC
# Line 25  Line 25 
25   *  SUCH DAMAGE.   *  SUCH DAMAGE.
26   *   *
27   *   *
28   *  $Id: file.c,v 1.4 2007/05/22 09:49:31 debug Exp $   *  $Id: file.c,v 1.5 2007/06/23 23:59:14 debug Exp $
29   *   *
30   *  This module contains functions which load executable images into (emulated)   *  This module contains functions which load executable images into (emulated)
31   *  memory. File formats recognized so far are:   *  memory. File formats recognized so far are:
# Line 123  void file_load(struct machine *machine, Line 123  void file_load(struct machine *machine,
123  {  {
124          int iadd = DEBUG_INDENTATION, old_quiet_mode;          int iadd = DEBUG_INDENTATION, old_quiet_mode;
125          FILE *f;          FILE *f;
126            char *tmpdir = getenv("TMPDIR") == NULL?
127                DEFAULT_TMP_DIR : getenv("TMPDIR");
128          unsigned char buf[12];          unsigned char buf[12];
129          unsigned char buf2[2];          unsigned char buf2[2];
130            char tmpname[400];
131          size_t len, len2, i;          size_t len, len2, i;
132          off_t size;          off_t size;
133    
# Line 298  void file_load(struct machine *machine, Line 301  void file_load(struct machine *machine,
301           *  is a "scrambled" raw binary. This code unscrambles it, and loads           *  is a "scrambled" raw binary. This code unscrambles it, and loads
302           *  it as a raw binary.           *  it as a raw binary.
303           */           */
304            snprintf(tmpname, sizeof(tmpname), "%s/gxemul.", tmpdir);
305          if (machine->machine_type == MACHINE_DREAMCAST &&          if (machine->machine_type == MACHINE_DREAMCAST &&
306              strncmp(filename, "/tmp/gxemul.", 12) == 0) {              strncmp(filename, tmpname, strlen(tmpname)) == 0) {
307                  char *tmp_filename = malloc(strlen(filename) + 100);                  char *tmp_filename = malloc(strlen(filename) + 100);
308                  snprintf(tmp_filename, strlen(filename) + 100,                  snprintf(tmp_filename, strlen(filename) + 100,
309                      "%s.descrambled", filename);                      "%s.descrambled", filename);

Legend:
Removed from v.42  
changed lines
  Added in v.44

  ViewVC Help
Powered by ViewVC 1.1.26