Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft: Port s3 graphics driver code from @gdwnldsksc #102

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 3.10)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
project(AXPBox VERSION 0.1)
project(AXPBox VERSION 1.1.2)

# Source files
file(GLOB srcs src/*.cpp src/base/*.cpp src/gui/*.cpp)
Expand Down
6 changes: 5 additions & 1 deletion src/AlphaCPU.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -494,8 +494,12 @@ inline int CAlphaCPU::get_icache(u64 address, u32 *data) {
return result;
}

memcpy(state.icache[state.next_icache].data, cSystem->PtrToMem(p_a),
char* addr = cSystem->PtrToMem(p_a);
if(addr)
memcpy(state.icache[state.next_icache].data, addr,
ICACHE_LINE_SIZE * 4);
else
printf("PtrToMem(p_a) == nullptr! Address: %lu.\n", p_a);

state.icache[state.next_icache].valid = true;
state.icache[state.next_icache].asn = state.asn;
Expand Down
8 changes: 4 additions & 4 deletions src/AlphaCPU_vmspal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@
#define r30 state.r[30]
#define r31 state.r[31]

#define hw_stq(a, b) cSystem->WriteMem(a & ~U64(0x7), 64, b, this)
#define hw_stl(a, b) cSystem->WriteMem(a & ~U64(0x3), 32, b, this)
#define hw_stq(a, b) cSystem->WriteMem((a) & ~U64(0x7), 64, b, this)
#define hw_stl(a, b) cSystem->WriteMem((a) & ~U64(0x3), 32, b, this)
#define stq(a, b) \
if (virt2phys(a, &phys_address, ACCESS_WRITE, NULL, 0)) \
return -1; \
Expand All @@ -106,8 +106,8 @@
if (virt2phys(a, &phys_address, ACCESS_READ, NULL, 0)) \
return -1; \
b = (char)(cSystem->ReadMem(phys_address, 8, this));
#define hw_ldq(a, b) b = cSystem->ReadMem(a & ~U64(0x7), 64, this)
#define hw_ldl(a, b) b = sext_u64_32(cSystem->ReadMem(a & ~U64(0x3), 32, this));
#define hw_ldq(a, b) b = cSystem->ReadMem((a) & ~U64(0x7), 64, this)
#define hw_ldl(a, b) b = sext_u64_32(cSystem->ReadMem((a) & ~U64(0x3), 32, this));
#define hw_ldbu(a, b) b = cSystem->ReadMem(a, 8, this)

/**
Expand Down
Loading