- [Psy-X] add extern "C" on every PSX header back

This commit is contained in:
Ilya Shurumov 2021-05-10 03:16:50 +06:00 committed by InspirationByte
parent a0d533ee8e
commit 718b456f26
16 changed files with 280 additions and 164 deletions

View File

@ -11,8 +11,8 @@
#include <libetc.h> #include <libetc.h>
#include <libapi.h> #include <libapi.h>
#include <gtemac.h>
#include <inline_c.h> #include <inline_c.h>
#include <gtemac.h>
#include <strings.h> #include <strings.h>
#include <rand.h> #include <rand.h>

View File

@ -5,6 +5,14 @@
#define ABS(x) fst_abs(x) #define ABS(x) fst_abs(x)
#endif #endif
#if defined(_LANGUAGE_C_PLUS_PLUS)||defined(__cplusplus)||defined(c_plusplus)
extern "C" {
#endif
extern int fst_abs(int x); extern int fst_abs(int x);
#if defined(_LANGUAGE_C_PLUS_PLUS)||defined(__cplusplus)||defined(c_plusplus)
}
#endif
#endif #endif

View File

@ -1,25 +1,34 @@
#ifndef INLINE_C_H #ifndef INLINE_C_H
#define INLINE_C_H #define INLINE_C_H
extern void gte_SetGeomScreen(int h); #if defined(_LANGUAGE_C_PLUS_PLUS)||defined(__cplusplus)||defined(c_plusplus)
extern "C" {
#endif
extern int docop2(int op); /* Psy-X specific calls */
// sets cop2 data register value. LWC2 is the same kind /* sets cop2 data register value. LWC2 is the same kind*/
void MTC2(unsigned int value, int reg); extern void MTC2(unsigned int value, int reg);
void MTC2_S(int value, int reg); extern void MTC2_S(int value, int reg);
// sets cop2 control register value /* sets cop2 control register value */
void CTC2(unsigned int value, int reg); extern void CTC2(unsigned int value, int reg);
void CTC2_S(int value, int reg); extern void CTC2_S(int value, int reg);
// returns cop2 register value. SWC2 is the same kind /* returns cop2 register value. SWC2 is the same kind */
unsigned int MFC2(int reg); extern unsigned int MFC2(int reg);
int MFC2_S(int reg); extern int MFC2_S(int reg);
// returns cop2 control register value /* returns cop2 control register value */
unsigned int CFC2(int reg); extern unsigned int CFC2(int reg);
int CFC2_S(int reg); extern int CFC2_S(int reg);
/* performs cop2 opcode */
extern int doCOP2(int op);
#if defined(_LANGUAGE_C_PLUS_PLUS)||defined(__cplusplus)||defined(c_plusplus)
}
#endif
/* /*
* Type 1 functions * Type 1 functions
@ -147,6 +156,10 @@ int CFC2_S(int reg);
MTC2(*(uint*)((char*)r0 + 4), 10);\ MTC2(*(uint*)((char*)r0 + 4), 10);\
MTC2(*(uint*)((char*)r0 + 8), 11);} MTC2(*(uint*)((char*)r0 + 8), 11);}
// ctc2 26
#define gte_SetGeomScreen( r0 ) \
{ CTC2(r0, 26); }
// ctc2 24,25 // ctc2 24,25
#define gte_SetGeomOffset( r0, r1 )\ #define gte_SetGeomOffset( r0, r1 )\
{ CTC2(r0 << 16, 24); \ { CTC2(r0 << 16, 24); \
@ -243,137 +256,137 @@ int CFC2_S(int reg);
#define gte_nop() #define gte_nop()
#define gte_rtps() docop2(0x0180001); #define gte_rtps() doCOP2(0x0180001);
#define gte_rtpt() docop2(0x0280030); #define gte_rtpt() doCOP2(0x0280030);
#define gte_rt() docop2(0x0480012); #define gte_rt() doCOP2(0x0480012);
#define gte_rtv0() docop2(0x0486012); #define gte_rtv0() doCOP2(0x0486012);
#define gte_rtv1() docop2(0x048E012); #define gte_rtv1() doCOP2(0x048E012);
#define gte_rtv2() docop2(0x0496012); #define gte_rtv2() doCOP2(0x0496012);
#define gte_rtir() docop2(0x049E012); #define gte_rtir() doCOP2(0x049E012);
#define gte_rtir_sf0() docop2(0x041E012); #define gte_rtir_sf0() doCOP2(0x041E012);
#define gte_rtv0tr() docop2(0x0480012); #define gte_rtv0tr() doCOP2(0x0480012);
#define gte_rtv1tr() docop2(0x0488012); #define gte_rtv1tr() doCOP2(0x0488012);
#define gte_rtv2tr() docop2(0x0490012); #define gte_rtv2tr() doCOP2(0x0490012);
#define gte_rtirtr() op2 0x0498012); #define gte_rtirtr() op2 0x0498012);
#define gte_rtv0bk() docop2(0x0482012); #define gte_rtv0bk() doCOP2(0x0482012);
#define gte_rtv1bk() docop2(0x048A012); #define gte_rtv1bk() doCOP2(0x048A012);
#define gte_rtv2bk() docop2(0x0492012); #define gte_rtv2bk() doCOP2(0x0492012);
#define gte_rtirbk() docop2(0x049A012); #define gte_rtirbk() doCOP2(0x049A012);
#define gte_ll() docop2(0x04A6412); #define gte_ll() doCOP2(0x04A6412);
#define gte_llv0() docop2(0x04A6012); #define gte_llv0() doCOP2(0x04A6012);
#define gte_llv1() docop2(0x04AE012); #define gte_llv1() doCOP2(0x04AE012);
#define gte_llv2() docop2(0x04B6012); #define gte_llv2() doCOP2(0x04B6012);
#define gte_llir() docop2(0x04BE012); #define gte_llir() doCOP2(0x04BE012);
#define gte_llv0tr() docop2(0x04A0012); #define gte_llv0tr() doCOP2(0x04A0012);
#define gte_llv1tr() docop2(0x04A8012); #define gte_llv1tr() doCOP2(0x04A8012);
#define gte_llv2tr() docop2(0x04B0012); #define gte_llv2tr() doCOP2(0x04B0012);
#define gte_llirtr() docop2(0x04B8012); #define gte_llirtr() doCOP2(0x04B8012);
#define gte_llv0bk() docop2(0x04A2012); #define gte_llv0bk() doCOP2(0x04A2012);
#define gte_llv1bk() docop2(0x4AA012); #define gte_llv1bk() doCOP2(0x4AA012);
#define gte_llv2bk() docop2(0x04B2012); #define gte_llv2bk() doCOP2(0x04B2012);
#define gte_llirbk() docop2(0x04BA012); #define gte_llirbk() doCOP2(0x04BA012);
#define gte_lc() docop2(0x04DA412); #define gte_lc() doCOP2(0x04DA412);
#define gte_lcv0() docop2(0x04C6012); #define gte_lcv0() doCOP2(0x04C6012);
#define gte_lcv1() docop2(0x04CE012); #define gte_lcv1() doCOP2(0x04CE012);
#define gte_lcv2() docop2(0x04D6012); #define gte_lcv2() doCOP2(0x04D6012);
#define gte_lcir() docop2(0x04DE012); #define gte_lcir() doCOP2(0x04DE012);
#define gte_lcv0tr() docop2(0x04C0012); #define gte_lcv0tr() doCOP2(0x04C0012);
#define gte_lcv1tr() docop2(0x04C8012); #define gte_lcv1tr() doCOP2(0x04C8012);
#define gte_lcv2tr() docop2(0x04D0012); #define gte_lcv2tr() doCOP2(0x04D0012);
#define gte_lcirtr() docop2(0x04D8012); #define gte_lcirtr() doCOP2(0x04D8012);
#define gte_lcv0bk() docop2(0x04C2012); #define gte_lcv0bk() doCOP2(0x04C2012);
#define gte_lcv1bk() docop2(0x04CA012); #define gte_lcv1bk() doCOP2(0x04CA012);
#define gte_lcv2bk() docop2(0x04D2012); #define gte_lcv2bk() doCOP2(0x04D2012);
#define gte_lcirbk() docop2(0x04DA012); #define gte_lcirbk() doCOP2(0x04DA012);
#define gte_dpcl() docop2(0x0680029); #define gte_dpcl() doCOP2(0x0680029);
#define gte_dpcs() docop2(0x0780010); #define gte_dpcs() doCOP2(0x0780010);
#define gte_dpct() docop2(0x0F8002A); #define gte_dpct() doCOP2(0x0F8002A);
#define gte_intpl() docop2(0x0980011); #define gte_intpl() doCOP2(0x0980011);
#define gte_sqr12() docop2(0x0A80428); #define gte_sqr12() doCOP2(0x0A80428);
#define gte_sqr0() docop2(0x0A00428); #define gte_sqr0() doCOP2(0x0A00428);
#define gte_ncs() docop2(0x0C8041E); #define gte_ncs() doCOP2(0x0C8041E);
#define gte_nct() docop2(0x0D80420); #define gte_nct() doCOP2(0x0D80420);
#define gte_ncds() docop2(0x0E80413); #define gte_ncds() doCOP2(0x0E80413);
#define gte_ncdt() docop2(0x0F80416); #define gte_ncdt() doCOP2(0x0F80416);
#define gte_nccs() docop2(0x0108041B); #define gte_nccs() doCOP2(0x0108041B);
#define gte_ncct() docop2(0x0118043F); #define gte_ncct() doCOP2(0x0118043F);
#define gte_cdp() docop2(0x01280414); #define gte_cdp() doCOP2(0x01280414);
#define gte_cc() docop2(0x0138041C); #define gte_cc() doCOP2(0x0138041C);
#define gte_nclip() docop2(0x01400006); #define gte_nclip() doCOP2(0x01400006);
#define gte_avsz3() docop2(0x0158002D); #define gte_avsz3() doCOP2(0x0158002D);
#define gte_avsz4() docop2(0x0168002E); #define gte_avsz4() doCOP2(0x0168002E);
#define gte_op12() docop2(0x0178000C); #define gte_op12() doCOP2(0x0178000C);
#define gte_op0() docop2(0x0170000C); #define gte_op0() doCOP2(0x0170000C);
#define gte_gpf12() docop2(0x0198003D); #define gte_gpf12() doCOP2(0x0198003D);
#define gte_gpf0() docop2(0x0190003D); #define gte_gpf0() doCOP2(0x0190003D);
#define gte_gpl12() docop2(0x01A8003E); #define gte_gpl12() doCOP2(0x01A8003E);
#define gte_gpl0() docop2(0x01A0003E0); #define gte_gpl0() doCOP2(0x01A0003E0);
#define gte_mvmva_core( r0 ) docop2(r0) #define gte_mvmva_core( r0 ) doCOP2(r0)
#define gte_mvmva(sf,mx,v,cv,lm) gte_mvmva_core( 0x0400012 | \ #define gte_mvmva(sf,mx,v,cv,lm) gte_mvmva_core( 0x0400012 | \
((sf)<<19) | ((mx)<<17) | ((v)<<15) | ((cv)<<13) | ((lm)<<10) ) ((sf)<<19) | ((mx)<<17) | ((v)<<15) | ((cv)<<13) | ((lm)<<10) )
@ -384,137 +397,137 @@ int CFC2_S(int reg);
*/ */
#define gte_rtps_b() docop2(0x0180001); #define gte_rtps_b() doCOP2(0x0180001);
#define gte_rtpt_b() docop2(0x0280030); #define gte_rtpt_b() doCOP2(0x0280030);
#define gte_rt_b() docop2(0x0480012); #define gte_rt_b() doCOP2(0x0480012);
#define gte_rtv0_b() docop2(0x0486012); #define gte_rtv0_b() doCOP2(0x0486012);
#define gte_rtv1_b() docop2(0x048E012); #define gte_rtv1_b() doCOP2(0x048E012);
#define gte_rtv2_b() docop2(0x0496012); #define gte_rtv2_b() doCOP2(0x0496012);
#define gte_rtir_b() docop2(0x049E012); #define gte_rtir_b() doCOP2(0x049E012);
#define gte_rtir_sf0_b() docop2(0x041E012); #define gte_rtir_sf0_b() doCOP2(0x041E012);
#define gte_rtv0tr_b() docop2(0x0480012); #define gte_rtv0tr_b() doCOP2(0x0480012);
#define gte_rtv1tr_b() docop2(0x0488012); #define gte_rtv1tr_b() doCOP2(0x0488012);
#define gte_rtv2tr_b() docop2(0x0490012); #define gte_rtv2tr_b() doCOP2(0x0490012);
#define gte_rtirtr_b() op2 0x0498012); #define gte_rtirtr_b() op2 0x0498012);
#define gte_rtv0bk_b() docop2(0x0482012); #define gte_rtv0bk_b() doCOP2(0x0482012);
#define gte_rtv1bk_b() docop2(0x048A012); #define gte_rtv1bk_b() doCOP2(0x048A012);
#define gte_rtv2bk_b() docop2(0x0492012); #define gte_rtv2bk_b() doCOP2(0x0492012);
#define gte_rtirbk_b() docop2(0x049A012); #define gte_rtirbk_b() doCOP2(0x049A012);
#define gte_ll_b() docop2(0x04A6412); #define gte_ll_b() doCOP2(0x04A6412);
#define gte_llv0_b() docop2(0x04A6012); #define gte_llv0_b() doCOP2(0x04A6012);
#define gte_llv1_b() docop2(0x04AE012); #define gte_llv1_b() doCOP2(0x04AE012);
#define gte_llv2_b() docop2(0x04B6012); #define gte_llv2_b() doCOP2(0x04B6012);
#define gte_llir_b() docop2(0x04BE012); #define gte_llir_b() doCOP2(0x04BE012);
#define gte_llv0tr_b() docop2(0x04A0012); #define gte_llv0tr_b() doCOP2(0x04A0012);
#define gte_llv1tr_b() docop2(0x04A8012); #define gte_llv1tr_b() doCOP2(0x04A8012);
#define gte_llv2tr_b() docop2(0x04B0012); #define gte_llv2tr_b() doCOP2(0x04B0012);
#define gte_llirtr_b() docop2(0x04B8012); #define gte_llirtr_b() doCOP2(0x04B8012);
#define gte_llv0bk_b() docop2(0x04A2012); #define gte_llv0bk_b() doCOP2(0x04A2012);
#define gte_llv1bk_b() docop2(0x4AA012); #define gte_llv1bk_b() doCOP2(0x4AA012);
#define gte_llv2bk_b() docop2(0x04B2012); #define gte_llv2bk_b() doCOP2(0x04B2012);
#define gte_llirbk_b() docop2(0x04BA012); #define gte_llirbk_b() doCOP2(0x04BA012);
#define gte_lc_b() docop2(0x04DA412); #define gte_lc_b() doCOP2(0x04DA412);
#define gte_lcv0_b() docop2(0x04C6012); #define gte_lcv0_b() doCOP2(0x04C6012);
#define gte_lcv1_b() docop2(0x04CE012); #define gte_lcv1_b() doCOP2(0x04CE012);
#define gte_lcv2_b() docop2(0x04D6012); #define gte_lcv2_b() doCOP2(0x04D6012);
#define gte_lcir_b() docop2(0x04DE012); #define gte_lcir_b() doCOP2(0x04DE012);
#define gte_lcv0tr_b() docop2(0x04C0012); #define gte_lcv0tr_b() doCOP2(0x04C0012);
#define gte_lcv1tr_b() docop2(0x04C8012); #define gte_lcv1tr_b() doCOP2(0x04C8012);
#define gte_lcv2tr_b() docop2(0x04D0012); #define gte_lcv2tr_b() doCOP2(0x04D0012);
#define gte_lcirtr_b() docop2(0x04D8012); #define gte_lcirtr_b() doCOP2(0x04D8012);
#define gte_lcv0bk_b() docop2(0x04C2012); #define gte_lcv0bk_b() doCOP2(0x04C2012);
#define gte_lcv1bk_b() docop2(0x04CA012); #define gte_lcv1bk_b() doCOP2(0x04CA012);
#define gte_lcv2bk_b() docop2(0x04D2012); #define gte_lcv2bk_b() doCOP2(0x04D2012);
#define gte_lcirbk_b() docop2(0x04DA012); #define gte_lcirbk_b() doCOP2(0x04DA012);
#define gte_dpcl_b() docop2(0x0680029); #define gte_dpcl_b() doCOP2(0x0680029);
#define gte_dpcs_b() docop2(0x0780010); #define gte_dpcs_b() doCOP2(0x0780010);
#define gte_dpct_b() docop2(0x0F8002A); #define gte_dpct_b() doCOP2(0x0F8002A);
#define gte_intpl_b() docop2(0x0980011); #define gte_intpl_b() doCOP2(0x0980011);
#define gte_sqr12_b() docop2(0x0A80428); #define gte_sqr12_b() doCOP2(0x0A80428);
#define gte_sqr0_b() docop2(0x0A00428); #define gte_sqr0_b() doCOP2(0x0A00428);
#define gte_ncs_b() docop2(0x0C8041E); #define gte_ncs_b() doCOP2(0x0C8041E);
#define gte_nct_b() docop2(0x0D80420); #define gte_nct_b() doCOP2(0x0D80420);
#define gte_ncds_b() docop2(0x0E80413); #define gte_ncds_b() doCOP2(0x0E80413);
#define gte_ncdt_b() docop2(0x0F80416); #define gte_ncdt_b() doCOP2(0x0F80416);
#define gte_nccs_b() docop2(0x0108041B); #define gte_nccs_b() doCOP2(0x0108041B);
#define gte_ncct_b() docop2(0x0118043F); #define gte_ncct_b() doCOP2(0x0118043F);
#define gte_cdp_b() docop2(0x01280414); #define gte_cdp_b() doCOP2(0x01280414);
#define gte_cc_b() docop2(0x0138041C); #define gte_cc_b() doCOP2(0x0138041C);
#define gte_nclip_b() docop2(0x01400006); #define gte_nclip_b() doCOP2(0x01400006);
#define gte_avsz3_b() docop2(0x0158002D); #define gte_avsz3_b() doCOP2(0x0158002D);
#define gte_avsz4_b() docop2(0x0168002E); #define gte_avsz4_b() doCOP2(0x0168002E);
#define gte_op12_b() docop2(0x0178000C); #define gte_op12_b() doCOP2(0x0178000C);
#define gte_op0_b() docop2(0x0170000C); #define gte_op0_b() doCOP2(0x0170000C);
#define gte_gpf12_b() docop2(0x0198003D); #define gte_gpf12_b() doCOP2(0x0198003D);
#define gte_gpf0_b() docop2(0x0190003D); #define gte_gpf0_b() doCOP2(0x0190003D);
#define gte_gpl12_b() docop2(0x01A8003E); #define gte_gpl12_b() doCOP2(0x01A8003E);
#define gte_gpl0_b() docop2(0x01A0003E0); #define gte_gpl0_b() doCOP2(0x01A0003E0);
#define gte_mvmva_core_b( r0 ) docop2(r0) #define gte_mvmva_core_b( r0 ) doCOP2(r0)
#define gte_mvmva_b(sf,mx,v,cv,lm) gte_mvmva_core_b( 0x0400012 | \ #define gte_mvmva_b(sf,mx,v,cv,lm) gte_mvmva_core_b( 0x0400012 | \
((sf)<<19) | ((mx)<<17) | ((v)<<15) | ((cv)<<13) | ((lm)<<10) ) ((sf)<<19) | ((mx)<<17) | ((v)<<15) | ((cv)<<13) | ((lm)<<10) )

