Merge branch 'master' of https://github.com/water111/jak-project into w/ir

This commit is contained in:
water
2020-09-08 19:39:39 -04:00
22 changed files with 251 additions and 239 deletions
+4 -8
View File
@@ -5,6 +5,9 @@
*/
#include <cstring>
#include <chrono>
#include <thread>
#include "common/common_types.h"
#include "game/sce/libscf.h"
#include "kboot.h"
@@ -152,21 +155,14 @@ void KernelCheckAndDispatch() {
}
}
// TODO-WINDOWS
#ifdef __linux__
ClearPending();
#endif
// if the listener function changed, it means the kernel ran it, so we should notify compiler.
if (MasterDebug && ListenerFunction->value != old_listener) {
SendAck();
}
#ifdef _WIN32
Sleep(1000); // todo - remove this
#elif __linux__
usleep(1000);
#endif
std::this_thread::sleep_for(std::chrono::microseconds(1000));
}
}
-3
View File
@@ -27,8 +27,6 @@ void kdsnetm_init_globals() {
protoBlock.reset();
}
// TODO-WINDOWS
#ifdef __linux__
/*!
* Register GOAL DECI2 Protocol Driver with DECI2 service
* DONE, EXACT
@@ -222,4 +220,3 @@ void GoalProtoStatus() {
Msg(6, "gproto: got %d %d\n", protoBlock.most_recent_event, protoBlock.most_recent_param);
Msg(6, "gproto: %d %d\n", protoBlock.last_receive_size, protoBlock.send_remaining);
}
#endif
-7
View File
@@ -51,8 +51,6 @@ extern GoalProtoBlock protoBlock;
*/
void kdsnetm_init_globals();
// TODO-WINDOWS
#ifdef __linux__
/*!
* Register GOAL DECI2 Protocol Driver with DECI2 service
* DONE, EXACT
@@ -65,8 +63,6 @@ void InitGoalProto();
*/
void ShutdownGoalProto();
#endif
/*!
* Handle a DECI2 Protocol Event for the GOAL Proto.
* Called by the DECI2 Protocol driver
@@ -74,8 +70,6 @@ void ShutdownGoalProto();
*/
void GoalProtoHandler(int event, int param, void* data);
// TODO-WINDOWS
#ifdef __linux__
/*!
* Low level DECI2 send
* Will block until send is complete.
@@ -83,7 +77,6 @@ void GoalProtoHandler(int event, int param, void* data);
* removed
*/
s32 SendFromBufferD(s32 p1, u64 p2, char* data, s32 size);
#endif
/*!
* Print GOAL Protocol status
+1 -9
View File
@@ -71,10 +71,7 @@ void ClearPending() {
Ptr<char> msg = OutputBufArea.cast<char>() + sizeof(GoalMessageHeader);
auto size = strlen(msg.c());
// note - if size is ever greater than 2^16 this will cause an issue.
// TODO-WINDOWS
#ifdef __linux__
SendFromBuffer(msg.c(), size);
#endif
clear_output();
}
@@ -87,10 +84,7 @@ void ClearPending() {
if (send_size > 64000) {
send_size = 64000;
}
// TODO-WINDOWS
#ifdef __linux__
SendFromBufferD(2, 0, msg, send_size);
#endif
size -= send_size;
msg += send_size;
}
@@ -109,11 +103,9 @@ void ClearPending() {
*/
void SendAck() {
if (MasterDebug) {
#ifdef __linux__
SendFromBufferD(u16(ListenerMessageKind::MSG_ACK), protoBlock.msg_id,
AckBufArea + sizeof(GoalMessageHeader),
strlen(AckBufArea + sizeof(GoalMessageHeader)));
#endif
}
}
@@ -164,4 +156,4 @@ void ProcessListenerMessage(Ptr<char> msg) {
break;
}
SendAck();
}
}
-6
View File
@@ -329,10 +329,7 @@ int InitMachine() {
// }
if (MasterDebug) { // connect to GOAL compiler
// TODO-WINDOWS
#ifdef __linux__
InitGoalProto();
#endif
}
printf("InitSound\n");
@@ -362,10 +359,7 @@ int ShutdownMachine() {
StopIOP();
CloseListener();
ShutdownSound();
// TODO-WINDOWS
#ifdef __linux__
ShutdownGoalProto();
#endif
Msg(6, "kernel: machine shutdown");
return 0;
}
-3
View File
@@ -52,8 +52,6 @@ u32 ReceiveToBuffer(char* buff) {
return msg_size;
}
// TODO-WINDOWS
#ifdef __linux__
/*!
* Do a DECI2 send and block until it is complete.
* The message type is OUTPUT
@@ -62,7 +60,6 @@ u32 ReceiveToBuffer(char* buff) {
s32 SendFromBuffer(char* buff, s32 size) {
return SendFromBufferD(u16(ListenerMessageKind::MSG_OUTPUT), 0, buff, size);
}
#endif
/*!
* Just prepare the Ack buffer, doesn't actually connect.