Browse Source

Minor change in licensing information & bug fix in makemessage.py

louyihua 8 years ago
parent
commit
77bf04e2cc
20 changed files with 162 additions and 117 deletions
  1. 1 1
      AUTHORS.txt
  2. 18 4
      adplug/dbemuopl.cpp
  3. 21 21
      adplug/dbemuopl.h
  4. 2 0
      adplug/dbopl.cpp
  5. 2 0
      adplug/dbopl.h
  6. 21 7
      adplug/demuopl.cpp
  7. 5 3
      codepage.h
  8. 3 4
      common.h
  9. 3 1
      fontglyph.h
  10. 2 0
      global.c
  11. 2 2
      makemessage.py
  12. 4 1
      mp3play.c
  13. 4 1
      oggplay.c
  14. 1 0
      players.h
  15. 3 0
      rixplay.cpp
  16. 17 17
      script.c
  17. 51 51
      text.c
  18. 1 1
      uigame.c
  19. 1 1
      uigame.h
  20. 0 2
      yj1.c

+ 1 - 1
AUTHORS.txt

@@ -2,7 +2,7 @@ ADDITIONAL AUTHORS
 ------------------
 palxex <palxex.ys168.com>
 louyihua <louyihua@21cn.com>
-Öлª´óÊ¥
+PalMusicFan
 
 
 SPECIAL THANKS

+ 18 - 4
adplug/dbemuopl.cpp

@@ -1,9 +1,23 @@
+/* -*- mode: c; tab-width: 4; c-basic-offset: 4; c-file-style: "linux" -*- */
 //
-//  dbemuopl.cpp
-//  SDLPal
+// Copyright (c) 2009, Wei Mingzhi <whistler_wmz@users.sf.net>.
+// All rights reserved.
+// Created by Lou Yihua <louyihua@21cn.com>, 2015-08-03.
 //
-//  Created by louyihua on 15-08-03.
-//  Copyright (c) 2014 Wei Mingzhi. All rights reserved.
+// This file is part of SDLPAL.
+//
+// SDLPAL is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program.  If not, see <http://www.gnu.org/licenses/>.
 //
 
 #include "dbemuopl.h"

+ 21 - 21
adplug/dbemuopl.h

@@ -1,24 +1,24 @@
-/*
-* Adplug - Replayer for many OPL2/OPL3 audio file formats.
-* Copyright (C) 1999 - 2005 Simon Peter, <dn.tlp@gmx.net>, et al.
-*
-* This library is free software; you can redistribute it and/or
-* modify it under the terms of the GNU Lesser General Public
-* License as published by the Free Software Foundation; either
-* version 2.1 of the License, or (at your option) any later version.
-*
-* This library is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this library; if not, write to the Free Software
-* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-*
-* demuopl.h - Emulated OPL using DOSBOX's emulator, by Wei Mingzhi
-*             <whistler_wmz@users.sf.net>.
-*/
+/* -*- mode: c; tab-width: 4; c-basic-offset: 4; c-file-style: "linux" -*- */
+//
+// Copyright (c) 2009, Wei Mingzhi <whistler_wmz@users.sf.net>.
+// All rights reserved.
+// Created by Lou Yihua <louyihua@21cn.com>, 2015-08-03.
+//
+// This file is part of SDLPAL.
+//
+// SDLPAL is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program.  If not, see <http://www.gnu.org/licenses/>.
+//
 
 #ifndef H_ADPLUG_DBEMUOPL
 #define H_ADPLUG_DBEMUOPL

+ 2 - 0
adplug/dbopl.cpp

@@ -14,6 +14,8 @@
  *  You should have received a copy of the GNU General Public License
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ *  dbopl.cpp - Ported to SDLPAL by Lou Yihua <louyihua@21cn.com>, 2015-08-03.
  */
 
 /*

+ 2 - 0
adplug/dbopl.h

@@ -14,6 +14,8 @@
  *  You should have received a copy of the GNU General Public License
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ *  dbopl.h - Ported to SDLPAL by Lou Yihua <louyihua@21cn.com>, 2015-08-03.
  */
 
 //#include "adlib.h"

