pkgsrc-wip/gens/patches/patch-ah
Dieter Baron a43f29406b Initial import of gens-2.12rc3:
Gens is an emulator of Sega's 16 bit consoles: Genesis
	(a.k.a Megadrive), Game Gear, and Sega CD (a.k.a Mega CD).
	For Sega CD, you will need BIOS ROM images.
2004-06-26 19:49:04 +00:00

40 lines
850 B
Text

$NetBSD: patch-ah,v 1.1.1.1 2004/06/26 19:49:06 dillo Exp $
--- src/gens/util/rom.c.orig 2004-05-18 22:33:59.000000000 +0200
+++ src/gens/util/rom.c
@@ -17,6 +17,7 @@
#include "ccnet.h"
#include "misc.h"
#include "unzip.h"
+#include "chd.h"
#include "wave.h"
#include "gym.h"
#include <assert.h>
@@ -168,6 +169,7 @@ Detect_Format (char *Name)
FILE *f;
unzFile zf;
unz_file_info zinf;
+ struct chd *cf;
int i;
char buf[1024], zname[256];
@@ -225,6 +227,19 @@ Detect_Format (char *Name)
gzread (f, buf, 1024);
gzclose (f);
}
+ else if (!stricmp (".chd", &Name[strlen (Name) -4]))
+ {
+ char *p;
+ int n;
+
+ cf = chd_open(Name, NULL);
+ if (cf == NULL)
+ return -1;
+
+ chd_read_range(cf, buf, 0, 1024);
+
+ chd_close(cf);
+ }
else
{
strcpy (zname, Name);