Skip to content

Commit

Permalink
Merge pull request #1748 from nicolasnoble/psyqo-cd-refactor
Browse files Browse the repository at this point in the history
Refactoring the CD-Rom device state machine system.
  • Loading branch information
nicolasnoble authored Oct 1, 2024
2 parents 14027ad + 9536104 commit 3a70ffa
Show file tree
Hide file tree
Showing 30 changed files with 1,629 additions and 198 deletions.
8 changes: 6 additions & 2 deletions src/core/cdrom.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1602,8 +1602,12 @@ class CDRomImpl : public PCSX::CDRom {
delayedString, m_param[0], m_param[1], m_param[2]);
break;
case CdlPlay:
PCSX::g_system->log(PCSX::LogClass::CDROM, "%08x [CDROM]%s Command: CdlPlay %i\n", pc, delayedString,
m_param[0]);
if (m_paramC == 0) {
PCSX::g_system->log(PCSX::LogClass::CDROM, "%08x [CDROM]%s Command: CdlPlay\n", pc, delayedString);
} else {
PCSX::g_system->log(PCSX::LogClass::CDROM, "%08x [CDROM]%s Command: CdlPlay %i\n", pc,
delayedString, m_param[0]);
}
break;
case CdlSetfilter:
PCSX::g_system->log(PCSX::LogClass::CDROM,
Expand Down
55 changes: 55 additions & 0 deletions src/mips/common/kernel/threads.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
/*
MIT License
Copyright (c) 2024 PCSX-Redux authors
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/

#pragma once

#include <stdint.h>

struct Registers {
union {
struct {
uint32_t r0, at, v0, v1, a0, a1, a2, a3;
uint32_t t0, t1, t2, t3, t4, t5, t6, t7;
uint32_t s0, s1, s2, s3, s4, s5, s6, s7;
uint32_t t8, t9, k0, k1, gp, sp, fp, ra;
} n;
uint32_t r[32];
} GPR;
uint32_t returnPC;
uint32_t hi, lo;
uint32_t SR;
uint32_t Cause;
};

struct Thread {
uint32_t flags, flags2;
struct Registers registers;
uint32_t unknown[9];
};

struct Process {
struct Thread* thread;
};
26 changes: 1 addition & 25 deletions src/mips/openbios/kernel/threads.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,31 +27,7 @@ SOFTWARE.

#include <stdint.h>

struct Registers {
union {
struct {
uint32_t r0, at, v0, v1, a0, a1, a2, a3;
uint32_t t0, t1, t2, t3, t4, t5, t6, t7;
uint32_t s0, s1, s2, s3, s4, s5, s6, s7;
uint32_t t8, t9, k0, k1, gp, sp, fp, ra;
} n;
uint32_t r[32];
} GPR;
uint32_t returnPC;
uint32_t hi, lo;
uint32_t SR;
uint32_t Cause;
};

struct Thread {
uint32_t flags, flags2;
struct Registers registers;
uint32_t unknown[9];
};

struct Process {
struct Thread* thread;
};
#include "common/kernel/threads.h"

int initThreads(int processCount, int threadCount);

Expand Down
2 changes: 1 addition & 1 deletion src/mips/psyqo/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ TARGET = psyqo
TYPE = library

SRCS = \
../../../third_party/EASTL/source/fixed_pool.cpp \
$(wildcard ../../../third_party/EASTL/source/*.cpp) \
../common/crt0/crt0cxx.s \
../common/crt0/cxxglue.c \
../common/crt0/memory-c.c \
Expand Down
Loading

0 comments on commit 3a70ffa

Please sign in to comment.