+ 21 - 7
adplug/demuopl.cpp

@@ -1,10 +1,24 @@
-//
-//  demuopl.cpp
-//  SDLPal
-//
-//  Created by palxex on 14-7-20.
-//  Copyright (c) 2014 Wei Mingzhi. All rights reserved.
-//
+/*
+* Adplug - Replayer for many OPL2/OPL3 audio file formats.
+* Copyright (C) 1999 - 2005 Simon Peter, <dn.tlp@gmx.net>, et al.
+*
+* This library is free software; you can redistribute it and/or
+* modify it under the terms of the GNU Lesser General Public
+* License as published by the Free Software Foundation; either
+* version 2.1 of the License, or (at your option) any later version.
+*
+* This library is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this library; if not, write to the Free Software
+* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+*
+* demuopl.cpp - Emulated OPL using DOSBOX's emulator, by Pal Lockheart
+*               <palxex@gmail.com> on 2014-07-20.
+*/
 
 #include "demuopl.h"
 #include <string.h>

+ 5 - 3
codepage.h

@@ -1,6 +1,8 @@
+/* -*- mode: c; tab-width: 4; c-basic-offset: 4; c-file-style: "linux" -*- */
 //
-// Copyright (c) 2015, Lou Yihua <louyihua@21cn.com>.
+// Copyright (c) 2009, Wei Mingzhi <whistler_wmz@users.sf.net>.
 // All rights reserved.
+// Created by Lou Yihua <louyihua@21cn.com>, 2015-06-03.
 //
 // This file is part of SDLPAL.
 //
@@ -3313,7 +3315,7 @@ static WCHAR cptbl_big5[126][160] = {
     0xE302,0xE303,0xE304,0xE305,0xE306,0xE307,0xE308,0xE309,0xE30A,0xE30B,0xE30C,0xE30D,0xE30E,0xE30F,0xE310,0x003F,
   },
 };
-
+/*
 static WCHAR cptbl_jis[60][192] = {
   {
     0x3000,0x3001,0x3002,0xFF0C,0xFF0E,0x30FB,0xFF1A,0xFF1B,0xFF1F,0xFF01,0x309B,0x309C,0x00B4,0xFF40,0x00A8,0xFF3E,
@@ -4167,7 +4169,7 @@ static WCHAR cptbl_jis_half[64] = {
 	0xFF90, 0xFF91, 0xFF92, 0xFF93, 0xFF94, 0xFF95, 0xFF96, 0xFF97,
 	0xFF98, 0xFF99, 0xFF9A, 0xFF9B, 0xFF9C, 0xFF9D, 0xFF9E, 0xFF9F,
 };
-
+*/
 #ifdef __cplusplus
 }
 #endif

+ 3 - 4
common.h

@@ -1,6 +1,7 @@
 //
 // Copyright (c) 2009, Wei Mingzhi <whistler_wmz@users.sf.net>.
 // All rights reserved.
+// Modified by Lou Yihua <louyihua@21cn.com> with unicode support, 2015.
 //
 // This file is part of SDLPAL.
 //
@@ -17,8 +18,6 @@
 // You should have received a copy of the GNU General Public License
 // along with this program.  If not, see <http://www.gnu.org/licenses/>.
 //
-// Modified by Lou Yihua <louyihua@21cn.com> with Unicode support, 2015
-//
 
 #ifndef _COMMON_H
 #define _COMMON_H
@@ -404,8 +403,8 @@ typedef enum tagCODEPAGE {
 	CP_MIN = 0,
 	CP_BIG5 = 0,
 	CP_GBK = 1,
-	CP_SHIFTJIS = 2,
-	CP_MAX = 3,
+	//CP_SHIFTJIS = 2,
+	CP_MAX = CP_GBK + 1,
 	CP_UTF_8 = CP_MAX + 1
 } CODEPAGE;
 

