commit 47aee91ef478ff11ae388f0b958be23a98bc6d31 Author: Daveo Date: Tue Aug 29 16:26:01 2000 +0000 diff --git a/Utils/MkData/MkData.cpp b/Utils/MkData/MkData.cpp new file mode 100644 index 000000000..f88d26d19 --- /dev/null +++ b/Utils/MkData/MkData.cpp @@ -0,0 +1,591 @@ +/************************/ +/*** DataFile Creator ***/ +/************************/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "Mkdata.h" + +using namespace std; + + +//*********************************************************************** +//*********************************************************************** +//*********************************************************************** +int DebugFlag=0; +int AlignSize=2048; +char *AlignBuffer; + +//*********************************************************************** +CBank Banks; +CFileList Files; +char *BaseDir=0; + +//*********************************************************************** + +static void app_debug_msg(const char * pszFmt,va_list args) +{ + char szBuf[256]; + vsprintf(szBuf,pszFmt,args); + + printf("%s\n",szBuf); +} + + +//****************************************************************** +//****************************************************************** + +void __cdecl DEBUG(const char * pszFmt,...) +{ + if (DebugFlag) + if (pszFmt) + { + va_list args; + va_start(args,pszFmt); + app_debug_msg(pszFmt,args); + va_end(args); + } +} + +void __cdecl FATAL(const char * pszFmt,...) +{ + if (pszFmt) + { + va_list args; + va_start(args,pszFmt); + app_debug_msg(pszFmt,args); + va_end(args); + } + exit(123); +} + +//****************************************************************** +char *LoadFileInMem(const char * FileName,int *OutSize) +{ +FILE *FileHandle; +char *Buffer; +int Size; + + FileHandle= fopen( FileName,"rb" ); + if(!FileHandle) + { + FATAL("ERROR : Could not open file %s\n",FileName); + } + else + { + fseek(FileHandle,0,SEEK_END); + Size=ftell(FileHandle); + fseek(FileHandle,0,SEEK_SET); + + if( (Buffer=(char*)malloc(Size))==NULL ) {printf("Out of memory.\n");exit(123);} + fread(Buffer, 1,Size,FileHandle); + fclose(FileHandle); + } + if (OutSize) *OutSize=Size; + return Buffer; +} + + +//****************************************************************** +static char s_illegalChars[] = "\\/!£$%^&*()+-=-:. "; +static int s_nbChars = sizeof(s_illegalChars); + +void convertIllegalChar( char *c ) +{ + for (int i=0;i=EndPtr) return; + switch (*Ptr) + { + case CHAR_COMMENT: + Ptr=ScriptComment(Ptr,EndPtr); + break; + case CHAR_STARTBANK: + Ptr=ScriptStartBank(Ptr,EndPtr); + break; + case CHAR_ENDBANK: + Ptr=ScriptEndBank(Ptr,EndPtr); + break; + default: + Ptr=ScriptFile(Ptr,EndPtr); + break; + } + } + free(Script); +} + +//*********************************************************************** +//*********************************************************************** +//*********************************************************************** +void ResetFAT(std::vector &FAT) +{ +int FATSize=Files.GetCount(); +int Loop; + + FAT.resize(FATSize); + for (Loop=0; Loop &FAT,int Align) +{ +int Pos=ftell(FileHandle); +int FATSize=Files.GetCount(); + + for (int Loop=0;Loop FAT; +sBank &ThisBank=Banks.GetBank(BankIdx); +int ThisListSize=ThisBank.FileList.size(); +int Loop; +long StartFilePos,EndFilePos; + +// reset FAT and write dummy FAT + ResetFAT(FAT); + ParentFAT.FilePos=WriteFAT(FileHandle,FAT,ThisBank.Align); + StartFilePos=ftell(FileHandle);; + +// Write files + + for (Loop=0; Loop FAT; +int FATSize=Files.GetCount(),Idx; + + FileHandle= fopen( Filename,"wb" ); + if(!FileHandle) FATAL( "Could not write %s", Filename); + ResetFAT(FAT); + WriteFAT(FileHandle,FAT,AlignSize); + for (Idx=0; Idx Scripts; +// Parse Input + for (int Loop=1;Loop +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=MkData - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "MkData.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "MkData.mak" CFG="MkData - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "MkData - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "MkData - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName ""$/PRLSR/utils/MkData", BLVAAAAA" +# PROP Scc_LocalPath "." +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "MkData - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD BASE RSC /l 0x809 /d "NDEBUG" +# ADD RSC /l 0x809 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /out:"../../tools/MkData.exe" + +!ELSEIF "$(CFG)" == "MkData - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c +# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c +# ADD BASE RSC /l 0x809 /d "_DEBUG" +# ADD RSC /l 0x809 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept + +!ENDIF + +# Begin Target + +# Name "MkData - Win32 Release" +# Name "MkData - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=.\MkData.cpp +# End Source File +# Begin Source File + +SOURCE=.\MkData.h +# End Source File +# End Group +# End Target +# End Project diff --git a/Utils/MkData/MkData.h b/Utils/MkData/MkData.h new file mode 100644 index 000000000..a73812831 --- /dev/null +++ b/Utils/MkData/MkData.h @@ -0,0 +1,86 @@ +/************************/ +/*** DataFile Creator ***/ +/************************/ + +//*********************************************************************** +//*********************************************************************** +//*********************************************************************** +#define CHAR_COMMENT '#' +#define CHAR_TAB 0x09 +#define CHAR_EOL 0x0d +#define CHAR_SKIP '-' +#define CHAR_STARTBANK '{' +#define CHAR_ENDBANK '}' + +//*********************************************************************** +//*********************************************************************** +//*********************************************************************** +typedef signed char s8; +typedef signed short s16; +typedef signed long s32; + +//*********************************************************************** +//*********************************************************************** +//*********************************************************************** +struct sFAT +{ + s32 FilePos; + s32 FileSize; +}; + +struct sBankEntry +{ + int ListIdx; + int Pos; +}; + +struct sBank +{ + char Name[256]; + int Align; + std::vector FileList; +}; + +struct sFile +{ + char Filename[256]; + char ShortName[256]; + int Size; + char *Data; + int BankIdx; +}; + +//*********************************************************************** +class CFileList +{ +public: + CFileList(){}; + ~CFileList(); + int FindFileIdx(char *Filename); + int AddFile(char *Filename,int BankIdx=0); + int GetCount() {return(FileList.size());} + sFile &GetFile(int Idx) {return(FileList[Idx]);} + +private: + + std::vector FileList; +}; + +//*********************************************************************** +class CBank +{ +public: + void Start(char *Name,int Align=0); + void End(); + int FindEntry(int Idx); + void Add(char *Filename); + int GetCount() {return(BankList.size());} + sBank &GetBank(int Idx) {return(BankList[Idx]);} + int GetCurrentBankNo() {return(CurrentBank);} + +private: + int CurrentBank; + std::vector BankList; +}; + +//*********************************************************************** diff --git a/Utils/MkSpeech/MkSpeech.cpp b/Utils/MkSpeech/MkSpeech.cpp new file mode 100644 index 000000000..5ae30b845 --- /dev/null +++ b/Utils/MkSpeech/MkSpeech.cpp @@ -0,0 +1,413 @@ +/***********************/ +/*** Speech Compiler ***/ +/***********************/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +using namespace std; + +//************************************************ +#define CHUNKSIZE 2336 // XA track size + +#define SPACE ' ' +#define MINUS '-' +#define COMMENT '#' +#define TAB 0x09 +#define EOL 0x0d +#define InFileEXT "Ixa" +#define OutFileEXT "XaB" +#define BANK_SHIFT 16 + +//************************************************ +struct sLang +{ + char *Dir; + char Prefix; +}; + +struct sInFile +{ + char Name[32]; + int Chunks; + int Offset; +}; + +//************************************************ +char *Script; +char *OutDir="",*ScriptFile=0; +int IncFileSet=0; +char IncludeFilename[256]; +int BankNo=0; + +char drive[_MAX_DRIVE]; +char dir[_MAX_DIR]; +char fname[_MAX_FNAME]; +char ext[_MAX_EXT]; + + +std::vector LangList; +std::vector FileList; + +//*********************************************************************** +//*********************************************************************** + +static void app_debug_msg(const char * pszFmt,va_list args) +{ + char szBuf[256]; + vsprintf(szBuf,pszFmt,args); + + printf("%s\n",szBuf); +} + + +//****************************************************************** +//****************************************************************** + +void __cdecl DEBUG(const char * pszFmt,...) +{ + if (pszFmt) + { + va_list args; + va_start(args,pszFmt); + app_debug_msg(pszFmt,args); + va_end(args); + } +} + +void __cdecl FATAL(const char * pszFmt,...) +{ + if (pszFmt) + { + va_list args; + va_start(args,pszFmt); + app_debug_msg(pszFmt,args); + va_end(args); + } + exit(123); +} + +//****************************************************************** + + + +char *LoadFileInMem(const char * pszName) +{ +HANDLE FileHandle; +DWORD SizeRead; +char *Buffer; +char TName[256]; +int Size; + + sprintf(TName,pszName); + + if( (FileHandle = CreateFile(TName, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_READONLY, NULL)) == INVALID_HANDLE_VALUE ) + { + FATAL("ERROR : Could not open file %s.",TName); + return NULL; + } + else + { + Size = GetFileSize(FileHandle,NULL); + + if( (Buffer=(char*)malloc(Size))==NULL ) {printf("Out of memory.\n");exit(123);} + ReadFile(FileHandle,(void*)Buffer,Size,&SizeRead,NULL); + CloseHandle(FileHandle); + } + return Buffer; +} + + +//****************************************************************** + +int FindFileSize(const char * FileName) +{ +HANDLE FileHandle; +DWORD Size; +char TName[256]; + + sprintf(TName,FileName); + + if( (FileHandle = CreateFile(TName, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_READONLY, NULL)) == INVALID_HANDLE_VALUE ) + { + FATAL("ERROR : Could not open file %s.",TName); + return (0); + } + else + { + Size = GetFileSize(FileHandle,NULL); + CloseHandle(FileHandle); + } + + return (Size); +} + +int FindFileSizeAlign(const char * FileName) +{ +int Size=FindFileSize(FileName); + Size = ((Size + 3) & 0xfffffffc); + return(Size); +} + + +//****************************************************************** +// Read pre-defined script file +//****************************************************************** +int IsWhiteSpace(char c) +{ + if (c==' ') return(1); + if (c==TAB) return(1); + if (c==0xd) return(1); + if (c==0xa) return(1); + return(0); +} + +//****************************************************************** +char *SkipWhiteSpace(char *Ptr) +{ + while (IsWhiteSpace(*Ptr)) Ptr++; + return(Ptr); +} + +//****************************************************************** +char *GotoNextLine(char *Ptr) +{ + while (*Ptr!=EOL) Ptr++; + return(Ptr+2); +} + +//****************************************************************** +void ReadScript() +{ +char *Ptr,*EndPtr; +int Size; +sInFile InFile; + + Script = (char *)LoadFileInMem( ScriptFile); + Size = FindFileSize(ScriptFile); + Ptr=Script; + EndPtr=Ptr+Size; + + while (Ptr=EndPtr) return; + if (*Ptr==COMMENT) + { // Comment + Ptr=GotoNextLine(Ptr); + } + else + { + int i=0; + InFile.Chunks=0; + while (!IsWhiteSpace(*Ptr) && Ptr +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=MkSpeech - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "MkSpeech.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "MkSpeech.mak" CFG="MkSpeech - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "MkSpeech - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "MkSpeech - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "MkSpeech - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD BASE RSC /l 0x809 /d "NDEBUG" +# ADD RSC /l 0x809 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /out:"C:\PRLSR\tools\MkSpeech.exe" + +!ELSEIF "$(CFG)" == "MkSpeech - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c +# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c +# ADD BASE RSC /l 0x809 /d "_DEBUG" +# ADD RSC /l 0x809 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept + +!ENDIF + +# Begin Target + +# Name "MkSpeech - Win32 Release" +# Name "MkSpeech - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=.\MkSpeech.cpp +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# End Group +# Begin Group "Resource Files" + +# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" +# End Group +# End Target +# End Project diff --git a/Utils/banker/banker.dsp b/Utils/banker/banker.dsp new file mode 100644 index 000000000..ed0a515f4 --- /dev/null +++ b/Utils/banker/banker.dsp @@ -0,0 +1,94 @@ +# Microsoft Developer Studio Project File - Name="banker" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=banker - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "banker.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "banker.mak" CFG="banker - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "banker - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "banker - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName ""$/PRLSR/utils/banker", KJRAAAAA" +# PROP Scc_LocalPath "." +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "banker - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD BASE RSC /l 0x809 /d "NDEBUG" +# ADD RSC /l 0x809 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /out:"..\..\tools\banker.exe" + +!ELSEIF "$(CFG)" == "banker - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c +# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c +# ADD BASE RSC /l 0x809 /d "_DEBUG" +# ADD RSC /l 0x809 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /out:"..\..\tools\banker.exe" /pdbtype:sept + +!ENDIF + +# Begin Target + +# Name "banker - Win32 Release" +# Name "banker - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=.\main.cpp +# End Source File +# End Group +# End Target +# End Project diff --git a/Utils/banker/main.cpp b/Utils/banker/main.cpp new file mode 100644 index 000000000..8a00cd825 --- /dev/null +++ b/Utils/banker/main.cpp @@ -0,0 +1,399 @@ +#include +#include +#include +#include +#include +#include +#include +#include + +//#include "SfxList.h" + + +//************************************************ + +#define MAX_SFX 1024 + +//************************************************ + +char path_buffer[_MAX_PATH]; +char drive[_MAX_DRIVE]; +char dir[_MAX_DIR]; +char fname[_MAX_FNAME]; +char ext[_MAX_EXT]; + + +struct bank_entry +{ + WORD looped; + WORD pitch; + DWORD offset; +}; + +typedef struct +{ + char Name[ 100 ]; + WORD SfxNo; + BYTE Hashed; + BYTE Looped; + WORD LoopPos; +} file_entry; + + +char ThisDir[256]; +file_entry FileList[MAX_SFX]; +int NoFiles = 0; + + +//*********************************************************************** +//*********************************************************************** + +static void app_debug_msg(const char * pszFmt,va_list args) +{ + char szBuf[256]; + + vsprintf(szBuf,pszFmt,args); + printf("\n%s\n",szBuf); +} + + +//****************************************************************** +//****************************************************************** + +void __cdecl screen_debug_msg(const char * pszFmt,...) +{ + if (pszFmt) + { + va_list args; + va_start(args,pszFmt); + app_debug_msg(pszFmt,args); + va_end(args); + } +} + +void __cdecl app_assert(const char * pszFmt,...) +{ + if (pszFmt) + { + va_list args; + va_start(args,pszFmt); + app_debug_msg(pszFmt,args); + va_end(args); + } + exit(123); +} + +//****************************************************************** + +void FreePtr(void *p) +{ + if(p) free(p); +} + +//****************************************************************** + +BYTE* LoadFileInMem(const char * pszName) +{ + HANDLE hsFile; + DWORD dwSize = NULL; + DWORD dwSize2 = NULL; + DWORD Temp; + BYTE* Buffer; + + if( (hsFile = CreateFile(pszName, GENERIC_READ, FILE_SHARE_READ, NULL, + OPEN_EXISTING, FILE_ATTRIBUTE_READONLY, NULL)) == INVALID_HANDLE_VALUE ) + { + screen_debug_msg("LFIM: Could not open file %s",pszName); + return NULL; + }else{ + dwSize = GetFileSize(hsFile,NULL); + dwSize2 = dwSize; + if(dwSize&0x7) dwSize2 = (dwSize-(dwSize&0x7))+8; + if( (Buffer=(BYTE*)malloc(dwSize2))==NULL ) {printf("Out of memory.\n");exit(123);} + ReadFile(hsFile,(void*)Buffer,dwSize,&Temp,NULL); + CloseHandle(hsFile); + } + + return Buffer; +} + + +//****************************************************************** + +DWORD FindFileSize(const char * pszName) +{ + HANDLE hsFile; + DWORD dwSize=NULL; + + if( (hsFile = CreateFile(pszName, GENERIC_READ, FILE_SHARE_READ, NULL, + OPEN_EXISTING, FILE_ATTRIBUTE_READONLY, NULL)) == INVALID_HANDLE_VALUE ) + { + screen_debug_msg("\nFFS: Could not open file %s",pszName); + return NULL; + }else{ + dwSize = GetFileSize(hsFile,NULL); + if(dwSize&0x7) dwSize = (dwSize-(dwSize&0x7))+8; + CloseHandle(hsFile); + } + + return dwSize; +} + + +//*************************************************** +// Find files in directory +//*************************************************** + +int CalcHashNum(char* astring) +{ + int result = 0; + WORD count; + + for (count=0; count>8) + ((val&0xff000000)>>24); + + return(result); +} + +void WriteBankData(char* Bank) +{ + FILE* BANKFILE = NULL; + FILE* OFFSETFILE = NULL; + BYTE* Buffer = NULL; + WORD Size; + DWORD filepos = 0; + char file[256]; + bank_entry BankInfo; + WORD pitch; + DWORD vagpitch; + + sprintf(file,"%s.bnk",Bank); + BANKFILE = fopen(file,"wb"); + if(!BANKFILE) {printf("\nBank file error\n\n");return;} + + sprintf(file,"%s.bof",Bank); + OFFSETFILE = fopen(file,"wb"); + if(!OFFSETFILE) {printf("\nBank offset error\n\n");return;} + + for(int i=0;i', '?', '@', '{', '}', '[', ']', '¬', +}; + +static const int nbBadFileChars = (sizeof(BadFileChars) / sizeof(char)); + + +void ExportEnums(char * name) +{ + FILE * ENUMFILE = NULL; + char file[256]; + + _splitpath(name, drive, dir, fname, ext); + strupr(fname); + sprintf( file, "%s.h", name ); + ENUMFILE = fopen(file,"wt"); + if(!ENUMFILE) {printf("\nEnum file error\n\n");return;} + + fprintf( ENUMFILE, "enum\n{\n" ); + for (int i=0;i=0;t--) + { + if( ostr[ t ] == '\\' ) + { + t++; + break; + } + } + + int o = 0; + for (;t "); + printf("\nFor example, 'Banker level0.txt \\data\\snd\\level0' will take"); + printf("\n'level0.txt' as its input and produce three files ( \\data\\snd\\level0.bof,"); + printf("\n\\data\\snd\\level0.bnk and \\data\\snd\\level0.h ) as output."); + printf("\n\n"); + return(0); + } + + FindDirFiles(argv[1]); + WriteBankData(argv[2]); + ExportEnums(argv[2]); + + printf("\nBank files made\n\n"); + + return(0); +} diff --git a/Utils/parkgrab/VImage.cpp b/Utils/parkgrab/VImage.cpp new file mode 100644 index 000000000..c21746ebe --- /dev/null +++ b/Utils/parkgrab/VImage.cpp @@ -0,0 +1,472 @@ +/*========================================================================= + + FILENAME.CPP + + Author: Gary Liddon @ + Created: + Project: + Purpose: + + Copyright (c) 1998 G R Liddon + +===========================================================================*/ + +/*---------------------------------------------------------------------- + Includes + -------- */ + +/* Std Lib + ------- */ + +/* Glib + ---- */ +#include "pak.h" + +/* Local + ----- */ +#include "vimage.h" + +/*---------------------------------------------------------------------- + Tyepdefs && Defines + ------------------- */ +using namespace std; + +/*---------------------------------------------------------------------- + Structure defintions + -------------------- */ + +/*---------------------------------------------------------------------- + Function Prototypes + ------------------- */ + +/*---------------------------------------------------------------------- + Vars + ---- */ + +/*---------------------------------------------------------------------- + Data + ---- */ + +/*---------------------------------------------------------------------- + Function: + Purpose: + Params: + Returns: + ---------------------------------------------------------------------- */ +VRAMImage::VRAMImage(int NewWidthInTpages,int NewHeightInPixels) : VRAMData(NULL) +{ + WidthInTpages=NewWidthInTpages; + HeightInPixels=NewHeightInPixels; + HeightInTPages=NewHeightInPixels / 256; + + if (!HeightInTPages) + { + aTPageHeight = 128; + HeightInTPages = 1; + } + else + { + aTPageHeight = HeightInTPages * 256; + } + TPageSizeInBytes = 128 * aTPageHeight; + + WidthInBytes=WidthInTpages*128; + + VramAreaBytes=WidthInBytes * HeightInPixels; + + VRAMData=new u8[VramAreaBytes]; + lbmData = new u8[WidthInTpages*256*HeightInPixels]; + + if (!lbmData) + Error(ERM_OUTOFMEM); + + if (!VRAMData) + Error(ERM_OUTOFMEM); + + memset(VRAMData,0,VramAreaBytes); + m_doCompress=false; +} + +/*---------------------------------------------------------------------- + Function: + Purpose: + Params: + Returns: + ---------------------------------------------------------------------- */ +VRAMImage::~VRAMImage(void) +{ + if (lbmData) + delete lbmData; + if (VRAMData) + delete VRAMData; +} + +/*---------------------------------------------------------------------- + Function: + Purpose: + Params: + Returns: + ---------------------------------------------------------------------- */ + +void VRAMImage::getTpData(unsigned int tp,std::vector & dest) const +{ + const int TPAGES_IN_ALL =WidthInTpages * HeightInTPages; + + if (tp >= TPAGES_IN_ALL) + Error(ERR_FATAL,"illegal tpage number"); + + int tpX,tpY; + u8 const * srcTpData; + dest.resize(TPageSizeInBytes); + + + tpX=(tp%WidthInTpages)*128; + tpY=(tp/WidthInTpages)*aTPageHeight; + + srcTpData=&VRAMData[tpX+tpY*WidthInBytes]; + + for (int x=0;x<128;x++) + for (int y=0;y & Body) +{ + try + { + GString Com; + + char TmpName[100]; + char CompTmpName[100]; + + tmpnam(TmpName); + tmpnam(CompTmpName); + + GString ComStr(CmdLine); + + ComStr.Replace("%1",TmpName); + ComStr.Replace("%2",CompTmpName); + + ofstream Out; + Out.open(TmpName,ios::binary|ios::trunc); + + if (Out) + { + int CompSize; + Out.write((char const *)&Body[0],Body.size()); + Out.close(); + + cout<<(char const *)ComStr<<"from "< tpageData; + tpageData.resize(TPageSizeInBytes); + + for (int f=0;f tpageData; + vector dataToWrite; + + tpageData.resize(TPageSizeInBytes); + dataToWrite.resize(TPageSizeInBytes); + + for (int f=0;f myData; + + myData.resize(128*64); + + memcpy(&myData[0],srcData,128*64); + + #ifdef __USE_LZNP__ + + CompressMem("lznp %1 %2",myData); + dataWriteSize=myData.size(); + memcpy(&dataToWrite[0],&myData[0],dataWriteSize); + + #else + dataWriteSize=PAK_findPakSize(&myData[0],128*64); + PAK_doPak(&dataToWrite[0],&myData[0],128*64); + #endif + + } + else + { + dataWriteSize=128*64; + memcpy(&dataToWrite[0],srcData,128*64); + } + for (int a=0;a<16;a++) printf("%i, ",(int)dataToWrite[a]); + printf("\n"); + Str.write((char *)(&dataToWrite[0]),dataWriteSize); + } + + } + else + Str.write((char *)(VRAMData),VramAreaBytes); +} + + + + + + + +/*---------------------------------------------------------------------- + Function: + Purpose: + Params: + Returns: + ---------------------------------------------------------------------- */ +void VRAMImage::PlotPal(SprPal const & PalToPlot) +{ + TPRect Tp=PalToPlot.GetTPRect(); + + int W=WidthInTpages*256; + + W/=2; + + u16 * Addr=(u16 *)&VRAMData[Tp.Y*W+Tp.X/2]; + + std::vector OutWords; + + PalToPlot.MakePSXPal(OutWords); + + int f; + + for (f=0;f> 4; + else + lbmData[x+y*W]=VRAMData[(y*(W/2))+(x/2)]&0x0f; + } + + ThisFr.SetFrame(lbmData,W,H,GazPalette); + ThisFr.SaveLbm(Name); + + cout<<"Written "< +#include + +/* Local + ----- */ + +/*---------------------------------------------------------------------- + Tyepdefs && Defines + ------------------- */ + +/*---------------------------------------------------------------------- + Structure defintions + -------------------- */ + +/*---------------------------------------------------------------------- + Function Prototypes + ------------------- */ +using namespace std; + +/*---------------------------------------------------------------------- + Vars + ---- */ + +/*---------------------------------------------------------------------- + Data + ---- */ +struct RGB +{ + u8 r,g,b; +}; + +class BITMAP +{ +public: + BITMAP(void) + { + m_width=0; + m_height=0; + } + + void setSize(int width,int height) + { + bitMap.resize(width*height); + + m_width=width; + m_height=height; + } + + void clear(void) + { + if (m_width && m_height) + memset(&bitMap[0],0,m_width*m_height); + } + + void line(unsigned int y,unsigned int x,u8 pix) + { + if (x >= m_width) + { + GObject::Error(ERR_WARNING,"Out of X boundary - %d %d\n", x, m_width); + x = m_width-1; + } + if (y >= m_height) + { + GObject::Error(ERR_WARNING,"Out of Y boundary - %d %d\n", y, m_height); + y = m_height-1; + } + bitMap[y*m_width+x]=pix; + + } + + u8 const * getBitMap(void) const + {return(&bitMap[0]);} + +protected: + int m_width; + int m_height; + vector bitMap; +}; + +/*---------------------------------------------------------------------- + Function: + Purpose: + Params: + Returns: + ---------------------------------------------------------------------- */ +#include +#include +#include +#include + + +#define BI_RGB 0 +#define BI_RLE8 1 +#define BI_RLE4 2 +#define BI_BITFIELDS 3 + +#define OS2INFOHEADERSIZE 12 +#define WININFOHEADERSIZE 40 + + +typedef struct BITMAPFILEHEADER +{ + unsigned long bfType; + unsigned long bfSize; + unsigned short bfReserved1; + unsigned short bfReserved2; + unsigned long bfOffBits; +} BITMAPFILEHEADER; + + +/* Used for both OS/2 and Windows BMP. + * Contains only the parameters needed to load the image + */ +typedef struct BITMAPINFOHEADER +{ + unsigned long biWidth; + unsigned long biHeight; + unsigned short biBitCount; + unsigned long biCompression; +} BITMAPINFOHEADER; + + +typedef struct WINBMPINFOHEADER /* size: 40 */ +{ + unsigned long biWidth; + unsigned long biHeight; + unsigned short biPlanes; + unsigned short biBitCount; + unsigned long biCompression; + unsigned long biSizeImage; + unsigned long biXPelsPerMeter; + unsigned long biYPelsPerMeter; + unsigned long biClrUsed; + unsigned long biClrImportant; +} WINBMPINFOHEADER; + + +typedef struct OS2BMPINFOHEADER /* size: 12 */ +{ + unsigned short biWidth; + unsigned short biHeight; + unsigned short biPlanes; + unsigned short biBitCount; +} OS2BMPINFOHEADER; + + + +/* read_bmfileheader: + * Reads a BMP file header and check that it has the BMP magic number. + */ +static int read_bmfileheader(Gifstream & f, BITMAPFILEHEADER *fileheader) +{ + fileheader->bfType = f.Get16(); + fileheader->bfSize= f.Get32(); + fileheader->bfReserved1= f.Get16(); + fileheader->bfReserved2= f.Get16(); + fileheader->bfOffBits= f.Get32(); + + if (fileheader->bfType != 19778) + return -1; + + return 0; +} + + + +/* read_win_bminfoheader: + * Reads information from a BMP file header. + */ +static int read_win_bminfoheader(Gifstream & f, BITMAPINFOHEADER *infoheader) +{ + WINBMPINFOHEADER win_infoheader; + + win_infoheader.biWidth = f.Get32(); + win_infoheader.biHeight = f.Get32(); + win_infoheader.biPlanes = f.Get16(); + win_infoheader.biBitCount = f.Get16(); + win_infoheader.biCompression = f.Get32(); + win_infoheader.biSizeImage = f.Get32(); + win_infoheader.biXPelsPerMeter = f.Get32(); + win_infoheader.biYPelsPerMeter = f.Get32(); + win_infoheader.biClrUsed = f.Get32(); + win_infoheader.biClrImportant = f.Get32(); + + infoheader->biWidth = win_infoheader.biWidth; + infoheader->biHeight = win_infoheader.biHeight; + infoheader->biBitCount = win_infoheader.biBitCount; + infoheader->biCompression = win_infoheader.biCompression; + + return 0; +} + + + +/* read_os2_bminfoheader: + * Reads information from an OS/2 format BMP file header. + */ +static int read_os2_bminfoheader(Gifstream & f, BITMAPINFOHEADER *infoheader) +{ + OS2BMPINFOHEADER os2_infoheader; + + os2_infoheader.biWidth = f.Get16(); + os2_infoheader.biHeight = f.Get32(); + os2_infoheader.biPlanes = f.Get32(); + os2_infoheader.biBitCount = f.Get32(); + + infoheader->biWidth = os2_infoheader.biWidth; + infoheader->biHeight = os2_infoheader.biHeight; + infoheader->biBitCount = os2_infoheader.biBitCount; + infoheader->biCompression = 0; + + return 0; +} + + +/* read_bmicolors: + * Loads the color pallete for 1,4,8 bit formats. + */ +static void read_bmicolors(int ncols, RGB *pal, Gifstream & f,int win_flag) +{ + int i; + + for (i=0; i> 1; + } + } + + pix = b[j]; + bmp->line(line,i,pix); + } +} + + + +/* read_4bit_line: + * Support function for reading the 4 bit bitmap file format. + */ +static void read_4bit_line(int length, Gifstream & f, BITMAP *bmp, int line) +{ + unsigned char b[8]; + unsigned long n; + int i, j, k; + int temp; + int pix; + + for (i=0; i> 4; + b[k*2] = temp & 15; + n = n >> 8; + } + } + + pix = b[j]; + bmp->line(line,i,pix); + } +} + + + +/* read_8bit_line: + * Support function for reading the 8 bit bitmap file format. + */ +static void read_8bit_line(int length, Gifstream & f, BITMAP *bmp, int line) +{ + unsigned char b[4]; + unsigned long n; + int i, j, k; + int pix; + + for (i=0; i> 8; + } + } + pix = b[j]; + bmp->line(line,i,pix); + } +} + + +/* read_24bit_line: + * Support function for reading the 24 bit bitmap file format, doing + * our best to convert it down to a 256 color pallete. + */ +static void read_24bit_line(int length, Gifstream & f, BITMAP *bmp, int line) +{ +#if 0 + int i, nbytes; + RGB c; + + nbytes=0; + + for (i=0; iline[line][i*3+_rgb_r_shift_24/8] = c.r; + bmp->line[line][i*3+_rgb_g_shift_24/8] = c.g; + bmp->line[line][i*3+_rgb_b_shift_24/8] = c.b; + nbytes += 3; + } + + nbytes = nbytes % 4; + if (nbytes != 0) + for (i=nbytes; i<4; i++) + f.get();; +#endif +} + + + +/* read_image: + * For reading the noncompressed BMP image format. + */ +static void read_image(Gifstream & f, BITMAP *bmp, BITMAPINFOHEADER *infoheader) +{ + int i, line; + + for (i=0; i<(int)infoheader->biHeight; i++) { + line = i; + + switch (infoheader->biBitCount) { + + case 1: + read_1bit_line(infoheader->biWidth, f, bmp, infoheader->biHeight-i-1); + break; + + case 4: + read_4bit_line(infoheader->biWidth, f, bmp, infoheader->biHeight-i-1); + break; + + case 8: + read_8bit_line(infoheader->biWidth, f, bmp, infoheader->biHeight-i-1); + break; + + case 24: + read_24bit_line(infoheader->biWidth, f, bmp, infoheader->biHeight-i-1); + break; + } + } +} + + + +/* read_RLE8_compressed_image: + * For reading the 8 bit RLE compressed BMP image format. + */ +static void read_RLE8_compressed_image(Gifstream & f, BITMAP *bmp, BITMAPINFOHEADER *infoheader) +{ + unsigned char count, val, val0; + int j, pos, line; + int eolflag, eopicflag; + + eopicflag = 0; + line = infoheader->biHeight - 1; + + while (eopicflag == 0) { + pos = 0; /* x position in bitmap */ + eolflag = 0; /* end of line flag */ + + while ((eolflag == 0) && (eopicflag == 0)) { + count = f.get(); + val = f.get(); + + if (count > 0) { /* repeat pixel count times */ + for (j=0;jline(line,pos,val); + pos++; + } + } + else { + switch (val) { + + case 0: /* end of line flag */ + eolflag=1; + break; + + case 1: /* end of picture flag */ + eopicflag=1; + break; + + case 2: /* displace picture */ + count = f.get(); + val = f.get(); + pos += count; + line -= val; + break; + + default: /* read in absolute mode */ + for (j=0; jline(line,pos,val0); + pos++; + } + + if (j%2 == 1) + val0 = f.get(); /* align on word boundary */ + break; + + } + } + + if (pos > (int)infoheader->biWidth) + eolflag=1; + } + + line--; + if (line < 0) + eopicflag = 1; + } +} + + + +/* read_RLE4_compressed_image: + * For reading the 4 bit RLE compressed BMP image format. + */ +static void read_RLE4_compressed_image(Gifstream & f, BITMAP *bmp, BITMAPINFOHEADER *infoheader) +{ + unsigned char b[8]; + unsigned char count; + unsigned short val0, val; + int j, k, pos, line; + int eolflag, eopicflag; + + eopicflag = 0; /* end of picture flag */ + line = infoheader->biHeight - 1; + + while (eopicflag == 0) { + pos = 0; + eolflag = 0; /* end of line flag */ + + while ((eolflag == 0) && (eopicflag == 0)) { + count = f.get(); + val = f.get(); + + if (count > 0) { /* repeat pixels count times */ + b[1] = val & 15; + b[0] = (val >> 4) & 15; + for (j=0; jline(line,pos,b[j%2]); + pos++; + } + } + else { + switch (val) { + + case 0: /* end of line */ + eolflag=1; + break; + + case 1: /* end of picture */ + eopicflag=1; + break; + + case 2: /* displace image */ + count = f.get(); + val = f.get(); + pos += count; + line -= val; + break; + + default: /* read in absolute mode */ + for (j=0; j> 4; + b[2*k] = val0 & 15; + val0 = val0 >> 4; + } + } + bmp->line(line,pos,b[j%4]); + pos++; + } + break; + } + } + + if (pos > (int)infoheader->biWidth) + eolflag=1; + } + + line--; + if (line < 0) + eopicflag = 1; + } +} + + + +/* load_bmp: + * Loads a Windows BMP file, returning a bitmap structure and storing + * the pallete data in the specified pallete (this should be an array of + * at least 256 RGB structures). + * + * Thanks to Seymour Shlien for contributing this function. + */ + +void load_bmp(Frame & frm,char const *filename) +{ + BITMAPFILEHEADER fileheader; + BITMAPINFOHEADER infoheader; + + RGB pal[256]; + BITMAP bmp; + + Gifstream f(Gifstream::LITTLE_ENDIAN); + + int ncol; + unsigned long biSize; + + f.open(filename,ios::in|ios::binary); + + if (!f) + GObject::Error(ERR_FATAL,"couldn't open file %s",filename); + + if (read_bmfileheader(f, &fileheader) != 0) + { + GObject::Error(ERR_FATAL,"error reading bmp hdr for %s",filename); + } + + biSize = f.Get32(); + + if (biSize == WININFOHEADERSIZE) + { + if (read_win_bminfoheader(f, &infoheader) != 0) + GObject::Error(ERR_FATAL,"error reading windows bmp info hdr for %s",filename); + + /* compute number of colors recorded */ + ncol = (fileheader.bfOffBits - 54) / 4; + read_bmicolors(ncol, pal, f, 1); + } + else if (biSize == OS2INFOHEADERSIZE) + { + if (read_os2_bminfoheader(f, &infoheader) != 0) + GObject::Error(ERR_FATAL,"error reading os2 bmp info hdr for %s",filename); + + /* compute number of colors recorded */ + ncol = (fileheader.bfOffBits - 26) / 3; + read_bmicolors(ncol, pal, f, 0); + } + else + { + GObject::Error(ERR_FATAL,"error finding correct hdr for bmp %s",filename); + } + + if (infoheader.biBitCount != 4 && infoheader.biBitCount != 8) + GObject::Error(ERR_FATAL,"only handles 4 && 8 bit bmps not %d : %s",infoheader.biBitCount,filename); + + + bmp.setSize(infoheader.biWidth, infoheader.biHeight); + + bmp.clear(); + + switch (infoheader.biCompression) + { + + case BI_RGB: + read_image(f, &bmp, &infoheader); + break; + + case BI_RLE8: + read_RLE8_compressed_image(f, &bmp, &infoheader); + break; + + case BI_RLE4: + read_RLE4_compressed_image(f, &bmp, &infoheader); + break; + + default: + GObject::Error(ERR_FATAL,"unknown compression foramt for %s",filename); + break; + } + + f.close(); + + + { + Palette palObj; + + + + for (int f=0;f + +/* Local + ----- */ + +/*---------------------------------------------------------------------- + Tyepdefs && Defines + ------------------- */ + +/*---------------------------------------------------------------------- + Structure defintions + -------------------- */ + +/*---------------------------------------------------------------------- + Globals + ------- */ + +/* Vars + ---- */ + +/* Data + ---- */ + +/* Functions + --------- */ +void load_bmp(Frame & frm,char const *filename); + +/*---------------------------------------------------------------------- */ + +#endif /* __BMPLOADER_H__ */ + +/*=========================================================================== + end */ \ No newline at end of file diff --git a/Utils/parkgrab/cross.cpp b/Utils/parkgrab/cross.cpp new file mode 100644 index 000000000..100a1c0de --- /dev/null +++ b/Utils/parkgrab/cross.cpp @@ -0,0 +1,158 @@ +/*========================================================================= + + CROSS.CPP + + Author: Gary Liddon @ Climax + Created: + Project: Diablo Playstation Conversion + Purpose: Find A Crosshair on a frame + + Copyright (c) 1996 Director's Cut Ltd. + +===========================================================================*/ + +/*---------------------------------------------------------------------- + Includes + -------- */ + +/* Std Lib + ------- */ + +/* STL + --- */ + +/* Glib + ---- */ + +/* Local + ----- */ +#include "cross.h" + +/*---------------------------------------------------------------------- + Structure defintions + -------------------- */ +using namespace std; + +/*---------------------------------------------------------------------- + Tyepdefs && Defines + ------------------- */ + +/*---------------------------------------------------------------------- + Function Prototypes + ------------------- */ + +/*---------------------------------------------------------------------- + Vars + ---- */ + +/*---------------------------------------------------------------------- + Classes + ------- */ + + +/*---------------------------------------------------------------------- + Description: + Find a cross hair in this frame for animation offset and store it + into member vars x and y. + + Returns: + True if a cross hair is found + ---------------------------------------------------------------------- */ +bool CROSS_RES::FindCrossHair( + Frame const & Fr, /* Frame we're looking for a cross-hair in */ + u8 CrossCol /* Pixel value of cross hair we're looking for */ + ) +{ + u8 const * FrmData; + int * CountCol=NULL; + int * CountRow=NULL; + + int Width; + int Height; + bool RetVal; + + RetVal=false; + + Width=Fr.GetWidth(); + Height=Fr.GetHeight(); + + if (Width && Height) + { + int Col; + int Row; + + if (!(CountCol=new int[Width])) + { + cout<<"Width is "< Largest) + { + Largest=CountCol[f]; + LargestIndex=f; + } + } + + return(LargestIndex); +} + +/*=========================================================================== + end */ + diff --git a/Utils/parkgrab/cross.h b/Utils/parkgrab/cross.h new file mode 100644 index 000000000..cda039c74 --- /dev/null +++ b/Utils/parkgrab/cross.h @@ -0,0 +1,67 @@ +/*========================================================================= + + CROSS.CPP + + Author: Gary Liddon @ Climax + Created: + Project: Diablo Playstation Conversion + Purpose: Find A Crosshair on a frame + + Copyright (c) 1996 Director's Cut Ltd. + +===========================================================================*/ + +#ifndef __CROSS_HPP__ +#define __CROSS_HPP__ + +/*---------------------------------------------------------------------- + Includes + -------- */ + +/* Std Lib + ------- */ + +/* STL + --- */ + +/* Glib + ---- */ +#include +#include + + +/*---------------------------------------------------------------------- + Tyepdefs && Defines + ------------------- */ + +/*---------------------------------------------------------------------- + Description: + This structure is used to find centering cross hairs + in frame objects using the FindCrossHair method. + If a cross hair is found, the results are put in + the x and y member vars. + ---------------------------------------------------------------------- */ +struct CROSS_RES +{ + int x; /* x co-ord of cross found */ + int y; /* y co-ord of cross found */ + + bool FindCrossHair(Frame const & Fr,u8 CrossCol); + +private: + int FindLargestIndex(int * CountCol,int Width); +}; + + +/*---------------------------------------------------------------------- + Function Prototypes + ------------------- */ + +/*---------------------------------------------------------------------- */ + +#endif /* __CROSS_HPP__ */ + +/*=========================================================================== + end */ + + diff --git a/Utils/parkgrab/grect.cpp b/Utils/parkgrab/grect.cpp new file mode 100644 index 000000000..80e1dc2fd --- /dev/null +++ b/Utils/parkgrab/grect.cpp @@ -0,0 +1,138 @@ +/*========================================================================= + + GRECT.CPP + + Author: Gary Liddon @ Climax + Created: + Project: + Purpose: + + Copyright (c) 1997 Climax Development Ltd + +===========================================================================*/ + +/*---------------------------------------------------------------------- + Includes + -------- */ + +/* Std Lib + ------- */ +#include + +/* Glib + ---- */ +#include + +/* Local + ----- */ +#include "grect.h" + + +/*---------------------------------------------------------------------- + Tyepdefs && Defines + ------------------- */ +using namespace std; + +/*---------------------------------------------------------------------- + Structure defintions + -------------------- */ + +/*---------------------------------------------------------------------- + Positional Vars + --------------- */ + +/*---------------------------------------------------------------------- + Function Prototypes + ------------------- */ +static Rect & AddAnotherRect(RectVec & Result); +static void AddRectMessage(Rect const & T); + + +/*---------------------------------------------------------------------- + Vars + ---- */ + +/*---------------------------------------------------------------------- + Data + ---- */ + +/*---------------------------------------------------------------------- + Function: + Purpose: + Params: + Returns: + ---------------------------------------------------------------------- */ +Rect & AddAnotherRect(RectVec & Result) +{ + Result.resize(Result.size()+1); + return(Result[Result.size()-1]); +} + +/*---------------------------------------------------------------------- + Function: + Purpose: + Params: + Returns: + ---------------------------------------------------------------------- */ + +void CutRect(Rect const & ToBeCut,Rect const & TheCutter,RectVec & Result) +{ + Rect Cutter=TheCutter; + + ToBeCut.ClipRect(Cutter); + + if (Cutter) + { + /* Is there a top rectangle hanging about? */ + + if (ToBeCut.Y != Cutter.Y) + { + Rect & TopRect=AddAnotherRect(Result); + TopRect=ToBeCut; + TopRect.H=Cutter.Y-TopRect.Y; + AddRectMessage(TopRect); + } + + /* Is there a bottom rectangle hanging about? */ + + if ((ToBeCut.Y+ToBeCut.H) != (Cutter.Y+Cutter.H)) + { + Rect & TopRect=AddAnotherRect(Result); + TopRect=ToBeCut; + TopRect.Y=Cutter.Y+Cutter.H; + TopRect.H=(ToBeCut.Y+ToBeCut.H)-(Cutter.Y+Cutter.H); + AddRectMessage(TopRect); + } + + /* Is there a left rectangle hanging about? */ + + if (ToBeCut.X != Cutter.X) + { + Rect & TopRect=AddAnotherRect(Result); + TopRect=Cutter; + TopRect.X=ToBeCut.X; + TopRect.W=Cutter.X-ToBeCut.X; + AddRectMessage(TopRect); + } + + /* Is there a right rectangle hanging about? */ + + if ((ToBeCut.X+ToBeCut.W) != (Cutter.X+Cutter.W)) + { + Rect & TopRect=AddAnotherRect(Result); + TopRect=Cutter; + TopRect.X=Cutter.X+Cutter.W; + TopRect.W=(ToBeCut.X+ToBeCut.W)-(Cutter.X+Cutter.W); + AddRectMessage(TopRect); + } + } + +} + +void AddRectMessage(Rect const & T) +{ +} + + +/*=========================================================================== + end */ diff --git a/Utils/parkgrab/grect.h b/Utils/parkgrab/grect.h new file mode 100644 index 000000000..32460a47c --- /dev/null +++ b/Utils/parkgrab/grect.h @@ -0,0 +1,63 @@ +/*========================================================================= + + GRECT.CPP + + Author: Gary Liddon @ Climax + Created: + Project: + Purpose: + + Copyright (c) 1997 Climax Development Ltd + +===========================================================================*/ + +#ifndef __GRECT_H__ +#define __GRECT_H__ + +/*---------------------------------------------------------------------- + Includes + -------- */ + +/* Std Lib + ------- */ +#include + +/* Glib + ---- */ +#include + +/* Local + ----- */ + +/*---------------------------------------------------------------------- + Tyepdefs && Defines + ------------------- */ + +typedef std::vector RectVec; + +/*---------------------------------------------------------------------- + Structure defintions + -------------------- */ + +/*---------------------------------------------------------------------- + Globals + ------- */ + +/* Vars + ---- */ + +/* Data + ---- */ + +/* Functions + --------- */ +void CutRect(Rect const & ToBeCut,Rect const & TheCutter,RectVec & Result); +void ReportRectVec(RectVec & Result); +void GRectTest(void); + +/*---------------------------------------------------------------------- */ + +#endif /* __GRECT_H__ */ + +/*=========================================================================== + end */ diff --git a/Utils/parkgrab/main.cpp b/Utils/parkgrab/main.cpp new file mode 100644 index 000000000..f39ba18d3 --- /dev/null +++ b/Utils/parkgrab/main.cpp @@ -0,0 +1,703 @@ +/*========================================================================= + + MAIN.CPP + + Author: Gary Liddon @ Fareham + Created: 28th September 1998 + Project: Theme Park World PSX + Purpose: Main file for tpw sprite grabber (it's sprgrab II!) + + Copyright (c) 1998 G R Liddon + +===========================================================================*/ + +/*---------------------------------------------------------------------- + Version info + + 1.0 - 1.1 Various changes by various authors + 1.2 GL Added -r switch to allow \ disallow sprite rotation + 1.3 GL Added -x option to allow saving out of non VRAM sprs + 1.31 GL Added -f option so you can force offsets to a value + 1.4 TS Added replacement of bad characters in filenames + 1.5 GL Added support for BMP files + 1.6 GL Made all out files lower case + Checked for errrors when writing files (Doh!) + 1.7 GL Added -q (turn on\of grabbers shrink to fit routine) + Also Added -k option to report where each texture has gone in the VRAM, + This will be read by mikes gin -> ars program for deciding what to do about shared + textures + 1.71 GL Added widths and heights of textures to report file + 1.72 GL Actually made the -q switch do what it was supposed to. Doh! + 1.8 GL Added -i switch to set output dir for inc files + 1.81 GL Corrected bug in 1.8 that meant no .h was written + 1.9 GL -e to set maximum size for textures + 1.91 GL Changed so that files prefixed with a "+" have col zero as see-through + 2.0 GL Added reading of gin files and import of rep files + 2.1 GL Added spare tpage space defintions + 2.11 GL Added the rather excellent -j option + 2.12 GL Fixed a bug, stopped -j textures from being reduced + 2.13 GL Removed the -j option and changed it so that all textures starting with ! are auto -j'd ;) + 2.14 GL Replaced bit map loader, will move this code into Frame at some point + 2.15 GL Restricted it so that only images up to 254x254 are allowed + 2.16 GL Fixed bug that meant 256 col images were often shagged + 2.17 TS Added '@' filename pre-fix to denote scrolling and transparent textures + 2.2 GL Changed the autocropping so that if the image is blank it allocates a 1x1 texture instead of a + texture the size of the input lbm + 2.21 GL added -twisting_my_melon_man siwtch (don't ask) + 2.3 GL added -y command to give us tpage compression + 2.31 GL -y didn't work (not even a little bit) but it does now ;) + 2.4 GL Added -~ switch to write out a raw tpage chunked version of the VRAM file + 2.41 GL Added -^ switch to stop any tpages being written + 2.5 TS Added -h half a tpage flag + 2.6 DO Added -w only output animated texture frame headers + Added -b dont output spare boxes + Added -a align headers to 2k + +/*---------------------------------------------------------------------- + Includes + -------- */ + +/* Std Lib + ------- */ +#include +#include + +/* Glib + ---- */ +#include +#include +#include +#include +#include + +/* TP Lib + ------- */ +#include +#include + + +/* Local + ----- */ +#include "sprset.h" + +/*---------------------------------------------------------------------- + Tyepdefs && Defines + ------------------- */ +using namespace std; + +/*---------------------------------------------------------------------- + Class defintions + ---------------- */ + +/* Hold's a list of all the files to be processed on along with the options that apply to them + ------------------------------------------------------------------------------------------- */ +class AllFiles : protected FileCycler +{ +public: + AllFiles(void) + { + RecurseFiles=false; + CrossHair=false; + ZeroColZero=false; + MoveUVs=false; + AllowRotate=true; + ForceOffsets=false; + ShrinkToFit=true; + m_allocateAs16bit=false; + MaxSize=0; + m_noSort=false; + } + + void SetFileRecursion(bool NewRecurseFiles) + {RecurseFiles=NewRecurseFiles;} + + void SetCrossHair(bool NewCrossHair) + {CrossHair=NewCrossHair;} + + void SetZeroColZero(bool NewColZero) + {ZeroColZero=NewColZero;} + + void SetMoveUVs(bool NewMoveUVs) + {MoveUVs=NewMoveUVs;} + + void SetAllowRotate(bool NewAllowRotate) + {AllowRotate=NewAllowRotate;} + + void SetForceOffsets(bool NewForceOffsets) + {ForceOffsets=NewForceOffsets;} + + void SetShrinkToFit(bool NewSetShrinkToFit) + {ShrinkToFit=NewSetShrinkToFit;} + + void SetXOff(int NewXOff) + {XOff=NewXOff;} + + void SetYOff(int NewYOff) + {YOff=NewYOff;} + + void SetMaxSize(int New) + {MaxSize=New;} + + int GetMaxSize(void) const + {return(MaxSize);} + + void AddFile(const char * Name); + + FIVec const & GetFileInfoVector(void) const + {return(AllFileInfos);} + + void SortOrder(); + + void ReadRepFile(char const * Name) + { + vector MyItems; + + ::readRepFile(Name,MyItems); + + for (int f=0;f UniqueTexturesSoFar; + vector AllExternalSharedTextures; + + void FileCallback(char const * FName,int FileNum); + + bool ShrinkToFit; + bool RecurseFiles; + bool CrossHair; + bool ZeroColZero; + bool MoveUVs; + bool AllowRotate; + bool ForceOffsets; + + bool m_allocateAs16bit; + bool m_noSort; + + int XOff,YOff; + + FIVec AllFileInfos; + int MaxSize; +}; + +/*---------------------------------------------------------------------- + Function Prototypes + ------------------- */ +static char * CycleCommands(char *String,int Num); +static void Usage(void); +static bool CheckPlusMinus(const char * Str); +static GString CheckFileString(const char * Str); +static GString OutFile; +static GString OutLbm; +static GString SprFile; +static GString ReportFile; +static GString IncOutFile; + +static int PageBase; +static int WidthPages; +static int HeightPages; +static bool PagePlacements=false; +static bool s_compressTpages=false; +static bool s_noWriteTpages=false; +static bool s_useHalfTpage=false; +static bool s_AnimatedHeadersOnly=false; +static bool s_DontOutputBoxes=false; +static bool s_AlignHeaders=false; + +static GString s_rawTpageFile; + +/*---------------------------------------------------------------------- + Vars + ---- */ +static AllFiles MyFiles; + +/*---------------------------------------------------------------------- + Data + ---- */ + +static const float Version = 2.6; + +/*---------------------------------------------------------------------- + Function: + Purpose: + Params: + Returns: + ---------------------------------------------------------------------- */ +int main(int argc,char ** argv) +{ + cerr<<"GRLiddon() PARKGRAB TPW Spr Grabber "<+|-. Aborts out of there was a problem. + Params: Str = Text of item + Returns: true if a plus option + ---------------------------------------------------------------------- */ +bool CheckPlusMinus(const char * Str) +{ + if (strlen(Str)==3 && (Str[0]=='-' || Str[0]=='/') && (Str[2]=='-' || Str[2]=='+')) + { + } + else + GObject::Error(ERR_FATAL,"Problem with cmd line option %s",Str); + + return(Str[2]=='+'); +} + +/*---------------------------------------------------------------------- + Function: void CheckPlusMinus(const char * Str) + Purpose: Check to see if this cmd line item is of the type + -+|-. Aborts out of there was a problem. + Params: Str = Text of item + Returns: true if a plus option + ---------------------------------------------------------------------- */ +GString CheckFileString(const char * Str) +{ + GString RetStr; + + if (strlen(Str)>3 && (Str[0]=='-' || Str[0]=='/') && (Str[2]==':' || Str[2]==':')) + RetStr=&Str[3]; + else + GObject::Error(ERR_FATAL,"Problem with cmd line option %s",Str); + + return(RetStr); +} + + +/*---------------------------------------------------------------------- + Function: void Usage(void) + Notes: Usage of the util + ---------------------------------------------------------------------- */ +void Usage(void) +{ + cout<<"Usage: PARKGRAB [ .. ] [ switches.. ]\n"; + cout<<"Switches:\n"<\t\t\tSet recurse sub dirs (default off)"<\t\t\tSet cross hair offset detection (default off)"<\t\t\tSet colour zero trans (default off)"<\t\t\tSet move in u/v coords (default off)"<\t\t\tSet if spr rotation allowed (default on)"<\t\t\tShrink to bounds of lbm (default on)"<\t\t\tCompress tpages (default off)"<\t\t\tDo not write a tpage (default off)"<\t\t\tForce tpage height to half (default off)"<\t\t\tOnly write animated headers (default off)"<\t\t\tDo not write spare boxes (default off)"<\t\t\tAlign headers to 2k chunk (default off)"<\t\tSet maximum size for textures"<\t\tRead in a shared texture file for gin files"<\t\tOutput Vram filename"<\t\tOutput Sprfile filename"<\t\tWrite out an lbm of the tpage "<\t\tWrite out a vram report"<\t\tWrite out raw VRAM image"< +#include + +void AllFiles::FileCallback(char const * FName,int FileNum) +{ + FileInfo MyInfo; + bool ThisZeroColZero; + + + GFName FileName(FName); + + GString Ext(FileName.Ext()); + + Ext.Lower(); + + if (Ext=="gin") + { + vector NonSharedTextures; + +// Gin4File MyFile; + CScene MyFile; + MyFile.Load(FName); + + MyFile.GetNonSharedTextures(AllExternalSharedTextures,NonSharedTextures); + + + vector NewEntrys; + + for (int f=0;f +#include "pak.h" + +/* Graphics + -------- */ + +/*---------------------------------------------------------------------- + Tyepdefs && Defines + ------------------- */ +#define UNPAKBUFFERSIZE 4096 +#define STRMAX 80 +#define BUFFERSIZE 30000 +#define TRIGGER 20000 +#define MAXUNIQUE 127 + +/*---------------------------------------------------------------------- + Structure defintions + -------------------- */ +struct Block +{ + int data[128]; + BOOL blockrep; + int blocksize; + int blockoffset; + + u8 * Dest; + int outsize; + + virtual void fputc(u8 Val) + { + *Dest=Val; + Dest++; + outsize++; + } + + void writeBlock(void); +}; + +struct CountBlock : Block +{ + virtual void fputc(u8 Val) + { + Dest++; + outsize++; + } +}; + +/*---------------------------------------------------------------------- + Vars + ---- */ +static int s_lastAmountOfCompressedData; + +/*---------------------------------------------------------------------- + Function Prototypes + ------------------- */ +static void writeblock(struct block *theblock); + +/*---------------------------------------------------------------------- + Vars + ---- */ +/*---------------------------------------------------------------------- + Data + ---- */ + +/*---------------------------------------------------------------------- + Function: + Purpose: + Params: + Returns: + ---------------------------------------------------------------------- */ +void Block::writeBlock(void) +{ + if ((blockrep) && (blocksize == 0)) + { + /* Terminator */ + fputc(128); + fputc(0); + } + else if (blockrep) + { + fputc(blockoffset); + fputc(blocksize); + } + else /* Unique bytes */ + { + fputc(blocksize & 127); + + for (int i = 0; i <= blocksize; i++) + fputc(data[i]); + } + + // Get ready for next block + blockrep = FALSE; + blockoffset = 0; + blocksize = -1; +} + + +/*---------------------------------------------------------------------- + Function: + Purpose: + Params: + Returns: + ---------------------------------------------------------------------- */ +static bool memequ(u8 const * p1,u8 const * p2,int size) +{ + bool same; + + same=true; + + for (int f=0;f FORWARDDIST) + end = FORWARDDIST; + + bestoffset = begin; + bestlength = 1; + theptr = buffer + (inpos); + + ptr1 = buffer + (inpos + begin); + + for (offset = begin; offset < 0; offset++) + { + if (*ptr1 == *theptr) + { + if (memequ(ptr1, theptr, bestlength + 1)) + { + bestlength++; + bestoffset = offset; + ptr2 = ptr1 + bestlength; + ptr3 = theptr + bestlength; + + while (*ptr2 == *ptr3) + { + ptr2++; + ptr3++; + bestlength++; + if (bestlength >= end) + break; + } + } + } + + if (bestlength >= end) + { + bestlength = end; + break; + } + + ptr1++; + } + + + if (bestlength < MINBLOCK) + { + /* See if last block is unique */ + + if (theblock.blockrep) /* Flush previous special block */ + { + theblock.writeBlock(); + theblock.data[++theblock.blocksize] = buffer[inpos++]; + } + else + { + /* Add to it */ + + if (theblock.blocksize >= MAXUNIQUE) + theblock.writeBlock(); + + theblock.data[++theblock.blocksize] = buffer[inpos++]; + } + } + else + { + /* We have found a match */ + theblock.writeBlock(); + theblock.blockrep = TRUE; + theblock.blocksize = bestlength; + theblock.blockoffset = bestoffset; + inpos += bestlength; + } + } + + /* Flush buffer */ + + theblock.writeBlock(); + + /* Terminate file */ + + theblock.blockrep = TRUE; + theblock.blocksize = 0; + theblock.blockoffset = 0; + theblock.writeBlock(); + + return(theblock.outsize); +} + + +/*---------------------------------------------------------------------- + Function: + Purpose: + Params: + Returns: + ---------------------------------------------------------------------- */ +int PAK_doPak(u8 * Dest,u8 const * buffer,int insize) +{ + Block outBlock; + return(lowLevelPak(Dest,buffer,insize,outBlock)); +} + +/*---------------------------------------------------------------------- + Function: + Purpose: + Params: + Returns: + ---------------------------------------------------------------------- */ +int PAK_findPakSize(u8 const * buffer,int insize) +{ + CountBlock outBlock; + return(lowLevelPak(NULL,buffer,insize,outBlock)); +} + +/*---------------------------------------------------------------------- + Function: + Purpose: + Params: + Returns: + ---------------------------------------------------------------------- */ +int PAK_doUnpak(u8 * Dest,u8 const * Source) +{ + int outsize = 0; + u8 const * originalSource; + + originalSource=Source; + + while (1) /* ie, continue until end mark */ + { + u8 const * From; + + int size; + int ch; + + ch = *Source++; + + if (ch < 128) /* if it is in range {0..127} then */ + { + size = (ch + 1); + From=Source; + Source+=size; + } + else + { + size = *Source++; + + if (size == 0) /* distance == 0 => end of file */ + break; + + From=Dest+(s8)ch; + } + + u8 * endAddr; + endAddr=(u8*)(u32(From)+size); + + outsize += size; + + while (From!=endAddr) + { + *Dest=*From; + Dest++; + From++; + } + } + + s_lastAmountOfCompressedData=Source-originalSource; + + return(outsize); +} + +int PAK_getLastAmountOfDataRead(void) +{ + return(s_lastAmountOfCompressedData); +} + +/*=========================================================================== + end */ + + + + diff --git a/Utils/parkgrab/pak.h b/Utils/parkgrab/pak.h new file mode 100644 index 000000000..f3f5df83f --- /dev/null +++ b/Utils/parkgrab/pak.h @@ -0,0 +1,61 @@ +/*========================================================================= + + PAK.H + + Author: Carl Muller (algorithm Nick Pelling && Carl Muller) + Created: + Project: + Purpose: + + Copyright (c) 1997 Climax Development Ltd + +===========================================================================*/ + +#ifndef __PAK_PAK_H__ +#define __PAK_PAK_H__ + +/*---------------------------------------------------------------------- + Includes + -------- */ + +/* Std Lib + ------- */ + +/* Glib + ---- */ +#include + +/* Local + ----- */ + +/*---------------------------------------------------------------------- + Tyepdefs && Defines + ------------------- */ + +/*---------------------------------------------------------------------- + Structure defintions + -------------------- */ + +/*---------------------------------------------------------------------- + Globals + ------- */ + +/* Vars + ---- */ + +/* Data + ---- */ + +/* Functions + --------- */ +int PAK_doPak(u8 * Dest,u8 const * source,int insize); +int PAK_doUnpak(u8 * Dest,u8 const * Source); +int PAK_findPakSize(u8 const * souce,int insize); +int PAK_getLastAmountOfDataRead(void); + +/*---------------------------------------------------------------------- */ + +#endif /* __PAK_PAK_H__ */ + +/*=========================================================================== + end */ diff --git a/Utils/parkgrab/parkgrab.dsp b/Utils/parkgrab/parkgrab.dsp new file mode 100644 index 000000000..eb4f5c6bb --- /dev/null +++ b/Utils/parkgrab/parkgrab.dsp @@ -0,0 +1,154 @@ +# Microsoft Developer Studio Project File - Name="parkgrab" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=parkgrab - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "parkgrab.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "parkgrab.mak" CFG="parkgrab - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "parkgrab - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "parkgrab - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName ""$/tp2psx/utils/parkgrab", IXNAAAAA" +# PROP Scc_LocalPath "." +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "parkgrab - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\glibdev\glib\include" /I "..\glibdev\glib\include\pc" /I "..\ginutils\tplib" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /FR /YX /FD /c +# ADD BASE RSC /l 0x809 /d "NDEBUG" +# ADD RSC /l 0x809 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib win32lib.lib tplib.lib /nologo /subsystem:console /machine:I386 /out:"../../tools/parkgrab.exe" /libpath:"..\glibdev\glib\lib\win32lib\release" /libpath:"..\ginutils\tplib\release" + +!ELSEIF "$(CFG)" == "parkgrab - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c +# ADD CPP /nologo /G5 /MDd /W3 /Gm /GX /ZI /Od /I "..\glibdev\glib\include" /I "..\glibdev\glib\include\pc" /I "..\ginutils\tplib" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FR /YX /FD /GZ /c +# ADD BASE RSC /l 0x809 /d "_DEBUG" +# ADD RSC /l 0x809 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib win32lib.lib tplib.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\glibdev\glib\lib\win32lib\debug" /libpath:"..\ginutils\tplib\debug" + +!ENDIF + +# Begin Target + +# Name "parkgrab - Win32 Release" +# Name "parkgrab - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=.\bmploader.cpp +# End Source File +# Begin Source File + +SOURCE=.\cross.cpp +# End Source File +# Begin Source File + +SOURCE=.\grect.cpp +# End Source File +# Begin Source File + +SOURCE=.\main.cpp +# End Source File +# Begin Source File + +SOURCE=.\pak.cpp +# End Source File +# Begin Source File + +SOURCE=.\sprset.cpp +# End Source File +# Begin Source File + +SOURCE=.\tpage.cpp +# End Source File +# Begin Source File + +SOURCE=.\VImage.cpp +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h" +# Begin Source File + +SOURCE=.\bmploader.h +# End Source File +# Begin Source File + +SOURCE=.\cross.h +# End Source File +# Begin Source File + +SOURCE=.\grect.h +# End Source File +# Begin Source File + +SOURCE=.\pak.h +# End Source File +# Begin Source File + +SOURCE=.\sprset.h +# End Source File +# Begin Source File + +SOURCE=.\tpage.h +# End Source File +# Begin Source File + +SOURCE=.\vimage.h +# End Source File +# End Group +# End Target +# End Project diff --git a/Utils/parkgrab/parkgrab.dsw b/Utils/parkgrab/parkgrab.dsw new file mode 100644 index 000000000..8bebab67d --- /dev/null +++ b/Utils/parkgrab/parkgrab.dsw @@ -0,0 +1,33 @@ +Microsoft Developer Studio Workspace File, Format Version 6.00 +# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! + +############################################################################### + +Project: "parkgrab"=.\parkgrab.dsp - Package Owner=<4> + +Package=<5> +{{{ + begin source code control + "$/PRLSR/utils/parkgrab", TCEAAAAA + . + end source code control +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Global: + +Package=<5> +{{{ +}}} + +Package=<3> +{{{ +}}} + +############################################################################### + diff --git a/Utils/parkgrab/parkgrab.ncb b/Utils/parkgrab/parkgrab.ncb new file mode 100644 index 000000000..f88fe5a38 Binary files /dev/null and b/Utils/parkgrab/parkgrab.ncb differ diff --git a/Utils/parkgrab/sprset.cpp b/Utils/parkgrab/sprset.cpp new file mode 100644 index 000000000..1a24c8508 --- /dev/null +++ b/Utils/parkgrab/sprset.cpp @@ -0,0 +1,1314 @@ +/*========================================================================= + + SPRSET.CPP + + Author: Gary Liddon @ Fareham + Created: + Project: TPW Parkgrab + Purpose: Object that reads in all the frames for sprites + processes them into tpages and spits it all out to + disk + + Copyright (c) 1998 G R Liddon + +===========================================================================*/ + +/*---------------------------------------------------------------------- + Includes + -------- */ + +/* Std Lib + ------- */ +#include +#include +#include + +/* Glib + ---- */ +#include +#include +#include +#include +#include + +/* Local + ----- */ +#include "sprset.h" +#include "cross.h" + +/*---------------------------------------------------------------------- + Tyepdefs && Defines + ------------------- */ + +using namespace std; + +/*---------------------------------------------------------------------- + Structure defintions + -------------------- */ + +/*---------------------------------------------------------------------- + Function Prototypes + ------------------- */ + +/*---------------------------------------------------------------------- + Vars + ---- */ + +/*---------------------------------------------------------------------- + Data + ---- */ + +static const char BadFileChars[] = +{ + '+', '-', '*', '/', '\\', '#', ',', + '.', '(', ')', '!', '"', '£', '$', + '%', '^', '&', '=', '#', ':', ';', '<', + '>', '?', '@', '{', '}', '[', ']', '¬', +}; + +static const int nbBadFileChars = (sizeof(BadFileChars) / sizeof(char)); + +/*---------------------------------------------------------------------- + Function: + Purpose: + Params: + Returns: + ---------------------------------------------------------------------- */ +GString ReplaceBadFileChars(GString s) +{ + GString out; + const char *textin = (const char*)s; + char *textout = new char[s.Len()+1]; + memset(textout, 0, s.Len()+1); + int i, p; + + p=0; + for (i=0; i (*PalIt).GetNumOfCols()) + (*PalIt)=ThisPal; + + PalIndex=PalIt-AllSprPals.begin(); + } + } + + /* If Palindex == -1 then we couldn't find the palette we wanted so add this one to the pool */ + + if (PalIndex==-1) + { + AllSprPals.resize(AllSprPals.size()+1); + SprPal & ThisSprPal=AllSprPals[AllSprPals.size()-1]; + PalIndex=AllSprPals.size()-1; + ThisSprPal=ThisPal; + ThisSprPal.SetPlusColZero((*it).GetPlusColZero()); + ThisSprPal.SetZeroColZero((*it).GetZeroColZero()); + ThisSprPal.SetName((*it).GetName()); + } + + /* Set the sprframe to have the write pal index */ + + (*it).SetPalIndex(PalIndex); + AllSprPals[PalIndex].SetPalIndex(PalIndex); + } + + cout<<"Found "<SaveAs16ColLbm(FileName); +} + +/*---------------------------------------------------------------------- + Function: + Purpose: + Params: + Returns: + ---------------------------------------------------------------------- */ +#include + +void SprSet::WriteReport(char const * File) +{ + const int DirLen=1024; + char Dir[DirLen+1]; + GString CurrDir; + + CurrDir=getcwd(Dir,DirLen); + CurrDir.Upper(); + CurrDir=CurrDir+"\\"; + + GString OutFileName(File); + OutFileName.Lower(); + + Gofstream Out; + + Out.open(OutFileName,ios::out); + + if (Out) + { + Out<<"File\tTPage\tClut\tu\tv\tw\th\tRotated"<GetActualName(); + u=Frm.GetTPRect().X; + v=Frm.GetTPRect().Y; + w=Frm.GetWidth(); + h=Frm.GetHeight(); + + RelName=GFName::makerelative(CurrDir,Name,Dir); + + Out<<(char const *)RelName<<"\t$"<PlotFrame(AllSprFrames[f]); + + for (f=0;fPlotPal(AllSprPals[f]); + + /* + struct SpriteBankHdr + { + u16 NumOfSprites; + u16 NumOfTPages; + + u16 TpageStart; + u16 WidthInTpages; + + u16 HeightInTpages; + u16 NumOfSpareBoxes; + }; + */ + + Gofstream Out(Gofstream::LITTLE_ENDIAN); + + GString OutFileName(File); + OutFileName.Lower(); + + Out.open(OutFileName,ios::out|ios::binary); + + TPRectVec spareVRAM; + + MyVram.getUnusedSpace(spareVRAM); + + if (Out) + { +int FrameCount=AllSprFrames.size(); + if (m_AnimatedHeadersOnly) + { + FrameCount=0; + for (f=0;fsetDoCompress(m_compressTpages); + Vi->Write(Out); + } + + Out.close(); + } + else + Error(ERR_FATAL,"Error wring file %s",(char const *)OutFileName); + + WriteHeaderFile(GetHeaderFileName(File)); +} + + +GString SprSet::GetHeaderFileName(char const * File) +{ + GString HeaderFileName; + + if (IncOutFile == "") + { + GFName HeaderFile(File); + HeaderFile.Ext("h"); + HeaderFileName=HeaderFile.FullName(); + } + else + HeaderFileName=IncOutFile; + + HeaderFileName.Lower(); + + return(HeaderFileName); +} + +void SprSet::WriteHeaderFile(char const * HName) +{ + ofstream HOut; + int f; + + GFName HeaderFile(HName); + + GString OFileDefine; + OFileDefine="__SPR_"; + OFileDefine+=HeaderFile.File(); + OFileDefine+="_H__"; + OFileDefine.Upper(); + + GString HeaderFileName(HeaderFile.FullName()); + HeaderFileName.Lower(); + + HOut.open(HeaderFileName,ios::out); + + if (HOut) + { + HOut<<"#ifndef "<<(char const *)OFileDefine< CopySprPals; /* Make a copy of the palettes */ + + CopySprPals=AllSprPals; + + std::sort(CopySprPals.begin(),CopySprPals.end()); /* Sort em according to how many cols */ + + for (f=0;f AllocRects; + + AllocRects.resize(AllSprFrames.size()); + + std::vector oldTypes; + + oldTypes.resize(AllSprFrames.size()); + + for (f=0;fgetAllocateAs16Bit()) + oldTypes[f]=AllocRects[f].convertTo16Bit(); + } + + /* Allocate int VRAM */ + + if(Vr.AllocVRAM(AllocRects,false,true,true)) + { + /* + Now go back through all the sprite frames and tell them where + they are going to sit in VRAM + */ + + for (f=0;fgetAllocateAs16Bit()) + AllocRects[f].convertFrom16Bit(oldTypes[AllocRects[f].GetId()]); + + AllSprFrames[AllocRects[f].GetId()].SetVRAMPos(AllocRects[f]); + } + } + else + { + Error(ERR_FATAL,"Couldn't fit frames into VRAM"); + } + + /* Go through and tell all pals and frames what the base tpage is */ + + for (f=0;fWriteInTpageChunks(out); + } + else + Error(ERR_FATAL,"Error opening raw file %s",file); +} + +/*---------------------------------------------------------------------- + Function: + Purpose: Write out sprs and pals to a sprite file (not a VRAM block) + Params: + Returns: + ---------------------------------------------------------------------- */ +void SprSet::WriteSprFile(char const * Name) +{ + std::vector SprOffsets; + std::vector PalOffsets; + + ProcessPals(); + + Gofstream SpriteOut(Gofstream::LITTLE_ENDIAN); + + GString SpriteOutName(Name); + SpriteOutName.Lower(); + SpriteOut.open(SpriteOutName,ios::binary|ios::out|ios::trunc); + + if (SpriteOut) + { + int NumOfSprs; + int NumOfPals; + int PalOffsetTable; + int SprOffsetTable; + + /* + struct SPR_RAM_HDR + { + int NumOfPals; + int NumOfSprs; + int PalOffsets[NumOfPals]; + int SprOfffsets[NumOfSprs]; + RAM_FRAME_HDR Frames[NumOfSprs]; + Pals Pals[NumOfPals]; + Data [NumOfSprs] + } + + */ + + NumOfSprs=AllSprFrames.size(); + NumOfPals=AllSprPals.size(); + + SpriteOut.Put32(NumOfPals); + SpriteOut.Put32(NumOfSprs); + + SprOffsets.resize(NumOfSprs); + PalOffsets.resize(NumOfPals); + + PalOffsetTable=SpriteOut.tellp(); + SpriteOut.seekp(sizeof(u32)*NumOfPals,ios::cur); + + SprOffsetTable=SpriteOut.tellp(); + SpriteOut.seekp(sizeof(u32)*NumOfSprs,ios::cur); + + int f; + + for (f=0;f MaxSize) + NewWidth=MaxSize; + + if (NewHeight > MaxSize) + NewHeight=MaxSize; + + if (NewWidth != GetWidth() || NewHeight != GetHeight()) + { + cout<<"Reducing frame "<GetActualFileName()<GetActualFileName()< 254 || Height > 254) + { + Error(ERR_FATAL,"Images only allowed to 254x254, this is %dx%d : %s",Width,Height,MyFileInfo.GetActualFileName()); + } + + +} + +struct fRGBA + { + void Set(float _R,float _G,float _B,float _A) + {R=_R;G=_G;B=_B;A=_A;} + + float R,G,B,A; + }; + +void SprFrame::ResizeAndReduce(Frame & Frm,int TargCols,float XPerc,float YPerc,bool ZeroSeeThrough) +{ + std::vector FullColNewScreen; + std::vector DestBytePic; + std::vector Bitmap; + + u8 Pal[256*3]; + u8 * Dest; + int f; + + Bitmap.resize(Frm.GetWidth()*Frm.GetHeight()*4); + + Frm.MakeRGBA(&Bitmap[0],ZeroSeeThrough); + + int Width,Height; + + Width=Frm.GetWidth(); + Height=Frm.GetHeight(); + + int NewWidth=float(Width)*XPerc; + int NewHeight=float(Height)*YPerc; + + if (!(Dest=new u8[NewWidth*NewHeight])) + GObject::Error(ERM_OUTOFMEM); + + FullColNewScreen.resize(NewWidth*NewHeight); + DestBytePic.resize(NewWidth*NewHeight*3); + + /* Now Super Sample it down */ + + const int Samples=8; + + int DestW=NewWidth; + int DestH=NewHeight; + float YMul=float(Height)/DestH; + float XMul=float(Width)/DestW; + + for (int dy=0;dy1.0f) + R=1.0f; + + if (G>1.0f) + B=1.0f; + + if (B>1.0f) + B=1.0f; + + int DestIndex=(dy*NewWidth+dx); + + FullColNewScreen[DestIndex].Set(R,G,B,A); + } + } + + /* Convert Back to RGBA into a dest byte picture */ + + const float Bound=0.5f; + + for (f=0;f Bound) + { + DestBytePic[f*3+0]=R*255; + DestBytePic[f*3+1]=G*255; + DestBytePic[f*3+2]=B*255; + } + else + { + DestBytePic[f*3+0]=0; + DestBytePic[f*3+1]=0; + DestBytePic[f*3+2]=0; + } + } + + /* Now reduce colours */ + Palette NewPal; + + if (ZeroSeeThrough) + { + int Cols=TargCols-1; + + tquant(&DestBytePic[0],Dest,Pal,Cols,NewWidth*NewHeight); + + for (f=0;f Bound) + Dest[f]=Dest[f]+1; + else + Dest[f]=0; + } + + for (f=1;f Body; + + Frame NewFrame; + + NewFrame=*this; + + Rect OriginalRect; + + OriginalRect=NewFrame; + + OriginalRect.X=0; + OriginalRect.Y=0; + OriginalRect.W=GU_AlignVal(OriginalRect.W,AlignPixels); + + NewFrame.Crop(OriginalRect); + + int nfW,nfH,nfLineWidthBytes,nfAreaBytes; + + nfW=NewFrame.GetWidth(); + nfH=NewFrame.GetHeight(); + nfLineWidthBytes=GU_AlignVal(nfW,2)/2; + nfAreaBytes=nfLineWidthBytes*nfH; + + Body.resize(nfAreaBytes); + + for (int y=0;y OutPal; + MakePSXPal(OutPal); + + Out.Put32(OutPal.size()); + + for (int f=0;f>3; + G=Col.GetG()>>3; + B=Col.GetB()>>3; + return((R&0x1f)<<0)|((G&0x1f)<<5)|((B&0x1f)<<10); +} +/*---------------------------------------------------------------------- + Function: + Purpose: + Params: + Returns: + ---------------------------------------------------------------------- */ +void SprPal::MakePSXPal(std::vector & OutWords) const +{ + + int NumOfCols; + int f; + + NumOfCols=(*this).GetNumOfCols(); + OutWords.resize(NumOfCols); + + if (GetZeroColZero() || GetPlusColZero()) + { + OutWords[0]=0; + + for (f=1;f + +/* Glib + ---- */ +#include +#include +#include +#include + +/* Local + ----- */ +#include "tpage.h" +#include "vimage.h" + + +/*---------------------------------------------------------------------- + Tyepdefs && Defines + ------------------- */ + +/*---------------------------------------------------------------------- + Structure defintions + -------------------- */ + +/* Encapsulates a file and all the infomation parkgrab needs to process it + ----------------------------------------------------------------------- */ +class FileInfo + { + public: + FileInfo(void) + { + CrossHair=false; + ForceOffsets=false; + } + + FileInfo(FileInfo const & Fi) + { + operator=(Fi); + } + + void operator=(FileInfo const & Fi) + { + FileName = Fi.FileName; + strcpy(ActualFileName,Fi.ActualFileName); + CrossHair=Fi.CrossHair; + ZeroColZero = Fi.ZeroColZero; + PlusColZero = Fi.PlusColZero; + MoveUVs = Fi.MoveUVs; + AllowRotate=Fi.AllowRotate; + ForceOffsets=Fi.ForceOffsets; + XOff=Fi.XOff; + YOff=Fi.YOff; + ShrinkToFit=Fi.ShrinkToFit; + m_allocateAs16Bit=Fi.m_allocateAs16Bit; + } + + void SetForceOffsets(int x,int y) + { + ForceOffsets=true; + XOff=x; + YOff=y; + } + + GString CheckForPlus(GString s) + { + GString out; + const char *textin = (const char*)s; + char *textout = new char[s.Len()+1]; + memset(textout, 0, s.Len()+1); + int p; + bool plus; + + p=0; + if (textin[0] == '+') plus = true; + else plus = false; +/* for (i=0; i FIVec; +typedef std::vector::iterator FIVecIt; +typedef std::vector::const_iterator FIVecConstIt; + + +/* A Palette of graphics with sprset specific stuff + ---------------------------------------------- */ +class SprPal : public Palette +{ +public: + SprPal(void) + {} + + SprPal(SprPal const & Pal) + {MakeCopy(Pal);} + + void operator=(SprPal const & Pal) + {MakeCopy(Pal);} + + void operator=(Palette const & Pal) + {Palette::CopyPal(Pal);} + + bool operator==(Palette const & Pal) + {return(Palette::operator==(Pal));} + + bool operator<(SprPal const & Pal) + {return(GetNumOfCols() < Pal.GetNumOfCols());} + + void SetPalIndex(int NewPalIndex) + {PalIndex=NewPalIndex;} + + int GetPalIndex(void) const + {return(PalIndex);} + + void SetVRAMPos(TPRect & NewRect) + { + MyRect=NewRect; + } + + void SetTpBase(int NewTpBase) + { + TpBase=NewTpBase; + BaseTpX=((TpBase&0xf)*64); + BaseTpY=(TpBase>>4)*256; + } + + u16 GetClut(void) + { + int x=(MyRect.X/4)+BaseTpX; + int y=MyRect.Y+BaseTpY; + return((y<<6)|((x>>4)&0x3f)); + } + + TPRect const & GetTPRect(void) const + {return(MyRect);} + + char const * GetName(void) const + {return(Name);} + + void SetName(char const * NewName) + {Name=NewName;} + + void SetZeroColZero(bool New) + {ZeroColZero=New;} + + bool GetZeroColZero(void) const + {return(ZeroColZero);} + + void SetPlusColZero(bool New) + {PlusColZero=New;} + + bool GetPlusColZero(void) const + {return(PlusColZero);} + + void Write(Gofstream & Out) const; + void MakePSXPal(std::vector & OutWord) const; + u16 GetPsxCol(Colour const & Col) const; + +protected: + int PalIndex; + int TpBase; + int BaseTpX; + int BaseTpY; + bool ZeroColZero; + bool PlusColZero; + TPRect MyRect; + GString Name; + + void MakeCopy(SprPal const & NewPal) + { + Palette::CopyPal(NewPal); + PalIndex=NewPal.PalIndex; + TpBase=NewPal.TpBase; + BaseTpX=NewPal.BaseTpX; + BaseTpY=NewPal.BaseTpY; + MyRect=NewPal.MyRect; + Name=NewPal.Name; + ZeroColZero=NewPal.ZeroColZero; + PlusColZero=NewPal.PlusColZero; + } +}; + +/* A Frame of graphics with sprset specific stuff + ---------------------------------------------- */ +class SprFrame : public Frame +{ +public: + enum BDEPTH + { + BITS_4, + BITS_8, + }; + + SprFrame(void); + SprFrame(SprFrame const & NewFrame) + {MakeCopy(NewFrame);} + + void operator=(SprFrame const & NewFrame) + {MakeCopy(NewFrame);} + + void SetFrameAndInfo(Frame const & Fr,FileInfo const & MyFileInfo,int MaxSize); + FileInfo * GetFileInfo(void) + { + return (&MyFileInfo); + } + + void Process(void); + + void SetPalIndex(int NewPalIndex) + {PalIndex=NewPalIndex;} + + int GetPalIndex(void) const + {return(PalIndex);} + + void SetVRAMPos(TPRect const & Rect); + + BDEPTH GetBitDepth(void) const + { + BDEPTH RetDepth; + int NumOfCols; + + NumOfCols=MyPal.GetNumOfCols(); + + if (NumOfCols<=16) + RetDepth=BITS_4; + else + RetDepth=BITS_8; + + return(RetDepth); + } + + TPRect const & GetTPRect(void) const + {return(MyRect);} + + bool IsRotated(void) const + {return(MyRect.GetRotate());} + + void SetTpBase(int NewTpBase) + { + TpBase=NewTpBase; + BaseTpX=((TpBase&0xf)*64); + BaseTpY=(TpBase>>4)*256; + } + + void SetClut(u16 NewClut) + {Clut=NewClut;} + + u16 GetClut(void) const + {return(Clut);} + + void WriteHeader(Gofstream & Out); + + bool GetZeroColZero(void) const + {return(MyFileInfo.GetZeroColZero());} + + bool GetPlusColZero(void) const + {return(MyFileInfo.GetPlusColZero());} + + bool GetAllowRotate(void) const + {return(MyFileInfo.GetAllowRotate());} + + + void Write(Gofstream & Out) const; + + void WriteHeaderNotInVram(Gofstream & Out); + + + int getV(void) + {return(MyRect.X&0xff);} + + int getU(void) + { + u16 tpage; + int u; + int pageX; + + tpage=GetTpage(); + pageX=(tpage&0xf)*256; + u=MyRect.X-pageX; + + switch(GetBitDepth()) + { + case BITS_8: + u/=2; + break; + } + + return(u); + } + + u16 GetTpage(void) + { + int tp; + BDEPTH RetDepth; + + RetDepth=GetBitDepth(); + + int abr=0; + int x=BaseTpX + (MyRect.X/4); //MA + int y=BaseTpY + MyRect.Y; //MA + + switch(RetDepth) + { + case BITS_4: + tp=0; + break; + case BITS_8: + tp=1; + break; + } + + return((((tp)&0x3)<<7)|(((abr)&0x3)<<5)|(((y)&0x100)>>4)|(((x)&0x3ff)>>6)| (((y)&0x200)<<2)); + } + + bool IsAnimated() + { + return(MyFileInfo.getAllocateAs16Bit()); + } +protected: + void ResizeAndReduce(Frame & Frm,int TargCols,float XPerc,float YPerc,bool ZeroSeeThrough); + + + void MakeCopy(SprFrame const & NewFrame) + { + Frame::CopyFrame(NewFrame); + + Clut=NewFrame.Clut; + TpBase=NewFrame.TpBase; + BaseTpX=NewFrame.BaseTpX; + BaseTpY=NewFrame.BaseTpY; + PalIndex=NewFrame.PalIndex; + MyFileInfo=NewFrame.MyFileInfo; + MyRect=NewFrame.MyRect; + } + + + u16 Clut; + int TpBase; + int BaseTpX; + int BaseTpY; + + GString loadFileName; + + int PalIndex; + FileInfo MyFileInfo; + TPRect MyRect; +}; + +/* A collection of sprites + ----------------------- */ +class SprSet : protected GObject +{ +public: + SprSet(void) + { + Vi=NULL; + MaxSize=0; + } + + void SetMaxSize(int New) + {MaxSize=New;} + + void AddFiles(FIVec const & FileList); + + void Write(char const * FileName,int TpNumber,int WidthInTpages,int HeightInTpages); + void WriteLBM(char const * FileName); + void WriteSprFile(char const * Name); + void WriteReport(char const * Name); + void writeRawTPage(char const * File); + void SetIncOutFile(char const * NewIncOutFile) + {IncOutFile=NewIncOutFile;IncOutFile.Lower();} + + void setAnimatedHeader(bool newVal) + {m_AnimatedHeadersOnly=newVal;} + + void setDontOutputBoxes(bool newVal) + {m_DontOutputBoxes=newVal;} + + void setAlignHeaders(bool newVal) + {m_AlignHeaders=newVal;} + + void setHalfTpage(bool newVal) + {m_halfTpage=newVal;} + + void setCompressTpages(bool newVal) + {m_compressTpages=newVal;} + + void setNoWriteTpages(bool newVal) + {m_noWriteTpages=newVal;} + +protected: + void WriteHeaderFile(char const * HName); + + void ProcessPals(void); + void AddFile(FileInfo const & ThisInfo); + void AddAnm(FileInfo const & ThisInfo); + void AddLbm(FileInfo const & ThisInfo); + void AddFrame(Frame const & Fr,FileInfo const & ThisInfo); + + void AddFramesAndPalsToVRAM(VRAM & Vr,int TpNumber,int WidthInTpages,int HeightInPixels); + + GString GetHeaderFileName(char const * File); + + + typedef std::vector SprFrVec; + typedef std::vector::iterator SprFrIt; + + typedef std::vector SprPalVec; + typedef std::vector::iterator SprPalVecIt; + + GString IncOutFile; + + bool m_AnimatedHeadersOnly; + bool m_DontOutputBoxes; + bool m_AlignHeaders; + bool m_halfTpage; + bool m_compressTpages; + bool m_noWriteTpages; + + SprFrVec AllSprFrames; + SprPalVec AllSprPals; + VRAMImage * Vi; + + int MaxSize; +}; + +/*---------------------------------------------------------------------- + Globals + ------- */ + +/* Vars + ---- */ + +/* Data + ---- */ + +/* Functions + --------- */ + +/*---------------------------------------------------------------------- */ + +#else /* __SPRSET_H__ */ + +class SprPal; +class SprFrame; + +#endif + +/*=========================================================================== + end */ diff --git a/Utils/parkgrab/tpage.cpp b/Utils/parkgrab/tpage.cpp new file mode 100644 index 000000000..84921f5c6 --- /dev/null +++ b/Utils/parkgrab/tpage.cpp @@ -0,0 +1,857 @@ +/*========================================================================= + + FILENAME.CPP + + Author: Gary Liddon @ + Created: + Project: + Purpose: + + Copyright (c) 1997 Climax Development Ltd + +===========================================================================*/ + +/*---------------------------------------------------------------------- + Includes + -------- */ + +/* Std Lib + ------- */ +#include +#include "conio.h" + +/* Glib + ---- */ +#include "gutils.h" + +/* Local + ----- */ +#include "tpage.h" +#include "grect.h" + +/* Graphics + -------- */ + +/*---------------------------------------------------------------------- + Tyepdefs && Defines + ------------------- */ + +using namespace std; + + +/*---------------------------------------------------------------------- + Structure defintions + -------------------- */ +struct TPInfo +{ + int XAlign; + int TpWidth; + int BorderX; + int BorderY; +}; + +/* Information about where I can place this frame in the Tpage + ----------------------------------------------------------- */ +/*---------------------------------------------------------------------- + Vars + ---- */ +static TPInfo const InfStruct[TP_NUM_OF_TP_TYPES]= +{ + {1,256,1,1}, /* TP_4 */ + {2,512,2,1}, /* TP_8 */ + {4,256,4,1}, /* TP_16 */ + {0,0,0,0}, /* TP_SCREEN */ + {16*4,1024*4,0,0}, /* TP_PAL */ +}; + +/*---------------------------------------------------------------------- + Function Prototypes + ------------------- */ + +/*---------------------------------------------------------------------- + Vars + ---- */ +int TPRect::W2Alloc=1; +int TPRect::H2Alloc=1; + +/*---------------------------------------------------------------------- + Data + ---- */ + +/*---------------------------------------------------------------------- + Function: + Purpose: + Params: + Returns: + ---------------------------------------------------------------------- */ +VRAM::VRAM(int nTpWidth,int nTpHeightInPixels) +{ + Big2Little=false; + RotateEveryEmpty=false; + + + TpWidth=-1; + TpHeightInPixels=-1; + + Clear(nTpWidth,nTpHeightInPixels); +} + +void VRAM::Clear(int nTpWidth,int nTpHeightInPixels) +{ + if (nTpWidth >= 0 ) + TpWidth=nTpWidth; + + if (nTpHeightInPixels >= 0) + TpHeightInPixels=nTpHeightInPixels; + + InitEmpty(0,0,TpWidth*256,TpHeightInPixels); +} + + +/*---------------------------------------------------------------------- + Function: void VRAM::InitEmpty(void) + Purpose: Initialise the VRAM as empty + Params: + Returns: + ---------------------------------------------------------------------- */ +void VRAM::InitEmpty(int vX,int vY,int nW,int nH) +{ + const int Width16=256; + const int Height16=256; + + W=nW; + H=nH; + X=vX; + Y=vY; + + VRAMWidthPages=W/Width16; + VRAMHeightPages=H/Height16; + + if (!VRAMHeightPages) + { + VRAMHeightPages = 1; + } + + NumOfTPages=VRAMWidthPages*VRAMHeightPages; + + VecOfPages.resize(NumOfTPages,TPRectList()); + + Unused.reserve(4000); + Used.reserve(2000); + + Unused.resize(0); + Used.resize(0); + + for (int f=0;fXAlign; + + WorkingWidth=GU_AlignVal(ThisRect.W,Pi.XAlign); + + Pi.MinX=Tpi->BorderX; + Pi.MinY=Tpi->BorderY; + Pi.MaxX=W-Tpi->BorderX-WorkingWidth; + Pi.MaxY=H-Tpi->BorderY-ThisRect.H; + + Pi.TpWidthPix=Tpi->TpWidth; + + Pi.MinXTp=Tpi->BorderX; + Pi.MaxXTp=Tpi->TpWidth-Tpi->BorderX-WorkingWidth; + + Pi.MinYTp=Tpi->BorderY; + Pi.MaxYTp=(256-Tpi->BorderY)-ThisRect.H; +} + +bool VRAM::TryRect(TPRect & BlankRect,TPRect & ThisRect) +{ + POS_INFO Pi; + PosFromTPrect(ThisRect,Pi); + + int MinTpX=Pi.MinXTp+(BlankRect.X/Pi.TpWidthPix)*Pi.TpWidthPix; + int MaxTpX=Pi.MaxXTp+(BlankRect.X/Pi.TpWidthPix)*Pi.TpWidthPix; + int MinTpY=Pi.MinYTp+(BlankRect.Y/256)*256; + int MaxTpY=Pi.MaxYTp+(BlankRect.Y/256)*256; + + /* Move to avoid edges of the map */ + int MinX = MinTpX > Pi.MinX ? MinTpX : Pi.MinX; + int MaxX = MaxTpX < Pi.MaxX ? MaxTpX : Pi.MaxX; + int MinY = MinTpY > Pi.MinY ? MinTpY : Pi.MinY; + int MaxY = MaxTpY < Pi.MaxY ? MaxTpY : Pi.MaxY; + + int ThisX=GU_AlignVal(BlankRect.X,Pi.XAlign); + int ThisY=BlankRect.Y; + + if (ThisXMaxX) + return(false); + + if (ThisYMaxY) + return(false); + + ThisRect.SetXY(ThisX,ThisY); + + if (!InColisionWithUsed(ThisRect)) + { + RemovedFromUnused(ThisRect); + AddToUsed(ThisRect); + return(true); + } + + return(false); +} + +/*---------------------------------------------------------------------- + Function: TPRect VRAM::AllocVRAM(TPageType nType,int nW,int nH,bool Rotated) + Purpose: + Params: + Returns: + ---------------------------------------------------------------------- */ + +class Predicate +{ +public: + bool operator()(TPRect const & R1,TPRect const & R2) const + { + u32 R1Val=(R1.H<<16)|(R1.W); + u32 R2Val=(R2.H<<16)|(R2.W); + return (R1ValR2Val); + } +}; + +/*---------------------------------------------------------------------- + Function: TPRect VRAM::AllocVRAM(TpRectVec & RectVec) + Purpose: + Params: + Returns: + ---------------------------------------------------------------------- */ +bool VRAM::AllocVRAM(TPRectVec & RectVec,bool nRotateEveryEmpty,bool nBig2Little,bool nWiderThanHigher) +{ + int f; + + RotateEveryEmpty=nRotateEveryEmpty; + Big2Little=nBig2Little; + WiderThanHigher=nWiderThanHigher; + + if (WiderThanHigher) + { + for (f=0;f RectVec[f].W) && CanRotate(RectVec[f])) + RectVec[f].SetRotate(!RectVec[f].GetRotate()); + } + } + + if (!Big2Little) + std::sort(RectVec.begin(),RectVec.end(),Predicate()); + else + std::sort(RectVec.begin(),RectVec.end(),Predicate2()); + + bool AllocedEverything=true; + + for (f=0;f + +/* Glib + ---- */ +#include + +/* Local + ----- */ + +/*---------------------------------------------------------------------- + Tyepdefs && Defines + ------------------- */ + +/*---------------------------------------------------------------------- + Structure defintions + -------------------- */ +struct POS_INFO +{ + int MinXTp; /* Minimum x placeable within a Tpage */ + int MaxXTp; /* Maximum x placeable within a Tpage */ + + int MinYTp; /* Minimum y placeable within a Tpage */ + int MaxYTp; /* Maximum y placeable within a Tpage */ + + int MinX; /* Minimum global x */ + int MaxX; /* Maximum global x */ + + int MinY; /* Minimum global y */ + int MaxY; /* Maximum global y */ + + int XAlign; /* X Alignment */ + int TpWidthPix; /* Width of each tpages for this rect */ +}; + + +/* Different Tpage Types + --------------------- */ +enum TPageType +{ + TP_4= 0, + TP_8, + TP_16, + TP_SCREEN, + TP_PAL, + TP_NUM_OF_TP_TYPES, +}; + + +/* A Rectangle in the Tpage + ------------------------ */ +class TPRect : public Rect +{ +public: + TPRect(void); + TPRect(TPageType nType,int nW,int nH); + TPRect(TPRect const & NewR) {MakeCopy(NewR);} + + void InitFromFrame(Frame const & Fr); + void SetAlloced(bool nAlloced=true); + bool SetRotate(bool Rot=true); + void operator=(TPRect const & NewR) {MakeCopy(NewR);} + bool operator< (TPRect const & R) const {return(GetId() TPRectVec; + +/* VRAM + ---- */ + +typedef std::list TPRectList; +typedef std::vector TPRectListVec; + +class VRAM : public GObject +{ +public: + VRAM(int nTpWidth=16,int nTpHeightInPixels=512); + + int GetNumOfItems(void); + int GetNumOfUsedPages(); + + bool AllocVRAM(TPRect & OriginalRect); + bool AllocVRAM(TPRectVec & RectVec,bool nRotateEveryEmpty,bool nBig2Little,bool nWiderThanHigher); + + TPRect const & GetVRAM(VHND hnd) const; + + TPRectVec & GetUsed(void) + {return(Used);} + + TPRectVec & GetUnused(void) + {return(Unused);} + + void Clear(int nTpWidth=-1,int nTpHeight=-1); + + void SetBig2Little(bool Val=true) + { Big2Little=Val;} + + void SetRotateEveryEmpty(bool Val=true) + { RotateEveryEmpty=Val;} + + bool CanRotate(TPRect & ThisRect); + + void getUnusedSpace(TPRectVec & unusedBoxes); + +protected: + void PosFromTPrect(TPRect & ThisRect,POS_INFO & Pi); + bool TryRect(TPRect & BlankRect,TPRect & ThisRect); + + TPRectListVec VecOfPages; + + bool TryNFit(TPRectList & TpList,TPRect & ThisRect); + + void AddEmpty(int x,int y,int w,int h); + bool InColisionWithUsed(TPRect const & R); + void InitEmpty(int vX,int vY,int W,int H); + bool CheckValidAlloc(TPageType nType,int nW,int nH); + int GetXAlign(TPageType nType); + int GetMaxWidthTp(TPageType nType); + void RemovedFromUnused(TPRect const & ThisRect); + void AddToUsed(TPRect const & ThisRect); + void RectFromTpRect(Rect & R,TPRect const & ThisRect); + + TPRect & NewItem(TPRectVec & TPRects); + + TPRect & NewUnused(void) + { return(NewItem(Unused)); } + + TPRect & NewUsed(void) + { return(NewItem(Used)); } + + + TPRectVec Unused; + TPRectVec Used; + TPRect ErrorRect; + + int X,Y,W,H; + int NumOfTPages; + int TpWidth; + int TpHeightInPixels; + + int VRAMWidthPages; + int VRAMHeightPages; + + bool Big2Little; + bool RotateEveryEmpty; + bool WiderThanHigher; +}; + +/* Error codes for VHND + -------------------- */ +enum +{ + VHND_NULL = -1, +}; + +/*---------------------------------------------------------------------- + Globals + ------- */ + +/* Vars + ---- */ + +/* Data + ---- */ + +/* Functions + --------- */ +void TestTPageStuff(void); + +/*---------------------------------------------------------------------- */ + +#endif /* __TPAGE_HPP__ */ + +/*=========================================================================== + end */ + + diff --git a/Utils/parkgrab/vimage.h b/Utils/parkgrab/vimage.h new file mode 100644 index 000000000..43a1d4b43 --- /dev/null +++ b/Utils/parkgrab/vimage.h @@ -0,0 +1,103 @@ +/*========================================================================= + + VIMAGE.CPP + + Author: Gary Liddon @ Climax + Created: + Project: TPW Parkgrab + Purpose: An object that represents a bit of VRAM + + Copyright (c) 1998 G R Liddon + +===========================================================================*/ + +#ifndef __VIMAGE_H__ +#define __VIMAGE_H__ + +/*---------------------------------------------------------------------- + Includes + -------- */ + +/* Std Lib + ------- */ + +/* Glib + ---- */ +#include +#include + +/* Local + ----- */ +#include "sprset.h" + +/*---------------------------------------------------------------------- + Tyepdefs && Defines + ------------------- */ + +/*---------------------------------------------------------------------- + Structure defintions + -------------------- */ + +class VRAMImage : protected GObject +{ +public: + + VRAMImage(int NewWidthInTpages,int NewHeightInPixels); + ~VRAMImage(void); + + void WriteInTpageChunks(std::ofstream & Str); + void Write(std::ofstream & Str); + void PlotPal(SprPal const & PalToPlot); + void PlotFrame(SprFrame const & FrameToPlot); + void SaveAs16ColLbm(const char * Name); + + void setDoCompress(bool newVal) + {m_doCompress=newVal;} + + bool getDoCompress(void) const + {return(m_doCompress);} + + void getTpData(unsigned int tp,std::vector & dest) const; + +protected: + void PlotFrame4(SprFrame const & Fr); + void PlotFrame8(SprFrame const & Fr); + u16 GetPsxCol(Colour const & Col) const; + + int WidthInBytes; + int WidthInTpages; + int HeightInTPages; + int HeightInPixels; + int aTPageHeight; + int TPageSizeInBytes; + int VramAreaBytes; + bool m_doCompress; + + u8 * lbmData; + u8 * VRAMData; +}; + + +/*---------------------------------------------------------------------- + Globals + ------- */ + +/* Vars + ---- */ + +/* Data + ---- */ + +/* Functions + --------- */ + +/*---------------------------------------------------------------------- */ + +#else /* __VIMAGE_H__ */ + +class VRAMImage; + +#endif + +/*=========================================================================== + end */ diff --git a/Utils/transtext/kanjiclass.cpp b/Utils/transtext/kanjiclass.cpp new file mode 100644 index 000000000..5706b4b58 --- /dev/null +++ b/Utils/transtext/kanjiclass.cpp @@ -0,0 +1,1022 @@ +/*========================================================================= + + KANJICLASS.CPP + + Author: Gary Liddon @ + Created: + Project: + Purpose: + + Copyright (c) 1998 G R Liddon + +===========================================================================*/ + +/*---------------------------------------------------------------------- + Includes + -------- */ + +#include "kanjiclass.h" + +/* Std Lib + ------- */ +#include + +/* Glib + ---- */ +#include +#include + +/* Local + ----- */ + +using namespace std; + +/*---------------------------------------------------------------------- + Tyepdefs && Defines + ------------------- */ +#include "fontdata/got11j0b.h" +#include "fontdata/got11j1b.h" +#include "fontdata/got13j0b.h" +#include "fontdata/got13j1b.h" +#include "fontdata/got15j0b.h" +#include "fontdata/got15j1b.h" +#include "fontdata/got15gai.h" + +/*---------------------------------------------------------------------- + Tyepdefs && Defines + ------------------- */ +static int const kanjiAddr0[3]= +{ + u32(got11j0b), + u32(got13j0b), + u32(got15j0b), +}; + +static int const kanjiAddr1[3]= +{ + u32(got11j1b), + u32(got13j1b), + u32(got15j1b), +}; + +static int const kanjiAddrG[3]= +{ + u32(0), + u32(0), + u32(got15gai), +}; + +static int const dotSize[3]={11,13,15}; + +/*---------------------------------------------------------------------- + Structure defintions + -------------------- */ +struct SjisS +{ + char Ascii; + unsigned char Num; + unsigned short Sjis; + char const * name; +}; + +/*---------------------------------------------------------------------- + Function Prototypes + ------------------- */ +static void dekan(u8 *ptr,u8 *buf,int dot); +static long kanjiTest( u8 const *sjis,KanjiClass::KanjiFontSize k = KanjiClass::FONT_SIZE_11); +static int kanjiTrans(u16 scode); +static void ascii2SJIS(u8 *dest,u8 const *src); +static void ascii2SJIS(u8 *dest,u8 Ascii); +static GString makeName(char const * dir,int frameNumber); + + + +/*---------------------------------------------------------------------- + Vars + ---- */ + +/*---------------------------------------------------------------------- + Data + ---- */ + +static SjisS SjisTable[]= +{ + {'0',10, 0x824f,"num" },{'A',26, 0x8260,"upper_case" },{'a',26, 0x8281,"lower_case" }, + {' ', 1,0x8140,"space"},{'!', 1,0x8149,"exclamation",},{'"', 1,0x8168,"double_quote"},{'#', 1,0x8194,"hash",},{'$', 1,0x8190,"dollar"}, + {'%', 1,0x8193,"percent"},{'&', 1,0x8195,"and"},{'\'',1,0x8166,"single_quote"},{'(', 1,0x8169,"open_bracket"},{')', 1,0x816a,"close_bracket"}, + {'*', 1,0x8196,"star"},{'+', 1,0x817b,"plus",},{',', 1,0x8143,"comma",},{'-', 1,0x817c,"minus"},{'.', 1,0x8144,"period"}, + {'/', 1,0x815e,"forward_slash"},{':', 1,0x8146,"colon"},{';', 1,0x8147,"semi_colon"},{'<', 1,0x8171,"less_than"},{'=', 1,0x8181,"equals"}, + {'>', 1,0x8172,"greater_than"},{'?', 1,0x8148,"question_mark"},{'@', 1,0x8197,"ampersand"},{'[', 1,0x816d,"open_square_brace"},{'\\',1,0x818f,"back_slash"}, + {']', 1,0x816e,"close_square_brace"},{'^', 1,0x814f,"carrat"},{'_', 1,0x8151,"underscore"},{'`', 1,0x8165,"other_quote"},{'{', 1,0x816f,"open_brace"}, + {'|', 1,0x8162,"or"},{'}', 1,0x8170,"close_brace"},{'~', 1,0x8150,"tilde"},{0,0,0,NULL} +}; + +/* + * sjis code to access number transfer table (non-Kanji) + */ +static unsigned short kanji_0_table[19][2] = { + {0x8140, 0}, + {0x8180, 63}, + {0x81b8, 108}, + {0x81c8, 116}, + {0x81da, 123}, + {0x81f0, 138}, + {0x81fc, 146}, + + {0x824f, 147}, + {0x8260, 157}, + {0x8281, 183}, + {0x829f, 209}, + {0x8340, 292}, + {0x8380, 355}, + + {0x839f, 378}, + {0x83bf, 402}, + {0x8440, 426}, + {0x8470, 459}, + {0x8480, 474}, + {0x849f, 492} +}; + +/* + * sjis code to access number transfer table (user defined characters) + */ +static unsigned short kanji_g_table[19][2] = { + {0x8540, 0}, + {0x8546, 5}, + {0x8548, 6}, + {0x854b, 8}, + {0x8550, 9}, + + {0x85a0, 21}, + {0x85b0, 34}, + + {0x8640, 47}, + {0x8643, 49}, + {0x8645, 50}, + {0x8647, 51}, + {0x864a, 53}, + {0x864e, 56}, + {0x8660, 58}, + + {0x869f, 74}, + {0x86b8, 98}, + {0x8740, 160}, + {0x875c, 187}, + {0x8764, 194}, +}; + +/* + * sjis code to access number transfer table (First level Kanji) + */ +static unsigned short kanji_1_table[32][2] = { + {0x889f, 0}, + {0x8940, 94}, + {0x899f, 188}, + {0x8a40, 282}, + {0x8a9f, 376}, + {0x8b40, 470}, + {0x8b9f, 564}, + {0x8c40, 658}, + {0x8c9f, 752}, + {0x8d40, 846}, + {0x8d9f, 940}, + {0x8e40, 1034}, + {0x8e9f, 1128}, + {0x8f40, 1222}, + {0x8f9f, 1316}, + {0x9040, 1410}, + {0x909f, 1504}, + {0x9140, 1598}, + {0x919f, 1692}, + {0x9240, 1786}, + {0x929f, 1880}, + {0x9340, 1974}, + {0x939f, 2068}, + {0x9440, 2162}, + {0x949f, 2256}, + {0x9540, 2350}, + {0x959f, 2444}, + {0x9640, 2538}, + {0x969f, 2632}, + {0x9740, 2726}, + {0x979f, 2820}, + {0x9840, 2914} +}; + +/* + * sjis code to access number transfer table (Second level Kanji) + */ +static unsigned short kanji_2_table[37][2] = { + {0x989f, 0}, + {0x9940, 94}, + {0x999f, 188}, + {0x9a40, 282}, + {0x9a9f, 376}, + {0x9b40, 470}, + {0x9b9f, 564}, + {0x9c40, 658}, + {0x9c9f, 752}, + {0x9d40, 846}, + {0x9d9f, 940}, + {0x9e40, 1034}, + {0x9e9f, 1128}, + {0x9f40, 1222}, + {0x9f9f, 1316}, + {0xe040, 1410}, + {0xe09f, 1504}, + {0xe140, 1598}, + {0xe19f, 1692}, + {0xe240, 1786}, + {0xe29f, 1880}, + {0xe340, 1974}, + {0xe39f, 2068}, + {0xe440, 2162}, + {0xe49f, 2256}, + {0xe540, 2350}, + {0xe59f, 2444}, + {0xe640, 2538}, + {0xe69f, 2632}, + {0xe740, 2726}, + {0xe79f, 2820}, + {0xe840, 2914}, + {0xe89f, 3008}, + {0xe940, 3102}, + {0xe99f, 3196}, + {0xea40, 3290}, + {0xea9f, 3384} +}; + +/* + * sjis code to access number transfer table (Vertical writing) + */ +static unsigned short kanji_t_table[2][2] = { + {0xeb40, 0}, + {0xeb42, 4} +}; + + + +/*---------------------------------------------------------------------- + Function: + Purpose: + Params: + Returns: + ---------------------------------------------------------------------- */ +static GString makeName(char const * dir,int frameNumber) +{ + char tempBuff[1024]; + + sprintf(tempBuff,"%s\\%04d.lbm",dir,frameNumber); + return(tempBuff); +} + + +/*---------------------------------------------------------------------- + Function: + Purpose: + Params: + Returns: + ---------------------------------------------------------------------- */ +void KanjiClass::writeEnglishFontLbms(char const * _dir,KanjiFontSize k,char const * repFile) +{ + SjisS * jisTab; + + jisTab=SjisTable; + + GString dir; + + dir=_dir; + dir+="\\"; + + vector allLbms; + + while (jisTab->name) + { + u16 num; + GString name; + GString fileName; + + num=jisTab->Sjis; + name=jisTab->name; + fileName=dir+name; + + if (jisTab->Num != 1) + { + for (int f=0;fNum;f++) + { + char saveName[300]; + + sprintf(saveName,"%s_%c.lbm",(char const *)fileName,jisTab->Ascii+f); + + saveKanjiLbm(saveName,k,num); + allLbms.push_back(saveName); + num++; + } + } + else + { + GString saveName; + saveName=fileName; + saveName+=".lbm"; + saveKanjiLbm(saveName,k,num); + allLbms.push_back(saveName); + } + + jisTab++; + } + + if (repFile) + { + ofstream out; + + out.open(repFile,ios::out|ios::trunc); + + if (out) + { + for (int f=0;f=0x8140 && kan<=0x84be) + kan-=0x8140; + else + { + if(kan>=0x8540 && kan<=0x8796) + { + kan-=0x8540; + kan+=((0x84be-0x8140)+1); + } + else + { + if(kan>=0x889f && kan<=0x9872) + { + kan-=0x889f; + kan+=((0x84be-0x8140)+1); + kan+=((0x8796-0x8540)+1); + } + else + Error(ERR_FATAL,"illegal kanji char"); + } + } + return kan; +} + +/*---------------------------------------------------------------------- + Function: + Purpose: + Params: + Returns: + ---------------------------------------------------------------------- */ +void KanjiClass::saveKanjiTable(char const *name) +{ + int num,highest; + + num=0; + highest=0; + + vector kanjiChars; + kanjiChars.resize(256*256); + + for (int f=0;f<256*256;f++) + kanjiChars[f]=-1; + + for(int l=0;l<256;l++) + { + for(int h=0;h<256;h++) + { + if(getKanjiHit(h,l)) + { + u16 kan; + int val; + + + kan=(h<<8)|l; + + + val=findKanjiIndex(kan); + kanjiChars[val]=num; + + if (val > highest) + highest=val; + + num++; + } + } + } + + cout<<"highest is "<>8; + kbuff[1]=kan&0xff; + + + addr=kanjiTest((u8 *)&kbuff,k); + + if(addr!=-1) + { + const int PLOT_X = 100; + const int PLOT_Y = 100; + int dot; + + dot=dotSize[k]; + + memset(buff,0,sizeof(buff)); + dekan((u8*)addr,(u8*)&buff,dot); + + Frame myFrame; + Frame topFrame; + Palette myPal; + + for (int f=0;f<256;f++) + myPal[f].SetRGB(255,255,0); + + myPal[0].SetRGB(255,0,0); + myPal[1].SetRGB(255,255,255); + myPal[2].SetRGB(0,0,0); + myPal[3].SetRGB(64,64,64); + myPal[255].SetRGB(255,0,255); + + myFrame.SetFrame((u8*)buff,16,dot,myPal); + topFrame=myFrame; + + myFrame.Resize(32,dot+2); + myFrame.Clear(0); + + + topFrame.ReplaceColour(1,3); + topFrame.PlotTrans(myFrame,0,0); + topFrame.PlotTrans(myFrame,2,0); + topFrame.PlotTrans(myFrame,0,2); + topFrame.PlotTrans(myFrame,2,2); + + topFrame.ReplaceColour(3,2); + topFrame.PlotTrans(myFrame,1,0); + topFrame.PlotTrans(myFrame,1,2); + topFrame.PlotTrans(myFrame,0,1); + topFrame.PlotTrans(myFrame,2,1); + + topFrame.ReplaceColour(2,1); + topFrame.PlotTrans(myFrame,1,1); + + Rect myRect; + + + myRect=topFrame.FindBoundingRect(); + + topFrame.Resize(256,200); + topFrame.Clear(0); + topFrame.DrawBox(Rect(100,0,1,200),255); + topFrame.DrawBox(Rect(0,100,200,1),255); + myFrame.PlotTrans(topFrame,100-myRect.X,(100-dot)); + + topFrame.SaveLbm(fileName); + + cout<<"saved "<=256) + GObject::Error(ERR_FATAL,"high char too big"); + if(lo>=256) + GObject::Error(ERR_FATAL,"low char too big"); +} + +void KanjiClass::addKanjiHit(uint hi,uint lo) +{ + if(!hi && !lo) + { + GObject::Error(ERR_FATAL,"passed a bad kanji code"); + } + + checkKanjiCode(hi,lo); + m_kanjiHit[hi*256+lo]=1; +} + +bool KanjiClass::getKanjiHit(uint hi,uint lo) +{ + checkKanjiCode(hi,lo); + return(m_kanjiHit[hi*256+lo]!=0); +} + +void KanjiClass::clearKanjiHit(uint hi,uint lo) +{ + checkKanjiCode(hi,lo); + m_kanjiHit[hi*256+lo]=0; +} + + +/*---------------------------------------------------------------------- + Function: + Purpose: + Params: + Returns: + ---------------------------------------------------------------------- */ +void ascii2SJIS(u8 *dest,u8 const *src) +{ + while (*src) + { + if ((src[0])&0x80) + { + *dest++=*src++; + *dest++=*src++; + } + else + { + ascii2SJIS(dest,*src); + src++; + dest+=2; + } + } + + *dest++=0; +} + + +/*---------------------------------------------------------------------- + Function: + Purpose: + Params: + Returns: + ---------------------------------------------------------------------- */ +int kanjiTrans(u16 scode) +{ + int ret = 0; + u8 ss[2]; + u8 stmp; + + ss[0]=scode&0xff; + ss[1]=scode>>8&0xff; + //bcopy(&scode, ss, 2); + + switch(ss[1]) + { + case 0x81: + if ((ss[0] >= 0x40) && (ss[0] <= 0x7e)) + stmp = 0; + else + if ((ss[0] >= 0x80) && (ss[0] <= 0xac)) + stmp = 1; + else + if ((ss[0] >= 0xb8) && (ss[0] <= 0xbf)) + stmp = 2; + else + if ((ss[0] >= 0xc8) && (ss[0] <= 0xce)) + stmp = 3; + else + if ((ss[0] >= 0xda) && (ss[0] <= 0xe8)) + stmp = 4; + else + if ((ss[0] >= 0xf0) && (ss[0] <= 0xf7)) + stmp = 5; + else + if (ss[0] == 0xfc) + stmp = 6; + else { + ret = -1; + break; + } + ret = scode - kanji_0_table[stmp][0] + kanji_0_table[stmp][1]; + break; + + case 0x82: + if ((ss[0] >= 0x4f) && (ss[0] <= 0x58)) + stmp = 7; + else + if ((ss[0] >= 0x60) && (ss[0] <= 0x79)) + stmp = 8; + else + if ((ss[0] >= 0x81) && (ss[0] <= 0x9a)) + stmp = 9; + else + if ((ss[0] >= 0x9f) && (ss[0] <= 0xf1)) + stmp = 10; + else { + ret = -1; + break; + } + ret = scode - kanji_0_table[stmp][0] + kanji_0_table[stmp][1]; + break; + + case 0x83: + if ((ss[0] >= 0x40) && (ss[0] <= 0x7e)) + stmp = 11; + else + if ((ss[0] >= 0x80) && (ss[0] <= 0x96)) + stmp = 12; + else + if ((ss[0] >= 0x9f) && (ss[0] <= 0xb6)) + stmp = 13; + else + if ((ss[0] >= 0xbf) && (ss[0] <= 0xd6)) + stmp = 14; + else { + ret = -1; + break; + } + ret = scode - kanji_0_table[stmp][0] + kanji_0_table[stmp][1]; + break; + + case 0x84: + if ((ss[0] >= 0x40) && (ss[0] <= 0x60)) + stmp = 15; + else + if ((ss[0] >= 0x70) && (ss[0] <= 0x7e)) + stmp = 16; + else + if ((ss[0] >= 0x80) && (ss[0] <= 0x91)) + stmp = 17; + else + if ((ss[0] >= 0x9f) && (ss[0] <= 0xbe)) + stmp = 18; + ret = scode - kanji_0_table[stmp][0] + kanji_0_table[stmp][1]; + break; + + case 0x85: + if ((ss[0] >= 0x40) && (ss[0] <= 0x44)) + stmp = 0; + else + if (ss[0] == 0x46) + stmp = 1; + else + if ((ss[0] >= 0x48) && (ss[0] <= 0x49)) + stmp = 2; + else + if (ss[0] == 0x4b) + stmp = 3; + else + if ((ss[0] >= 0x50) && (ss[0] <= 0x5b)) + stmp = 4; + else + if ((ss[0] >= 0xa0) && (ss[0] <= 0xac)) + stmp = 5; + else + if ((ss[0] >= 0xb0) && (ss[0] <= 0xbc)) + stmp = 6; + else { + ret = -1; + break; + } + ret = scode - kanji_g_table[stmp][0] + kanji_g_table[stmp][1]; + break; + + case 0x86: + if ((ss[0] >= 0x40) && (ss[0] <= 0x41)) + stmp = 7; + else + if (ss[0] == 0x43) + stmp = 8; + else + if (ss[0] == 0x45) + stmp = 9; + else + if ((ss[0] >= 0x47) && (ss[0] <= 0x48)) + stmp = 10; + else + if ((ss[0] >= 0x4a) && (ss[0] <= 0x4c)) + stmp = 11; + else + if ((ss[0] >= 0x4e) && (ss[0] <= 0x4f)) + stmp = 12; + else + if ((ss[0] >= 0x60) && (ss[0] <= 0x6f)) + stmp = 13; + else + if ((ss[0] >= 0x9f) && (ss[0] <= 0xb6)) + stmp = 14; + else + if ((ss[0] >= 0xb8) && (ss[0] <= 0xf5)) + stmp = 15; + else { + ret = -1; + break; + } + ret = scode - kanji_g_table[stmp][0] + kanji_g_table[stmp][1]; + break; + + case 0x87: + if ((ss[0] >= 0x40) && (ss[0] <= 0x5a)) + stmp = 16; + else + if ((ss[0] >= 0x5c) && (ss[0] <= 0x62)) + stmp = 17; + else + if ((ss[0] >= 0x64) && (ss[0] <= 0x96)) + stmp = 18; + else { + ret = -1; + break; + } + ret = scode - kanji_g_table[stmp][0] + kanji_g_table[stmp][1]; + break; + + default: + if ((ss[1] > 0x98) || ((ss[1] == 0x98) && (ss[0] > 0x72)) || + (ss[1] < 0x88) || ((ss[1] == 0x88) && (ss[0] < 0x9f)) || + (ss[0] > 0xfc) || (ss[0] < 0x40) || + ((ss[0] > 0x7e) && (ss[0] < 0x80))) { + ret = -1; + break; + } + stmp = ((ss[1] - 0x88)*2) + ((ss[0] < 0x7f) ? 0 : 1) - 1; + ret = scode - kanji_1_table[stmp][0] + kanji_1_table[stmp][1]; + } + + return(ret); +} + +/*---------------------------------------------------------------------- + Function: + Purpose: + Params: + Returns: + ---------------------------------------------------------------------- */ + long kanjiTest( u8 const *sjis,KanjiClass::KanjiFontSize k) +{ + int code; + u32 kaddr, addr; + u16 sjiscode; + int dot; + + dot=dotSize[k]; + + sjiscode = *sjis << 8 | *(sjis+1); + + if ((sjiscode >= 0x8140) && (sjiscode <= 0x84be)) + kaddr = kanjiAddr0[k]; + else if (dot==15 && (sjiscode >= 0x8540) && (sjiscode <= 0x8796)) + kaddr = kanjiAddrG[k]; + else if ((sjiscode >= 0x889f) && (sjiscode <= 0x9872)) + kaddr = kanjiAddr1[k]; + else + return -1; + + code = kanjiTrans(sjiscode); + addr = kaddr + code * dot * 2; + + return addr; +} + +/*---------------------------------------------------------------------- + Function: + Purpose: + Params: + Returns: + ---------------------------------------------------------------------- */ +void dekan(u8 *ptr,u8 *buf,int dot) +{ + int i,j,k; + char tmp; + int xchar, ychar; + + xchar = 2; + ychar = dot; + + for (i=0 ; i < ychar ; i++) + { + for (j=0 ; j < xchar ; j++) + { + tmp = *(ptr+i*xchar+j); + for (k=0 ; k < 8 ; k++) + { + if (tmp & 0x80) + *buf++=1; + else + *buf++=0; + + tmp *= 2 ; + } + } + } +} + +/*---------------------------------------------------------------------- + Function: + Purpose: + Params: + Returns: + ---------------------------------------------------------------------- */ +void ascii2SJIS(u8 *dest,u8 Ascii) +{ + u16 kan; + int done=0; + + struct SjisS *Ptr=SjisTable; + + while (!done && Ptr->Ascii) + { + + if ((Ascii>=Ptr->Ascii) && (Ascii<(Ptr->Ascii+Ptr->Num))) + { + /* Found ASCII char, return SJIS equivalent */ + kan= (Ptr->Sjis+(Ascii-Ptr->Ascii)); + done=1; + } + Ptr++; + } + + if(!done) + kan=0x8148; + + *dest++=(kan>>8); + *dest++=(kan&0xff); +} + +/*=========================================================================== + end */ diff --git a/Utils/transtext/kanjiclass.h b/Utils/transtext/kanjiclass.h new file mode 100644 index 000000000..e5ad312ea --- /dev/null +++ b/Utils/transtext/kanjiclass.h @@ -0,0 +1,97 @@ +/*========================================================================= + + KANJICLASS.CPP + + Author: Gary Liddon @ + Created: + Project: + Purpose: + + Copyright (c) 1998 G R Liddon + +===========================================================================*/ + +#ifndef __KANJI_CLASS__ +#define __KANJI_CLASS__ + +/*---------------------------------------------------------------------- + Includes + -------- */ + +/* Std Lib + ------- */ +#include + +/* Glib + ---- */ +#include +#include + +/* Local + ----- */ + +/*---------------------------------------------------------------------- + Tyepdefs && Defines + ------------------- */ + +/*---------------------------------------------------------------------- + Structure defintions + -------------------- */ + +class KanjiClass : GObject +{ +public: + + enum KanjiFontSize + { + FONT_SIZE_11, + FONT_SIZE_13, + FONT_SIZE_15, + }; +private: + std::vector m_kanjiHit; + + void initialise(void); + + void addKanjiHit(uint hi,uint lo); + bool getKanjiHit(uint hi,uint lo); + void clearKanjiHit(uint hi,uint lo); + int findKanjiIndex(u16 kan) const; + static void saveKanjiLbm(char const * fileName,KanjiFontSize k,u16 kan); + +public: + + + KanjiClass(void); + + void addStr(u8 const * newStr); + + int howManyKanjiChars(void); + void saveKanjiLbms(char const * dir,KanjiFontSize k = KanjiClass::FONT_SIZE_11); + void saveKanjiLbmNames(char const * dir,char const *name); + void saveKanjiTable(char const *name); + static void writeEnglishFontLbms(char const * dir,KanjiFontSize k = KanjiClass::FONT_SIZE_11,char const * repFile= NULL); +}; + + +/*---------------------------------------------------------------------- + Globals + ------- */ + +/* Vars + ---- */ + +/* Data + ---- */ + +/* Functions + --------- */ + + + +/*---------------------------------------------------------------------- */ + +#endif /* XYZ */ + +/*=========================================================================== + end */ diff --git a/Utils/transtext/main.cpp b/Utils/transtext/main.cpp new file mode 100644 index 000000000..0ffa53bc2 --- /dev/null +++ b/Utils/transtext/main.cpp @@ -0,0 +1,299 @@ +/*========================================================================= + + MAIN.CPP + + Author: Gary Liddon @ Fareham + Created: 3rd March 1999 + Project: Theme Park World Playstation + Purpose: Main module for Folio + + Copyright (c) 1998 G R Liddon + +===========================================================================*/ + +/*---------------------------------------------------------------------- + Includes + -------- */ + +/* Std Lib + ------- */ +#include +#include +#include +#include +#include +#include + +/* Glib + ---- */ +#include +#include +#include +#include + +/* tplib + ---- */ +#include +#include +#include + + +/* local + ---- */ +#include "kanjiclass.h" + +/*---------------------------------------------------------------------- + Version info + + 1.0 - 1.2 GL Initial working version + 1.3 GL Longer line length (now 4096) + 1.4 GL Added comments to file + 1.5 GL Changed it so that \n are now returns + 1.6 GL Added a slew of stuff to handle kanji + 1.7 GL Chganged format of kanji table + 1.8 GL Removed bug with kanji frame lookup + 1.9 GL added -s so user can specify the size of output font + 1.91 GL Transtext also writes out an ID text file (id.dat) + 1.92 GL fixed bug with output kanji table being too short + +/*---------------------------------------------------------------------- + +/*---------------------------------------------------------------------- + Tyepdefs && Defines + ------------------- */ +using namespace std; + +/*---------------------------------------------------------------------- + Structure defintions + -------------------- */ + + +/*---------------------------------------------------------------------- + Function Prototypes + ------------------- */ +static void usage(void); +static char * cycleCommands(char *String,int Num); + +/*---------------------------------------------------------------------- + Vars + ---- */ +static const float version=1.92f; +static GString fileWithTranslations; +static GString headerFile; +static GString outDir; + +static GString g_japKanjiFile; +static GString g_japLbmDir; +static GString g_englishLbmsDir; +static GString g_japLbmListFile; +static int g_fontSize=0; + +/*---------------------------------------------------------------------- + Data + ---- */ + +/*---------------------------------------------------------------------- + Function: + Purpose: + Params: + Returns: + ---------------------------------------------------------------------- */ +int main(int argc, char ** argv) +{ + cerr<<"GRLiddon() TRANSTEXT text translation stuphh "<getNumOfStrings(); + + for (int f=0;fgetText(f)); + + if (g_japLbmDir) + { + if (g_fontSize >=0 && g_fontSize < 3) + kClass.saveKanjiLbms(g_japLbmDir,KanjiClass::KanjiFontSize(g_fontSize)); + else + GObject::Error(ERR_FATAL,"illegal font size parameter"); + } + + if (g_japKanjiFile) + kClass.saveKanjiTable(g_japKanjiFile); + + if (g_japLbmListFile && g_japLbmDir) + kClass.saveKanjiLbmNames(g_japLbmDir,g_japLbmListFile); + + cout<<"text uses "< [ switches.. ]\n"; + cout<<"Switches:\n"< Dir to save translation strings to"< Dir write ascii images to"< File to save lang enums to"< Dir to save kanji lbms to"< File to save kanji table to"< File to save list of saved lbms to"< Set the size of the output font"< + +/* Glib + ---- */ +#include + +/* Local + ----- */ + +/*---------------------------------------------------------------------- + Tyepdefs && Defines + ------------------- */ + +/*---------------------------------------------------------------------- + Structure defintions + -------------------- */ +class ScriptFile +{ +private: + std::ifstream m_inStream; + bool m_isOpen; + GString m_fileName; + int m_lineCount; + + void scriptError(void); + + bool getNextNonBlankLine(char * Line,int LineLen); + + void stripTrailingSpace(char * Line); + GString getCommandString(char * Com); + bool isCommand(char * Line); + void checkIsOpen(void); + +protected: + bool eof(void); + GString peekNextCommand(void); + bool nextLineIsCommand(void); + GString getNextLine(void); + + void open(char const * fileName); + void close(void); + + + +public: + + + ScriptFile(void); + ~ScriptFile(void); +}; + +/*---------------------------------------------------------------------- + Globals + ------- */ + +/* Vars + ---- */ + +/* Data + ---- */ + +/* Functions + --------- */ + + + +/*---------------------------------------------------------------------- */ + +#endif /* __SCRIPT_H__ */ + +/*=========================================================================== + end */ + diff --git a/Utils/transtext/transtext.dsp b/Utils/transtext/transtext.dsp new file mode 100644 index 000000000..580ae07f3 --- /dev/null +++ b/Utils/transtext/transtext.dsp @@ -0,0 +1,108 @@ +# Microsoft Developer Studio Project File - Name="transtext" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=transtext - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "transtext.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "transtext.mak" CFG="transtext - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "transtext - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "transtext - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName ""$/TP2psx/utils/transtext", JNXBAAAA" +# PROP Scc_LocalPath "." +CPP=xicl6.exe +RSC=rc.exe + +!IF "$(CFG)" == "transtext - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\..\glibdev\glib\include" /I "..\..\glibdev\glib\include\pc" /I "..\tplib" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD BASE RSC /l 0x809 /d "NDEBUG" +# ADD RSC /l 0x809 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=xilink6.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib win32lib.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\glibdev\glib\lib\win32lib\release" /libpath:"..\tplib\release" + +!ELSEIF "$(CFG)" == "transtext - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c +# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\..\glibdev\glib\include" /I "..\..\glibdev\glib\include\pc" /I "..\tplib" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FR /YX /FD /GZ /c +# ADD BASE RSC /l 0x809 /d "_DEBUG" +# ADD RSC /l 0x809 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=xilink6.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib win32lib.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\glibdev\glib\lib\win32lib\debug" /libpath:"..\tplib\debug" + +!ENDIF + +# Begin Target + +# Name "transtext - Win32 Release" +# Name "transtext - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=.\kanjiclass.cpp +# End Source File +# Begin Source File + +SOURCE=.\main.cpp +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# Begin Source File + +SOURCE=.\kanjiclass.h +# End Source File +# End Group +# Begin Group "Resource Files" + +# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" +# End Group +# End Target +# End Project diff --git a/Utils/transtext/transtext.dsw b/Utils/transtext/transtext.dsw new file mode 100644 index 000000000..cbaffd59a --- /dev/null +++ b/Utils/transtext/transtext.dsw @@ -0,0 +1,29 @@ +Microsoft Developer Studio Workspace File, Format Version 6.00 +# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! + +############################################################################### + +Project: "transtext"=.\transtext.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Global: + +Package=<5> +{{{ +}}} + +Package=<3> +{{{ +}}} + +############################################################################### + diff --git a/build/ccopt.mak b/build/ccopt.mak new file mode 100644 index 000000000..90e8d0d3e --- /dev/null +++ b/build/ccopt.mak @@ -0,0 +1,60 @@ +#---------------------------------------------------------------------------- +# CCOPT.MAK +# +# This holds all the command line options for C++ +# compilation +# +# Tabbed for 5 9 (Please do not change) +# +# Created: 3rd February 1999 +# +# Copyright (C) 1997-1998 G R Liddon +#---------------------------------------------------------------------------- + +COMPILER_INI_FILE := $(PSYQ_PATH)/sn.ini + +ASM_OPTS := /l /zd /z /w /q \ + /o c+ /o w+ /o ws+ \ + /j $(PSYQ_INC_DIR) \ + /j $(SOURCE_DIR) \ + /j ./ + + + +COMMON_CCFLAGS := -Werror \ + -D__TERRITORY_$(TERRITORY)__\ + -D__VERSION_$(VERSION)__\ + -D__USER_$(USER_NAME)__ \ + -D__VERSION_STR__=$(VERSION)\ + -D__TERRITORY_STR__=$(TERRITORY)\ + -DPSX \ + -D_LANGUAGE_C_PLUS_PLUS \ + $(USER_DEF_OPT) \ + $(GLIB_OPT) \ + $(FILE_OPT) \ + $(DEV_OPT) \ + $(SMALL_OPT) \ + -Wall \ + -Wmissing-prototypes\ + -Wmissing-declarations\ + -Wno-unused \ + -Wbad-function-cast \ + -g \ + -O2\ + -fno-builtin\ + -fomit-frame-pointer\ + -fno-exceptions \ + -fno-rtti \ + -I. \ + -I$(PSYQ_INC_DIR) \ + -I$(DDX_INC_DIR)\ + -I$(MOD_INC_DIR)\ + -I$(SOURCE_DIR)\ + -I$(GIN_INC_DIR) \ + -I$(GAME_DATA_DIR) \ + -I$(INC_DIR) + +# -fno-inline \ + +#---------------------------------------------------------------------------- +# end \ No newline at end of file diff --git a/build/getuser.mak b/build/getuser.mak new file mode 100644 index 000000000..bb2a06a62 --- /dev/null +++ b/build/getuser.mak @@ -0,0 +1,35 @@ +#---------------------------------------------------------------------------- +# GETUSER.MAK +# +# Get's the user vars in from their makefile +# +# Their makefile is at $(USERS_DIR)//makefile +# The user name is whatever they logged onto +# their computer as (in lower case) +# +# Tabbed for 5 9 (Please do not change) +# +# Created: 3rd February 1999 +# +# Copyright (C) 1997-1998 G R Liddon +#---------------------------------------------------------------------------- + +# Now that's all sorted include the users vars +# -------------------------------------------- + +ifndef USER_NAME + +USER_NAME := $(shell $(LOG_NAME)) + +endif + + +USER_VAR_FILE := $(USERS_DIR)/$(USER_NAME)/makefile + +$(USERS_DIR)/$(USER_NAME)/makefile : + @$(ECHO) You Need a user file. See gary liddon + +include $(USER_VAR_FILE) + +#---------------------------------------------------------------------------- +# end \ No newline at end of file diff --git a/build/globals.mak b/build/globals.mak new file mode 100644 index 000000000..0f06e4447 --- /dev/null +++ b/build/globals.mak @@ -0,0 +1,162 @@ +#---------------------------------------------------------------------------- +# globals.mak +# +# Global defintions for all makefiles +# Directory definitions and user preference inclusion +# +# Tabbed for 5 9 (Please do not change) +# +# Created: 19th April 1997 by G R Liddon @ Fareham +# +# Copyright (C) 1997 G R Liddon +#---------------------------------------------------------------------------- + +ifndef __GLOBALS_MAK__ +__GLOBALS_MAK__ := 1 + +#---------------------------------------------------------------------------- +# Useful Macros +# ------------- + +NULL := +SPACE := $(NULL) $(NULL) +TAB := $(NULL) $(NULL) +COMMA := , +LBRACKET := ( +RBRACKET := ) +DOLLAR := $$ +SQUOTE := ' +DQUOTE := " + +define NEWLINE + + +endef + + +#---------------------------------------------------------------------------- +# Directory Definitions +# --------------------- + + +# Miscellaneous Dirs +# ------------------ +TOOL_DIR := tools +GRAF_DIR := graphics +GAME_DATA_DIR := data +USERS_DIR := users +SOURCE_DIR := source +SOUND := sounds + +# Psyq Utilities and libraries +# ---------------------------- +PSYQ_DIR := $(TOOL_DIR)/psyq +PSYQ_BIN_DIR := $(PSYQ_DIR)/bin +PSYQ_LIB_DIR := $(PSYQ_DIR)/lib +PSYQ_INC_DIR := $(PSYQ_DIR)/include + +# DDX Dodgy test kit +# ------------------ +DDX_DIR := $(TOOL_DIR)/climax +DDX_BIN_DIR := $(DDX_DIR)/exes +DDX_INC_DIR := $(DDX_DIR)/libs +DDX_LIB_DIR := $(DDX_DIR)/libs + +# MOD - mod playing lib +# --------------------- +MOD_DIR := $(TOOL_DIR)/mod +MOD_INC_DIR := $(MOD_DIR)/include +MOD_LIB_DIR := $(MOD_DIR)/lib + +# VLC - FMV decoder +# --------------------- +VLC_DIR := $(TOOL_DIR)/vlc +VLC_INC_DIR := $(VLC_DIR)/include +VLC_LIB_DIR := $(VLC_DIR)/lib + +# GIN tools and includes +# --------------------- +GIN_TOOL_DIR := $(TOOL_DIR)/gin +GIN_BIN_DIR := $(GIN_TOOL_DIR)/bin +GIN_INC_DIR := $(GIN_TOOL_DIR)/include + +GIN2MSH := $(GIN_BIN_DIR)/Gin2Msh -q +GIN2ACT := $(GIN_BIN_DIR)/Gin2Act -q +GIN2ANM := $(GIN_BIN_DIR)/Gin2Anm +GIN2LVL := $(GIN_BIN_DIR)/Gin2Kdt -q + +# Cygwin +# ------ +CYG_DIR := $(TOOL_DIR)/cygwin +CYG_BIN_DIR := $(CYG_DIR) + +# Perl +# ---- +PERL_DIR := $(TOOL_DIR)/perl +PERL_BIN_DIR := $(PERL_DIR)/bin +PERL_SCRIPT_DIR := $(PERL_DIR)/pl + +# Cygwin tools +# ------------ +ECHO := $(CYG_BIN_DIR)/echo +RMDIR := $(CYG_BIN_DIR)/rmdir +MKDIR := $(CYG_BIN_DIR)/mkdir +REDIR := glecho +TOUCH := touch +RM := rm +CP := cp +SED := sed +LS := $(CYG_BIN_DIR)/ls +MV := $(CYG_BIN_DIR)/mv +DATE := $(CYG_BIN_DIR)/date +SED := $(CYG_BIN_DIR)/sed + +LOG_NAME := uname +PARKGRAB := parkgrab +BANKER := banker +BIGLUMP := bl2 + +# PSX and misc tools +# ------------------ +LNK := slink +PL := perl +CC := ccpsx +ASM := asmpsx +CPE2EXE := cpe2exe +CPE2BIN := cpe2bin +LZNP := lznp -Q +SIZEAPP := sizeapp +MAKEDATA := MkData + +#---------------------------------------------------------------------------- +# Vars that need exporting +# ------------------------ + +# Path +# ---- +export PATH = $(TOOL_DIR);$(CYG_BIN_DIR);$(PSYQ_BIN_DIR);$(PERL_BIN_DIR) +export Path = $(TOOL_DIR);$(CYG_BIN_DIR);$(PSYQ_BIN_DIR);$(PERL_BIN_DIR) + +# PsyQ Vars overidden for those who've installed PSYQ on their machine +# -------------------------------------------------------------------- +export COMPILER_PATH := +export PSYQ_PATH := +export ASSEMBLER_PATH := +export LIBRARY_PATH := +export C_PLUS_INCLUDE_PATH := +export C_INCLUDE_PATH := + +# These vars are also used by GCC +# ------------------------------- +export GCC_EXEC_PREFIX := +export COMPILER_PATH := +export LIBRARY_PATH := +export C_INCLUDE_PATH := +export CPLUS_INCLUDE_PATH := +export OBJC_INCLUDE_PATH := + +#---------------------------------------------------------------------------- +endif # __GLOBALS_MAK__ +#---------------------------------------------------------------------------- +# end + diff --git a/build/lnk.mak b/build/lnk.mak new file mode 100644 index 000000000..f4a533586 --- /dev/null +++ b/build/lnk.mak @@ -0,0 +1,88 @@ +#---------------------------------------------------------------------------- +# LNK.MAK +# +# This creates the macro that finally makes the linker script file +# It also holds any linker options needed +# +# Tabbed for 5 9 (Please do not change) +# +# Created: 3rd February 1999 +# +# Copyright (C) 1997-1998 G R Liddon +#---------------------------------------------------------------------------- + +ifndef STACK_SIZE +STACK_SIZE := 3000 +endif + +LNK_FLAGS:= -m -psx -c -v -z -o $(PROG_ORG) -entry __SN_ENTRY_POINT \ + -cpemunge \ + -strip \ + -nsf \ + $(ALL_ASM_OBJS) \ + $(PSYQ_LIB_DIR)/libsn.lib \ + -nsf \ + -we -wm -wo \ + -nostrip \ + stup0 \ + stup1 \ + stup2 \ + VectorNormalS \ + VectorNormal \ + VectorNormalSS\ + cqsrt \ + -nostrip + +LINKER_FILE_MACRO := \ +';nostripfile=$(PSYQ_LIB_DIR)/libsn.lib' \ +'text group ' \ +'extractors group ' \ +'extradtors group ' \ +'data group ' \ +'sdata group ' \ +'sbss group bss' \ +'bss group bss ' \ +'cached group cache(0x20000000) ' \ +'' \ +'' \ +'memend group bss' \ +'' \ +'' \ +' section .text,text' \ +' section .cached,cached' \ +' section .sdata,sdata' \ +' section .ctors,text' \ +' section .dtors,text ' \ +' section .data,data' \ +' section .rdata,text' \ +' section .sbss,sbss' \ +' section .bss,bss' \ +' section .memend,memend' \ +' section .last,memend' \ +'' \ +'' \ +'' \ +'' \ +'LNK_RamSize equ $(RAM_SIZE)' \ +'LNK_StackSize equ $(STACK_SIZE)' \ +'LNK_OrgAddress equ $(PROG_ORG)' \ +'LNK_FileSys equ $(LNK_FILE_SYS)' \ +'LNK_DevKit equ $(LNK_DEV_KIT)' \ +'$(LNK_OVL) ' \ +'' \ +'$(TAB)regs$(TAB)pc=__SN_ENTRY_POINT' \ +'; $(FILE_SYSTEM) Start-Up Objects' \ +'' \ +$(foreach FILE,$($(FILE_SYSTEM)_STARTUP_OBJ), '$(TAB)startstats "$(FILE)" ' '$(TAB)include $(PSYQ_LIB_DIR)/$(FILE).obj' '$(TAB)endstats') \ +'' \ +'; Main Game object files' \ +$(foreach FILE,$(CODE_OBJS_TO_MAKE), '$(TAB)startstats "$(subst /,.,$(FILE:$(OBJ_DIR)/%.o=%))" ' '$(TAB)include $(FILE) $(ovl_$(subst /,_,$(FILE:$(OBJ_DIR)/%.o=%)))' '$(TAB)endstats') \ +$(foreach FILE,$(EXTRA_OBJS), '$(TAB)startstats "$(subst /,.,$(FILE:$(OBJ_DIR)/%.o=%))" ' '$(TAB)include $(FILE) $(ovl_$(subst /,_,$(FILE:$(OBJ_DIR)/%.o=%)))' '$(TAB)endstats') \ +'' \ +'; Libs' \ +$(foreach FILE,$(ALL_LIBS_FULL),'$(TAB)startstats "$(FILE)"' '$(TAB)inclib $(FILE)' '$(TAB)endstats') \ +'' + + +#---------------------------------------------------------------------------- +# end diff --git a/build/outdirs.mak b/build/outdirs.mak new file mode 100644 index 000000000..4490edcbf --- /dev/null +++ b/build/outdirs.mak @@ -0,0 +1,43 @@ +#---------------------------------------------------------------------------- +# Create all the output directories the game needs +#---------------------------------------------------------------------------- + +# Macros for ouput dirs +# --------------------- +OUT_DIR := out/$(TERRITORY) + +OBJ_DIR := $(OUT_DIR)/$(VERSION)/$(FILE_SYSTEM)/objs +OBJ_DIRS_TO_MAKE := $(foreach SRC_DIR,$(SRC_DIRS),$(OBJ_DIR)/$(SRC_DIR)) +VERSION_DIR := $(OUT_DIR)/$(VERSION)/version/$(FILE_SYSTEM) + +DEPS_DIR := $(OUT_DIR)/$(VERSION)/deps/$(FILE_SYSTEM) +DEP_DIRS_TO_MAKE := $(foreach SRC_DIR,$(SRC_DIRS),$(DEPS_DIR)/$(SRC_DIR)) + +TEMP_DIR := $(OUT_DIR)/$(VERSION)/$(FILE_SYSTEM)/temp +TEMP_BUILD_DIR := $(OUT_DIR)/$(VERSION)/build +DATA_OUT := $(OUT_DIR)/data +INC_DIR := $(OUT_DIR)/include +REPORT_DIR := $(OUT_DIR)/report +SYSTEM_GEN_DIR := $(SOURCE_DIR)/system/$(VERSION)/$(TERRITORY)/$(FILE_SYSTEM) +SYSTEM_GEN_DIR_O := $(OBJ_DIR)/system/$(VERSION)/$(TERRITORY)/$(FILE_SYSTEM) +SYSTEM_GEN_DIR_D := $(DEPS_DIR)/system/$(VERSION)/$(TERRITORY)/$(FILE_SYSTEM) + +DIRS_TO_MAKE := $(OBJ_DIR) $(VERSION_DIR) $(TEMP_DIR) $(DEPS_DIR) $(OBJ_DIRS_TO_MAKE) $(DEP_DIRS_TO_MAKE) $(TEMP_BUILD_DIR) $(DATA_OUT) $(INC_DIR) $(REPORT_DIR) $(SYSTEM_GEN_DIR) $(SYSTEM_GEN_DIR_O) $(SYSTEM_GEN_DIR_D) + +# DIRS_TO_MAKE := $(OBJ_DIR) $(VERSION_DIR) $(DEPS_DIR) $(OBJ_DIRS_TO_MAKE) $(TEMP_DIR) $(DEP_DIRS_TO_MAKE) $(TEMP_BUILD_DIR) $(DATA_OUT) $(INC_DIR) $(REPORT_DIR) $(SIZES_DIR) $(SYSTEM_GEN_DIR) $(SYSTEM_GEN_DIR_O) $(SYSTEM_GEN_DIR_D) + +# Stuff needed to make output dirs +# -------------------------------- +.PHONY: dirs + +$(DIRS_TO_MAKE) : + @$(MKDIR) -p $(DIRS_TO_MAKE) + @$(ECHO) Created directories $(DIRS_TO_MAKE) + +dirs : $(DIRS_TO_MAKE) + +# Some more exports to do after we've decided what the temp dir is +# ---------------------------------------------------------------- +export TEMP := $(TEMP_DIR) +export TMPDIR := $(TEMP_DIR) +export DEPENDENCIES_OUTPUT := $(TEMP_DIR)/dep.tmp diff --git a/build/parse.mak b/build/parse.mak new file mode 100644 index 000000000..8c1648a9d --- /dev/null +++ b/build/parse.mak @@ -0,0 +1,288 @@ +#---------------------------------------------------------------------------- +# PARSE.MAK +# +# Makes sure all the that need defining to build the game have been defined +# If not ERR_STR is defined and this cause the makefile to report an error +# +# Tabbed for 5 9 (Please do not change) +# +# Created: +# +# Copyright (C) 1997-1999 G R Liddon +#---------------------------------------------------------------------------- + +# Make sure the basics are defined first +# -------------------------------------- +ifndef TERRITORY + +ERR_STR := You must define a territory to build for (USA EUR || JAP) + +endif + +ifndef VERSION + +ERR_STR := You must define a version to build + +endif + + +# Now Parse for the dev kit stuff +# ---------------------------------- +ifdef PSYQ_DEV_IRQ + + PSYQ_DEV_IRQ_OPT := /i$(PSYQ_DEV_IRQ) + +endif + +ifndef DEV_KIT + ERR_STR := You must define DEV_KIT to either SONY_ISA or SONY_PCI or CLIMAX or TPWART +else + DEV_OPT := -DSONY_ISA=0 \ + -DSONY_PCI=1 \ + -DCLIMAX=2 \ + -DTPWART=3 \ + -D__DEV_KIT__=$(DEV_KIT) + +DK_SONY_ISA := 0 +DK_SONY_PCI := 1 +DK_CLIMAX := 2 +DK_TPWART := 3 +DK_SONY_H2700 := $(DK_SONY_PCI) + +LNK_DEV_KIT := $(DK_$(DEV_KIT)) + +endif + +# Now sort out how the game loads files +# ------------------------------------- +ifndef FILE_SYSTEM + ERR_STR := You must define FILE_SYSTEM to either PC or CD +else + FILE_OPT := -DPC=0 \ + -DCD=1 \ + -D__FILE_SYSTEM__=$(FILE_SYSTEM) + +FS_PC := 0 +FS_CD := 1 + +LNK_FILE_SYS := $(FS_$(FILE_SYSTEM)) + +endif + +# Make sure we have everything we need for the sony pci dev kit +# -------------------------------------------------------------- +ifeq ($(DEV_KIT),SONY_PCI) + +DEV_KIT_FOUND := 1 + +endif + +# Make sure we have everything we need for the climax dev kit +# ----------------------------------------------------------- +ifeq ($(DEV_KIT),CLIMAX) + +ifndef DDX_PORT + + ERR_STR := You must define DDX_PORT for the Climax dev kit i/o addr in your personal makefile + +endif + +DEV_KIT_FOUND := 1 + +endif + + +# Make sure we have everything we need for the climax dev kit +# ----------------------------------------------------------- +ifeq ($(DEV_KIT),TPWART) + +ifndef DDX_PORT + + ERR_STR := You must define DDX_PORT for the Climax dev kit i/o addr in your personal makefile + +endif + +DEV_KIT_FOUND := 1 + +endif + + +# Make sure we have everything we need for the Sony H2000 +# -------------------------------------------------------------------- +ifeq ($(DEV_KIT),SONY_ISA) + +ifdef SONY_ISA_IRQ + + SONY_ISA_IRQ_OPT := /i $(SONY_ISA_IRQ) + +endif + +ifndef SONY_ISA_ADDR + + ERR_STR := You must define SONY_ISA_ADDR for the dtl i/o addr in your personal makefile + +endif + +DEV_KIT_FOUND := 1 + +endif + +# Make sure we have everything we need for the Sony H2700 +# ------------------------------------------------------- +ifeq ($(DEV_KIT),SONY_H2700) + +ifdef SONY_ISA_IRQ + + SONY_ISA_IRQ_OPT := /i $(SONY_ISA_IRQ) + +endif + +ifndef SONY_ISA_ADDR + + ERR_STR := You must define SONY_ISA_ADDR for the dtl i/o addr in your personal makefile + +endif + +DEV_KIT_FOUND := 1 + +endif + +#---------------------------------------------------------------------------- +# Macros for dev BIOS load \ unload for all the dev systems +# All take form LOAD_BIOS_$(DEV_KIT) +#---------------------------------------------------------------------------- + +# PCI Bios load \ unload +# ---------------------- +define LOAD_BIOS_SONY_PCI + h25bios + RESETPS 1 /n +endef + +define UNLOAD_BIOS_SONY_PCI + -mess1 + h25bios +endef + +# H2700 Bios load \ unload +# ------------------------ +define LOAD_BIOS_SONY_H2700 + -mess1 + -dexbios /a $(SONY_ISA_ADDR) $(SONY_ISA_IRQ_OPT) + RESETPS 1 /n +endef + +define UNLOAD_BIOS_SONY_H2700 + -dexbios + -mess1 +endef + + +# ISA Bios load \ unload +# ---------------------- +define LOAD_BIOS_SONY_ISA + -mess1 + -dexbios /a $(SONY_ISA_ADDR) $(SONY_ISA_IRQ_OPT) + RESETPS 1 + RUN /w4 $(subst /,\,$(PSYQ_BIN_DIR)\snpatch.cpe) > con + DELAY +endef + +define UNLOAD_BIOS_SONY_ISA + -mess1 + -dexbios +endef + + +# CLIMAX Bios load \ unload +# ------------------------ +define LOAD_BIOS_CLIMAX + -mess1 + -datbios +endef + +define UNLOAD_BIOS_CLIMAX + -datbios + -mess1 +endef + + +# TPWART Bios load \ unload +# ------------------------ +define LOAD_BIOS_TPWART + -mess1 + -psy /4 +endef + +define UNLOAD_BIOS_TPWART + -psy + -mess1 +endef + +# Set the LOAD\UNLOAD_BIOS macros correctly +# ----------------------------------------- +LOAD_BIOS := $(LOAD_BIOS_$(DEV_KIT)) +UNLOAD_BIOS := $(UNLOAD_BIOS_$(DEV_KIT)) + + +# Check to make sure we found a dev kit we know about +# --------------------------------------------------- +ifndef ERR_STR + +ifndef DEV_KIT_FOUND + ERR_STR := $(DEV_KIT) is not a recognised dev kit +endif + +endif + +# Sort out the compiler we're using +# --------------------------------- +ifdef USE_EGCS + +COMPILER := egcs + +else + +COMPILER := gnu + +endif + +export PSYQ_PATH := $(PSYQ_BIN_DIR)/$(COMPILER) +export SN_PATH := $(PSYQ_BIN_DIR)/$(COMPILER) + + +# Define what we need for the ram size +# ------------------------------------ +ifdef RAM_SIZE +MEG := $(RAM_SIZE) +else +MEG := 8 +endif + +MEG_OPT := -D__MEG$(MEG)__ + + +# Bodge Address for 4 meg dev kit +# ------------------------------- +ifeq ($(VERSION),debug) + +GLIB_OPT := -D__GL_DEBUG__ + +else + +GLIB_OPT := + +endif + + +# Bodge Address for 4 meg dev kit +# ------------------------------- +ifeq ($(RAM_SIZE),4) +PROG_ORG = 0x80210000 +else +PROG_ORG = 0x80010000 +endif + + +#---------------------------------------------------------------------------- +# end diff --git a/data/DataCache.scr b/data/DataCache.scr new file mode 100644 index 000000000..4dfbfdcf3 --- /dev/null +++ b/data/DataCache.scr @@ -0,0 +1,703 @@ +translations/swe.dat +translations/dut.dat +translations/ita.dat +translations/ger.dat +translations/id.dat +translations/eng.dat +{ SYSTEM_CACHE 4 +anims/Generic.Abk +anims/Civ.Abk +anims/Boss.Abk +anims/Missions.Abk +sounds/ui/ui.bof +} + +ui/UIGfx.Spr +sfx/sfx.spr +options/options.spr + +sounds/ui/ui.bnk +pickups/pickup_gfx.tex +sounds/generic/generic.bnk +sounds/generic/generic.bof +actors/GENGRP.tex + +###################################### +### Front End ######################## +###################################### +{ FRONTEND_CACHE 4 +#options/gameopt.gfx +options/optmod.msh +options/optq.msh +actors/PRB.act +actors/PRG.act +actors/PRM.act +actors/PRP.act +actors/PRR.act +actors/PRY.act +sounds/gameopts/gameopts.bof +} +sounds/gameopts/gameopts.bnk + +actors/PRB.act +actors/PRB.tex +actors/PRG.act +actors/PRG.tex +actors/PRM.act +actors/PRM.tex +actors/PRP.act +actors/PRP.tex +actors/PRR.act +actors/PRR.tex +actors/PRY.act +actors/PRY.tex + +options/gameopt.gfx +sounds/pause/pause.bnk +sounds/pause/pause.bof + +###################################### +### LEVEL 1 ########################## +###################################### +music/LEVEL1.VH +music/LEVEL1.VB +Levels/LEVEL1.tex + +{ LEVEL1_CACHE 4 +# Generic +ui/PAUSEMENU.msh +ui/PAUSELIGHTS.msh +ui/PAUSELIGHTS2.msh +ui/compass.msh +ui/moveon.msh +sfx/asteroid.msh +sfx/card.msh +sfx/dagger.msh +sfx/icicle.msh +sfx/missile.msh +sfx/projectile.msh +sfx/sonic.msh +sfx/telesphere.msh +pickups/pu-health.msh +pickups/pu-crr.msh +pickups/pu-crg.msh +pickups/pu-crb.msh +pickups/pu-cry.msh +pickups/pu-crp.msh +pickups/pu-invun.msh +pickups/pu-life.msh +pickups/pu-mosb.msh +pickups/pu-mogo.msh +pickups/pu-mosg.msh +pickups/pu-mosr.msh +pickups/pu-mogp.msh +pickups/pu-card.msh +pickups/pu-keyt.msh +pickups/pu-sell.msh +# pickups/pu-sward.msh +pickups/pu-aura00.msh +pickups/pu-aura10.msh +pickups/pu-aura11.msh +pickups/pu-aura20.msh +pickups/pu-aura30.msh +pickups/pu-aura31.msh +pickups/pu-aura40.msh +pickups/pu-aura00blue.msh + +# Actors +actors/CAPTAIN.Act +actors/FAIRWEATHER.Act +actors/KID.Act +actors/MAN.Act +actors/M01BLUE.Act +actors/M10.Act +actors/B03.Act + +# Level Data +Levels/LEVEL1.lvl + +# Sound & Music +music/LEVEL1.PXM +sounds/level1/level1.bof +} +actors/L01GRP.tex +sounds/level1/level1.bnk + +###################################### +### LEVEL 2 ########################## +###################################### +music/LEVEL2.VH +music/LEVEL2.VB +Levels/LEVEL2.tex + +{ LEVEL2_CACHE 4 +# Generic +ui/PAUSEMENU.msh +ui/PAUSELIGHTS.msh +ui/PAUSELIGHTS2.msh +ui/compass.msh +ui/moveon.msh +sfx/asteroid.msh +sfx/card.msh +sfx/dagger.msh +sfx/icicle.msh +sfx/missile.msh +sfx/projectile.msh +sfx/sonic.msh +sfx/telesphere.msh +pickups/pu-health.msh +pickups/pu-crr.msh +pickups/pu-crg.msh +pickups/pu-crb.msh +pickups/pu-cry.msh +pickups/pu-crp.msh +pickups/pu-invun.msh +pickups/pu-life.msh +pickups/pu-mosb.msh +pickups/pu-mogo.msh +pickups/pu-mosg.msh +pickups/pu-mosr.msh +pickups/pu-mogp.msh +pickups/pu-card.msh +pickups/pu-keyt.msh +pickups/pu-sell.msh +pickups/pu-sward.msh +pickups/pu-aura00.msh +pickups/pu-aura10.msh +pickups/pu-aura11.msh +pickups/pu-aura20.msh +pickups/pu-aura30.msh +pickups/pu-aura31.msh +pickups/pu-aura40.msh +pickups/pu-aura00blue.msh + +# Level Data +Levels/LEVEL2.lvl + +# Actors +actors/CAPTAIN.Act +actors/FAIRWEATHER.Act +actors/KID.Act +actors/BOY.Act +queencocoon/queencocoon.msh +actors/M01ORANGE.Act +actors/M07.Act +actors/B04.Act + +# Sound & Music +music/LEVEL2.PXM +sounds/level2/level2.bof +} +actors/L02GRP.tex +sounds/level2/level2.bnk + +###################################### +### LEVEL 3 ########################## +###################################### +music/LEVEL3.VH +music/LEVEL3.VB +Levels/LEVEL3.tex + +{ LEVEL3_CACHE 4 +# Generic +ui/PAUSEMENU.msh +ui/PAUSELIGHTS.msh +ui/PAUSELIGHTS2.msh +ui/compass.msh +ui/moveon.msh +sfx/asteroid.msh +sfx/card.msh +sfx/dagger.msh +sfx/icicle.msh +sfx/missile.msh +sfx/projectile.msh +sfx/sonic.msh +sfx/telesphere.msh +pickups/pu-health.msh +pickups/pu-crr.msh +pickups/pu-crg.msh +pickups/pu-crb.msh +pickups/pu-cry.msh +pickups/pu-crp.msh +pickups/pu-invun.msh +pickups/pu-life.msh +pickups/pu-mosb.msh +pickups/pu-mogo.msh +pickups/pu-mosg.msh +pickups/pu-mosr.msh +pickups/pu-mogp.msh +pickups/pu-card.msh +pickups/pu-keyt.msh +pickups/pu-sell.msh +# pickups/pu-sward.msh +pickups/pu-aura00.msh +pickups/pu-aura10.msh +pickups/pu-aura11.msh +pickups/pu-aura20.msh +pickups/pu-aura30.msh +pickups/pu-aura31.msh +pickups/pu-aura40.msh +pickups/pu-aura00blue.msh + +#Level Data +Levels/LEVEL3.lvl +levels/section1.msh +levels/section2.msh +levels/section3.msh +levels/section4.msh +levels/section5.msh +levels/section6.msh + +# Actors +actors/CAPTAIN.Act +actors/FAIRWEATHER.Act +actors/KID.Act +actors/M01GREEN.Act +actors/B05.Act + +#Sound & Music +music/LEVEL3.PXM +sounds/level3/level3.bof +} +actors/L03GRP.tex +sounds/level3/level3.bnk + +###################################### +### LEVEL 4 ########################## +###################################### +music/LEVEL4.VH +music/LEVEL4.VB +Levels/LEVEL4.tex + +{ LEVEL4_CACHE 4 +# Generic +ui/PAUSEMENU.msh +ui/PAUSELIGHTS.msh +ui/PAUSELIGHTS2.msh +ui/compass.msh +ui/moveon.msh +sfx/asteroid.msh +sfx/card.msh +sfx/dagger.msh +sfx/icicle.msh +sfx/missile.msh +sfx/projectile.msh +sfx/sonic.msh +sfx/telesphere.msh +pickups/pu-health.msh +pickups/pu-crr.msh +pickups/pu-crg.msh +pickups/pu-crb.msh +pickups/pu-cry.msh +pickups/pu-crp.msh +pickups/pu-invun.msh +pickups/pu-life.msh +pickups/pu-mosb.msh +pickups/pu-mogo.msh +pickups/pu-mosg.msh +pickups/pu-mosr.msh +pickups/pu-mogp.msh +pickups/pu-card.msh +pickups/pu-keyt.msh +pickups/pu-sell.msh +# pickups/pu-sward.msh +pickups/pu-aura00.msh +pickups/pu-aura10.msh +pickups/pu-aura11.msh +pickups/pu-aura20.msh +pickups/pu-aura30.msh +pickups/pu-aura31.msh +pickups/pu-aura40.msh +pickups/pu-aura00blue.msh + +# Level Data +Levels/LEVEL4.lvl + +# Actors +actors/CAPTAIN.Act +actors/FAIRWEATHER.Act +actors/MAN.Act +actors/BOY.Act +actors/KID.Act +actors/M01.Act +actors/M02.Act +actors/M03.Act +actors/B02.Act + +# Sound & Music +music/LEVEL4.PXM +sounds/level4/level4.bof +} +actors/L04GRP.tex +sounds/level4/level4.bnk + +###################################### +### LEVEL 5 ########################## +###################################### +music/LEVEL5.VH +music/LEVEL5.VB +Levels/LEVEL5.tex + +{ LEVEL5_CACHE 4 +# Generic +ui/PAUSEMENU.msh +ui/PAUSELIGHTS.msh +ui/PAUSELIGHTS2.msh +ui/compass.msh +ui/moveon.msh +sfx/asteroid.msh +sfx/card.msh +sfx/dagger.msh +sfx/icicle.msh +sfx/missile.msh +sfx/projectile.msh +sfx/sonic.msh +sfx/telesphere.msh +pickups/pu-health.msh +pickups/pu-crr.msh +pickups/pu-crg.msh +pickups/pu-crb.msh +pickups/pu-cry.msh +pickups/pu-crp.msh +pickups/pu-invun.msh +pickups/pu-life.msh +pickups/pu-mosb.msh +pickups/pu-mogo.msh +pickups/pu-mosg.msh +pickups/pu-mosr.msh +pickups/pu-mogp.msh +pickups/pu-card.msh +pickups/pu-keyt.msh +pickups/pu-sell.msh +# pickups/pu-sward.msh +pickups/pu-aura00.msh +pickups/pu-aura10.msh +pickups/pu-aura11.msh +pickups/pu-aura20.msh +pickups/pu-aura30.msh +pickups/pu-aura31.msh +pickups/pu-aura40.msh +pickups/pu-aura00blue.msh + +# Level Data +Levels/LEVEL5.lvl + +# Actors +actors/CAPTAIN.Act +actors/FAIRWEATHER.Act +actors/KID.Act +actors/M01PURPLE.Act +actors/M08.Act +actors/B06.Act + +# Sound & Music +music/LEVEL5.PXM +sounds/level5/level5.bof +} +actors/L05GRP.tex +sounds/level5/level5.bnk + +###################################### +### LEVEL 6 ########################## +###################################### +music/LEVEL6.VH +music/LEVEL6.VB +Levels/LEVEL6.tex + +{ LEVEL6_CACHE 4 +# Generic +ui/PAUSEMENU.msh +ui/PAUSELIGHTS.msh +ui/PAUSELIGHTS2.msh +ui/compass.msh +ui/moveon.msh +sfx/asteroid.msh +sfx/card.msh +sfx/dagger.msh +sfx/icicle.msh +sfx/missile.msh +sfx/projectile.msh +sfx/sonic.msh +sfx/telesphere.msh +pickups/pu-health.msh +pickups/pu-crr.msh +pickups/pu-crg.msh +pickups/pu-crb.msh +pickups/pu-cry.msh +pickups/pu-crp.msh +pickups/pu-invun.msh +pickups/pu-life.msh +pickups/pu-mosb.msh +pickups/pu-mogo.msh +pickups/pu-mosg.msh +pickups/pu-mosr.msh +pickups/pu-mogp.msh +pickups/pu-card.msh +pickups/pu-keyt.msh +pickups/pu-sell.msh +# pickups/pu-sward.msh +pickups/pu-aura00.msh +pickups/pu-aura10.msh +pickups/pu-aura11.msh +pickups/pu-aura20.msh +pickups/pu-aura30.msh +pickups/pu-aura31.msh +pickups/pu-aura40.msh +pickups/pu-aura00blue.msh + +# Level Data +Levels/LEVEL6.lvl + +# Actors +actors/CAPTAIN.Act +actors/FAIRWEATHER.Act +actors/SCIENTIST.Act +actors/KID.Act +queencocoon/queencocoon.msh +actors/M01PINK.Act +actors/M06.Act +actors/M09.Act + +# Sound & Music +music/LEVEL6.PXM +sounds/level6/level6.bof +} +actors/L06GRP.tex +sounds/level6/level6.bnk + +###################################### +### LEVEL 7 ########################## +###################################### +music/LEVEL7.VH +music/LEVEL7.VB +Levels/LEVEL7.tex + +{ LEVEL7_CACHE 4 +# Generic +ui/PAUSEMENU.msh +ui/PAUSELIGHTS.msh +ui/PAUSELIGHTS2.msh +ui/compass.msh +ui/moveon.msh +sfx/asteroid.msh +sfx/card.msh +sfx/dagger.msh +sfx/icicle.msh +sfx/missile.msh +sfx/projectile.msh +sfx/sonic.msh +sfx/telesphere.msh +pickups/pu-health.msh +pickups/pu-crr.msh +pickups/pu-crg.msh +pickups/pu-crb.msh +pickups/pu-cry.msh +pickups/pu-crp.msh +pickups/pu-invun.msh +pickups/pu-life.msh +pickups/pu-mosb.msh +pickups/pu-mogo.msh +pickups/pu-mosg.msh +pickups/pu-mosr.msh +pickups/pu-mogp.msh +pickups/pu-card.msh +pickups/pu-keyt.msh +pickups/pu-sell.msh +# pickups/pu-sward.msh +pickups/pu-aura00.msh +pickups/pu-aura10.msh +pickups/pu-aura11.msh +pickups/pu-aura20.msh +pickups/pu-aura30.msh +pickups/pu-aura31.msh +pickups/pu-aura40.msh +pickups/pu-aura00blue.msh + +# Level Data +Levels/LEVEL7.lvl + +# Actors +actors/CAPTAIN.Act +actors/FAIRWEATHER.Act +actors/TITANIUM.Act +# actors/kid.Act +queencocoon/queencocoon.msh +actors/M01YELLOW.Act +# actors/B01.Act +actors/B02.Act +actors/B03.Act +actors/B04.Act +actors/B05.Act +actors/B06.Act + +# Sound & Music +music/LEVEL7.PXM +sounds/level7/level7.bof +} +actors/L07GRP.tex +sounds/level7/level7.bnk + +###################################### +### LEVEL 8 ########################## +###################################### +music/LEVEL8.VH +music/LEVEL8.VB +Levels/LEVEL8.tex + +{ LEVEL8_CACHE 4 +# Generic +ui/PAUSEMENU.msh +ui/PAUSELIGHTS.msh +ui/PAUSELIGHTS2.msh +ui/compass.msh +ui/moveon.msh +sfx/asteroid.msh +sfx/card.msh +sfx/dagger.msh +sfx/icicle.msh +sfx/missile.msh +sfx/projectile.msh +sfx/sonic.msh +sfx/telesphere.msh +pickups/pu-health.msh +pickups/pu-crr.msh +pickups/pu-crg.msh +pickups/pu-crb.msh +pickups/pu-cry.msh +pickups/pu-crp.msh +pickups/pu-invun.msh +pickups/pu-life.msh +pickups/pu-mosb.msh +pickups/pu-mogo.msh +pickups/pu-mosg.msh +pickups/pu-mosr.msh +pickups/pu-mogp.msh +pickups/pu-card.msh +pickups/pu-keyt.msh +pickups/pu-sell.msh +# pickups/pu-sward.msh +pickups/pu-aura00.msh +pickups/pu-aura10.msh +pickups/pu-aura11.msh +pickups/pu-aura20.msh +pickups/pu-aura30.msh +pickups/pu-aura31.msh +pickups/pu-aura40.msh +pickups/pu-aura00blue.msh + +# Level Data +Levels/LEVEL8.lvl +anims/Zord.Abk + +# Actors +actors/CAPTAIN.Act +actors/FAIRWEATHER.Act +actors/KID.Act +queencocoon/queencocoon.msh +actors/B01.Act +actors/B02.Act +actors/B04.Act +actors/B06.Act + +actors/OMZORD.act +actors/STRZORD.act + +# Sound & Music +music/LEVEL8.PXM +sounds/level8/level8.bof +} +actors/OMZORD.tex +actors/STRZORD.tex +sounds/level8/level8.bnk + +###################################### +### BACKEND ########################## +###################################### +{ BACKEND_CACHE 4 +ui/hiscore.msh +} + +###################################### +### SCREENS ########################## +###################################### +screens/prlogo.gfx +screens/thqlogo.gfx +screens/foxkids.gfx +screens/credits.gfx +screens/loading.gfx + +backend/gover1.gfx +backend/gover2.gfx +backend/goverc.gfx + +loading/PinkRang.gfx +loading/GreenRan.gfx +loading/BlueRang.gfx +loading/RedRange.gfx +loading/TitRange.gfx +loading/YellowRa.gfx +loading/bots.gfx +loading/2PinkRan.gfx +loading/2GreenRa.gfx +loading/2BlueRan.gfx +loading/2RedRang.gfx +loading/2TitRang.gfx +loading/2YellowR.gfx + +gallery/comic/RedColor.gfx +gallery/comic/BlueColo.gfx +gallery/comic/GreenCol.gfx +gallery/comic/YellowCo.gfx +gallery/comic/PinkColo.gfx +gallery/comic/Titanium.gfx +gallery/comic/VypraCol.gfx +gallery/comic/QueenFac.gfx +gallery/maps/DamLv1st.gfx +gallery/maps/DamLv2nd.gfx +gallery/maps/DamLv3rd.gfx +gallery/maps/CityS1st.gfx +gallery/maps/CityS2nd.gfx +gallery/maps/CityS3rd.gfx +gallery/maps/Docks1st.gfx +gallery/maps/Docks2nd.gfx +gallery/models/Abominus.gfx +gallery/models/Stingwin.gfx +gallery/models/Cpfireor.gfx +gallery/models/CpofLoki.gfx +gallery/models/Salamand.gfx +gallery/models/Shockatr.gfx +gallery/models/smoggers.gfx +gallery/models/Bansheer.gfx +gallery/tvshow/abominus.gfx +gallery/tvshow/firejump.gfx +gallery/tvshow/fireor.gfx +gallery/tvshow/jinxer.gfx +gallery/tvshow/oldired.gfx +gallery/tvshow/omegmega.gfx +gallery/tvshow/poster03.gfx +gallery/tvshow/queen.gfx +gallery/tvshow/shockact.gfx +gallery/tvshow/smogger.gfx +gallery/tvshow/striknin.gfx +gallery/tvshow/tranmega.gfx + +options/goload.gfx + +###################################### +### To Be Assigned ################### +###################################### + +music/LVLCOMP.PXM +music/LVLCOMP.VH +music/LVLCOMP.VB +music/GAMECOMP.PXM +music/GAMECOMP.VH +music/GAMECOMP.VB +music/GAMEOVER.PXM +music/GAMEOVER.VH +music/GAMEOVER.VB +music/GALLERY.PXM +music/GALLERY.VH +music/GALLERY.VB + + diff --git a/data/translations/dut.dat b/data/translations/dut.dat new file mode 100644 index 000000000..707dabbc8 --- /dev/null +++ b/data/translations/dut.dat @@ -0,0 +1,9 @@ +;---------------------------------------- +; Please +; DO NOT edit this document with word +; DO NOT add trailing spaces and tabs +; DO NOT Omit text after identifier +; DO NOT add spaces to identifier +; DO NOT add duplicate identifiers +;---------------------------------------- + diff --git a/data/translations/ger.dat b/data/translations/ger.dat new file mode 100644 index 000000000..707dabbc8 --- /dev/null +++ b/data/translations/ger.dat @@ -0,0 +1,9 @@ +;---------------------------------------- +; Please +; DO NOT edit this document with word +; DO NOT add trailing spaces and tabs +; DO NOT Omit text after identifier +; DO NOT add spaces to identifier +; DO NOT add duplicate identifiers +;---------------------------------------- + diff --git a/data/translations/ita.dat b/data/translations/ita.dat new file mode 100644 index 000000000..707dabbc8 --- /dev/null +++ b/data/translations/ita.dat @@ -0,0 +1,9 @@ +;---------------------------------------- +; Please +; DO NOT edit this document with word +; DO NOT add trailing spaces and tabs +; DO NOT Omit text after identifier +; DO NOT add spaces to identifier +; DO NOT add duplicate identifiers +;---------------------------------------- + diff --git a/data/translations/swe.dat b/data/translations/swe.dat new file mode 100644 index 000000000..707dabbc8 --- /dev/null +++ b/data/translations/swe.dat @@ -0,0 +1,9 @@ +;---------------------------------------- +; Please +; DO NOT edit this document with word +; DO NOT add trailing spaces and tabs +; DO NOT Omit text after identifier +; DO NOT add spaces to identifier +; DO NOT add duplicate identifiers +;---------------------------------------- + diff --git a/data/translations/text.dat b/data/translations/text.dat new file mode 100644 index 000000000..c67090d65 --- /dev/null +++ b/data/translations/text.dat @@ -0,0 +1,1046 @@ +;---------------------------------------- +; Please +; DO NOT edit this document with Excel/Word +; DO NOT add trailing spaces and tabs +; DO NOT Omit text after identifier +; DO NOT add spaces to identifier +; DO NOT add duplicate identifiers +; DO NOT put - or ; characters in text strings :( +; DO NOT cut&paste from Excel/Word as it alters strings!! ( eg: ... gets translated to … ) +;---------------------------------------- + + + +; --------------------------------------------------------------- +; Some generic strings.. +; --------------------------------------------------------------- + +[STR__YES] +eng=Yes +[STR__NO] +eng=No +[STR__ON] +eng=ON +[STR__OFF] +eng=OFF +[STR__DUMMY] +eng=??? +[STR__NOW_LOADING] +eng=NOW LOADING.. + +; NOTE: This string just contains a single space +[STR__BLANK] +eng= + + + +; --------------------------------------------------------------- +; Front end +; --------------------------------------------------------------- + +[STR__FRONT_END__PRESS_START] +eng=PRESS START + +[STR__FRONT_END__HIGH_SCORES] +eng=HIGH SCORES + + + +; --------------------------------------------------------------- +; Game options +; --------------------------------------------------------------- + +; Titles of the available menus +[STR__GAME_OPTIONS_MENU__ONE_PLAYER] +eng=ONE PLAYER +[STR__GAME_OPTIONS_MENU__TWO_PLAYERS] +eng=TWO PLAYERS +[STR__GAME_OPTIONS_MENU__OPTIONS] +eng=OPTIONS +[STR__GAME_OPTIONS_MENU__CODES] +eng=CODES +[STR__GAME_OPTIONS_MENU__FILE] +eng=LOAD +[STR__GAME_OPTIONS_MENU__GALLERY] +eng=GALLERY + +; Navigation text +[STR__GAME_OPTIONS__SELECT] +eng=SELECT +[STR__GAME_OPTIONS__BACK] +eng=BACK + +; One and two player selection +[STR__GAME_OPTIONS__CHOOSE_RANGER] +eng=CHOOSE RANGER +[STR__GAME_OPTIONS__CHOOSE_RANGER_1] +eng=CHOOSE RANGER 1 +[STR__GAME_OPTIONS__CHOOSE_RANGER_2] +eng=CHOOSE RANGER 2 +[STR__GAME_OPTIONS__STRENGTH] +eng=STRENGTH +[STR__GAME_OPTIONS__SPEED] +eng=SPEED +[STR__GAME_OPTIONS__ENERGY] +eng=ENERGY + +; Sound volumes +[STR__GAME_OPTIONS__SOUND] +eng=SOUND +[STR__GAME_OPTIONS__MUSIC_VOLUME] +eng=MUSIC VOLUME +[STR__GAME_OPTIONS__SFX_VOLUME] +eng=SFX VOLUME +[STR__GAME_OPTIONS__SPEECH_VOLUME] +eng=SPEECH VOLUME + +; Screen adjustment +[STR__GAME_OPTIONS__SCREEN] +eng=SCREEN + +; Controls +[STR__GAME_OPTIONS__CONTROL_CONFIG1] +eng=CONTROLLER CONFIG 1 +[STR__GAME_OPTIONS__CONTROL_CONFIG2] +eng=CONTROLLER CONFIG 2 +[STR__GAME_OPTIONS__STEP_LEFT] +eng=Roll left +[STR__GAME_OPTIONS__RUN] +eng=Run +[STR__GAME_OPTIONS__STEP_RIGHT] +eng=Roll right +[STR__GAME_OPTIONS__SPECIAL] +eng=Special +[STR__GAME_OPTIONS__BLOCK] +eng=Block +[STR__GAME_OPTIONS__KICK] +eng=Kick +[STR__GAME_OPTIONS__PUNCH] +eng=Punch +[STR__GAME_OPTIONS__JUMP] +eng=Jump +[STR__GAME_OPTIONS__PAUSE] +eng=Pause +[STR__GAME_OPTIONS__MOVE] +eng=Move +[STR__GAME_OPTIONS__WALK_RUN] +eng=Walk/Run + +; Control method +[STR__GAME_OPTIONS__CONTROL_STYLE] +eng=SELECT CONTROL STYLE +[STR__GAME_OPTIONS__PLAYER_1] +eng=PLAYER 1 +[STR__GAME_OPTIONS__PLAYER_2] +eng=PLAYER 2 +[STR__GAME_OPTIONS__REALATIVE_MOVEMENT] +eng=Relative movement +[STR__GAME_OPTIONS__ABSOLUTE_MOVEMENT] +eng=Absolute movement +[STR__GAME_OPTIONS__RUN] +eng=Default Walk +[STR__GAME_OPTIONS__WALK] +eng=Default Run +[STR__GAME_OPTIONS__VIBRATION_ON] +eng=Vibration On +[STR__GAME_OPTIONS__VIBRATION_OFF] +eng=Vibration Off +[STR__GAME_OPTIONS__PAD_CONFIG_1] +eng=Controller Config 1 +[STR__GAME_OPTIONS__PAD_CONFIG_2] +eng=Controller Config 2 + + +; Difficulty level +[STR__GAME_OPTIONS__DIFFICULTY] +eng=CHOOSE DIFFICULTY +[STR__GAME_OPTIONS__HARD] +eng=Hard +[STR__GAME_OPTIONS__NORMAL] +eng=Normal +[STR__GAME_OPTIONS__EASY] +eng=Easy + +; Password entry +[STR__GAME_OPTIONS__ENTER_PASSWORD] +eng=ENTER CODE +[STR__GAME_OPTIONS__NEW_CODE_ACTIVATED] +eng=NEW CODE ACTIVATED +[STR__GAME_OPTIONS__INCORRECT_PASSWORD] +eng=INCORRECT CODE +[STR__GAME_OPTIONS__ALREADY_ACTIVE_PASSWORD] +eng=CODE ALREADY ACTIVE + +; Password activation +[STR__GAME_OPTIONS__ACTIVATE_CODES] +eng=ACTIVATE CODES + +; Memory card stuff +[STR__GAME_OPTIONS__LOAD] +eng=LOAD SAVED GAME DATA +[STR__GAME_OPTIONS__CHECKMEMORYCARD] +eng=Checking...\nPlease do not remove the MEMORY CARD +[STR__GAME_OPTIONS__SELECTFILETOLOAD] +eng=Select file to load from the MEMORY CARD in MEMORY CARD slot 1 +[STR__GAME_OPTIONS__UNFORMATTEDCARD] +eng=MEMORY CARD in MEMORY CARD slot 1 is not formatted +[STR__GAME_OPTIONS__NOFILESONCARD] +eng=No Power Rangers data present +[STR__GAME_OPTIONS__NOCARDINSLOT] +eng=MEMORY CARD is not inserted into the MEMORY CARD slot +[STR__GAME_OPTIONS__LOADINGPLEASEWIAT] +eng=Loading... Do not remove the MEMORY CARD in MEMORY CARD slot 1 +[STR__GAME_OPTIONS__LOADOK] +eng=Load complete! +[STR__GAME_OPTIONS__LOADERROR] +eng=Load Error! + +; Gallery stuff +[STR__GAME_OPTIONS__GALLERY_NAME] +eng=NAME +[STR__GAME_OPTIONS__GALLERY_STATUS] +eng=STATUS + +[STR__GAME_OPTIONS__GALLERY_NOT_AVAILABLE] +eng=Inactive +[STR__GAME_OPTIONS__GALLERY_AVAILABLE] +eng=Active + +[STR__GAME_OPTIONS__GALLERY0] +eng=T.V. Show +[STR__GAME_OPTIONS__GALLERY1] +eng=Models +[STR__GAME_OPTIONS__GALLERY2] +eng=Maps +[STR__GAME_OPTIONS__GALLERY3] +eng=Comic + + +; --------------------------------------------------------------- +; Password descriptions +; These are the descriptions that appear in the code list so they need to be fairly short +; --------------------------------------------------------------- + +[STR__PASSWORD_DESCRIPTION__INFHEALTH] +eng=Infinite Health +[STR__PASSWORD_DESCRIPTION__INFLIVES] +eng=Infinite Lives +[STR__PASSWORD_DESCRIPTION__LEVELSKIP] +eng=Level Skip +[STR__PASSWORD_DESCRIPTION__TITRANGER] +eng=Titanium Ranger +[STR__PASSWORD_DESCRIPTION__BLINDENEMIES] +eng=Blind Enemies +[STR__PASSWORD_DESCRIPTION__CONTINUES] +eng=Continues +[STR__PASSWORD_DESCRIPTION__RPE] +eng=Infinite RPE +[STR__PASSWORD_DESCRIPTION__GALLERY] +eng=All galleries open + + + +; --------------------------------------------------------------- +; Password values +; These are the values that appear in the codelist +; --------------------------------------------------------------- +[STR__PASSWORD_VALUES__STAGE1_1] +eng=L1 +[STR__PASSWORD_VALUES__STAGE2_1] +eng=L2 +[STR__PASSWORD_VALUES__STAGE2_2] +eng=B2 +[STR__PASSWORD_VALUES__STAGE3_1] +eng=L3 +[STR__PASSWORD_VALUES__STAGE4_1] +eng=L4 +[STR__PASSWORD_VALUES__STAGE4_2] +eng=B4 +[STR__PASSWORD_VALUES__STAGE5_1] +eng=L5 +[STR__PASSWORD_VALUES__STAGE5_2] +eng=B5 +[STR__PASSWORD_VALUES__STAGE6_1] +eng=L6 +[STR__PASSWORD_VALUES__STAGE7_1] +eng=L7 +[STR__PASSWORD_VALUES__STAGE7_2] +eng=B7 + +[STR__PASSWORD_VALUES__CONTINUES_0] +eng=0 +[STR__PASSWORD_VALUES__CONTINUES_5] +eng=5 +[STR__PASSWORD_VALUES__CONTINUES_9] +eng=9 +[STR__PASSWORD_VALUES__CONTINUES_99] +eng=99 + + + +; --------------------------------------------------------------- +; Pause menu +; --------------------------------------------------------------- + +; Texts at the bottom of the display, stating which buttons can be used +[STR__PAUSE_BUTTONS__SELECT] +eng=Select +[STR__PAUSE_BUTTONS__BACK] +eng=Back +[STR__PAUSE_BUTTONS__CONTINUE] +eng=Continue + +; Options on pause menu +[STR__PAUSE_MENU_OPTION__CONTINUE] +eng=Continue +[STR__PAUSE_MENU_OPTION__MISSION] +eng=Mission +[STR__PAUSE_MENU_OPTION__OBJECTIVES] +eng=Objectives +[STR__PAUSE_MENU_OPTION__CONTROLS] +eng=Controls +[STR__PAUSE_MENU_OPTION__QUIT] +eng=Quit +[STR__PAUSE_MENU_OPTION__SAVE] +eng=Save game + + +; Titles of the different pages in the pause menu +[STR__PAUSE_MENU_TITLE__OPTIONS] +eng=OPTIONS +[STR__PAUSE_MENU_TITLE__DEBUG] +eng=DEBUG +[STR__PAUSE_MENU_TITLE__MISSION] +eng=MISSION +[STR__PAUSE_MENU_TITLE__OBJECTIVES] +eng=OBJECTIVES +[STR__PAUSE_MENU_TITLE__CONTROLS] +eng=CONTROLS +[STR__PAUSE_MENU_TITLE__QUIT] +eng=QUIT +[STR__PAUSE_MENU_TITLE__END_OF_LEVEL] +eng=END OF LEVEL +[STR__PAUSE_BONUSES__TITLE] +eng=BONUS + + + + +; Move names as listed in the pause menu +[STR__PAUSE_MENU_MOVE__POWER_LEVEL_1] +eng=Power Level 1 +[STR__PAUSE_MENU_MOVE__POWER_LEVEL_2] +eng=Power Level 2 +[STR__PAUSE_MENU_MOVE__POWER_LEVEL_3] +eng=Power Level 3 +[STR__PAUSE_MENU_MOVE__WHILE_RISING] +eng=While rising +[STR__PAUSE_MENU_MOVE__WHILE_RUNNING] +eng=When running + +[STR__PAUSE_MENU_MOVE__K1] +eng=Straight kick +[STR__PAUSE_MENU_MOVE__K2] +eng=Left kick +[STR__PAUSE_MENU_MOVE__K3] +eng=Roundhouse kick +[STR__PAUSE_MENU_MOVE__K4] +eng=Cartwheel kick +[STR__PAUSE_MENU_MOVE__K5] +eng=Frontsweep kick +[STR__PAUSE_MENU_MOVE__K6] +eng=Jumpside kick + +[STR__PAUSE_MENU_MOVE__P1] +eng=Jab +[STR__PAUSE_MENU_MOVE__P2] +eng=Cross +[STR__PAUSE_MENU_MOVE__P3] +eng=Uppercut +[STR__PAUSE_MENU_MOVE__P4] +eng=Straight punch +[STR__PAUSE_MENU_MOVE__P5] +eng=Quick jab +[STR__PAUSE_MENU_MOVE__P6] +eng=Low Punch +[STR__PAUSE_MENU_MOVE__P7] +eng=Spinning punch +[STR__PAUSE_MENU_MOVE__P8] +eng=Uppercut + +[STR__PAUSE_MENU_MOVE__B1] +eng=Block +[STR__PAUSE_MENU_MOVE__B2] +eng=Backward jump +[STR__PAUSE_MENU_MOVE__B3] +eng=Sideroll + +[STR__PAUSE_MENU_MOVE__N1] +eng=Special +[STR__PAUSE_MENU_MOVE__N2] +eng=Walk/Run +[STR__PAUSE_MENU_MOVE__N3] +eng=Sideroll + +[STR__PAUSE_MENU_MOVE__R1] +eng=Getup attack + + +; Quit page +[STR__PAUSE_MENU_QUIT__REALLY_QUIT] +eng=Really quit? + + +; Story page +[STR__PAUSE_MENU_STORY__PRESS_SELECT] +eng=PRESS SELECT + +; Story page +[STR__PAUSE_MENU_STORY__SECTOR_NOT_CLEARED] +eng=SECTOR NOT CLEARED ! + + +; Save page +[STR__PAUSE_MENU_SAVE__SAVE] +eng=SAVE GAME +[STR__PAUSE_MENU_SAVE__NOSPACEONCARD] +eng=Insufficient free blocks +[STR__PAUSE_MENU_SAVE__SELECTFILETOSAVE] +eng=Select file to save to the MEMORY CARD in MEMORY CARD slot 1 +[STR__PAUSE_MENU_SAVE__NEWSAVE] +eng=- NEW SAVE - +[STR__PAUSE_MENU_SAVE__ENTERSAVENAME] +eng=Enter filename to save +[STR__PAUSE_MENU_SAVE__DUPLICATESAVENAME] +eng=Are you sure you want to overwrite this file? +[STR__PAUSE_MENU_SAVE__DOYOUWANTTOFORMATCARD] +eng=MEMORY CARD in MEMORY CARD slot 1 is not formatted. Do you wish to format? +[STR__PAUSE_MENU_SAVE__FORMATTINGPLEASEWIAT] +eng=Formatting... Do not remove the MEMORY CARD in MEMORY CARD slot 1 +[STR__PAUSE_MENU_SAVE__FORMATTINGOK] +eng=Format complete!\n\nPress X to continue +[STR__PAUSE_MENU_SAVE__FORMATTINGERROR] +eng=Format Error!\n\nPress X to continue +[STR__PAUSE_MENU_SAVE__FORMATTINGINTERRUPTED] +eng=Operation interrupted!\n\nPress X to continue +[STR__PAUSE_MENU_SAVE__SAVEINGPLEASEWIAT] +eng=Saving... Do not remove the MEMORY CARD in MEMORY CARD slot 1 +[STR__PAUSE_MENU_SAVE__SAVEOK] +eng=Save complete!\n\nPress X to continue +[STR__PAUSE_MENU_SAVE__SAVEERROR] +eng=Save error!\n\nPress X to continue + + +; End of level bonus stuff +[STR__PAUSE_BONUSES__HOSTAGES_RESCUED] +eng=Hostages Rescued +[STR__PAUSE_BONUSES__MONSTERS_KILLED] +eng=Monsters Defeated +[STR__PAUSE_BONUSES__PICKUPS_COLLECTED] +eng=Pickups Collected +[STR__PAUSE_BONUSES__QUAKE_SPIKES_COLLECTED] +eng=Quake Spikes Destroyed +[STR__PAUSE_BONUSES__FUEL_CELLS_COLLECTED] +eng=Fuel Cells Collected +[STR__PAUSE_BONUSES__HAS_NOT_DIED] +eng=Survival Bonus +[STR__PAUSE_BONUSES__NOT_USED_SPECIAL] +eng=Combat Bonus +[STR__PAUSE_BONUSES__LIVES_REMAINING] +eng=Lives Remaining +[STR__PAUSE_BONUSES__PERFECT] +eng=Skill Bonus + + +; Controller removed stuff +[STR__PAUSE__CONTROLLER_1_REMOVED] +eng=NO CONTROLLER INSERTED IN CONTROLLER PORT 1 +[STR__PAUSE__CONTROLLER_2_REMOVED] +eng=NO CONTROLLER INSERTED IN CONTROLLER PORT 2 + + +; Objectives +[STR__PAUSE__OBJECTIVE_HOSTAGES_RESCUED] +eng=Hostages Rescued +[STR__PAUSE__OBJECTIVE_QUAKE_SPIKES_DESTROYED] +eng=Quake Spikes Destroyed +[STR__PAUSE__OBJECTIVE_KEY_PARTS_RECOVERED] +eng=Key Parts Recovered +[STR__PAUSE__OBJECTIVE_FUEL_CELLS_RECOVERED] +eng=Fuel Cells Recovered +[STR__PAUSE__OBJECTIVE_LIFE_FORCE_STONES_RECOVERED] +eng=Life Force Stones Recovered + + +; --------------------------------------------------------------- +; Level intro +; --------------------------------------------------------------- + +[STR__LEVEL_INTRO__ENTERING_LEVEL] +eng=LEVEL %d + +[STR__LEVEL__OMEGA_MEGAZORD] +eng=Omega Megazord +[STR__LEVEL__SUPERTRAIN_MEGAZORD] +eng=Supertrain Megazord +[STR__LEVEL__LIGHTSPEED_RESCUE] +eng=Lightspeed Rescue! + +[STR__LEVEL_INTRO__1] +eng=Operation Lightspeed +[STR__LEVEL_INTRO__2] +eng=Lightspeed Teamwork +[STR__LEVEL_INTRO__3] +eng=Rail Rescue +[STR__LEVEL_INTRO__4] +eng=Go Volcanic +[STR__LEVEL_INTRO__5] +eng=Safety First +[STR__LEVEL_INTRO__6] +eng=Lightspeed Rescue +[STR__LEVEL_INTRO__7] +eng=The Road To Skull Cavern + + + + + + + + + +; --------------------------------------------------------------- +; --------------------------------------------------------------- +; Ingame Texts +; These texts appear during each level +; --------------------------------------------------------------- +; --------------------------------------------------------------- + + +; --------------------------------------------------------------- +; Credits/Continues +; --------------------------------------------------------------- +[STR__INGAME__CREDITS] +eng=CREDITS %d +[STR__INGAME__CONTINUE] +eng=CONTINUE %d? + + +; --------------------------------------------------------------- +; Character names +; --------------------------------------------------------------- +[STR__NAME__CAPT_MITCHELL] +eng=Capt. Mitchell +[STR__NAME__MISS_FAIRWEATHER] +eng=Miss. Fairweather +[STR__NAME__QUEEN_BANSHEERA] +eng=Queen Bansheera +[STR__NAME__RED_RANGER] +eng=Red Ranger + + +; --------------------------------------------------------------- +; Level 1 +; --------------------------------------------------------------- + +[STR__VOSCRIPT_0001] +eng=Alert status.\nThere are reports of a siege in downtown Mariner Bay. The monsters seem to be using magical powers to keep the city police away. We suspect it's the work of Queen Bansheera. Your mission Rangers, neutralize this evil so the police can enter the building. +[STR__VOSCRIPT_0002] +eng=Once you arrive at the building we will be able to track you via your Rescue Morphers. Find a way in and rescue any hostages you find on the office floors. Meanwhile, my techs at the Aquabase lab will be locking on to them and teleporting them to safety. It's my job to make sure you stay one step ahead of Queen Bansheera's monsters. +[STR__VOSCRIPT_0002a] +eng=Find a way in and rescue all the hostages found on the office floors. +[STR__VOSCRIPT_0003] +eng=These items improve your special attack. The more you collect, the stronger you become. +[STR__VOSCRIPT_0004] +eng=Well-done Ranger! All the hostages have been rescued from the building. Have you found and destroyed the leader of the Battlings?\nOur sensors have picked up a strong magical source coming from under the building. It's unclear, but the cause of the trouble appears to be emanating from there.\nRanger, be careful... +[STR__VOSCRIPT_0004a] +eng=Ranger, destroy Vypra! + + +; --------------------------------------------------------------- +; Level 2 +; --------------------------------------------------------------- + +[STR__VOSCRIPT_0005] +eng=We have completed our analysis of the crystal you received from defeating Vypra. It appears to be her 'Life-force' stone which, in the wrong hands, could restore her life energy. You must hold onto any crystals retrieved from Queen Bansheera's minions. +[STR__VOSCRIPT_0006] +eng=We have reports of a Code Red. Our seismological data confirms that someone or something is trying to damage the dam. If that happens, we will be facing a serious ecological disaster and Mariner Bay will be washed out to sea.\nGo Rangers! +[STR__VOSCRIPT_0007] +eng=Ranger, our satellite has pin-pointed the source of the seismological activity.\nYou need to destroy all the 'Quake Spikes'. Go to alert status.\nGood luck! +[STR__VOSCRIPT_0007a] +eng=Find and rescue the hostages. +[STR__VOSCRIPT_0007b] +eng=Find and destroy all Quake Spikes. +[STR__VOSCRIPT_0008] +eng=Well done, that's half of the Quake Spikes destroyed, but there's no time to relax: you still need to destroy the other half. +[STR__VOSCRIPT_0009] +eng=Hold on Ranger, that card looks like a trap. Use extreme caution!. +[STR__VOSCRIPT_0010] +eng=We have just finished developing the Supertrain Megazord! These massive machines have been programmed to automatically assist you in defeating any opposing threat.\nThis will be the Supertrain Megazord's first test drive.\nGood luck, Ranger!! +[STR__VOSCRIPT_0010a] +eng=Ranger, get Loki! +[STR__VOSCRIPT_0011] +eng=I am alive. I must be freed.\nThis world will be mine again! + + + +; --------------------------------------------------------------- +; Level 3 +; --------------------------------------------------------------- +[STR__VOSCRIPT_0012] +eng=Ranger, we've got trouble.\nThe Supertrain has been hijacked! Our sensors show that it is being controlled by an enemy on board. Use Aero Rescue Three for drop off at the end of Rail Rescue Five and work your way to the front neutralizing all threats as you go.\nGO! GO! GO! +[STR__VOSCRIPT_0012a] +eng=You must regain control of the Supertrain. +[STR__VOSCRIPT_0012b] +eng=Ranger, you must defeat Jinxer! + + + +; --------------------------------------------------------------- +; Level 4 +; --------------------------------------------------------------- +[STR__VOSCRIPT_0013] +eng=Rangers, listen up. All of your training up to now will be tested to its limits. An asteroid has just hit the city and created a volcanic mountain. With your help the city has a chance.\nLightspeed Rescue! +[STR__VOSCRIPT_0014] +eng=Right now our top priority is to rescue all the trapped civilians. +[STR__VOSCRIPT_0014a] +eng=Find and rescue all the hostages. +[STR__VOSCRIPT_0015] +eng=Well done Ranger: you're on target for saving all of the civilians. Our Lightspeed Rescue research team believes that the Asteroid is somehow alive. We need you now to focus your attention on the large rock itself and get closer to it. +[STR__VOSCRIPT_0016] +eng=This has all the hallmarks of Queen Bansheera. Yes I'm right, Battlings have started to swarm all over the place. Quick, no time to lose. Advance to the asteroid as quickly as possible. +[STR__VOSCRIPT_0016a] +eng=Destroy the evil Fireor. +[STR__VOSCRIPT_0016b] +eng=Ranger, Magmavore must be stopped. +[STR__VOSCRIPT_0016c] +eng=Ranger, you must obliterate Diabolico. + + + +; --------------------------------------------------------------- +; Level 5 +; --------------------------------------------------------------- +[STR__VOSCRIPT_0017] +eng=These 'Fuel Cells' are extremely explosive. They must be delivered to Headquarters via the docks. Your assignment is to collect these precious items before marauding Battlings find them. +[STR__VOSCRIPT_0018] +eng=It is essential that you retrieve these dangerous items. In the wrong hands they could cause immense environmental damage. Make sure you keep them away from high temperatures. Return back safely. +[STR__VOSCRIPT_0018a] +eng=You must find and rescue all the civilians. +[STR__VOSCRIPT_0018b] +eng=Ranger, destroy Olympius! + + + +; --------------------------------------------------------------- +; Level 6 +; --------------------------------------------------------------- +[STR__VOSCRIPT_0019] +eng=Ranger, the Battlings have entered.... TRANSMISSION INTERRUPTED +[STR__VOSCRIPT_0020] +eng=Ranger, we are under attack! I repeat, we are under attack! Our defenses have been breached. Captain Mitchell is missing. Somehow the Battlings have passed through our defenses undetected. Please help us quickly. You can gain access to the base via one of the submarine pools.\nOh no, too late!\nRanger help. +[STR__VOSCRIPT_0021] +eng=This time Lightspeed Power Rangers you are too late. I now control all of Aquabase and all of Lightspeed. I have taken your "palace" from you! Ha ha ha ha! +[STR__VOSCRIPT_0021a] +eng=You must rescue all hostages. +[STR__VOSCRIPT_0021b] +eng=Rescue Ms. Fairweather. +[STR__VOSCRIPT_0022] +eng=Thank you Ranger for rescuing me. Now it's time to rescue Dana's father. First, take me to security's main terminal. +[STR__VOSCRIPT_0022a] +eng=Find security's main terminal. +[STR__VOSCRIPT_0023] +eng=Well done! The security systems will be overridden in a few minutes. +[STR__VOSCRIPT_0023a] +eng=Ranger, you must hold off the Battlings 'til the power is restored. +[STR__VOSCRIPT_0024] +eng=Okay, that's it! Provisional control is now back online and in the hands of Lightspeed Rescue. The main computer has tracked Captain Mitchell to the main control room of Aquabase. Find the other main switches to gain access. I shall keep track of your progress from behind these locked doors. Now go! +[STR__VOSCRIPT_0024a] +eng=Find the other two main switches to gain access to the control room. +[STR__VOSCRIPT_0025] +eng=Well done Ranger, I knew we could trust you to save the day. This will be your final battle! Now step through that portal to Samai Road and defeat Queen Bansheera. +[STR__VOSCRIPT_0025a] +eng=Ranger, destroy the elusive Mermatron! + + + +; --------------------------------------------------------------- +; Level 7 +; --------------------------------------------------------------- +[STR__VOSCRIPT_0026] +eng=Ranger, this portal is the entrance to the Queen's dimension. You must destroy her before the planetary alignment restores her strength. We will try to communicate with you once you step through the portal, but the connection might be unstable. Good luck! +[STR__VOSCRIPT_0026a] +eng=Unlock Demonite!!! +[STR__VOSCRIPT_0026b] +eng=Unlock the Titanium Ranger! +[STR__VOSCRIPT_0026c] +eng=This is the final battle, Ranger!!! Destroy Queen Bansheera!!!! +[STR__VOSCRIPT_0027] +eng=I summon the energy of my minions. They shall live on! +[STR__VOSCRIPT_0028] +eng=Pathetic humans. You are too late. The crossover is here. It is time... +[STR__VOSCRIPT_0029] +eng=Contact re-established.\nWe have completed work on our ultimate weapon. Use the Omega MegaZord, Ranger... + + + +; --------------------------------------------------------------- +; End sequence +; --------------------------------------------------------------- +[STR__VOSCRIPT_0030] +eng=Congratulations Ranger. Evil has been banished. Your training and skills have saved the day. +[STR__VOSCRIPT_0031] +eng=But we're going to keep Aquabase functional, for there will always be a successor ready to take Queen Bansheera's place. +[STR__VOSCRIPT_0032] +eng=We'll be ready! +[STR__VOSCRIPT_0033] +eng=LIGHTSPEED RESCUE! + + + + + + +; --------------------------------------------------------------- +; Back end +; --------------------------------------------------------------- + +[STR__BACK_END__GAMEOVER] +eng=GAME OVER + +[STR__BACK_END__CONGRATSPLAYER1] +eng=Congratulations Player One! + +[STR__BACK_END__CONGRATSPLAYER2] +eng=Congratulations Player Two! + +[STR__BACK_END__ENTERNAME] +eng=Enter your name! + +[STR__BACK_END__POSITION] +eng=You made position %d in the high score table! + + + +; --------------------------------------------------------------- +; Monster names +; --------------------------------------------------------------- + +[STR__MNAME__QUEEN] +eng=Queen +[STR__MNAME__DIABOLICO] +eng=Diabolico +[STR__MNAME__VYPRA] +eng=Vypra +[STR__MNAME__LOKI] +eng=Loki +[STR__MNAME__JINXER] +eng=Jinxer +[STR__MNAME__OLYMPUS] +eng=Olympius + +[STR__MNAME__M01] +eng=Battling +[STR__MNAME__M02] +eng=Fireor +[STR__MNAME__M03] +eng=Magmavore +[STR__MNAME__M04] +eng=Cog +[STR__MNAME__M05] +eng=Stingwinger +[STR__MNAME__M06] +eng=Abominus +[STR__MNAME__M07] +eng=Smogger +[STR__MNAME__M08] +eng=Strikning +[STR__MNAME__M09] +eng=Mermatron +[STR__MNAME__M10] +eng=Shockatron +[STR__MNAME__M11] +eng=Omega Megazord +[STR__MNAME__M12] +eng=Supertrain Megazord + + + + +; --------------------------------------------------------------- +; Credits +; --------------------------------------------------------------- + + +[STR__CREDITS__PRESIDENT] +eng=President +[STR__CREDITS__MANAGING_DIRECTOR] +eng=Managing Director +[STR__CREDITS__DEVELOPMENT_DIRECTOR] +eng=Development Director +[STR__CREDITS__CREATIVE_DIRECTOR] +eng=Creative Director +[STR__CREDITS__PRODUCER] +eng=Producer +[STR__CREDITS__LEAD_PROGRAMMER] +eng=Lead Programmer +[STR__CREDITS__LEAD_ARTIST] +eng=Lead Artists +[STR__CREDITS__LEAD_DESIGNER] +eng=Lead Designer +[STR__CREDITS__PROGRAMMERS] +eng=Programmers +[STR__CREDITS__ARTISTS] +eng=Artists +[STR__CREDITS__ANIMATION] +eng=Animation +[STR__CREDITS__ADDITIONAL_ART_AND_ANIMATION] +eng=Additional Art and Animation +[STR__CREDITS__SOUND_AND_AUDIO] +eng=Sound and Audio +[STR__CREDITS__QUALITY_ASSURANCE_MANAGER] +eng=QA Manager +[STR__CREDITS__QA_TESTERS] +eng=QA Testers +[STR__CREDITS__WITH_SPECIAL_THANKS_TO] +eng=With Special Thanks to +[STR__CREDITS__ASSOCIATE_PRODUCER] +eng=Associate Producer +[STR__CREDITS__ASSISTANT_PRODUCER] +eng=Assistant Producer +[STR__CREDITS__EXECUTIVE_PRODUCER] +eng=Executive Producer +[STR__CREDITS__VP_OF_PRODUCT_DEVELOPMENT] +eng=VP of Product Development +[STR__CREDITS__QA_MANAGERS] +eng=QA Managers +[STR__CREDITS__LEAD_TESTER] +eng=Lead Tester +[STR__CREDITS__TESTERS] +eng=Testers +[STR__CREDITS__PRODUCT_MANAGER] +eng=Product Manager +[STR__CREDITS__ASSOCIATE_PRODUCT_MANAGER] +eng=Associate Product Manager +[STR__CREDITS__CREATIVE_SERVICES] +eng=Creative Services +[STR__CREDITS__VO_TALENT] +eng=VO Talent +[STR__CREDITS__LICENSING_AND_MERCHANDISING_DIRECTOR] +eng=Licensing and Merchandising Director +[STR__CREDITS__COORDINATOR] +eng=Coordinator +[STR__CREDITS__CREATIVE_RESOURCES] +eng=Creative Resources + + + +; Saban + +[STR__CREDITS__SABAN_CREDITS] +eng= Saban Credits + +[STR__CREDITS__CINDY_DAVIS] +eng=Cindy Davis +[STR__CREDITS__CHRISTIANE_TOWNSEND] +eng=Christiane Townsend +[STR__CREDITS__DONNY_SOEDER] +eng=Donny Soeder + + + +; THQ + +[STR__CREDITS__THQ_CREDITS] +eng=THQ Credits + +[STR__CREDITS__PETRO_PIASECKYJ] +eng=Petro Piaseckyj +[STR__CREDITS__ED_RAMIRO] +eng=Ed Ramiro +[STR__CREDITS__CAROLINA_BEROZA] +eng=Carolina Beroza +[STR__CREDITS__SCOTT_KRAGER] +eng=Scott Krager +[STR__CREDITS__MICHAEL_RUBINELLI] +eng=Michael Rubinelli +[STR__CREDITS__DONN_NAUERT] +eng=Donn Nauert +[STR__CREDITS__JEREMY_BARNES] +eng=Jeremy Barnes +[STR__CREDITS__RYAN_CAMU] +eng=Ryan Camu +[STR__CREDITS__JASON_DE_HERAS] +eng=Jason de Heras +[STR__CREDITS__MAURICIO_HERNANDEZ] +eng=Mauricio Hernandez +[STR__CREDITS__MIKE_KAFITY] +eng=Mike Kafity +[STR__CREDITS__STEFAN_MENDEZ] +eng=Stefan Mendez +[STR__CREDITS__MICHAEL_PARKER] +eng=Michael Parker +[STR__CREDITS__MIKE_TOPPER] +eng=Mike Topper +[STR__CREDITS__RACHEL_SILVERSTEIN] +eng=Rachel Silverstein +[STR__CREDITS__KEVIN_HOOPER] +eng=Kevin Hooper +[STR__CREDITS__KIRK_SOMDAL] +eng=Kirk Somdal +[STR__CREDITS__BRIAN_FARRELL] +eng=Brian Farrell +[STR__CREDITS__JEFFREY_LAPIN] +eng=Jeffrey Lapin +[STR__CREDITS__ALISON_LOCKE] +eng=Alison Locke +[STR__CREDITS__GERMAINE_GIOIA] +eng=Germaine Gioia +[STR__CREDITS__LESLIE_BROWN] +eng=Leslie Brown +[STR__CREDITS__TIFFANY_TERNAN] +eng=Tiffany Ternan +[STR__CREDITS__PETER_DILLE] +eng=Peter Dille +[STR__CREDITS__JAMIE_BAFUS] +eng=Jamie Bafus +[STR__CREDITS__LALIE_FISHER] +eng=Lalie Fisher +[STR__CREDITS__CINDY_DAVIS] +eng=Cindy Davis +[STR__CREDITS__DEB_MCCOY_LARSON] +eng=Deb McCoy Larson +[STR__CREDITS__SEAN_CW_JOHNSON__RED_RANGER] +eng=Sean Cw Johnson - Red Ranger +[STR__CREDITS__MICHAEL_CHATURANTABUT__BLUE_RANGER] +eng=Michael Chaturantabut - Blue Ranger +[STR__CREDITS__KEITH_ROBINSON__GREEN_RANGER] +eng=Keith Robinson - Green Ranger +[STR__CREDITS__SASHA_WILLIAMS__YELLOW_RANGER] +eng=Sasha Williams - Yellow Ranger +[STR__CREDITS__ALISON_MACINNIS_PINK_RANGER] +eng=Alison MacInnis - Pink Ranger +[STR__CREDITS__RHETT_FISHER___TITANIUM_RANGER] +eng=Rhett Fisher - Titanium Ranger +[STR__CREDITS__RON_ROGGE____CAPTAIN__MITCHELL] +eng=Ron Rogge' - Captain Mitchell +[STR__CREDITS__MONICA_LOUWERENS__MISS_FAIRWEATHER] +eng=Monica Louwerens - Miss Fairweather +[STR__CREDITS__DIANE_SALINGER___QUEEN_BANSHEERA] +eng=Diane Salinger - Queen Bansheera +[STR__CREDITS__JUSTINE_ARONOFF__GIRL] +eng=Justine Aronoff - Girl +[STR__CREDITS__LAURA_OROZCO__WOMAN] +eng=Laura Orozco - Woman +[STR__CREDITS__ZACH_PAGTER__BOY] +eng=Zach Pagter - Boy +[STR__CREDITS__SCOTT_PAGE_PAGTER__MAN] +eng=Scott Page-Pagter - Man +[STR__CREDITS__JUSTIN_GRUSH] +eng=Justin Grush +[STR__CREDITS__MORGAN_CLARK] +eng=Morgan Clark + +[STR__CREDITS__THQ_AND_THE_THQ_LOGO_ARE_] +eng=THQ and the THQ logo are trademarks and/or registered trademarks of THQ Inc. +[STR__CREDITS___C__2000_THQ_INC_] +eng=(c) 2000 THQ Inc. + + + +; Climax + +[STR__CREDITS__CLIMAX_GROUP_CREDITS] +eng=Climax Group Credits + +[STR__CREDITS__KARL_JEFFERY] +eng=Karl Jeffery +[STR__CREDITS__GARY_LIDDON] +eng=Gary Liddon +[STR__CREDITS__CHRIS_HADLEY] +eng=Chris Hadley +[STR__CREDITS__JOSEPH_CAVALLA] +eng=Joseph Cavalla +[STR__CREDITS__JIM_GARDNER] +eng=Jim Gardner +[STR__CREDITS__DAVE_OWENS] +eng=Dave Owens +[STR__CREDITS__THOR_HAYTON] +eng=Thor H Hayton +[STR__CREDITS__NICK_DRY] +eng=Nick Dry +[STR__CREDITS__CHARLES_BLAIR] +eng=Charlie Blair +[STR__CREDITS__PAUL_GRENFELL] +eng=Paul Grenfell +[STR__CREDITS__TIM_SWANN] +eng=Tim Swann +[STR__CREDITS__JAMES_BRACE] +eng=James Brace +[STR__CREDITS__DAVID_PIMM] +eng=David Pimm +[STR__CREDITS__KEVIN_MARTIN] +eng=Kevin Martin +[STR__CREDITS__NICK_THOMAS] +eng=Nick Thomas +[STR__CREDITS__MATT_EVERITT] +eng=Matt Everitt +[STR__CREDITS__MATT_HUGHES] +eng=Matt Hughes +[STR__CREDITS__PETER_PANTON] +eng=Peter Panton +[STR__CREDITS__STEVE_SAMPSON] +eng=Steve Sampson +[STR__CREDITS__STEVE_CROCKER] +eng=Steve Crocker +[STR__CREDITS__MATT_SIMMONDS] +eng=Matt Simmonds +[STR__CREDITS__STUART_BAYLISS] +eng=Stuart Bayliss +[STR__CREDITS__BARRY_MARTIN] +eng=Barry Martin +[STR__CREDITS__KRAIG_MORGAN] +eng=Kraig Morgan +[STR__CREDITS__JAMES_NEILSON] +eng=James Neilson +[STR__CREDITS__CHRISS_JUBB] +eng=Chris Jubb +[STR__CREDITS__OLIVER_REED_SMITH] +eng=Oliver Reid-Smith +[STR__CREDITS__MATT_SAMSAM] +eng=Matt Sansam +[STR__CREDITS__MIKE_ARMSTRONG] +eng=Mike Armstrong +[STR__CREDITS__DAVE_FALLER] +eng=Dave Faller +[STR__CREDITS__JAMES_PARHAM] +eng=James Parham + +[STR__CREDITS__CAROLINE_MILLER] +eng=Caroline Miller +[STR__CREDITS__CAL_BLAGBROUGH] +eng=Cal Blagbrough + +[STR__CREDITS__HELLOS] +eng=Very Special Thanks Indeed to + +[STR__CREDITS__HILARY_GARDNER] +eng=Hilary Gardner +[STR__CREDITS__TEREZA_PARSONS] +eng=Tereza Parsons +[STR__CREDITS__RACHEL_FORD] +eng=Rachel Ford +[STR__CREDITS__CATHERINE_ROCHATTE] +eng=Catherine Rochatte +[STR__CREDITS__BRASHLEY] +eng=Ashley and Bradley Bricknell + + +; --------------------------------------------------------------- +; Debugging text +; The following texts DO NOT require translation +; --------------------------------------------------------------- + +[STR__ART_REMOVE_THIS_TRIGGER] +eng=THIS TRIGGER SHOULD NOT BE HERE\nTO BE REMOVED BY ART.. + diff --git a/tools/Banker.exe b/tools/Banker.exe new file mode 100644 index 000000000..21c6d55d1 Binary files /dev/null and b/tools/Banker.exe differ diff --git a/tools/MkData.exe b/tools/MkData.exe new file mode 100644 index 000000000..d239369ea Binary files /dev/null and b/tools/MkData.exe differ diff --git a/tools/MkSpeech.exe b/tools/MkSpeech.exe new file mode 100644 index 000000000..f9870a28e Binary files /dev/null and b/tools/MkSpeech.exe differ diff --git a/tools/Perl/bin/GET b/tools/Perl/bin/GET new file mode 100644 index 000000000..1207cd7fe --- /dev/null +++ b/tools/Perl/bin/GET @@ -0,0 +1,505 @@ +#!perl -w + +# $Id: lwp-request.PL,v 1.33 1998/08/04 09:18:11 aas Exp $ +# +# Simple user agent using LWP library. + +=head1 NAME + +lwp-request, GET, HEAD, POST - Simple WWW user agent + +=head1 SYNOPSIS + + lwp-request [-aeEdvhx] [-m method] [-b ] [-t ] + [-i ] [-c ] [-C ] + [-p ] [-o ] ... + +=head1 DESCRIPTION + +This program can be used to send requests to WWW servers and your +local file system. The request content for POST, PUT and CHECKIN +methods is read from stdin. The content of the response is printed on +stdout. Error messages are printed on stderr. The program returns a +status value indicating the number of URLs that failed. + +The options are: + +=over 4 + +=item -m + +Set which method to use for the request. If this option is not used, +then the method is derived from the name of the program. + +=item -f + +Force request through, even if the program believes that the method is +illegal. The server will probably reject the request. + +=item -b + +This URL will be used as the base URL for the URLs that the method is +applied to. The base URL only takes effect for relative URLs. If you +do not provide this option and the URLs are relative, then they will +be treated as files in the local file system. + +=item -t + +Set the timeout value for the requests. The timeout is the amount of +time that the program will wait for a response from the remote server +before it fails. The default unit for the timeout value is seconds. +You might append "m" or "h" to the timeout value to make it minutes or +hours, respectively. The default timeout is '3m', i.e. 3 minutes. + +=item -i