aboutsummaryrefslogtreecommitdiffstats
path: root/emulators
diff options
context:
space:
mode:
authormartymac <martymac@FreeBSD.org>2011-07-15 20:37:24 +0800
committermartymac <martymac@FreeBSD.org>2011-07-15 20:37:24 +0800
commit10ee40d8f8d246e26ce071ad2da0225fa61f8949 (patch)
treec3a0f7ce08237f9f2a47bcc4150780e28ae24aa3 /emulators
parent2f075ddc476c3d06bc6f32db6f1d54a17911c0d0 (diff)
downloadfreebsd-ports-graphics-10ee40d8f8d246e26ce071ad2da0225fa61f8949.tar.gz
freebsd-ports-graphics-10ee40d8f8d246e26ce071ad2da0225fa61f8949.tar.zst
freebsd-ports-graphics-10ee40d8f8d246e26ce071ad2da0225fa61f8949.zip
Improve dfbinimage2 plugin CD handling (seeking, fix TOC parsing)
Diffstat (limited to 'emulators')
-rw-r--r--emulators/pcsxr/Makefile1
-rw-r--r--emulators/pcsxr/files/patch-plugins-dfbinimage2-FileInterface.cpp17
-rw-r--r--emulators/pcsxr/files/patch-plugins-dfbinimage2-TrackParser.cpp2
3 files changed, 7 insertions, 13 deletions
diff --git a/emulators/pcsxr/Makefile b/emulators/pcsxr/Makefile
index 432407c57f7..5c22eeef871 100644
--- a/emulators/pcsxr/Makefile
+++ b/emulators/pcsxr/Makefile
@@ -7,6 +7,7 @@
PORTNAME= pcsxr
PORTVERSION= 1.9.92.r68256
+PORTREVISION= 1
CATEGORIES= emulators
MASTER_SITES= http://contribs.martymac.org/FreeBSD-ports/distfiles/ \
LOCAL/martymac
diff --git a/emulators/pcsxr/files/patch-plugins-dfbinimage2-FileInterface.cpp b/emulators/pcsxr/files/patch-plugins-dfbinimage2-FileInterface.cpp
index c24f99584b9..edfe4aa32ad 100644
--- a/emulators/pcsxr/files/patch-plugins-dfbinimage2-FileInterface.cpp
+++ b/emulators/pcsxr/files/patch-plugins-dfbinimage2-FileInterface.cpp
@@ -1,5 +1,5 @@
---- plugins/dfbinimage2/FileInterface.cpp.orig 2008-08-24 14:27:09.000000000 +0000
-+++ plugins/dfbinimage2/FileInterface.cpp 2010-04-22 06:01:39.002592019 +0000
+--- plugins/dfbinimage2/FileInterface.cpp.orig 2011-07-01 06:50:32.771525631 +0200
++++ plugins/dfbinimage2/FileInterface.cpp 2011-07-01 08:34:37.050364589 +0200
@@ -35,7 +35,9 @@
#include <fcntl.h>
#include <sys/stat.h>
@@ -32,22 +32,15 @@
bufferPos.setMSF(MSFTime(255,255,255));
}
-@@ -482,9 +484,16 @@
+@@ -482,9 +484,9 @@
char *buf = (char*)fileBuffer;
int cnt;
for(cnt = 0; cnt < bufferFrames; cnt++) {
- memcpy(buf, seekTime.getMSFbuf(), 3);
- if(ioctl(theFd, CDROMREADRAW, buf)<0)
- break;
-+ if (lseek(theFd,
-+ seekTime.getMSF().m() * bytesPerMinute +
-+ seekTime.getMSF().s() * bytesPerSecond +
-+ seekTime.getMSF().f() * bytesPerFrame,
-+ SEEK_SET) == -1) {
-+ return;
-+ }
-+ if (read(theFd, buf, bytesPerFrame) == -1) {
-+ return;
++ if (pread(theFd, buf, bytesPerFrame, seekTime.getAbsoluteFrame() * bytesPerFrame) != bytesPerFrame) {
++ break;
+ }
buf += bytesPerFrame;
seekTime += CDTime(0,0,1);
diff --git a/emulators/pcsxr/files/patch-plugins-dfbinimage2-TrackParser.cpp b/emulators/pcsxr/files/patch-plugins-dfbinimage2-TrackParser.cpp
index 24abad77d4c..231afb67b2b 100644
--- a/emulators/pcsxr/files/patch-plugins-dfbinimage2-TrackParser.cpp
+++ b/emulators/pcsxr/files/patch-plugins-dfbinimage2-TrackParser.cpp
@@ -16,7 +16,7 @@
- struct cdrom_tochdr tocHdr;
- if(ioctl(theFd, CDROMREADTOCHDR, &tocHdr) < 0) {
+ struct ioc_toc_header tocHdr;
-+ if(ioctl(theFd, CDIOREADTOCENTRY, &tocHdr) < 0) {
++ if(ioctl(theFd, CDIOREADTOCHEADER, &tocHdr) < 0) {
close(theFd);
Exception e(std::string("Cannot read TOC: ") + cuename);
THROW(e);