+ 3 - 1
fontglyph.h

@@ -1,6 +1,8 @@
+/* -*- mode: c++; tab-width: 4; c-basic-offset: 4; c-file-style: "linux" -*- */
 //
-// Copyright (c) 2015, Lou Yihua <louyihua@21cn.com>.
+// Copyright (c) 2009, Wei Mingzhi <whistler_wmz@users.sf.net>.
 // All rights reserved.
+// Created by Lou Yihua <louyihua@21cn.com>, 2015-06-07.
 //
 // This file is part of SDLPAL.
 //

+ 2 - 0
global.c

@@ -123,6 +123,8 @@ PAL_InitGlobals(
 				   if (SDL_strcasecmp(p, "CODEPAGE") == 0)
 				   {
 					   sscanf(ptr, "%d", &iCodePage);
+					   if (iCodePage < 0) iCodePage = 0;
+					   if (iCodePage >= CP_MAX) iCodePage = CP_MAX - 1;
 				   }
 				   else if (SDL_strcasecmp(p, "EXTRAMAGICDESCLINES") == 0)
 				   {

+ 2 - 2
makemessage.py

@@ -93,7 +93,7 @@ def main():
         if options.comment: output += "# Original word: %d=%s\n" % (i, temp)
         output += "%d=%s\n" % (i, temp)
     output += "# This is the only addtional word for ATB in SDLPAL. It is not used in classical mode.\n"
-    output += "65530=Battle Speed"
+    output += "65530=Battle Speed\n"
     output += "[END WORDS]\n\n"
 
     output += "# The following sections contain dialog/description texts used by the game.\n\n"
@@ -107,7 +107,7 @@ def main():
             if is_msg_group == 0:
                 is_msg_group = 1
                 message = "%s %d\n" % ('[BEGIN MESSAGE]', w1)
-                if options.comment: comment = "# Original message:\n"
+                if options.comment: comment = "# Original message: %d\n" % w1
 
             last_index = w1
             msg_count += 1

+ 4 - 1
mp3play.c

@@ -1,7 +1,10 @@
 /* -*- mode: c++; tab-width: 4; c-basic-offset: 4; c-file-style: "linux" -*- */
 //
-// Copyright (c) 2015, Lou Yihua <louyihua@21cn.com>.
+// Copyright (c) 2009, Wei Mingzhi <whistler_wmz@users.sf.net>.
 // All rights reserved.
+// Modified by Lou Yihua <louyihua@21cn.com>, 2015.
+//
+// This file is part of SDLPAL.
 //
 // This program is free software: you can redistribute it and/or modify
 // it under the terms of the GNU General Public License as published by

+ 4 - 1
oggplay.c

@@ -1,7 +1,10 @@
 /* -*- mode: c++; tab-width: 4; c-basic-offset: 4; c-file-style: "linux" -*- */
 //
-// Copyright (c) 2015, Lou Yihua <louyihua@21cn.com>.
+// Copyright (c) 2009, Wei Mingzhi <whistler_wmz@users.sf.net>.
 // All rights reserved.
+// Created by Lou Yihua <louyihua@21cn.com>, 2015-07-28.
+//
+// This file is part of SDLPAL.
 //
 // This program is free software: you can redistribute it and/or modify
 // it under the terms of the GNU General Public License as published by

+ 1 - 0
players.h

@@ -2,6 +2,7 @@
 //
 // Copyright (c) 2009, Wei Mingzhi <whistler_wmz@users.sf.net>.
 // All rights reserved.
+// Created by Lou Yihua <louyihua@21cn.com>, 2015-07-28.
 //
 // This file is part of SDLPAL.
 //

+ 3 - 0
rixplay.cpp

@@ -2,6 +2,9 @@
 //
 // Copyright (c) 2008, Wei Mingzhi <whistler_wmz@users.sf.net>.
 // All rights reserved.
+// Modified by Lou Yihua <louyihua@21cn.com>, 2015.
+//
+// This file is part of SDLPAL.
 //
 // This program is free software: you can redistribute it and/or modify
 // it under the terms of the GNU General Public License as published by

+ 17 - 17
script.c

@@ -509,30 +509,30 @@ PAL_AdditionalCredits(
 --*/
 {
    LPCWSTR rgszcps[][CP_MAX] = {
-	   // Traditional Chinese, Simplified Chinese, Japanese
-	   { L"", L"", L"" },
-	   { L"          \x7D93\x5178\x7279\x5225\x7BC7  ",
-	     L"          \x7ECF\x5178\x7279\x522B\x7BC7  ",
-	     L"   \x30AF\x30E9\x30B7\x30C3\x30AF\x7279\x5225\x7DE8  "
+	   // Traditional Chinese, Simplified Chinese
+	   { L"", L"", /*L""*/ },
+	   { L"         \x7D93\x5178\x7279\x5225\x7BC7   ",
+	     L"         \x7ECF\x5178\x7279\x522B\x7BC7   ",
+	     //L"   \x30AF\x30E9\x30B7\x30C3\x30AF\x7279\x5225\x7DE8  "
 	   },
-	   { L"", L"", L"" },
-	   { L"", L"", L"" },
-	   { L"", L"", L"" },
-	   { L"", L"", L"" },
-	   { L"", L"", L"" },
-	   { L"", L"", L"" },
+	   { L"", L"", /*L""*/ },
+	   { L"", L"", /*L""*/ },
+	   { L"", L"", /*L""*/ },
+	   { L"", L"", /*L""*/ },
+	   { L"", L"", /*L""*/ },
+	   { L"", L"", /*L""*/ },
 	   { L"   \x672C\x7A0B\x5F0F\x662F\x81EA\x7531\x8EDF\x9AD4\xFF0C\x6309\x7167 GNU General",
 	     L"   \x672C\x7A0B\x5E8F\x662F\x81EA\x7531\x8F6F\x4EF6\xFF0C\x6309\x7167 GNU General",
-		 L" \x3053\x306E\x30D7\x30ED\x30B0\x30E9\x30E0\x306F\x81EA\x7531\x30BD\x30D5\x30C8\x30A6\x30A7\x30A2\x3067\x3059\x3001"
+		 //L" \x3053\x306E\x30D7\x30ED\x30B0\x30E9\x30E0\x306F\x81EA\x7531\x30BD\x30D5\x30C8\x30A6\x30A7\x30A2\x3067\x3059\x3001"
 	   },
-	   { L"   Public License v3 \x767C\x4F48",
-	     L"   Public License v3 \x53D1\x5E03",
-	     L" GNU General Public License v3 \x306E\x4E0B\x3067"
+	   { L"   Public License v3 \x6216\x66F4\x9AD8\x7248\x672C\x767C\x4F48",
+	     L"   Public License v3 \x6216\x66F4\x9AD8\x7248\x672C\x53D1\x5E03",
+	     //L" GNU General Public License v3 \x306E\x4E0B\x3067"
 	   },
-	   { L"", L"", L" \x914D\x5E03\x3055\x308C\x3066\x3044\x307E\x3059\x3002" },
+	   { L"", L"", /*L" \x914D\x5E03\x3055\x308C\x3066\x3044\x307E\x3059\x3002"*/ },
 	   { L"                    ...\x6309 Enter \x7D50\x675F",
 	     L"                    ...\x6309 Enter \x7ED3\x675F",
-	     L"      ...Enter\x30AD\x30FC\x3092\x62BC\x3057\x3066\x7D42\x4E86\x3057\x307E\x3059"
+	     //L"      ...Enter\x30AD\x30FC\x3092\x62BC\x3057\x3066\x7D42\x4E86\x3057\x307E\x3059"
 	   },
    };
 

+ 51 - 51
text.c

@@ -43,9 +43,9 @@ BOOL      g_fUpdatedInBattle      = FALSE;
 static LPWSTR gc_rgszAdditionalWords[CP_MAX][PAL_ADDITIONAL_WORD_COUNT] = {
    { L"\x6230\x9B25\x901F\x5EA6", L"\x4E00", L"\x4E8C", L"\x4E09", L"\x56DB", L"\x4E94" },
    { L"\x6218\x6597\x901F\x5EA6", L"\x4E00", L"\x4E8C", L"\x4E09", L"\x56DB", L"\x4E94" },
-   { L"\x6226\x95D8\x901F\x5EA6", L"\x4E00", L"\x4E8C", L"\x4E09", L"\x56DB", L"\x4E94" },
+   //{ L"\x6226\x95D8\x901F\x5EA6", L"\x4E00", L"\x4E8C", L"\x4E09", L"\x56DB", L"\x4E94" },
 };
-static LPWSTR gc_rgszDefaultAdditionalWords[PAL_ADDITIONAL_WORD_COUNT] = { NULL, L"1", "2", "3", L"4", L"5" };
+static LPWSTR gc_rgszDefaultAdditionalWords[PAL_ADDITIONAL_WORD_COUNT] = { NULL, L"1", L"2", L"3", L"4", L"5" };
 #endif
 
 LPWSTR g_rcCredits[12];
@@ -1500,23 +1500,23 @@ PAL_MultiByteToWideCharCP(
 	{
 		switch (cp)
 		{
-		case CP_SHIFTJIS:
-			for (i = 0; i < mbslength && mbs[i]; i++)
-			{
-				if (state == 0)
-				{
-					if ((BYTE)mbs[i] <= 0x80 || (BYTE)mbs[i] >= 0xfd || ((BYTE)mbs[i] >= 0xa0 && (BYTE)mbs[i] <= 0xdf))
-						wlen++;
-					else
-						state = 1;
-				}
-				else
-				{
-					wlen++;
-					state = 0;
-				}
-			}
-			break;
+		//case CP_SHIFTJIS:
+		//	for (i = 0; i < mbslength && mbs[i]; i++)
+		//	{
+		//		if (state == 0)
+		//		{
+		//			if ((BYTE)mbs[i] <= 0x80 || (BYTE)mbs[i] >= 0xfd || ((BYTE)mbs[i] >= 0xa0 && (BYTE)mbs[i] <= 0xdf))
+		//				wlen++;
+		//			else
+		//				state = 1;
+		//		}
+		//		else
+		//		{
+		//			wlen++;
+		//			state = 0;
+		//		}
+		//	}
+		//	break;
 		case CP_GBK:
 		case CP_BIG5:
 			for (i = 0; i < mbslength && mbs[i]; i++)
@@ -1577,37 +1577,37 @@ PAL_MultiByteToWideCharCP(
 		WCHAR invalid_char;
 		switch (cp)
 		{
-		case CP_SHIFTJIS:
-			invalid_char = 0x30fb;
-			for (i = 0; i < mbslength && wlen < wcslength && mbs[i]; i++)
-			{
-				if (state == 0)
-				{
-					if ((BYTE)mbs[i] <= 0x80)
-						wcs[wlen++] = mbs[i];
-					else if ((BYTE)mbs[i] >= 0xa0 && (BYTE)mbs[i] <= 0xdf)
-						wcs[wlen++] = cptbl_jis_half[(BYTE)mbs[i] - 0xa0];
-					else if ((BYTE)mbs[i] == 0xfd)
-						wcs[wlen++] = 0xf8f1;
-					else if ((BYTE)mbs[i] == 0xfe)
-						wcs[wlen++] = 0xf8f2;
-					else if ((BYTE)mbs[i] == 0xff)
-						wcs[wlen++] = 0xf8f3;
-					else
-						state = 1;
-				}
-				else
-				{
-					if ((BYTE)mbs[i] < 0x40)
-						wcs[wlen++] = 0x30fb;
-					else if ((BYTE)mbs[i - 1] < 0xa0)
-						wcs[wlen++] = cptbl_jis[(BYTE)mbs[i - 1] - 0x81][(BYTE)mbs[i] - 0x40];
-					else
-						wcs[wlen++] = cptbl_jis[(BYTE)mbs[i - 1] - 0xc1][(BYTE)mbs[i] - 0x40];
-					state = 0;
-				}
-			}
-			break;
+		//case CP_SHIFTJIS:
+		//	invalid_char = 0x30fb;
+		//	for (i = 0; i < mbslength && wlen < wcslength && mbs[i]; i++)
+		//	{
+		//		if (state == 0)
+		//		{
+		//			if ((BYTE)mbs[i] <= 0x80)
+		//				wcs[wlen++] = mbs[i];
+		//			else if ((BYTE)mbs[i] >= 0xa0 && (BYTE)mbs[i] <= 0xdf)
+		//				wcs[wlen++] = cptbl_jis_half[(BYTE)mbs[i] - 0xa0];
+		//			else if ((BYTE)mbs[i] == 0xfd)
+		//				wcs[wlen++] = 0xf8f1;
+		//			else if ((BYTE)mbs[i] == 0xfe)
+		//				wcs[wlen++] = 0xf8f2;
+		//			else if ((BYTE)mbs[i] == 0xff)
+		//				wcs[wlen++] = 0xf8f3;
+		//			else
+		//				state = 1;
+		//		}
+		//		else
+		//		{
+		//			if ((BYTE)mbs[i] < 0x40)
+		//				wcs[wlen++] = 0x30fb;
+		//			else if ((BYTE)mbs[i - 1] < 0xa0)
+		//				wcs[wlen++] = cptbl_jis[(BYTE)mbs[i - 1] - 0x81][(BYTE)mbs[i] - 0x40];
+		//			else
+		//				wcs[wlen++] = cptbl_jis[(BYTE)mbs[i - 1] - 0xc1][(BYTE)mbs[i] - 0x40];
+		//			state = 0;
+		//		}
+		//	}
+		//	break;
 		case CP_GBK:
 			invalid_char = 0x3f;
 			for (i = 0; i < mbslength && wlen < wcslength && mbs[i]; i++)
@@ -1755,7 +1755,7 @@ PAL_GetInvalidChar(
    {
    case CP_BIG5:     return 0x3f;
    case CP_GBK:      return 0x3f;
-   case CP_SHIFTJIS: return 0x30fb;
+   //case CP_SHIFTJIS: return 0x30fb;
    case CP_UTF_8:    return 0x3f;
    default:          return 0;
    }

+ 1 - 1
uigame.c

@@ -18,7 +18,7 @@
 // You should have received a copy of the GNU General Public License
 // along with this program.  If not, see <http://www.gnu.org/licenses/>.
 //
-// Modified by Lou Yihua <louyihua@21cn.com> with Japanese support, 2015
+// Modified by Lou Yihua <louyihua@21cn.com> with unicode support, 2015
 //
 
 #include "main.h"

+ 1 - 1
uigame.h

@@ -18,7 +18,7 @@
 // You should have received a copy of the GNU General Public License
 // along with this program.  If not, see <http://www.gnu.org/licenses/>.
 //
-// Modified by Lou Yihua <louyihua@21cn.com> with Japanese support, 2015
+// Modified by Lou Yihua <louyihua@21cn.com> with unicode support, 2015
 //
 
 #ifndef UIGAME_H

+ 0 - 2
yj1.c

@@ -25,8 +25,6 @@
 // Ported to C from C++ and modified for compatibility with Big-Endian
 // by Wei Mingzhi <whistler@openoffice.org>.
 
-// TODO: fix YJ_2 for big-endian
-
 #include "common.h"
 
 typedef struct _YJ1_TreeNode