From 91d411a98977786fc67ad12838245fa4ab99220d Mon Sep 17 00:00:00 2001 From: abs Date: Thu, 26 Jul 2012 22:10:28 +0000 Subject: Fake up a much more complete TOC based on real CD image. Now works with NetBSD 4, 5 & 6 which would have previously failed. Comment out some unusual sector subtractions which handled values in the multigigabyte range. Now allows all tested NetBSD versions (3, 4, 5 & 6) to mount ISO images --- emulators/gxemul/Makefile | 4 +- emulators/gxemul/distinfo | 10 +-- .../patch-src_devices_dev__dreamcast__gdrom.cc | 87 ++++++++++++++++++++++ 3 files changed, 91 insertions(+), 10 deletions(-) create mode 100644 emulators/gxemul/patches/patch-src_devices_dev__dreamcast__gdrom.cc (limited to 'emulators/gxemul') diff --git a/emulators/gxemul/Makefile b/emulators/gxemul/Makefile index bc1a7e24d13..3f128994103 100644 --- a/emulators/gxemul/Makefile +++ b/emulators/gxemul/Makefile @@ -1,7 +1,7 @@ -# $NetBSD: Makefile,v 1.46 2012/07/16 00:19:14 abs Exp $ +# $NetBSD: Makefile,v 1.47 2012/07/26 22:10:28 abs Exp $ DISTNAME= gxemul-0.6.0 -PKGREVISION= 2 +PKGREVISION= 3 CATEGORIES= emulators MASTER_SITES= http://gxemul.sourceforge.net/src/ diff --git a/emulators/gxemul/distinfo b/emulators/gxemul/distinfo index 27530bfecbe..31d78842a3d 100644 --- a/emulators/gxemul/distinfo +++ b/emulators/gxemul/distinfo @@ -1,12 +1,6 @@ -$NetBSD: distinfo,v 1.36 2012/07/16 00:19:14 abs Exp $ +$NetBSD: distinfo,v 1.37 2012/07/26 22:10:28 abs Exp $ SHA1 (gxemul-0.6.0.tar.gz) = aa37ad5f200eee045b1da2b1d3f651401cf474af RMD160 (gxemul-0.6.0.tar.gz) = ac6291a5f8bc9c0d1988d3ce39750339fe90a8ce Size (gxemul-0.6.0.tar.gz) = 3598795 bytes -SHA1 (patch-aa) = 6f2c0dc94606ba213bcc73527ea4bef997c89c45 -SHA1 (patch-ab) = ebd64a2b56cd4140522c567b90dcbfb9440b9db2 -SHA1 (patch-ad) = a8757e7397ec3cc301d02bdf93654f55d558d29f -SHA1 (patch-ae) = 19ef822c16f0f6dd50aea719e0bc797c39d1f9c0 -SHA1 (patch-af) = 8304ff5d8f779ac60f8d416d27e0a183e0e47d94 -SHA1 (patch-ag) = 9d13bf6f6e6038e114a45cfbd03e4e52ac60d2c7 -SHA1 (patch-configure) = b7cacc97ffdeb127be196a7d352ee82b673d4026 +SHA1 (patch-src_devices_dev__dreamcast__gdrom.cc) = 3e9abc13118fb79473adb11156f73c93b13b6dd8 diff --git a/emulators/gxemul/patches/patch-src_devices_dev__dreamcast__gdrom.cc b/emulators/gxemul/patches/patch-src_devices_dev__dreamcast__gdrom.cc new file mode 100644 index 00000000000..cf7c2bc433c --- /dev/null +++ b/emulators/gxemul/patches/patch-src_devices_dev__dreamcast__gdrom.cc @@ -0,0 +1,87 @@ +$NetBSD: patch-src_devices_dev__dreamcast__gdrom.cc,v 1.1 2012/07/26 22:10:28 abs Exp $ + +Fake up a much more complete TOC based on real CD image. +Now works with NetBSD 4, 5 & 6 which would have previously failed. + +Comment out some unusual sector subtractions which handled values in the +multigigabyte range. + +--- src/devices/dev_dreamcast_gdrom.cc.orig 2010-02-14 09:33:52.000000000 +0000 ++++ src/devices/dev_dreamcast_gdrom.cc +@@ -109,12 +109,37 @@ static void handle_command(struct cpu *c + } + alloc_data(d); + +- /* TODO: Fill TOC in a better way */ +- d->data[99*4] = 1; /* First track */ +- d->data[100*4] = 2; /* Last track */ ++ /* ++ TOC from test booted real CD image on NetBSD/dreamcast ++ 01000096,41002e4c,ffffffff * 97,01010000,41020000,6100e641, ++ */ ++ memset(d->data, 0xff, d->cnt); /* Default data to 0xff */ ++ ++ d->data[0*4] = 0x10; /* Track 1 */ ++ d->data[0*4+1] = 0; ++ d->data[0*4+2] = 0; ++ d->data[0*4+3] = 0x96; ++ ++ d->data[1*4] = 0x41; /* Track 2 */ ++ d->data[1*4+1] = 0; ++ d->data[1*4+2] = 0x2e; ++ d->data[1*4+3] = 0x4c; ++ ++ d->data[99*4] = 0x01; /* First track */ ++ d->data[99*4+1] = 0x01; ++ d->data[99*4+2] = 0; ++ d->data[99*4+3] = 0; ++ ++ d->data[100*4] = 0x41; /* Last track */ ++ d->data[100*4+1] = 0x02; ++ d->data[100*4+2] = 0; ++ d->data[100*4+3] = 0; ++ ++ d->data[101*4] = 0x61; /* Leadout */ ++ d->data[101*4+1] = 0; ++ d->data[101*4+2] = 0xe6; ++ d->data[101*4+3] = 0x41; + +- d->data[0*4] = 0x10; /* Track 1 */ +- d->data[1*4] = 0x10; /* Track 2 */ + break; + + case 0x30: +@@ -126,6 +151,7 @@ static void handle_command(struct cpu *c + } + sector_nr = d->cmd[2] * 65536 + d->cmd[3] * 256 + d->cmd[4]; + sector_count = d->cmd[8] * 65536 + d->cmd[9] * 256 + d->cmd[10]; ++ + if (d->cnt == 0) + d->cnt = 65536; + alloc_data(d); +@@ -136,9 +162,17 @@ static void handle_command(struct cpu *c + } + + { ++ ++/* Definitely not needed for NetBSD - unknown if needed for anything else? */ ++#if 0 + if (sector_nr >= 1376810) + sector_nr -= 1376810; ++#endif ++ + sector_nr -= 150; ++ ++/* Definitely not needed for NetBSD - unknown if needed for anything else? */ ++#if 0 + if (sector_nr > 1048576) + sector_nr -= 1048576; + /* printf("sector nr = %i\n", (int)sector_nr); */ +@@ -146,6 +180,7 @@ if (sector_nr > 1048576) + if (sector_nr < 1000) + sector_nr += (diskimage_get_baseoffset(cpu->machine, 0, DISKIMAGE_IDE) + / 2048); ++#endif + } + + res = diskimage_access(cpu->machine, 0, DISKIMAGE_IDE, -- cgit v1.2.3