Add rayman2 source files

This commit is contained in:
2024-09-18 02:33:44 +08:00
parent bcc093f8ed
commit fb036c54fd
14339 changed files with 2596224 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
/*********************************************************************************/
/* Struct.h : public header file for the CPA Timer library. Pentium Version */
/* Just the defintion of the structure used to store timer values */
/* Author : JENTEY F. */
/* Last update : 03/03/97 */
/*********************************************************************************/
#ifndef _TIMER_STRUCT_H
#define _TIMER_STRUCT_H
/* This structure store 64 bits values. Timer value are returned in this structure */
/* The m_ulHighPart isn't used for low precision timer. */
typedef struct _stTimerCount
{
u_long m_ulLowPart;
u_long m_ulHighPart;
} stTimerCount;
#endif

View File

@@ -0,0 +1,313 @@
/****************************************************************************/
/* Timer.h : header file for the CPA Timer library. */
/* Author : F.JENTEY */
/* Last update : 04/03/97 */
/****************************************************************************/
#ifndef _TIMER_H
#define _TIMER_H
/* Define a 16 bits unsigned type */
#ifndef u_short
#define u_short unsigned short
#endif
/* Define a 32 bits unsigned type */
#ifndef u_long
#define u_long unsigned long
#endif
#include "Struct.h"
#include "specif/counter.h"
/* Define prototype for event callback declaration */
typedef void (td_fn_vTimerEventCallback)();
typedef td_fn_vTimerEventCallback* td_p_fn_vTimerEventCallback;
/* Number of timer available */
#define C_uwTimerMaxCount 16
/* Define the timer state */
#define C_wTimerUnused 0
#define C_wTimerReady 1
#define C_wTimerRunning 2
#define C_wTimerStop 3
#define C_wTimerPaused 4
#define C_wTimerEvent 5
/*
tdsTimer : Contains informations for each timer.
*/
typedef struct _tdstTimer
{
/* Define the type of the timer */
short m_wTimerType;
/* Define the timer state */
short m_wTimerState;
/* Timer init value */
stTimerCount m_stTimerCount_InitValue;
/* Timer last access value */
stTimerCount m_stTimerCount_LastValue;
/* Timer total value */
stTimerCount m_stTimerCount_TotalValue;
/* Event timer Id if the timer is an event timer. */
u_long m_ulEventId;
/* A pointer to the callback function of the event */
td_p_fn_vTimerEventCallback m_p_fn_vEventCallback;
} tdstTimer;
/* All functions return a short value that should be compared with this constant */
#define C_wTimerError 32767
#define C_wTimerTrue 32766
#define C_wTimerFalse 32765
/* Define timer accuracy. Use this value with wTimerType parameter */
#define C_wTimerFrequencyLow 0
#define C_wTimerFrequencyMedium 1
#define C_wTimerFrequencyHigh 2
/* Value to use with the fn_wTimerCreateEvent function to specified if the */
/* callback function must be called one time only or periodically. */
#define C_ulTimerEventOneTime 0
#define C_ulTimerEventPeriodic 1
/**************************************/
#ifndef CPA_EXPORT
#if defined(CPA_WANTS_IMPORT)
#define CPA_EXPORT __declspec(dllimport)
#elif defined(CPA_WANTS_EXPORT)
#define CPA_EXPORT __declspec(dllexport)
#else
#define CPA_EXPORT
#endif
#endif
/**************************************/
/******************************************************/
/* Macro for old prototypes compatibilty */
/******************************************************/
#define fn_wTimerInitLibrary TMR_fn_wInitLibrary
#define fn_wTimerExitLibrary TMR_fn_wExitLibrary
#define fn_wTimerCreate(A) TMR_fn_wCreateTimer(A)
#define fn_wTimerStart(A) TMR_fn_wStartTimer(A)
#define fn_wTimerStop(A) TMR_fn_wStopTimer(A)
#define fn_wTimerRead(A,B) TMR_fn_wReadTimer(A,B)
#define fn_wTimerReset(A) TMR_fn_wResetTimer(A)
#define fn_wTimerDestroy(A) TMR_fn_wDestroyTimer(A)
#define fn_wTimerPause(A) TMR_fn_wPauseTimer(A)
#define fn_wTimerGetFrequency(A,B) TMR_fn_wGetTimerFrequency(A,B)
#define fn_wTimerDelay(A) TMR_fn_wWait(A)
#define fn_ulTimerDelayUnit(A) TMR_fn_ulGetWaitTickPerSecond(A)
#define fn_wTimerCreateEvent(A,B,C,D) TMR_fn_wCreateEvent(A,B,C,D)
#define fn_ulTimerFrameCycleNumber TMR_fn_ulFrameCycleNumber
#define fn_ulTimerMonitorFrequency TMR_fn_ulMonitorFrequency
/************************************************************************/
/* All functions return a short type value that must be compared with */
/* C_wTimerError. If there is an error, you can read the error code */
/* with the error management functions. */
/************************************************************************/
#if defined(__cplusplus)
extern "C"
{
/*
Makes some internal initializations.
In - nothing.
Ou - C_wTimerError if the function has failed and zero otherwise.
*/
CPA_EXPORT short __stdcall TMR_fn_wInitLibrary( void );
/*
Release the ressource the library has used.
In - nothing.
Out - nothing.
*/
CPA_EXPORT short __stdcall TMR_fn_wExitLibrary( void );
/*
This function create a timer and return an handle to this timer.The parameter
wTimerType define the resolution of the timer and must set to one of the
C_wTimerType Flag.
In - timer precision in wTimerType (must be one of the timer type flag).
Out - C_wTimerError or zero.
*/
CPA_EXPORT short __stdcall TMR_fn_wCreateTimer( short wTimerType );
/*
Start a timer.
In - the handle of the timer to start in wTimerType.
Out - C_wTimerError or zero.
*/
CPA_EXPORT short __stdcall TMR_fn_wStartTimer( short wTimerHandle );
/*
Stop a Timer.
In - the handle of the timer to stop in wTimerType.
Out - C_wTimerError or zero.
*/
CPA_EXPORT short __stdcall TMR_fn_wStopTimer( short wTimerHandle );
/*
Read a timer count.
In - the handle of the timer to read in wTimerType.
- a pointer to a stTimerCount structure to be filled with the value
of the timer in p_ulFrequency.
Out - C_wTimerError or zero.
*/
CPA_EXPORT short __stdcall TMR_fn_wReadTimer( short wTimerHandle, stTimerCount *p_stTimerState );
/*
Reset a timer.
In - the handle of the timer to reset in wTimerType.
Out - C_wTimerError or zero.
*/
CPA_EXPORT short __stdcall TMR_fn_wResetTimer( short wTimerHandle );
/*
Set a timer with a specific value. Afeter a call of this function the Timer is paused.
In - the handle of the timer to reset in wTimerType.
Out - C_wTimerError or zero.
*/
CPA_EXPORT short __stdcall TMR_fn_wSetTimerValue( short wTimerHandle, stTimerCount *p_stValue );
/*
Pause a timer.
In - the handle of the timer to reset in wTimerType.
Out - C_wTimerError or zero.
*/
CPA_EXPORT short __stdcall TMR_fn_wPauseTimer( short wTimerHandle );
/*
Destroy a timer.
In - the handle of the timer to destroy in wTimerType.TMR_fn_wPauseTimer
Out - C_wTimerError or zero.
*/
CPA_EXPORT short __stdcall TMR_fn_wDestroyTimer( short wTimerHandle );
/*
Give the precision of a timer.
In - the handle of the timer to query in wTimerType.
- a pointer to an u_long to be filled with the timer frequency in
p_ulFrequency.
Out - C_wTimerError or zero.
*/
CPA_EXPORT short __stdcall TMR_fn_wGetTimerFrequency( short wTimerHandle , u_long *p_ulFrequency );
/*
This function waits a given length. Th time unit should be the thousandth of second
but check it with the next function.
In - time to wait in ulTimeToWait
Out - Nothing.
*/
CPA_EXPORT short __stdcall TMR_fn_wWait( u_long ulTimeToWait );
/*
This function returns the time unit of the fn_wTimerDelay function.
In - a pointer to an u_long to be filled with the time unit.
Out - nothing.
*/
CPA_EXPORT short __stdcall TMR_fn_ulGetWaitTickPerSecond(u_long *p_ulWaitFrequency);
/*
This function create a callback timer.
In - the period at the end of which the callback function will be called
in ulPeriod.
- a pointer to the callback function in p_fn_vEventCallback.
- the timer accuracy in wTimerType.
- tell if the callback function must be called periodically or just
one time in ulTimerEventType.
Out - C_wTimerError or zero.
*/
CPA_EXPORT short __stdcall TMR_fn_wCreateEvent(
u_long ulPeriod,
td_p_fn_vTimerEventCallback p_fn_vEventCallback,
short wTimerType,
u_long ulTimerEventType
);
/*
This function return the length of a frame. The units length is the tick
of a C_wTimerFrequencyHigh timer type (so the return value is the number CPU cycle).
Return 0 if an error occured.
In - nothing.
Out - an u_long value containing the number of cpu cycle of a frame.
*/
CPA_EXPORT u_long __stdcall TMR_fn_ulFrameCycleNumber( void );
/*
Return the monitor frequency multiples by 100. Return 0 the function can't
find the refresh rate.
In - nothing.
Out - an u_long value containing the video display mode vertical frequency.
*/
CPA_EXPORT u_long __stdcall TMR_fn_ulMonitorFrequency( void );
}
#else /* C prototype */
extern CPA_EXPORT short __stdcall TMR_fn_wInitLibrary( void );
extern CPA_EXPORT short __stdcall TMR_fn_wExitLibrary( void );
extern CPA_EXPORT short __stdcall TMR_fn_wCreateTimer( short wTimerType );
extern CPA_EXPORT short __stdcall TMR_fn_wStartTimer( short wTimerHandle );
extern CPA_EXPORT short __stdcall TMR_fn_wStopTimer( short wTimerHandle );
extern CPA_EXPORT short __stdcall TMR_fn_wReadTimer( short wTimerHandle, stTimerCount *p_stTimerState );
extern CPA_EXPORT short __stdcall TMR_fn_wResetTimer( short wTimerHandle );
extern CPA_EXPORT short __stdcall TMR_fn_wSetTimerValue( short wTimerHandle, stTimerCount *p_stValue );
extern CPA_EXPORT short __stdcall TMR_fn_wDestroyTimer( short wTimerHandle );
extern CPA_EXPORT short __stdcall TMR_fn_wPauseTimer( short wTimerHandle );
extern CPA_EXPORT short __stdcall TMR_fn_wGetTimerFrequency( short wTimerHandle , u_long *p_ulFrequency );
extern CPA_EXPORT short __stdcall TMR_fn_wWait( u_long ulTimeToWait );
extern CPA_EXPORT short __stdcall TMR_fn_ulGetWaitTickPerSecond(u_long *p_ulWaitFrequency);
extern CPA_EXPORT short __stdcall TMR_fn_wCreateEvent( u_long ulPeriod,
td_p_fn_vTimerEventCallback p_fn_vEventCallback,
short wTimerType,
u_long ulTimerEventType
);
extern CPA_EXPORT u_long __stdcall TMR_fn_ulFrameCycleNumber( void );
extern CPA_EXPORT u_long __stdcall TMR_fn_ulMonitorFrequency( void );
#endif
#endif