View File

@ -1,10 +1,14 @@
#ifndef LIBAPI_H #ifndef LIBAPI_H
#define LIBAPI_H #define LIBAPI_H
#ifndef EMU_KERNEL_H #ifndef KERNEL_H
#include "kernel.h" #include "kernel.h"
#endif #endif
#if defined(_LANGUAGE_C_PLUS_PLUS)||defined(__cplusplus)||defined(c_plusplus)
extern "C" {
#endif
extern long SetRCnt(long spec, unsigned short target, long mode); extern long SetRCnt(long spec, unsigned short target, long mode);
extern long GetRCnt(long spec); extern long GetRCnt(long spec);
extern long ResetRCnt(long spec); extern long ResetRCnt(long spec);
@ -24,21 +28,23 @@ extern long OpenTh(long (*func)(), unsigned long , unsigned long);
extern int CloseTh(long unk00); extern int CloseTh(long unk00);
extern int ChangeTh(long unk00); extern int ChangeTh(long unk00);
/*
extern long open(char* unk00, unsigned long); extern long open(char* unk00, unsigned long);
extern long close(long unk00); extern long close(long unk00);
extern long lseek(long unk00, long, long); extern long lseek(long unk00, long, long);
extern long read(long unk00, void *, long); extern long read(long unk00, void *, long);
extern long write(long unk00, void *, long); extern long write(long unk00, void *, long);
extern long ioctl(long unk00, long, long); extern long ioctl(long unk00, long, long);
extern struct DIRENTRY* firstfile(char* unk00, struct DIRENTRY *); extern struct DIRENTRY* firstfile(char* unk00, struct DIRENTRY *);
extern struct DIRENTRY* nextfile(struct DIRENTRY* unk00); extern struct DIRENTRY* nextfile(struct DIRENTRY* unk00);
extern long erase(char* unk00); extern long erase(char* unk00);
extern long undelete(char* unk00); extern long undelete(char* unk00);
extern long format(char* unk00); extern long format(char* unk00);
extern long rename(char* unk00, char *); extern long rename(char* unk00, char *);
extern long cd(char* unk00); extern long cd(char* unk00);
*/
extern long LoadTest(char* unk00, struct EXEC *); extern long LoadTest(char* unk00, struct EXEC *);
extern long Load(char * unk00, struct EXEC *); extern long Load(char * unk00, struct EXEC *);
@ -69,9 +75,10 @@ extern unsigned long GetSysSp();
extern long SetConf(unsigned long,unsigned long,unsigned long); extern long SetConf(unsigned long,unsigned long,unsigned long);
extern void GetConf(unsigned long *,unsigned long *,unsigned long *); extern void GetConf(unsigned long *,unsigned long *,unsigned long *);
/*
extern long _get_errno(void); extern long _get_errno(void);
extern long _get_error(long); extern long _get_error(long);
*/
extern void SystemError( char, long); extern void SystemError( char, long);
extern void SetMem(long); extern void SetMem(long);
@ -101,4 +108,9 @@ extern long _card_write(long chan, long block, unsigned char *buf);
extern long _card_read(long chan, long block, unsigned char *buf); extern long _card_read(long chan, long block, unsigned char *buf);
extern long _card_format(long chan); extern long _card_format(long chan);
#if defined(_LANGUAGE_C_PLUS_PLUS)||defined(__cplusplus)||defined(c_plusplus)
}
#endif
#endif #endif

