gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

DS Misc > Heretic and Hexen in the same Cart

#53444 - SolidSnake - Thu Sep 08, 2005 2:10 pm

Is this possible??

#53472 - MrAdults - Thu Sep 08, 2005 5:07 pm

Maybe. Hexen's source has been out there for a while. Since the core of the Doom engine is mostly unchanged between the two, it would just be mainly a matter of fitting assets for both Hexen and Heretic in under 32mbits (aside from globals needed by game code), which would work if you can also fit your binary in under a couple megs (which should also be reasonable). In short, not at all worth the effort it would require, and especially not worth the waste of ram from extra globals lying around.

I'd rather see someone make it work with GBAMP or something else that would make saving/loading and persistant level data storage a reasonable thing. This has acted as a deterrent for me, since Hexen isn't a lot of fun without proper back-and-forth level transitions (after you cheat and warp through all the levels). That, and me not actually having a GBAMP to do it myself.

-Rich

#53527 - SolidSnake - Fri Sep 09, 2005 12:07 am

but there is a hexen / heretic port already made for DS o.0
i just would like to know if i could use both with some kind of loader

#53531 - MrAdults - Fri Sep 09, 2005 12:55 am

I'm aware there are ports, I did the Hexen one. I assumed you meant having them in one running binary, akin to the more popular Doom engine Windows source ports (more specifically Doomsday).

The first issue you'd run into using a loader for both would be the fact that they both (or at least Hexen) expect their asset files to be stored at the beginning of cart rom. I'm sure you'd run into other issues that don't immediately come to mind.

-Rich

#53601 - tepples - Fri Sep 09, 2005 5:16 pm

MrAdults wrote:
The first issue you'd run into using a loader for both would be the fact that they both (or at least Hexen) expect their asset files to be stored at the beginning of cart rom.

That's sort of what I made skip_gbfs_file() for. If two programs are looking for files of different names, try something like the following (untested) code:
Code:
/* is_gbfs_file() **************
   Returns FALSE if data is a null pointer.
   Returns TRUE if data appears to point at a GBFS file.
   Returns FALSE otherwise.
*/
void is_gbfs_file(const GBFS_FILE *data)
{
  const u32 *d = (const u32 *)data;

  return d && (*d == 0x456e6950);
}

/* find_first_gbfs_file_containing() **********
   Finds the first GBFS file in GBA ROM space that contains
   an object of the given name.
*/
const GBFS_FILE *find_first_gbfs_file_containing(const char *name)
{
  const GBFS_FILE *data;

  for(data = find_first_gbfs_file(find_first_gbfs_file);
      is_gbfs_file(data) && !gbfs_get_obj(data, name, NULL);
      data = skip_gbfs_file(data))
    { ; }

  if(!is_gbfs_file(data))
    return NULL;
  else
    return data;
}

Then you'd find_first_gbfs_file_containing("hexen.wad") or something like that.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.