pkgsrc-Changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
CVS commit: pkgsrc/games/xclannad
Module Name: pkgsrc
Committed By: tsutsui
Date: Fri Jan 3 02:35:51 UTC 2020
Added Files:
pkgsrc/games/xclannad: DESCR Makefile PLIST distinfo
pkgsrc/games/xclannad/patches: patch-Makefile.in
patch-font_font__peer__ft2.cc patch-font_text__stream.cc
patch-music2_music.cc patch-scn2k_scn2k__cmd.cc
patch-scn2k_scn2k__grp.cc patch-scn2k_scn2k__text.cc
patch-system_file.cc patch-system_file.h
patch-system_system__config.cc patch-window_SDL__rotozoom.cc
patch-window_button.cc patch-window_picture.cc patch-xlovesys.cc
Log Message:
xclannad: Import xclannad-0.07hc as games/xclannad
Xclannad, developed by Jagarl, is an interpretor for RealLive engine games.
To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 pkgsrc/games/xclannad/DESCR \
pkgsrc/games/xclannad/Makefile pkgsrc/games/xclannad/PLIST \
pkgsrc/games/xclannad/distinfo
cvs rdiff -u -r0 -r1.1 pkgsrc/games/xclannad/patches/patch-Makefile.in \
pkgsrc/games/xclannad/patches/patch-font_font__peer__ft2.cc \
pkgsrc/games/xclannad/patches/patch-font_text__stream.cc \
pkgsrc/games/xclannad/patches/patch-music2_music.cc \
pkgsrc/games/xclannad/patches/patch-scn2k_scn2k__cmd.cc \
pkgsrc/games/xclannad/patches/patch-scn2k_scn2k__grp.cc \
pkgsrc/games/xclannad/patches/patch-scn2k_scn2k__text.cc \
pkgsrc/games/xclannad/patches/patch-system_file.cc \
pkgsrc/games/xclannad/patches/patch-system_file.h \
pkgsrc/games/xclannad/patches/patch-system_system__config.cc \
pkgsrc/games/xclannad/patches/patch-window_SDL__rotozoom.cc \
pkgsrc/games/xclannad/patches/patch-window_button.cc \
pkgsrc/games/xclannad/patches/patch-window_picture.cc \
pkgsrc/games/xclannad/patches/patch-xlovesys.cc
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Added files:
Index: pkgsrc/games/xclannad/DESCR
diff -u /dev/null pkgsrc/games/xclannad/DESCR:1.1
--- /dev/null Fri Jan 3 02:35:51 2020
+++ pkgsrc/games/xclannad/DESCR Fri Jan 3 02:35:51 2020
@@ -0,0 +1 @@
+Xclannad, developed by Jagarl, is an interpretor for RealLive engine games.
Index: pkgsrc/games/xclannad/Makefile
diff -u /dev/null pkgsrc/games/xclannad/Makefile:1.1
--- /dev/null Fri Jan 3 02:35:51 2020
+++ pkgsrc/games/xclannad/Makefile Fri Jan 3 02:35:51 2020
@@ -0,0 +1,44 @@
+# $NetBSD: Makefile,v 1.1 2020/01/03 02:35:51 tsutsui Exp $
+#
+
+DISTNAME= xclannad-7hc
+PKGNAME= xclannad-0.07hc
+CATEGORIES= games
+#MASTER_SITES= http://www.creator.club.ne.jp/~jagarl/
+MASTER_SITES= http://teokurebsd.org/netbsd/packages/distfiles/xclannad/
+
+MAINTAINER= tsutsui%NetBSD.org@localhost
+HOMEPAGE= https://web.archive.org/web/20100331135549/http://www.creator.club.ne.jp/~jagarl/xclannad.html
+COMMENT= Interpretor to execute REALLIVE games for Microsoft Windows
+LICENSE= modified-bsd AND gnu-gpl-v2
+
+WRKSRC= ${WRKDIR}/xclannad-0.07h
+GNU_CONFIGURE= yes
+USE_LANGUAGES= c c++03
+
+.include "../../mk/bsd.prefs.mk"
+
+.if ${OPSYS} == "NetBSD"
+CONFIGURE_ARGS+= --with-audiodev=/dev/audio
+.endif
+
+SUBST_CLASSES+= path
+SUBST_MESSAGE.path= Fixing hardcoded paths.
+SUBST_STAGE.path= pre-configure
+SUBST_FILES.path= configure font/font_peer_ft2.cc
+SUBST_SED.path= -e 's|/usr/local/|${PREFIX}/|g'
+SUBST_SED.path+= -e 's|/usr/pkg/|${PREFIX}/|g'
+SUBST_SED.path+= -e 's|/usr/X11R6/|${X11BASE}/|g'
+SUBST_SED.path+= -e 's|/usr/X11R7/|${X11BASE}/|g'
+
+.include "../../devel/zlib/buildlink3.mk"
+BUILDLINK_API_DEPENDS.gtk2+= gtk2+>=2.6.0
+.include "../../audio/SDL_mixer/buildlink3.mk"
+.include "../../audio/libvorbis/buildlink3.mk"
+.include "../../devel/SDL/buildlink3.mk"
+.include "../../graphics/png/buildlink3.mk"
+.include "../../graphics/freetype2/buildlink3.mk"
+.include "../../multimedia/smpeg/buildlink3.mk"
+.include "../../mk/jpeg.buildlink3.mk"
+.include "../../mk/pthread.buildlink3.mk"
+.include "../../mk/bsd.pkg.mk"
Index: pkgsrc/games/xclannad/PLIST
diff -u /dev/null pkgsrc/games/xclannad/PLIST:1.1
--- /dev/null Fri Jan 3 02:35:51 2020
+++ pkgsrc/games/xclannad/PLIST Fri Jan 3 02:35:51 2020
@@ -0,0 +1,3 @@
+@comment $NetBSD: PLIST,v 1.1 2020/01/03 02:35:51 tsutsui Exp $
+bin/nwatowav
+bin/xclannad
Index: pkgsrc/games/xclannad/distinfo
diff -u /dev/null pkgsrc/games/xclannad/distinfo:1.1
--- /dev/null Fri Jan 3 02:35:51 2020
+++ pkgsrc/games/xclannad/distinfo Fri Jan 3 02:35:51 2020
@@ -0,0 +1,20 @@
+$NetBSD: distinfo,v 1.1 2020/01/03 02:35:51 tsutsui Exp $
+
+SHA1 (xclannad-7hc.tar.gz) = fbe63701a47a1bc90aca8ab8d0b41ca3b5c9d114
+RMD160 (xclannad-7hc.tar.gz) = a7bea485587c59d7797aa1bde01f0eb963122d02
+SHA512 (xclannad-7hc.tar.gz) = 5d14c1ca6932d0a013e36c2af51d0d4de2cb73e4c438ccf2bebf03f223a62649203726cc552f975e3177ea614f79c1d2d0d36220116289f0bb8f65a74997ac27
+Size (xclannad-7hc.tar.gz) = 534245 bytes
+SHA1 (patch-Makefile.in) = 3586afaf131737ded3ac1b64bfa56b3c357f3269
+SHA1 (patch-font_font__peer__ft2.cc) = cb40078c701d1bf6c5113d21890ed8d9fbb18b62
+SHA1 (patch-font_text__stream.cc) = 27b2812c199f69f4d58cc9324c9aa56b713b5abe
+SHA1 (patch-music2_music.cc) = fe8c90d9901a86dc6c799a1482ffe8ca7ca53c98
+SHA1 (patch-scn2k_scn2k__cmd.cc) = cd13290660eab7748998e46782e751748f8d4685
+SHA1 (patch-scn2k_scn2k__grp.cc) = cf0c7efa5fcac698873665b9b51f98b62344fb1d
+SHA1 (patch-scn2k_scn2k__text.cc) = aef8170b267a5a2b3f9ddbe9246fbdab8d0856cb
+SHA1 (patch-system_file.cc) = dd68b7bd6ec97961e1e367bbbb505ee3e6f0347e
+SHA1 (patch-system_file.h) = f5a759c4716b8ecdb84672de017cb92dbe36e058
+SHA1 (patch-system_system__config.cc) = 28707a1e9f489f655db18595cead0aa908175b53
+SHA1 (patch-window_SDL__rotozoom.cc) = 7f21616ba4889df0b70fa11c57eb378c3a3ac369
+SHA1 (patch-window_button.cc) = 301d30641ee6342803e2d5307118d25b31d165cc
+SHA1 (patch-window_picture.cc) = dacce976d13167f18a5a3186840f6625277c3bfc
+SHA1 (patch-xlovesys.cc) = 88e227d3ad0ca49de6c4a373cda5c31fb9fcc8ce
Index: pkgsrc/games/xclannad/patches/patch-Makefile.in
diff -u /dev/null pkgsrc/games/xclannad/patches/patch-Makefile.in:1.1
--- /dev/null Fri Jan 3 02:35:51 2020
+++ pkgsrc/games/xclannad/patches/patch-Makefile.in Fri Jan 3 02:35:51 2020
@@ -0,0 +1,32 @@
+$NetBSD: patch-Makefile.in,v 1.1 2020/01/03 02:35:51 tsutsui Exp $
+
+- handle ${DESTDIR} properly
+- install nwatowav
+
+--- Makefile.in.orig 2008-01-06 05:17:13.000000000 +0000
++++ Makefile.in
+@@ -1,3 +1,6 @@
++PREFIX=@prefix@
++BINDIR=$(PREFIX)/bin
++
+ @SET_MAKE@
+ CC = @CC@
+ CXX = @CXX@
+@@ -12,14 +15,14 @@ SRCS = xlovesys.cc
+
+ OBJS = ${SRCS:.cc=.o}
+
+-all: xclannad
++all: xclannad music2/nwatowav
+
+ xclannad: xlovesys.o system/libsystem.a scn2k/libscn2k.a window/libwindow.a font/libfont.a music2/libmusic.a
+ $(LD) -o xclannad xlovesys.o system/libsystem.a scn2k/libscn2k.a window/libwindow.a font/libfont.a music2/libmusic.a $(LDFLAGS)
+
+ install: xclannad music2/nwatowav
+- mkdir -p /usr/local/bin
+- cp xclannad music2/nwatowav /usr/local/bin
++ mkdir -p ${DESTDIR}$(BINDIR)
++ cp xclannad music2/nwatowav ${DESTDIR}$(BINDIR)
+
+ clean:
+ rm -f xclannad xlovesys ${OBJS} *.bak
Index: pkgsrc/games/xclannad/patches/patch-font_font__peer__ft2.cc
diff -u /dev/null pkgsrc/games/xclannad/patches/patch-font_font__peer__ft2.cc:1.1
--- /dev/null Fri Jan 3 02:35:51 2020
+++ pkgsrc/games/xclannad/patches/patch-font_font__peer__ft2.cc Fri Jan 3 02:35:51 2020
@@ -0,0 +1,21 @@
+$NetBSD: patch-font_font__peer__ft2.cc,v 1.1 2020/01/03 02:35:51 tsutsui Exp $
+
+Add and fix default font paths.
+
+--- font/font_peer_ft2.cc.orig 2008-08-31 09:54:15.000000000 +0000
++++ font/font_peer_ft2.cc
+@@ -52,12 +52,13 @@ static FontLibrary *library = NULL;
+ static char *default_paths[] = {
+ ".",
+ "/",
+- "/usr/X11R6/lib/X11/fonts/TrueType",
++ "/usr/X11R7/lib/X11/fonts/TTF",
+ "/usr/local/share/fonts/TrueType",
+ "/usr/local/share/fonts/truetype",
+ "/usr/share/fonts/TrueType",
+ "/usr/share/fonts/truetype",
+ "/usr/share/fonts/tt",
++ "/usr/pkg/share/fonts/X11/TTF",
+ NULL
+ };
+
Index: pkgsrc/games/xclannad/patches/patch-font_text__stream.cc
diff -u /dev/null pkgsrc/games/xclannad/patches/patch-font_text__stream.cc:1.1
--- /dev/null Fri Jan 3 02:35:51 2020
+++ pkgsrc/games/xclannad/patches/patch-font_text__stream.cc Fri Jan 3 02:35:51 2020
@@ -0,0 +1,31 @@
+$NetBSD: patch-font_text__stream.cc,v 1.1 2020/01/03 02:35:51 tsutsui Exp $
+
+- don't assume signed char for arm and powerpc
+
+--- font/text_stream.cc.orig 2008-08-31 15:11:10.000000000 +0000
++++ font/text_stream.cc
+@@ -89,10 +89,10 @@ void TextStream::Clear(void) {
+ void TextStream::Add(const char* str) {
+ TextElem elem;
+ for (; *str; str++) {
+- if (*str >= 0x20) {
++ if (*str >= 0x20 && (*str & 0x80) == 0) {
+ elem.type = TextElem::glyph;
+ elem.impl.Glyph.code = *str;
+- } else if (*str < 0 && str[1] != 0) {
++ } else if ((*str & 0x80) != 0 && str[1] != 0) {
+ elem.type = TextElem::glyph;
+ elem.impl.Glyph.code = ((int(*(unsigned char*)str))<<8) | int(*(unsigned char*)(str+1));
+ if (kanji_type == sjis) elem.impl.Glyph.code = codeconv_sjis_to_euc(elem.impl.Glyph.code);
+@@ -222,9 +222,9 @@ void TextStream::Load(const std::string&
+ s++;
+ }
+ } else {
+- if (*s < 0) { // kanji-code
++ if ((*s & 0x80) != 0) { // kanji-code
+ if (s[1] == 0) break;
+- if (s[1] >= 0 && s[1] < 0x40) break; // not EUC nor SJIS
++ if ((s[1] & 0x80) == 0 && s[1] < 0x40) break; // not EUC nor SJIS
+ e.type = TextElem::glyph;
+ e.impl.Glyph.code = codeconv_sjis_to_euc(int(*(unsigned char*)(s))*0x100 + int(*(unsigned char*)(s+1)));
+ s += 2;
Index: pkgsrc/games/xclannad/patches/patch-music2_music.cc
diff -u /dev/null pkgsrc/games/xclannad/patches/patch-music2_music.cc:1.1
--- /dev/null Fri Jan 3 02:35:51 2020
+++ pkgsrc/games/xclannad/patches/patch-music2_music.cc Fri Jan 3 02:35:51 2020
@@ -0,0 +1,15 @@
+$NetBSD: patch-music2_music.cc,v 1.1 2020/01/03 02:35:51 tsutsui Exp $
+
+- avoid duplicated definition
+
+--- music2/music.cc.orig 2008-08-31 14:51:04.000000000 +0000
++++ music2/music.cc
+@@ -43,7 +43,7 @@
+
+ using namespace std;
+
+-#define MUSIC_VOLUME 0.2
++//#define MUSIC_VOLUME 0.2
+ #define MUSIC_VOLUME 1
+
+ int pcm_enable = 0;
Index: pkgsrc/games/xclannad/patches/patch-scn2k_scn2k__cmd.cc
diff -u /dev/null pkgsrc/games/xclannad/patches/patch-scn2k_scn2k__cmd.cc:1.1
--- /dev/null Fri Jan 3 02:35:51 2020
+++ pkgsrc/games/xclannad/patches/patch-scn2k_scn2k__cmd.cc Fri Jan 3 02:35:51 2020
@@ -0,0 +1,78 @@
+$NetBSD: patch-scn2k_scn2k__cmd.cc,v 1.1 2020/01/03 02:35:51 tsutsui Exp $
+
+- don't assume signed char for arm and powerpc
+- fix wrong casts
+
+--- scn2k/scn2k_cmd.cc.orig 2008-08-31 09:52:12.000000000 +0000
++++ scn2k/scn2k_cmd.cc
+@@ -372,8 +372,8 @@ bool Flags::Exec(Cmd& cmd) {
+ string s = cmd.Str(cmd.args[1]);
+ const char* sc = s.c_str();
+ int len = cmd.args[2].value;
+- int i;for (i=0; i<sc[i]!=0 && len != 0; i++, len--) {
+- if (sc[i]<0 && sc[i+1]!=0) i++;
++ int i;for (i=0; i<(signed char)sc[i]!=0 && len != 0; i++, len--) {
++ if ((sc[i] & 0x80) != 0 && sc[i+1]!=0) i++;
+ }
+ s.erase(i); // ��Ѥ� len ʸ��ޤ��ڤ�ͤ��
+ SetStr(arg1, s);
+@@ -434,7 +434,7 @@ bool Flags::Exec(Cmd& cmd) {
+ int i;
+ int offset_top = 0;
+ for (i=0; i<offset && s[offset_top] != 0; i++) {
+- if (s[offset_top] < 0 && s[offset_top+1] != 0) offset_top += 2;
++ if ((s[offset_top] & 0x80) != 0 && s[offset_top+1] != 0) offset_top += 2;
+ else offset_top += 1;
+ }
+ if (s[offset_top] == 0) {
+@@ -445,7 +445,7 @@ bool Flags::Exec(Cmd& cmd) {
+ int slen = cmd.args[3].value;
+ int offset_end = offset_top;
+ for (i=0; i<slen && s[offset_end] != 0; i++) {
+- if (s[offset_end] < 0 && s[offset_end]+1 != 0) offset_end += 2;
++ if ((s[offset_end] & 0x80) != 0 && s[offset_end]+1 != 0) offset_end += 2;
+ else offset_end += 1;
+ }
+ string result(s, offset_top, offset_end-offset_top);
+@@ -456,7 +456,7 @@ bool Flags::Exec(Cmd& cmd) {
+ case 7: {// strlen w/ kanji
+ const char* s = cmd.Str(cmd.args[0]); int i;
+ for (i=0; *s != 0; i++) {
+- if (*s < 0 && s[1] != 0) s += 2;
++ if ((*s & 0x80) != 0 && s[1] != 0) s += 2;
+ else s++;
+ }
+ SetSys(i);
+@@ -682,8 +682,8 @@ int Cmd::GetLeftToken(const char*& d, Va
+ d += 2;
+ var_flag = false;
+ }
+- if (d[0] == 0x24 && ((unsigned const char*)d)[1] == 0xff) {
+- // if ( (d[0] == 0x30 || d[0] == 0x31) && d[1] == 0x24 && ((unsigned const char*)d)[2] == 0xff) /* @@@ not supported; selection ��ǡ�0x30|0x31 ���տ魯�뤳�Ȥ����� */
++ if (d[0] == 0x24 && (unsigned char)d[1] == 0xff) {
++ // if ( (d[0] == 0x30 || d[0] == 0x31) && d[1] == 0x24 && (unsigned const char)d[2] == 0xff) /* @@@ not supported; selection ��ǡ�0x30|0x31 ���տ魯�뤳�Ȥ����� */
+ // numerical atom
+ d += 6;
+ value = read_little_endian_int(d-4);
+@@ -1001,7 +1001,7 @@ dprintf("enum.<");
+ int count = GetArgs(d);
+ args[pt] = VarInfo(count);
+ dprintf(">");
+- } else if (*d == 0x61 && (d[1] >= 0x00 && d[1] <= 0x04) && d[2] == 0x28 ) {
++ } else if (*d == 0x61 && ((d[1] & 0x80) == 0 && d[1] <= 0x04) && d[2] == 0x28 ) {
+ /* �Ȥ��륳�ޥ�ɤ� 01-21:004b, 01-28:0064 �Τ����줫��R,C,PB,LO)
+ ** �����Υ��ޥ�ɤ�
+ ** arg1: ����ե�����̾
+@@ -1714,10 +1714,10 @@ int main(int argc, char** argv) {
+ Cmd cmd(flags, system_version); cmd.ClearError();
+
+ /* end? */
+- if (*dcur == -1) {
++ if ((unsigned char)*dcur == 0xff) {
+ /* 0xff x 32byte + 0x00 : end sign */
+ int i; for (i=0; i<0x20; i++)
+- if (dcur[i] != -1) break;
++ if ((unsigned char)dcur[i] != 0xff) break;
+ if (i == 0x20 && dcur[i] == 0) break;
+ }
+ dprintf("%d : ",dcur-dstart);
Index: pkgsrc/games/xclannad/patches/patch-scn2k_scn2k__grp.cc
diff -u /dev/null pkgsrc/games/xclannad/patches/patch-scn2k_scn2k__grp.cc:1.1
--- /dev/null Fri Jan 3 02:35:51 2020
+++ pkgsrc/games/xclannad/patches/patch-scn2k_scn2k__grp.cc Fri Jan 3 02:35:51 2020
@@ -0,0 +1,53 @@
+$NetBSD: patch-scn2k_scn2k__grp.cc,v 1.1 2020/01/03 02:35:51 tsutsui Exp $
+
+- don't assume signed char for arm and powerpc
+- avoid use of double and use long long instead
+- use string::npos properly
+
+--- scn2k/scn2k_grp.cc.orig 2009-08-22 15:41:41.000000000 +0000
++++ scn2k/scn2k_grp.cc
+@@ -440,7 +440,7 @@ void GrpObj::ZoomRotate(void) {
+ static char* wstrchr(const char* s, unsigned int chr) {
+ int ws, wc;
+ while(*s != 0) {
+- if (*s < 0 && s[1] != 0) {
++ if ((*s & 0x80) != 0 && s[1] != 0) {
+ wc = int((unsigned char)(s[0]))*0x100 + int((unsigned char)(s[1]));
+ ws = 2;
+ } else {
+@@ -501,7 +501,7 @@ TextStream GrpObj::ParseMoji(const char*
+ } else {
+ if (def_size == 0) def_size = 20;
+ if (var <= 0) var = 1;
+- new_size = double(var) / def_size;
++ new_size = (long long)var / def_size;
+ }
+ if (new_size < 2 || new_size > 200) new_size = 16;
+ ts.SetSize(new_size);
+@@ -1820,7 +1820,7 @@ void GrpImpl::Exec(Cmd& cmd) {
+ if (cmd.cmd3 == 0x3e8) { /* �ե�����̾���� */
+ g.gtype = GrpObj::FILE;
+ string name = cmd.Str(cmd.args[1]);
+- if (name.find('?') != -1) {
++ if (name.find('?') != string::npos) {
+ name.erase(name.find('?')); // '?' �ʹߤΰ�̣���狼��ʤ�
+ }
+ g.name = name;
+@@ -1840,7 +1840,7 @@ void GrpImpl::Exec(Cmd& cmd) {
+ if (cmd.argc >= 5)
+ g.SetPos(1, cmd.args[4].value, -cmd.args[5].value);
+
+- if (g.name.find('?') != -1) {
++ if (g.name.find('?') != string::npos) {
+ g.name.erase(g.name.find('?'));
+ g.gan_name = cmd.Str(cmd.args[2]);
+ }
+@@ -1891,7 +1891,7 @@ void GrpImpl::Exec(Cmd& cmd) {
+ // cmd.cmd4 == 3 : args = 6, KANOGI : CG mode
+ GrpObj& g = bs_obj[cmd.args[0].value];
+ string name = cmd.Str(cmd.args[1]);
+- if (name.find('?') != -1) {
++ if (name.find('?') != string::npos) {
+ name.erase(name.find('?')); // '?' �ʹߤΰ�̣���狼��ʤ�
+ }
+ g.gtype = GrpObj::FILE;
Index: pkgsrc/games/xclannad/patches/patch-scn2k_scn2k__text.cc
diff -u /dev/null pkgsrc/games/xclannad/patches/patch-scn2k_scn2k__text.cc:1.1
--- /dev/null Fri Jan 3 02:35:51 2020
+++ pkgsrc/games/xclannad/patches/patch-scn2k_scn2k__text.cc Fri Jan 3 02:35:51 2020
@@ -0,0 +1,52 @@
+$NetBSD: patch-scn2k_scn2k__text.cc,v 1.1 2020/01/03 02:35:51 tsutsui Exp $
+
+- don't assume signed char for arm and powerpc
+- explicitly use NULL to pass NULL pointer via varargs
+
+--- scn2k/scn2k_text.cc.orig 2008-08-31 15:26:43.000000000 +0000
++++ scn2k/scn2k_text.cc
+@@ -789,7 +789,7 @@ void TextImpl::AddText(const char* str_o
+ /* �� = 81 96 A-Z = 0x82 [0x60-0x79] */
+ /* �� = 81 93 A-Z = 0x82 [0x60-0x79] */
+ for (i=0; cnt<10000 && str_o[i] != 0; i++) {
+- if (str_o[i] < 0) {
++ if ((str_o[i] & 0x80) != 0) {
+ if ( (unsigned char)str_o[i] == 0x81 && (unsigned char)str_o[i+1] == 0x96 && (unsigned char)str_o[i+2] == 0x82) {
+ int c = str_o[i+3];
+ if (c >= 0x60 && c <= 0x79 && replace_name[c-0x60].length() != 0) { // ̾��Ѵ�
+@@ -831,7 +831,7 @@ void TextImpl::AddText(const char* str_o
+ text_stream.AddName(name_top);
+ break;
+ }
+- if (*s < 0 && s[1] != 0) s++; // ���ʸ��ʤ飲����Ф�
++ if ((*s & 0x80) != 0 && s[1] != 0) s++; // ���ʸ��ʤ飲����Ф�
+ }
+ str_top = s;
+ }
+@@ -840,7 +840,7 @@ void TextImpl::AddText(const char* str_o
+ text_stream.Add(str_top);
+ text_stream.AddReturn();
+ str_top = s;
+- } else if (*s < 0 && s[1] != 0) s++;
++ } else if ((*s & 0x80) != 0 && s[1] != 0) s++;
+ }
+ text_stream.Add(str_top);
+ return;
+@@ -1874,7 +1874,7 @@ void TextWindow::MakeWaku(PicContainer&
+ }
+ int x, y, w, h;
+ sprintf(key, "#WAKU.%03d.000.%s_BOX", waku_no, btnname[i]);
+- if (config.GetParam(key, 5, 0, &x, &y, &w, &h) == -1) continue;
++ if (config.GetParam(key, 5, NULL, &x, &y, &w, &h) == -1) continue;
+ int sx, sy, sdx, sdy, cnt;
+ const char* d = data + 9 + btnpos[i]*24*8;
+ sx = read_little_endian_int(d);
+@@ -1901,7 +1901,7 @@ TextWindow::TextWindow(PicContainer& par
+ sprintf(key, "#WINDOW.%03d.MOJI_REP", win_no); if (config.GetParam(key, 2, &rep1, &rep2) == -1) return;
+ sprintf(key, "#WINDOW.%03d.MOJI_CNT", win_no); if (config.GetParam(key, 2, &cntw, &cnth) == -1) return;
+ sprintf(key, "#WINDOW.%03d.POS", win_no); if (config.GetParam(key, 3, &posd, &posx, &posy) == -1) return;
+- sprintf(key, "#WINDOW.%03d.MOJI_POS", win_no); if (config.GetParam(key, 4, &mposy, 0, &mposx, 0) == -1) return;
++ sprintf(key, "#WINDOW.%03d.MOJI_POS", win_no); if (config.GetParam(key, 4, &mposy, NULL, &mposx, NULL) == -1) return;
+ sprintf(key, "#WINDOW.%03d.MOJI_MIN", win_no); if (config.GetParam(key, 2, &minx, &miny) == -1) return;
+ sprintf(key, "#WINDOW.%03d.WAKU_SETNO", win_no);if (config.GetParam(key, 1, &waku_no) == -1) return;
+ sprintf(key, "#WINDOW.%03d.LUBY_SIZE", win_no); if (config.GetParam(key, 1, &ruby) == -1) return;
Index: pkgsrc/games/xclannad/patches/patch-system_file.cc
diff -u /dev/null pkgsrc/games/xclannad/patches/patch-system_file.cc:1.1
--- /dev/null Fri Jan 3 02:35:51 2020
+++ pkgsrc/games/xclannad/patches/patch-system_file.cc Fri Jan 3 02:35:51 2020
@@ -0,0 +1,137 @@
+$NetBSD: patch-system_file.cc,v 1.1 2020/01/03 02:35:51 tsutsui Exp $
+
+- avoid unaligned copy for RISC cpus (XXX: handle NetBSD only)
+
+--- system/file.cc.orig 2008-08-31 09:52:12.000000000 +0000
++++ system/file.cc
+@@ -1161,14 +1161,8 @@ public:
+ lsrc += 2;
+ }
+ static void Copy1Pixel(const char*& lsrc, char*& ldest) {
+-#ifdef WORDS_BIGENDIAN
+- ldest[3] = lsrc[0];
+- ldest[2] = lsrc[1];
+- ldest[1] = lsrc[2];
+- ldest[0] = 0;
+-#else
+- *(int*)ldest = read_little_endian_int(lsrc); ldest[3]=0;
+-#endif
++ memcpy(ldest, lsrc, 3);
++ ldest[3] = 0;
+ lsrc += 3; ldest += 4;
+ }
+ static int IsRev(void) { return 0; }
+@@ -1246,13 +1240,7 @@ public:
+ lsrc += 2;
+ }
+ static void Copy1Pixel(const char*& lsrc, char*& ldest) {
+-#ifdef WORDS_BIGENDIAN
+- ldest[0] = lsrc[0];
+- ldest[1] = lsrc[1];
+- ldest[2] = lsrc[2];
+-#else /* LITTLE ENDIAN / intel architecture */
+- *(int*)ldest = *(int*)lsrc;
+-#endif
++ memcpy(ldest, lsrc, 3);
+ lsrc += 3; ldest += 3;
+ }
+ static int IsRev(void) { return 1; }
+@@ -1279,7 +1267,7 @@ bool PDTCONV::Read(char* image) {
+ int i; int len = width*height;
+ src = buf; dest = image;
+ for (i=0; i<len; i++) {
+- *(int*)dest |= int(*(unsigned char*)src) << 24;
++ write_little_endian_int(dest, (int)((unsigned char)src[0]) << 24 | read_little_endian_int(dest));
+ src++;
+ dest += 4;
+ }
+@@ -1328,9 +1316,12 @@ bool PDTCONV::Read_PDT11(char* image) {
+ cur += 4;
+ }
+ src = image + width*height;
+- int* desti = (int*)(image + width*height*4);
+- while(desti != (int*)image)
+- *--desti = color_table[*(unsigned char*)--src];
++ char *desti = (image + width*height*4);
++ while(desti != image) {
++ desti -= sizeof(int);
++ --src;
++ (void)write_little_endian_int(desti, color_table[(int)(unsigned char)src[0]]);
++ }
+ return true;
+ }
+
+@@ -1475,8 +1466,8 @@ bool G00CONV::Read_Type1(char* image) {
+ srcend = uncompress_data + uncompress_size;
+ dest = image; destend = image + width*height*4;
+ while(dest < destend && src < srcend) {
+- *(int*)dest = colortable[*(unsigned char*)src];
+- dest += 4; src ++;
++ write_little_endian_int(dest, colortable[(int)(unsigned char)src[0]]);
++ dest += sizeof(int); src ++;
+ }
+ delete[] uncompress_data;
+ return true;
+@@ -1541,16 +1532,17 @@ bool G00CONV::Read_Type2(char* image) {
+
+ void G00CONV::Copy_32bpp(char* image, int x, int y, const char* src, int bpl, int h) {
+ int i;
+- int* dest = (int*)(image + x*4 + y*4*width);
++ char* dest = (image + x*4 + y*4*width);
+ int w = bpl / 4;
+ for (i=0; i<h; i++) {
+ const char* s = src;
+- int* d = dest;
++ char* d = dest;
+ int j; for (j=0; j<w; j++) {
+- *d++ = read_little_endian_int(s);
++ write_little_endian_int(d, read_little_endian_int(s));
++ d += sizeof(int);
+ s += 4;
+ }
+- src += bpl; dest += width;
++ src += bpl; dest += width * sizeof(int);
+ }
+ }
+
+@@ -1560,10 +1552,10 @@ void GRPCONV::CopyRGBA_rev(char* image,
+ int len = width * height;
+ int i;
+ unsigned char* s = (unsigned char*)buf;
+- int* d = (int*)image;
++ char* d = image;
+ for(i=0; i<len; i++) {
+- *d = (int(s[2])) | (int(s[1])<<8) | (int(s[0])<<16) | (int(s[3])<<24) | mask;
+- d++; s += 4;
++ write_little_endian_int(d, (int(s[2])) | (int(s[1])<<8) | (int(s[0])<<16) | (int(s[3])<<24) | mask);
++ d += 4; s += 4;
+ }
+ return;
+ }
+@@ -1576,9 +1568,10 @@ void GRPCONV::CopyRGBA(char* image, cons
+ /* ���Ѵ���Ԥ� */
+ int len = width * height;
+ int i;
+- int* outbuf = (int*)image;
++ char* outbuf = image;
+ for(i=0; i<len; i++) {
+- *outbuf++ = read_little_endian_int(buf);
++ write_little_endian_int(outbuf, read_little_endian_int(buf));
++ outbuf += 4;
+ buf += 4;
+ }
+ return;
+@@ -1588,10 +1581,10 @@ void GRPCONV::CopyRGB(char* image, const
+ int len = width * height;
+ int i;
+ unsigned char* s = (unsigned char*)buf;
+- int* d = (int*)image;
++ char* d = image;
+ for(i=0; i<len; i++) {
+- *d = (int(s[0])) | (int(s[1])<<8) | (int(s[2])<<16) | 0xff000000;
+- d++; s+=3;
++ write_little_endian_int(d, (int(s[0])) | (int(s[1])<<8) | (int(s[2])<<16) | 0xff000000);
++ d += sizeof(int); s+=3;
+ }
+ return;
+ }
Index: pkgsrc/games/xclannad/patches/patch-system_file.h
diff -u /dev/null pkgsrc/games/xclannad/patches/patch-system_file.h:1.1
--- /dev/null Fri Jan 3 02:35:51 2020
+++ pkgsrc/games/xclannad/patches/patch-system_file.h Fri Jan 3 02:35:51 2020
@@ -0,0 +1,36 @@
+$NetBSD: patch-system_file.h,v 1.1 2020/01/03 02:35:51 tsutsui Exp $
+
+- make stream little endian read/write functions inline
+
+--- system/file.h.orig 2008-01-06 05:17:13.000000000 +0000
++++ system/file.h
+@@ -51,17 +51,17 @@
+
+ #define INT_SIZE 4
+
+-static int read_little_endian_int(const char* buf) {
++static inline int read_little_endian_int(const char* buf) {
+ const unsigned char *p = (const unsigned char *) buf;
+ return (p[3] << 24) | (p[2] << 16) | (p[1] << 8) | p[0];
+ }
+
+-static int read_little_endian_short(const char* buf) {
++static inline int read_little_endian_short(const char* buf) {
+ const unsigned char *p = (const unsigned char *) buf;
+ return (p[1] << 8) | p[0];
+ }
+
+-static int write_little_endian_int(char* buf, int number) {
++static inline int write_little_endian_int(char* buf, int number) {
+ int c = read_little_endian_int(buf);
+ unsigned char *p = (unsigned char *) buf;
+ unsigned int unum = (unsigned int) number;
+@@ -75,7 +75,7 @@ static int write_little_endian_int(char*
+ return c;
+ }
+
+-static int write_little_endian_short(char* buf, int number) {
++static inline int write_little_endian_short(char* buf, int number) {
+ int c = read_little_endian_short(buf);
+ unsigned char *p = (unsigned char *) buf;
+ unsigned int unum = (unsigned int) number;
Index: pkgsrc/games/xclannad/patches/patch-system_system__config.cc
diff -u /dev/null pkgsrc/games/xclannad/patches/patch-system_system__config.cc:1.1
--- /dev/null Fri Jan 3 02:35:51 2020
+++ pkgsrc/games/xclannad/patches/patch-system_system__config.cc Fri Jan 3 02:35:51 2020
@@ -0,0 +1,23 @@
+$NetBSD: patch-system_system__config.cc,v 1.1 2020/01/03 02:35:51 tsutsui Exp $
+
+Fix casts in printfs that cause build error on LP64 machines.
+
+--- system/system_config.cc.orig 2008-08-31 09:52:12.000000000 +0000
++++ system/system_config.cc
+@@ -367,14 +367,14 @@ public:
+ fprintf(f, ") ");
+ }
+ if (old_data) {
+- fprintf(f, "old %08x(%d", (unsigned int)(old_data), old_data[0]);
++ fprintf(f, "old %08lx(%d", (unsigned long)(old_data), old_data[0]);
+ int i;for (i=1; i<item_deal; i++) {
+ fprintf(f, ",%d",old_data[i]);
+ }
+ fprintf(f, ") ");
+ }
+ if (new_data) {
+- fprintf(f, "new %08x(%d", (unsigned int)(new_data), new_data[0]);
++ fprintf(f, "new %08lx(%d", (unsigned long)(new_data), new_data[0]);
+ int i;for (i=1; i<item_deal; i++) {
+ fprintf(f, ",%d",new_data[i]);
+ }
Index: pkgsrc/games/xclannad/patches/patch-window_SDL__rotozoom.cc
diff -u /dev/null pkgsrc/games/xclannad/patches/patch-window_SDL__rotozoom.cc:1.1
--- /dev/null Fri Jan 3 02:35:51 2020
+++ pkgsrc/games/xclannad/patches/patch-window_SDL__rotozoom.cc Fri Jan 3 02:35:51 2020
@@ -0,0 +1,33 @@
+$NetBSD: patch-window_SDL__rotozoom.cc,v 1.1 2020/01/03 02:35:51 tsutsui Exp $
+
+- avoid use of float and use long long instead to avoid overflow
+
+--- window/SDL_rotozoom.cc.orig 2008-01-06 05:17:14.000000000 +0000
++++ window/SDL_rotozoom.cc
+@@ -42,11 +42,11 @@ int zoomSurfaceRGBA(SDL_Surface * src, S
+ /*
+ * smaller to avoid overflow on right and bottom edge.
+ */
+- sx = (int) (65536.0 * (float) (src->w - 1) / (float) dst->w);
+- sy = (int) (65536.0 * (float) (src->h - 1) / (float) dst->h);
++ sx = (int) (65536 * (long long) (src->w - 1) / (long long) dst->w);
++ sy = (int) (65536 * (long long) (src->h - 1) / (long long) dst->h);
+ } else {
+- sx = (int) (65536.0 * (float) src->w / (float) dst->w);
+- sy = (int) (65536.0 * (float) src->h / (float) dst->h);
++ sx = (int) (65536 * (long long) src->w / (long long) dst->w);
++ sy = (int) (65536 * (long long) src->h / (long long) dst->h);
+ }
+
+ /*
+@@ -221,8 +221,8 @@ int zoomSurfaceY(SDL_Surface * src, SDL_
+ /*
+ * Variable setup
+ */
+- sx = (Uint32) (65536.0 * (float) src->w / (float) dst->w);
+- sy = (Uint32) (65536.0 * (float) src->h / (float) dst->h);
++ sx = (Uint32) (65536 * (long long) src->w / (long long) dst->w);
++ sy = (Uint32) (65536 * (long long) src->h / (long long) dst->h);
+
+ /*
+ * Allocate memory for row increments
Index: pkgsrc/games/xclannad/patches/patch-window_button.cc
diff -u /dev/null pkgsrc/games/xclannad/patches/patch-window_button.cc:1.1
--- /dev/null Fri Jan 3 02:35:51 2020
+++ pkgsrc/games/xclannad/patches/patch-window_button.cc Fri Jan 3 02:35:51 2020
@@ -0,0 +1,43 @@
+$NetBSD: patch-window_button.cc,v 1.1 2020/01/03 02:35:51 tsutsui Exp $
+
+- avoid unaligned copy for RISC cpus
+
+--- window/button.cc.orig 2008-08-31 09:52:12.000000000 +0000
++++ window/button.cc
+@@ -471,6 +471,7 @@ void ButtonColor::SetBrightness(int c1,
+ #include"rect.h"
+ #include<stdlib.h>
+ #include<string.h>
++#include"system/file.h"
+
+ static void draw_button(char* rdata, int width, int height, char* bdata, int bwidth, int bheight, const ButtonColor& color) {
+ const int* rs = color.rs;
+@@ -514,8 +515,8 @@ static void draw_button(char* rdata, int
+ ScaleData* d = data + y*width;
+ char* rd = rdata + y*width*4;
+ for (x=0; x<width; x++) {
+- if (d->c == 0) *(int*)rd = 0;
+- else *(int*)rd = (int(d->b / d->c)&0xff)| ((int(d->g / d->c)&0xff)<<8)| ((int(d->r / d->c)&0xff)<<16)| ((int(d->a / d->c)&0xff)<<24);
++ if (d->c == 0) memset(rd, 0, sizeof(int));
++ else write_little_endian_int(rd, (int(d->b / d->c)&0xff)| ((int(d->g / d->c)&0xff)<<8)| ((int(d->r / d->c)&0xff)<<16)| ((int(d->a / d->c)&0xff)<<24));
+ rd += 4;
+ d++;
+ }
+@@ -556,7 +557,7 @@ static void drawbox(char* buf, const Rec
+ for (i=0; i<h; i++) {
+ char* c = buf;
+ for (j=0; j<w; j++) {
+- *(int*)c = col;
++ write_little_endian_int(c, col);
+ c += 4;
+ }
+ buf += width*4;
+@@ -684,7 +685,7 @@ int main(void) {
+ if(f==0)return 0;
+ create_png(f,w,h*3,c);
+ for (i=0;i<w*h;i++) {
+- printf("%08x,",*(int*)(c+i*4));
++ printf("%08x,",read_little_endian_int(c+i*4));
+ if ( (i&7)==7) printf("\n");
+ }
+ return 0;
Index: pkgsrc/games/xclannad/patches/patch-window_picture.cc
diff -u /dev/null pkgsrc/games/xclannad/patches/patch-window_picture.cc:1.1
--- /dev/null Fri Jan 3 02:35:51 2020
+++ pkgsrc/games/xclannad/patches/patch-window_picture.cc Fri Jan 3 02:35:51 2020
@@ -0,0 +1,29 @@
+$NetBSD: patch-window_picture.cc,v 1.1 2020/01/03 02:35:51 tsutsui Exp $
+
+- avoid unaligned copy for RISC cpus
+
+--- window/picture.cc.orig 2008-01-06 05:17:14.000000000 +0000
++++ window/picture.cc
+@@ -370,7 +370,7 @@ err_ret:
+ char* s = (char*)((SDL_Surface*)surface_own)->pixels + ((SDL_Surface*)surface_own)->pitch*i;
+ int bpp = ((SDL_Surface*)surface_own)->format->BytesPerPixel;
+ for (j=0; j<w; j++) {
+- if ( ((*(int*)s) & 0xffffff) == 0) *a = 0;
++ if ( (read_little_endian_int(s) & 0xffffff) == 0) *a = 0;
+ else if (*a == 0) *a = 0xff;
+ s += bpp; a++;
+ }
+@@ -730,10 +730,10 @@ inline Surface* FileToSurface::LoadSurfa
+ MaskType is_mask = conv->IsMask() ? ALPHA_MASK : NO_MASK;
+ if (is_mask == ALPHA_MASK) { // alpha �����٤� 0xff �ʤ�ޥ���̵���Ȥ���
+ int len = conv->Width()*conv->Height();
+- unsigned int* d = (unsigned int*)mem;
++ char* d = mem;
+ int i; for (i=0; i<len; i++) {
+- if ( (*d&0xff000000) != 0xff000000) break;
+- d++;
++ if ( (read_little_endian_int(d)&0xff000000) != 0xff000000) break;
++ d += 4;
+ }
+ if (i == len) {
+ is_mask = NO_MASK;
Index: pkgsrc/games/xclannad/patches/patch-xlovesys.cc
diff -u /dev/null pkgsrc/games/xclannad/patches/patch-xlovesys.cc:1.1
--- /dev/null Fri Jan 3 02:35:51 2020
+++ pkgsrc/games/xclannad/patches/patch-xlovesys.cc Fri Jan 3 02:35:51 2020
@@ -0,0 +1,15 @@
+$NetBSD: patch-xlovesys.cc,v 1.1 2020/01/03 02:35:51 tsutsui Exp $
+
+Use VL-PGothic instead of msgothic.ttc for the default TTF.
+
+--- xlovesys.cc.orig 2008-01-06 05:17:14.000000000 +0000
++++ xlovesys.cc
+@@ -61,7 +61,7 @@ int main(int argc, char *argv[]) {
+ AyuSysConfig config;
+ int opt = 0, end = 0, screenmode = 0;
+ char rootPath[1024] = "/mnt/KEY/CLANNAD";
+- char font[1024] = "msgothic.ttc";
++ char font[1024] = "VL-PGothic-Regular.ttf";
+ Uint32 videoOptions = SDL_HWSURFACE;
+
+ while(1) {
Home |
Main Index |
Thread Index |
Old Index