Skip to content

Commit

Permalink
Merge branch 'main' into psyqo-cd-refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolasnoble authored Oct 1, 2024
2 parents a0a2774 + 14027ad commit 9536104
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 7 deletions.
7 changes: 6 additions & 1 deletion src/core/disr3000a.cc
Original file line number Diff line number Diff line change
Expand Up @@ -716,7 +716,12 @@ declare(disMTLO) {
*********************************************************/
declare(disBREAK) {
dOpCode("break");
Imm32((code >> 6) & 0xfffff);
unsigned category = (code >> 16) & 0x3ff;
unsigned exCode = (code >> 6) & 0x3ff;
Imm16(category);
if (exCode != 0) {
Imm16(exCode);
}
}
declare(disRFE) { dOpCode("rfe"); }
declare(disSYSCALL) {
Expand Down
8 changes: 4 additions & 4 deletions src/core/r3000a.cc
Original file line number Diff line number Diff line change
Expand Up @@ -433,14 +433,14 @@ std::unique_ptr<PCSX::R3000Acpu> PCSX::Cpus::DynaRec() {
}

void PCSX::R3000Acpu::processA0KernelCall(uint32_t call) {
auto r = m_regs.GPR.n;
auto& r = m_regs.GPR.n;

switch (call) {
case 0x03: { // write
if (r.a0 != 1) break;
IO<File> memFile = g_emulator->m_mem->getMemoryAsFile();
uint32_t size = r.a2;
m_regs.GPR.n.v0 = size;
r.v0 = size;
memFile->rSeek(r.a1);
while (size--) {
g_system->biosPutc(memFile->getc());
Expand Down Expand Up @@ -468,14 +468,14 @@ void PCSX::R3000Acpu::processA0KernelCall(uint32_t call) {
}

void PCSX::R3000Acpu::processB0KernelCall(uint32_t call) {
auto r = m_regs.GPR.n;
auto& r = m_regs.GPR.n;

switch (call) {
case 0x35: { // write
if (r.a0 != 1) break;
IO<File> memFile = g_emulator->m_mem->getMemoryAsFile();
uint32_t size = r.a2;
m_regs.GPR.n.v0 = size;
r.v0 = size;
memFile->rSeek(r.a1);
while (size--) {
g_system->biosPutc(memFile->getc());
Expand Down
8 changes: 6 additions & 2 deletions tools/linux-mips/spawn-compiler.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,19 @@ set -ex

PREFIX=${PREFIX:-"/usr/local"}

wget https://ftp.gnu.org/gnu/binutils/binutils-2.43.tar.gz
for url in https://ftp.gnu.org/gnu/binutils/binutils-2.43.tar.gz https://mirrors.kernel.org/gnu/binutils/binutils-2.43.tar.gz ; do
wget --timeout=60 --continue $url && break
done
tar xvfz binutils-2.43.tar.gz
cd binutils-2.43
./configure --target=mipsel-none-elf --disable-multilib --disable-nls --disable-werror --prefix=$PREFIX
make
make install-strip
cd ..

wget https://ftp.gnu.org/gnu/gcc/gcc-14.2.0/gcc-14.2.0.tar.gz
for url in https://ftp.gnu.org/gnu/gcc/gcc-14.2.0/gcc-14.2.0.tar.gz https://mirrors.kernel.org/gnu/gcc/gcc-14.2.0/gcc-14.2.0.tar.gz ; do
wget --timeout=60 --continue $url && break
done
tar xvfz gcc-14.2.0.tar.gz
cd gcc-14.2.0
./contrib/download_prerequisites
Expand Down
1 change: 1 addition & 0 deletions tools/macos-mips/mipsel-none-elf-binutils.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ class MipselNoneElfBinutils < Formula
desc "FSF Binutils for mipsel cross development"
homepage "https://www.gnu.org/software/binutils/"
url "https://ftp.gnu.org/gnu/binutils/binutils-2.43.tar.gz"
mirror "https://mirrors.kernel.org/gnu/binutils/binutils-2.43.tar.gz"
sha256 "025c436d15049076ebe511d29651cc4785ee502965a8839936a65518582bdd64"

depends_on "texinfo" => :build
Expand Down
1 change: 1 addition & 0 deletions tools/macos-mips/mipsel-none-elf-gcc.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ class MipselNoneElfGcc < Formula
desc "The GNU compiler collection for mipsel"
homepage "https://gcc.gnu.org"
url "https://ftp.gnu.org/gnu/gcc/gcc-14.2.0/gcc-14.2.0.tar.xz"
mirror "https://mirrors.kernel.org/gnu/gcc/gcc-14.2.0/gcc-14.2.0.tar.xz"
sha256 "a7b39bc69cbf9e25826c5a60ab26477001f7c08d85cec04bc0e29cabed6f3cc9"

depends_on "gmp"
Expand Down
1 change: 1 addition & 0 deletions tools/macos-mips/mipsel-none-elf-gdb.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ class MipselNoneElfGdb < Formula
desc "GDB: The GNU Project Debugger compiled for Mips"
homepage "https://sourceware.org/gdb/"
url "https://ftp.gnu.org/gnu/gdb/gdb-15.1.tar.xz"
mirror "https://mirrors.kernel.org/gnu/gdb/gdb-15.1.tar.xz"
sha256 "38254eacd4572134bca9c5a5aa4d4ca564cbbd30c369d881f733fb6b903354f2"

# inspired by https://github.com/orgs/Homebrew/discussions/1114#discussioncomment-8863715
Expand Down
1 change: 1 addition & 0 deletions tools/vscode-extension/scripts/mipsel-none-elf-binutils.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ class MipselNoneElfBinutils < Formula
desc "FSF Binutils for mipsel cross development"
homepage "https://www.gnu.org/software/binutils/"
url "https://ftp.gnu.org/gnu/binutils/binutils-2.43.tar.gz"
mirror "https://mirrors.kernel.org/gnu/binutils/binutils-2.43.tar.gz"
sha256 "025c436d15049076ebe511d29651cc4785ee502965a8839936a65518582bdd64"

depends_on "texinfo" => :build
Expand Down
1 change: 1 addition & 0 deletions tools/vscode-extension/scripts/mipsel-none-elf-gcc.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ class MipselNoneElfGcc < Formula
desc "The GNU compiler collection for mipsel"
homepage "https://gcc.gnu.org"
url "https://ftp.gnu.org/gnu/gcc/gcc-14.2.0/gcc-14.2.0.tar.xz"
mirror "https://mirrors.kernel.org/gnu/gcc/gcc-14.2.0/gcc-14.2.0.tar.xz"
sha256 "a7b39bc69cbf9e25826c5a60ab26477001f7c08d85cec04bc0e29cabed6f3cc9"

depends_on "gmp"
Expand Down
1 change: 1 addition & 0 deletions tools/vscode-extension/scripts/mipsel-none-elf-gdb.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ class MipselNoneElfGdb < Formula
desc "GDB: The GNU Project Debugger compiled for Mips"
homepage "https://sourceware.org/gdb/"
url "https://ftp.gnu.org/gnu/gdb/gdb-15.1.tar.xz"
mirror "https://mirrors.kernel.org/gnu/gdb/gdb-15.1.tar.xz"
sha256 "38254eacd4572134bca9c5a5aa4d4ca564cbbd30c369d881f733fb6b903354f2"

# inspired by https://github.com/orgs/Homebrew/discussions/1114#discussioncomment-8863715
Expand Down

0 comments on commit 9536104

Please sign in to comment.