Push to git

This commit is contained in:
2025-01-08 09:59:16 -06:00
parent 36d985cc57
commit dad571f169
28 changed files with 983 additions and 181 deletions

View File

@ -1,4 +1,5 @@
#include "CrossLang.hpp"
#if defined(GEKKO)
#include <ogcsys.h>
#include <gccore.h>
@ -9,9 +10,60 @@
#endif
namespace Tesses::CrossLang
{
#if defined(GEKKO)
#if defined(HW_RVL)
static TObject OGC_WPAD_ScanPads(GCList& ls, std::vector<TObject> args)
{
return (int64_t)WPAD_ScanPads();
}
static TObject OGC_WPAD_ButtonsUp(GCList& ls, std::vector<TObject> args)
{
int64_t chan;
if(GetArgument(args,0,chan))
return (int64_t)WPAD_ButtonsUp((int)chan);
return 0;
}
static TObject OGC_WPAD_ButtonsDown(GCList& ls, std::vector<TObject> args)
{
int64_t chan;
if(GetArgument(args,0,chan))
return (int64_t)WPAD_ButtonsDown((int)chan);
return 0;
}
static TObject OGC_WPAD_ButtonsHeld(GCList& ls, std::vector<TObject> args)
{
int64_t chan;
if(GetArgument(args,0,chan))
return (int64_t)WPAD_ButtonsDown((int)chan);
return 0;
}
static TObject OGC_WPAD_BatteryLevel(GCList& ls, std::vector<TObject> args)
{
int64_t chan;
if(GetArgument(args,0,chan))
return (int64_t)WPAD_BatteryLevel((int)chan);
return 0;
}
#endif
#endif
void TStd::RegisterOGC(GC* gc, TRootEnvironment* env)
{
GCList ls(gc);
#if defined(GEKKO)
gc->BarrierBegin();
TDictionary* dict_ogc_pad = TDictionary::Create(ls);
#if defined(HW_RVL)
TDictionary* dict_rvl_wpad = TDictionary::Create(ls);
dict_rvl_wpad->DeclareFunction(gc, "ScanPads","Scan wiimotes",{},OGC_WPAD_ScanPads);
env->DeclareVariable("WPAD", dict_rvl_wpad);
#endif
env->DeclareVariable("PAD", dict_ogc_pad);
gc->BarrierEnd();
#endif
env->permissions.canRegisterOGC=true;
}
}