mirror of
https://github.com/open-goal/jak-project
synced 2026-09-02 02:02:51 -04:00
revamp controller LED in jak 1 + reorganize some pc-settings things + fix some jak 2 decomp (#2719)
This commit is contained in:
@@ -23,7 +23,7 @@ void klisten_init_globals() {
|
||||
*/
|
||||
void ClearPending() {
|
||||
if (!MasterDebug || !ListenerStatus) {
|
||||
// if we aren't debugging print the print buffer to stdout.
|
||||
// if we aren't debugging or connected print the print buffer to stdout.
|
||||
if (PrintPending.offset != 0) {
|
||||
auto size = strlen(PrintBufArea.cast<char>().c() + sizeof(ListenerMessageHeader));
|
||||
if (size > 0) {
|
||||
@@ -34,10 +34,19 @@ void ClearPending() {
|
||||
} else {
|
||||
if (ListenerStatus) {
|
||||
if (OutputPending.offset != 0) {
|
||||
Ptr<char> msg = OutputBufArea.cast<char>() + sizeof(ListenerMessageHeader);
|
||||
auto size = strlen(msg.c());
|
||||
// note - if size is ever greater than 2^16 this will cause an issue.
|
||||
SendFromBuffer(msg.c(), size);
|
||||
// note - same 64 kB patch as prints done here
|
||||
char* msg = OutputBufArea.cast<char>().c() + sizeof(ListenerMessageHeader);
|
||||
auto size = strlen(msg);
|
||||
while (size > 0) {
|
||||
// sends larger than 64 kB are broken by the GoalProtoBuffer thing, so they are split
|
||||
auto send_size = size;
|
||||
if (send_size > 64000) {
|
||||
send_size = 64000;
|
||||
}
|
||||
SendFromBuffer(msg, send_size);
|
||||
size -= send_size;
|
||||
msg += send_size;
|
||||
}
|
||||
clear_output();
|
||||
}
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ extern Ptr<u8> PrintBufArea;
|
||||
constexpr u32 DEBUG_MESSAGE_BUFFER_SIZE = 0x80000;
|
||||
constexpr u32 DEBUG_OUTPUT_BUFFER_SIZE = 0x80000;
|
||||
constexpr u32 DEBUG_PRINT_BUFFER_SIZE = 0x200000;
|
||||
constexpr u32 PRINT_BUFFER_SIZE = 0x2000;
|
||||
constexpr u32 PRINT_BUFFER_SIZE = 0x8000; // upped from 0x2000 on PS2 because we ran out of memory
|
||||
|
||||
struct format_struct {
|
||||
char data[0x40];
|
||||
@@ -141,4 +141,4 @@ char* kitoa(char* buffer, s64 value, u64 base, s32 length, char pad, u32 flag);
|
||||
* The format function does have the ability to call it, but it always passes a zero because
|
||||
* getting a 128-bit integer in PS2 gcc's varargs doesn't work.
|
||||
*/
|
||||
void kqtoa();
|
||||
void kqtoa();
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
namespace jak2 {
|
||||
|
||||
void output_sql_query(char* query_name) {
|
||||
if (MasterDebug != 0) {
|
||||
if (MasterDebug) {
|
||||
sprintf(strend(OutputBufArea.cast<char>().c() + sizeof(ListenerMessageHeader)), "sql-query \"");
|
||||
|
||||
char* buffer_ptr = strend(OutputBufArea.cast<char>().c() + sizeof(ListenerMessageHeader));
|
||||
@@ -539,12 +539,14 @@ s32 format_impl_jak2(uint64_t* args) {
|
||||
// we'd get these eventually in ClearPending, but for some reason they flush these here.
|
||||
// This is nicer because we may crash in between here and flushing the print buffer.
|
||||
if (DiskBoot) {
|
||||
// It's actually really annoying when debugging though so we disable it then
|
||||
if (!MasterDebug) {
|
||||
// however, we are going to disable it anyway because it spams the console and is annoying
|
||||
if (false) {
|
||||
printf("%s", PrintPendingLocal3);
|
||||
fflush(stdout);
|
||||
}
|
||||
PrintPending = make_ptr(PrintPendingLocal2).cast<u8>();
|
||||
// if we don't comment this line, our output gets cleared
|
||||
// *PrintPendingLocal3 = 0;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user