View File

@ -190,6 +190,11 @@ typedef struct {
#define StMOVIE_HEIGHT 0x09 #define StMOVIE_HEIGHT 0x09
#if defined(_LANGUAGE_C_PLUS_PLUS)||defined(__cplusplus)||defined(c_plusplus)
extern "C" {
#endif
void StSetRing(u_long *ring_addr,u_long ring_size); void StSetRing(u_long *ring_addr,u_long ring_size);
void StClearRing(void); void StClearRing(void);
void StUnSetRing(void); void StUnSetRing(void);
@ -244,4 +249,10 @@ int CdGetDiskType( void );
struct EXEC *CdReadExec(char *file); struct EXEC *CdReadExec(char *file);
void CdReadBreak( void ); void CdReadBreak( void );
#if defined(_LANGUAGE_C_PLUS_PLUS)||defined(__cplusplus)||defined(c_plusplus)
}
#endif
#endif #endif

View File

@ -33,12 +33,17 @@ extern int PadIdentifier;
#define _PAD(x,y) ((y)<<((x)<<4)) #define _PAD(x,y) ((y)<<((x)<<4))
extern char scratchData[1024];
#define getScratchAddr(offset) ((u_long *)(&scratchData+(offset)*4)) #define getScratchAddr(offset) ((u_long *)(&scratchData+(offset)*4))
#define MODE_NTSC 0 #define MODE_NTSC 0
#define MODE_PAL 1 #define MODE_PAL 1
#if defined(_LANGUAGE_C_PLUS_PLUS)||defined(__cplusplus)||defined(c_plusplus)
extern "C" {
#endif
extern char scratchData[1024];
extern int CheckCallback(void); extern int CheckCallback(void);
extern void PadInit(int mode); extern void PadInit(int mode);
extern int ResetCallback(void); extern int ResetCallback(void);
@ -52,6 +57,12 @@ extern u_long PadRead(int id);
extern void PadStop(void); extern void PadStop(void);
extern void(*vsync_callback)(void); extern void(*vsync_callback)(void);
#if defined(_LANGUAGE_C_PLUS_PLUS)||defined(__cplusplus)||defined(c_plusplus)
}
#endif
#endif #endif

View File

@ -716,6 +716,15 @@ typedef struct {
#pragma pack(pop) #pragma pack(pop)
#if defined(_LANGUAGE_C_PLUS_PLUS)||defined(__cplusplus)||defined(c_plusplus)
extern "C" {
#endif
#ifdef LoadImage
#undef LoadImage
#endif
/* /*
* Prototypes * Prototypes
*/ */
@ -836,7 +845,9 @@ extern void GetDrawEnv2(DR_ENV *p);
extern void SetPsyXTexture(DR_PSYX_TEX *p, uint grTextureId); extern void SetPsyXTexture(DR_PSYX_TEX *p, uint grTextureId);
extern DISPENV activeDispEnv;
extern DRAWENV activeDrawEnv; #if defined(_LANGUAGE_C_PLUS_PLUS)||defined(__cplusplus)||defined(c_plusplus)
}
#endif
#endif #endif

View File

@ -27,6 +27,10 @@ typedef struct { /* 2D short vector */
short vx, vy; short vx, vy;
} DVECTOR; } DVECTOR;
#if defined(_LANGUAGE_C_PLUS_PLUS)||defined(__cplusplus)||defined(c_plusplus)
extern "C" {
#endif
extern void InitGeom(); extern void InitGeom();
extern void SetGeomOffset(int ofx, int ofy); extern void SetGeomOffset(int ofx, int ofy);
extern void SetGeomScreen(int h); extern void SetGeomScreen(int h);
@ -81,4 +85,8 @@ extern int rsin(int a);
extern int rcos(int a); extern int rcos(int a);
extern long ratan2(long y, long x); extern long ratan2(long y, long x);
#if defined(_LANGUAGE_C_PLUS_PLUS)||defined(__cplusplus)||defined(c_plusplus)
}
#endif
#endif #endif

View File

@ -22,6 +22,10 @@ typedef void (*MemCB)( long cmds, long rslt );
#define McErrBlockFull (7) #define McErrBlockFull (7)
#define McErrExtend (0x8000) #define McErrExtend (0x8000)
#if defined(_LANGUAGE_C_PLUS_PLUS)||defined(__cplusplus)||defined(c_plusplus)
extern "C" {
#endif
extern void MemCardInit( long val ); extern void MemCardInit( long val );
extern void MemCardEnd( void ); extern void MemCardEnd( void );
extern void MemCardStart(void); extern void MemCardStart(void);
@ -42,4 +46,8 @@ extern long MemCardSync( long mode, long* cmds, long* rslt );
extern MemCB MemCardCallback( MemCB func ); extern MemCB MemCardCallback( MemCB func );
extern long MemCardGetDirentry( long chan, char* name, struct DIRENTRY* dir, long* files, long ofs, long max ); extern long MemCardGetDirentry( long chan, char* name, struct DIRENTRY* dir, long* files, long ofs, long max );
#if defined(_LANGUAGE_C_PLUS_PLUS)||defined(__cplusplus)||defined(c_plusplus)
}
#endif
#endif #endif

View File

@ -33,6 +33,10 @@ typedef struct PADRAW
unsigned char analog[4]; // size=4, offset=4 unsigned char analog[4]; // size=4, offset=4
} *LPPADRAW; } *LPPADRAW;
#if defined(_LANGUAGE_C_PLUS_PLUS)||defined(__cplusplus)||defined(c_plusplus)
extern "C" {
#endif
extern void PadInitDirect(unsigned char* pad1, unsigned char* pad2); extern void PadInitDirect(unsigned char* pad1, unsigned char* pad2);
extern void PadInitMtap(unsigned char* unk00, unsigned char* unk01); extern void PadInitMtap(unsigned char* unk00, unsigned char* unk01);
extern void PadInitGun(unsigned char* unk00, int unk01); extern void PadInitGun(unsigned char* unk00, int unk01);
@ -50,4 +54,8 @@ extern int PadSetActAlign(int port, unsigned char* table);
extern int PadSetMainMode(int socket, int offs, int lock); extern int PadSetMainMode(int socket, int offs, int lock);
extern void PadSetAct(int port, unsigned char* table, int len); extern void PadSetAct(int port, unsigned char* table, int len);
#if defined(_LANGUAGE_C_PLUS_PLUS)||defined(__cplusplus)||defined(c_plusplus)
}
#endif
#endif #endif

