mirror of
https://github.com/ondra-novak/gates_of_skeldal.git
synced 2025-07-05 14:10:27 -04:00
libs compiles
This commit is contained in:
parent
1b0f7fe0c2
commit
a7278bac40
121 changed files with 1528 additions and 1731 deletions
|
@ -1,4 +1,4 @@
|
|||
__inline void *getmem(long sz)
|
||||
__inline void *getmem(int32_t sz)
|
||||
{
|
||||
return malloc(sz);
|
||||
}
|
|
@ -3,4 +3,5 @@ project(skeldal)
|
|||
|
||||
include_directories(platform libs)
|
||||
add_compile_options(-funsigned-char)
|
||||
add_subdirectory(libs)
|
||||
add_subdirectory(game)
|
||||
|
|
|
@ -36,15 +36,15 @@ bool DDLFile::ReadFile(void *data, size_t sz)
|
|||
|
||||
bool DDLFile::EnumFiles(IDDLFileEnumerator &enmClass)
|
||||
{
|
||||
unsigned long firstGroup;
|
||||
unsigned long groupEndOffset;
|
||||
unsigned long endGroups;
|
||||
uint32_t firstGroup;
|
||||
uint32_t groupEndOffset;
|
||||
uint32_t endGroups;
|
||||
int i;
|
||||
int ngroups;
|
||||
SetFilePointer(_hFile,0,0,FILE_BEGIN);
|
||||
if (ReadFile(&firstGroup,sizeof(firstGroup))==false) return false;
|
||||
if (ReadFile(&groupEndOffset,sizeof(firstGroup))==false) return false;
|
||||
unsigned long *group=(unsigned long *)alloca(groupEndOffset);
|
||||
uint32_t *group=(uint32_t *)alloca(groupEndOffset);
|
||||
group[0]=firstGroup;
|
||||
group[1]=groupEndOffset;
|
||||
ngroups=groupEndOffset/8;
|
||||
|
@ -56,13 +56,13 @@ bool DDLFile::EnumFiles(IDDLFileEnumerator &enmClass)
|
|||
WString fname;
|
||||
for (i=0;i<ngroups;i++)
|
||||
{
|
||||
unsigned long endGroup=(i+1)<ngroups?group[i*2+3]:endGroups;
|
||||
uint32_t endGroup=(i+1)<ngroups?group[i*2+3]:endGroups;
|
||||
SetFilePointer(_hFile,group[i*2+1],0,FILE_BEGIN);
|
||||
unsigned long pos=group[i*2+1];
|
||||
uint32_t pos=group[i*2+1];
|
||||
while (pos<endGroup)
|
||||
{
|
||||
char buff[13];
|
||||
unsigned long offset;
|
||||
uint32_t offset;
|
||||
if (ReadFile(buff,12)==false) return false;
|
||||
if (ReadFile(&offset,4)==false) return false;
|
||||
buff[12]=0;
|
||||
|
@ -74,15 +74,15 @@ bool DDLFile::EnumFiles(IDDLFileEnumerator &enmClass)
|
|||
return true;
|
||||
}
|
||||
|
||||
unsigned long DDLFile::GetFileSize(unsigned long offset)
|
||||
uint32_t DDLFile::GetFileSize(uint32_t offset)
|
||||
{
|
||||
unsigned long sz=0;
|
||||
uint32_t sz=0;
|
||||
SetFilePointer(_hFile,offset,0,FILE_BEGIN);
|
||||
ReadFile(&sz,4);
|
||||
return sz;
|
||||
}
|
||||
|
||||
DDLData DDLFile::ExtractFile(unsigned long offset)
|
||||
DDLData DDLFile::ExtractFile(uint32_t offset)
|
||||
{
|
||||
SetFilePointer(_hFile,offset,0,FILE_BEGIN);
|
||||
DDLData data;
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
class IDDLFileEnumerator
|
||||
{
|
||||
public:
|
||||
virtual bool File(WString name, int group, unsigned long offset)=0;
|
||||
virtual bool File(WString name, int group, uint32_t offset)=0;
|
||||
};
|
||||
|
||||
struct DDLData
|
||||
|
@ -40,6 +40,6 @@ public:
|
|||
|
||||
bool OpenDDLFile(WString filename);
|
||||
bool EnumFiles(IDDLFileEnumerator &enmClass);
|
||||
DDLData ExtractFile(unsigned long offset);
|
||||
unsigned long GetFileSize(unsigned long offset);
|
||||
DDLData ExtractFile(uint32_t offset);
|
||||
uint32_t GetFileSize(uint32_t offset);
|
||||
};
|
||||
|
|
|
@ -281,7 +281,7 @@ static CString GetGroupName(int group)
|
|||
return res;
|
||||
}
|
||||
|
||||
bool CDDLReaderDlg::File(WString name, int group, unsigned long offset)
|
||||
bool CDDLReaderDlg::File(WString name, int group, uint32_t offset)
|
||||
{
|
||||
LVITEM item;
|
||||
CString grpname=GetGroupName(group);
|
||||
|
@ -305,10 +305,10 @@ void CDDLReaderDlg::UpdateList(void)
|
|||
_ddlfile.EnumFiles(*this);
|
||||
for (int i=0,cnt=wFileList.GetItemCount();i<cnt;i++)
|
||||
{
|
||||
unsigned long offset;
|
||||
uint32_t offset;
|
||||
tmp=wFileList.GetItemText(i,3);
|
||||
offset=_wtoi(tmp);
|
||||
unsigned long size=_ddlfile.GetFileSize(offset);
|
||||
uint32_t size=_ddlfile.GetFileSize(offset);
|
||||
if (size<1024)
|
||||
tmp.Format(_T("%d B"),size);
|
||||
else
|
||||
|
@ -364,8 +364,8 @@ static int CALLBACK SortItemsInFileList(LPARAM lParam1, LPARAM lParam2, LPARAM l
|
|||
{
|
||||
sinfo.left=sinfo.list->GetItemText(lParam1,3);
|
||||
sinfo.right=sinfo.list->GetItemText(lParam2,3);
|
||||
unsigned long l=_wtoi(sinfo.left);
|
||||
unsigned long r=_wtoi(sinfo.right);
|
||||
uint32_t l=_wtoi(sinfo.left);
|
||||
uint32_t r=_wtoi(sinfo.right);
|
||||
l=sinfo._ddlfile->GetFileSize(l);
|
||||
r=sinfo._ddlfile->GetFileSize(r);
|
||||
res=(l>r)-(l<r);
|
||||
|
@ -463,9 +463,9 @@ void CDDLReaderDlg::OnBnClickedExport()
|
|||
pb.wProgress.SetPos(++cur);
|
||||
int i=wFileList.GetNextSelectedItem(pos);
|
||||
CString fname;
|
||||
unsigned long offset;
|
||||
uint32_t offset;
|
||||
fname=wFileList.GetItemText(i,1);
|
||||
offset=(unsigned long)_wtoi64(wFileList.GetItemText(i,3));
|
||||
offset=(uint32_t)_wtoi64(wFileList.GetItemText(i,3));
|
||||
pb.wDesc.SetWindowText(fname);
|
||||
if (PeekMessage(&msg,0,0,0,PM_NOREMOVE)==TRUE) AfxPumpMessage();
|
||||
if (pb.stop) break;
|
||||
|
@ -506,9 +506,9 @@ WPathname CDDLReaderDlg::CreateTemp(int index)
|
|||
{
|
||||
if (!_lastTemp.IsNull()) DeleteFile(_lastTemp);
|
||||
CString fname;
|
||||
unsigned long offset;
|
||||
uint32_t offset;
|
||||
fname=wFileList.GetItemText(index,1);
|
||||
offset=(unsigned long)_wtoi64(wFileList.GetItemText(index,3));
|
||||
offset=(uint32_t)_wtoi64(wFileList.GetItemText(index,3));
|
||||
_lastTemp.SetTempDirectory();
|
||||
_lastTemp.SetFileTitle(WSC("SkeldalDDLReader"));
|
||||
_lastTemp.SetExtension(WSC(".")+WString(fname));
|
||||
|
|
|
@ -60,7 +60,7 @@ public:
|
|||
DDLFile _ddlfile;
|
||||
afx_msg void OnEnKillfocusDdlfile();
|
||||
void UpdateList(void);
|
||||
virtual bool File(WString name, int group, unsigned long offset);
|
||||
virtual bool File(WString name, int group, uint32_t offset);
|
||||
afx_msg void OnBnClickedDdlbrowse();
|
||||
afx_msg void OnLvnColumnclickFilelist(NMHDR *pNMHDR, LRESULT *pResult);
|
||||
afx_msg void OnBnClickedBrowse();
|
||||
|
|
|
@ -15,7 +15,7 @@ public:
|
|||
@param curSize size of string that enters to the effect
|
||||
@return count of extra characters needs to effects;
|
||||
*/
|
||||
virtual unsigned long GetEffectExtraSize(unsigned long curSize) {return 0;}
|
||||
virtual uint32_t GetEffectExtraSize(uint32_t curSize) {return 0;}
|
||||
|
||||
///function renders begin of string.
|
||||
/** Function returns number of characters rendered, and must be <= then size returned by GetEffectExtraSize()
|
||||
|
@ -23,14 +23,14 @@ public:
|
|||
@param curSize size of string that enters to the effect
|
||||
@return number of characters rendered. Entered string will be rendered behind.
|
||||
*/
|
||||
virtual unsigned long PreRenderString(wchar_t *renderPtr,unsigned long curSize) {return 0;}
|
||||
virtual uint32_t PreRenderString(wchar_t *renderPtr,uint32_t curSize) {return 0;}
|
||||
|
||||
///function renders effect.
|
||||
/**
|
||||
@param renderPtr pointer to begin of render buffer.
|
||||
@param rendered number of characters rendered by previous effect. Value doesn't point to the end
|
||||
of buffer, function must add result of PreRenderString */
|
||||
virtual void RenderString(wchar_t *renderPtr, unsigned long rendered)=0;
|
||||
virtual void RenderString(wchar_t *renderPtr, uint32_t rendered)=0;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -36,15 +36,15 @@ bool DDLFile::ReadFile(void *data, size_t sz)
|
|||
|
||||
bool DDLFile::EnumFiles(IDDLFileEnumerator &enmClass)
|
||||
{
|
||||
unsigned long firstGroup;
|
||||
unsigned long groupEndOffset;
|
||||
unsigned long endGroups;
|
||||
uint32_t firstGroup;
|
||||
uint32_t groupEndOffset;
|
||||
uint32_t endGroups;
|
||||
int i;
|
||||
int ngroups;
|
||||
SetFilePointer(_hFile,0,0,FILE_BEGIN);
|
||||
if (ReadFile(&firstGroup,sizeof(firstGroup))==false) return false;
|
||||
if (ReadFile(&groupEndOffset,sizeof(firstGroup))==false) return false;
|
||||
unsigned long *group=(unsigned long *)alloca(groupEndOffset);
|
||||
uint32_t *group=(uint32_t *)alloca(groupEndOffset);
|
||||
group[0]=firstGroup;
|
||||
group[1]=groupEndOffset;
|
||||
ngroups=groupEndOffset/8;
|
||||
|
@ -56,13 +56,13 @@ bool DDLFile::EnumFiles(IDDLFileEnumerator &enmClass)
|
|||
WString fname;
|
||||
for (i=0;i<ngroups;i++)
|
||||
{
|
||||
unsigned long endGroup=(i+1)<ngroups?group[i*2+3]:endGroups;
|
||||
uint32_t endGroup=(i+1)<ngroups?group[i*2+3]:endGroups;
|
||||
SetFilePointer(_hFile,group[i*2+1],0,FILE_BEGIN);
|
||||
unsigned long pos=group[i*2+1];
|
||||
uint32_t pos=group[i*2+1];
|
||||
while (pos<endGroup)
|
||||
{
|
||||
char buff[13];
|
||||
unsigned long offset;
|
||||
uint32_t offset;
|
||||
if (ReadFile(buff,12)==false) return false;
|
||||
if (ReadFile(&offset,4)==false) return false;
|
||||
buff[12]=0;
|
||||
|
@ -74,15 +74,15 @@ bool DDLFile::EnumFiles(IDDLFileEnumerator &enmClass)
|
|||
return true;
|
||||
}
|
||||
|
||||
unsigned long DDLFile::GetFileSize(unsigned long offset)
|
||||
uint32_t DDLFile::GetFileSize(uint32_t offset)
|
||||
{
|
||||
unsigned long sz=0;
|
||||
uint32_t sz=0;
|
||||
SetFilePointer(_hFile,offset,0,FILE_BEGIN);
|
||||
ReadFile(&sz,4);
|
||||
return sz;
|
||||
}
|
||||
|
||||
DDLData DDLFile::ExtractFile(unsigned long offset)
|
||||
DDLData DDLFile::ExtractFile(uint32_t offset)
|
||||
{
|
||||
SetFilePointer(_hFile,offset,0,FILE_BEGIN);
|
||||
DDLData data;
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
class IDDLFileEnumerator
|
||||
{
|
||||
public:
|
||||
virtual bool File(WString name, int group, unsigned long offset)=0;
|
||||
virtual bool File(WString name, int group, uint32_t offset)=0;
|
||||
};
|
||||
|
||||
struct DDLData
|
||||
|
@ -40,6 +40,6 @@ public:
|
|||
|
||||
bool OpenDDLFile(WString filename);
|
||||
bool EnumFiles(IDDLFileEnumerator &enmClass);
|
||||
DDLData ExtractFile(unsigned long offset);
|
||||
unsigned long GetFileSize(unsigned long offset);
|
||||
DDLData ExtractFile(uint32_t offset);
|
||||
uint32_t GetFileSize(uint32_t offset);
|
||||
};
|
||||
|
|
|
@ -281,7 +281,7 @@ static CString GetGroupName(int group)
|
|||
return res;
|
||||
}
|
||||
|
||||
bool CDDLReaderDlg::File(WString name, int group, unsigned long offset)
|
||||
bool CDDLReaderDlg::File(WString name, int group, uint32_t offset)
|
||||
{
|
||||
LVITEM item;
|
||||
CString grpname=GetGroupName(group);
|
||||
|
@ -305,10 +305,10 @@ void CDDLReaderDlg::UpdateList(void)
|
|||
_ddlfile.EnumFiles(*this);
|
||||
for (int i=0,cnt=wFileList.GetItemCount();i<cnt;i++)
|
||||
{
|
||||
unsigned long offset;
|
||||
uint32_t offset;
|
||||
tmp=wFileList.GetItemText(i,3);
|
||||
offset=_wtoi(tmp);
|
||||
unsigned long size=_ddlfile.GetFileSize(offset);
|
||||
uint32_t size=_ddlfile.GetFileSize(offset);
|
||||
if (size<1024)
|
||||
tmp.Format(_T("%d B"),size);
|
||||
else
|
||||
|
@ -364,8 +364,8 @@ static int CALLBACK SortItemsInFileList(LPARAM lParam1, LPARAM lParam2, LPARAM l
|
|||
{
|
||||
sinfo.left=sinfo.list->GetItemText(lParam1,3);
|
||||
sinfo.right=sinfo.list->GetItemText(lParam2,3);
|
||||
unsigned long l=_wtoi(sinfo.left);
|
||||
unsigned long r=_wtoi(sinfo.right);
|
||||
uint32_t l=_wtoi(sinfo.left);
|
||||
uint32_t r=_wtoi(sinfo.right);
|
||||
l=sinfo._ddlfile->GetFileSize(l);
|
||||
r=sinfo._ddlfile->GetFileSize(r);
|
||||
res=(l>r)-(l<r);
|
||||
|
@ -463,9 +463,9 @@ void CDDLReaderDlg::OnBnClickedExport()
|
|||
pb.wProgress.SetPos(++cur);
|
||||
int i=wFileList.GetNextSelectedItem(pos);
|
||||
CString fname;
|
||||
unsigned long offset;
|
||||
uint32_t offset;
|
||||
fname=wFileList.GetItemText(i,1);
|
||||
offset=(unsigned long)_wtoi64(wFileList.GetItemText(i,3));
|
||||
offset=(uint32_t)_wtoi64(wFileList.GetItemText(i,3));
|
||||
pb.wDesc.SetWindowText(fname);
|
||||
if (PeekMessage(&msg,0,0,0,PM_NOREMOVE)==TRUE) AfxPumpMessage();
|
||||
if (pb.stop) break;
|
||||
|
@ -506,9 +506,9 @@ WPathname CDDLReaderDlg::CreateTemp(int index)
|
|||
{
|
||||
if (!_lastTemp.IsNull()) DeleteFile(_lastTemp);
|
||||
CString fname;
|
||||
unsigned long offset;
|
||||
uint32_t offset;
|
||||
fname=wFileList.GetItemText(index,1);
|
||||
offset=(unsigned long)_wtoi64(wFileList.GetItemText(index,3));
|
||||
offset=(uint32_t)_wtoi64(wFileList.GetItemText(index,3));
|
||||
_lastTemp.SetTempDirectory();
|
||||
_lastTemp.SetFileTitle(WSC("SkeldalDDLReader"));
|
||||
_lastTemp.SetExtension(WSC(".")+WString(fname));
|
||||
|
|
|
@ -60,7 +60,7 @@ public:
|
|||
DDLFile _ddlfile;
|
||||
afx_msg void OnEnKillfocusDdlfile();
|
||||
void UpdateList(void);
|
||||
virtual bool File(WString name, int group, unsigned long offset);
|
||||
virtual bool File(WString name, int group, uint32_t offset);
|
||||
afx_msg void OnBnClickedDdlbrowse();
|
||||
afx_msg void OnLvnColumnclickFilelist(NMHDR *pNMHDR, LRESULT *pResult);
|
||||
afx_msg void OnBnClickedBrowse();
|
||||
|
|
|
@ -15,7 +15,7 @@ public:
|
|||
@param curSize size of string that enters to the effect
|
||||
@return count of extra characters needs to effects;
|
||||
*/
|
||||
virtual unsigned long GetEffectExtraSize(unsigned long curSize) {return 0;}
|
||||
virtual uint32_t GetEffectExtraSize(uint32_t curSize) {return 0;}
|
||||
|
||||
///function renders begin of string.
|
||||
/** Function returns number of characters rendered, and must be <= then size returned by GetEffectExtraSize()
|
||||
|
@ -23,14 +23,14 @@ public:
|
|||
@param curSize size of string that enters to the effect
|
||||
@return number of characters rendered. Entered string will be rendered behind.
|
||||
*/
|
||||
virtual unsigned long PreRenderString(wchar_t *renderPtr,unsigned long curSize) {return 0;}
|
||||
virtual uint32_t PreRenderString(wchar_t *renderPtr,uint32_t curSize) {return 0;}
|
||||
|
||||
///function renders effect.
|
||||
/**
|
||||
@param renderPtr pointer to begin of render buffer.
|
||||
@param rendered number of characters rendered by previous effect. Value doesn't point to the end
|
||||
of buffer, function must add result of PreRenderString */
|
||||
virtual void RenderString(wchar_t *renderPtr, unsigned long rendered)=0;
|
||||
virtual void RenderString(wchar_t *renderPtr, uint32_t rendered)=0;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -60,7 +60,7 @@ int WString::Format(wchar_t *format, ...)
|
|||
|
||||
int WString::ScanStringV(const wchar_t *format, va_list lst) const
|
||||
{
|
||||
unsigned long *ptr=(unsigned long *)lst;
|
||||
uint32_t *ptr=(uint32_t *)lst;
|
||||
return swscanf(GetString(),format,ptr[0],ptr[1],ptr[2],ptr[3],ptr[4],ptr[5],ptr[6],ptr[7],ptr[8],ptr[9],
|
||||
ptr[10],ptr[11],ptr[12],ptr[13],ptr[14],ptr[15],ptr[16],ptr[17],ptr[18],ptr[19]);
|
||||
|
||||
|
|
|
@ -9,8 +9,8 @@
|
|||
// Construction/Destruction
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
/** Funkce vytvoří transitivní uzávěr.
|
||||
to znamená, že zruší všechny zřetězené redirecty.
|
||||
/** Funkce vytvo<EFBFBD><EFBFBD> transitivn<76> uz<75>v<EFBFBD>r.
|
||||
to znamen<EFBFBD>, <EFBFBD>e zru<EFBFBD><EFBFBD> v<EFBFBD>echny z<EFBFBD>et<EFBFBD>zen<EFBFBD> redirecty.
|
||||
*/
|
||||
WStringProxy *WStringProxy::TransitivniUzaver()
|
||||
{
|
||||
|
@ -94,7 +94,7 @@ void WStringProxy::RenderStringToBuffer(wchar_t *renderPtr)
|
|||
break;
|
||||
case OpEffect:
|
||||
{
|
||||
unsigned long offset=0;
|
||||
uint32_t offset=0;
|
||||
renderPtr[_stringSize]=0; //we can append zero, because right side of string is not yet rendered
|
||||
//if this is end of string, one extra character for zero is also allocated.
|
||||
//efect functions can rely on it.
|
||||
|
|
|
@ -90,24 +90,24 @@ public:
|
|||
};
|
||||
public:
|
||||
|
||||
unsigned long _refCount; //reference count
|
||||
unsigned long _stringSize:30; //string size in characters (maximum size 1073741823 characters ~ 2147483646 bytes)
|
||||
uint32_t _refCount; //reference count
|
||||
uint32_t _stringSize:30; //string size in characters (maximum size 1073741823 characters ~ 2147483646 bytes)
|
||||
Operation _operation:2; //operation with string or proxy type
|
||||
|
||||
union
|
||||
{
|
||||
WStringProxy *_baseString; //pointer to next proxy referenced by this proxy
|
||||
unsigned long _blockData; //user defined block data for OpMemBlock proxy type
|
||||
uint32_t _blockData; //user defined block data for OpMemBlock proxy type
|
||||
const wchar_t *_redirect; //used for OpMemBlock, when _blockData2 is zero.
|
||||
};
|
||||
|
||||
union
|
||||
{
|
||||
WStringProxy *_secondString; //pointer to second string for OpConcat
|
||||
unsigned long _offset; //offset of substring for OpSubstr
|
||||
uint32_t _offset; //offset of substring for OpSubstr
|
||||
Effect _effect; //effect selector for OpEffect
|
||||
IWStringEffect *_userEffect; //user effect defined by IWStringEffect interface (valid when _effect is invalid)
|
||||
unsigned long _blockData2; //user defined block data for OpMemBlock proxy type - exception: if this value is zero, member _redirect is valid
|
||||
uint32_t _blockData2; //user defined block data for OpMemBlock proxy type - exception: if this value is zero, member _redirect is valid
|
||||
|
||||
};
|
||||
|
||||
|
@ -128,7 +128,7 @@ public:
|
|||
_offset(0)
|
||||
{_baseString->AddRef();}
|
||||
|
||||
WStringProxy(WStringProxy *other, unsigned long offset, unsigned long size):
|
||||
WStringProxy(WStringProxy *other, uint32_t offset, uint32_t size):
|
||||
_refCount(0),
|
||||
_stringSize(size),
|
||||
_baseString(other),
|
||||
|
@ -160,7 +160,7 @@ public:
|
|||
_userEffect(userEffect)
|
||||
{_baseString->AddRef();}
|
||||
|
||||
WStringProxy(unsigned long size, unsigned long user1, unsigned long user2):
|
||||
WStringProxy(uint32_t size, uint32_t user1, uint32_t user2):
|
||||
_refCount(0),
|
||||
_stringSize(size),
|
||||
_operation(OpMemBlck),
|
||||
|
@ -200,7 +200,7 @@ public:
|
|||
}
|
||||
|
||||
|
||||
unsigned long GetLength() {return _stringSize;}
|
||||
uint32_t GetLength() {return _stringSize;}
|
||||
void AddRef() {if (this) WStringMemory::AddRefProxy(this);}
|
||||
void Release() {if (this) if (WStringMemory::ReleaseRefProxy(this)) WStringMemory::FreeProxy(this);}
|
||||
|
||||
|
|
|
@ -60,7 +60,7 @@ int WString::Format(wchar_t *format, ...)
|
|||
|
||||
int WString::ScanStringV(const wchar_t *format, va_list lst) const
|
||||
{
|
||||
unsigned long *ptr=(unsigned long *)lst;
|
||||
uint32_t *ptr=(uint32_t *)lst;
|
||||
return swscanf(GetString(),format,ptr[0],ptr[1],ptr[2],ptr[3],ptr[4],ptr[5],ptr[6],ptr[7],ptr[8],ptr[9],
|
||||
ptr[10],ptr[11],ptr[12],ptr[13],ptr[14],ptr[15],ptr[16],ptr[17],ptr[18],ptr[19]);
|
||||
|
||||
|
|
|
@ -9,8 +9,8 @@
|
|||
// Construction/Destruction
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
/** Funkce vytvoří transitivní uzávěr.
|
||||
to znamená, že zruší všechny zřetězené redirecty.
|
||||
/** Funkce vytvo<EFBFBD><EFBFBD> transitivn<76> uz<75>v<EFBFBD>r.
|
||||
to znamen<EFBFBD>, <EFBFBD>e zru<EFBFBD><EFBFBD> v<EFBFBD>echny z<EFBFBD>et<EFBFBD>zen<EFBFBD> redirecty.
|
||||
*/
|
||||
WStringProxy *WStringProxy::TransitivniUzaver()
|
||||
{
|
||||
|
@ -94,7 +94,7 @@ void WStringProxy::RenderStringToBuffer(wchar_t *renderPtr)
|
|||
break;
|
||||
case OpEffect:
|
||||
{
|
||||
unsigned long offset=0;
|
||||
uint32_t offset=0;
|
||||
renderPtr[_stringSize]=0; //we can append zero, because right side of string is not yet rendered
|
||||
//if this is end of string, one extra character for zero is also allocated.
|
||||
//efect functions can rely on it.
|
||||
|
|
|
@ -90,24 +90,24 @@ public:
|
|||
};
|
||||
public:
|
||||
|
||||
unsigned long _refCount; //reference count
|
||||
unsigned long _stringSize:30; //string size in characters (maximum size 1073741823 characters ~ 2147483646 bytes)
|
||||
uint32_t _refCount; //reference count
|
||||
uint32_t _stringSize:30; //string size in characters (maximum size 1073741823 characters ~ 2147483646 bytes)
|
||||
Operation _operation:2; //operation with string or proxy type
|
||||
|
||||
union
|
||||
{
|
||||
WStringProxy *_baseString; //pointer to next proxy referenced by this proxy
|
||||
unsigned long _blockData; //user defined block data for OpMemBlock proxy type
|
||||
uint32_t _blockData; //user defined block data for OpMemBlock proxy type
|
||||
const wchar_t *_redirect; //used for OpMemBlock, when _blockData2 is zero.
|
||||
};
|
||||
|
||||
union
|
||||
{
|
||||
WStringProxy *_secondString; //pointer to second string for OpConcat
|
||||
unsigned long _offset; //offset of substring for OpSubstr
|
||||
uint32_t _offset; //offset of substring for OpSubstr
|
||||
Effect _effect; //effect selector for OpEffect
|
||||
IWStringEffect *_userEffect; //user effect defined by IWStringEffect interface (valid when _effect is invalid)
|
||||
unsigned long _blockData2; //user defined block data for OpMemBlock proxy type - exception: if this value is zero, member _redirect is valid
|
||||
uint32_t _blockData2; //user defined block data for OpMemBlock proxy type - exception: if this value is zero, member _redirect is valid
|
||||
|
||||
};
|
||||
|
||||
|
@ -128,7 +128,7 @@ public:
|
|||
_offset(0)
|
||||
{_baseString->AddRef();}
|
||||
|
||||
WStringProxy(WStringProxy *other, unsigned long offset, unsigned long size):
|
||||
WStringProxy(WStringProxy *other, uint32_t offset, uint32_t size):
|
||||
_refCount(0),
|
||||
_stringSize(size),
|
||||
_baseString(other),
|
||||
|
@ -160,7 +160,7 @@ public:
|
|||
_userEffect(userEffect)
|
||||
{_baseString->AddRef();}
|
||||
|
||||
WStringProxy(unsigned long size, unsigned long user1, unsigned long user2):
|
||||
WStringProxy(uint32_t size, uint32_t user1, uint32_t user2):
|
||||
_refCount(0),
|
||||
_stringSize(size),
|
||||
_operation(OpMemBlck),
|
||||
|
@ -200,7 +200,7 @@ public:
|
|||
}
|
||||
|
||||
|
||||
unsigned long GetLength() {return _stringSize;}
|
||||
uint32_t GetLength() {return _stringSize;}
|
||||
void AddRef() {if (this) WStringMemory::AddRefProxy(this);}
|
||||
void Release() {if (this) if (WStringMemory::ReleaseRefProxy(this)) WStringMemory::FreeProxy(this);}
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* Copyright (C) 1987, by Steven A. Bennett
|
||||
*
|
||||
* Permission is given by the author to freely redistribute and include
|
||||
* this code in any program as long as this credit is given where due.
|
||||
* this code in any program as int32_t as this credit is given where due.
|
||||
*
|
||||
* In accordance with the above, I want to credit Steve Wilhite who wrote
|
||||
* the code which this is heavily inspired by...
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/* Various error codes used by decoder
|
||||
* and my own routines... It's okay
|
||||
* for you to define whatever you want,
|
||||
* as long as it's negative... It will be
|
||||
* as int32_t as it's negative... It will be
|
||||
* returned intact up the various subroutine
|
||||
* levels...
|
||||
*/
|
||||
|
|
|
@ -58,8 +58,8 @@ static void done_bar_draw(int x1,int y1,int x2,int y2,OBJREC *o)
|
|||
|
||||
void done_bar(OBJREC *o) //define(...done_bar,max);
|
||||
{
|
||||
o->runs[0]=done_bar_init;
|
||||
o->runs[1]=done_bar_draw;
|
||||
o->call_init=done_bar_init;
|
||||
o->call_draw=done_bar_draw;
|
||||
o->datasize=4;
|
||||
}
|
||||
|
||||
|
@ -238,8 +238,8 @@ static void view_line_draw(int x1,int y1, int x2, int y2, OBJREC *o)
|
|||
|
||||
void view_line(OBJREC *o)
|
||||
{
|
||||
o->runs[0]=view_line_init;
|
||||
o->runs[1]=view_line_draw;
|
||||
o->call_init=view_line_init;
|
||||
o->call_draw=view_line_draw;
|
||||
}
|
||||
|
||||
|
||||
|
@ -369,8 +369,8 @@ char do_script(int section)
|
|||
{
|
||||
char s[200];
|
||||
|
||||
sprintf(s,"Instal tor nedok z l zpracovat © dek '%s' - P©¡kaz '%s' vr til chybu",command,commands[i]);
|
||||
if (msg_box("Chyba v INF",'\x1',s,"Ignoruj","P©eru¨it",NULL)==2) return 1;
|
||||
sprintf(s,"Instal<EFBFBD>tor nedok<6F>z<EFBFBD>l zpracovat <20><>dek '%s' - P<><50>kaz '%s' vr<76>til chybu",command,commands[i]);
|
||||
if (msg_box("Chyba v INF",'\x1',s,"Ignoruj","P<EFBFBD>eru<EFBFBD>it",NULL)==2) return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -412,7 +412,7 @@ char *get_cdrom()
|
|||
}
|
||||
else
|
||||
{
|
||||
strcpy(s,"<nen¡>");
|
||||
strcpy(s,"<nen<EFBFBD>>");
|
||||
}
|
||||
return s;
|
||||
}
|
||||
|
|
|
@ -109,7 +109,7 @@ void string_list_sup_call()
|
|||
v=string_list(*(char **)(o_aktual->userptr),v);
|
||||
if (v+1) c_set_value(0,id,v);
|
||||
o_aktual=p;
|
||||
p->events[3]();
|
||||
p->on_change();
|
||||
o_aktual=o_start;
|
||||
}
|
||||
|
||||
|
@ -156,9 +156,9 @@ void str_line_event(EVENT_MSG *msg,OBJREC *o)
|
|||
|
||||
void str_line(OBJREC *o)
|
||||
{
|
||||
o->runs[0]=str_line_init;
|
||||
o->runs[1]=str_line_draw;
|
||||
o->runs[2]=str_line_event;
|
||||
o->call_init=str_line_init;
|
||||
o->call_draw=str_line_draw;
|
||||
o->call_event=str_line_event;
|
||||
o->datasize=4;
|
||||
}
|
||||
|
||||
|
@ -293,7 +293,7 @@ void value_store_init(OBJREC *o,int *bytes)
|
|||
|
||||
void value_store(OBJREC *o)
|
||||
{
|
||||
o->runs[0]=value_store_init;
|
||||
o->call_init=value_store_init;
|
||||
}
|
||||
|
||||
void action_flags()
|
||||
|
@ -623,7 +623,7 @@ void chozeni2(EVENT_MSG *msg,OBJREC *o)
|
|||
if (msg->msg==E_DONE) return ;
|
||||
if (msg->msg==E_KEYBOARD)
|
||||
{
|
||||
if (o_aktual==NULL || o_aktual->events[3]!=chozeni2) return;
|
||||
if (o_aktual==NULL || o_aktual->on_change!=chozeni2) return;
|
||||
if (waktual->id==map_win || waktual->id==tool_bar)
|
||||
select_window(sektor_win);
|
||||
if (waktual->id!=sektor_win) return;
|
||||
|
@ -907,10 +907,10 @@ void open_sector_win(void)
|
|||
c_default(0); on_control_enter(string_list_sup);on_control_change(set_change_map);
|
||||
define(80,5,125,95,12,0,str_line,side_names);property(&b2,NULL,&f_sel,WINCOLOR);
|
||||
c_default(0); on_control_enter(string_list_sup);on_control_change(set_change_map);
|
||||
define(140,103,35,12,12,0,check_box,"");o_end->runs[2]=o_end->events[3];
|
||||
define(150,103,65,12,12,0,check_box,"");o_end->runs[2]=o_end->events[3];
|
||||
define(160,103,95,12,12,0,check_box,"");o_end->runs[2]=o_end->events[3];
|
||||
define(170,103,125,12,12,0,check_box,"");o_end->runs[2]=o_end->events[3];
|
||||
define(140,103,35,12,12,0,check_box,"");o_end->call_event=o_end->on_change;
|
||||
define(150,103,65,12,12,0,check_box,"");o_end->call_event=o_end->on_change;
|
||||
define(160,103,95,12,12,0,check_box,"");o_end->call_event=o_end->on_change;
|
||||
define(170,103,125,12,12,0,check_box,"");o_end->call_event=o_end->on_change;
|
||||
define(200,5,155,110,12,0,str_line,ceils);property(&b2,NULL,&f_sel,WINCOLOR);
|
||||
c_default(0); on_control_enter(string_list_sup);on_control_change(set_change_map);
|
||||
define(210,5,185,110,12,0,str_line,floors);property(&b2,NULL,&f_sel,WINCOLOR);
|
||||
|
|
12
MAPS/ITEMS.C
12
MAPS/ITEMS.C
|
@ -448,8 +448,8 @@ TITEM *items_on_map()
|
|||
if (waktual->id==tool_bar) close_current();
|
||||
select_window(map_win);
|
||||
o=find_object(waktual,10);
|
||||
o->runs[1]=workspace_items;
|
||||
o->runs[2]=workspace_select_item;
|
||||
o->call_draw=workspace_items;
|
||||
o->call_event=workspace_select_item;
|
||||
set_window_modal();
|
||||
selected_item=NULL;
|
||||
while (selected_item==NULL && waktual->id==map_win) do_events();
|
||||
|
@ -468,8 +468,8 @@ void item_umisti_v_mape(TITEM *it)
|
|||
if (waktual->id==tool_bar) close_current();
|
||||
select_window(map_win);
|
||||
o=find_object(waktual,10);
|
||||
o->runs[1]=workspace_items;
|
||||
o->runs[2]=workspace_select_item;
|
||||
o->call_draw=workspace_items;
|
||||
o->call_event=workspace_select_item;
|
||||
set_window_modal();
|
||||
lastpos_sec=-1;
|
||||
while (waktual->id==map_win)
|
||||
|
@ -535,8 +535,8 @@ void ikona_click(EVENT_MSG *msg,OBJREC *o)
|
|||
|
||||
void ikona(OBJREC *o)
|
||||
{
|
||||
o->runs[1]=ikona_display;
|
||||
o->runs[2]=ikona_click;
|
||||
o->call_draw=ikona_display;
|
||||
o->call_event=ikona_click;
|
||||
o->datasize=4;
|
||||
}
|
||||
|
||||
|
|
|
@ -175,8 +175,8 @@ void ikona_click(EVENT_MSG *msg,OBJREC *o)
|
|||
|
||||
void ikona(OBJREC *o)
|
||||
{
|
||||
o->runs[1]=ikona_display;
|
||||
o->runs[2]=ikona_click;
|
||||
o->call_draw=ikona_display;
|
||||
o->call_event=ikona_click;
|
||||
o->datasize=4;
|
||||
}
|
||||
|
||||
|
|
|
@ -441,10 +441,10 @@ void dtext_draw(int x1,int y1,int x2, int y2,OBJREC *o)
|
|||
|
||||
void dtext(OBJREC *o)
|
||||
{
|
||||
o->runs[0]=dtext_init;
|
||||
o->runs[1]=dtext_draw;
|
||||
//o->runs[2]=sample_event;
|
||||
//o->runs[3]=sample_done;
|
||||
o->call_init=dtext_init;
|
||||
o->call_draw=dtext_draw;
|
||||
//o->call_event=sample_event;
|
||||
//o->call_done=sample_done;
|
||||
}
|
||||
|
||||
void about()
|
||||
|
@ -485,7 +485,7 @@ void fog_bar_draw(int x1,int y1,int x2,int y2,OBJREC *o)
|
|||
|
||||
void fog_bar(OBJREC *o)
|
||||
{
|
||||
o->runs[1]=fog_bar_draw;
|
||||
o->call_draw=fog_bar_draw;
|
||||
}
|
||||
|
||||
void close_app(void)
|
||||
|
|
|
@ -817,9 +817,9 @@ void workspace_event(EVENT_MSG *msg,OBJREC *o)
|
|||
}
|
||||
void workspace(OBJREC *o)
|
||||
{
|
||||
//o->runs[0]=workspace_init;
|
||||
o->runs[1]=workspace_draw;
|
||||
o->runs[2]=workspace_event;
|
||||
//o->call_init=workspace_init;
|
||||
o->call_draw=workspace_draw;
|
||||
o->call_event=workspace_event;
|
||||
o->datasize=4;
|
||||
}
|
||||
|
||||
|
|
|
@ -106,9 +106,9 @@ void pcx_view_done(OBJREC *o)
|
|||
|
||||
void pcx_view(OBJREC *o)
|
||||
{
|
||||
o->runs[0]=pcx_view_init;
|
||||
o->runs[1]=pcx_view_draw;
|
||||
o->runs[3]=pcx_view_done;
|
||||
o->call_init=pcx_view_init;
|
||||
o->call_draw=pcx_view_draw;
|
||||
o->call_done=pcx_view_done;
|
||||
o->datasize=129;
|
||||
}
|
||||
|
||||
|
@ -146,8 +146,8 @@ void symetry_event(EVENT_MSG *msg,OBJREC *o)
|
|||
|
||||
void symetry(OBJREC *o)
|
||||
{
|
||||
o->runs[1]=symetry_draw;
|
||||
o->runs[2]=symetry_event;
|
||||
o->call_draw=symetry_draw;
|
||||
o->call_event=symetry_event;
|
||||
o->datasize=4;
|
||||
}
|
||||
|
||||
|
|
|
@ -140,7 +140,7 @@ static void picture2_display(int x1,int y1,int x2,int y2,OBJREC *o)
|
|||
|
||||
static void picture2(OBJREC *o)
|
||||
{
|
||||
o->runs[1]=picture2_display;
|
||||
o->call_draw=picture2_display;
|
||||
o->datasize=4;
|
||||
}
|
||||
|
||||
|
|
|
@ -176,9 +176,9 @@ void strlist_event(EVENT_MSG *msg,OBJREC *o)
|
|||
|
||||
void strlist(OBJREC *o)
|
||||
{
|
||||
o->runs[0]=strlist_init;
|
||||
o->runs[1]=strlist_draw;
|
||||
o->runs[2]=strlist_event;
|
||||
o->call_init=strlist_init;
|
||||
o->call_draw=strlist_draw;
|
||||
o->call_event=strlist_event;
|
||||
o->datasize=4;
|
||||
|
||||
}
|
||||
|
|
|
@ -1590,7 +1590,7 @@ void show_3dbox_draw(int x1,int y1,int x2,int y2,OBJREC *o)
|
|||
|
||||
void show_3dbox(OBJREC *o)
|
||||
{
|
||||
o->runs[1]=show_3dbox_draw;
|
||||
o->call_draw=show_3dbox_draw;
|
||||
}
|
||||
|
||||
void tma_fireball(TMULTI_ACTION *p)
|
||||
|
|
|
@ -36,8 +36,8 @@ static void done_bar_draw(int x1,int y1,int x2,int y2,OBJREC *o)
|
|||
|
||||
void done_bar(OBJREC *o) //define(...done_bar,max);
|
||||
{
|
||||
o->runs[0]=done_bar_init;
|
||||
o->runs[1]=done_bar_draw;
|
||||
o->call_init=done_bar_init;
|
||||
o->call_draw=done_bar_draw;
|
||||
o->datasize=4;
|
||||
}
|
||||
|
||||
|
@ -54,7 +54,7 @@ static void pic_view_draw(int x1,int y1,int x2,int y2,OBJREC *o)
|
|||
|
||||
void pic_viewer(OBJREC *o) //define(...pic_view);set_value(ptr)
|
||||
{
|
||||
o->runs[1]=pic_view_draw;
|
||||
o->call_draw=pic_view_draw;
|
||||
o->datasize=4;
|
||||
}
|
||||
|
||||
|
@ -196,9 +196,9 @@ static void track_view_click(EVENT_MSG *msg,OBJREC *o)
|
|||
|
||||
void track_view(OBJREC *o) //track_view(void *track);set_value(pos);
|
||||
{
|
||||
o->runs[0]=track_view_init;
|
||||
o->runs[1]=track_view_draw;
|
||||
o->runs[2]=track_view_click;
|
||||
o->call_init=track_view_init;
|
||||
o->call_draw=track_view_draw;
|
||||
o->call_event=track_view_click;
|
||||
o->datasize=4;
|
||||
}
|
||||
|
||||
|
@ -256,8 +256,8 @@ static void starts_view_draw(int x1,int y1,int x2,int y2,OBJREC *o)
|
|||
|
||||
void starts_view(OBJREC *o) //track_view(void *track);set_value(pos);
|
||||
{
|
||||
o->runs[0]=starts_view_init;
|
||||
o->runs[1]=starts_view_draw;
|
||||
o->call_init=starts_view_init;
|
||||
o->call_draw=starts_view_draw;
|
||||
o->datasize=4;
|
||||
}
|
||||
|
||||
|
@ -269,7 +269,7 @@ static void color_box_draw(int x1,int y1,int x2,int y2,OBJREC *o)
|
|||
|
||||
void color_box(OBJREC *o)
|
||||
{
|
||||
o->runs[1]=color_box_draw;
|
||||
o->call_draw=color_box_draw;
|
||||
o->datasize=4;
|
||||
}
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ static int initSizeY = 480;
|
|||
static unsigned short *mainBuffer=NULL;
|
||||
static unsigned short *secondBuffer=NULL;
|
||||
static unsigned short *curBuffer=NULL;
|
||||
static unsigned long main_linelen;
|
||||
static uint32_t main_linelen;
|
||||
|
||||
#ifdef _DX_REF
|
||||
#define DXDEVICE_TYPE D3DDEVTYPE_REF
|
||||
|
@ -139,7 +139,7 @@ static void ColCalc()
|
|||
{
|
||||
do
|
||||
{
|
||||
long val;
|
||||
int32_t val;
|
||||
printf("number:");
|
||||
scanf("%X",&val);
|
||||
printf("RGB555(%d,%d,%d)\n",(val>>10),(val>>5) & 0x1F, val & 0x1F);
|
||||
|
@ -662,7 +662,7 @@ void DxLockBuffers(BOOL lock)
|
|||
else UnLockBuffers();
|
||||
}
|
||||
|
||||
void StripBlt(void *data, unsigned int startline, unsigned long width)
|
||||
void StripBlt(void *data, unsigned int startline, uint32_t width)
|
||||
{
|
||||
unsigned short *start=startline*scr_linelen2+GetScreenAdr();
|
||||
while (width--)
|
||||
|
|
|
@ -5,9 +5,9 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
extern long scr_linelen;
|
||||
extern long scr_linelen2;
|
||||
extern long dx_linelen;
|
||||
extern int32_t scr_linelen;
|
||||
extern int32_t scr_linelen2;
|
||||
extern int32_t dx_linelen;
|
||||
|
||||
|
||||
//inicializuje a otevira rezim 640x480x16b v DX - otevre okno, pripravi vse pro beh hry
|
||||
|
@ -35,8 +35,8 @@ void DxDialogs(char enable);
|
|||
|
||||
void setvesa_displaystart(int x,int y);
|
||||
|
||||
extern long scr_linelen;
|
||||
extern long scr_linelen2;
|
||||
extern int32_t scr_linelen;
|
||||
extern int32_t scr_linelen2;
|
||||
|
||||
void DxSetInitResolution(int x, int y);
|
||||
int DxGetResX();
|
||||
|
@ -47,7 +47,7 @@ void DXMouseTransform(unsigned short *x, unsigned short *y);
|
|||
HWND GetGameWindow();
|
||||
void DxLockBuffers(BOOL lock);
|
||||
|
||||
void StripBlt(void *data, unsigned int startline, unsigned long width);
|
||||
void StripBlt(void *data, unsigned int startline, uint32_t width);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
|
@ -173,7 +173,7 @@ void *task_sleep(void *data)
|
|||
return data;
|
||||
}
|
||||
|
||||
void *task_wait_event(long event_number)
|
||||
void *task_wait_event(int32_t event_number)
|
||||
{
|
||||
void *p;
|
||||
suspend_task(currentFiber,event_number);
|
||||
|
|
|
@ -17,7 +17,7 @@ void suspend_task(int id_num,int msg);
|
|||
void shut_down_task(int id_num);
|
||||
void unsuspend_task(EVENT_MSG *msg);
|
||||
void *task_sleep(void *data);
|
||||
void *task_wait_event(long event_number);
|
||||
void *task_wait_event(int32_t event_number);
|
||||
int q_any_task();
|
||||
char task_quitmsg();
|
||||
char task_quitmsg_by_id(int id);
|
||||
|
|
|
@ -250,7 +250,7 @@ int MusicPlayer::Write(const char *buf, int len)
|
|||
if (_crossfadebytes)
|
||||
{
|
||||
short *data=(short *)wrtptr;
|
||||
long a=data[0]+sample[0];
|
||||
int32_t a=data[0]+sample[0];
|
||||
if (a<-32767) a=-32767;
|
||||
if (a>32767) a=32767;
|
||||
data[0]=(short)a;
|
||||
|
@ -383,16 +383,16 @@ DWORD WINAPI MusDecoder::StartMusDecoder(LPVOID data)
|
|||
|
||||
UINT MusDecoder::MusDecodingThread()
|
||||
{
|
||||
long blocksRemain=_header.blocks;
|
||||
int32_t blocksRemain=_header.blocks;
|
||||
char *packbuf=0;
|
||||
short *unpackbuf=0;
|
||||
long packbufsz=0;
|
||||
long unpackbufsz=0;
|
||||
int32_t packbufsz=0;
|
||||
int32_t unpackbufsz=0;
|
||||
for (int i=0;i<blocksRemain;i++)
|
||||
{
|
||||
if (_stop) break;
|
||||
long packedSize;
|
||||
long unpackedSize;
|
||||
int32_t packedSize;
|
||||
int32_t unpackedSize;
|
||||
DWORD bytesread;
|
||||
if (ReadFile(_file,&packedSize,sizeof(packedSize),&bytesread,NULL)==FALSE) break;
|
||||
if (ReadFile(_file,&unpackedSize,sizeof(unpackedSize),&bytesread,NULL)==FALSE) break;
|
||||
|
|
|
@ -41,8 +41,8 @@ public:
|
|||
void Flush(int t) {}
|
||||
int GetOutputTime() {return 1;}
|
||||
int GetWrittenTime() {return 1;}
|
||||
unsigned long AddRef() {return 1;}
|
||||
unsigned long Release() {return 1;}
|
||||
uint32_t AddRef() {return 1;}
|
||||
uint32_t Release() {return 1;}
|
||||
int Pause(int pause);
|
||||
bool IsOpenned() {return _opened;}
|
||||
};
|
||||
|
@ -51,11 +51,11 @@ public:
|
|||
struct MusFileHeader
|
||||
{
|
||||
short channels;
|
||||
long freq;
|
||||
long ssize;
|
||||
long blocks;
|
||||
long reserved1;
|
||||
long reserved2;
|
||||
int32_t freq;
|
||||
int32_t ssize;
|
||||
int32_t blocks;
|
||||
int32_t reserved1;
|
||||
int32_t reserved2;
|
||||
short ampltable[256];
|
||||
};
|
||||
#pragma pack()
|
||||
|
|
|
@ -56,9 +56,9 @@ public:
|
|||
// returns time written in MS (used for synching up vis stuff)
|
||||
virtual int GetWrittenTime()=0;
|
||||
|
||||
virtual unsigned long AddRef()=0;
|
||||
virtual uint32_t AddRef()=0;
|
||||
|
||||
virtual unsigned long Release()=0;
|
||||
virtual uint32_t Release()=0;
|
||||
|
||||
};
|
||||
|
||||
|
|
|
@ -43,8 +43,8 @@ public:
|
|||
virtual void Flush(int t);
|
||||
virtual int GetOutputTime();
|
||||
virtual int GetWrittenTime();
|
||||
virtual unsigned long AddRef() {return 1;}
|
||||
virtual unsigned long Release() {return 0;}
|
||||
virtual uint32_t AddRef() {return 1;}
|
||||
virtual uint32_t Release() {return 0;}
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -16,8 +16,8 @@ HKL english_layout=NULL;
|
|||
#define GET_Y_LPARAM(lp) ((int)(short)HIWORD(lp))
|
||||
|
||||
|
||||
static unsigned long keyqueue[MAX_KEYQUEUE];
|
||||
static unsigned long keyqueuelen=0;
|
||||
static uint32_t keyqueue[MAX_KEYQUEUE];
|
||||
static uint32_t keyqueuelen=0;
|
||||
static char wheel_mapping[2]={'Q','I'};
|
||||
static BOOL noextra;
|
||||
MS_EVENT win_mouseEvent;
|
||||
|
@ -143,7 +143,7 @@ void WaitMsgQueue()
|
|||
CheckMessageQueue();
|
||||
}
|
||||
|
||||
unsigned long _bios_keybrd(int mode)
|
||||
uint32_t _bios_keybrd(int mode)
|
||||
{
|
||||
repeat:
|
||||
if (keyqueuelen)
|
||||
|
|
|
@ -15,7 +15,7 @@ extern "C"
|
|||
|
||||
#define TIMERSPEED 20;
|
||||
|
||||
unsigned long _bios_keybrd(int mode);
|
||||
uint32_t _bios_keybrd(int mode);
|
||||
|
||||
|
||||
LRESULT GameMainWindowWindowProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
|
||||
|
|
|
@ -398,10 +398,10 @@ do not use :)
|
|||
|
||||
#define IPC_GETMBURL 246
|
||||
/* (requires Winamp 2.2+)
|
||||
** char buffer[4096]; // Urls can be VERY long
|
||||
** char buffer[4096]; // Urls can be VERY int32_t
|
||||
** SendMessage(hwnd_winamp,WM_WA_IPC,(WPARAM)buffer,IPC_GETMBURL);
|
||||
** IPC_GETMBURL will retrieve the current Minibrowser URL into buffer.
|
||||
** buffer must be at least 4096 bytes long.
|
||||
** buffer must be at least 4096 bytes int32_t.
|
||||
*/
|
||||
|
||||
|
||||
|
@ -505,7 +505,7 @@ typedef struct
|
|||
|
||||
#define IPC_GETUNCOMPRESSINTERFACE 331
|
||||
/* returns a function pointer to uncompress().
|
||||
** int (*uncompress)(unsigned char *dest, unsigned long *destLen, const unsigned char *source, unsigned long sourceLen);
|
||||
** int (*uncompress)(unsigned char *dest, uint32_t *destLen, const unsigned char *source, uint32_t sourceLen);
|
||||
** right out of zlib, useful for decompressing zlibbed data.
|
||||
** if you pass the parm of 0x10100000, it will return a wa_inflate_struct * to an inflate API.
|
||||
*/
|
||||
|
@ -515,7 +515,7 @@ typedef struct {
|
|||
int (*inflateInit_)(void *strm,const char *version, int stream_size);
|
||||
int (*inflate)(void *strm, int flush);
|
||||
int (*inflateEnd)(void *strm);
|
||||
unsigned long (*crc32)(unsigned long crc, const unsigned char *buf, unsigned int len);
|
||||
uint32_t (*crc32)(uint32_t crc, const unsigned char *buf, unsigned int len);
|
||||
} wa_inflate_struct;
|
||||
|
||||
|
||||
|
@ -778,7 +778,7 @@ class SubsItem;
|
|||
|
||||
typedef struct {
|
||||
unsigned char* baseAddr;
|
||||
long rowBytes;
|
||||
int32_t rowBytes;
|
||||
} YV12_PLANE;
|
||||
|
||||
typedef struct {
|
||||
|
|
|
@ -57,7 +57,7 @@ char start_mixing()
|
|||
void stop_mixing()
|
||||
{
|
||||
}
|
||||
void play_sample(int channel,void *sample,long size,long lstart,long sfreq,int type)
|
||||
void play_sample(int channel,void *sample,int32_t size,int32_t lstart,int32_t sfreq,int type)
|
||||
{
|
||||
}
|
||||
void set_channel_volume(int channel,int left,int right)
|
||||
|
@ -87,7 +87,7 @@ void mute_channel(int channel)
|
|||
void chan_break_loop(int channel)
|
||||
{
|
||||
}
|
||||
void chan_break_ext(int channel,void *org_sample,long size_sample) //zrusi loop s moznosti dohrat zvuk
|
||||
void chan_break_ext(int channel,void *org_sample,int32_t size_sample) //zrusi loop s moznosti dohrat zvuk
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -117,7 +117,7 @@ static DWORD WINAPI PostError(LPVOID p)
|
|||
"<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"cs\" lang=\"cs\">"
|
||||
"<head>"
|
||||
"<meta http-equiv=\"Content-Type\" content=\"text/html; charset=windows-1250\" />"
|
||||
"<title>Brány Skeldalu - formulář k odeslání chyby</title>"
|
||||
"<title>Br<EFBFBD>ny Skeldalu - formul<75><6C> k odesl<73>n<EFBFBD> chyby</title>"
|
||||
"<style type=\"text/css\">\n"
|
||||
"@import url(\"http://skeldal.jinak.cz/style.css\");\n"
|
||||
"</style>"
|
||||
|
@ -125,26 +125,26 @@ static DWORD WINAPI PostError(LPVOID p)
|
|||
"<body>"
|
||||
"<div style=\"float: left; width: 155px;\"><img src=\"http://skeldal.jinak.cz/logo.jpg\" alt=\"logo\" width=\"150\" height=\"82\"/></div>"
|
||||
"<div style=\"margin-left: 180px;margin-right: 50px;\">"
|
||||
"<h1>Brány Skeldalu - formulář k odeslání chyby</h1>"
|
||||
"<p>Autor programu se omlouvá za chybu a prosí Vás, abyste pomohl při odhalování chyb.<br />"
|
||||
"Stačí když pravdivě vyplníte odešlete následující formulář.<br />"
|
||||
"Pokuste se prosím napsat co nejvíce informací.<br />"
|
||||
"<b>K formuláři je přiložen soubor obsahující záznam o chybě.</b><br /><br />"
|
||||
"Děkujeme za spolupráci</p>"
|
||||
"<h1>Br<EFBFBD>ny Skeldalu - formul<75><6C> k odesl<73>n<EFBFBD> chyby</h1>"
|
||||
"<p>Autor programu se omlouv<EFBFBD> za chybu a pros<6F> V<>s, abyste pomohl p<>i odhalov<6F>n<EFBFBD> chyb.<br />"
|
||||
"Sta<EFBFBD><EFBFBD> kdy<64> pravdiv<69> vypln<6C>te ode<64>lete n<>sleduj<75>c<EFBFBD> formul<75><6C>.<br />"
|
||||
"Pokuste se pros<EFBFBD>m napsat co nejv<6A>ce informac<61>.<br />"
|
||||
"<b>K formul<EFBFBD><EFBFBD>i je p<>ilo<6C>en soubor obsahuj<75>c<EFBFBD> z<>znam o chyb<79>.</b><br /><br />"
|
||||
"D<EFBFBD>kujeme za spolupr<70>ci</p>"
|
||||
"<hr />"
|
||||
"<form enctype=\"multipart/form-data\" action=\"http://skeldal.jinak.cz/bugreport.php\" method=\"post\"><div>"
|
||||
"<div>Váš e-mail pro případ, že bysme vás chtěli kontaktovat: (nepovinné)</div>"
|
||||
"<div>V<EFBFBD> e-mail pro p<><70>pad, <20>e bysme v<>s cht<68>li kontaktovat: (nepovinn<6E>)</div>"
|
||||
"<input type=\"text\" name=\"email\" value=\"\" size=\"50\"/>"
|
||||
"<div>Napište prosím další informace o tom, za jakých podmínek chyba vznikla, popřípadě jak chybu znovu vyvolat</div>"
|
||||
"<div>Napi<EFBFBD>te pros<6F>m dal<61><6C> informace o tom, za jak<61>ch podm<64>nek chyba vznikla, pop<6F><70>pad<61> jak chybu znovu vyvolat</div>"
|
||||
"<textarea cols=\"50\" rows=\"10\" name=\"popis\" style=\"width:100%\"></textarea>"
|
||||
"<div>Případně přiložte uloženou pozici nebo jiné soubory související s chybou</div>"
|
||||
"<div>P<EFBFBD><EFBFBD>padn<EFBFBD> p<>ilo<6C>te ulo<6C>enou pozici nebo jin<69> soubory souvisej<65>c<EFBFBD> s chybou</div>"
|
||||
"<input name=\"userfile\" type=\"file\" size=\"50\" />"
|
||||
"<hr /><div>"
|
||||
"Pozor: Formulář také obsahuje informace o poslední chybě.<br />"
|
||||
"Nepoužívejte tento formulář k odeslání jiných chybových hlášení.</div>"
|
||||
"<p><a href=\"http://skeldal.jinak.cz/main.php?page=soukromí\">Prohlášení o ochraně soukromých údajů</a></p>"
|
||||
"Pozor: Formul<EFBFBD><EFBFBD> tak<61> obsahuje informace o posledn<64> chyb<79>.<br />"
|
||||
"Nepou<EFBFBD><EFBFBD>vejte tento formul<75><6C> k odesl<73>n<EFBFBD> jin<69>ch chybov<6F>ch hl<68>en<65>.</div>"
|
||||
"<p><a href=\"http://skeldal.jinak.cz/main.php?page=soukrom<EFBFBD>\">Prohl<68>en<65> o ochran<61> soukrom<6F>ch <20>daj<61></a></p>"
|
||||
"<hr />"
|
||||
"<input type=\"submit\" value=\"Odeslat záznam o chybě\" /><br />"
|
||||
"<input type=\"submit\" value=\"Odeslat z<EFBFBD>znam o chyb<79>\" /><br />"
|
||||
"<input type=\"hidden\" name=\"data\" value=\"";
|
||||
WriteFile(h,(void *)(form1),strlen(form1),&wrt,0);
|
||||
HANDLE v=CreateFile(dmp,GENERIC_READ,0,0,OPEN_EXISTING,0,0);
|
||||
|
@ -211,7 +211,7 @@ static DWORD WINAPI CrashReportGenerateThread(LPVOID data)
|
|||
WS_DLGFRAME|WS_VISIBLE|SS_CENTER,0,0,640,80,NULL,NULL,GetModuleHandle(NULL),NULL);
|
||||
UpdateWindow(hwnd);
|
||||
if (GenerateMinidump(ExceptionInfo,MiniDumpNormal,".short.dmp")==false) return 0;
|
||||
GenerateMinidump(ExceptionInfo,MiniDumpWithDataSegs,".long.dmp");
|
||||
GenerateMinidump(ExceptionInfo,MiniDumpWithDataSegs,".int32_t.dmp");
|
||||
GenerateMinidump(ExceptionInfo,MiniDumpWithFullMemory,".full.dmp");
|
||||
PostError(0);
|
||||
DestroyWindow(hwnd);
|
||||
|
|
|
@ -2,4 +2,4 @@ SET(files automap.c clk_map.c dialogy.c dump.cpp enemy.c engine2.c g
|
|||
builder.c engine1.c gamesave.c interfac.c kniha.c macros.c realgame.c setup.c sndandmus.c specproc.c)
|
||||
|
||||
add_executable(skeldal ${files})
|
||||
|
||||
target_link_libraries(skeldal skeldal_libs)
|
||||
|
|
|
@ -208,14 +208,12 @@ void psani_poznamek_event(EVENT_MSG *msg,void **data)
|
|||
data;
|
||||
if (msg->msg==E_INIT)
|
||||
{
|
||||
int *p;
|
||||
char *c;
|
||||
char *c;
|
||||
x = va_arg(msg->data, int);
|
||||
y = va_arg(msg->data, int);
|
||||
c = va_arg(msg->data, char *);
|
||||
|
||||
set_font(H_FLITT5,NOSHADOW(0));
|
||||
p=msg->data;
|
||||
x=p[0];
|
||||
y=p[1];
|
||||
c=*(char **)(p+2);
|
||||
strcpy(text,c);
|
||||
save=(char *)getmem(strlen(text)+1);
|
||||
strcpy(save,text);
|
||||
|
@ -242,7 +240,7 @@ void psani_poznamek_event(EVENT_MSG *msg,void **data)
|
|||
{
|
||||
char c;
|
||||
|
||||
c=*(char *)msg->data;
|
||||
c=va_arg(msg->data, int);
|
||||
set_font(H_FLITT5,NOSHADOW(0));
|
||||
if (c)
|
||||
{
|
||||
|
@ -438,7 +436,7 @@ static void draw_amap_sector(int x,int y,int sector,int mode,int turn,int line1,
|
|||
void herni_cas(char *s)
|
||||
{
|
||||
int mes,den,hod,min;
|
||||
long cas;
|
||||
int32_t cas;
|
||||
|
||||
cas=game_time;
|
||||
mes=cas/(360*24*30);cas%=360*24*30;
|
||||
|
@ -464,7 +462,7 @@ void herni_cas(char *s)
|
|||
static void zobraz_herni_cas(void)
|
||||
{
|
||||
static char text[100];
|
||||
static long old_time=-1;
|
||||
static int32_t old_time=-1;
|
||||
char cas[100];
|
||||
|
||||
if (old_time!=game_time)
|
||||
|
@ -627,7 +625,8 @@ void *map_keyboard(EVENT_MSG *msg,void **usr)
|
|||
if (msg->msg==E_AUTOMAP_REDRAW) draw=4;
|
||||
if (msg->msg==E_KEYBOARD)
|
||||
{
|
||||
c=(*(int *)msg->data)>>8;
|
||||
int d = va_arg(msg->data, int);
|
||||
c=d>>8;
|
||||
switch (c)
|
||||
{
|
||||
case 'H':yr++;draw=4;break;
|
||||
|
@ -641,10 +640,8 @@ void *map_keyboard(EVENT_MSG *msg,void **usr)
|
|||
case 15:
|
||||
case 50:
|
||||
case 1:
|
||||
(*(int *)msg->data)=0;
|
||||
unwire_proc();
|
||||
wire_proc();
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -893,14 +890,16 @@ char map_target_cancel(int id,int xa,int ya,int xr,int yr)
|
|||
void map_teleport_keyboard(EVENT_MSG *msg,void **usr)
|
||||
{
|
||||
usr;
|
||||
if (msg->msg==E_KEYBOARD)
|
||||
switch (*(short *)msg->data>>8)
|
||||
if (msg->msg==E_KEYBOARD) {
|
||||
int c = va_arg(msg->data, int);
|
||||
switch (c>>8)
|
||||
{
|
||||
case 1:
|
||||
case 15:
|
||||
case 50: exit_wait=1; msg->msg=-1;break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static char path_ok(word sector)
|
||||
|
|
|
@ -181,7 +181,7 @@ void show_money()
|
|||
{
|
||||
char c[20];
|
||||
set_font(H_FONT7,RGB555(28,28,21));
|
||||
sprintf(c,"%ld",money);
|
||||
sprintf(c,"%d",money);
|
||||
set_aligned_position(460,13,2,2,c);
|
||||
outtext(c);
|
||||
}
|
||||
|
@ -275,7 +275,7 @@ word *bott_clear(void)
|
|||
{
|
||||
word *bott_scr;
|
||||
|
||||
long sz;
|
||||
int32_t sz;
|
||||
bott_scr=(word *)getmem(sz = scr_linelen2*104*2);
|
||||
memset(bott_scr,0,sz);
|
||||
return bott_scr;
|
||||
|
@ -290,7 +290,7 @@ static void draw_small_icone(int num,int x,int y)
|
|||
put_textured_bar(pic,x,y,13,13,num,0);
|
||||
}
|
||||
|
||||
static void bott_fletna_normal(void **pp,long *s)
|
||||
static void bott_fletna_normal(void **pp,int32_t *s)
|
||||
{
|
||||
word *bott_scr;
|
||||
int i,x;
|
||||
|
@ -308,7 +308,7 @@ static void bott_fletna_normal(void **pp,long *s)
|
|||
RestoreScreen();
|
||||
}
|
||||
|
||||
static void bott_draw_normal(void **pp,long *s)
|
||||
static void bott_draw_normal(void **pp,int32_t *s)
|
||||
{
|
||||
int i,j;int x,xs=0,y;
|
||||
word *bott_scr;
|
||||
|
@ -415,7 +415,7 @@ void bott_timer_draw(struct the_timer *q)
|
|||
bott_timer=NULL;
|
||||
}
|
||||
|
||||
void bott_disp_text_proc(void **pp,long *ss)
|
||||
void bott_disp_text_proc(void **pp,int32_t *ss)
|
||||
{
|
||||
char *p,*text;
|
||||
int y=20;
|
||||
|
@ -471,7 +471,7 @@ static void MaskPutPicture(int x, int y, char mask, word color, char blend, void
|
|||
}
|
||||
|
||||
|
||||
void bott_draw_rune(void **pp,long *ss)
|
||||
void bott_draw_rune(void **pp,int32_t *ss)
|
||||
{
|
||||
int sel_zivel=showrune/10;
|
||||
int sel_rune=showrune%10;
|
||||
|
@ -519,7 +519,7 @@ void bott_text_forever()
|
|||
bott_timer=NULL;
|
||||
}
|
||||
|
||||
void bott_draw_proc(void **p,long *s)
|
||||
void bott_draw_proc(void **p,int32_t *s)
|
||||
{
|
||||
switch (bott_display)
|
||||
{
|
||||
|
@ -645,7 +645,7 @@ int enter_tab[VIEW3D_Z+1][VIEW3D_X*2+1]=
|
|||
void crt_minimap_itr(int sector,int smer,int itrx,int itry, int automap)
|
||||
{
|
||||
static int sector_temp;
|
||||
static long sideflags;
|
||||
static int32_t sideflags;
|
||||
static short enter=0;
|
||||
short savee;
|
||||
|
||||
|
|
|
@ -514,7 +514,7 @@ static void stop_edit_name()
|
|||
{
|
||||
shut_downing_text=1;send_message(E_KEYBOARD,13);
|
||||
task_sleep(NULL);
|
||||
if (edit_task>0 && is_running(edit_task))
|
||||
if (edit_task>0 && is_running(edit_task))
|
||||
shut_down_task(edit_task);
|
||||
shut_downing_text=0;
|
||||
}
|
||||
|
@ -752,7 +752,8 @@ static void enter_reaction(EVENT_MSG *msg,void **unused)
|
|||
unused;
|
||||
if (msg->msg==E_KEYBOARD)
|
||||
{
|
||||
if (*(char *)msg->data==13 && !shut_downing_text)
|
||||
int c = va_arg(msg->data, int);
|
||||
if (c==13 && !shut_downing_text)
|
||||
{
|
||||
send_message(E_KEYBOARD,13);
|
||||
bott_draw(1);
|
||||
|
@ -766,7 +767,8 @@ static void enter_reaction(EVENT_MSG *msg,void **unused)
|
|||
static void enter_reaction2(EVENT_MSG *msg,void **unused)
|
||||
{
|
||||
unused;
|
||||
if (msg->msg==E_KEYBOARD && *(char *)msg->data==13 && !shut_downing_text && ~b_disables & 0x3)
|
||||
int c = va_arg(msg->data, int)
|
||||
if (msg->msg==E_KEYBOARD && c==13 && !shut_downing_text && ~b_disables & 0x3)
|
||||
{
|
||||
send_message(E_KEYBOARD,13);
|
||||
bott_draw(1);
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
#include <stdio.h>
|
||||
#include <mem.h>
|
||||
|
||||
unsigned long l;
|
||||
uint32_t l;
|
||||
|
||||
#define ZAKLAD_CRC 0xC005
|
||||
|
||||
char data[100000];
|
||||
long delka;
|
||||
int32_t delka;
|
||||
FILE *f;
|
||||
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@ typedef struct t_paragraph
|
|||
unsigned alt:15;
|
||||
unsigned visited:1;
|
||||
unsigned first:1;
|
||||
long position;
|
||||
int32_t position;
|
||||
}T_PARAGRAPH;
|
||||
|
||||
#define STR_BUFF_SIZ 4096
|
||||
|
@ -126,7 +126,7 @@ static int glob_y;
|
|||
static int last_pgf;
|
||||
|
||||
static word *paleta;
|
||||
static long loc_anim_render_buffer;
|
||||
static int32_t loc_anim_render_buffer;
|
||||
static short task_num=-1;
|
||||
|
||||
void small_anm_buff(void *target,void *buff,void *paleta);
|
||||
|
@ -688,9 +688,9 @@ static void key_check(EVENT_MSG *msg,void **unused)
|
|||
unused;
|
||||
if (msg->msg==E_KEYBOARD)
|
||||
{
|
||||
c=*(char *)msg->data;
|
||||
d=*(int *)msg->data>>8;
|
||||
if (c==0)
|
||||
int c = va_arg(msg->data, int);
|
||||
d=c>>8;
|
||||
if (c & 0xFF)
|
||||
{
|
||||
switch(d)
|
||||
{
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
#include <bgraph.h>
|
||||
|
||||
FILE *dlg;
|
||||
long *odstavce=NULL;
|
||||
int32_t *odstavce=NULL;
|
||||
int pocet;
|
||||
|
||||
int selptr=0;
|
||||
|
@ -61,11 +61,11 @@ int count_pargh()
|
|||
void read_pargh()
|
||||
{
|
||||
int s,i;
|
||||
long *d;
|
||||
int32_t *d;
|
||||
char c;
|
||||
if (odstavce!=NULL) free(odstavce);
|
||||
odstavce=NULL;
|
||||
s=(pocet=i=count_pargh())*sizeof(long)*2;
|
||||
s=(pocet=i=count_pargh())*sizeof(int32_t)*2;
|
||||
if (s==0) return;
|
||||
odstavce=getmem(s);
|
||||
d=odstavce;
|
||||
|
@ -92,9 +92,9 @@ void dlg_error(char *chyba)
|
|||
exit(1);
|
||||
}
|
||||
|
||||
long *najdi_odstavec(int odstavec)
|
||||
int32_t *najdi_odstavec(int odstavec)
|
||||
{
|
||||
long *d;
|
||||
int32_t *d;
|
||||
int i;
|
||||
|
||||
|
||||
|
@ -111,7 +111,7 @@ long *najdi_odstavec(int odstavec)
|
|||
|
||||
char jdi_na_odstavec(int odstavec)
|
||||
{
|
||||
long *l,m;
|
||||
int32_t *l,m;
|
||||
char c;
|
||||
|
||||
l=najdi_odstavec(odstavec);
|
||||
|
@ -121,9 +121,9 @@ char jdi_na_odstavec(int odstavec)
|
|||
return c;
|
||||
}
|
||||
|
||||
void set_flags(int n,long maskand,long maskor)
|
||||
void set_flags(int n,int32_t maskand,int32_t maskor)
|
||||
{
|
||||
long *l;
|
||||
int32_t *l;
|
||||
l=najdi_odstavec(n);
|
||||
l[1]&=(maskand<<24)+0xffffff;
|
||||
l[1]|=maskor<<24;
|
||||
|
@ -152,7 +152,7 @@ int nparam(int n,char *c)
|
|||
void proved_goto(int num)
|
||||
{
|
||||
char c;
|
||||
long l;
|
||||
int32_t l;
|
||||
l=ftell(dlg);
|
||||
c=jdi_na_odstavec(num);
|
||||
while (c & 1)
|
||||
|
@ -220,7 +220,7 @@ void proved_d(char *code,char *text)
|
|||
}
|
||||
else if (*code==4)
|
||||
{
|
||||
long *l=najdi_odstavec(param(text));
|
||||
int32_t *l=najdi_odstavec(param(text));
|
||||
char c,*d;
|
||||
|
||||
c=l[1]>>24;
|
||||
|
|
|
@ -153,7 +153,7 @@ static EVENT_PROC(mob_reload)
|
|||
if (counter++==10)
|
||||
{
|
||||
TMOB *m;
|
||||
long vl;
|
||||
int32_t vl;
|
||||
|
||||
static int last;
|
||||
counter=0;
|
||||
|
@ -344,7 +344,7 @@ static void mob_sound_event(TMOB *m,int event)
|
|||
play_sample_at_sector(m->cislo_vzoru+16*6+event+monster_block,viewsector,m->sector,0,0);
|
||||
}
|
||||
|
||||
void load_enemies(short *data,int size,int *grptr,TMOB *template,long tsize)
|
||||
void load_enemies(short *data,int size,int *grptr,TMOB *template,int32_t tsize)
|
||||
{
|
||||
int i;
|
||||
short cisla[256];
|
||||
|
|
|
@ -45,21 +45,21 @@ void sikma_zleva(void);
|
|||
//#pragma aux sikma_zleva parm modify [EAX EBX ECX EDX ESI EDI]
|
||||
void sikma_zprava(void);
|
||||
//#pragma aux sikma_zprava parm modify [EAX EBX ECX EDX ESI EDI]
|
||||
/*void zooming_dx(void *source,void *target,void *background,void *xlat,long xysize);
|
||||
/*void zooming_dx(void *source,void *target,void *background,void *xlat,int32_t xysize);
|
||||
//#pragma aux zooming_dx parm [ESI][EDI][EAX][EBX][ECX] modify [EDX]
|
||||
void zooming32(void *source,void *target,void *background,void *xlat,long xysize);
|
||||
void zooming32(void *source,void *target,void *background,void *xlat,int32_t xysize);
|
||||
//#pragma aux zooming32 parm [ESI][EDI][EAX][EBX][ECX] modify [EDX]
|
||||
void zooming32b(void *source,void *target,void *background,void *xlat,long xysize);
|
||||
void zooming32b(void *source,void *target,void *background,void *xlat,int32_t xysize);
|
||||
//#pragma aux zooming32b parm [ESI][EDI][EAX][EBX][ECX] modify [EAX EDX]
|
||||
void zooming_lo(void *source,void *target,void *xlat,long xysize);
|
||||
void zooming_lo(void *source,void *target,void *xlat,int32_t xysize);
|
||||
//#pragma aux zooming_lo parm [ESI][EDI][EBX][ECX] modify [EAX EDX]
|
||||
void zooming256(void *source,void *target,void *background,void *xlat,long xysize);
|
||||
void zooming256(void *source,void *target,void *background,void *xlat,int32_t xysize);
|
||||
//#pragma aux zooming256 parm [ESI][EDI][EAX][EBX][ECX] modify [EDX]
|
||||
void zooming256b(void *source,void *target,void *background,void *xlat,long xysize);
|
||||
void zooming256b(void *source,void *target,void *background,void *xlat,int32_t xysize);
|
||||
//#pragma aux zooming256b parm [ESI][EDI][EAX][EBX][ECX] modify [EAX EDX]
|
||||
void zooming64(void *source,void *target,void *background,void *xlat,long xysize);
|
||||
void zooming64(void *source,void *target,void *background,void *xlat,int32_t xysize);
|
||||
//#pragma aux zooming64 parm [ESI][EDI][EAX][EBX][ECX] modify [EDX]
|
||||
void zooming64b(void *source,void *target,void *background,void *xlat,long xysize);
|
||||
void zooming64b(void *source,void *target,void *background,void *xlat,int32_t xysize);
|
||||
//#pragma aux zooming64b parm [ESI][EDI][EAX][EBX][ECX] modify [EAX EDX]
|
||||
void scroll_support_dx(void *lbuf,void *src1,void *src2,int size1);
|
||||
//#pragma aux scroll_support_dx parm [EDI][ESI][EDX][ECX] modify [EAX]
|
||||
|
@ -78,38 +78,38 @@ void scroll_support_64b(void *lbuf,void *src1,void *src2,int size1,void *xlat);
|
|||
void fcdraw(void *source,void *target, void *table);
|
||||
//#pragma aux fcdraw parm [EDX][EBX][EAX] modify [ECX ESI EDI];
|
||||
|
||||
/*void lodka32(void *source,void *target,void *background,void *xlat,long xysize);
|
||||
/*void lodka32(void *source,void *target,void *background,void *xlat,int32_t xysize);
|
||||
//#pragma aux lodka32 parm [ESI][EDI][EAX][EBX][ECX] modify [EDX]
|
||||
void lodka_dx(void *source,void *target,void *background,void *xlat,long xysize);
|
||||
void lodka_dx(void *source,void *target,void *background,void *xlat,int32_t xysize);
|
||||
//#pragma aux lodka_dx parm [ESI][EDI][EAX][EBX][ECX] modify [EDX]
|
||||
void lodka32b(void *source,void *target,void *background,void *xlat,long xysize);
|
||||
void lodka32b(void *source,void *target,void *background,void *xlat,int32_t xysize);
|
||||
//#pragma aux lodka32b parm [ESI][EDI][EAX][EBX][ECX] modify [EDX]
|
||||
|
||||
void lodka256(void *source,void *target,void *background,void *xlat,long xysize);
|
||||
void lodka256(void *source,void *target,void *background,void *xlat,int32_t xysize);
|
||||
//#pragma aux lodka256 parm [ESI][EDI][EAX][EBX][ECX] modify [EDX]
|
||||
void lodka256b(void *source,void *target,void *background,void *xlat,long xysize);
|
||||
void lodka256b(void *source,void *target,void *background,void *xlat,int32_t xysize);
|
||||
//#pragma aux lodka256b parm [ESI][EDI][EAX][EBX][ECX] modify [EAX EDX]
|
||||
|
||||
void lodka64(void *source,void *target,void *background,void *xlat,long xysize);
|
||||
void lodka64(void *source,void *target,void *background,void *xlat,int32_t xysize);
|
||||
//#pragma aux lodka64 parm [ESI][EDI][EAX][EBX][ECX] modify [EDX]
|
||||
void lodka64b(void *source,void *target,void *background,void *xlat,long xysize);
|
||||
void lodka64b(void *source,void *target,void *background,void *xlat,int32_t xysize);
|
||||
//#pragma aux lodka64b parm [ESI][EDI][EAX][EBX][ECX] modify [EAX EDX]
|
||||
*/
|
||||
|
||||
void *p,*p2,*pozadi,*podlaha,*strop,*sit;int i;
|
||||
void (*zooming)(void *source,long target,word *background,void *xlat,long xysize);
|
||||
void (*turn)(long lbuf,void *src1,void *src2,int size1);
|
||||
void (*zooming)(void *source,int32_t target,word *background,void *xlat,int32_t xysize);
|
||||
void (*turn)(int32_t lbuf,void *src1,void *src2,int size1);
|
||||
word *GetBuffer2nd();
|
||||
word *background;
|
||||
char debug=0,nosides=0,nofloors=0,drwsit=0,show_names=0,show_lives=0;
|
||||
static long old_timer;
|
||||
static int32_t old_timer;
|
||||
|
||||
static void wait_timer()
|
||||
{
|
||||
sleep_ms(10);
|
||||
}
|
||||
|
||||
/*void zooming1(void *source,long target,word *background,void *xlat,long xysize)
|
||||
/*void zooming1(void *source,int32_t target,word *background,void *xlat,int32_t xysize)
|
||||
{
|
||||
wait_timer();
|
||||
if (backgrnd_mode)
|
||||
|
@ -119,7 +119,7 @@ static void wait_timer()
|
|||
showview(0,0,0,0);
|
||||
}
|
||||
/*
|
||||
void zooming2(void *source,long target,word *background,void *xlat,long xysize)
|
||||
void zooming2(void *source,int32_t target,word *background,void *xlat,int32_t xysize)
|
||||
{
|
||||
word *lbuffer=LockDirectScreen();
|
||||
wait_timer();
|
||||
|
@ -130,12 +130,12 @@ void zooming2(void *source,long target,word *background,void *xlat,long xysize)
|
|||
UnlockDirectScreen();
|
||||
}
|
||||
|
||||
void zooming3(void *source,long target,word *background,void *xlat,long xysize)
|
||||
void zooming3(void *source,int32_t target,word *background,void *xlat,int32_t xysize)
|
||||
{
|
||||
source;target;background;xlat;xysize;
|
||||
}
|
||||
|
||||
/*void zooming4(void *source,long target,word *background,void *xlat,long xysize)
|
||||
/*void zooming4(void *source,int32_t target,word *background,void *xlat,int32_t xysize)
|
||||
{
|
||||
word *lbuffer=LockDirectScreen();
|
||||
wait_timer();
|
||||
|
@ -146,7 +146,7 @@ void zooming3(void *source,long target,word *background,void *xlat,long xysize)
|
|||
UnlockDirectScreen();
|
||||
}*/
|
||||
/*
|
||||
void zooming5(void *source,long target,word *background,void *xlat,long xysize)
|
||||
void zooming5(void *source,int32_t target,word *background,void *xlat,int32_t xysize)
|
||||
{
|
||||
wait_timer();
|
||||
if (backgrnd_mode)
|
||||
|
@ -155,7 +155,7 @@ void zooming5(void *source,long target,word *background,void *xlat,long xysize)
|
|||
zooming256b(source,(void *)target,background+3,xlat,xysize);
|
||||
}
|
||||
|
||||
void zooming6(void *source,long target,word *background,void *xlat,long xysize)
|
||||
void zooming6(void *source,int32_t target,word *background,void *xlat,int32_t xysize)
|
||||
{
|
||||
word *lbuffer=LockDirectScreen();
|
||||
wait_timer();
|
||||
|
@ -166,7 +166,7 @@ void zooming6(void *source,long target,word *background,void *xlat,long xysize)
|
|||
UnlockDirectScreen();
|
||||
}
|
||||
/*
|
||||
void zooming7(void *source,long target,word *background,void *xlat,long xysize)
|
||||
void zooming7(void *source,int32_t target,word *background,void *xlat,int32_t xysize)
|
||||
{
|
||||
wait_timer();
|
||||
if (backgrnd_mode)
|
||||
|
@ -176,38 +176,38 @@ void zooming7(void *source,long target,word *background,void *xlat,long xysize)
|
|||
}
|
||||
*/
|
||||
|
||||
void turn1(long lbuf,void *src1,void *src2,int size1)
|
||||
void turn1(int32_t lbuf,void *src1,void *src2,int size1)
|
||||
{
|
||||
//wait_timer();
|
||||
// scroll_support_dx(lbuf+GetScreenAdr(),src1,src2,size1);
|
||||
showview(0,0,0,0);
|
||||
}
|
||||
|
||||
/*void turn2(long lbuf,void *src1,void *src2,int size1)
|
||||
/*void turn2(int32_t lbuf,void *src1,void *src2,int size1)
|
||||
{
|
||||
wait_timer();
|
||||
scroll_support_256((lbuf>>1)+lbuffer,src1,src2,size1,xlatmem);
|
||||
}
|
||||
*/
|
||||
void turn3(long lbuf,void *src1,void *src2,int size1)
|
||||
void turn3(int32_t lbuf,void *src1,void *src2,int size1)
|
||||
{
|
||||
lbuf;src1;src2;size1;
|
||||
}
|
||||
/*
|
||||
void turn4(long lbuf,void *src1,void *src2,int size1)
|
||||
void turn4(int32_t lbuf,void *src1,void *src2,int size1)
|
||||
{
|
||||
wait_timer();
|
||||
scroll_support_32b((void *)(lbuf*2),src1,src2,size1);
|
||||
}
|
||||
|
||||
void turn5(long lbuf,void *src1,void *src2,int size1)
|
||||
void turn5(int32_t lbuf,void *src1,void *src2,int size1)
|
||||
{
|
||||
wait_timer();
|
||||
scroll_support_256b((void *)lbuf,src1,src2,size1,xlatmem);
|
||||
}
|
||||
*/
|
||||
/*
|
||||
void turn6(long lbuf,void *src1,void *src2,int size1)
|
||||
void turn6(int32_t lbuf,void *src1,void *src2,int size1)
|
||||
{
|
||||
word *lbuffer=LockDirectScreen();
|
||||
wait_timer();
|
||||
|
@ -215,7 +215,7 @@ void turn6(long lbuf,void *src1,void *src2,int size1)
|
|||
UnlockDirectScreen();
|
||||
}
|
||||
/*
|
||||
void turn7(long lbuf,void *src1,void *src2,int size1)
|
||||
void turn7(int32_t lbuf,void *src1,void *src2,int size1)
|
||||
{
|
||||
wait_timer();
|
||||
scroll_support_64b((void *)(lbuf*2),src1,src2,size1,xlatmem);
|
||||
|
@ -245,7 +245,7 @@ void calc_points(void)
|
|||
}
|
||||
}
|
||||
|
||||
void calc_x_buffer(long *ptr,long txt_size_x, long len,long total,long scale1)
|
||||
void calc_x_buffer(int32_t *ptr,int32_t txt_size_x, int32_t len,int32_t total,int32_t scale1)
|
||||
{
|
||||
int i,j,old,z=-1;
|
||||
|
||||
|
@ -264,7 +264,7 @@ void calc_x_buffer(long *ptr,long txt_size_x, long len,long total,long scale1)
|
|||
|
||||
}
|
||||
|
||||
void calc_y_buffer(short *ptr,long txt_size_y, long len,long total)
|
||||
void calc_y_buffer(short *ptr,int32_t txt_size_y, int32_t len,int32_t total)
|
||||
{
|
||||
int i,j,old;
|
||||
|
||||
|
@ -445,7 +445,7 @@ static void zooming_forward_backward(word *background,char back)
|
|||
{
|
||||
if (!zooming_step) return;
|
||||
{
|
||||
long tmp=get_timer_value();
|
||||
int32_t tmp=get_timer_value();
|
||||
void *buffer=DxPrepareWalk(SCREEN_OFFLINE);
|
||||
int tpoints[4]={90,31,90+460,31+259};
|
||||
|
||||
|
@ -482,7 +482,7 @@ void zooming_backward(word *background)
|
|||
if (!zooming_step) return;
|
||||
for (i=0;i<ZOOM_PHASES;i+=zooming_step)
|
||||
{
|
||||
zoom.xtable=(long *)&zooming_xtable[i];
|
||||
zoom.xtable=(int32_t *)&zooming_xtable[i];
|
||||
zoom.ytable=(short *)&zooming_ytable[i];
|
||||
zoom.texture_line=0;
|
||||
do_events();
|
||||
|
@ -495,7 +495,7 @@ void zooming_backward(word *background)
|
|||
if (!zooming_step) return;
|
||||
for (i=ZOOM_PHASES-1;i>=0;i-=zooming_step)
|
||||
{
|
||||
zoom.xtable=(long *)&zooming_xtable[i];
|
||||
zoom.xtable=(int32_t *)&zooming_xtable[i];
|
||||
zoom.ytable=(short *)&zooming_ytable[i];
|
||||
zoom.texture_line=0;
|
||||
do_events();
|
||||
|
@ -510,7 +510,7 @@ static void turn_left_right(char right)
|
|||
{
|
||||
if (!rot_phases) return;
|
||||
{
|
||||
long tmp=get_timer_value();
|
||||
int32_t tmp=get_timer_value();
|
||||
void *buffer=DxPrepareTurn(SCREEN_OFFLINE);
|
||||
|
||||
int maxtime=5*rot_phases;
|
||||
|
@ -959,7 +959,7 @@ void map_pos(int celx,int cely,int posx,int posy,int posz,int *x,int *y)
|
|||
T_INFO_Y *yd;
|
||||
T_INFO_X *x3d;
|
||||
int ys1,ys2,xs1,xs2;
|
||||
static long zoomtab_x[640];
|
||||
static int32_t zoomtab_x[640];
|
||||
static short zoomtab_y[360];
|
||||
static lastcely=-1;
|
||||
int randx,randy;
|
||||
|
@ -1012,14 +1012,14 @@ void map_pos(int celx,int cely,int posx,int posy,int posz,int *x,int *y)
|
|||
if ((cely<<1)+posy!=lastcely)
|
||||
{
|
||||
lastcely=(cely<<1)+posy;
|
||||
calc_x_buffer((long *)&zoomtab_x,xs2,xs1,640,xs2);
|
||||
calc_x_buffer((int32_t *)&zoomtab_x,xs2,xs1,640,xs2);
|
||||
calc_y_buffer((short *)&zoomtab_y,ys2,ys1,360);
|
||||
}
|
||||
if (y-ysr<0) ysr=y;
|
||||
zoom.startptr=GetBuffer2nd()+y*640+x+SCREEN_OFFSET;
|
||||
zoom.texture=(short *)((char *)(&pic[3+SHADE_PAL])+xofs);
|
||||
zoom.texture_line=xs;
|
||||
zoom.xtable=(long *)&zoomtab_x;
|
||||
zoom.xtable=(int32_t *)&zoomtab_x;
|
||||
zoom.ytable=(short *)&zoomtab_y;
|
||||
zoom.palette=(word *)&pic[3+cely*256+(secnd_shade?SHADE_STEPS*256:0)];
|
||||
zoom.ycount=ysr;
|
||||
|
@ -1092,7 +1092,7 @@ void draw_placed_texture(short *txtr,int celx,int cely,int posx,int posy,int pos
|
|||
/*void draw_placed_texture(short *txtr,int celx,int cely,int posx,int posy,int posz,char turn)
|
||||
{
|
||||
int x,y,xsr,ysr;
|
||||
long zoomtab_x[640];
|
||||
int32_t zoomtab_x[640];
|
||||
short zoomtab_y[360];
|
||||
int xs,ys,xofs,xmax;
|
||||
|
||||
|
@ -1122,7 +1122,7 @@ void draw_placed_texture(short *txtr,int celx,int cely,int posx,int posy,int pos
|
|||
xofs=0;
|
||||
xmax=xsr;
|
||||
}
|
||||
calc_x_buffer((long *)&zoomtab_x,320,last_scale,640,last_scale);
|
||||
calc_x_buffer((int32_t *)&zoomtab_x,320,last_scale,640,last_scale);
|
||||
calc_y_buffer((short *)&zoomtab_y,320,last_scale,360);
|
||||
if (y-ysr<0) ysr=y;
|
||||
if (ysr<=0) return;
|
||||
|
@ -1130,7 +1130,7 @@ void draw_placed_texture(short *txtr,int celx,int cely,int posx,int posy,int pos
|
|||
else zoom.startptr=GetBuffer2nd()+y*640+x+SCREEN_OFFSET;
|
||||
zoom.texture=(short *)((char *)(&txtr[3+SHADE_PAL])+xofs);
|
||||
zoom.texture_line=xs;
|
||||
zoom.xtable=(long *)&zoomtab_x;
|
||||
zoom.xtable=(int32_t *)&zoomtab_x;
|
||||
zoom.ytable=(short *)&zoomtab_y;
|
||||
zoom.palette=(word *)&txtr[3+cely*256+(secnd_shade?SHADE_STEPS*256:0)];
|
||||
zoom.ycount=ysr;
|
||||
|
|
|
@ -50,8 +50,8 @@ void clear_buff(word *background,word backcolor,int lines);
|
|||
typedef struct zoominfo
|
||||
{
|
||||
void *startptr, *texture;
|
||||
long texture_line,line_len;
|
||||
long *xtable;
|
||||
int32_t texture_line,line_len;
|
||||
int32_t *xtable;
|
||||
short *ytable;
|
||||
word *palette;
|
||||
word ycount;
|
||||
|
@ -61,7 +61,7 @@ typedef struct zoominfo
|
|||
|
||||
typedef struct t_info_y
|
||||
{
|
||||
long drawline; //ukazatel na radku na ktere bude stena zacinat
|
||||
int32_t drawline; //ukazatel na radku na ktere bude stena zacinat
|
||||
word vert_size; //konecna velikost steny, pokud ma pocatecni velikost TXT_SIZE_Y
|
||||
word vert_total; //maximalni velikost textury aby jeste nepresahla obrazovku
|
||||
short zoom_table[TAB_SIZE_Y]; //tabulka pro zoomovaci rutiny
|
||||
|
@ -73,7 +73,7 @@ typedef struct t_info_x_3d
|
|||
integer xpos; //bod od leveho okraje
|
||||
word txtoffset; //posunuti x vuci texture
|
||||
word point_total; //rozdil mezi levym prednim a levym zadnim okrajem postranni steny (v adresach)
|
||||
long zoom_table[VIEW_SIZE_X]; //zoomovaci tabulka pro osu x pro postranni steny
|
||||
int32_t zoom_table[VIEW_SIZE_X]; //zoomovaci tabulka pro osu x pro postranni steny
|
||||
}T_INFO_X_3D;
|
||||
|
||||
typedef struct t_info_x
|
||||
|
@ -84,12 +84,12 @@ typedef struct t_info_x
|
|||
word txtoffset; //posunuti x vuci texture
|
||||
word max_x; //pocet viditelnych bodu z textury
|
||||
word point_total; //celkovy pocet adres mezi levym a pravym okrajem
|
||||
long zoom_table[VIEW_SIZE_X]; //zoomovaci tabulka pro osu x pro kolme steny
|
||||
int32_t zoom_table[VIEW_SIZE_X]; //zoomovaci tabulka pro osu x pro kolme steny
|
||||
}T_INFO_X;
|
||||
|
||||
typedef struct t_floor_map
|
||||
{
|
||||
long lineofs,linesize,counter,txtrofs;
|
||||
int32_t lineofs,linesize,counter,txtrofs;
|
||||
}T_FLOOR_MAP;
|
||||
|
||||
typedef struct all_view
|
||||
|
|
|
@ -19,7 +19,7 @@ void sikma_zleva(void)
|
|||
const unsigned char *pixmap = zoom.texture;
|
||||
const short *ytable = zoom.ytable;
|
||||
while (cy) {
|
||||
const long *xtable = zoom.xtable;
|
||||
const int32_t *xtable = zoom.xtable;
|
||||
word cx = zoom.xmax;
|
||||
word *scr_iter = scr;
|
||||
const unsigned char *pixmap_iter = pixmap;
|
||||
|
@ -93,7 +93,7 @@ void sikma_zprava(void)
|
|||
const unsigned char *pixmap = zoom.texture;
|
||||
const short *ytable = zoom.ytable;
|
||||
while (cy) {
|
||||
const long *xtable = zoom.xtable;
|
||||
const int32_t *xtable = zoom.xtable;
|
||||
word cx = zoom.xmax;
|
||||
word *scr_iter = scr;
|
||||
const unsigned char *pixmap_iter = pixmap;
|
||||
|
@ -161,7 +161,7 @@ void fcdraw(void *source,void *target, void *table)
|
|||
word *src = (word *)source;
|
||||
word *trg = (word *)target;
|
||||
T_FLOOR_MAP *t = (T_FLOOR_MAP *)table;
|
||||
unsigned long cc;
|
||||
uint32_t cc;
|
||||
|
||||
do {
|
||||
word *ss = t->txtrofs/2+src;
|
||||
|
@ -368,8 +368,8 @@ void small_anm_delta(void *target,void *buff,void *paleta)
|
|||
{
|
||||
word *t = (word *)target;
|
||||
word *pal = (word *)paleta;
|
||||
unsigned long *deltastart = (unsigned long *)buff;
|
||||
unsigned long ofs = *deltastart++;
|
||||
uint32_t *deltastart = (uint32_t *)buff;
|
||||
uint32_t ofs = *deltastart++;
|
||||
unsigned char *control = (unsigned char *)deltastart;
|
||||
unsigned char *pixels = control + ofs;
|
||||
int y;
|
||||
|
|
|
@ -64,8 +64,8 @@ typedef struct s_save
|
|||
char stereing;
|
||||
char swapchans;
|
||||
char out_filter;
|
||||
long glob_flags;
|
||||
long game_time;
|
||||
int32_t glob_flags;
|
||||
int32_t game_time;
|
||||
char runes[5];
|
||||
char level_name[12];
|
||||
short picks; //pocet_sebranych predmetu v mysi
|
||||
|
@ -78,9 +78,9 @@ typedef struct s_save
|
|||
|
||||
static int get_list_count();
|
||||
|
||||
static word vypocet_crc(char *data,long delka)
|
||||
static word vypocet_crc(char *data,int32_t delka)
|
||||
{
|
||||
unsigned long l=0;
|
||||
uint32_t l=0;
|
||||
do
|
||||
{
|
||||
l=(l<<8)|(delka>0?*data++:0);delka--;
|
||||
|
@ -118,7 +118,7 @@ int load_org_map(char *filename,TSTENA **sides,TSECTOR **sectors,TMAP_EDIT_INFO
|
|||
FILE *f;
|
||||
void *temp;
|
||||
int sect;
|
||||
long size,r;
|
||||
int32_t size,r;
|
||||
char nmapend=1;
|
||||
char *c;
|
||||
|
||||
|
@ -352,7 +352,7 @@ int save_map_state() //uklada stav mapy pro savegame (neuklada aktualni pozici);
|
|||
char *bf;
|
||||
TMPFILE_WR *fsta;
|
||||
int i;
|
||||
long siz;
|
||||
int32_t siz;
|
||||
TSTENA *org_sides;
|
||||
TSECTOR *org_sectors;
|
||||
short res=-1;
|
||||
|
@ -432,7 +432,7 @@ int load_map_state() //obnovuje stav mapy; nutno volat po zavolani load_map;
|
|||
char *bf;
|
||||
TMPFILE_RD *fsta;
|
||||
int i;
|
||||
long siz;
|
||||
int32_t siz;
|
||||
short res=-2;
|
||||
unsigned char ver=0;
|
||||
|
||||
|
@ -867,11 +867,11 @@ int load_game(int slotnum)
|
|||
return r;
|
||||
}
|
||||
|
||||
static void load_specific_file(int slot_num,char *filename,void **out,long *size) //call it in task!
|
||||
static void load_specific_file(int slot_num,char *filename,void **out,int32_t *size) //call it in task!
|
||||
{
|
||||
FILE *slot;
|
||||
char *c,*d;
|
||||
long siz;
|
||||
int32_t siz;
|
||||
char fname[12];
|
||||
char succes=0;
|
||||
|
||||
|
@ -1028,7 +1028,7 @@ static void read_story_task(va_list args)
|
|||
TSTR_LIST ls;
|
||||
void *text_data;
|
||||
char *c,*d;
|
||||
long size;
|
||||
int32_t size;
|
||||
|
||||
load_specific_file(slot,STORY_BOOK,&text_data,&size);
|
||||
if (text_data!=NULL)
|
||||
|
@ -1258,12 +1258,12 @@ static int slot_pos;
|
|||
|
||||
void save_step_next(EVENT_MSG *msg,void **unused)
|
||||
{
|
||||
char c;
|
||||
int c;
|
||||
|
||||
unused;
|
||||
if (msg->msg==E_KEYBOARD)
|
||||
{
|
||||
c=*(char *)msg->data;
|
||||
c=va_arg(msg->data, int);
|
||||
if (c==13)
|
||||
{
|
||||
send_message(E_KEYBOARD,c);
|
||||
|
@ -1471,7 +1471,7 @@ static int load_map_state_partial(char *level_fname,int mapsize) //obnovuje stav
|
|||
char *bf;
|
||||
TMPFILE_RD *fsta;
|
||||
int i;
|
||||
long siz;
|
||||
int32_t siz;
|
||||
short res=-2;
|
||||
unsigned char ver;
|
||||
|
||||
|
|
|
@ -444,7 +444,7 @@ typedef struct tdregisters
|
|||
{
|
||||
int h_num;
|
||||
char name[13];
|
||||
void (*proc)(void **,long *);
|
||||
void (*proc)(void **,int32_t *);
|
||||
char path;
|
||||
}TDREGISTERS;
|
||||
|
||||
|
@ -453,7 +453,7 @@ typedef struct tstena
|
|||
char prim,sec,oblouk,side_tag;
|
||||
unsigned short sector_tag;
|
||||
char xsec,ysec;
|
||||
unsigned long flags;
|
||||
uint32_t flags;
|
||||
char prim_anim,sec_anim,lclip,action;
|
||||
}TSTENA;
|
||||
|
||||
|
@ -504,7 +504,7 @@ typedef struct the_timer
|
|||
int id;
|
||||
int counter,count_max,calls;
|
||||
void (*proc)(struct the_timer *);
|
||||
long userdata[4];
|
||||
int32_t userdata[4];
|
||||
struct the_timer *next;
|
||||
char zavora;
|
||||
}THE_TIMER;
|
||||
|
@ -563,8 +563,8 @@ extern char group_sort[POCET_POSTAV]; //pretrideni skupin
|
|||
extern char global_anim_counter;
|
||||
extern char one_buffer; //1 zapina pouziti pouze jednoho bufferu pro render
|
||||
extern char save_map; //1 oznamuje ze pri opusteni levelu je nutne ulozit stav mapy
|
||||
extern long money; //stav konta hracu
|
||||
extern long level_map[]; //tabulka urovni
|
||||
extern int32_t money; //stav konta hracu
|
||||
extern int32_t level_map[]; //tabulka urovni
|
||||
extern char true_seeing; //1 oznamuje ze bezi kouzlo true_seeing
|
||||
extern char set_halucination;
|
||||
extern int hal_sector; //cislo sektoru a smeru pri halucinaci
|
||||
|
@ -572,7 +572,7 @@ extern int hal_dir;
|
|||
extern char side_touched; //promena se nastavuje na 1 pri kazdem uspesnem dotyku steny
|
||||
extern char *texty_knihy; //jmeno souboru s textamy knihy
|
||||
extern int cur_page; //cislo stranky v knize;
|
||||
extern long game_time; //hraci cas
|
||||
extern int32_t game_time; //hraci cas
|
||||
extern char autoattack;
|
||||
extern char enable_sort;
|
||||
extern char last_send_action; //naposled vyslana akce
|
||||
|
@ -622,15 +622,15 @@ void calc_animations(void);
|
|||
int load_map(char *filename);
|
||||
void other_draw();
|
||||
void refresh_scene();
|
||||
void pcx_fade_decomp(void **p,long *s);
|
||||
void pcx_15bit_decomp(void **p,long *s);
|
||||
void pcx_15bit_autofade(void **p,long *s);
|
||||
void pcx_15bit_backgrnd(void **p,long *s);
|
||||
void pcx_8bit_decomp(void **p,long *s);
|
||||
void hi_8bit_correct(void **p,long *s);
|
||||
void pcx_8bit_nopal(void **p,long *s);
|
||||
void set_background(void **p,long *s);
|
||||
void wav_load(void **p,long *s);
|
||||
void pcx_fade_decomp(void **p,int32_t *s);
|
||||
void pcx_15bit_decomp(void **p,int32_t *s);
|
||||
void pcx_15bit_autofade(void **p,int32_t *s);
|
||||
void pcx_15bit_backgrnd(void **p,int32_t *s);
|
||||
void pcx_8bit_decomp(void **p,int32_t *s);
|
||||
void hi_8bit_correct(void **p,int32_t *s);
|
||||
void pcx_8bit_nopal(void **p,int32_t *s);
|
||||
void set_background(void **p,int32_t *s);
|
||||
void wav_load(void **p,int32_t *s);
|
||||
void wire_main_functs();
|
||||
void ukaz_kompas(char mode);
|
||||
void *timming(EVENT_MSG *msg,void **data);
|
||||
|
@ -726,8 +726,8 @@ void turn_zoom(int smer);
|
|||
void a_touch(int sector,int dir);
|
||||
int do_action(int action_numb,int sector,int direct,int flags,int nosend);
|
||||
void delay_action(int action_numb,int sector,int direct,int flags,int nosend,int delay);
|
||||
long load_section(FILE *f,void **section, int *sct_type,long *sect_size);
|
||||
void prepare_graphics(int *ofs,char *names,long size,void *decomp,int class);
|
||||
int32_t load_section(FILE *f,void **section, int *sct_type,int32_t *sect_size);
|
||||
void prepare_graphics(int *ofs,char *names,int32_t size,void *decomp,int class);
|
||||
void show_automap(char full);
|
||||
void draw_medium_map();
|
||||
void anim_sipky(int h,int mode);
|
||||
|
@ -802,7 +802,7 @@ extern short water_breath; //vec pro dychani pod vodou
|
|||
extern short flute_item;
|
||||
|
||||
void load_items(void);
|
||||
void load_item_map(void *p,long s);
|
||||
void load_item_map(void *p,int32_t s);
|
||||
void draw_placed_items_normal(int celx,int cely,int sect,int side);
|
||||
|
||||
#define SPL_INVIS 0x1 //hrac je neviditelny
|
||||
|
@ -930,7 +930,7 @@ typedef struct thuman
|
|||
short inv[MAX_INV]; //inventar
|
||||
short level; //uroven
|
||||
short weapon_expy[TPW_MAX]; //zkusenosti za zbrane
|
||||
long exp; //zkusenost
|
||||
int32_t exp; //zkusenost
|
||||
char female; //1 kdyz zena
|
||||
char utek; //hodnota udavajici pocet kroku pri uteku
|
||||
HUM_ACTION *zvolene_akce; //ukazatel na tabulku zvolenych akci
|
||||
|
@ -968,7 +968,7 @@ void calc_fly();
|
|||
void zmen_skupinu(THUMAN *p);
|
||||
void add_to_group(int num);
|
||||
void group_all(void);
|
||||
void build_items_called(void **p,long *s);
|
||||
void build_items_called(void **p,int32_t *s);
|
||||
void real_regeneration(); //regenerace postav behem hry v realu (pouze kondice a mana)
|
||||
char sleep_regenerace(THUMAN *p); //regenerace postav behem spani
|
||||
char check_jidlo_voda(THUMAN *p);
|
||||
|
@ -1154,7 +1154,7 @@ typedef struct tma_sound
|
|||
char volume; //5
|
||||
char soundid; //6
|
||||
unsigned short freq; //8
|
||||
long start_loop,end_loop,offset;//20
|
||||
int32_t start_loop,end_loop,offset;//20
|
||||
char filename[12]; //32
|
||||
}TMA_SOUND;
|
||||
|
||||
|
@ -1162,7 +1162,7 @@ typedef struct tma_sound
|
|||
typedef struct tma_text
|
||||
{
|
||||
char action,flags,eflags,pflags;
|
||||
long textindex;
|
||||
int32_t textindex;
|
||||
}TMA_TEXT;
|
||||
|
||||
typedef struct tma_send_action
|
||||
|
@ -1247,7 +1247,7 @@ typedef struct tma_globe
|
|||
unsigned short sector; //sektor of action target, when event occured
|
||||
unsigned char side; //side of action target, when event occured
|
||||
unsigned char cancel; //1 - cancel event
|
||||
unsigned long param; //event depend param - zero is default
|
||||
uint32_t param; //event depend param - zero is default
|
||||
}TMA_GLOBE;
|
||||
|
||||
|
||||
|
@ -1396,7 +1396,7 @@ char test_playing(int track);
|
|||
void stop_track_free(int track);
|
||||
void mute_all_tracks(char all);
|
||||
void kill_all_sounds();
|
||||
void create_sound_table(char *template,long size);
|
||||
void create_sound_table(char *template,int32_t size);
|
||||
void create_sound_table_old();
|
||||
void start_play_flute(char );
|
||||
void stop_play_flute();
|
||||
|
@ -1458,7 +1458,7 @@ typedef struct tmob
|
|||
char flee_num; //pravdepodobnost uteku
|
||||
char anim_counts[6]; //pocet animacnich policek pro kazdy pohyb
|
||||
char mobs_name[7]; //zaklad jmena souboru pro moba
|
||||
long experience; //zkusenost
|
||||
int32_t experience; //zkusenost
|
||||
char vlajky; //BIT0 - 1 v boji
|
||||
char anim_phase; //cinnost kterou mob dela
|
||||
short csektor; //Cilovy sektor
|
||||
|
@ -1501,7 +1501,7 @@ char track_mob(int sect,int dir);//trackuje pritomnost potvory v urcitem smeru
|
|||
void stop_all_mobs();
|
||||
int utok_na_sektor(THUMAN *p,TMOB *m,int chaos,int bonus);
|
||||
int vyber_potvoru(int sect,int dir,int *chaos); //vybere potvoru ze sektoru a smeru. Vraci take pocet potvor v promenne *chaos
|
||||
void load_enemies(short *data,int size,int *grptr,TMOB *template,long tsize);
|
||||
void load_enemies(short *data,int size,int *grptr,TMOB *template,int32_t tsize);
|
||||
char mob_test_na_bitvu(TMOB *p); //nastavi p->vlajky|MOB_INBATTLE pokud potvora muze vstoupit do bitvy;
|
||||
void send_mob_to(int m,word *path);
|
||||
void save_enemy_paths(TMPFILE_WR *f);
|
||||
|
@ -1622,7 +1622,7 @@ int message(int butts,char def,char canc,char *keys,...);
|
|||
void type_text(); //event procedura (parms: X,Y,TEXT,MAX_SPACE,MAX_CHARS);
|
||||
void type_text_v2(va_list args);//char *text_buffer,int x,int y,int max_size,int max_chars,int font,int color,void (*exit_proc)(char));
|
||||
void zalamovani(char *source,char *target,int maxxs,int *xs,int *ys);
|
||||
void col_load(void **data,long *size);
|
||||
void col_load(void **data,int32_t *size);
|
||||
void open_story_file();
|
||||
void write_story_text(char *text);
|
||||
void close_story_file();
|
||||
|
@ -1702,7 +1702,7 @@ typedef struct _tag_globalEventDef
|
|||
unsigned short sector; //sektor of action target, when event occured
|
||||
unsigned char side; //side of action target, when event occured
|
||||
unsigned char cancel; //
|
||||
long param; //event depend param - zero is default
|
||||
int32_t param; //event depend param - zero is default
|
||||
}SGlobalEventDef;
|
||||
|
||||
extern SGlobalEventDef GlobEventList[MAGLOB_NEXTID];
|
||||
|
@ -1715,7 +1715,7 @@ static __inline char GlobEvent(int event, int sector, int side)
|
|||
}
|
||||
|
||||
|
||||
static __inline char GlobEvents(int firstevid, int lastevid, int sector, int side, long param)
|
||||
static __inline char GlobEvents(int firstevid, int lastevid, int sector, int side, int32_t param)
|
||||
{
|
||||
int i;
|
||||
for (i=firstevid;i<=lastevid;i++) if (GlobEventList[i].param==param)
|
||||
|
@ -1726,7 +1726,7 @@ static __inline char GlobEvents(int firstevid, int lastevid, int sector, int sid
|
|||
}
|
||||
|
||||
|
||||
static __inline char TimerEvents(int sector, int side, long time)
|
||||
static __inline char TimerEvents(int sector, int side, int32_t time)
|
||||
{
|
||||
int i;
|
||||
for (i=MAGLOB_ONTIMER1;i<=MAGLOB_ONTIMER4;i++) if (GlobEventList[i].param && GlobEventList[i].param<=time)
|
||||
|
|
127
game/interfac.c
127
game/interfac.c
|
@ -303,12 +303,11 @@ void type_text(EVENT_MSG *msg,void **data)
|
|||
char *c;
|
||||
|
||||
set_font(H_FBOLD,RGB555(31,31,31));
|
||||
p=msg->data;
|
||||
x=p[0];
|
||||
y=p[1];
|
||||
c=*(char **)(p+2);
|
||||
max_size=*(int *)(p+3);
|
||||
max_chars=*(int *)(p+4);
|
||||
x=va_arg(msg->data, int);
|
||||
y=va_arg(msg->data, int);
|
||||
c=va_arg(msg->data, char *);
|
||||
max_size=va_arg(msg->data,int);
|
||||
max_chars=va_arg(msg->data, int);
|
||||
strcpy(text,c);
|
||||
source=c;
|
||||
index=strchr(text,0)-text;
|
||||
|
@ -330,9 +329,8 @@ void type_text(EVENT_MSG *msg,void **data)
|
|||
}
|
||||
else if (msg->msg==E_KEYBOARD)
|
||||
{
|
||||
char c;
|
||||
char c = va_arg(msg->data, int);
|
||||
|
||||
c=*(char *)msg->data;
|
||||
set_font(H_FBOLD,RGB555(31,31,31));
|
||||
if (c)
|
||||
{
|
||||
|
@ -487,7 +485,7 @@ void type_text_v2(va_list args)
|
|||
}
|
||||
|
||||
|
||||
void col_load(void **data,long *size)
|
||||
void col_load(void **data,int32_t *size)
|
||||
{
|
||||
int siz=*size;
|
||||
char *s,*c;
|
||||
|
@ -580,30 +578,31 @@ typedef struct radio_butt_data
|
|||
char *texty;
|
||||
}TRADIO_BUTT_DATA;
|
||||
|
||||
static void radio_butts_init(OBJREC *o,long *params)
|
||||
static void radio_butts_init(OBJREC *o,va_list params)
|
||||
{
|
||||
char *c,*z;
|
||||
long cnt=0,*q,*d,*zz;
|
||||
int32_t cnt=0,*q,*zz;
|
||||
int i;
|
||||
TRADIO_BUTT_DATA *rd;
|
||||
|
||||
d=params;
|
||||
for (i=0;i<*params;i++)
|
||||
va_list d;
|
||||
va_copy(d, params);
|
||||
int count = va_arg(d, int);
|
||||
for (i=0;i<count;i++)
|
||||
{
|
||||
d+=1;
|
||||
c=get_title(d);
|
||||
c=va_arg(d, char *);
|
||||
cnt+=strlen(c);cnt++;
|
||||
}
|
||||
rd=New(TRADIO_BUTT_DATA);
|
||||
o->userptr=(void *)rd;
|
||||
zz=q=(long *)getmem(cnt+8);
|
||||
*q++=1;*q++=*params;
|
||||
d=params;
|
||||
zz=q=(int32_t *)getmem(cnt+8);
|
||||
*q++=1;*q++=count;
|
||||
va_end(d);
|
||||
va_copy(d, params);
|
||||
z=(char *)q;
|
||||
for (i=0;i<*params;i++)
|
||||
for (i=0;i<count;i++)
|
||||
{
|
||||
d+=1;
|
||||
c=get_title(d);
|
||||
c=va_arg(d, char *);
|
||||
strcpy(z,c);
|
||||
z=strchr(z,'\0');z++;
|
||||
}
|
||||
|
@ -614,14 +613,14 @@ static void radio_butts_init(OBJREC *o,long *params)
|
|||
static void radio_butts_draw(int x1,int y1,int x2,int y2,OBJREC *o)
|
||||
{
|
||||
int step,size,sizpul,i;
|
||||
long *params;
|
||||
int32_t *params;
|
||||
char *texts;
|
||||
CTL3D *clt;
|
||||
TRADIO_BUTT_DATA *rd;
|
||||
|
||||
x2;
|
||||
rd=(TRADIO_BUTT_DATA *)o->userptr;
|
||||
params=(long *)rd->texty;
|
||||
params=(int32_t *)rd->texty;
|
||||
step=(y2-y1)/(*(params+1));
|
||||
size=(step*9)/10;
|
||||
sizpul=size>>1;
|
||||
|
@ -637,7 +636,7 @@ static void radio_butts_draw(int x1,int y1,int x2,int y2,OBJREC *o)
|
|||
clt=def_border(5,curcolor);
|
||||
for (i=0;i<*(params+1);i++,y1+=step)
|
||||
{
|
||||
if (*(long *)o->data==i)
|
||||
if (*(int32_t *)o->data==i)
|
||||
{
|
||||
int xx1=x1+2,yy1=y1+1,xx2=x1+size-2,yy2=y1+size-3,xxs=(xx1+xx2)>>1,yys=(yy1+yy2)>>1;
|
||||
curcolor=0x0;
|
||||
|
@ -670,13 +669,13 @@ static void radio_butts_event(EVENT_MSG *msg,OBJREC *o)
|
|||
if (ms->event_type & 0x02)
|
||||
{
|
||||
TRADIO_BUTT_DATA *rd;
|
||||
long *params;
|
||||
int32_t *params;
|
||||
|
||||
rd=(TRADIO_BUTT_DATA *)o->userptr;
|
||||
params=(long *)rd->texty;
|
||||
params=(int32_t *)rd->texty;
|
||||
sel=(ms->y-o->locy)/(o->ys/(*(params+1)));
|
||||
if (sel>=*(params+1)) sel=*(params+1)-1;
|
||||
*(long *)o->data=sel;
|
||||
*(int32_t *)o->data=sel;
|
||||
*params=0;
|
||||
redraw_object(o);
|
||||
*params=1;
|
||||
|
@ -697,10 +696,10 @@ static void radio_butts_done(OBJREC *o)
|
|||
|
||||
void radio_butts_gr(OBJREC *o)
|
||||
{
|
||||
o->runs[0]=radio_butts_init;
|
||||
o->runs[1]=radio_butts_draw;
|
||||
o->runs[2]=radio_butts_event;;
|
||||
o->runs[3]=radio_butts_done;;
|
||||
o->call_init=radio_butts_init;
|
||||
o->call_draw=radio_butts_draw;
|
||||
o->call_event=radio_butts_event;;
|
||||
o->call_done=radio_butts_done;;
|
||||
o->datasize=4;
|
||||
}
|
||||
|
||||
|
@ -715,7 +714,7 @@ void radio_butts_gr(OBJREC *o)
|
|||
return znak=='A';
|
||||
}
|
||||
*/
|
||||
long get_disk_free(char disk)
|
||||
int32_t get_disk_free(char disk)
|
||||
{
|
||||
return 10*1024*1024;
|
||||
/* struct diskfree_t ds;
|
||||
|
@ -729,7 +728,7 @@ void start_check()
|
|||
/*
|
||||
char *c;
|
||||
unsigned drv;
|
||||
long siz;
|
||||
int32_t siz;
|
||||
struct meminfo memory;
|
||||
get_mem_info(&memory);
|
||||
concat(c,pathtable[SR_TEMP],TEMP_FILE);
|
||||
|
@ -762,7 +761,7 @@ void start_check()
|
|||
/*
|
||||
typedef struct dos_extra_block
|
||||
{
|
||||
long sector;
|
||||
int32_t sector;
|
||||
word pocet;
|
||||
word buffer_ofs;
|
||||
word buffer_seg;
|
||||
|
@ -772,7 +771,7 @@ typedef struct dos_extra_block
|
|||
typedef struct disk_label
|
||||
{
|
||||
word nula;
|
||||
long serial;
|
||||
int32_t serial;
|
||||
char label[11];
|
||||
char type[8];
|
||||
};
|
||||
|
@ -808,13 +807,13 @@ typedef struct disk_label
|
|||
|
||||
*/
|
||||
/*
|
||||
long read_serial(char drive)
|
||||
int32_t read_serial(char drive)
|
||||
{
|
||||
word segment;
|
||||
word selector;
|
||||
struct disk_label *p;
|
||||
RMREGS regs;
|
||||
long serial;
|
||||
int32_t serial;
|
||||
|
||||
dosalloc(32,&segment,&selector);
|
||||
regs.eax=0x6900;
|
||||
|
@ -830,7 +829,7 @@ long read_serial(char drive)
|
|||
|
||||
static void crash_event1(THE_TIMER *t)
|
||||
{
|
||||
long serial;
|
||||
int32_t serial;
|
||||
int i;
|
||||
|
||||
serial=read_serial(t->userdata[1]);
|
||||
|
@ -843,7 +842,7 @@ static void crash_event1(THE_TIMER *t)
|
|||
|
||||
static void crash_event2(THE_TIMER *t)
|
||||
{
|
||||
long serial;
|
||||
int32_t serial;
|
||||
int i;
|
||||
|
||||
serial=read_serial(t->userdata[1]);
|
||||
|
@ -856,7 +855,7 @@ static void crash_event2(THE_TIMER *t)
|
|||
|
||||
static void crash_event3(THE_TIMER *t)
|
||||
{
|
||||
long serial;
|
||||
int32_t serial;
|
||||
int i;
|
||||
|
||||
serial=read_serial(t->userdata[1]);
|
||||
|
@ -875,21 +874,21 @@ void check_number_1phase(char *exename) //check serial number!
|
|||
int h;
|
||||
char buffer[_MAX_PATH];
|
||||
unsigned short date,time;
|
||||
long serial;
|
||||
int32_t serial;
|
||||
|
||||
_fullpath(buffer,exename,_MAX_PATH);
|
||||
t=add_to_timer(TM_HACKER,2000,1,crash_event1);
|
||||
t->userdata[0]=*(long *)error_hack;
|
||||
t->userdata[1]=(long)buffer[0]-'@';
|
||||
t->userdata[0]=*(int32_t *)error_hack;
|
||||
t->userdata[1]=(int32_t)buffer[0]-'@';
|
||||
t=add_to_timer(TM_HACKER,3000,1,crash_event2);
|
||||
t->userdata[0]=*(long *)error_hack;
|
||||
t->userdata[1]=(long)buffer[0]-'@';
|
||||
t->userdata[0]=*(int32_t *)error_hack;
|
||||
t->userdata[1]=(int32_t)buffer[0]-'@';
|
||||
h=open(exename,O_RDONLY);
|
||||
_dos_getftime(h,&date,&time);
|
||||
serial=(date<<16) | time;
|
||||
t=add_to_timer(TM_HACKER,4000,1,crash_event3);
|
||||
t->userdata[0]=~serial;
|
||||
t->userdata[1]=(long)buffer[0]-'@';
|
||||
t->userdata[1]=(int32_t)buffer[0]-'@';
|
||||
close(h);
|
||||
}
|
||||
|
||||
|
@ -958,20 +957,21 @@ void animate_checkbox(int first_id,int last_id,int step)
|
|||
|
||||
void skeldal_checkbox(OBJREC *o)
|
||||
{
|
||||
// o->runs[0]=skeldal_checkbox_init;
|
||||
o->runs[1]=skeldal_checkbox_draw;
|
||||
o->runs[2]=skeldal_checkbox_event;
|
||||
// o->call_init=skeldal_checkbox_init;
|
||||
o->call_draw=skeldal_checkbox_draw;
|
||||
o->call_event=skeldal_checkbox_event;
|
||||
o->datasize=1;
|
||||
}
|
||||
|
||||
//------------------------------------------
|
||||
|
||||
static void setup_button_init(OBJREC *o,char **params)
|
||||
static void setup_button_init(OBJREC *o,va_list params)
|
||||
{
|
||||
void **d;
|
||||
char title = va_arg(params, char *);
|
||||
d=NewArr(void *,2);
|
||||
d[0]=NewArr(char,strlen(*params)+1);
|
||||
strcpy(d[0],*params);
|
||||
d[0]=NewArr(char,strlen(title)+1);
|
||||
strcpy(d[0],title);
|
||||
d[1]=NULL;
|
||||
o->userptr=(void *)d;
|
||||
*(char *)o->data=0;
|
||||
|
@ -1038,10 +1038,10 @@ static void setup_button_done(OBJREC *o)
|
|||
|
||||
void setup_ok_button(OBJREC *o)
|
||||
{
|
||||
o->runs[0]=setup_button_init;
|
||||
o->runs[1]=setup_button_draw;
|
||||
o->runs[2]=setup_button_event;
|
||||
o->runs[3]=setup_button_done;
|
||||
o->call_init=setup_button_init;
|
||||
o->call_draw=setup_button_draw;
|
||||
o->call_event=setup_button_event;
|
||||
o->call_done=setup_button_done;
|
||||
o->datasize=1;
|
||||
}
|
||||
|
||||
|
@ -1052,10 +1052,10 @@ typedef struct skeldal_soupak_params_t {
|
|||
void *bgpic;
|
||||
} skeldal_soupak_params;
|
||||
|
||||
static void skeldal_soupak_init (OBJREC *o,int *params)
|
||||
static void skeldal_soupak_init (OBJREC *o,va_list params)
|
||||
{
|
||||
skeldal_soupak_params *p = getmem(sizeof(skeldal_soupak_params));
|
||||
p->range = *params;
|
||||
p->range = va_arg(params, int);
|
||||
p->bgpic = NULL;
|
||||
o->userptr=p;
|
||||
}
|
||||
|
@ -1132,10 +1132,10 @@ static void skeldal_soupak_done(OBJREC *o)
|
|||
|
||||
void skeldal_soupak(OBJREC *o)
|
||||
{
|
||||
o->runs[0]=skeldal_soupak_init;
|
||||
o->runs[1]=skeldal_soupak_draw;
|
||||
o->runs[2]=skeldal_soupak_event;
|
||||
o->runs[3]=skeldal_soupak_done;
|
||||
o->call_init=skeldal_soupak_init;
|
||||
o->call_draw=skeldal_soupak_draw;
|
||||
o->call_event=skeldal_soupak_event;
|
||||
o->call_done=skeldal_soupak_done;
|
||||
o->datasize=4;
|
||||
}
|
||||
|
||||
|
@ -1479,7 +1479,8 @@ static void smlouvat_enter(EVENT_MSG *msg,OBJREC *o)
|
|||
o;
|
||||
if (msg->msg==E_KEYBOARD)
|
||||
{
|
||||
switch( *(char *)msg->data)
|
||||
int c = va_arg(msg->data, int);
|
||||
switch(c)
|
||||
{
|
||||
case 13:goto_control(30);terminate_gui();break;
|
||||
case 27:goto_control(20);terminate_gui();break;
|
||||
|
|
26
game/inv.c
26
game/inv.c
|
@ -61,7 +61,7 @@ TSHOP *cur_shop;
|
|||
TSHOP **shop_list=NULL;int max_shops=0; //shop_list=prima spojeni s obchody
|
||||
void *shop_hacek=NULL; //hacek za ktery visi cely shop strom (free(shop_hacek) - odalokuje shopy)
|
||||
//hacek lze ulozit do savegame -> ulozi se cely stav obchodu
|
||||
long shop_hacek_size=0; //toto je jeho delka
|
||||
int32_t shop_hacek_size=0; //toto je jeho delka
|
||||
|
||||
#define ico_extract(icnnum) (((char*)ablock(ikon_libs+(icnnum)/IT_LIB_SIZE))+IT_ICONE_SIZE*((icnnum)%IT_LIB_SIZE))
|
||||
|
||||
|
@ -138,7 +138,7 @@ void item_sound_event(int item,int sector)
|
|||
play_sample_at_sector(glob_items[item].sound+sound_handle,viewsector,sector,0,0);
|
||||
}
|
||||
|
||||
static void items_15to16_correct(void **p,long *s)
|
||||
static void items_15to16_correct(void **p,int32_t *s)
|
||||
{
|
||||
int i,j;
|
||||
char *cur=(char *)(*p);
|
||||
|
@ -161,7 +161,7 @@ void load_items()
|
|||
char *name;
|
||||
FILE *f;THANDLE_DATA *h;
|
||||
int sect,i,hs;
|
||||
long size;
|
||||
int32_t size;
|
||||
void *p;
|
||||
|
||||
f=NULL;i=0;
|
||||
|
@ -349,7 +349,7 @@ short create_item_money(int obnos)
|
|||
return i+1;
|
||||
}
|
||||
|
||||
void load_item_map(void *p,long s)
|
||||
void load_item_map(void *p,int32_t s)
|
||||
{
|
||||
word itmc;
|
||||
int sect;
|
||||
|
@ -1164,7 +1164,7 @@ void display_rings()
|
|||
}
|
||||
}
|
||||
|
||||
void *build_items_wearing(THUMAN *h, long *s)
|
||||
void *build_items_wearing(THUMAN *h, int32_t *s)
|
||||
{
|
||||
int i,vzhled,it;
|
||||
word *p,hx,hy;
|
||||
|
@ -1215,7 +1215,7 @@ void *build_items_wearing(THUMAN *h, long *s)
|
|||
}
|
||||
|
||||
|
||||
void build_items_called(void **p,long *s)
|
||||
void build_items_called(void **p,int32_t *s)
|
||||
{
|
||||
*p=build_items_wearing(&postavy[memman_handle-H_POSTAVY], s);
|
||||
}
|
||||
|
@ -1343,8 +1343,8 @@ static T_INV_SCRIPT script[]=
|
|||
|
||||
static int calc_value(int parm,int lenght)
|
||||
{
|
||||
long l;
|
||||
if (parm>=0) l=*(long *)(((char *)human_selected)+parm);
|
||||
int32_t l;
|
||||
if (parm>=0) l=*(int32_t *)(((char *)human_selected)+parm);
|
||||
else
|
||||
switch (parm)
|
||||
{
|
||||
|
@ -1357,10 +1357,10 @@ static int calc_value(int parm,int lenght)
|
|||
}
|
||||
switch(lenght)
|
||||
{
|
||||
case 1:l=(long)((signed char)l);break;
|
||||
case 1:l=(int32_t)((signed char)l);break;
|
||||
default:
|
||||
case 2:l=(long)((short)l);break;
|
||||
case 4:l=(long)l;break;
|
||||
case 2:l=(int32_t)((short)l);break;
|
||||
case 4:l=(int32_t)l;break;
|
||||
}
|
||||
return l;
|
||||
}
|
||||
|
@ -2164,7 +2164,7 @@ void *inv_keyboard(EVENT_MSG *msg,void **usr)
|
|||
usr;
|
||||
if (msg->msg==E_KEYBOARD)
|
||||
{
|
||||
c=(*(int *)msg->data)>>8;
|
||||
c=va_arg(msg->data, int)>>8;
|
||||
switch (c)
|
||||
{
|
||||
case 0x17:
|
||||
|
@ -2819,7 +2819,7 @@ void unwire_shop()
|
|||
|
||||
void wire_shop()
|
||||
{
|
||||
long size;
|
||||
int32_t size;
|
||||
static TSHOP *last_shop=NULL;
|
||||
static void *pic=NULL;
|
||||
mute_all_tracks(0);
|
||||
|
|
|
@ -146,7 +146,7 @@ typedef struct tkouzlo
|
|||
TKOUZLO *spell_table[MAX_SPELLS];
|
||||
short *vls_table[MAX_SPELLS]; //nove vlastnosti postav
|
||||
//pokud je cislo vetsi nez 0x7f00 pak dolni byte uvadi percentualni pomer
|
||||
static long _flag_map[MAX_SPELLS]; //tabulka nastavenych priznaku pro kouzlo.
|
||||
static int32_t _flag_map[MAX_SPELLS]; //tabulka nastavenych priznaku pro kouzlo.
|
||||
//prvnich 16 bitu je pro postavu
|
||||
//hornich 16 bitu je globalne
|
||||
|
||||
|
@ -186,7 +186,7 @@ static void play_anim(va_list args) //tasked animation
|
|||
int block=va_arg(args,int);
|
||||
#define ANIM_SIZE (320*180*2)
|
||||
void *anm;
|
||||
long *l,c;
|
||||
int32_t *l,c;
|
||||
|
||||
if (running_anm)
|
||||
{
|
||||
|
@ -552,7 +552,7 @@ char hod_na_uspech(int cil,TKOUZLO *k)
|
|||
|
||||
void spell_end_global()
|
||||
{
|
||||
long l=0;
|
||||
int32_t l=0;
|
||||
int i;
|
||||
for(i=0;i<MAX_SPELLS;i++) l|=_flag_map[i];
|
||||
if (!(l & FLG_TRUESEEING)) true_seeing=0;
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
int **macros=NULL;
|
||||
void *macro_block;
|
||||
int macro_block_size;
|
||||
long sound_side_flags=0; //kopie flagu steny pro zvuk
|
||||
int32_t sound_side_flags=0; //kopie flagu steny pro zvuk
|
||||
static char codelock_memory[16][8];
|
||||
static short rand_value;
|
||||
static int program_counter=0;
|
||||
|
@ -501,7 +501,7 @@ static void ma_wbook(TMA_LOADLEV *l)
|
|||
free(s);
|
||||
}
|
||||
|
||||
static void ma_send_experience(long what)
|
||||
static void ma_send_experience(int32_t what)
|
||||
{
|
||||
int maxl,i;
|
||||
THUMAN *h;
|
||||
|
@ -627,9 +627,9 @@ void macro_register_global_event(TMULTI_ACTION *q)
|
|||
GlobEventList[q->globe.event].param+=game_time;
|
||||
else
|
||||
{
|
||||
long den=24*60*6;
|
||||
long cas=((-GlobEventList[q->globe.event].param/100)*60+(-GlobEventList[q->globe.event].param%100))*6;
|
||||
long curtm=game_time % den;
|
||||
int32_t den=24*60*6;
|
||||
int32_t cas=((-GlobEventList[q->globe.event].param/100)*60+(-GlobEventList[q->globe.event].param%100))*6;
|
||||
int32_t curtm=game_time % den;
|
||||
if (cas<=curtm) cas+=den;
|
||||
GlobEventList[q->globe.event].param=game_time-curtm+cas;
|
||||
}
|
||||
|
|
|
@ -122,7 +122,7 @@ jp1:lodsb
|
|||
}
|
||||
}*/
|
||||
|
||||
static void nahraj_rozdilovy_pcx(void **pp,long *s)
|
||||
static void nahraj_rozdilovy_pcx(void **pp,int32_t *s)
|
||||
{
|
||||
char *org,*pos;
|
||||
char *vysl;
|
||||
|
@ -315,8 +315,8 @@ static void klavesnice(EVENT_MSG *msg,void **unused)
|
|||
{
|
||||
for(cursor=0;cursor<5;cursor++) if (cur_dir[cursor]==SELECT) break;
|
||||
if (cursor==5) cursor=-1;
|
||||
|
||||
switch(*((char *)msg->data+1))
|
||||
int c = va_arg(msg->data,int);
|
||||
switch(c)
|
||||
{
|
||||
case 'H':cursor--;if (cursor<0) cursor=0;break;
|
||||
case 'P':cursor++;if (cursor>4) cursor=4;break;
|
||||
|
|
|
@ -85,16 +85,16 @@ char force_start_dialog=0;
|
|||
int start_dialog_number=0;
|
||||
int start_dialog_mob=0;
|
||||
|
||||
long money=0;
|
||||
int32_t money=0;
|
||||
|
||||
char runes[5]={0,0,0,0,0};
|
||||
|
||||
char group_sort[POCET_POSTAV]={0,1,2,3,4,5};
|
||||
|
||||
long load_section(FILE *f,void **section, int *sct_type,long *sect_size)
|
||||
int32_t load_section(FILE *f,void **section, int *sct_type,int32_t *sect_size)
|
||||
//
|
||||
{
|
||||
long s;
|
||||
int32_t s;
|
||||
char c[20];
|
||||
|
||||
*section=NULL;
|
||||
|
@ -109,7 +109,7 @@ long load_section(FILE *f,void **section, int *sct_type,long *sect_size)
|
|||
}
|
||||
|
||||
|
||||
void prepare_graphics(int *ofs,char *names,long size,void *decomp,int class)
|
||||
void prepare_graphics(int *ofs,char *names,int32_t size,void *decomp,int class)
|
||||
{
|
||||
char *p,*end;
|
||||
|
||||
|
@ -192,7 +192,7 @@ char *pripona(char *filename,char *pripona)
|
|||
void show_loading_picture(char *filename)
|
||||
{
|
||||
void *p;
|
||||
long s;
|
||||
int32_t s;
|
||||
|
||||
p=afile(filename,SR_BGRAFIKA,&s);
|
||||
put_picture(0,0,p);
|
||||
|
@ -211,13 +211,13 @@ int load_map(char *filename)
|
|||
FILE *f;
|
||||
void *temp;
|
||||
int sect;
|
||||
long size,r;
|
||||
int32_t size,r;
|
||||
char nmapend=1;
|
||||
int ofsts=START_HANDLE;
|
||||
char *c,*d;
|
||||
char snd_load=0;
|
||||
void *mob_template;
|
||||
long mob_size;
|
||||
int32_t mob_size;
|
||||
int suc;
|
||||
|
||||
map_with_password=0;
|
||||
|
@ -312,7 +312,7 @@ int load_map(char *filename)
|
|||
SEND_LOG("(GAME) Loading enemies...",0,0);
|
||||
if (mob_template==NULL)
|
||||
{
|
||||
long h;char *p;
|
||||
int32_t h;char *p;
|
||||
|
||||
alock(H_ENEMY);
|
||||
p=ablock(H_ENEMY);p+=8;
|
||||
|
@ -492,7 +492,7 @@ void leave_current_map()
|
|||
|
||||
|
||||
|
||||
long actn_flags(TSTENA *q,long flags)
|
||||
int32_t actn_flags(TSTENA *q,int32_t flags)
|
||||
{
|
||||
flags>>=24;
|
||||
flags&=0x1f;
|
||||
|
@ -697,7 +697,7 @@ void calc_fly()
|
|||
|
||||
}
|
||||
|
||||
extern long sound_side_flags;
|
||||
extern int32_t sound_side_flags;
|
||||
|
||||
|
||||
void calc_animations()
|
||||
|
@ -789,7 +789,7 @@ int get_action_delay(TSTENA *q)
|
|||
return 0;
|
||||
}
|
||||
*/
|
||||
void check_codelock_log(int sector,unsigned long flags)
|
||||
void check_codelock_log(int sector,uint32_t flags)
|
||||
{
|
||||
int i;
|
||||
TSTENA *p;
|
||||
|
@ -1912,7 +1912,7 @@ void *game_keyboard(EVENT_MSG *msg,void **usr)
|
|||
if (cur_mode==MD_END_GAME) return NULL;
|
||||
if (msg->msg==E_KEYBOARD)
|
||||
{
|
||||
c=(*(int *)msg->data)>>8;
|
||||
c=va_arg(msg->data, int)>>8;
|
||||
while (_bios_keybrd(_KEYBRD_READY) ) _bios_keybrd(_KEYBRD_READ);
|
||||
switch (c)
|
||||
{
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#define DELITEL 0xC005
|
||||
|
||||
|
||||
unsigned long vysledek;
|
||||
uint32_t vysledek;
|
||||
|
||||
main()
|
||||
{
|
||||
|
|
|
@ -76,7 +76,7 @@ char **texty;
|
|||
|
||||
char skip_intro=0;
|
||||
char autosave_enabled=0;
|
||||
long game_time=0;
|
||||
int32_t game_time=0;
|
||||
int charmin=3;
|
||||
int charmax=3;
|
||||
|
||||
|
@ -123,11 +123,11 @@ static char windowedzoom=1;
|
|||
static char monitor=0;
|
||||
static int refresh=0;
|
||||
|
||||
void pcx_fade_decomp(void **p,long *s);
|
||||
void pcx_15bit_decomp(void **p,long *s);
|
||||
void pcx_15bit_autofade(void **p,long *s);
|
||||
void pcx_15bit_backgrnd(void **p,long *s);
|
||||
void pcx_8bit_decomp(void **p,long *s);
|
||||
void pcx_fade_decomp(void **p,int32_t *s);
|
||||
void pcx_15bit_decomp(void **p,int32_t *s);
|
||||
void pcx_15bit_autofade(void **p,int32_t *s);
|
||||
void pcx_15bit_backgrnd(void **p,int32_t *s);
|
||||
void pcx_8bit_decomp(void **p,int32_t *s);
|
||||
|
||||
char *texty_knihy;
|
||||
static char *patch_file=NULL;
|
||||
|
@ -360,7 +360,7 @@ int ask_video()
|
|||
return c-1;
|
||||
}
|
||||
|
||||
void pcx_fade_decomp(void **p,long *s)
|
||||
void pcx_fade_decomp(void **p,int32_t *s)
|
||||
{
|
||||
char *buff;
|
||||
int r = load_pcx(*p,*s,A_FADE_PAL,&buff,mglob.fade_r,mglob.fade_g,mglob.fade_b);
|
||||
|
@ -370,7 +370,7 @@ void pcx_fade_decomp(void **p,long *s)
|
|||
*p=buff;
|
||||
}
|
||||
|
||||
void pcx_15bit_decomp(void **p,long *s)
|
||||
void pcx_15bit_decomp(void **p,int32_t *s)
|
||||
{
|
||||
char *buff;
|
||||
int r = load_pcx(*p,*s,A_16BIT,&buff);
|
||||
|
@ -380,7 +380,7 @@ void pcx_15bit_decomp(void **p,long *s)
|
|||
*p=buff;
|
||||
}
|
||||
|
||||
void pcx_15bit_autofade(void **p,long *s)
|
||||
void pcx_15bit_autofade(void **p,int32_t *s)
|
||||
{
|
||||
char *buff;
|
||||
int r = load_pcx(*p,*s,A_16BIT,&buff);
|
||||
|
@ -391,16 +391,16 @@ void pcx_15bit_autofade(void **p,long *s)
|
|||
buff[5]=0x80;
|
||||
}
|
||||
|
||||
void pcx_15bit_backgrnd(void **p,long *s)
|
||||
void pcx_15bit_backgrnd(void **p,int32_t *s)
|
||||
{
|
||||
char *buff;
|
||||
long i;long *z;
|
||||
int32_t i;int32_t *z;
|
||||
|
||||
if (*p!=NULL)
|
||||
{
|
||||
int r = load_pcx(*p,*s,A_16BIT,&buff);
|
||||
assert(r>0);
|
||||
z=(long *)buff;
|
||||
z=(int32_t *)buff;
|
||||
*s=r;
|
||||
for(i=*s;i>0;i-=4,z++) *z|=0x80008000;
|
||||
free(*p);
|
||||
|
@ -408,7 +408,7 @@ void pcx_15bit_backgrnd(void **p,long *s)
|
|||
}
|
||||
}
|
||||
|
||||
void pcx_8bit_nopal(void **p,long *s)
|
||||
void pcx_8bit_nopal(void **p,int32_t *s)
|
||||
{
|
||||
char *buff;
|
||||
|
||||
|
@ -423,7 +423,7 @@ void pcx_8bit_nopal(void **p,long *s)
|
|||
}
|
||||
|
||||
|
||||
void pcx_8bit_decomp(void **p,long *s)
|
||||
void pcx_8bit_decomp(void **p,int32_t *s)
|
||||
{
|
||||
char *buff;
|
||||
int r = load_pcx(*p,*s,A_8BIT,&buff);
|
||||
|
@ -433,7 +433,7 @@ void pcx_8bit_decomp(void **p,long *s)
|
|||
*p=buff;
|
||||
}
|
||||
|
||||
void hi_8bit_correct(void **p,long *s)
|
||||
void hi_8bit_correct(void **p,int32_t *s)
|
||||
{
|
||||
word *ptr=(word *)*p;
|
||||
int i;
|
||||
|
@ -447,7 +447,7 @@ void hi_8bit_correct(void **p,long *s)
|
|||
}
|
||||
|
||||
|
||||
void set_background(void **p,long *s)
|
||||
void set_background(void **p,int32_t *s)
|
||||
{
|
||||
word *data;
|
||||
word *ptr;
|
||||
|
@ -601,7 +601,7 @@ void *timming(EVENT_MSG *msg,void **data)
|
|||
data;
|
||||
if (msg->msg==E_INIT) return &timming;
|
||||
*otevri_zavoru=1;
|
||||
j=*(int *)msg->data;
|
||||
j=va_arg(msg->data,int);
|
||||
for (i=0;i<j;i++)
|
||||
{
|
||||
p=&timer_tree;
|
||||
|
@ -862,7 +862,7 @@ void global_kbd(EVENT_MSG *msg,void **usr)
|
|||
usr;
|
||||
if (msg->msg==E_KEYBOARD)
|
||||
{
|
||||
c=(*(int *)msg->data)>>8;
|
||||
c=va_arg(msg->data,int)>>8;
|
||||
if (c==';') save_dump(GetScreenAdr(), DxGetResX(), DxGetResY(), scr_linelen2);
|
||||
}
|
||||
return;
|
||||
|
@ -973,7 +973,7 @@ static void patch_error(int err)
|
|||
|
||||
void init_skeldal(void)
|
||||
{
|
||||
char c[200],d[200];
|
||||
char c[MAX_FILESYSTEM_PATH],d[MAX_FILESYSTEM_PATH];
|
||||
int verr;
|
||||
|
||||
boldcz=LoadDefaultFont();
|
||||
|
@ -998,7 +998,7 @@ SEND_LOG("(INIT) Initializing engine.",0,0);
|
|||
/*SEND_LOG("(INIT) Loading DOS error handler.",0,0);
|
||||
install_dos_error(device_error,(char *)getmem(4096)+4096);*/
|
||||
swap_error=swap_error_exception;
|
||||
sprintf(d,"%s%s",pathtable[SR_DATA],"skeldal.ddl");
|
||||
snprintf(d,sizeof(d),"%s%s",pathtable[SR_DATA],"skeldal.ddl");
|
||||
SEND_LOG("(INIT) Initializing memory manager",0,0);
|
||||
init_manager(d,c);
|
||||
SEND_LOG("(GAME) Memory manager initialized. Using DDL: '%s' Temp dir: '%s'",d,c);
|
||||
|
@ -1104,7 +1104,7 @@ extern char running_battle;
|
|||
if (msg->msg==E_RELOADMAP)
|
||||
{
|
||||
int i;
|
||||
ReloadMapInfo *minfo=(ReloadMapInfo *)msg->data;
|
||||
ReloadMapInfo *minfo=va_arg(msg->data, ReloadMapInfo *);
|
||||
const char *fname=minfo->fname;
|
||||
int sektor=minfo->sektor;
|
||||
strncpy(loadlevel.name,fname,sizeof(loadlevel.name));
|
||||
|
|
|
@ -195,10 +195,10 @@ int calcul_volume(int chan,int x,int y,int side,int volume)
|
|||
return 0;
|
||||
}
|
||||
|
||||
void wav_load(void **p,long *s)
|
||||
void wav_load(void **p,int32_t *s)
|
||||
{
|
||||
char *sr;
|
||||
long *d;
|
||||
int32_t *d;
|
||||
char *c;
|
||||
char *tg;
|
||||
void *tgr;
|
||||
|
@ -238,7 +238,7 @@ void wav_load(void **p,long *s)
|
|||
|
||||
s=siz & 3;
|
||||
siz>>=2;
|
||||
d=(long *)tg;
|
||||
d=(int32_t *)tg;
|
||||
for(;siz--;d++) *d^=0x80808080;
|
||||
c=(char *)d;
|
||||
for(;s--;c++) *c^=0x80;
|
||||
|
@ -515,7 +515,7 @@ void play_sample_at_channel(int sample,int channel,int vol)
|
|||
}
|
||||
|
||||
|
||||
void create_sound_table(char *template,long size)
|
||||
void create_sound_table(char *template,int32_t size)
|
||||
{
|
||||
char *c,*s;
|
||||
int i=0;
|
||||
|
@ -533,12 +533,12 @@ void create_sound_table(char *template,long size)
|
|||
void create_sound_table_old()
|
||||
{
|
||||
char *c,*s;
|
||||
long pocet;
|
||||
int32_t pocet;
|
||||
int i=0;
|
||||
|
||||
if (sound_table==NULL) sound_table=create_list(2);
|
||||
s=c=ablock(H_SOUND_DAT);
|
||||
memcpy(&pocet,s,sizeof(long));c+=4;
|
||||
memcpy(&pocet,s,sizeof(int32_t));c+=4;
|
||||
while (pocet--)
|
||||
{
|
||||
if (c[0]!=0) str_replace(&sound_table,i,c);
|
||||
|
|
|
@ -33,7 +33,7 @@ static int autostart_round=0;
|
|||
|
||||
char autoattack=0;
|
||||
char immortality=0;
|
||||
long level_map[]=
|
||||
int32_t level_map[]=
|
||||
{400, //level 2
|
||||
1000, // 3
|
||||
1800, // 4
|
||||
|
@ -689,8 +689,8 @@ void wire_end_game()
|
|||
void konec_presunu(EVENT_MSG *msg,void **unused)
|
||||
{
|
||||
unused;
|
||||
|
||||
if (msg->msg==E_KEYBOARD && ((*(int *)msg->data)>>8)==28 && !pass_zavora)
|
||||
int d = va_arg(msg->data, int);
|
||||
if (msg->msg==E_KEYBOARD && (d>>8)==28 && !pass_zavora)
|
||||
{
|
||||
unwire_proc();
|
||||
wire_jadro_souboje();
|
||||
|
@ -1913,7 +1913,7 @@ void programming_keyboard(EVENT_MSG *msg,void **unused)
|
|||
unused;
|
||||
if (msg->msg==E_KEYBOARD)
|
||||
{
|
||||
c=(*(int *)msg->data)>>8;
|
||||
c=va_arg(msg->data, int)>>8;
|
||||
while (_bios_keybrd(_KEYBRD_READY) ) _bios_keybrd(_KEYBRD_READ);
|
||||
switch (c)
|
||||
{
|
||||
|
@ -2284,7 +2284,7 @@ void send_experience(TMOB *p,int dostal)
|
|||
player_check_death(postavy+select_player,0);
|
||||
}
|
||||
}
|
||||
if (dostal>0) postavy[select_player].exp+=(long)((float)p->experience*(float)dostal/p->vlastnosti[VLS_MAXHIT]);
|
||||
if (dostal>0) postavy[select_player].exp+=(int32_t)((float)p->experience*(float)dostal/p->vlastnosti[VLS_MAXHIT]);
|
||||
check_player_new_level(&postavy[select_player]);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
|
||||
|
||||
///store to temp storage
|
||||
void temp_storage_store(const char *name, const void *data, long size);
|
||||
void temp_storage_store(const char *name, const void *data, int32_t size);
|
||||
///find in temp storage - returns -1 = not found, otherwise size of data
|
||||
long temp_storage_find(const char *name);
|
||||
int32_t temp_storage_find(const char *name);
|
||||
///retrieve from temp storage (returns same as find)
|
||||
long temp_storage_retrieve(const char *name, void *data, long size);
|
||||
int32_t temp_storage_retrieve(const char *name, void *data, int32_t size);
|
||||
|
||||
void temp_storage_list(void (*callback)(const char *, void *), void *context);
|
||||
|
||||
|
@ -19,8 +19,8 @@ TMPFILE_WR *temp_storage_create(const char *name);
|
|||
TMPFILE_WR *temp_storage_append(const char *name);
|
||||
void temp_storage_close_rd(TMPFILE_RD *f);
|
||||
void temp_storage_close_wr(TMPFILE_WR *f);
|
||||
void temp_storage_write(const void *data, unsigned long size, TMPFILE_WR *f);
|
||||
unsigned long temp_storage_read(void *data, unsigned long size, TMPFILE_RD *f);
|
||||
void temp_storage_write(const void *data, uint32_t size, TMPFILE_WR *f);
|
||||
uint32_t temp_storage_read(void *data, uint32_t size, TMPFILE_RD *f);
|
||||
void temp_storage_skip(TMPFILE_RD *f, int bytes);
|
||||
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
#include <mem.h>
|
||||
#include <conio.h>
|
||||
#include <bios.h>
|
||||
#define EVENT_MSG long
|
||||
#define EVENT_MSG int32_t
|
||||
#include "globals.h"
|
||||
#include <memman.c>
|
||||
#include <strlite.c>
|
||||
|
@ -15,7 +15,7 @@ TSTR_LIST skini;
|
|||
#define PLAYERS 3
|
||||
|
||||
void *datablast;
|
||||
long datablastsize;
|
||||
int32_t datablastsize;
|
||||
char *lasterror=NULL;
|
||||
char relarr[6];
|
||||
char szBuff[65536];
|
||||
|
@ -42,8 +42,8 @@ typedef struct s_save
|
|||
char stereing;
|
||||
char swapchans;
|
||||
char out_filter;
|
||||
long glob_flags;
|
||||
long game_time;
|
||||
int32_t glob_flags;
|
||||
int32_t game_time;
|
||||
char runes[5];
|
||||
char level_name[12];
|
||||
short picks; //pocet_sebranych predmetu v mysi
|
||||
|
@ -72,7 +72,7 @@ typedef struct _tkzlall
|
|||
{
|
||||
TKOUZLO kouzlo;
|
||||
short vlstab[24];
|
||||
long flagmap;
|
||||
int32_t flagmap;
|
||||
}TKZLALL;
|
||||
|
||||
THUMAN postavy[6],postavy2[6];
|
||||
|
@ -115,9 +115,9 @@ word keyconv(word key)
|
|||
|
||||
#define ZAKLAD_CRC 0xC005
|
||||
|
||||
static word vypocet_crc(char *data,long delka)
|
||||
static word vypocet_crc(char *data,int32_t delka)
|
||||
{
|
||||
unsigned long l=0;
|
||||
uint32_t l=0;
|
||||
do
|
||||
{
|
||||
l=(l<<8)|(delka>0?*data++:0);delka--;
|
||||
|
@ -171,10 +171,10 @@ void *loadmem(void *to,void *from,int size)
|
|||
return (void *)((char *)from+size);
|
||||
}
|
||||
|
||||
long load_section(FILE *f,void **section, int *sct_type,long *sect_size)
|
||||
int32_t load_section(FILE *f,void **section, int *sct_type,int32_t *sect_size)
|
||||
//
|
||||
{
|
||||
long s;
|
||||
int32_t s;
|
||||
char c[20];
|
||||
|
||||
*section=NULL;
|
||||
|
@ -189,11 +189,11 @@ long load_section(FILE *f,void **section, int *sct_type,long *sect_size)
|
|||
}
|
||||
|
||||
|
||||
static void load_specific_file(char *slotname,char *filename,void **out,long *size)
|
||||
static void load_specific_file(char *slotname,char *filename,void **out,int32_t *size)
|
||||
{
|
||||
FILE *slot;
|
||||
char *c,*d;
|
||||
long siz;
|
||||
int32_t siz;
|
||||
char fname[12];
|
||||
char succes=0;
|
||||
|
||||
|
@ -490,7 +490,7 @@ int tracemap(char *name)
|
|||
FILE *f;
|
||||
void *section;
|
||||
int type;
|
||||
long size,s;
|
||||
int32_t size,s;
|
||||
|
||||
f=fopen(name,"rb");
|
||||
if (f==NULL) return -1;
|
||||
|
|
|
@ -424,7 +424,7 @@ void wizard_kbd(EVENT_MSG *msg,void **usr)
|
|||
usr;
|
||||
if (msg->msg==E_KEYBOARD)
|
||||
{
|
||||
c=(*(int *)msg->data)>>8;
|
||||
int c=va_arg(msg->data,int)>>8;
|
||||
msg->msg=-1;
|
||||
switch (c)
|
||||
{
|
||||
|
|
|
@ -58,8 +58,8 @@ static void done_bar_draw(int x1,int y1,int x2,int y2,OBJREC *o)
|
|||
|
||||
void done_bar(OBJREC *o) //define(...done_bar,max);
|
||||
{
|
||||
o->runs[0]=done_bar_init;
|
||||
o->runs[1]=done_bar_draw;
|
||||
o->call_init=done_bar_init;
|
||||
o->call_draw=done_bar_draw;
|
||||
o->datasize=4;
|
||||
}
|
||||
|
||||
|
@ -238,8 +238,8 @@ static void view_line_draw(int x1,int y1, int x2, int y2, OBJREC *o)
|
|||
|
||||
void view_line(OBJREC *o)
|
||||
{
|
||||
o->runs[0]=view_line_init;
|
||||
o->runs[1]=view_line_draw;
|
||||
o->call_init=view_line_init;
|
||||
o->call_draw=view_line_draw;
|
||||
}
|
||||
|
||||
|
||||
|
@ -369,8 +369,8 @@ char do_script(int section)
|
|||
{
|
||||
char s[200];
|
||||
|
||||
sprintf(s,"Instal tor nedok z l zpracovat © dek '%s' - P©¡kaz '%s' vr til chybu",command,commands[i]);
|
||||
if (msg_box("Chyba v INF",'\x1',s,"Ignoruj","P©eru¨it",NULL)==2) return 1;
|
||||
sprintf(s,"Instal<EFBFBD>tor nedok<6F>z<EFBFBD>l zpracovat <20><>dek '%s' - P<><50>kaz '%s' vr<76>til chybu",command,commands[i]);
|
||||
if (msg_box("Chyba v INF",'\x1',s,"Ignoruj","P<EFBFBD>eru<EFBFBD>it",NULL)==2) return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -412,7 +412,7 @@ char *get_cdrom()
|
|||
}
|
||||
else
|
||||
{
|
||||
strcpy(s,"<nen¡>");
|
||||
strcpy(s,"<nen<EFBFBD>>");
|
||||
}
|
||||
return s;
|
||||
}
|
||||
|
|
20
libs/CMakeLists.txt
Normal file
20
libs/CMakeLists.txt
Normal file
|
@ -0,0 +1,20 @@
|
|||
SET(files basicobj.c
|
||||
bgraph2.c
|
||||
bgraph2a.c
|
||||
bmouse.c
|
||||
devices.c
|
||||
event.c
|
||||
gui.c
|
||||
inicfg.c
|
||||
memman.c
|
||||
mgifmapmem.c
|
||||
mgifmem.c
|
||||
mgifplaya.c
|
||||
pcx.c
|
||||
strlite.c
|
||||
wav_mem.c
|
||||
strlists.c
|
||||
swaper.c )
|
||||
|
||||
add_library(skeldal_libs ${files})
|
||||
|
331
libs/basicobj.c
331
libs/basicobj.c
|
@ -14,7 +14,7 @@
|
|||
#include "gui.h"
|
||||
#include "basicobj.h"
|
||||
|
||||
#define MEMTEXT "Pamˆt: "
|
||||
#define MEMTEXT "Pam<EFBFBD>t: "
|
||||
|
||||
#define E_STATUS_LINE 60
|
||||
|
||||
|
@ -51,9 +51,9 @@ CTL3D *def_border(int btype,int color)
|
|||
return &ctl;
|
||||
}
|
||||
|
||||
void sample_init(OBJREC *o,char *title)
|
||||
void sample_init(OBJREC *o,va_list params)
|
||||
{
|
||||
title=get_title(title);
|
||||
char *title=va_arg(params, char *);
|
||||
o->userptr=(void *)getmem(strlen(title)+1);
|
||||
strcpy((char *)o->userptr,title);
|
||||
}
|
||||
|
@ -89,17 +89,17 @@ void sample_event(EVENT_MSG *msg,OBJREC *o)
|
|||
|
||||
void sample(OBJREC *o)
|
||||
{
|
||||
o->runs[0]=sample_init;
|
||||
o->runs[1]=sample_draw;
|
||||
o->runs[2]=sample_event;
|
||||
//o->runs[3]=sample_done;
|
||||
o->call_init=sample_init;
|
||||
o->call_draw=sample_draw;
|
||||
o->call_event=sample_event;
|
||||
//o->call_done=sample_done;
|
||||
}
|
||||
|
||||
//------------------------------------------
|
||||
void button_init(OBJREC *o,char *title)
|
||||
void button_init(OBJREC *o,va_list params)
|
||||
{
|
||||
char *v;
|
||||
title=get_title(title);
|
||||
char *title=va_arg(params, char *);
|
||||
o->userptr=(void *)getmem(strlen(title)+1);
|
||||
strcpy((char *)o->userptr,title);
|
||||
v=(char *)o->data;
|
||||
|
@ -176,19 +176,19 @@ void button_event(EVENT_MSG *msg,OBJREC *o)
|
|||
|
||||
void button(OBJREC *o)
|
||||
{
|
||||
o->runs[0]=button_init;
|
||||
o->runs[1]=button_draw;
|
||||
o->runs[2]=button_event;
|
||||
//o->runs[3]=button_done;
|
||||
o->call_init=button_init;
|
||||
o->call_draw=button_draw;
|
||||
o->call_event=button_event;
|
||||
//o->call_done=button_done;
|
||||
o->datasize=1;
|
||||
}
|
||||
|
||||
void button2(OBJREC *o)
|
||||
{
|
||||
o->runs[0]=button_init;
|
||||
o->runs[1]=button_draw2;
|
||||
o->runs[2]=button_event;
|
||||
//o->runs[3]=button_done;
|
||||
o->call_init=button_init;
|
||||
o->call_draw=button_draw2;
|
||||
o->call_event=button_event;
|
||||
//o->call_done=button_done;
|
||||
o->datasize=1;
|
||||
}
|
||||
|
||||
|
@ -242,20 +242,6 @@ void draw_status_line(char *c)
|
|||
|
||||
void *status_mem_info(EVENT_MSG *msg)
|
||||
{
|
||||
char *c;
|
||||
long l;
|
||||
static char memtext[]=MEMTEXT;
|
||||
MEMORYSTATUS mem;
|
||||
|
||||
if (msg->msg==E_INIT) return &status_mem_info;
|
||||
c=(char *)msg->data;
|
||||
strcpy(c,memtext);
|
||||
c+=strlen(memtext);
|
||||
get_mem_info(&mem);
|
||||
l=mem.dwAvailPageFile;
|
||||
sprintf(c,"%d KB ",l/1024);
|
||||
c=strchr(c,'\0');
|
||||
msg->data=(void *)c;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -266,78 +252,72 @@ void *status_idle(EVENT_MSG *msg)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
void status_line(EVENT_MSG *msg,T_EVENT_ROOT **user_data)
|
||||
{
|
||||
T_EVENT_ROOT **p;
|
||||
static char st_line[256],oldline[256]={"\0"};
|
||||
EVENT_MSG tg;
|
||||
static char recurse=1;
|
||||
static int enter_event_msg_to(EVENT_MSG *msg, void *ctx) {
|
||||
T_EVENT_ROOT **p = (T_EVENT_ROOT **)ctx;
|
||||
enter_event(p, msg);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if(msg->msg==E_INIT)
|
||||
if (recurse)
|
||||
{
|
||||
T_EVENT_ROOT *p;
|
||||
recurse=0;
|
||||
send_message(E_ADD,E_IDLE,status_idle);
|
||||
send_message(E_ADD,E_REDRAW,status_idle);
|
||||
p=NULL;
|
||||
*user_data=p;
|
||||
draw_status_line(NULL);
|
||||
recurse=1;
|
||||
return;
|
||||
}
|
||||
else return;
|
||||
shift_msg(msg,tg);
|
||||
if (tg.msg==E_REDRAW)
|
||||
{
|
||||
void status_line(EVENT_MSG *msg, T_EVENT_ROOT **user_data) {
|
||||
T_EVENT_ROOT **p;
|
||||
static char st_line[256], oldline[256] = { "\0" };
|
||||
static char recurse = 1;
|
||||
|
||||
if (msg->msg == E_INIT)
|
||||
if (recurse) {
|
||||
T_EVENT_ROOT *p;
|
||||
recurse = 0;
|
||||
send_message(E_ADD, E_IDLE, status_idle);
|
||||
send_message(E_ADD, E_REDRAW, status_idle);
|
||||
p = NULL;
|
||||
*user_data = p;
|
||||
draw_status_line(NULL);
|
||||
recurse = 1;
|
||||
return;
|
||||
} else
|
||||
return;
|
||||
|
||||
msg->msg = va_arg(msg->data, int);
|
||||
if (msg->msg == E_REDRAW) {
|
||||
draw_status_line(oldline);
|
||||
return;
|
||||
}
|
||||
p = user_data;
|
||||
if (msg->msg == E_IDLE) {
|
||||
char *c = st_line;
|
||||
send_message_to(enter_event_msg_to, p, E_IDLE, &c);
|
||||
if (strcmp(st_line, oldline)) {
|
||||
draw_status_line(st_line);
|
||||
strcpy(oldline, st_line);
|
||||
}
|
||||
p=user_data;
|
||||
if (tg.msg==E_IDLE)
|
||||
{
|
||||
EVENT_MSG msg;
|
||||
|
||||
msg.msg=E_IDLE;
|
||||
msg.data=&st_line;
|
||||
enter_event(p,&msg);
|
||||
if (strcmp(st_line,oldline))
|
||||
{
|
||||
draw_status_line(st_line);
|
||||
strcpy(oldline,st_line);
|
||||
}
|
||||
}
|
||||
else
|
||||
tree_basics(p,&tg);
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
tree_basics(p, msg);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
void *mouse_xy(EVENT_MSG *msg)
|
||||
{
|
||||
char *c;
|
||||
char **c = va_arg(msg->data, char **);
|
||||
|
||||
if (msg->msg==E_INIT) return &mouse_xy;
|
||||
c=(char *)msg->data;
|
||||
sprintf(c," X: %d Y: %d",ms_last_event.x,ms_last_event.y);
|
||||
c=strchr(c,'\0');
|
||||
msg->data=(void *)c;
|
||||
sprintf(*c," X: %d Y: %d",ms_last_event.x,ms_last_event.y);
|
||||
*c=strchr(*c,'\0');
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void *show_time(EVENT_MSG *msg)
|
||||
{
|
||||
char *c;
|
||||
char **c = va_arg(msg->data, char **);
|
||||
time_t t;
|
||||
struct tm cas;
|
||||
|
||||
if (msg->msg==E_INIT) return &show_time;
|
||||
c=(char *)msg->data;
|
||||
t=time(NULL);
|
||||
cas=*localtime(&t);
|
||||
|
||||
sprintf(c,"%02d:%02d:%02d ",cas.tm_hour,cas.tm_min,cas.tm_sec);
|
||||
c=strchr(c,'\0');
|
||||
msg->data=(void *)c;
|
||||
sprintf(*c,"%02d:%02d:%02d ",cas.tm_hour,cas.tm_min,cas.tm_sec);
|
||||
*c=strchr(*c,'\0');
|
||||
return NULL;
|
||||
}
|
||||
//------------------------------------------
|
||||
|
@ -380,8 +360,8 @@ void win_label_move(EVENT_MSG *msg,OBJREC *o)
|
|||
static char run=0;
|
||||
static word xref,yref;
|
||||
static WINDOW w;
|
||||
static moved=0;
|
||||
static drawed=0;
|
||||
static int moved=0;
|
||||
static int drawed=0;
|
||||
|
||||
o;
|
||||
if (msg->msg==E_INIT) return;
|
||||
|
@ -454,10 +434,10 @@ return;
|
|||
|
||||
void win_label(OBJREC *o)
|
||||
{
|
||||
o->runs[0]=sample_init;
|
||||
o->runs[1]=win_label_draw;
|
||||
o->runs[2]=win_label_move;
|
||||
//o->runs[3]=button_done;
|
||||
o->call_init=sample_init;
|
||||
o->call_draw=win_label_draw;
|
||||
o->call_event=win_label_move;
|
||||
//o->call_done=button_done;
|
||||
o->datasize=0;
|
||||
}
|
||||
|
||||
|
@ -524,50 +504,53 @@ void check_box_event(EVENT_MSG *msg,OBJREC *o)
|
|||
|
||||
void check_box(OBJREC *o)
|
||||
{
|
||||
o->runs[0]=sample_init;
|
||||
o->runs[1]=check_box_draw;
|
||||
o->runs[2]=check_box_event;
|
||||
o->call_init=sample_init;
|
||||
o->call_draw=check_box_draw;
|
||||
o->call_event=check_box_event;
|
||||
o->datasize=4;
|
||||
}
|
||||
|
||||
//------------------------------------------
|
||||
void radio_butts_init(OBJREC *o,long *params)
|
||||
void radio_butts_init(OBJREC *o,va_list params)
|
||||
{
|
||||
char *c,*z;
|
||||
long cnt=0,*q,*d;
|
||||
int32_t cnt=0,*q;
|
||||
int i;
|
||||
va_list d;
|
||||
|
||||
d=params;
|
||||
for (i=0;i<*params;i++)
|
||||
va_copy(d, params);
|
||||
int rcount = va_arg(d, int);
|
||||
for (i=0;i<rcount;i++)
|
||||
{
|
||||
d+=1;
|
||||
c=get_title(d);
|
||||
c=va_arg(d, char *);
|
||||
cnt+=strlen(c);cnt++;
|
||||
}
|
||||
q=(long *)getmem(cnt+8);
|
||||
va_end(d);
|
||||
q=(int32_t *)getmem(cnt+8);
|
||||
o->userptr=(void *)q;
|
||||
*q++=1;*q++=*params;
|
||||
d=params;
|
||||
z=(char *)q;
|
||||
for (i=0;i<*params;i++)
|
||||
*q++=1;*q++=rcount;
|
||||
va_copy(d, params);
|
||||
va_arg(d, int);
|
||||
for (i=0;i<rcount;i++)
|
||||
{
|
||||
d+=1;
|
||||
c=get_title(d);
|
||||
c=va_arg(d, char *);
|
||||
strcpy(z,c);
|
||||
z=strchr(z,'\0');z++;
|
||||
}
|
||||
va_end(d);
|
||||
}
|
||||
|
||||
|
||||
void radio_butts_draw(int x1,int y1,int x2,int y2,OBJREC *o)
|
||||
{
|
||||
int step,size,sizpul,i,cr;
|
||||
long *params;
|
||||
int32_t *params;
|
||||
char *texts;
|
||||
CTL3D ctl;
|
||||
|
||||
cr=curcolor;
|
||||
highlight(&ctl,curcolor);
|
||||
params=(long *)o->userptr;
|
||||
params=(int32_t *)o->userptr;
|
||||
if (*params) bar(x1,y1,x2,y2);
|
||||
step=(y2-y1)/(*(params+1));
|
||||
size=(step*9)/10;
|
||||
|
@ -583,7 +566,7 @@ void radio_butts_draw(int x1,int y1,int x2,int y2,OBJREC *o)
|
|||
curcolor=ctl.light;
|
||||
line(x1+sizpul+1,y1,x1+size,y1+sizpul);
|
||||
line(x1+size,y1+sizpul,x1+sizpul+1,y1+size-1);
|
||||
if (*(long *)o->data==i) curcolor=0;else curcolor=cr;
|
||||
if (*(int32_t *)o->data==i) curcolor=0;else curcolor=cr;
|
||||
for (j=0;j<3;j++)
|
||||
{
|
||||
hor_line(x1+sizpul-j,y1+sizpul-2+j,x1+sizpul+j);
|
||||
|
@ -609,12 +592,12 @@ void radio_butts_event(EVENT_MSG *msg,OBJREC *o)
|
|||
ms=get_mouse(msg);
|
||||
if (ms->event_type & 0x02)
|
||||
{
|
||||
sel=(ms->y-o->locy)/(o->ys/(*((long *)o->userptr+1)));
|
||||
if (sel>=*((long *)o->userptr+1)) sel=*((long *)o->userptr+1)-1;
|
||||
*(long *)o->data=sel;
|
||||
*(long *)o->userptr=0;
|
||||
sel=(ms->y-o->locy)/(o->ys/(*((int32_t *)o->userptr+1)));
|
||||
if (sel>=*((int32_t *)o->userptr+1)) sel=*((int32_t *)o->userptr+1)-1;
|
||||
*(int32_t *)o->data=sel;
|
||||
*(int32_t *)o->userptr=0;
|
||||
redraw_object(o);
|
||||
*(long *)o->userptr=1;
|
||||
*(int32_t *)o->userptr=1;
|
||||
set_change();
|
||||
}
|
||||
}
|
||||
|
@ -624,9 +607,9 @@ void radio_butts_event(EVENT_MSG *msg,OBJREC *o)
|
|||
|
||||
void radio_butts(OBJREC *o)
|
||||
{
|
||||
o->runs[0]=radio_butts_init;
|
||||
o->runs[1]=radio_butts_draw;
|
||||
o->runs[2]=radio_butts_event;;
|
||||
o->call_init=radio_butts_init;
|
||||
o->call_draw=radio_butts_draw;
|
||||
o->call_event=radio_butts_event;;
|
||||
o->datasize=4;
|
||||
}
|
||||
|
||||
|
@ -670,21 +653,32 @@ void toggle_button_event(EVENT_MSG *msg,OBJREC *o)
|
|||
|
||||
void toggle_button(OBJREC *o)
|
||||
{
|
||||
o->runs[0]=button_init;
|
||||
o->runs[1]=button_draw;
|
||||
o->runs[2]=toggle_button_event;
|
||||
o->call_init=button_init;
|
||||
o->call_draw=button_draw;
|
||||
o->call_event=toggle_button_event;
|
||||
o->datasize=1;
|
||||
}
|
||||
|
||||
//------------------------------------------
|
||||
|
||||
void input_line_init(OBJREC *o,int *len)
|
||||
typedef struct input_line_state_st {
|
||||
int len;
|
||||
int start;
|
||||
int minimum;
|
||||
int maximum;
|
||||
char *format;
|
||||
} input_line_state;
|
||||
|
||||
void input_line_init(OBJREC *o,va_list len)
|
||||
{
|
||||
o->datasize=(*len)+1;
|
||||
o->userptr=malloc(20);
|
||||
memset(o->userptr,0,20);
|
||||
memcpy(o->userptr,len,4);
|
||||
memcpy((int *)o->userptr+2,len+1,12);
|
||||
input_line_state *st = malloc(sizeof(input_line_state));
|
||||
st->len = va_arg(len, int);;
|
||||
st->start = 0;
|
||||
st->minimum = va_arg(len, int);
|
||||
st->maximum = va_arg(len, int);
|
||||
st->format = va_arg(len, char * );
|
||||
o->datasize=st->len;
|
||||
o->userptr = st;
|
||||
}
|
||||
|
||||
void input_line_draw(int x1,int y1, int x2, int y2, OBJREC *o)
|
||||
|
@ -700,7 +694,8 @@ void input_line_draw(int x1,int y1, int x2, int y2, OBJREC *o)
|
|||
c=(char *)o->data;
|
||||
if (!*c) return;
|
||||
len=strlen(c);
|
||||
shift=*((int *)o->userptr+1);
|
||||
input_line_state *st = o->userptr;
|
||||
shift=st->start;
|
||||
if (shift>=len) shift=0;
|
||||
c+=shift;
|
||||
d[0]=*c++;x=x1+text_width(d);
|
||||
|
@ -714,14 +709,14 @@ void input_line_draw(int x1,int y1, int x2, int y2, OBJREC *o)
|
|||
|
||||
void input_line_event(EVENT_MSG *msg,OBJREC *o)
|
||||
{
|
||||
static cursor=0;
|
||||
static int cursor=0;
|
||||
int *len,*start,slen;
|
||||
char *c;
|
||||
static char *save;
|
||||
static char clear_kontext;
|
||||
|
||||
len=(int *)o->userptr;
|
||||
start=len+1;
|
||||
input_line_state *st = o->userptr;
|
||||
start=&st->start;
|
||||
c=(char *)o->data;
|
||||
slen=strlen(c);
|
||||
switch (msg->msg)
|
||||
|
@ -771,12 +766,14 @@ void input_line_event(EVENT_MSG *msg,OBJREC *o)
|
|||
break;
|
||||
case E_KEYBOARD:
|
||||
{
|
||||
char key;
|
||||
|
||||
int code = va_arg(msg->data, int);
|
||||
char key;
|
||||
|
||||
cancel_event();
|
||||
key=(*(int *)msg->data) & 0xff;
|
||||
key= code & 0xff;
|
||||
if (!key)
|
||||
switch (*(int *)msg->data >> 8)
|
||||
switch (code >> 8)
|
||||
{
|
||||
case 'M':if (cursor<slen) cursor++;break;
|
||||
case 'K':if (cursor>0) cursor--;break;
|
||||
|
@ -813,28 +810,31 @@ void input_line_event(EVENT_MSG *msg,OBJREC *o)
|
|||
}
|
||||
|
||||
|
||||
|
||||
void input_line_done(OBJREC *o) {
|
||||
free(o->userptr);
|
||||
}
|
||||
|
||||
|
||||
void input_line(OBJREC *o)
|
||||
{
|
||||
o->runs[0]=input_line_init;
|
||||
o->runs[1]=input_line_draw;
|
||||
o->runs[2]=input_line_event;
|
||||
o->call_init=input_line_init;
|
||||
o->call_draw=input_line_draw;
|
||||
o->call_event=input_line_event;
|
||||
o->call_done = input_line_done;
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------------------
|
||||
void label(OBJREC *o)
|
||||
{
|
||||
o->runs[0]=sample_init;
|
||||
o->runs[1]=sample_draw;
|
||||
o->call_init=sample_init;
|
||||
o->call_draw=sample_draw;
|
||||
}
|
||||
|
||||
void mid_label(OBJREC *o)
|
||||
{
|
||||
o->runs[0]=sample_init;
|
||||
o->runs[1]=mid_label_draw;
|
||||
o->call_init=sample_init;
|
||||
o->call_draw=mid_label_draw;
|
||||
}
|
||||
//-------------------------------------------------------------
|
||||
|
||||
|
@ -845,16 +845,16 @@ typedef struct scr_button
|
|||
char *title;
|
||||
}SCR_BUTTON;
|
||||
|
||||
void scroll_button_init(OBJREC *o,int *param)
|
||||
void scroll_button_init(OBJREC *o,va_list param)
|
||||
{ // int step, int maxvalue,char *title
|
||||
char *v;
|
||||
SCR_BUTTON *p;
|
||||
|
||||
o->userptr=getmem(sizeof(SCR_BUTTON));
|
||||
p=(SCR_BUTTON *)o->userptr;
|
||||
p->step=*param++;
|
||||
p->maxvalue=*param++;
|
||||
p->title=(char *)*param++;
|
||||
p->step=va_arg(param, int);
|
||||
p->maxvalue=va_arg(param, int);
|
||||
p->title=va_arg(param, char *);
|
||||
v=(char *)o->data;
|
||||
*v=0;
|
||||
}
|
||||
|
@ -912,9 +912,9 @@ void scroll_button_event(EVENT_MSG *msg,OBJREC *o)
|
|||
|
||||
void scroll_button(OBJREC *o)
|
||||
{
|
||||
o->runs[0]=scroll_button_init;
|
||||
o->runs[1]=scroll_button_draw;
|
||||
o->runs[2]=scroll_button_event;
|
||||
o->call_init=scroll_button_init;
|
||||
o->call_draw=scroll_button_draw;
|
||||
o->call_event=scroll_button_event;
|
||||
o->datasize=1;
|
||||
}
|
||||
|
||||
|
@ -930,16 +930,16 @@ typedef struct scr_bar
|
|||
int stepsize;
|
||||
}SCR_BAR;
|
||||
|
||||
void scroll_bar_init(OBJREC *o,int *param)
|
||||
void scroll_bar_init(OBJREC *o,va_list param)
|
||||
{
|
||||
SCR_BAR *p;
|
||||
|
||||
o->userptr=getmem(sizeof(SCR_BAR));
|
||||
p=(SCR_BAR *)o->userptr;
|
||||
p->minvalue=*param++;
|
||||
p->maxvalue=*param++;
|
||||
p->parview=*param++;
|
||||
p->bgcolor=*param++;
|
||||
p->minvalue=va_arg(param, int);
|
||||
p->maxvalue=va_arg(param, int);
|
||||
p->parview=va_arg(param, int);
|
||||
p->bgcolor=va_arg(param, int);
|
||||
p->barsize=10;
|
||||
p->stepsize=10;
|
||||
}
|
||||
|
@ -1010,9 +1010,8 @@ void scroll_bar_v_event(EVENT_MSG *msg,OBJREC *o)
|
|||
break;
|
||||
case E_CONTROL:
|
||||
{
|
||||
int *q;
|
||||
int *q = va_arg(msg->data, int *);
|
||||
|
||||
q=msg->data;
|
||||
p->minvalue=*q++;
|
||||
p->maxvalue=*q++;
|
||||
p->parview=*q++;
|
||||
|
@ -1024,9 +1023,9 @@ void scroll_bar_v_event(EVENT_MSG *msg,OBJREC *o)
|
|||
|
||||
void scroll_bar_v(OBJREC *o)
|
||||
{
|
||||
o->runs[0]=scroll_bar_init;
|
||||
o->runs[1]=scroll_bar_v_draw;
|
||||
o->runs[2]=scroll_bar_v_event;
|
||||
o->call_init=scroll_bar_init;
|
||||
o->call_draw=scroll_bar_v_draw;
|
||||
o->call_event=scroll_bar_v_event;
|
||||
o->datasize=4;
|
||||
}
|
||||
|
||||
|
@ -1053,7 +1052,7 @@ void scroll_support()
|
|||
set_value(0,id,&x);
|
||||
r=o_aktual;
|
||||
o_aktual=o;
|
||||
o->events[3]();
|
||||
o->on_change();
|
||||
o_aktual=r;
|
||||
}
|
||||
//-------------------------------------------------------------
|
||||
|
@ -1130,9 +1129,9 @@ void scroll_bar_h_event(EVENT_MSG *msg,OBJREC *o)
|
|||
|
||||
void scroll_bar_h(OBJREC *o)
|
||||
{
|
||||
o->runs[0]=scroll_bar_init;
|
||||
o->runs[1]=scroll_bar_h_draw;
|
||||
o->runs[2]=scroll_bar_h_event;
|
||||
o->call_init=scroll_bar_init;
|
||||
o->call_draw=scroll_bar_h_draw;
|
||||
o->call_event=scroll_bar_h_event;
|
||||
o->datasize=4;
|
||||
|
||||
}
|
||||
|
@ -1214,7 +1213,7 @@ int msg_box(char *title, char icone, char *text, ... )
|
|||
sz=(winx/(temp2+1))>>1;
|
||||
if (sz<text_width(*c)) sz=text_width(*c);
|
||||
define((i),i*winx/(temp2+1)-(sz>>1),10,sz+5,20,3,button,*c);
|
||||
property(ctl,NULL,flat_color(0),RGB555(24,24,24));on_change(terminate);
|
||||
property(ctl,NULL,flat_color(0),RGB555(24,24,24));on_control_change(terminate_gui);
|
||||
c++;
|
||||
}
|
||||
set_window_modal();
|
||||
|
@ -1254,8 +1253,8 @@ void resizer_event(EVENT_MSG *msg,OBJREC *o)
|
|||
static char run=0;
|
||||
static word xref,yref;
|
||||
static WINDOW w;
|
||||
static moved=0;
|
||||
static drawed=0;
|
||||
static int moved=0;
|
||||
static int drawed=0;
|
||||
|
||||
o;
|
||||
if (msg->msg==E_INIT) return;
|
||||
|
@ -1326,7 +1325,7 @@ if (msg->msg!=E_TIMER) msg->msg=-1;
|
|||
|
||||
void resizer(OBJREC *o)
|
||||
{
|
||||
//o->runs[0]=resizer_init;
|
||||
o->runs[1]=resizer_draw;
|
||||
o->runs[2]=resizer_event;
|
||||
//o->call_init=resizer_init;
|
||||
o->call_draw=resizer_draw;
|
||||
o->call_event=resizer_event;
|
||||
}
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
#define MEMTEXT "Pamˆt: "
|
||||
|
||||
#define E_STATUS_LINE 60
|
||||
|
||||
|
|
|
@ -17,12 +17,12 @@ byte fontdsize=0;
|
|||
byte *palmem,*xlatmem;
|
||||
void (*showview)(word,word,word,word);
|
||||
char line480=0;
|
||||
long screen_buffer_size=512000;
|
||||
int32_t screen_buffer_size=512000;
|
||||
|
||||
void *mscursor,*mssavebuffer=NULL;
|
||||
integer mscuroldx=0,mscuroldy=0;
|
||||
integer msshowx=0,msshowy=0;
|
||||
long pictlen; // Tato promenna je pouze pouzita v BGRAPH1.ASM
|
||||
int32_t pictlen; // Tato promenna je pouze pouzita v BGRAPH1.ASM
|
||||
|
||||
void line32(word x1,word y1, word x2, word y2)
|
||||
{
|
||||
|
@ -68,7 +68,7 @@ int initmode32()
|
|||
if (!(data.modeattr & MA_SUPP)) return -1;
|
||||
if (!(data.modeattr & MA_LINEARFBUF)) return -2;
|
||||
setvesamode(0x411e-line480*0xe,-1);
|
||||
lbuffer=(word *)physicalalloc((long)data.linearbuffer,screen_buffer_size);
|
||||
lbuffer=(word *)physicalalloc((int32_t)data.linearbuffer,screen_buffer_size);
|
||||
screen=lbuffer;
|
||||
linelen=640*2;
|
||||
showview=showview32;
|
||||
|
@ -83,7 +83,7 @@ int initmode256(void *paletefile)
|
|||
if (!(data.modeattr & MA_SUPP)) return -1;
|
||||
if (!(data.modeattr & MA_LINEARFBUF)) return -2;
|
||||
setvesamode(0x4100+line480,-1);
|
||||
lbuffer=(word *)physicalalloc((long)data.linearbuffer,screen_buffer_size>>1);
|
||||
lbuffer=(word *)physicalalloc((int32_t)data.linearbuffer,screen_buffer_size>>1);
|
||||
screen=lbuffer;
|
||||
linelen=640*2;
|
||||
palmem=(char *)paletefile;
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
#define point point32
|
||||
|
||||
word *GetScreenAdr();
|
||||
long GetScreenSizeBytes();
|
||||
int32_t GetScreenSizeBytes();
|
||||
word *GetBuffer2nd();
|
||||
void RedirectScreen(word *newaddr);
|
||||
void RestoreScreen();
|
||||
|
@ -14,15 +14,15 @@ void RedirectScreenBufferSecond();
|
|||
|
||||
|
||||
extern word curcolor,charcolors[7];
|
||||
extern long scr_linelen;
|
||||
extern long scr_linelen2;
|
||||
extern long dx_linelen;
|
||||
extern int32_t scr_linelen;
|
||||
extern int32_t scr_linelen2;
|
||||
extern int32_t dx_linelen;
|
||||
extern word *curfont,*writepos,writeposx;
|
||||
extern byte fontdsize;
|
||||
extern byte *palmem,*xlatmem;
|
||||
extern void (*showview)(word,word,word,word);
|
||||
extern char line480;
|
||||
extern long screen_buffer_size;
|
||||
extern int32_t screen_buffer_size;
|
||||
extern char banking;
|
||||
extern char __skip_change_line_test;
|
||||
extern char no_restore_mode;
|
||||
|
|
|
@ -8,21 +8,20 @@
|
|||
#include <stdlib.h>
|
||||
#include <malloc.h>
|
||||
//#include <graph.h>
|
||||
#include <conio.h>
|
||||
#include "bgraph.h"
|
||||
#include "memman.h"
|
||||
|
||||
word *screen;
|
||||
word curcolor,charcolors[7] = {0x0000,RGB555(0,31,0),RGB555(0,28,0),RGB555(0,24,0),RGB555(0,20,0),0x0000,0x0000};
|
||||
long scr_linelen;
|
||||
long scr_linelen2;
|
||||
long dx_linelen;
|
||||
int32_t scr_linelen;
|
||||
int32_t scr_linelen2;
|
||||
int32_t dx_linelen;
|
||||
word *curfont,*writepos,writeposx;
|
||||
byte fontdsize=0;
|
||||
byte *palmem=NULL,*xlatmem=NULL;
|
||||
void (*showview)(word,word,word,word);
|
||||
char line480=0;
|
||||
long screen_buffer_size=0;
|
||||
int32_t screen_buffer_size=0;
|
||||
char banking=0;
|
||||
char screenstate=0;
|
||||
char __skip_change_line_test=0;
|
||||
|
@ -32,7 +31,7 @@ void *mscursor,*mssavebuffer=NULL;
|
|||
integer mscuroldx=0,mscuroldy=0;
|
||||
integer mscuroldxs=1,mscuroldys=1;
|
||||
char write_window=0;
|
||||
long pictlen; // Tato promenna je pouze pouzita v BGRAPH1.ASM
|
||||
int32_t pictlen; // Tato promenna je pouze pouzita v BGRAPH1.ASM
|
||||
|
||||
void text_mode();
|
||||
|
||||
|
@ -104,7 +103,7 @@ void write_vesa_info(int mode)
|
|||
getmodeinfo(&vesadata,mode);
|
||||
if (vesadata[0].modeattr & MA_SUPP)
|
||||
{
|
||||
if (vesadata[0].modeattr & MA_LINEARFBUF) sprintf(c,"%8Xh",(long)vesadata[0].linearbuffer); else strcpy(c,"None");
|
||||
if (vesadata[0].modeattr & MA_LINEARFBUF) sprintf(c,"%8Xh",(int32_t)vesadata[0].linearbuffer); else strcpy(c,"None");
|
||||
printf("Mode: %04X \n"
|
||||
"WinA %02X\n"
|
||||
"WinB %02X\n"
|
||||
|
@ -271,7 +270,7 @@ word *mapvesaadr1(word *a)
|
|||
{
|
||||
word bank;
|
||||
|
||||
bank=(long)a>>16;
|
||||
bank=(int32_t)a>>16;
|
||||
if (bank!=lastbank)
|
||||
{
|
||||
lastbank=bank;
|
||||
|
@ -284,7 +283,7 @@ word *mapvesaadr1(word *a)
|
|||
int386 (0x10,®s,®s); // window A
|
||||
}
|
||||
}
|
||||
return (word *)(((long)a & 0xffff)+0xa0000);
|
||||
return (word *)(((int32_t)a & 0xffff)+0xa0000);
|
||||
}
|
||||
|
||||
void switchvesabank(word bank)
|
||||
|
@ -318,7 +317,7 @@ int initmode256(void *paletefile)
|
|||
if (!(data.modeattr & MA_LINEARFBUF)) return initmode256b(paletefile);
|
||||
//write_vesa_info(0x101);
|
||||
setvesamode(0x4101,-1);
|
||||
if (lbuffer==NULL)lbuffer=(word *)physicalalloc((long)data.linearbuffer,screen_buffer_size>>1);
|
||||
if (lbuffer==NULL)lbuffer=(word *)physicalalloc((int32_t)data.linearbuffer,screen_buffer_size>>1);
|
||||
screen=lbuffer;
|
||||
linelen=640*2;
|
||||
palmem=(char *)paletefile;
|
||||
|
@ -417,7 +416,7 @@ void closemode()
|
|||
|
||||
}
|
||||
|
||||
static void showview_dx(word x,word y,word xs,word ys)
|
||||
void showview_dx(word x,word y,word xs,word ys)
|
||||
{
|
||||
// register longint a;
|
||||
|
||||
|
@ -427,7 +426,7 @@ static void showview_dx(word x,word y,word xs,word ys)
|
|||
xs+=2;ys+=2;
|
||||
if (x+xs>DxGetResX()) xs=DxGetResX()-x;
|
||||
if (y+ys>DxGetResY()) ys=DxGetResY()-y;
|
||||
DXCopyRects64(x,y,xs,ys);
|
||||
DXCopyRects64(x,y,xs,ys);
|
||||
}
|
||||
/*
|
||||
static void showview64b(word x,word y,word xs,word ys)
|
||||
|
@ -595,16 +594,16 @@ void set_aligned_position(int x,int y,char alignx,char aligny,char *text)
|
|||
|
||||
/*void pal_optimize()
|
||||
{
|
||||
long *stattable;
|
||||
int32_t *stattable;
|
||||
word *c;
|
||||
char *d;
|
||||
int i;
|
||||
long maxr,maxg,maxb,max;
|
||||
int32_t maxr,maxg,maxb,max;
|
||||
int j;
|
||||
|
||||
if (palmem==NULL) return;
|
||||
stattable=(long *)getmem(32768*sizeof(long));
|
||||
memset(stattable,0,32768*sizeof(long));
|
||||
stattable=(int32_t *)getmem(32768*sizeof(int32_t));
|
||||
memset(stattable,0,32768*sizeof(int32_t));
|
||||
c=screen;
|
||||
for(i=0;i<screen_buffer_size;i++,c++)
|
||||
stattable[*c & 0x7fff]++;
|
||||
|
@ -797,4 +796,4 @@ int init_empty_mode()
|
|||
screenstate=1;
|
||||
return 0;
|
||||
}
|
||||
*/
|
||||
*/
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
#include <skeldal_win.h>
|
||||
#include "types.h"
|
||||
#include "bgraph.h"
|
||||
#include <debug.h>
|
||||
|
||||
#include <string.h>
|
||||
|
||||
|
||||
void bar32(int x1,int y1, int x2, int y2)
|
||||
|
@ -28,17 +29,17 @@ void hor_line32(int x1,int y1,int x2)
|
|||
{
|
||||
word *begline;
|
||||
int i;
|
||||
unsigned long curcolor2=curcolor | (curcolor<<16);
|
||||
uint32_t curcolor2=curcolor | (curcolor<<16);
|
||||
|
||||
int mx = DxGetResX() - 1;
|
||||
int my = DxGetResY() - 1;
|
||||
|
||||
if (y1<0 || y1>my) return;
|
||||
if (x1>x2) swap_int(x1,x2);
|
||||
if (x1>x2) swap_int(x1,x2);
|
||||
if (x1<0) x1=0;
|
||||
if (x2>mx) x2=mx;
|
||||
begline=GetScreenAdr()+scr_linelen2*y1;
|
||||
for (i=x1;i<x2;i+=2) *(unsigned long *)(begline+i)=curcolor2;
|
||||
for (i=x1;i<x2;i+=2) *(uint32_t *)(begline+i)=curcolor2;
|
||||
if (i==x2) begline[i]=curcolor;
|
||||
}
|
||||
|
||||
|
@ -56,22 +57,22 @@ void ver_line32(int x1,int y1,int y2)
|
|||
begline=GetScreenAdr()+scr_linelen2*y1+x1;
|
||||
for (i=y1;i<=y2;i++,begline+=scr_linelen2) *begline=curcolor;
|
||||
}
|
||||
|
||||
|
||||
void hor_line_xor(int x1,int y1,int x2)
|
||||
{
|
||||
word *begline;
|
||||
int i;
|
||||
unsigned long curcolor2=curcolor | (curcolor<<16);
|
||||
uint32_t curcolor2=curcolor | (curcolor<<16);
|
||||
|
||||
int mx = DxGetResX() - 1;
|
||||
int my = DxGetResY() - 1;
|
||||
|
||||
if (y1<0 || y1>my) return;
|
||||
if (x1>x2) swap_int(x1,x2);
|
||||
if (x1>x2) swap_int(x1,x2);
|
||||
if (x1<0) x1=0;
|
||||
if (x2>mx) x2=mx;
|
||||
begline=GetScreenAdr()+scr_linelen2*y1;
|
||||
for (i=x1;i<x2;i+=2) *(unsigned long *)(begline+i)^=curcolor2;
|
||||
for (i=x1;i<x2;i+=2) *(uint32_t *)(begline+i)^=curcolor2;
|
||||
if (i==x2) begline[i]^=curcolor;
|
||||
}
|
||||
|
||||
|
@ -120,14 +121,14 @@ void char_32(word *posit,word *font,char znak)
|
|||
{
|
||||
|
||||
word *edi = posit;
|
||||
unsigned char *esi = font;
|
||||
unsigned char *esi = (unsigned char *)font;
|
||||
int al = znak;
|
||||
unsigned char dl,cl,ch,dh;
|
||||
word *ebx;
|
||||
|
||||
word ax = esi[al*2]+256*esi[al*2+1];
|
||||
if (ax == 0) goto chrend;
|
||||
esi += ax;
|
||||
esi += ax;
|
||||
dl = 0;
|
||||
cl = *esi++;
|
||||
ch = *esi++;
|
||||
|
@ -155,7 +156,7 @@ chr4: ebx+=scr_linelen2;
|
|||
if (cl!=0) goto chr6;
|
||||
chrend:;
|
||||
|
||||
|
||||
|
||||
/*
|
||||
|
||||
__asm
|
||||
|
@ -218,7 +219,7 @@ void char2_32(word *posit,word *font,char znak)
|
|||
mov edi,posit
|
||||
mov esi,font
|
||||
mov al,znak
|
||||
|
||||
|
||||
;edi - pozice na obrazovce
|
||||
;esi - ukazatel na font
|
||||
;al - znak
|
||||
|
@ -271,13 +272,13 @@ chr2end: ;konec
|
|||
word charsize(word *font,char znak)
|
||||
{
|
||||
|
||||
unsigned char *esi = font;
|
||||
unsigned char *esi = (unsigned char *)font;
|
||||
int al = znak;
|
||||
unsigned char cl,ch;
|
||||
|
||||
word ax = esi[al*2]+256*esi[al*2+1];
|
||||
if (ax == 0) return 0;
|
||||
esi += ax;
|
||||
esi += ax;
|
||||
cl = *esi++;
|
||||
ch = *esi++;
|
||||
ax = (int)cl+256*(int)ch;
|
||||
|
@ -321,9 +322,9 @@ void put_picture(word x,word y,void *p)
|
|||
{
|
||||
int i;
|
||||
int j;
|
||||
|
||||
|
||||
for (i=0;i<yss;i++,adr+=scr_linelen2,data+=(xs-xss))
|
||||
for (j=0;j<xss;j++)
|
||||
for (j=0;j<xss;j++)
|
||||
{
|
||||
adr[j]=((*data & ~0x1f)<<1) | (*data & 0x1f);
|
||||
data++;
|
||||
|
@ -333,9 +334,9 @@ void put_picture(word x,word y,void *p)
|
|||
{
|
||||
int i;
|
||||
int j;
|
||||
|
||||
|
||||
for (i=0;i<yss;i++,adr+=scr_linelen2,data+=(xs-xss))
|
||||
for (j=0;j<xss;j++)
|
||||
for (j=0;j<xss;j++)
|
||||
{
|
||||
adr[j]=*data;
|
||||
data++;
|
||||
|
@ -347,7 +348,7 @@ void put_picture(word x,word y,void *p)
|
|||
char *cdata=(char *)(data+(mode==264?10*256:256));
|
||||
int i;
|
||||
int j;
|
||||
|
||||
|
||||
for (i=0;i<yss;i++,adr+=scr_linelen2,cdata+=(xs-xss))
|
||||
for (j=0;j<xss;j++)
|
||||
{
|
||||
|
@ -362,7 +363,7 @@ void put_picture(word x,word y,void *p)
|
|||
char *cdata=(char *)(data+256);
|
||||
int i;
|
||||
int j;
|
||||
|
||||
|
||||
for (i=0;i<yss;i++,adr+=scr_linelen2,cdata+=(xs-xss))
|
||||
for (j=0;j<xss;j++)
|
||||
{
|
||||
|
@ -381,7 +382,7 @@ void get_picture(word x,word y,word xs,word ys,void *p)
|
|||
|
||||
if (x+xss>=DxGetResX()) xss=DxGetResX()-x;
|
||||
if (y+yss>=DxGetResY()) yss=DxGetResY()-y;
|
||||
|
||||
|
||||
data[0]=xss;
|
||||
data[1]=yss;
|
||||
data[2]=16;
|
||||
|
@ -389,9 +390,9 @@ void get_picture(word x,word y,word xs,word ys,void *p)
|
|||
{
|
||||
int i;
|
||||
int j;
|
||||
|
||||
|
||||
for (i=0;i<yss;i++,adr+=scr_linelen2)
|
||||
for (j=0;j<xss;j++)
|
||||
for (j=0;j<xss;j++)
|
||||
{
|
||||
*data=adr[j];
|
||||
data++;
|
||||
|
@ -408,11 +409,11 @@ void put_image(word *image,word *target,int start_line,int sizex,int sizey)
|
|||
int eax = start_line;
|
||||
int ebx = sizex;
|
||||
int edx = sizey;
|
||||
int ecx = esi[0];
|
||||
int ecx = esi[0];
|
||||
esi = esi + 3 + start_line * ecx;
|
||||
|
||||
while (edx) {
|
||||
memcpy(edi,esi,ecx*2);
|
||||
memcpy(edi,esi,ecx*2);
|
||||
esi += ecx;
|
||||
edi += scr_linelen2;
|
||||
edx--;
|
||||
|
@ -461,7 +462,7 @@ void put_8bit_clipped(void *src,void *trg,int startline,int velx,int vely)
|
|||
word *esi = src;
|
||||
word *edi = trg;
|
||||
word *paleta = esi+3;
|
||||
int cx = esi[0];
|
||||
int cx = esi[0];
|
||||
unsigned char *imgdata = (unsigned char *)(esi + 3 + 256)+ startline * cx;
|
||||
|
||||
while (vely) {
|
||||
|
@ -474,7 +475,7 @@ void put_8bit_clipped(void *src,void *trg,int startline,int velx,int vely)
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*_asm
|
||||
{
|
||||
mov esi,src
|
||||
|
@ -538,7 +539,7 @@ void put_textured_bar_(void *src,void *trg,int xsiz,int ysiz,int xofs,int yofs)
|
|||
int y;
|
||||
|
||||
xofs = xofs % cx;
|
||||
|
||||
|
||||
if (tp != 8) return;
|
||||
|
||||
for (y = 0; y < ysiz; y++) {
|
||||
|
@ -547,7 +548,7 @@ void put_textured_bar_(void *src,void *trg,int xsiz,int ysiz,int xofs,int yofs)
|
|||
int x;
|
||||
for (x = 0; x < xsiz; x++) {
|
||||
unsigned char c = row[(x + xofs) % cx];
|
||||
if (c) target[x] = paleta[c];
|
||||
if (c) target[x] = paleta[c];
|
||||
}
|
||||
target+=scr_linelen2;
|
||||
}
|
||||
|
@ -624,8 +625,8 @@ ptb_skip2:
|
|||
sub edi,edx
|
||||
dec ecx ;odecti 1 od globalniho citace radek
|
||||
jnz ptb_l2 ;konec velke smycky
|
||||
POP EBP
|
||||
}
|
||||
POP EBP
|
||||
}
|
||||
}
|
||||
*/
|
||||
#define MIXTRANSP(a,b) ((((a) & 0xF7DE)+((b) & 0xF7DE))>>1)
|
||||
|
@ -699,7 +700,7 @@ void wait_retrace()
|
|||
void put_picture2picture(word *source,word *target,int xp,int yp)
|
||||
//#pragma aux put_picture2picture parm [ESI][EDI][EAX][EDX] modify [ECX]
|
||||
{
|
||||
|
||||
|
||||
word *srchdr = (word *)source;
|
||||
word *trghdr = (word *)target;
|
||||
word src_cx = srchdr[0];
|
||||
|
@ -707,7 +708,7 @@ void put_picture2picture(word *source,word *target,int xp,int yp)
|
|||
word src_cy = srchdr[1];
|
||||
word trg_cy = trghdr[1];
|
||||
word y;
|
||||
|
||||
|
||||
unsigned char *srcimagedata = (unsigned char *)source+pic_start;
|
||||
unsigned char *trgimagedata = (unsigned char *)target+pic_start;
|
||||
trgimagedata+=trg_cx * yp + xp;
|
||||
|
|
|
@ -25,14 +25,14 @@ void hor_line32(int x1,int y1,int x2)
|
|||
{
|
||||
word *begline;
|
||||
int i;
|
||||
unsigned long curcolor2=curcolor | (curcolor<<16);
|
||||
uint32_t curcolor2=curcolor | (curcolor<<16);
|
||||
|
||||
if (y1<0 || y1>479) return;
|
||||
if (x1>x2) swap_int(x1,x2);
|
||||
if (x1<0) x1=0;
|
||||
if (x2>639) x2=639;
|
||||
begline=screen+scr_linelen2*y1;
|
||||
for (i=x1;i<x2;i+=2) *(unsigned long *)(begline+i)=curcolor2;
|
||||
for (i=x1;i<x2;i+=2) *(uint32_t *)(begline+i)=curcolor2;
|
||||
if (i==x2) begline[i]=curcolor;
|
||||
}
|
||||
|
||||
|
@ -52,14 +52,14 @@ void hor_line_xor(int x1,int y1,int x2)
|
|||
{
|
||||
word *begline;
|
||||
int i;
|
||||
unsigned long curcolor2=curcolor | (curcolor<<16);
|
||||
uint32_t curcolor2=curcolor | (curcolor<<16);
|
||||
|
||||
if (y1<0 || y1>479) return;
|
||||
if (x1>x2) swap_int(x1,x2);
|
||||
if (x1<0) x1=0;
|
||||
if (x2>639) x2=639;
|
||||
begline=screen+scr_linelen2*y1;
|
||||
for (i=x1;i<x2;i+=2) *(unsigned long *)(begline+i)^=curcolor2;
|
||||
for (i=x1;i<x2;i+=2) *(uint32_t *)(begline+i)^=curcolor2;
|
||||
if (i==x2) begline[i]^=curcolor;
|
||||
}
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
#include "devices.h"
|
||||
|
||||
|
||||
#define get_mouse(info) ((MS_EVENT *)(*(long *) info->data))
|
||||
#define get_mouse(info) va_arg(info->data,MS_EVENT *)
|
||||
|
||||
extern MS_EVENT ms_last_event;
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
#include "types.h"
|
||||
|
||||
FILE *bmp;
|
||||
long xsize,ysize,nsize,xcor;
|
||||
int32_t xsize,ysize,nsize,xcor;
|
||||
char bmptype;
|
||||
char *buff,*buff2;
|
||||
char filename[]="sipka.bmp";
|
||||
|
@ -13,7 +13,7 @@ char genshadow=0;
|
|||
|
||||
int load_file(char *filename)
|
||||
{
|
||||
long size;
|
||||
int32_t size;
|
||||
|
||||
bmp=fopen(filename,"rb");
|
||||
if (!bmp) return -1;
|
||||
|
@ -30,11 +30,11 @@ int load_file(char *filename)
|
|||
|
||||
void get_bmp_header()
|
||||
{
|
||||
long *p_long;
|
||||
int32_t *p_long;
|
||||
|
||||
p_long=(long *)(buff+18);
|
||||
p_long=(int32_t *)(buff+18);
|
||||
xsize=*p_long;
|
||||
p_long=(long *)(buff+22);
|
||||
p_long=(int32_t *)(buff+22);
|
||||
ysize=*p_long;
|
||||
bmptype=*(buff+0x1c);
|
||||
if (bmptype==8)
|
||||
|
@ -57,7 +57,7 @@ void conv_hicolor()
|
|||
char r,g,b;
|
||||
short hi;
|
||||
char *s,*s1,*t;
|
||||
long x,y;
|
||||
int32_t x,y;
|
||||
|
||||
s=(buff+0x36+xsize*(ysize-1)*3);
|
||||
t=buff2;
|
||||
|
@ -157,7 +157,7 @@ void palette_shadow(int tr,int tg,int tb)
|
|||
void conv_256color()
|
||||
{
|
||||
char *s,*s1,*t;
|
||||
long x,y;
|
||||
int32_t x,y;
|
||||
|
||||
s=(buff+0x36+1024+xcor*(ysize-1));
|
||||
t=buff2;
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
#include <skeldal_win.h>
|
||||
#include "types.h"
|
||||
#include <stdio.h>
|
||||
#include <dos.h>
|
||||
//#include <i86.h>
|
||||
#include <bios.h>
|
||||
#include "event.h"
|
||||
#include "devices.h"
|
||||
|
@ -19,15 +17,15 @@ TMS_BASIC_INFO ms_basic_info={0};
|
|||
static char ms_keys;
|
||||
|
||||
void get_ms_event(MS_EVENT *event)
|
||||
{
|
||||
{
|
||||
CheckMessageQueue();
|
||||
*event=win_mouseEvent;
|
||||
win_mouseEvent.event=0;
|
||||
}
|
||||
|
||||
char cz_table_1[]=" 1!3457908+,-./‚+ˆ¨‡©‘˜ ¡\"–?=:_2ABCDEFGHIJKLMNOPQRSTUVWXYZ£\\)6=;abcdefghijklmnopqrstuvwxyz/|(; ";
|
||||
char cz_table_2[]=" !\"#$%&'()*+,-./0123456789:;<=>?@<40>BCD<43>FGH‹JKŠMN•PQ«ST—VWX<EFBFBD>Z[\\]^_` bcd‚fgh¡jk<6A>mn¢pqªst£vwx˜z{|}~ ";
|
||||
char cz_table_3[]=" !\"#$%&'()*+,-./0123456789:;<=>?@AB€…‰FGHIJKœM¥§PQž›†¦VWXY’[\\]^_`ab‡ƒˆfghijkŒm¤“pq©¨Ÿ–vwxy‘{|}~ ";
|
||||
char cz_table_1[]=" 1!3457<EFBFBD>908+,-./<2F>+<2B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\"<EFBFBD>?=:_2ABCDEFGHIJKLMNOPQRSTUVWXYZ<59>\\)6=;abcdefghijklmnopqrstuvwxyz/|(; ";
|
||||
char cz_table_2[]=" !\"#$%&'()*+,-./0123456789:;<=>?@<40>BCD<43>FGH<EFBFBD>JK<EFBFBD>MN<EFBFBD>PQ<EFBFBD>ST<EFBFBD>VWX<EFBFBD>Z[\\]^_`<60>bcd<63>fgh<67>jk<6A>mn<6D>pq<70>st<73>vwx<77>z{|}~ ";
|
||||
char cz_table_3[]=" !\"#$%&'()*+,-./0123456789:;<=>?@AB<EFBFBD><EFBFBD><EFBFBD>FGHIJK<EFBFBD>M<EFBFBD><EFBFBD>PQ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>VWXY<EFBFBD>[\\]^_`ab<61><62><EFBFBD>fghijk<6A>m<EFBFBD><6D>pq<70><71><EFBFBD><EFBFBD>vwxy<78>{|}~ ";
|
||||
char *cz_key_tabs[]={cz_table_1,cz_table_2,cz_table_3};
|
||||
|
||||
void keyboard(EVENT_MSG *msg,void *user_data)
|
||||
|
|
|
@ -33,8 +33,8 @@
|
|||
typedef struct zoominfo
|
||||
{
|
||||
void *startptr, *texture;
|
||||
long texture_line,line_len;
|
||||
long *xtable;
|
||||
int32_t texture_line,line_len;
|
||||
int32_t *xtable;
|
||||
short *ytable;
|
||||
word *palette;
|
||||
word ycount;
|
||||
|
@ -44,7 +44,7 @@ typedef struct zoominfo
|
|||
|
||||
typedef struct t_info_y
|
||||
{
|
||||
long drawline; //ukazatel na radku na ktere bude stena zacinat
|
||||
int32_t drawline; //ukazatel na radku na ktere bude stena zacinat
|
||||
word vert_size; //konecna velikost steny, pokud ma pocatecni velikost TXT_SIZE_Y
|
||||
word vert_total; //maximalni velikost textury aby jeste nepresahla obrazovku
|
||||
short zoom_table[TAB_SIZE_Y]; //tabulka pro zoomovaci rutiny
|
||||
|
@ -56,7 +56,7 @@ typedef struct t_info_x_3d
|
|||
word xpos; //bod od leveho okraje
|
||||
word txtoffset; //posunuti x vuci texture
|
||||
word point_total; //rozdil mezi levym prednim a levym zadnim okrajem postranni steny (v adresach)
|
||||
long zoom_table[MIDDLE_X]; //zoomovaci tabulka pro osu x pro postranni steny
|
||||
int32_t zoom_table[MIDDLE_X]; //zoomovaci tabulka pro osu x pro postranni steny
|
||||
}T_INFO_X_3D;
|
||||
|
||||
typedef struct t_info_x
|
||||
|
@ -67,12 +67,12 @@ typedef struct t_info_x
|
|||
word txtoffset; //posunuti x vuci texture
|
||||
word max_x; //pocet viditelnych bodu z textury
|
||||
word point_total; //celkovy pocet adres mezi levym a pravym okrajem
|
||||
long zoom_table[VIEW_SIZE_X]; //zoomovaci tabulka pro osu x pro kolme steny
|
||||
int32_t zoom_table[VIEW_SIZE_X]; //zoomovaci tabulka pro osu x pro kolme steny
|
||||
}T_INFO_X;
|
||||
|
||||
typedef struct t_floor_map
|
||||
{
|
||||
long lineofs,linesize,counter;
|
||||
int32_t lineofs,linesize,counter;
|
||||
}T_FLOOR_MAP;
|
||||
|
||||
typedef struct all_view
|
||||
|
@ -127,11 +127,11 @@ void sikma_zleva(void);
|
|||
#pragma aux sikma_zleva parm modify [EAX EBX ECX EDX ESI EDI]
|
||||
void sikma_zprava(void);
|
||||
#pragma aux sikma_zprava parm modify [EAX EBX ECX EDX ESI EDI]
|
||||
void zooming32(void *source,void *target,void *xlat,long xysize);
|
||||
void zooming32(void *source,void *target,void *xlat,int32_t xysize);
|
||||
#pragma aux zooming32 parm [ESI][EDI][EBX][ECX] modify [EAX EDX]
|
||||
void zooming_lo(void *source,void *target,void *xlat,long xysize);
|
||||
void zooming_lo(void *source,void *target,void *xlat,int32_t xysize);
|
||||
#pragma aux zooming_lo parm [ESI][EDI][EBX][ECX] modify [EAX EDX]
|
||||
void zooming256(void *source,void *target,void *xlat,long xysize);
|
||||
void zooming256(void *source,void *target,void *xlat,int32_t xysize);
|
||||
#pragma aux zooming256 parm [ESI][EDI][EBX][ECX] modify [EAX EDX]
|
||||
void scroll_support_32(void *lbuf,void *src1,void *src2,int size1);
|
||||
#pragma aux scroll_support_32 parm [EDI][ESI][EDX][ECX] modify [EAX]
|
||||
|
@ -143,32 +143,32 @@ void fcdraw(void *source,void *target, void *table);
|
|||
|
||||
|
||||
void *p,*p2,*pozadi,*podlaha,*strop,*sit;int i;
|
||||
void (*zooming)(void *source,long target,void *xlat,long xysize);
|
||||
void (*turn)(long lbuf,void *src1,void *src2,int size1);
|
||||
void (*zooming)(void *source,int32_t target,void *xlat,int32_t xysize);
|
||||
void (*turn)(int32_t lbuf,void *src1,void *src2,int size1);
|
||||
word *buffer_2nd;
|
||||
char debug=0,nosides=0,nofloors=0,drwsit=0;
|
||||
|
||||
void zooming1(void *source,long target,void *xlat,long xysize)
|
||||
void zooming1(void *source,int32_t target,void *xlat,int32_t xysize)
|
||||
{
|
||||
zooming32(source,lbuffer+target,xlat,xysize);
|
||||
}
|
||||
|
||||
void zooming2(void *source,long target,void *xlat,long xysize)
|
||||
void zooming2(void *source,int32_t target,void *xlat,int32_t xysize)
|
||||
{
|
||||
zooming256(source,lbuffer+(target>>1),xlat,xysize);
|
||||
}
|
||||
|
||||
void zooming3(void *source,long target,void *xlat,long xysize)
|
||||
void zooming3(void *source,int32_t target,void *xlat,int32_t xysize)
|
||||
{
|
||||
zooming_lo(source,lbuffer+target,xlat,xysize);
|
||||
}
|
||||
|
||||
void turn1(long lbuf,void *src1,void *src2,int size1)
|
||||
void turn1(int32_t lbuf,void *src1,void *src2,int size1)
|
||||
{
|
||||
scroll_support_32(lbuf+lbuffer,src1,src2,size1);
|
||||
}
|
||||
|
||||
void turn2(long lbuf,void *src1,void *src2,int size1)
|
||||
void turn2(int32_t lbuf,void *src1,void *src2,int size1)
|
||||
{
|
||||
scroll_support_256((lbuf>>1)+lbuffer,src1,src2,size1,xlatmem);
|
||||
}
|
||||
|
@ -202,7 +202,7 @@ void calc_points(void)
|
|||
}
|
||||
}
|
||||
|
||||
void calc_x_buffer(long *ptr,long txt_size_x, long len,long total)
|
||||
void calc_x_buffer(int32_t *ptr,int32_t txt_size_x, int32_t len,int32_t total)
|
||||
{
|
||||
int i,j,old;
|
||||
|
||||
|
@ -215,7 +215,7 @@ void calc_x_buffer(long *ptr,long txt_size_x, long len,long total)
|
|||
}
|
||||
}
|
||||
|
||||
void calc_y_buffer(short *ptr,long txt_size_y, long len,long total)
|
||||
void calc_y_buffer(short *ptr,int32_t txt_size_y, int32_t len,int32_t total)
|
||||
{
|
||||
int i,j,old;
|
||||
|
||||
|
@ -403,7 +403,7 @@ void zooming_forward(void)
|
|||
int i;
|
||||
for (i=0;i<ZOOM_PHASES;i+=zooming_step)
|
||||
{
|
||||
zoom.xtable=(long *)&zooming_xtable[i];
|
||||
zoom.xtable=(int32_t *)&zooming_xtable[i];
|
||||
zoom.ytable=(short *)&zooming_ytable[i];
|
||||
zoom.texture_line=0;
|
||||
zooming(screen+zooming_points[i][2]+zooming_points[i][3]*640+SCREEN_OFFSET,SCREEN_OFFSET,xlatmem,(360<<16)+320);
|
||||
|
@ -414,22 +414,22 @@ void zooming_backward(void)
|
|||
int i;
|
||||
for (i=ZOOM_PHASES-1;i>=0;i-=zooming_step)
|
||||
{
|
||||
zoom.xtable=(long *)&zooming_xtable[i];
|
||||
zoom.xtable=(int32_t *)&zooming_xtable[i];
|
||||
zoom.ytable=(short *)&zooming_ytable[i];
|
||||
zoom.texture_line=0;
|
||||
zooming(screen+zooming_points[i][2]+zooming_points[i][3]*640+SCREEN_OFFSET,SCREEN_OFFSET,xlatmem,(360<<16)+320);
|
||||
}
|
||||
}
|
||||
|
||||
/* zoom.xtable=(long *)&zooming_xtable[0];
|
||||
/* zoom.xtable=(int32_t *)&zooming_xtable[0];
|
||||
zoom.ytable=(short *)&zooming_ytable[0];
|
||||
zoom.texture_line=0;
|
||||
zooming(screen+35+25*640+SCREEN_OFFSET,lbuffer+SCREEN_OFFSET,xlatmem,(360<<16)+320);
|
||||
zoom.xtable=(long *)&zooming_xtable[1];
|
||||
zoom.xtable=(int32_t *)&zooming_xtable[1];
|
||||
zoom.ytable=(short *)&zooming_ytable[1];
|
||||
zoom.texture_line=0;
|
||||
zooming(screen+70+40*640+SCREEN_OFFSET,lbuffer+SCREEN_OFFSET,xlatmem,(360<<16)+320);
|
||||
zoom.xtable=(long *)&zooming_xtable[2];
|
||||
zoom.xtable=(int32_t *)&zooming_xtable[2];
|
||||
zoom.ytable=(short *)&zooming_ytable[2];
|
||||
zoom.texture_line=0;
|
||||
zooming(screen+95+60*640+SCREEN_OFFSET,lbuffer+SCREEN_OFFSET,xlatmem,(360<<16)+320);
|
||||
|
|
162
libs/event.c
162
libs/event.c
|
@ -40,7 +40,7 @@ static jmp_buf jmpenv;
|
|||
char exit_wait=0;
|
||||
T_EVENT_ROOT *ev_tree=NULL;
|
||||
char freeze_on_exit=0;
|
||||
long ev_buff_msg[EVENT_BUFF_SIZE]={0};
|
||||
int32_t ev_buff_msg[EVENT_BUFF_SIZE]={0};
|
||||
void *ev_buff_dta[EVENT_BUFF_SIZE]={NULL};
|
||||
int ev_poz=0;
|
||||
char *otevri_zavoru;
|
||||
|
@ -53,9 +53,9 @@ char *task_info;
|
|||
int taskcount=0;
|
||||
int foretask=0;
|
||||
int nexttask=0;
|
||||
long taskparam;
|
||||
int32_t taskparam;
|
||||
|
||||
long err_last_stack;
|
||||
int32_t err_last_stack;
|
||||
void *err_to_go;
|
||||
|
||||
|
||||
|
@ -226,7 +226,11 @@ void enter_event(T_EVENT_ROOT **tree,EVENT_MSG *msg)
|
|||
p->nezavora=p->nezavirat;
|
||||
otevri_zavoru=&p->nezavora;
|
||||
p->calls++;
|
||||
z->proc(msg,&(z->user_data));
|
||||
EVENT_MSG cpy;
|
||||
cpy.msg = msg->msg;
|
||||
va_copy(cpy.data, msg->data);
|
||||
z->proc(&cpy,&(z->user_data));
|
||||
va_end(cpy.data);
|
||||
p->calls--;
|
||||
p->nezavora=1;
|
||||
if (msg->msg==-2)
|
||||
|
@ -267,25 +271,32 @@ void enter_event(T_EVENT_ROOT **tree,EVENT_MSG *msg)
|
|||
unsuspend_task(msg);
|
||||
}
|
||||
|
||||
T_EVENT_POINT *install_event(T_EVENT_ROOT **tree,long ev_num,EV_PROC proc,void *procdata,char end)
|
||||
typedef struct call_proc_context_t {
|
||||
EV_PROC proc;
|
||||
void **user;
|
||||
}call_proc_context;
|
||||
|
||||
static int call_proc(EVENT_MSG *msg, void *ctx) {
|
||||
call_proc_context *c = ctx;
|
||||
c->proc(msg, c->user);
|
||||
return 0;
|
||||
}
|
||||
|
||||
T_EVENT_POINT *install_event(T_EVENT_ROOT **tree,int32_t ev_num,EV_PROC proc,void *procdata,char end)
|
||||
//instaluje novou udalost;
|
||||
{
|
||||
EVENT_MSG x;
|
||||
void **user=NULL;
|
||||
void *user=NULL;
|
||||
T_EVENT_POINT *p;
|
||||
call_proc_context ctx = {proc, &user};
|
||||
|
||||
x.msg=E_INIT;
|
||||
x.data=procdata;
|
||||
proc(&x,&user);
|
||||
if (x.data!=NULL)
|
||||
{
|
||||
p=add_event(tree,ev_num,proc,end);
|
||||
p->user_data=user;
|
||||
}
|
||||
return p;
|
||||
send_message_to(call_proc,&ctx, E_INIT, procdata);
|
||||
p=add_event(tree,ev_num,proc,end);
|
||||
p->user_data=user;
|
||||
return p;
|
||||
}
|
||||
|
||||
void deinstall_event(T_EVENT_ROOT **tree,long ev_num,EV_PROC proc,void *procdata)
|
||||
void deinstall_event(T_EVENT_ROOT **tree,int32_t ev_num,EV_PROC proc,void *procdata)
|
||||
//deinstaluje udalost;
|
||||
{
|
||||
EVENT_MSG x;
|
||||
|
@ -296,9 +307,8 @@ void deinstall_event(T_EVENT_ROOT **tree,long ev_num,EV_PROC proc,void *procdata
|
|||
if (r==NULL) return;
|
||||
find_event_proc(r->list,proc,p);
|
||||
if (p==NULL) return;
|
||||
x.msg=E_DONE;
|
||||
x.data=procdata;
|
||||
proc(&x,&p->user_data);
|
||||
call_proc_context ctx = {proc, &p->user_data};
|
||||
send_message_to(call_proc, &ctx, E_DONE, procdata);
|
||||
if (p->user_data!=NULL) free(p->user_data);
|
||||
p->proc=NULL;
|
||||
p->user_data=NULL;
|
||||
|
@ -308,46 +318,62 @@ void deinstall_event(T_EVENT_ROOT **tree,long ev_num,EV_PROC proc,void *procdata
|
|||
void tree_basics(T_EVENT_ROOT **ev_tree,EVENT_MSG *msg)
|
||||
{
|
||||
char *p;
|
||||
void *(*q)();
|
||||
void (*q)();
|
||||
EVENT_MSG tg;
|
||||
|
||||
if (msg->msg==E_ADD || msg->msg==E_ADDEND)
|
||||
{
|
||||
T_EVENT_POINT *r;
|
||||
shift_msg(msg,tg);
|
||||
p=(char *)(tg.data);
|
||||
p+=4;
|
||||
find_event_msg_proc(*ev_tree,tg.msg,tg.data,r);
|
||||
shift_message(msg);
|
||||
EV_PROC proc = va_arg(msg->data, EV_PROC);
|
||||
void *procdata = va_arg(msg->data, void *);
|
||||
find_event_msg_proc(*ev_tree,msg->msg,proc,r);
|
||||
assert(r==NULL);
|
||||
if (r==NULL)
|
||||
install_event(ev_tree,tg.msg,*(EV_PROC *)tg.data,p,msg->msg==E_ADDEND);
|
||||
install_event(ev_tree,msg->msg,proc,procdata,msg->msg==E_ADDEND);
|
||||
return;
|
||||
}
|
||||
if (msg->msg==E_INIT)
|
||||
{
|
||||
memcpy(&q,msg->data,4);
|
||||
q();
|
||||
q = va_arg(msg->data, void (*)());
|
||||
q();
|
||||
return;
|
||||
}
|
||||
if (msg->msg==E_DONE)
|
||||
{
|
||||
shift_msg(msg,tg);
|
||||
p=(char *)(tg.data);
|
||||
p+=4;
|
||||
deinstall_event(ev_tree,tg.msg,*(EV_PROC *) tg.data,p);
|
||||
shift_message(msg);
|
||||
EV_PROC proc = va_arg(msg->data, EV_PROC);
|
||||
void *procdata = va_arg(msg->data, void *);
|
||||
deinstall_event(ev_tree,msg->msg,proc,procdata);
|
||||
return;
|
||||
}
|
||||
if (msg->msg==E_GROUP)
|
||||
/* if (msg->msg==E_GROUP)
|
||||
{
|
||||
int pocet,i,addev;
|
||||
T_EVENT_POINT *pp;
|
||||
EVENT_MSG *tgm=&tg;
|
||||
|
||||
long *p;void *proc;
|
||||
shift_msg(msg,tg);addev=tg.msg; if (addev!=E_ADD || addev!=E_ADDEND) return;
|
||||
shift_message(msg);
|
||||
addev = msg->msg;
|
||||
if (addev!=E_ADD || addev!=E_ADDEND) return;
|
||||
shift_message(msg);
|
||||
int pocet = msg->msg;
|
||||
va_list va_procdata;
|
||||
va_copy(tmp, msg->data);
|
||||
for (int i = 0; i < pocet; ++i) va_arg(va_procdata, EV_PROC);
|
||||
for (int i = 0; i < pocet; ++i) {
|
||||
EV_PROC proc = va_arg(msg->data, EV_PROC);
|
||||
void *procdata = va_arg(va_procdata, void *)
|
||||
if (i == 0) {
|
||||
pp=install_event(ev_tree,proc,procdata,((int32_t *)proc+1),addev==E_ADDEND);
|
||||
}
|
||||
}
|
||||
|
||||
int32_t *p;void *proc;
|
||||
shift_msg(msg,tg);addev=tg.msg;
|
||||
shift_msg(tgm,tg);
|
||||
pocet=tg.msg;
|
||||
p=tg.data;proc=p+pocet*sizeof(long);
|
||||
p=tg.data;proc=p+pocet*sizeof(int32_t);
|
||||
for(i=0;i<pocet;i++,p++) if (i!=0)
|
||||
{
|
||||
T_EVENT_POINT *q;
|
||||
|
@ -356,23 +382,36 @@ void tree_basics(T_EVENT_ROOT **ev_tree,EVENT_MSG *msg)
|
|||
q->proc=PROC_GROUP;
|
||||
}
|
||||
else
|
||||
pp=install_event(ev_tree,*p,proc,((long *)proc+1),addev==E_ADDEND);
|
||||
pp=install_event(ev_tree,*p,proc,((int32_t *)proc+1),addev==E_ADDEND);
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
}
|
||||
|
||||
void send_message(long message,...)
|
||||
{
|
||||
long *p;
|
||||
EVENT_MSG x;
|
||||
int send_message_to(int (*cb)(EVENT_MSG *, void *), void *ctx, int message, ...) {
|
||||
EVENT_MSG x;
|
||||
x.msg = message;
|
||||
va_start(x.data, message);
|
||||
int r = cb(&x, ctx);
|
||||
va_end(x.data);
|
||||
}
|
||||
|
||||
p=&message;
|
||||
x.msg=*p++;
|
||||
x.data=(void *)p;
|
||||
if (x.msg==E_ADD || x.msg==E_INIT || x.msg==E_DONE) tree_basics(&ev_tree,&x);
|
||||
else
|
||||
enter_event(&ev_tree,&x);
|
||||
static void send_message_to_tree(EVENT_MSG *x) {
|
||||
if (x->msg==E_ADD || x->msg==E_INIT || x->msg==E_DONE) {
|
||||
tree_basics(&ev_tree,x);
|
||||
}
|
||||
else {
|
||||
enter_event(&ev_tree,x);
|
||||
}
|
||||
}
|
||||
|
||||
void send_message(int message,...)
|
||||
{
|
||||
EVENT_MSG x;
|
||||
x.msg = message;
|
||||
va_start(x.data, message);
|
||||
send_message_to_tree(&x);
|
||||
va_end(x.data);
|
||||
}
|
||||
|
||||
|
||||
|
@ -380,10 +419,10 @@ void send_message(long message,...)
|
|||
|
||||
void timer(EVENT_MSG *msg)
|
||||
{
|
||||
static unsigned long lasttime=0;
|
||||
static uint32_t lasttime=0;
|
||||
if (msg->msg==E_WATCH)
|
||||
{
|
||||
unsigned long tm=GetTickCount()/TIMERSPEED;
|
||||
uint32_t tm=get_game_tick_count()/TIMERSPEED;
|
||||
if (tm==lasttime) return;
|
||||
lasttime=tm;
|
||||
send_message(E_TIMER,tm);
|
||||
|
@ -483,7 +522,7 @@ void error_show(int error_number)
|
|||
|
||||
|
||||
void escape()
|
||||
{
|
||||
{
|
||||
|
||||
exit_wait=0;
|
||||
do
|
||||
|
@ -500,12 +539,11 @@ void escape()
|
|||
T_EVENT_ROOT *gate_basics(EVENT_MSG *msg, void **user_data)
|
||||
{
|
||||
T_EVENT_ROOT *p;
|
||||
EVENT_MSG msg2;
|
||||
|
||||
memcpy(&p,user_data,4);
|
||||
shift_msg(msg,msg2);;
|
||||
if (msg2.msg==E_ADD || msg2.msg==E_INIT || msg2.msg==E_DONE)
|
||||
tree_basics((T_EVENT_ROOT **)user_data,&msg2);
|
||||
shift_message(msg);
|
||||
if (msg->msg==E_ADD || msg->msg==E_INIT || msg->msg==E_DONE)
|
||||
tree_basics((T_EVENT_ROOT **)user_data,msg);
|
||||
return p;
|
||||
}
|
||||
/*
|
||||
|
@ -529,7 +567,7 @@ int create_task()
|
|||
*/
|
||||
void task_terminating();
|
||||
/*
|
||||
long getflags();
|
||||
int32_t getflags();
|
||||
#pragma aux getflags = \
|
||||
"pushfd"\
|
||||
"pop eax"\
|
||||
|
@ -538,7 +576,7 @@ long getflags();
|
|||
int add_task(int stack,void *name,...)
|
||||
{
|
||||
int task,i;
|
||||
long *sp,*spp;
|
||||
int32_t *sp,*spp;
|
||||
|
||||
task=create_task();
|
||||
if (task==-1)
|
||||
|
@ -552,16 +590,16 @@ int add_task(int stack,void *name,...)
|
|||
send_message(E_MEMERROR);
|
||||
return -1;
|
||||
}
|
||||
spp=(long *)((char *)sp+stack-17*4);
|
||||
spp=(int32_t *)((char *)sp+stack-17*4);
|
||||
memset(sp,0,stack);
|
||||
memcpy(spp,&name,17*4);
|
||||
*spp=(long )task_terminating;
|
||||
spp--;*spp=(long)name;
|
||||
*spp=(int32_t )task_terminating;
|
||||
spp--;*spp=(int32_t)name;
|
||||
for(i=0;i<9;i++)
|
||||
{
|
||||
spp--;
|
||||
*spp=0;
|
||||
if (i==5) *spp=(long)((char *)sp+stack);
|
||||
if (i==5) *spp=(int32_t)((char *)sp+stack);
|
||||
}
|
||||
tasklist_low[task]=(void *)sp;
|
||||
tasklist_top[task]=(void *)((char *)sp+stack);
|
||||
|
@ -620,10 +658,10 @@ void shut_down_task(int id_num)
|
|||
}
|
||||
}
|
||||
*/
|
||||
/*void *task_wait_event(long event_number)
|
||||
/*void *task_wait_event(int32_t event_number)
|
||||
{
|
||||
if (!curtask) return NULL;
|
||||
suspend_task(curtask,event_number);
|
||||
return task_sleep(NULL);
|
||||
}
|
||||
*/
|
||||
*/
|
||||
|
|
32
libs/event.h
32
libs/event.h
|
@ -1,3 +1,4 @@
|
|||
#include <stdarg.h>
|
||||
#ifndef __EVENT_H
|
||||
#define __EVENT_H
|
||||
//#define nodebug // 0 znamena ze se nealokuje udalost pro chybu
|
||||
|
@ -11,7 +12,7 @@
|
|||
#define E_ADD 2 //pridani udalosti do stromu
|
||||
#define E_DONE 3 //odebrani udalosti ze stromu
|
||||
#define E_IDLE 4 //udalost volana v dobe necinnosti
|
||||
#define E_GROUP 5 //vytvareni skupin udalosti
|
||||
//#define E_GROUP 5 //vytvareni skupin udalosti
|
||||
#define E_ADDEND 7 //pridani udalosti do stromu na konec.
|
||||
#define E_MEMERROR 8 //udalost je vyvolana pri nedostatku pameti
|
||||
// neni prirazena ZADNA standardni akce!!!
|
||||
|
@ -36,7 +37,8 @@
|
|||
|
||||
#define TASK_EVENT_WAITING 2
|
||||
|
||||
#define shift_msg(msgg,tg) ((tg.msg=*(long *)msgg->data),(tg.data=(void *)((long *)msgg->data+1)))
|
||||
|
||||
//#define shift_msg(msgg,tg) ((tg.msg=*(int32_t *)msgg->data),(tg.data=(void *)((int32_t *)msgg->data+1)))
|
||||
|
||||
#define EVENT_BUFF_SIZE 16
|
||||
|
||||
|
@ -46,12 +48,12 @@ typedef void (*EV_PROC)(void *,void *) ;
|
|||
|
||||
//typedef struct event_list
|
||||
// {
|
||||
// long *table; //tabulka udalosti
|
||||
// int32_t *table; //tabulka udalosti
|
||||
// EV_PROC *procs; //co se ma pri danne udalosti stat
|
||||
// void *(*user_data); //ukazatel na uzivatelska data
|
||||
// char *zavora; //1 znamena ze udalost je povolena
|
||||
// long max_events; // maximalni pocet udalosti, na ktere je system rezervova
|
||||
// long count; //aktualni pocet udalosti
|
||||
// int32_t max_events; // maximalni pocet udalosti, na ktere je system rezervova
|
||||
// int32_t count; //aktualni pocet udalosti
|
||||
// }EVENT_LIST;
|
||||
|
||||
/* event procedura ma dva parametry
|
||||
|
@ -87,8 +89,8 @@ typedef struct t_event_root
|
|||
|
||||
typedef struct event_msg
|
||||
{
|
||||
long msg;
|
||||
void *data;
|
||||
int32_t msg;
|
||||
va_list data;
|
||||
}EVENT_MSG;
|
||||
|
||||
extern char exit_wait; // 1 - opousti aktivni cekaci event;
|
||||
|
@ -99,11 +101,13 @@ extern char *otevri_zavoru;
|
|||
|
||||
void init_events();
|
||||
// inicalizuje zakladni strom udalosto
|
||||
void send_message(long message,...);
|
||||
void send_message(int message,...);
|
||||
|
||||
int send_message_to(int (*cb)(EVENT_MSG *, void *), void *ctx, int message, ...);
|
||||
// posila zpravu do stromu
|
||||
void tree_basics(T_EVENT_ROOT **ev_tree,EVENT_MSG *msg);
|
||||
// pripojuje zakladni funkce brany, jako je instalace listu a jejich deinstalace
|
||||
T_EVENT_ROOT *gate_basics(EVENT_MSG *msg, void *user_data);
|
||||
T_EVENT_ROOT *gate_basics(EVENT_MSG *msg, void **user_data);
|
||||
// implementace brany
|
||||
/* vstupuji informace, jake dostane brana pri zavolani
|
||||
vystupuji informace s jakymi musi vstoupit do stromu.
|
||||
|
@ -113,6 +117,10 @@ T_EVENT_ROOT *gate_basics(EVENT_MSG *msg, void *user_data);
|
|||
void enter_event(T_EVENT_ROOT **tree,EVENT_MSG *msg);
|
||||
//vstupuje do stromu s udalosti (msg)
|
||||
|
||||
static __inline void shift_message(EVENT_MSG *msg) {
|
||||
msg->msg = va_arg(msg->data, int);
|
||||
}
|
||||
|
||||
void do_events();
|
||||
void escape();
|
||||
|
||||
|
@ -129,7 +137,7 @@ void shut_down_task(int id_num);
|
|||
//Nasilne ukonci ulohu
|
||||
void raise_error(int error_number);
|
||||
|
||||
EVENT_MSG *task_wait_event(long event_number);
|
||||
EVENT_MSG *task_wait_event(int32_t event_number);
|
||||
char is_running(int id_num);
|
||||
*/
|
||||
void timer(EVENT_MSG *msg);
|
||||
|
@ -137,8 +145,8 @@ void timer(EVENT_MSG *msg);
|
|||
#define EVENT_PROC(name) void name(EVENT_MSG *msg,void **user_ptr)
|
||||
#define WHEN_MSG(msg_num) if (msg->msg==msg_num)
|
||||
#define UNTIL_MSG(msg_num) if (msg->msg!=msg_num)
|
||||
#define GET_DATA(data_type) (*(data_type *)msg->data)
|
||||
#define GET_DATA_PTR(data_type) ((data_type *)msg->data);
|
||||
#define GET_DATA(data_type) (va_arg(msg->data, data_type))
|
||||
#define GET_DATA_PTR(data_type) (va_arg(msg->data, data_type *))
|
||||
#define GET_USER(data_type) (*(data_type *)user_ptr)
|
||||
#define SAVE_USER_PTR(p) (*user_ptr=p)
|
||||
#define GET_USER_PTR() user_ptr
|
||||
|
|
|
@ -11,7 +11,7 @@ void help()
|
|||
|
||||
main(int argc,char **argv)
|
||||
{
|
||||
void *z;long s;
|
||||
void *z;int32_t s;
|
||||
FILE *f;
|
||||
|
||||
if (argc!=4) help();
|
||||
|
|
|
@ -11,7 +11,7 @@ void help()
|
|||
|
||||
main(int argc,char **argv)
|
||||
{
|
||||
void *z;long s;
|
||||
void *z;int32_t s;
|
||||
FILE *f;
|
||||
|
||||
if (argc==3) help();
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
#define LOAD_BUFFER 4096
|
||||
|
||||
int _fast_load(char *ptr,long size,FILE *f)
|
||||
int _fast_load(char *ptr,int32_t size,FILE *f)
|
||||
{
|
||||
if (size>LOAD_BUFFER) size=4096;
|
||||
return fread(ptr,1,size,f);
|
||||
|
@ -11,7 +11,7 @@ int _fast_load(char *ptr,long size,FILE *f)
|
|||
|
||||
size_t fread(void *ptr,size_t i,size_t j,FILE *f)
|
||||
{
|
||||
long s,z,celk=0;
|
||||
int32_t s,z,celk=0;
|
||||
char *c;
|
||||
|
||||
c=ptr;
|
||||
|
|
144
libs/gui.c
144
libs/gui.c
|
@ -36,6 +36,11 @@ void empty1(OBJREC *o)
|
|||
o;
|
||||
}
|
||||
|
||||
void empty2_p(OBJREC *o, va_list)
|
||||
{
|
||||
o;
|
||||
}
|
||||
|
||||
void empty3(EVENT_MSG *ms,OBJREC *o)
|
||||
{
|
||||
o;ms;
|
||||
|
@ -119,15 +124,15 @@ int send_lost()
|
|||
msg.msg=E_LOST_FOCUS;
|
||||
if (o_aktual!=NULL)
|
||||
{
|
||||
o_aktual->events[2]();
|
||||
o_aktual->on_exit();
|
||||
if (f_cancel_event) return -1;
|
||||
o_aktual->runs[2](&msg,o_aktual);
|
||||
o_aktual->call_event(&msg,o_aktual);
|
||||
o_aktual=NULL;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void select_window(long id)
|
||||
void select_window(int32_t id)
|
||||
{
|
||||
WINDOW *p,*q;
|
||||
|
||||
|
@ -162,9 +167,9 @@ void select_window(long id)
|
|||
|
||||
}
|
||||
|
||||
long desktop_add_window(WINDOW *w)
|
||||
int32_t desktop_add_window(WINDOW *w)
|
||||
{
|
||||
static long id_counter=0;
|
||||
static int32_t id_counter=0;
|
||||
|
||||
w->id=id_counter++;
|
||||
w->next=NULL;
|
||||
|
@ -180,8 +185,8 @@ long desktop_add_window(WINDOW *w)
|
|||
EVENT_MSG msg;
|
||||
|
||||
msg.msg=E_LOST_FOCUS;
|
||||
o_aktual->events[2]();
|
||||
o_aktual->runs[2](&msg,o_aktual);
|
||||
o_aktual->on_exit();
|
||||
o_aktual->call_event(&msg,o_aktual);
|
||||
}
|
||||
waktual->next=w;
|
||||
waktual=w;
|
||||
|
@ -193,7 +198,7 @@ long desktop_add_window(WINDOW *w)
|
|||
}
|
||||
|
||||
|
||||
WINDOW *find_window(long id)
|
||||
WINDOW *find_window(int32_t id)
|
||||
{
|
||||
WINDOW *p;
|
||||
|
||||
|
@ -262,7 +267,7 @@ void absolute_window(WINDOW *w,OBJREC *o, int *x, int *y)
|
|||
memcpy(&charcolors,&o->f_color,sizeof(charcolors));
|
||||
// ws=waktual;
|
||||
// waktual=w;
|
||||
o->runs[1](x,y,x+o->xs,y+o->ys,o);
|
||||
o->call_draw(x,y,x+o->xs,y+o->ys,o);
|
||||
// waktual=ws;
|
||||
if (!o->enabled) disable_bar(x,y,o->xs,o->ys,o->color);
|
||||
ukaz_mysku();
|
||||
|
@ -322,21 +327,21 @@ void add_to_idlist(OBJREC *o)
|
|||
void define(int id,int x,int y,int xs,int ys,char align,void (*initproc)(OBJREC *),...)
|
||||
{
|
||||
OBJREC *o;
|
||||
long *p;
|
||||
int32_t *p;
|
||||
|
||||
o=(OBJREC *)getmem(sizeof(OBJREC));
|
||||
o->x=x;o->y=y;o->xs=xs;o->ys=ys;
|
||||
o->id=id;
|
||||
o->runs[0]=empty1;
|
||||
o->runs[1]=empty2;
|
||||
o->runs[2]=empty3;
|
||||
o->runs[3]=empty1;
|
||||
o->call_init=empty2_p;
|
||||
o->call_draw=empty2;
|
||||
o->call_event=empty3;
|
||||
o->call_done=empty1;
|
||||
o->autoresizex=0;
|
||||
o->autoresizey=0;
|
||||
o->events[0]=empty;
|
||||
o->events[1]=empty;
|
||||
o->events[2]=empty1;
|
||||
o->events[3]=empty3;
|
||||
o->on_event=empty;
|
||||
o->on_enter=empty;
|
||||
o->on_exit=empty1;
|
||||
o->on_change=empty3;
|
||||
o->enabled=1;
|
||||
o->draw_error=0;
|
||||
o->color=waktual->color;memcpy(o->f_color,f_default,sizeof(f_default));
|
||||
|
@ -347,8 +352,10 @@ void define(int id,int x,int y,int xs,int ys,char align,void (*initproc)(OBJREC
|
|||
o->datasize=0;
|
||||
initproc(o);
|
||||
if (o->datasize) o->data=(void *)getmem(o->datasize); else o->data=NULL;
|
||||
p=(long *)&initproc;p++;
|
||||
o->runs[0](o,p);
|
||||
va_list vlst;
|
||||
va_start(vlst, initproc);
|
||||
o->call_init(o,vlst);
|
||||
va_end(vlst);
|
||||
if (o->datasize && o->data==NULL) o->data=(void *)getmem(o->datasize);
|
||||
o->next=NULL;
|
||||
if (o_start==NULL)
|
||||
|
@ -494,7 +501,7 @@ void close_window(WINDOW *w)
|
|||
{
|
||||
q=w->objects;
|
||||
w->objects=q->next;
|
||||
q->runs[3](q);
|
||||
q->call_done(q);
|
||||
if (q->userptr!=NULL) free(q->userptr);
|
||||
if (q->data!=NULL) free(q->data);
|
||||
free(q);
|
||||
|
@ -553,7 +560,7 @@ OBJREC *get_next_id(OBJREC *o)
|
|||
p=p->next;
|
||||
if (p==NULL) p=waktual->idlist;
|
||||
o=p->obj;
|
||||
if (o->enabled && o->runs[2]!=empty3) return o;
|
||||
if (o->enabled && o->call_event!=empty3) return o;
|
||||
}
|
||||
while (1);
|
||||
}
|
||||
|
@ -579,7 +586,7 @@ OBJREC *get_prev_id(OBJREC *o)
|
|||
p=q;
|
||||
}
|
||||
o=p->obj;
|
||||
if (o->enabled && o->runs[2]!=empty3) return o;
|
||||
if (o->enabled && o->call_event!=empty3) return o;
|
||||
}
|
||||
while (1);
|
||||
}
|
||||
|
@ -598,7 +605,7 @@ void do_it_events(EVENT_MSG *msg,void **user_data)
|
|||
if (msg->msg==E_INIT) return;
|
||||
if (desktop==NULL) {exit_wait=1;return;}
|
||||
change_flag=0;f_cancel_event=0;
|
||||
if (o_aktual!=NULL)o_aktual->events[0](msg,o_aktual);
|
||||
if (o_aktual!=NULL)o_aktual->on_event(msg,o_aktual);
|
||||
if (msg->msg==E_MOUSE)
|
||||
{
|
||||
*oz=1;
|
||||
|
@ -608,33 +615,33 @@ void do_it_events(EVENT_MSG *msg,void **user_data)
|
|||
if (o_start!=NULL && (msev->tl1 || msev->tl2 || msev->tl3))
|
||||
{
|
||||
o_aktual=o_start;
|
||||
while (o_aktual!=NULL && (!o_aktual->enabled || !mouse_in_object(msev,o_aktual,waktual) || o_aktual->runs[2]==empty3)) o_aktual=o_aktual->next;
|
||||
while (o_aktual!=NULL && (!o_aktual->enabled || !mouse_in_object(msev,o_aktual,waktual) || o_aktual->call_event==empty3)) o_aktual=o_aktual->next;
|
||||
if (o_aktual==NULL) return;
|
||||
msg2.msg=E_GET_FOCUS;
|
||||
o_aktual->runs[2](&msg2,o_aktual);
|
||||
o_aktual->events[1]();
|
||||
o_aktual->runs[2](msg,o_aktual);
|
||||
o_aktual->call_event(&msg2,o_aktual);
|
||||
o_aktual->on_enter();
|
||||
o_aktual->call_event(msg,o_aktual);
|
||||
}
|
||||
else return;
|
||||
else
|
||||
{
|
||||
if (o_aktual->enabled) b=mouse_in_object(msev,o_aktual,waktual);else b=0;
|
||||
if (b)
|
||||
o_aktual->runs[2](msg,o_aktual);
|
||||
o_aktual->call_event(msg,o_aktual);
|
||||
if ((msev->tl1 || msev->tl2 || msev->tl3)&& !b)
|
||||
{
|
||||
o_aktual->events[2]();
|
||||
o_aktual->on_exit();
|
||||
if (f_cancel_event) return;
|
||||
msg2.msg=E_LOST_FOCUS;
|
||||
o_aktual->runs[2](&msg2,o_aktual);
|
||||
o_aktual->call_event(&msg2,o_aktual);
|
||||
p=o_start;
|
||||
while (p!=NULL && (!p->enabled || !mouse_in_object(msev,p,waktual) || p->runs[2]==empty3))
|
||||
while (p!=NULL && (!p->enabled || !mouse_in_object(msev,p,waktual) || p->call_event==empty3))
|
||||
p=p->next;
|
||||
if (p!=NULL) o_aktual=p;
|
||||
msg2.msg=E_GET_FOCUS;
|
||||
o_aktual->runs[2](&msg2,o_aktual);
|
||||
o_aktual->events[1]();
|
||||
if (p!=NULL) o_aktual->runs[2](msg,o_aktual);
|
||||
o_aktual->call_event(&msg2,o_aktual);
|
||||
o_aktual->on_enter();
|
||||
if (p!=NULL) o_aktual->call_event(msg,o_aktual);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -643,59 +650,62 @@ void do_it_events(EVENT_MSG *msg,void **user_data)
|
|||
*oz=1;
|
||||
if (o_aktual!=NULL)
|
||||
{
|
||||
o_aktual->runs[2](msg,o_aktual);
|
||||
o_aktual->call_event(msg,o_aktual);
|
||||
}
|
||||
if ((*(int *)msg->data>>8)==0xf && waktual->idlist!=NULL)
|
||||
int code = va_arg(msg->data, int);
|
||||
if ((code>>8)==0xf && waktual->idlist!=NULL)
|
||||
{
|
||||
if (o_aktual==NULL) o_aktual=get_last_id();
|
||||
if (o_aktual!=NULL)
|
||||
{
|
||||
f_cancel_event=0;
|
||||
o_aktual->events[2]();
|
||||
o_aktual->on_exit();
|
||||
if (f_cancel_event) return;
|
||||
msg2.msg=E_LOST_FOCUS;
|
||||
o_aktual->runs[2](&msg2,o_aktual);
|
||||
o_aktual->call_event(&msg2,o_aktual);
|
||||
}
|
||||
if((*(int *)msg->data & 0xff)==9) o_aktual=get_next_id(o_aktual);
|
||||
if((code & 0xff)==9) o_aktual=get_next_id(o_aktual);
|
||||
else o_aktual=get_prev_id(o_aktual);
|
||||
if (o_aktual!=NULL)
|
||||
{
|
||||
msg2.msg=E_GET_FOCUS;
|
||||
o_aktual->runs[2](&msg2,o_aktual);
|
||||
o_aktual->events[1]();
|
||||
o_aktual->call_event(&msg2,o_aktual);
|
||||
o_aktual->on_enter();
|
||||
}
|
||||
}
|
||||
}
|
||||
if (msg->msg==E_TIMER && o_aktual!=NULL)
|
||||
{
|
||||
o_aktual->runs[2](msg,o_aktual);
|
||||
o_aktual->call_event(msg,o_aktual);
|
||||
if (!(cursor_tick--))
|
||||
{
|
||||
msg->msg=E_CURSOR_TICK;
|
||||
o_aktual->runs[2](msg,o_aktual);
|
||||
o_aktual->events[0](msg,o_aktual);
|
||||
o_aktual->call_event(msg,o_aktual);
|
||||
o_aktual->on_event(msg,o_aktual);
|
||||
cursor_tick=CURSOR_SPEED;
|
||||
}
|
||||
}
|
||||
if (msg->msg==E_GUI)
|
||||
{
|
||||
OBJREC *o;
|
||||
EVENT_MSG msg2;
|
||||
int *p;
|
||||
int control = va_arg(msg->data, int);
|
||||
msg->msg = va_arg(msg->data, int);
|
||||
o=find_object(waktual,control);
|
||||
|
||||
EVENT_MSG msg2;
|
||||
|
||||
p=msg->data;
|
||||
o=find_object(waktual,*p++);
|
||||
if (o!=NULL)
|
||||
{
|
||||
msg2.msg=*p++;
|
||||
msg2.data=p;
|
||||
o->runs[2](&msg2,o);
|
||||
o->events[0](&msg,o_aktual);
|
||||
msg2.msg=msg->msg;
|
||||
va_copy(msg2.data,msg->data);
|
||||
o->call_event(&msg2,o);
|
||||
o->on_event(msg,o_aktual);
|
||||
va_end(msg2.data);
|
||||
}
|
||||
|
||||
}
|
||||
if (msg->msg==E_CHANGE)
|
||||
run_background(o_aktual->events[3]);
|
||||
run_background(o_aktual->on_change);
|
||||
if (change_flag) send_message(E_CHANGE);
|
||||
}
|
||||
|
||||
|
@ -726,24 +736,24 @@ void uninstall_gui(void)
|
|||
//send_message(E_GUI,cislo,E_UDALOST,data....)
|
||||
|
||||
|
||||
void on_change(void (*proc)())
|
||||
void on_control_change(void (*proc)())
|
||||
{
|
||||
o_end->events[3]=proc;
|
||||
o_end->on_change=proc;
|
||||
}
|
||||
|
||||
void on_enter(void (*proc)())
|
||||
void on_control_enter(void (*proc)())
|
||||
{
|
||||
o_end->events[1]=proc;
|
||||
o_end->on_enter=proc;
|
||||
}
|
||||
void on_exit(void (*proc)())
|
||||
void on_control_exit(void (*proc)())
|
||||
{
|
||||
o_end->events[2]=proc;
|
||||
o_end->on_exit=proc;
|
||||
}
|
||||
void on_event(void (*proc)())
|
||||
void on_control_event(void (*proc)(EVENT_MSG *msg, struct objrec *))
|
||||
{
|
||||
o_end->events[0]=proc;
|
||||
o_end->on_event=proc;
|
||||
}
|
||||
void terminate(void)
|
||||
void terminate_gui(void)
|
||||
{
|
||||
exit_wait=1;
|
||||
}
|
||||
|
@ -810,8 +820,8 @@ void goto_control(int obj_id)
|
|||
if (send_lost()) return;
|
||||
o_aktual=find_object(waktual,obj_id);
|
||||
msg.msg=E_GET_FOCUS;
|
||||
o_aktual->events[0](&msg,o_aktual);
|
||||
o_aktual->runs[2](&msg,o_aktual);
|
||||
o_aktual->on_event(&msg,o_aktual);
|
||||
o_aktual->call_event(&msg,o_aktual);
|
||||
}
|
||||
|
||||
void c_set_value(int win_id,int obj_id,int cnst)
|
||||
|
@ -880,12 +890,12 @@ void close_current()
|
|||
|
||||
void background_runner(EVENT_MSG *msg,void **prog)
|
||||
{
|
||||
register void (*p)();
|
||||
void (*p)();
|
||||
char i=1;
|
||||
|
||||
if (msg->msg==E_INIT)
|
||||
{
|
||||
memcpy(prog,msg->data,4);
|
||||
*prog = va_arg(msg->data, void (*)());
|
||||
return;
|
||||
}
|
||||
if (msg->msg==E_DONE)
|
||||
|
|
33
libs/gui.h
33
libs/gui.h
|
@ -1,3 +1,8 @@
|
|||
#include <stdarg.h>
|
||||
|
||||
#ifndef SKELDAL_LIB_GUI
|
||||
#define SKELDAL_LIB_GUI
|
||||
|
||||
#define E_MS_CLICK 50
|
||||
#define E_MS_MOVE 51
|
||||
#define E_GET_FOCUS 52
|
||||
|
@ -10,7 +15,7 @@
|
|||
#define E_CONTROL 59 //User defined feature, enables direct controling desktop objects
|
||||
|
||||
#define CURSOR_SPEED 5;
|
||||
#define get_title(title) (char *)*(long *)(title);
|
||||
#define get_title(title) (char *)*(int32_t *)(title);
|
||||
#define DESK_TOP_COLOR RGB555(0,15,15);
|
||||
#define MINSIZX 60
|
||||
#define MINSIZY 40
|
||||
|
@ -48,7 +53,9 @@ typedef FC_TABLE FC_PALETTE[16];
|
|||
DONE(OBJREC *object);
|
||||
*/
|
||||
|
||||
typedef void (*RUN_ROUTS[4])();
|
||||
typedef struct objrec OBJREC;
|
||||
|
||||
typedef void (*RUN_ROUTS[4])(OBJREC *, va_list);
|
||||
|
||||
typedef struct objrec
|
||||
{
|
||||
|
@ -59,13 +66,19 @@ typedef struct objrec
|
|||
char align,autoresizex,autoresizey;
|
||||
char enabled;
|
||||
short locx,locy;
|
||||
long datasize;
|
||||
int32_t datasize;
|
||||
void *data;
|
||||
FC_TABLE f_color;
|
||||
word *font;
|
||||
void *userptr;
|
||||
RUN_ROUTS runs;
|
||||
RUN_ROUTS events;
|
||||
void (*call_init)(struct objrec *, va_list);
|
||||
void (*call_draw)(int , int, int, int, struct objrec *);
|
||||
void (*call_event)(EVENT_MSG *msg, struct objrec *);
|
||||
void (*call_done)(struct objrec *);
|
||||
void (*on_event)(EVENT_MSG *msg, struct objrec *);
|
||||
void (*on_enter)();
|
||||
void (*on_exit)();
|
||||
void (*on_change)();
|
||||
char draw_error; //1 znamena ze objekt zpusobil chybu a nebude vykreslovan
|
||||
struct objrec *next;
|
||||
}OBJREC;
|
||||
|
@ -94,7 +107,7 @@ typedef struct window
|
|||
CTL3D border3d;
|
||||
word color;
|
||||
OBJREC *objects;
|
||||
long id;
|
||||
int32_t id;
|
||||
char modal,minimized,popup;
|
||||
word minsizx,minsizy;
|
||||
char *window_name;
|
||||
|
@ -117,9 +130,9 @@ extern void *gui_background;
|
|||
|
||||
void draw_border(integer x,integer y,integer xs,integer ys,CTL3D *btype);
|
||||
WINDOW *create_window(int x,int y, int xs, int ys, word color, CTL3D *okraj);
|
||||
long desktop_add_window(WINDOW *w);
|
||||
void select_window(long id);
|
||||
WINDOW *find_window(long id);
|
||||
int32_t desktop_add_window(WINDOW *w);
|
||||
void select_window(int32_t id);
|
||||
WINDOW *find_window(int32_t id);
|
||||
void redraw_object(OBJREC *o);
|
||||
void redraw_window();
|
||||
void define(int id,int x,int y,int xs,int ys,char align,void (*initproc)(OBJREC *),...);
|
||||
|
@ -154,7 +167,7 @@ void disable_bar(int x,int y,int xs,int ys,word color);
|
|||
void movesize_win(WINDOW *w, int newx,int newy, int newxs, int newys);
|
||||
void goto_control(int obj_id);
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
#include <skeldal_win.h>
|
||||
#include <stdio.h>
|
||||
#include <malloc.h>
|
||||
#include <stdlib.h>
|
||||
|
@ -99,7 +100,7 @@ void add_field_txt(TSTR_LIST *ls,const char *name,const char *text)
|
|||
str_replace(ls,i,d);
|
||||
}
|
||||
|
||||
void add_field_num(TSTR_LIST *ls,const char *name,long number)
|
||||
void add_field_num(TSTR_LIST *ls,const char *name,int32_t number)
|
||||
{
|
||||
char buff[20];
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
TSTR_LIST read_config(const char *filename);
|
||||
void add_field_txt(TSTR_LIST *ls,const char *name,const char *text);
|
||||
void add_field_num(TSTR_LIST *ls,const char *name,long number);
|
||||
void add_field_num(TSTR_LIST *ls,const char *name,int32_t number);
|
||||
int save_config(TSTR_LIST ls,const char *filename);
|
||||
const char *get_text_field(TSTR_LIST ls,const char *name);
|
||||
int get_num_field(TSTR_LIST ls,const char *name,int *num);
|
||||
|
|
220
libs/memman.c
220
libs/memman.c
|
@ -1,7 +1,6 @@
|
|||
#include <skeldal_win.h>
|
||||
#include "types.h"
|
||||
#include <mem.h>
|
||||
#include <dos.h>
|
||||
#include <stdio.h>
|
||||
#include <malloc.h>
|
||||
#include <stdlib.h>
|
||||
|
@ -10,8 +9,8 @@
|
|||
//#include <i86.h>
|
||||
#include "swaper.c"
|
||||
#include <fcntl.h>
|
||||
#include <io.h>
|
||||
#include <SYS\STAT.H>
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#define DPMI_INT 0x31
|
||||
#define LOAD_BUFFER 4096
|
||||
|
@ -24,7 +23,7 @@ void bonz_table();
|
|||
char **mman_pathlist=NULL;
|
||||
static char swap_status=0;
|
||||
|
||||
static int swap;
|
||||
static FILE *swap = NULL;
|
||||
char mman_patch=0;
|
||||
|
||||
int memman_handle;
|
||||
|
@ -33,12 +32,7 @@ static int max_handle=0;
|
|||
|
||||
void (*mman_action)(int action)=NULL;
|
||||
|
||||
long last_load_size;
|
||||
void get_mem_info(MEMORYSTATUS *mem)
|
||||
{
|
||||
mem->dwLength=sizeof(*mem);
|
||||
GlobalMemoryStatus(mem);
|
||||
}
|
||||
int32_t last_load_size;
|
||||
|
||||
|
||||
void standard_mem_error(size_t size)
|
||||
|
@ -46,8 +40,8 @@ void standard_mem_error(size_t size)
|
|||
char buff[256];
|
||||
SEND_LOG("(ERROR) Memory allocation error detected, %u bytes missing",size,0);
|
||||
DXCloseMode();
|
||||
sprintf(buff,"Memory allocation error\n Application can't allocate %u bytes of memory (%xh)\n",size,memman_handle);
|
||||
MessageBox(NULL,buff,NULL,MB_OK|MB_ICONSTOP);
|
||||
sprintf(buff,"Memory allocation error\n Application can't allocate %lu bytes of memory (%xh)\n",size,memman_handle);
|
||||
display_error(buff);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
|
@ -60,7 +54,7 @@ void load_error(char *filename)
|
|||
#endif
|
||||
DXCloseMode();
|
||||
sprintf(buff,"Load error while loading file: %s", filename);
|
||||
MessageBox(NULL,buff,NULL,MB_OK|MB_ICONSTOP);
|
||||
display_error(buff);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
|
@ -69,7 +63,7 @@ void standard_swap_error()
|
|||
char buff[256];
|
||||
DXCloseMode();
|
||||
sprintf(buff,"Swap error. Maybe disk is full");
|
||||
MessageBox(NULL,buff,NULL,MB_OK|MB_ICONSTOP);
|
||||
display_error(buff);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
|
@ -77,7 +71,7 @@ void standard_swap_error()
|
|||
void (*mem_error)(size_t)=standard_mem_error;
|
||||
void (*swap_error)()=standard_swap_error;
|
||||
|
||||
void *getmem(long size)
|
||||
void *getmem(int32_t size)
|
||||
{
|
||||
void *p,*res;
|
||||
|
||||
|
@ -94,24 +88,29 @@ void *getmem(long size)
|
|||
if (p==NULL) mem_error(size);
|
||||
}
|
||||
while (p==NULL);
|
||||
// SEND_LOG("(ALLOC) **** Alloc: %p size %d",p,*((long *)p-1));
|
||||
// SEND_LOG("(ALLOC) **** Alloc: %p size %d",p,*((int32_t *)p-1));
|
||||
return p;
|
||||
}
|
||||
|
||||
|
||||
void *load_file(char *filename)
|
||||
{
|
||||
int f;
|
||||
long size,*p;
|
||||
FILE *f;
|
||||
int32_t size,*p;
|
||||
|
||||
if (mman_action!=NULL) mman_action(MMA_READ);
|
||||
SEND_LOG("(LOAD) Loading file '%s'",filename,0);
|
||||
f=open(filename,O_BINARY | O_RDONLY);
|
||||
if (f==-1) load_error(filename);
|
||||
size=filelength(f);
|
||||
f=fopen(filename, "rb");
|
||||
if (f==NULL) {
|
||||
load_error(filename);
|
||||
return NULL;
|
||||
}
|
||||
fseek(f,0, SEEK_END);
|
||||
size=ftell(f);
|
||||
fseek(f,0, SEEK_SET);
|
||||
p=(void *)getmem(size);
|
||||
if (read(f,p,size)!=size) load_error(filename);
|
||||
close(f);
|
||||
if (fread(p,1,size,f)!=size) load_error(filename);
|
||||
fclose(f);
|
||||
last_load_size=size;
|
||||
return p;
|
||||
}
|
||||
|
@ -121,11 +120,11 @@ void *load_file(char *filename)
|
|||
typedef struct tnametable
|
||||
{
|
||||
char name[12];
|
||||
long seek;
|
||||
int32_t seek;
|
||||
}TNAMETABLE;
|
||||
|
||||
|
||||
static long *grptable,grptabsiz;
|
||||
static int32_t *grptable,grptabsiz;
|
||||
static TNAMETABLE *nametable;
|
||||
static int nmtab_size;
|
||||
static int next_name_read=0;
|
||||
|
@ -133,9 +132,9 @@ static int last_group;
|
|||
|
||||
char *main_file_name=NULL;
|
||||
handle_groups _handles;
|
||||
static int bmf=-1;
|
||||
static int patch=-1;
|
||||
unsigned long bk_global_counter=0;
|
||||
static FILE *bmf=NULL;
|
||||
static FILE *patch=NULL;
|
||||
uint32_t bk_global_counter=0;
|
||||
char *swap_path;
|
||||
|
||||
#ifdef LOGFILE
|
||||
|
@ -164,14 +163,14 @@ static int test_file_exist_DOS(int group,char *filename)
|
|||
|
||||
void load_grp_table()
|
||||
{
|
||||
long i;
|
||||
int32_t i;
|
||||
|
||||
SEND_LOG("(LOAD) Loading Group Table",0,0);
|
||||
lseek(bmf,4,SEEK_SET);
|
||||
read(bmf,&i,4);
|
||||
grptable=(long *)getmem(i+4);
|
||||
lseek(bmf,0,SEEK_SET);
|
||||
read(bmf,grptable,i);
|
||||
fseek(bmf,4,SEEK_SET);
|
||||
fread(&i,4,1,bmf);
|
||||
grptable=(int32_t *)getmem(i+4);
|
||||
fseek(bmf,0,SEEK_SET);
|
||||
fread(grptable,i,1,bmf);
|
||||
grptabsiz=i;
|
||||
for(i=0;i<(grptabsiz>>3);i++) grptable[i*2+1]=(grptable[i*2+1]-grptabsiz)>>4;
|
||||
SEND_LOG("(LOAD) Group Table Loaded",0,0);
|
||||
|
@ -183,13 +182,13 @@ void load_file_table()
|
|||
void *p;
|
||||
|
||||
SEND_LOG("(LOAD) Loading File Table",0,0);
|
||||
lseek(bmf,grptabsiz,SEEK_SET);
|
||||
lseek(bmf,12,SEEK_CUR);
|
||||
read(bmf,&strsize,4);
|
||||
fseek(bmf,grptabsiz,SEEK_SET);
|
||||
fseek(bmf,12,SEEK_CUR);
|
||||
fread(&strsize,4,1,bmf);
|
||||
strsize-=grptabsiz;
|
||||
lseek(bmf,grptabsiz,SEEK_SET);
|
||||
fseek(bmf,grptabsiz,SEEK_SET);
|
||||
p=getmem(strsize);memcpy(&nametable,&p,4);
|
||||
read(bmf,nametable,strsize);
|
||||
fread(nametable,1,strsize,bmf);
|
||||
nmtab_size=strsize/sizeof(*nametable);
|
||||
SEND_LOG("(LOAD) File Table Loaded",0,0);
|
||||
}
|
||||
|
@ -224,17 +223,16 @@ int get_file_entry(int group,char *name)
|
|||
}
|
||||
int swap_block(THANDLE_DATA *h)
|
||||
{
|
||||
long wsize,pos;
|
||||
int32_t wsize,pos;
|
||||
|
||||
if (mman_action!=NULL) mman_action(MMA_SWAP);
|
||||
if (swap==-1) return -1;
|
||||
if (!swap) return -1;
|
||||
if (h->flags & BK_HSWAP) pos=h->seekpos; else pos=swap_add_block(h->size);
|
||||
lseek(swap,0,SEEK_END);
|
||||
wsize=tell(swap);
|
||||
if (wsize<pos) write(swap,NULL,pos-wsize);
|
||||
lseek(swap,pos,SEEK_SET);
|
||||
fseek(swap,0,SEEK_END);
|
||||
wsize=ftell(swap);
|
||||
fseek(swap,pos,SEEK_SET);
|
||||
SEND_LOG("(SWAP) Swaping block '%-.12hs'",h->src_file,0);
|
||||
wsize=write(swap,h->blockdata,h->size);
|
||||
wsize=fwrite(h->blockdata,1,h->size,swap);
|
||||
swap_status=1;
|
||||
if ((unsigned)wsize==h->size)
|
||||
{
|
||||
|
@ -271,7 +269,7 @@ void heap_error(size_t size) //heap system
|
|||
{
|
||||
int i,j;
|
||||
char swaped=0;
|
||||
unsigned long maxcounter=0;
|
||||
uint32_t maxcounter=0;
|
||||
THANDLE_DATA *sh;
|
||||
char repeat=0,did=0;
|
||||
THANDLE_DATA *lastblock=NULL;
|
||||
|
@ -285,7 +283,7 @@ void heap_error(size_t size) //heap system
|
|||
for(i=0;i<BK_MAJOR_HANDLES;i++)
|
||||
if (_handles[i]!=NULL)
|
||||
{
|
||||
unsigned long c,max=0xffffffff,d;
|
||||
uint32_t c,max=0xffffffff,d;
|
||||
for (j=0;j<BK_MINOR_HANDLES;j++)
|
||||
{
|
||||
THANDLE_DATA *h;
|
||||
|
@ -375,7 +373,7 @@ THANDLE_DATA *zneplatnit_block(int handle)
|
|||
return h;
|
||||
}
|
||||
|
||||
void init_manager(char *filename,char *swp) // filename= Jmeno datoveho souboru nebo NULL pak
|
||||
void init_manager(char *filename,char */*swap is not supported*/) // filename= Jmeno datoveho souboru nebo NULL pak
|
||||
// se pouzije DOS
|
||||
// swp je cesta do TEMP adresare
|
||||
{
|
||||
|
@ -384,8 +382,8 @@ void init_manager(char *filename,char *swp) // filename= Jmeno datoveho souboru
|
|||
memset(_handles,0,sizeof(_handles));
|
||||
if (filename!=NULL)
|
||||
{
|
||||
bmf=open(filename,O_BINARY | O_RDONLY);
|
||||
if (bmf!=-1)
|
||||
bmf=fopen(filename,"rb");
|
||||
if (bmf)
|
||||
{
|
||||
main_file_name=(char *)getmem(strlen(filename)+1);
|
||||
strcpy(main_file_name,filename);
|
||||
|
@ -398,13 +396,7 @@ void init_manager(char *filename,char *swp) // filename= Jmeno datoveho souboru
|
|||
else
|
||||
main_file_name=NULL;
|
||||
mem_error=heap_error;
|
||||
if (swp!=NULL)
|
||||
{
|
||||
swap=open(swp,O_BINARY | O_RDWR | O_CREAT | O_TRUNC,_S_IREAD | _S_IWRITE);
|
||||
swap_init();
|
||||
}
|
||||
else
|
||||
swap=-1;
|
||||
swap=NULL;
|
||||
}
|
||||
|
||||
void *load_swaped_block(THANDLE_DATA *h)
|
||||
|
@ -414,8 +406,8 @@ void *load_swaped_block(THANDLE_DATA *h)
|
|||
if (mman_action!=NULL) mman_action(MMA_SWAP_READ);
|
||||
i=getmem(h->size);
|
||||
SEND_LOG("(LOAD)(SWAP) Loading block from swap named '%-.12hs'",h->src_file,0);
|
||||
lseek(swap,h->seekpos,SEEK_SET);
|
||||
read(swap,i,h->size);
|
||||
fseek(swap,h->seekpos,SEEK_SET);
|
||||
fread(i,1,h->size,swap);
|
||||
h->status=BK_PRESENT;
|
||||
return i;
|
||||
}
|
||||
|
@ -430,7 +422,7 @@ int find_same(char *name,void *decomp)
|
|||
if (name[0]==0) return -1;
|
||||
for(i=0;i<BK_MAJOR_HANDLES;i++)
|
||||
if (_handles[i]!=NULL)
|
||||
{
|
||||
{
|
||||
p=(THANDLE_DATA *)(_handles[i]);
|
||||
for(j=0;j<BK_MINOR_HANDLES;j++)
|
||||
if ((!strncmp(p[j].src_file,name,12))&& (p[j].loadproc==decomp)) return i*BK_MINOR_HANDLES+j;
|
||||
|
@ -483,10 +475,10 @@ THANDLE_DATA *def_handle(int handle,char *filename,void *decompress,char path)
|
|||
return h;
|
||||
}
|
||||
|
||||
void *afile(char *filename,int group,long *blocksize)
|
||||
void *afile(char *filename,int group,int32_t *blocksize)
|
||||
{
|
||||
char *c,*d;
|
||||
long entr;
|
||||
int32_t entr;
|
||||
void *p;
|
||||
|
||||
d=alloca(strlen(filename)+1);
|
||||
|
@ -496,13 +488,13 @@ void *afile(char *filename,int group,long *blocksize)
|
|||
else entr=get_file_entry(group,d);
|
||||
if (entr!=0)
|
||||
{
|
||||
int hnd;
|
||||
FILE *hnd;
|
||||
SEND_LOG("(LOAD) Afile is loading file '%s' from group %d",d,group);
|
||||
if (entr<0) entr=-entr,hnd=patch;else hnd=bmf;
|
||||
lseek(hnd,entr,SEEK_SET);
|
||||
read(hnd,blocksize,4);
|
||||
fseek(hnd,entr,SEEK_SET);
|
||||
fread(blocksize,1,4,hnd);
|
||||
p=getmem(*blocksize);
|
||||
read(hnd,p,*blocksize);
|
||||
fread(p,1,*blocksize,hnd);
|
||||
}
|
||||
else if (mman_pathlist!=NULL)
|
||||
{
|
||||
|
@ -536,7 +528,7 @@ void *ablock(int handle)
|
|||
}
|
||||
if (h->status==BK_NOT_LOADED)
|
||||
{
|
||||
void *p;long s;
|
||||
void *p;int32_t s;
|
||||
char c[200];
|
||||
|
||||
SEND_LOG("(LOAD) Loading file as block '%-.12hs' %04X",h->src_file,handle);
|
||||
|
@ -563,13 +555,14 @@ void *ablock(int handle)
|
|||
}
|
||||
else
|
||||
{
|
||||
int entr=h->seekpos,hnd;
|
||||
int entr=h->seekpos;
|
||||
FILE *hnd;
|
||||
if (mman_action!=NULL) mman_action(MMA_READ);
|
||||
if (entr<0) entr=-entr,hnd=patch;else hnd=bmf;
|
||||
lseek(hnd,entr,SEEK_SET);
|
||||
read(hnd,&s,4);
|
||||
fseek(hnd,entr,SEEK_SET);
|
||||
fread(&s,1,4,hnd);
|
||||
p=getmem(s);
|
||||
read(hnd,p,s);
|
||||
fread(p,1,s,hnd);
|
||||
if (h->loadproc!=NULL) h->loadproc(&p,&s);
|
||||
h->blockdata=p;
|
||||
h->status=BK_PRESENT;
|
||||
|
@ -642,16 +635,16 @@ void apreload(int handle)
|
|||
}
|
||||
}
|
||||
|
||||
static long *apr_sign=NULL;
|
||||
static long max_sign;
|
||||
static int32_t *apr_sign=NULL;
|
||||
static int32_t max_sign;
|
||||
|
||||
void apreload_sign(int handle,int max_handle)
|
||||
{
|
||||
THANDLE_DATA *h;
|
||||
if (apr_sign==NULL)
|
||||
{
|
||||
apr_sign=NewArr(long,max_handle);
|
||||
memset(apr_sign,0x7f,sizeof(long)*max_handle);
|
||||
apr_sign=NewArr(int32_t,max_handle);
|
||||
memset(apr_sign,0x7f,sizeof(int32_t)*max_handle);
|
||||
max_sign=max_handle;
|
||||
}
|
||||
if (handle>=max_sign)
|
||||
|
@ -664,9 +657,9 @@ void apreload_sign(int handle,int max_handle)
|
|||
if (!(h->flags & BK_PRELOAD) || !(h->flags & BK_HSWAP)) apr_sign[handle]=h->seekpos;
|
||||
}
|
||||
|
||||
static int apreload_sort(const void *val1,const void *val2)
|
||||
int apreload_sort(const void *val1,const void *val2)
|
||||
{
|
||||
long vl1,vl2;
|
||||
int32_t vl1,vl2;
|
||||
|
||||
vl1=apr_sign[*(word *)val1];
|
||||
vl2=apr_sign[*(word *)val2];
|
||||
|
@ -728,9 +721,9 @@ void close_manager()
|
|||
free(_handles[i]);
|
||||
}
|
||||
free(main_file_name);
|
||||
close(bmf);
|
||||
if (swap!=-1) close(swap);
|
||||
// fclose(log);
|
||||
if (bmf) fclose(bmf);
|
||||
if (patch) fclose(patch);
|
||||
if (swap) fclose(swap);
|
||||
free(grptable); grptable=NULL;
|
||||
free(nametable); nametable=NULL;
|
||||
max_handle=0;
|
||||
|
@ -761,9 +754,8 @@ void display_status()
|
|||
char flags[]={"LS*PH"};
|
||||
char copys[6]=" ";
|
||||
char nname[14];
|
||||
long total_data=0;
|
||||
long total_mem=0;
|
||||
MEMORYSTATUS mem;
|
||||
int32_t total_data=0;
|
||||
int32_t total_mem=0;
|
||||
int ln=0;
|
||||
|
||||
//block();
|
||||
|
@ -781,9 +773,9 @@ void display_status()
|
|||
|
||||
for(k=0;k<5;k++) copys[k]=h->flags & (1<<k)?flags[k]:'.';
|
||||
if (h->src_file[0]) strncpy(nname,h->src_file,12);else strcpy(nname,"<local>");
|
||||
printf("%04Xh ... %12s %s %s %08Xh %6d %10d %6d \n",i*BK_MINOR_HANDLES+j,
|
||||
printf("%04Xh ... %12s %s %s %08lXh %6d %10d %6d \n",i*BK_MINOR_HANDLES+j,
|
||||
nname,names[h->status-1],
|
||||
copys,(int)h->blockdata,h->size,h->counter,h->lockcount);
|
||||
copys,(uintptr_t)h->blockdata,h->size,h->counter,h->lockcount);
|
||||
ln++;
|
||||
total_data+=h->size;
|
||||
if(h->status==BK_PRESENT)total_mem+=h->size;
|
||||
|
@ -802,33 +794,29 @@ void display_status()
|
|||
}
|
||||
|
||||
}
|
||||
get_mem_info(&mem);
|
||||
printf("Data: %7d KB, Loaded: %7d KB, Largest free: %7d KB",total_data/1024,total_mem/1024,mem.dwAvailPageFile/1024);
|
||||
printf("Data: %7d KB, Loaded: %7d KB",total_data/1024,total_mem/1024);
|
||||
while (getchar()!='\n');
|
||||
}
|
||||
|
||||
void *grealloc(void *p,long size)
|
||||
void *grealloc(void *p,int32_t size)
|
||||
{
|
||||
void *q;
|
||||
long scop;
|
||||
int32_t scop;
|
||||
|
||||
if (!size)
|
||||
{
|
||||
free(p);
|
||||
return NULL;
|
||||
}
|
||||
/*q=realloc(p,size);
|
||||
q=realloc(p,size);
|
||||
if (q!=NULL)
|
||||
{
|
||||
SEND_LOG("(ALLOC) **** Realloc: New %p size %d\n",q,*((long *)q-1));
|
||||
SEND_LOG("(ALLOC) **** Realloc: New %p size %d\n",q,*((int32_t *)q-1));
|
||||
return q;
|
||||
}*/
|
||||
}
|
||||
q=getmem(size);
|
||||
if (p==NULL) return q;
|
||||
scop=_msize(p);
|
||||
if (scop>size) scop=size;
|
||||
memmove(q,p,scop);
|
||||
free(p);
|
||||
free(q);
|
||||
q=realloc(p,size);
|
||||
return q;
|
||||
}
|
||||
|
||||
|
@ -847,25 +835,25 @@ int read_group(int index)
|
|||
|
||||
char add_patch_file(char *filename)
|
||||
{
|
||||
long l;
|
||||
long poc;
|
||||
int32_t l;
|
||||
int32_t poc;
|
||||
int i,cc=0;
|
||||
TNAMETABLE p;
|
||||
SEND_LOG("Adding patch: %s",filename,0);
|
||||
if (patch!=-1) return 2;
|
||||
if (bmf==-1) return 3;
|
||||
patch=open(filename,O_BINARY|O_RDONLY);
|
||||
if (patch==-1) return 1;
|
||||
lseek(patch,4,SEEK_SET);
|
||||
read(patch,&l,4);
|
||||
lseek(patch,l,SEEK_SET);
|
||||
read(patch,&p,sizeof(p));
|
||||
if (!patch) return 2;
|
||||
if (!bmf) return 3;
|
||||
patch=fopen(filename,"rb");
|
||||
if (!patch) return 1;
|
||||
fseek(patch,4,SEEK_SET);
|
||||
fread(&l,1,4,patch);
|
||||
fseek(patch,l,SEEK_SET);
|
||||
fread(&p,1,sizeof(p),patch);
|
||||
poc=(p.seek-l)/sizeof(p);
|
||||
lseek(patch,l,SEEK_SET);
|
||||
fseek(patch,l,SEEK_SET);
|
||||
for(i=0;i<poc;i++)
|
||||
{
|
||||
int j;
|
||||
read(patch,&p,sizeof(p));
|
||||
fread(&p,1,sizeof(p),patch);
|
||||
j=find_name(read_group(0),p.name);
|
||||
if (j==-1)
|
||||
{
|
||||
|
@ -883,7 +871,7 @@ char add_patch_file(char *filename)
|
|||
void free(void *c)
|
||||
{
|
||||
if (c==NULL) return;
|
||||
SEND_LOG("(ALLOC)úúú Dealloc: %p size %d",c,*((long *)c-1));
|
||||
SEND_LOG("(ALLOC)<EFBFBD><EFBFBD><EFBFBD> Dealloc: %p size %d",c,*((int32_t *)c-1));
|
||||
free(c);
|
||||
}
|
||||
*/
|
||||
|
@ -914,7 +902,7 @@ char *get_time_str()
|
|||
static char text[20];
|
||||
|
||||
|
||||
time( &long_time ); /* Get time as long integer. */
|
||||
time( &long_time ); /* Get time as int32_t integer. */
|
||||
newtime = localtime( &long_time ); /* Convert to local time. */
|
||||
|
||||
sprintf(text,"%02d:%02d:%02d",newtime->tm_hour,newtime->tm_min,newtime->tm_sec);
|
||||
|
@ -924,7 +912,7 @@ char *get_time_str()
|
|||
|
||||
#endif
|
||||
|
||||
long get_handle_size(int handle)
|
||||
int32_t get_handle_size(int handle)
|
||||
{
|
||||
THANDLE_DATA *h;
|
||||
|
||||
|
@ -942,7 +930,7 @@ long get_handle_size(int handle)
|
|||
if (log!=NULL && zavora)
|
||||
{
|
||||
zavora=0;
|
||||
fprintf(log,"Alloc: %p size %d\n",c,*((long *)c-1));
|
||||
fprintf(log,"Alloc: %p size %d\n",c,*((int32_t *)c-1));
|
||||
zavora=1;
|
||||
}
|
||||
return c;
|
||||
|
@ -951,7 +939,7 @@ long get_handle_size(int handle)
|
|||
|
||||
FILE *afiletemp(char *filename, int group)
|
||||
{
|
||||
long size;
|
||||
int32_t size;
|
||||
void *p=afile(filename,group,&size);
|
||||
FILE *f;
|
||||
if (p==NULL) return NULL;
|
||||
|
@ -960,4 +948,4 @@ FILE *afiletemp(char *filename, int group)
|
|||
fwrite(p,size,1,f);
|
||||
fseek(f,0,SEEK_SET);
|
||||
return f;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -27,15 +27,15 @@ typedef struct meminfo {
|
|||
typedef struct thandle_data
|
||||
{
|
||||
char src_file[12]; //12
|
||||
long seekpos; //16
|
||||
int32_t seekpos; //16
|
||||
void *blockdata; //20
|
||||
char flags; //21
|
||||
char path; //22
|
||||
short status;
|
||||
void (*loadproc)(void **data,long *size);//28
|
||||
void (*loadproc)(void **data,int32_t *size);//28
|
||||
unsigned short lockcount; //32
|
||||
unsigned long counter;
|
||||
unsigned long size;
|
||||
uint32_t counter;
|
||||
uint32_t size;
|
||||
}THANDLE_DATA;
|
||||
|
||||
#define BK_MAJOR_HANDLES 256 // maximalni pocet skupin rukojeti
|
||||
|
@ -64,8 +64,8 @@ extern void (*mem_error)(size_t); //pokud neni NULL je tato funkce volana vzd
|
|||
extern void (*swap_error)();
|
||||
extern int memman_handle; //cislo handle naposled zpracovavaneho prikazem ablock
|
||||
extern char mman_patch; //jednicka zapina moznost pouziti patchu
|
||||
void *getmem(long size); //alokace pameti pres memman. alokovat pomoci malloc lze ale hrozi nebezpeci ze vrati NULL
|
||||
void *grealloc(void *m,long size); //realokace pameti pres memman
|
||||
void *getmem(int32_t size); //alokace pameti pres memman. alokovat pomoci malloc lze ale hrozi nebezpeci ze vrati NULL
|
||||
void *grealloc(void *m,int32_t size); //realokace pameti pres memman
|
||||
void *load_file(char *filename); //obycejne natahne soubor do pameti a vrati ukazatel.
|
||||
void init_manager(char *filename,char *swp); //inicializuje manager. Jmeno filename i swapname nejsou povinne (musi byt NULL kdyz nejsou pouzity)
|
||||
THANDLE_DATA *def_handle(int handle,char *filename,void *decompress,char path); //deklaruje rukojet. promenna decompress je ukazatel na funkci ktera upravi data pred vracenim ukazatele
|
||||
|
@ -82,8 +82,8 @@ THANDLE_DATA *zneplatnit_block(int handle); //zneplatni data bloku
|
|||
THANDLE_DATA *get_handle(int handle); //vraci informace o rukojeti
|
||||
int find_handle(char *name,void *decomp); //hleda mezi rukojeti stejnou definici
|
||||
int test_file_exist(int group,char *filename); //testuje zda soubor existuje v ramci mmanageru
|
||||
void *afile(char *filename,int group,long *blocksize); //nahraje do pameti soubor registrovany v ramci mmanageru
|
||||
long get_handle_size(int handle);
|
||||
void *afile(char *filename,int group,int32_t *blocksize); //nahraje do pameti soubor registrovany v ramci mmanageru
|
||||
int32_t get_handle_size(int handle);
|
||||
//void get_mem_info(MEMORYSTATUS *mem);
|
||||
|
||||
void apreload_sign(int handle,int max_handle); //pripravi preloading pro nacteni dat z CD (sekvencne)
|
||||
|
|
|
@ -92,7 +92,7 @@ static char bankmode=0;
|
|||
static char colr64=0;
|
||||
|
||||
static void *bufpos;
|
||||
long vals_save=0x80008000;
|
||||
int32_t vals_save=0x80008000;
|
||||
|
||||
static void *f,*temp;
|
||||
static int posyb,posyl;
|
||||
|
@ -112,7 +112,7 @@ static char screen_mode=SMD_256;
|
|||
char year[2];
|
||||
char eof;
|
||||
word ver;
|
||||
long frames;
|
||||
int32_t frames;
|
||||
word snd_chans;
|
||||
int snd_freq;
|
||||
short ampl_table[256];
|
||||
|
@ -167,8 +167,8 @@ static void close_mgf_file()
|
|||
|
||||
static void load_frame(void *f)
|
||||
{
|
||||
long frame_head;
|
||||
long frame_size;
|
||||
int32_t frame_head;
|
||||
int32_t frame_size;
|
||||
|
||||
bread(&frame_head,4);
|
||||
chunks=frame_head & 0xff;
|
||||
|
@ -248,7 +248,7 @@ static void show_frame(void *fr,void *temp)
|
|||
{
|
||||
int x;
|
||||
char *p,a;
|
||||
long siz;
|
||||
int32_t siz;
|
||||
int frmode=0,i;
|
||||
void *sound=NULL;int ssize;
|
||||
static last_counter=-1;
|
||||
|
@ -257,7 +257,7 @@ static void show_frame(void *fr,void *temp)
|
|||
|
||||
for(x=0;x<chunks;x++)
|
||||
{
|
||||
a=*p;siz=*(long *)p>>8;p+=4;
|
||||
a=*p;siz=*(int32_t *)p>>8;p+=4;
|
||||
switch(a)
|
||||
{
|
||||
case MGIF_LZW:
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
#include <skeldal_win.h>
|
||||
#include <bgraph.h>
|
||||
#include <bgraph2dx.h>
|
||||
#include <stdio.h>
|
||||
#include "types.h"
|
||||
#include "memman.h"
|
||||
|
@ -8,21 +7,11 @@
|
|||
#include "mgifmem.h"
|
||||
#include <zvuk.h>
|
||||
|
||||
static HANDLE mapped_mgif;
|
||||
static HANDLE mgif_file;
|
||||
static MGIF_HEADER_T *mgif_header;
|
||||
|
||||
static short mgif_accnums[2];
|
||||
static long mgif_writepos;
|
||||
static int32_t mgif_writepos;
|
||||
|
||||
static void *OpenMGFFile(const char *filename)
|
||||
{
|
||||
mgif_file=CreateFile(filename,GENERIC_READ,FILE_SHARE_READ,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL|FILE_FLAG_SEQUENTIAL_SCAN,NULL);
|
||||
if (mgif_file==INVALID_HANDLE_VALUE) return NULL;
|
||||
mapped_mgif=CreateFileMapping(mgif_file,NULL,PAGE_READONLY,0,0,NULL);
|
||||
if (mapped_mgif==INVALID_HANDLE_VALUE) return NULL;
|
||||
return MapViewOfFile(mapped_mgif,FILE_MAP_READ,0,0,0);
|
||||
}
|
||||
|
||||
static word *paleta;
|
||||
|
||||
|
@ -30,14 +19,14 @@ static word *picture;
|
|||
static word *anim_render_buffer;
|
||||
static void *sound;
|
||||
|
||||
static void StretchImageHQ(word *src, word *trg, unsigned long linelen, char full)
|
||||
static void StretchImageHQ(word *src, word *trg, uint32_t linelen, char full)
|
||||
{
|
||||
word xs=src[0],ys=src[1];
|
||||
word *s,*t;
|
||||
int x,y;
|
||||
src+=3;
|
||||
for (y=0,s=src,t=trg;y<ys;y++,t+=linelen*2,s+=xs)
|
||||
for (x=0;x<xs;x++)
|
||||
src+=3;
|
||||
for (y=0,s=src,t=trg;y<ys;y++,t+=linelen*2,s+=xs)
|
||||
for (x=0;x<xs;x++)
|
||||
{
|
||||
word val;
|
||||
t[x*2]=s[x]+(s[x]&0x7fe0);
|
||||
|
@ -77,37 +66,25 @@ static void PlayMGFFile(void *file, MGIF_PROC proc,int ypos,char full)
|
|||
mgif_header=(MGIF_HEADER_T *)file;
|
||||
file=open_mgif(file);
|
||||
if (file==NULL) return;
|
||||
while (file)
|
||||
while (file)
|
||||
{
|
||||
__try
|
||||
{
|
||||
file=mgif_play(file);
|
||||
}
|
||||
__except(1)
|
||||
{
|
||||
SEND_LOG("(PLAYANIM) Exception raised",0,0);
|
||||
file=NULL;
|
||||
}
|
||||
StretchImageHQ(picture, GetScreenAdr()+ypos*scr_linelen2, scr_linelen2,full);
|
||||
showview(0,ypos,0,360);
|
||||
if (_bios_keybrd(_KEYBRD_READY)==0) mix_back_sound(0);
|
||||
else
|
||||
{
|
||||
_bios_keybrd(_KEYBRD_READ);
|
||||
break;
|
||||
file=mgif_play(file);
|
||||
StretchImageHQ(picture, GetScreenAdr()+ypos*scr_linelen2, scr_linelen2,full);
|
||||
showview(0,ypos,0,360);
|
||||
if (_bios_keybrd(_KEYBRD_READY)==0) {
|
||||
mix_back_sound(0);
|
||||
}
|
||||
else
|
||||
{
|
||||
_bios_keybrd(_KEYBRD_READ);
|
||||
break;
|
||||
}
|
||||
}
|
||||
close_mgif();
|
||||
close_mgif();
|
||||
DoneVideoSound(sound);
|
||||
free(picture);
|
||||
}
|
||||
|
||||
static void CloseMGFFile(void *file)
|
||||
{
|
||||
UnmapViewOfFile(file);
|
||||
CloseHandle(mapped_mgif);
|
||||
CloseHandle(mgif_file);
|
||||
}
|
||||
|
||||
void show_full_lfb12e(void *target,void *buff,void *paleta);
|
||||
void show_delta_lfb12e(void *target,void *buff,void *paleta);
|
||||
|
@ -123,18 +100,19 @@ void BigPlayProc(int act,void *data,int csize)
|
|||
case MGIF_COPY:show_full_lfb12e(anim_render_buffer,data,paleta);break;
|
||||
case MGIF_DELTA:show_delta_lfb12e(anim_render_buffer,data,paleta);break;
|
||||
case MGIF_PAL:paleta=data;break;
|
||||
case MGIF_SOUND:
|
||||
case MGIF_SOUND:
|
||||
while (LoadNextVideoFrame(sound,data,csize,mgif_header->ampl_table,mgif_accnums,&mgif_writepos)==0);
|
||||
}
|
||||
}
|
||||
|
||||
void play_animation(char *filename,char mode,int posy,char sound)
|
||||
{
|
||||
void *mgf=OpenMGFFile(filename);
|
||||
size_t sz;
|
||||
void *mgf=map_file_to_memory(filename, &sz);
|
||||
change_music(NULL);
|
||||
if (mgf==NULL) return;
|
||||
PlayMGFFile(mgf,BigPlayProc,posy,mode & 0x80);
|
||||
CloseMGFFile(mgf);
|
||||
unmap_file(mgf, sz);
|
||||
}
|
||||
|
||||
void set_title_list(char **titles)
|
||||
|
|
|
@ -98,8 +98,17 @@ void close_mgif() //dealokuje buffery pro prehravani
|
|||
}
|
||||
|
||||
|
||||
int input_code(void *source,long *bitepos,int bitsize,int mask)
|
||||
int input_code(void *source,int32_t *bitepos,int bitsize,int mask)
|
||||
{
|
||||
int32_t ofs = *bitepos >> 3;
|
||||
int32_t shf = *bitepos & 0x7;
|
||||
uint8_t *src = source;
|
||||
uint8_t val1 = src[ofs];
|
||||
uint8_t val2 = src[ofs+1];
|
||||
uint16_t val = val1 + val2 * 256;
|
||||
*bitepos+=bitsize;
|
||||
return val >> shf;
|
||||
/*
|
||||
__asm
|
||||
{
|
||||
mov esi,source
|
||||
|
@ -116,6 +125,7 @@ int input_code(void *source,long *bitepos,int bitsize,int mask)
|
|||
and eax,edx
|
||||
add [edi],ebx
|
||||
}
|
||||
*/
|
||||
}
|
||||
//#pragma aux input_code parm [esi][edi][ebx][edx]=\ value[eax] modify [ecx];
|
||||
|
||||
|
@ -135,9 +145,44 @@ int de_add_code(int group,int chr,int mask)
|
|||
}
|
||||
|
||||
|
||||
char fast_expand_code(int code,char **target)
|
||||
//#pragma aux fast_expand_code parm[eax][edi] modify [esi ecx] value [bl]
|
||||
int fast_expand_code(DOUBLE_S *compress_dic, int code,uint8_t **target, uint8_t *old_value)
|
||||
{
|
||||
|
||||
uint8_t out;
|
||||
uint8_t w;
|
||||
if (code >= 256) {
|
||||
|
||||
DOUBLE_S *pos = compress_dic+code;
|
||||
uint8_t *t = *target + pos->first;
|
||||
(**target) += pos->first+1;
|
||||
short len = pos->first;
|
||||
short group = pos->group;
|
||||
do{
|
||||
*t = pos->chr;
|
||||
--t;
|
||||
group = pos->group;
|
||||
pos = compress_dic+group;
|
||||
} while (group >= 256);
|
||||
w=(uint8_t)group;
|
||||
out = w;
|
||||
w += *old_value;
|
||||
*t = w;
|
||||
while (len) {
|
||||
++t;
|
||||
w = w + *t;
|
||||
*t = w;
|
||||
--len;
|
||||
}
|
||||
*old_value = w;
|
||||
} else {
|
||||
out = (uint8_t) code;
|
||||
w = out + *old_value;
|
||||
*old_value = w;
|
||||
**target = out;
|
||||
(*target)++;
|
||||
return code;
|
||||
}
|
||||
/*
|
||||
_asm
|
||||
{
|
||||
mov eax,code
|
||||
|
@ -149,20 +194,20 @@ char fast_expand_code(int code,char **target)
|
|||
inc dword ptr [edi]
|
||||
mov bl,al
|
||||
add al,old_value
|
||||
mov [esi],al
|
||||
mov [esi],al //esi - target ptr
|
||||
mov old_value,al
|
||||
jmp end
|
||||
expand:
|
||||
mov ebx,compress_dic
|
||||
lea ecx,[eax*8+ebx]
|
||||
movzx eax,short ptr [ecx+4]
|
||||
movzx eax,short ptr [ecx+4] // first
|
||||
add [edi],eax
|
||||
push eax
|
||||
mov esi,[edi]
|
||||
eloop:movzx eax,short ptr [ecx+2]
|
||||
mov esi,[edi] //esi - target ptr
|
||||
eloop:movzx eax,short ptr [ecx+2] // chr
|
||||
mov [esi],al
|
||||
dec esi
|
||||
movzx eax,short ptr [ecx]
|
||||
movzx eax,short ptr [ecx] //group
|
||||
lea ecx,[eax*8+ebx]
|
||||
cmp eax,256
|
||||
jnc eloop
|
||||
|
@ -180,12 +225,13 @@ elp2:inc esi
|
|||
end:
|
||||
movzx eax,bl
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
|
||||
void lzw_decode(void *source,char *target)
|
||||
{
|
||||
long bitpos=0;
|
||||
int32_t bitpos=0;
|
||||
register int code;
|
||||
int old,i;
|
||||
//int group,chr;
|
||||
|
@ -195,12 +241,13 @@ void lzw_decode(void *source,char *target)
|
|||
|
||||
for(i=0;i<LZW_MAX_CODES;i++) compress_dic[i].first=0;
|
||||
clear:
|
||||
old_value=0;
|
||||
uint8_t old_value=0;
|
||||
nextgroup=free_code;
|
||||
bitsize=init_bitsize;
|
||||
mask=(1<<bitsize)-1;
|
||||
code=input_code(source,&bitpos,bitsize,mask);
|
||||
old_first=fast_expand_code(code,&target);
|
||||
uint8_t *t = target;
|
||||
old_first=fast_expand_code(compress_dic,code,&t,&old_value);
|
||||
old=code;
|
||||
while ((code=input_code(source,&bitpos,bitsize,mask))!=end_code)
|
||||
{
|
||||
|
@ -210,7 +257,7 @@ void lzw_decode(void *source,char *target)
|
|||
}
|
||||
else if (code<nextgroup)
|
||||
{
|
||||
old_first=fast_expand_code(code,&target);
|
||||
old_first=fast_expand_code(compress_dic,code,&t,&old_value);
|
||||
//group=old;
|
||||
//chr=old_first;
|
||||
mask=de_add_code(old,old_first,mask);
|
||||
|
@ -221,7 +268,7 @@ void lzw_decode(void *source,char *target)
|
|||
//p.group=old;
|
||||
//p.chr=old_first;
|
||||
mask=de_add_code(old,old_first,mask);
|
||||
old_first=fast_expand_code(code,&target);
|
||||
old_first=fast_expand_code(compress_dic,code,&t, &old_value);
|
||||
old=code;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -25,7 +25,7 @@ typedef struct mgif_header
|
|||
char year[2];
|
||||
char eof;
|
||||
word ver;
|
||||
long frames;
|
||||
int32_t frames;
|
||||
word snd_chans;
|
||||
int snd_freq;
|
||||
short ampl_table[256];
|
||||
|
|
405
libs/mgifplaya.c
405
libs/mgifplaya.c
|
@ -4,105 +4,25 @@
|
|||
#include <bgraph.h>
|
||||
|
||||
|
||||
void show_full_lfb12e(void *target, void *buff, void *paleta) {
|
||||
uint16_t *edi = (uint16_t *)target;
|
||||
uint8_t *esi = (uint8_t *)buff;
|
||||
uint16_t *ebx = (uint16_t *)paleta;
|
||||
uint8_t dl = 180;
|
||||
|
||||
void show_full_interl_lfb(void *source,void *target,void *palette, long linelen)
|
||||
{
|
||||
int sslinelen=2*linelen-1280;
|
||||
__asm
|
||||
{
|
||||
mov edi,target
|
||||
mov esi,source
|
||||
mov ebx,palette
|
||||
;edi - target
|
||||
;esi - source
|
||||
;ebx - palette
|
||||
push ebp
|
||||
push sslinelen;
|
||||
mov dl,180
|
||||
shfif2: mov ecx,320
|
||||
shfif1: lodsb
|
||||
movzx eax,al
|
||||
movzx eax,short ptr [eax*2+ebx]
|
||||
mov ebp,eax
|
||||
shl eax,16
|
||||
or eax,ebp
|
||||
stosd
|
||||
dec ecx
|
||||
jnz shfif1
|
||||
add edi,[esp]
|
||||
dec dl
|
||||
jnz shfif2
|
||||
pop eax
|
||||
pop ebp
|
||||
}
|
||||
}
|
||||
//#pragma aux show_full_interl_lfb parm [esi][edi][ebx] modify [eax ecx edx]
|
||||
void show_delta_interl_lfb(void *source,void *target,void *palette, long linelen)
|
||||
{
|
||||
int sslinelen=2*linelen;
|
||||
__asm
|
||||
{
|
||||
mov edi,target
|
||||
mov esi,source
|
||||
mov ebx,palette
|
||||
;edi - target
|
||||
;esi - source
|
||||
;ebx - palette
|
||||
push ebp ;uchovej ebp
|
||||
push sslinelen
|
||||
mov cl,180 ;cl pocet zbyvajicich radek
|
||||
add esi,4 ;preskoc ukazatel
|
||||
mov edx,esi ;edx - zacatek delta mapy
|
||||
add esi,[esi-4] ;esi - zacatek dat
|
||||
shdif6: push edi ;uloz adresu radku
|
||||
shdif2: mov ch,[edx] ;cti _skip_ hodnotu
|
||||
mov al,ch
|
||||
inc edx
|
||||
or al,03fh ;test zda jsou 2 nejvyssi bity nastaveny
|
||||
inc al
|
||||
jz shdif3 ;ano - preskakovani radku
|
||||
movzx eax,ch ;expanduj _skip_ hodnotu do eax
|
||||
lea edi,[eax*8+edi] ;vypocti novou pozici na obrazovce
|
||||
mov ch,[edx] ;cti _copy_ hodnotu
|
||||
inc edx
|
||||
shdif1: lodsb ;vem bajt z datove oblasti
|
||||
movzx eax,al ;expanduj do eax
|
||||
movzx eax,short ptr[eax*2+ebx] ;expanduj hicolor barvu
|
||||
mov ebp,eax ;rozdvoj barvy
|
||||
shl ebp,16
|
||||
or eax,ebp
|
||||
stosd ;zapis dva body
|
||||
lodsb ;opakuj pro dalsi bod jeste jednou
|
||||
movzx eax,al
|
||||
movzx eax,short ptr[eax*2+ebx]
|
||||
mov ebp,eax
|
||||
shl ebp,16
|
||||
or eax,ebp
|
||||
stosd
|
||||
dec ch ;odecti _copy_ hodnotu
|
||||
jnz shdif1 ;dokud neni 0
|
||||
jmp shdif2 ;pokracuj _skip_ hodnotou
|
||||
shdif3: and ch,3fh ;odmaskuj hodni 2 bity
|
||||
pop edi ;obnov edi
|
||||
jnz shdif4 ;pokud je ch=0 preskoc jen jeden radek;
|
||||
add edi,[esp] ;preskoc radek
|
||||
dec cl ;odecti citac radku
|
||||
jnz shdif6 ;skok pokud neni konec
|
||||
pop ebp
|
||||
jmp konec ;navrat
|
||||
shdif4: inc ch ;pocet radek je ch+1
|
||||
sub cl,ch ;odecti ch od zbyvajicich radek
|
||||
jz shdif5 ;je-li nula tak konec
|
||||
shdif7: add edi,[esp] ;preskoc radek
|
||||
dec ch ;odecti ch
|
||||
jnz shdif7 ;preskakuj dokud neni 0
|
||||
jmp shdif6 ;cti dalsi _skip_
|
||||
shdif5: pop ebp
|
||||
konec:
|
||||
}
|
||||
}
|
||||
//#pragma aux show_delta_interl_lfb parm [esi][edi][ebx] modify [eax ecx edx]
|
||||
do {
|
||||
uint32_t ecx = 320;
|
||||
do {
|
||||
uint8_t value = *esi++;
|
||||
*edi++ = ebx[value];
|
||||
ecx--;
|
||||
} while (ecx != 0);
|
||||
dl--;
|
||||
} while (dl != 0);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
void show_full_lfb12e(void *target,void *buff,void *paleta)
|
||||
{
|
||||
__asm
|
||||
|
@ -130,164 +50,147 @@ shfl1: lodsw
|
|||
jnz shfl2
|
||||
pop ebp
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
/*
|
||||
void show_delta_lfb12e(void *target, void *buff, void *paleta) {
|
||||
uint8_t *edi = (uint8_t *)target;
|
||||
uint8_t *esi = (uint8_t *)buff + 4; // skip pointer
|
||||
uint8_t *ebx = (uint8_t *)paleta;
|
||||
uint8_t cl = 180; // remaining lines
|
||||
uint8_t ch, al;
|
||||
uint16_t *edx = (uint16_t *)esi; // start of delta map
|
||||
esi += *(uint32_t *)(esi - 4); // start of data
|
||||
|
||||
while (cl > 0) {
|
||||
uint8_t *line_address = edi; // save line address
|
||||
ch = *edx++; // read _skip_ value
|
||||
al = ch;
|
||||
al |= 0x3F; // test if the two highest bits are set
|
||||
al++;
|
||||
if (al == 0) { // if yes - skip lines
|
||||
ch &= 0x3F; // mask the upper 2 bits
|
||||
edi += (ch == 0) ? 640 : 0; // skip line if ch is 0
|
||||
cl--; // decrement line counter
|
||||
continue; // continue to next iteration
|
||||
}
|
||||
|
||||
uint32_t eax = (uint32_t)ch; // expand _skip_ value to eax
|
||||
edi += eax * 4; // calculate new position on screen
|
||||
ch = *edx++; // read _copy_ value
|
||||
|
||||
for (uint8_t i = 0; i < ch; i++) {
|
||||
uint16_t ebp = *(uint16_t *)(ebx + (al * 2)); // get color from palette
|
||||
uint16_t color = *(uint16_t *)(ebx + (eax * 2)); // get color from palette
|
||||
eax = (color << 16) | ebp; // combine colors
|
||||
*(uint32_t *)edi = eax; // store the color
|
||||
edi += 4; // move to the next pixel
|
||||
}
|
||||
edi += 640; // skip line
|
||||
cl--; // decrement line counter
|
||||
}
|
||||
}
|
||||
*/
|
||||
static __inline uint32_t read_uint32(uint8_t *from) {
|
||||
uint32_t a = from[0];
|
||||
uint32_t b = from[1];
|
||||
uint32_t c = from[2];
|
||||
uint32_t d = from[2];
|
||||
return a | (b << 8) | (c << 16) | (d << 24);
|
||||
}
|
||||
|
||||
//#pragma aux show_full_lfb12e parm[edi][esi][ebx] modify [eax ecx]
|
||||
void show_delta_lfb12e(void *target,void *buff,void *paleta)
|
||||
{
|
||||
__asm
|
||||
{
|
||||
mov edi,target
|
||||
mov esi,buff
|
||||
mov ebx,paleta
|
||||
;edi - target
|
||||
;esi - buff
|
||||
;ebx - paleta
|
||||
push ebp ;uchovej ebp
|
||||
mov cl,180 ;cl pocet zbyvajicich radek
|
||||
add esi,4 ;preskoc ukazatel
|
||||
mov edx,esi ;edx - zacatek delta mapy
|
||||
add esi,[esi-4] ;esi - zacatek dat
|
||||
shdl6: push edi ;uloz adresu radku
|
||||
shdl2: mov ch,[edx] ;cti _skip_ hodnotu
|
||||
mov al,ch
|
||||
inc edx
|
||||
or al,03fh ;test zda jsou 2 nejvyssi bity nastaveny
|
||||
inc al
|
||||
jz shdl3 ;ano - preskakovani radku
|
||||
movzx eax,ch ;expanduj _skip_ hodnotu do eax
|
||||
lea edi,[eax*4+edi] ;vypocti novou pozici na obrazovce
|
||||
mov ch,[edx] ;cti _copy_ hodnotu
|
||||
inc edx
|
||||
shdl1: lodsw
|
||||
movzx ebp,al
|
||||
movzx ebp,short ptr ds:[ebp*2+ebx]
|
||||
movzx eax,ah
|
||||
movzx eax,short ptr ds:[eax*2+ebx]
|
||||
shl eax,16
|
||||
or eax,ebp
|
||||
stosd
|
||||
dec ch ;odecti _copy_ hodnotu
|
||||
jnz shdl1 ;dokud neni 0
|
||||
jmp shdl2 ;pokracuj _skip_ hodnotou
|
||||
shdl3: and ch,3fh ;odmaskuj hodni 2 bity
|
||||
pop edi ;obnov edi
|
||||
jnz shdl4 ;pokud je ch=0 preskoc jen jeden radek;
|
||||
add edi,640 ;preskoc radek
|
||||
dec cl ;odecti citac radku
|
||||
jnz shdl6 ;skok pokud neni konec
|
||||
pop ebp
|
||||
jmp konec
|
||||
shdl4: inc ch ;pocet radek je ch+1
|
||||
sub cl,ch ;odecti ch od zbyvajicich radek
|
||||
jz shdl5 ;je-li nula tak konec
|
||||
shdl7: add edi,640 ;preskoc radek
|
||||
dec ch ;odecti ch
|
||||
jnz shdl7 ;preskakuj dokud neni 0
|
||||
jmp shdl6 ;cti dalsi _skip_
|
||||
shdl5: pop ebp
|
||||
konec:
|
||||
}
|
||||
}
|
||||
//#pragma aux show_delta_lfb12e parm[edi][esi][ebx] modify [eax ecx]
|
||||
{
|
||||
// __asm
|
||||
// {
|
||||
uint16_t *edi = target;
|
||||
// mov edi,target
|
||||
uint8_t *esi = buff;
|
||||
// mov esi,buff
|
||||
uint16_t *ebx = paleta;
|
||||
// mov ebx,paleta
|
||||
// ;edi - target
|
||||
// ;esi - buff
|
||||
// ;ebx - paleta
|
||||
// push ebp ;uchovej ebp
|
||||
uint8_t cl = 180;
|
||||
// mov cl,180 ;cl pocet zbyvajicich radek
|
||||
uint32_t offset = read_uint32(esi);
|
||||
// add esi,4 ;preskoc ukazatel
|
||||
esi += 4;
|
||||
uint8_t *edx = esi;
|
||||
// mov edx,esi ;edx - zacatek delta mapy
|
||||
uint8_t *data = (esi + offset);
|
||||
// add esi,[esi-4] ;esi - zacatek dat
|
||||
uint16_t *line_beg = edi;
|
||||
//shdl6: push edi ;uloz adresu radku
|
||||
while (cl>0) {
|
||||
uint8_t ch = *edx++;
|
||||
//shdl2: mov ch,[edx] ;cti _skip_ hodnotu
|
||||
// mov al,ch
|
||||
// inc edx
|
||||
// or al,03fh ;test zda jsou 2 nejvyssi bity nastaveny
|
||||
// inc al
|
||||
if ((ch & 0xC0) == 0) {
|
||||
// jz shdl3 ;ano - preskakovani radku
|
||||
edi += ((uint32_t)ch) << 1;
|
||||
// movzx eax,ch ;expanduj _skip_ hodnotu do eax
|
||||
// lea edi,[eax*4+edi] ;vypocti novou pozici na obrazovce
|
||||
ch = *edx++;
|
||||
// mov ch,[edx] ;cti _copy_ hodnotu
|
||||
// inc edx
|
||||
|
||||
void show_full_lfb12e_dx(void *target,void *buff,void *paleta)
|
||||
{
|
||||
__asm
|
||||
{
|
||||
mov edi,target
|
||||
mov esi,buff
|
||||
mov ebx,paleta
|
||||
;edi - target
|
||||
;esi - source
|
||||
;ebx - palette
|
||||
push ebp
|
||||
mov eax,scr_linelen
|
||||
sub eax,640
|
||||
push eax
|
||||
mov dl,180
|
||||
shfl2: mov ecx,160
|
||||
shfl1: lodsw
|
||||
movzx ebp,al
|
||||
movzx ebp,short ptr ds:[ebp*2+ebx]
|
||||
movzx eax,ah
|
||||
movzx eax,short ptr ds:[eax*2+ebx]
|
||||
shl eax,16
|
||||
or eax,ebp
|
||||
mov ebp,eax
|
||||
and ebp,0x7fe07fe0
|
||||
add eax,ebp
|
||||
stosd
|
||||
dec ecx
|
||||
jnz shfl1
|
||||
add edi,[esp]
|
||||
dec dl
|
||||
jnz shfl2
|
||||
pop eax
|
||||
pop ebp
|
||||
while (ch) {
|
||||
uint8_t a = *data++;
|
||||
*edi++ = ebx[a];
|
||||
a = *data++;
|
||||
*edi++ = ebx[a];
|
||||
--ch;
|
||||
}
|
||||
|
||||
//shdl1: lodsw
|
||||
// movzx ebp,al
|
||||
// movzx ebp,short ptr ds:[ebp*2+ebx]
|
||||
// movzx eax,ah
|
||||
// movzx eax,short ptr ds:[eax*2+ebx]
|
||||
// shl eax,16
|
||||
// or eax,ebp
|
||||
// stosd
|
||||
// dec ch ;odecti _copy_ hodnotu
|
||||
// jnz shdl1 ;dokud neni 0
|
||||
// jmp shdl2 ;pokracuj _skip_ hodnotou
|
||||
} else {
|
||||
ch &= 0x3F;
|
||||
++ch;
|
||||
if (ch > cl) ch = cl;
|
||||
line_beg += 320*ch;
|
||||
cl -= ch;
|
||||
edi = line_beg;
|
||||
}
|
||||
|
||||
//shdl3: and ch,3fh ;odmaskuj hodni 2 bity
|
||||
// pop edi ;obnov edi
|
||||
// jnz shdl4 ;pokud je ch=0 preskoc jen jeden radek;
|
||||
// add edi,640 ;preskoc radek
|
||||
// dec cl ;odecti citac radku
|
||||
// jnz shdl6 ;skok pokud neni konec
|
||||
// pop ebp
|
||||
// jmp konec
|
||||
//shdl4: inc ch ;pocet radek je ch+1
|
||||
// sub cl,ch ;odecti ch od zbyvajicich radek
|
||||
// jz shdl5 ;je-li nula tak konec
|
||||
//shdl7: add edi,640 ;preskoc radek
|
||||
// dec ch ;odecti ch
|
||||
// jnz shdl7 ;preskakuj dokud neni 0
|
||||
// jmp shdl6 ;cti dalsi _skip_
|
||||
//shdl5: pop ebp
|
||||
}
|
||||
}
|
||||
//#pragma aux show_full_lfb12e parm[edi][esi][ebx] modify [eax ecx]
|
||||
void show_delta_lfb12e_dx(void *target,void *buff,void *paleta,unsigned long Pitch)
|
||||
{
|
||||
__asm
|
||||
{
|
||||
mov edi,target
|
||||
mov esi,buff
|
||||
mov ebx,paleta
|
||||
;edi - target
|
||||
;esi - buff
|
||||
;ebx - paleta
|
||||
push ebp ;uchovej ebp
|
||||
mov eax,scr_linelen
|
||||
sub eax,640
|
||||
push eax
|
||||
mov cl,180 ;cl pocet zbyvajicich radek
|
||||
add esi,4 ;preskoc ukazatel
|
||||
mov edx,esi ;edx - zacatek delta mapy
|
||||
add esi,[esi-4] ;esi - zacatek dat
|
||||
shdl6: push edi ;uloz adresu radku
|
||||
shdl2: mov ch,[edx] ;cti _skip_ hodnotu
|
||||
mov al,ch
|
||||
inc edx
|
||||
or al,03fh ;test zda jsou 2 nejvyssi bity nastaveny
|
||||
inc al
|
||||
jz shdl3 ;ano - preskakovani radku
|
||||
movzx eax,ch ;expanduj _skip_ hodnotu do eax
|
||||
lea edi,[eax*4+edi] ;vypocti novou pozici na obrazovce
|
||||
mov ch,[edx] ;cti _copy_ hodnotu
|
||||
inc edx
|
||||
shdl1: lodsw
|
||||
movzx ebp,al
|
||||
movzx ebp,short ptr ds:[ebp*2+ebx]
|
||||
movzx eax,ah
|
||||
movzx eax,short ptr ds:[eax*2+ebx]
|
||||
shl eax,16
|
||||
or eax,ebp
|
||||
mov ebp,eax
|
||||
and ebp,0x7fe07fe0
|
||||
add eax,ebp
|
||||
stosd
|
||||
dec ch ;odecti _copy_ hodnotu
|
||||
jnz shdl1 ;dokud neni 0
|
||||
jmp shdl2 ;pokracuj _skip_ hodnotou
|
||||
shdl3: and ch,3fh ;odmaskuj hodni 2 bity
|
||||
pop edi ;obnov edi
|
||||
jnz shdl4 ;pokud je ch=0 preskoc jen jeden radek;
|
||||
add edi,scr_linelen ;preskoc radek
|
||||
dec cl ;odecti citac radku
|
||||
jnz shdl6 ;skok pokud neni konec
|
||||
jmp shdl5
|
||||
shdl4: inc ch ;pocet radek je ch+1
|
||||
sub cl,ch ;odecti ch od zbyvajicich radek
|
||||
jz shdl5 ;je-li nula tak konec
|
||||
shdl7: add edi,scr_linelen ;preskoc radek
|
||||
dec ch ;odecti ch
|
||||
jnz shdl7 ;preskakuj dokud neni 0
|
||||
jmp shdl6 ;cti dalsi _skip_
|
||||
shdl5: pop eax
|
||||
pop ebp
|
||||
}
|
||||
}
|
||||
//konec:
|
||||
// }
|
||||
// }
|
||||
}
|
||||
//#pragma aux show_delta_lfb12e parm[edi][esi][ebx] modify [eax ecx]
|
||||
|
||||
char test_next_frame(void *bufpos,int size)
|
||||
{
|
||||
|
|
|
@ -16,7 +16,7 @@ char load_rm_proc(void);
|
|||
char purge_rm_proc(void);
|
||||
#pragma aux purge_rm_proc modify [edx eax] value [al]
|
||||
|
||||
void pc_speak_run(long s_freq,long sim_freq);
|
||||
void pc_speak_run(int32_t s_freq,int32_t sim_freq);
|
||||
#pragma aux pc_speak_run parm[eax][edx] modify [ecx ebx]
|
||||
|
||||
void pc_speak_stop(void);
|
||||
|
@ -28,10 +28,10 @@ void pc_speak_enable(void);
|
|||
void pc_speak_disable(void);
|
||||
#pragma aux pc_speak_enable modify [eax]
|
||||
|
||||
long pc_speak_position(void);
|
||||
int32_t pc_speak_position(void);
|
||||
#pragma aux pc_speak_position modify[eax ebx] value [eax]
|
||||
|
||||
void pc_speak_set_proc(long *c);
|
||||
void pc_speak_set_proc(int32_t *c);
|
||||
#pragma aux pc_speak_set_proc parm [edi]
|
||||
|
||||
/* Zde jsou nejake komentare */
|
||||
|
@ -101,18 +101,18 @@ void pc_speak_disable;
|
|||
|
||||
-------------------------------------------------------------------
|
||||
|
||||
long pc_speak_position(void);
|
||||
int32_t pc_speak_position(void);
|
||||
|
||||
Vstup: -
|
||||
Vystup: long offset do bufferu. Vraci prave preravanou pozici
|
||||
Komentar: sice vraci long, ale offset je v rozsahu <0-64Kb>. Vzhledem k
|
||||
Vystup: int32_t offset do bufferu. Vraci prave preravanou pozici
|
||||
Komentar: sice vraci int32_t, ale offset je v rozsahu <0-64Kb>. Vzhledem k
|
||||
casovym ztratam muze vracena pozice byt starsi uz v dobe
|
||||
predavani vysledku. Presnost zavisi na rychlosti pocitace.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
|
||||
void pc_speak_set_proc;
|
||||
Vstup: Ukazatel na ukazatel na void (ackoliv je tam long *)
|
||||
Vstup: Ukazatel na ukazatel na void (ackoliv je tam int32_t *)
|
||||
Vystup:-
|
||||
Komentar: Procedura modifikuje promennou kam ukazuje parametr tak aby
|
||||
obsahovala adresu na proceduru pc_speak_position.
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue