mirror of
https://github.com/ACreTeam/ac-decomp
synced 2026-05-22 22:24:16 -04:00
Link Famicom/famicom.cpp
This commit is contained in:
+1
-3
@@ -795,9 +795,7 @@ config.libs = [
|
||||
"objects": [
|
||||
Object(NonMatching, "Famicom/ks_nes_core.cpp"),
|
||||
Object(NonMatching, "Famicom/ks_nes_draw.cpp"),
|
||||
# TODO: get ~J2DOrthoGraph's dtor in here somehow? 0x800468fc
|
||||
# also add in JUTGamePad::getPortStatus when JUTGamePad is linked?
|
||||
Object(NonMatching, "Famicom/famicom.cpp"),
|
||||
Object(Matching, "Famicom/famicom.cpp"),
|
||||
Object(Matching, "Famicom/famicom_nesinfo.cpp"),
|
||||
],
|
||||
},
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
#define MURA_GAME_NAME_SIZE 16
|
||||
|
||||
static void* my_malloc(size_t size, u32 align) { return (*my_malloc_current->malloc_align)(size, align); }
|
||||
static void* my_malloc(size_t size, int align) { return (*my_malloc_current->malloc_align)(size, align); }
|
||||
static void my_free(void* ptr) { (*my_malloc_current->free)(ptr); }
|
||||
static int my_getmemblocksize(void* ptr) { return (*my_malloc_current->getmemblocksize)(ptr); }
|
||||
static int my_gettotalfreesize() { return (*my_malloc_current->gettotalfreesize)(); }
|
||||
|
||||
@@ -26,8 +26,7 @@ struct J2DGrafBlend {
|
||||
struct J2DGrafContext {
|
||||
J2DGrafContext(f32, f32, f32, f32);
|
||||
|
||||
virtual ~J2DGrafContext() {
|
||||
} // _08 (weak)
|
||||
virtual ~J2DGrafContext() {} // _08 (weak)
|
||||
virtual void place(const JGeometry::TBox2f&); // _0C
|
||||
virtual void place(f32 x, f32 y, f32 width, f32 height) {
|
||||
JGeometry::TBox2f box(x, y, x + width, y + height);
|
||||
|
||||
@@ -100,11 +100,12 @@ class JUTGamePad : public JKRDisposer {
|
||||
}
|
||||
|
||||
/* @HACK - This gets inlined when defined -- JSystem might have precompiled headers */
|
||||
static s8 getPortStatus(EPadPort port);
|
||||
/*{
|
||||
|
||||
static s8 getPortStatus(EPadPort port)
|
||||
{
|
||||
JUT_ASSERT(0 <= port && port < 4);
|
||||
return mPadStatus[port].err;
|
||||
}*/
|
||||
}
|
||||
|
||||
bool isPushing3ButtonReset() const {
|
||||
bool pushing = false;
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
#include "JSystem/JKernel/JKRArchive.h"
|
||||
#include "JSystem/JKernel/JKRAram.h"
|
||||
#include "JSystem/ResTIMG.h"
|
||||
#include "JSystem/J2D/J2DGrafContext.h"
|
||||
#include "libc64/sprintf.h"
|
||||
#include "libjsys/jsyswrapper.h"
|
||||
#include "jsyswrap_cpp.h"
|
||||
@@ -2325,11 +2326,7 @@ static int ksnes_thread_exec(u32 flags) {
|
||||
}
|
||||
}
|
||||
|
||||
inline int GetPortStatus(int port) {
|
||||
JUTGamePad::EPadPort padPort = (JUTGamePad::EPadPort)port;
|
||||
return JUTGamePad::getPortStatus(padPort);
|
||||
}
|
||||
|
||||
#pragma dont_inline on // @HACK - necessary to not inline JUTGamePad::getPortStatus
|
||||
static void nogbaInput() {
|
||||
int port;
|
||||
u32 disconnected_ports = 0;
|
||||
@@ -2337,7 +2334,8 @@ static void nogbaInput() {
|
||||
for (port = 0; port < PAD_MAX_CONTROLLERS; port++) {
|
||||
InputValid[port] = false;
|
||||
|
||||
switch (GetPortStatus(port)) {
|
||||
// switch (GetPortStatus(port)) {
|
||||
switch ((int)JUTGamePad::getPortStatus((JUTGamePad::EPadPort)port)) {
|
||||
case PAD_ERR_NONE:
|
||||
{
|
||||
InputValid[port] = true;
|
||||
@@ -2396,6 +2394,14 @@ static void nogbaInput() {
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma dont_inline reset
|
||||
|
||||
// @HACK - we need to force J2DOrthoGraph's dtor to emit
|
||||
static void fake() {
|
||||
J2DOrthoGraph graph;
|
||||
|
||||
graph.~J2DOrthoGraph();
|
||||
}
|
||||
|
||||
extern void famicom_1frame() {
|
||||
nogbaInput();
|
||||
|
||||
Reference in New Issue
Block a user