View File

@ -1,6 +1,10 @@
#ifndef LIBPRESS_H #ifndef LIBPRESS_H
#define LIBPRESS_H #define LIBPRESS_H
#if defined(_LANGUAGE_C_PLUS_PLUS)||defined(__cplusplus)||defined(c_plusplus)
extern "C" {
#endif
extern void DecDCTReset(int mode); extern void DecDCTReset(int mode);
extern int DecDCTBufSize(u_long *bs); extern int DecDCTBufSize(u_long *bs);
extern void DecDCTvlc(u_long *bs, u_long *buf); extern void DecDCTvlc(u_long *bs, u_long *buf);
@ -9,4 +13,9 @@ extern void DecDCTout(u_long *buf, int size);
extern int DecDCTinSync( int mode) ; extern int DecDCTinSync( int mode) ;
extern int DecDCToutSync( int mode) ; extern int DecDCToutSync( int mode) ;
#if defined(_LANGUAGE_C_PLUS_PLUS)||defined(__cplusplus)||defined(c_plusplus)
}
#endif
#endif #endif

View File

@ -3,6 +3,10 @@
#include <stdint.h> #include <stdint.h>
#if defined(_LANGUAGE_C_PLUS_PLUS)||defined(__cplusplus)||defined(c_plusplus)
extern "C" {
#endif
extern int PCinit(); extern int PCinit();
extern uintptr_t PCopen(char* name, int flags, int perms); extern uintptr_t PCopen(char* name, int flags, int perms);
extern int PCcreat(char* name, int perms); extern int PCcreat(char* name, int perms);
@ -11,4 +15,9 @@ extern int PCread(uintptr_t fd, char* buff, int len);
extern int PCwrite(uintptr_t fd, char* buff, int len); extern int PCwrite(uintptr_t fd, char* buff, int len);
extern int PCclose(uintptr_t fd); extern int PCclose(uintptr_t fd);
#if defined(_LANGUAGE_C_PLUS_PLUS)||defined(__cplusplus)||defined(c_plusplus)
}
#endif
#endif #endif

