Skip to content

Commit

Permalink
chore: cleanup baseapp
Browse files Browse the repository at this point in the history
  • Loading branch information
intns committed Dec 16, 2024
1 parent 01dda17 commit 4ac1d9f
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 24 deletions.
2 changes: 1 addition & 1 deletion include/CoreNode.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ struct CoreNode : public ANode {
* @brief Gets the name of the CoreNode.
* @return The name of the CoreNode.
*/
char* getName() { return mName; }
char* Name() { return mName; }

/**
* @brief Gets the number of child nodes of the CoreNode.
Expand Down
51 changes: 28 additions & 23 deletions src/sysCommon/baseApp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,21 @@
#include "AtxStream.h"
#include "Age.h"
#include "system.h"
#include "DebugLog.h"

/*
* --INFO--
* Address: ........
* Size: 00009C
*/
static void _Error(char* msg, ...)
{
OSPanic(__FILE__, __LINE__, msg);
// UNUSED FUNCTION
}
DEFINE_ERROR();

/*
* --INFO--
* Address: ........
* Size: 0000F0
*/
static void _Print(char*, ...)
{
// UNUSED FUNCTION
}
DEFINE_PRINT("baseApp");

/*
* --INFO--
Expand All @@ -39,13 +33,6 @@ BaseApp::BaseApp()
nodeMgr->firstNode().add(this);
}

/*
* --INFO--
* Address: 80024ED4
* Size: 000008
*/
// void CoreNode::setName(char* name) { mName = name; }

/*
* --INFO--
* Address: ........
Expand Down Expand Up @@ -87,7 +74,25 @@ int BaseApp::idleupdate()
*/
void BaseApp::startAgeServer()
{
// UNUSED FUNCTION
#ifdef __MWERKS__
return;
#endif

if (mAgeServer) {
return;
}

PRINT("Atx - Wants to open Age service\n");
AgeServer* newServer = new AgeServer();

if (newServer->Open()) {
mAgeServer = newServer;

char* windowName = Name();
mAgeServer->NewNodeWindow(windowName);
read(*(RandomAccessStream*)mAgeServer);
mAgeServer->Done();
}
}

/*
Expand All @@ -97,14 +102,16 @@ void BaseApp::startAgeServer()
*/
void BaseApp::stopAgeServer()
{
#ifndef __MWERKS__
#ifdef __MWERKS__
return;
#endif

if (mAgeServer) {
_Print("Atx - Wants to close Age service\n");
PRINT("Atx - Wants to close Age service\n");
mAgeServer->mNetStream->writeInt(0xFFFF);
mAgeServer->mNetStream->flush();
mAgeServer = nullptr;
}
#endif
}

/*
Expand All @@ -127,9 +134,7 @@ void BaseApp::softReset()
*/
BaseApp::~BaseApp()
{
#ifndef __MWERKS__
_Print("default baseApp deconstructor\n");
#endif
PRINT("default baseApp deconstructor\n");

if (mCommandStream) {
mCommandStream->mNetStream->writeInt(0xFFFF);
Expand Down

0 comments on commit 4ac1d9f

Please sign in to comment.