Binary file not shown.

View File

@@ -0,0 +1,143 @@
/*///////////////////////////////////////////////////////////*/
/**/
/* Management of the Module : Tmr*/
/**/
/* File Name : ErrTmr.h*/
/* Date : 07/03/97*/
/* Author : Francis Jentey*/
/**/
/*///////////////////////////////////////////////////////////*/
/**/
/* abbreviation of the module-name. Used in macro is 'Tmr'*/
/**/
/*///////////////////////////////////////////////////////////*/
#ifndef __ERRTmr_H__
#define __ERRTmr_H__
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#define C_szTmrVersion "Tmr V5.0.2" /* The format is Tmr Va.b.c with Tmr is the Tag of the module */
#define C_szTmrFullName "Module Timer"/* the complete and clear name of the module */
#define C_szTmrDate "Apr 22 1997" /*The format is "Mmm dd yyyy".You can use __DATE__ but be careful that you have the control of the compilation*/
/* For DLLs who are using this module : */
#undef CPA_EXPORT
#if defined(CPA_WANTS_IMPORT)
#define CPA_EXPORT __declspec(dllimport)
#elif defined(CPA_WANTS_EXPORT)
#define CPA_EXPORT __declspec(dllexport)
#else
#define CPA_EXPORT
#endif
#include "ERM.h"
#define __FATAL_ERR_Tmr__
#define __WARNING1_ERR_Tmr__
#define __WARNING2_ERR_Tmr__
#define __WARNING3_ERR_Tmr__
/*----------*/
/* Constant */
/*----------*/
/* error of the Tmr Module*/
typedef enum e_uwTmrErrNumber_{
E_uwTmrFatalErr,
#ifdef __FATAL_ERR_Tmr__
/* -----------------*/
#endif /*__FATAL_ERR_Tmr__*/
E_uwTmrStartOfWarning,/* important constant, it allows to recognize if an error is fatal or not.*/
#ifdef __WARNING1_ERR_Tmr__
/* -------------------*/
E_uwTmrLibraryNotInitialized,
E_uwTmrInvalidType,
E_uwTmrTypeNotAvailable,
E_uwTmrInvalidHandle,
E_uwTmrInvalidForEventTimer,
E_uwTmrMaxTimerCountReached,
E_uwTmrTimerNotReady,
/*E_uwTmrStartTimerFirst,*/
E_uwTmrCreateEventFailed,
#endif /*__WARNING1_ERR_Tmr__*/
#ifdef __WARNING2_ERR_Tmr__
/* -------------------*/
#endif /*__WARNING2_ERR_Tmr__*/
#ifdef __WARNING3_ERR_Tmr__
/* -------------------*/
#endif /*__WARNING3_ERR_Tmr__*/
E_uwTmrErrNumber
} e_uwTmrErrNumber;
/*------------------*/
/* Global Variables*/
/*------------------*/
#undef __ERRTmr_EXTERN
#ifndef __DeclareGlobalVariableErrTmr_h__
#define __ERRTmr_EXTERN extern /*external declaration*/
#else /*__DeclareGlobalVariableErrTmr_h__*/
#define __ERRTmr_EXTERN /*replace by nothing : we have to declare*/
#endif /*__DeclareGlobalVariableErrTmr_h__*/
__ERRTmr_EXTERN CPA_EXPORT unsigned char g_ucTmrModuleId /*number of identification of the Erm module*/
#if defined(__DeclareGlobalVariableErrTmr_h__) && !defined(CPA_WANTS_IMPORT)
= C_ucModuleNotInitialized
#endif /*__DeclareGlobalVariableErrTmr_h__&& CPA_WANTS_IMPORT*/
;
#ifdef __ERROR_STRINGS__
__ERRTmr_EXTERN CPA_EXPORT char * g_a_szTmrInformationModule []
#if defined(__DeclareGlobalVariableErrTmr_h__) && !defined(CPA_WANTS_IMPORT)
= {C_szTmrVersion, C_szTmrFullName, C_szTmrDate}
#endif /*__DeclareGlobalVariableErrTmr_h__ && CPA_WANTS_IMPORT*/
;
__ERRTmr_EXTERN CPA_EXPORT char * g_szTmrModuleName /* Mandatory syntax 'g_sz'+[Abbreviation of ModuleName]+'ModuleName'*/
#if defined(__DeclareGlobalVariableErrTmr_h__) && !defined(CPA_WANTS_IMPORT)
= "Module Tmr"
#endif /*__DeclareGlobalVariableErrTmr_h__ && CPA_WANTS_IMPORT*/
;
__ERRTmr_EXTERN CPA_EXPORT struct tdstErrorMsg_ g_a_stTmrTabErr [] /* Mandatory syntax 'g_a_st'+[Abbreviation of ModuleName]+'TabErr'*/
#if defined(__DeclareGlobalVariableErrTmr_h__) && !defined(CPA_WANTS_IMPORT)
={
#ifdef __FATAL_ERR_Tmr__
/* -------------*/
#endif /*__FATAL_ERR_Tmr__*/
#ifdef __WARNING1_ERR_Tmr__
/* ----------------*/
E_uwTmrLibraryNotInitialized , "The Timer.lib isn't initialize. See fn_wTimerInitLibrary.",
E_uwTmrInvalidType , "You specified an unknow timer type.",
E_uwTmrTypeNotAvailable , "This timer type isn't supported. Try a lower precision.",
E_uwTmrInvalidHandle , "Unknow timer handle.",
E_uwTmrInvalidForEventTimer , "Event timer can't be start, stop or reset.",
E_uwTmrMaxTimerCountReached , "Too many timer. The library support a fix count of timer.",
E_uwTmrTimerNotReady , "The timer isn't ready. Try to the fn_wTimerResetTimer before.",
/*E_uwTmrStartTimerFirst , "The timer must be started before.",*/
E_uwTmrCreateEventFailed , "The system is unable to create an event!",
#endif /*__WARNING1_ERR_Tmr__*/
#ifdef __WARNING2_ERR_Tmr__
/* ----------------*/
#endif /*__WARNING2_ERR_Tmr__*/
#ifdef __WARNING3_ERR_Tmr__
/* ----------------*/
#endif /*__WARNING3_ERR_Tmr__*/
0xFFFF, "\0"/*fin*/
}
#endif /*__DeclareGlobalVariableErrTmr_h__ && CPA_WANTS_IMPORT*/
;
#endif /*__ERROR_STRINGS__*/
#ifdef __cplusplus
};
#endif /* __cplusplus */
#endif /*__ERRTmr_H__*/

View File

@@ -0,0 +1,45 @@
/***********************************************************************************/
/* counter.h : Specific header file for the CPA Timer library. Pentium Version */
/* Author : FBF */
/* Last update : 15/04/98 */
/***********************************************************************************/
#ifndef _TIMER_SPECIF_H
#define _TIMER_SPECIF_H
/* FBf 15.04.98 fast inline function to return the internal pentium counter */
#ifndef WATCOM
#if defined(__cplusplus)
extern "C"
{
#endif
/******** VISUAL 5 ************/
#pragma warning (disable : 4035) /* To prevent from displaying the 'no return value' warning message*/
#define RDTSC __asm _emit 0x0F __asm _emit 0x31
__inline unsigned long __fastcall TMR_fn_ulFastGetInternalCounter()
{
__asm
{
push edx
RDTSC
pop edx
}
}
#pragma warning (default : 4035)
#if defined(__cplusplus)
}
#endif
#endif /*watcom*/
#endif /*_timer_specif_h*/