View File

@ -21,6 +21,9 @@
#include "PsyX/PsyX_render.h" #include "PsyX/PsyX_render.h"
extern DISPENV activeDispEnv;
extern DRAWENV activeDrawEnv;
#ifdef __EMSCRIPTEN__ #ifdef __EMSCRIPTEN__
int strcasecmp(const char* _l, const char* _r) int strcasecmp(const char* _l, const char* _r)
{ {

View File

@ -1,6 +1,7 @@
#include "PsyX_GTE.h" #include "PsyX_GTE.h"
#include "psx/gtereg.h"
#include "psx/libgte.h" #include "psx/libgte.h"
#include "psx/gtereg.h"
#include <math.h> #include <math.h>
@ -418,7 +419,7 @@ int GTE_RotTransPers(int idx, int lm)
return h_over_sz3; return h_over_sz3;
} }
int docop2(int op) int GTE_operator(int op)
{ {
int v; int v;
int lm; int lm;

View File

@ -180,7 +180,9 @@ int CFC2_S(int reg)
return gteRegs.CP2C.p[reg].sd; return gteRegs.CP2C.p[reg].sd;
} }
void gte_SetGeomScreen(int h) extern int GTE_operator(int);
int doCOP2(int op)
{ {
CTC2(*(uint*)&h, 26); return GTE_operator(op);
} }

View File

@ -20,6 +20,8 @@ extern "C"
} }
#endif //def WIN32 #endif //def WIN32
extern DISPENV activeDispEnv;
extern DRAWENV activeDrawEnv;
#if defined(RENDERER_OGL) #if defined(RENDERER_OGL)