From 268ef98309441d31c8d0187887d24d30ca7dfac9 Mon Sep 17 00:00:00 2001 From: root <182859762@qq.com> Date: Sun, 19 May 2024 23:35:49 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BF=99=E9=87=8C=E9=A6=96=E5=85=88=E8=BF=9B?= =?UTF-8?q?=E8=A1=8C=E4=B8=80=E4=B8=8Blog=EF=BC=8C=E6=A3=80=E6=9F=A5?= =?UTF-8?q?=E8=8A=AF=E7=89=87=E7=B1=BB=E5=9E=8B=EF=BC=8C=E7=9B=AE=E5=89=8D?= =?UTF-8?q?=E7=9C=8B=E6=9D=A5=E5=B7=B2=E7=BB=8F=E5=8F=AF=E4=BB=A5=E7=A1=AE?= =?UTF-8?q?=E5=AE=9A=E8=8A=AF=E7=89=87=E7=B1=BB=E5=9E=8B=E7=9A=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Makefile | 2 +- src/nba/src/bus/bus.cpp | 6 ++++++ src/nba/src/hw/dma/dma.cpp | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 95a9007..fe077dc 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ CC := emcc CXX := emcc -CXXFLAGS := -c -fbracket-depth=4800 -O3 -std=c++17 -D NDEBUG=1 -msimd128 +CXXFLAGS := -c -fbracket-depth=4800 -O3 -std=c++17 -msimd128 INCLUDES := -I src/nba/include/ -I src/nba/src LDFLAGS := -s ENVIRONMENT=web -s ASSERTIONS=0 -s FILESYSTEM=0 -s STANDALONE_WASM=1 -s ALLOW_MEMORY_GROWTH\ -s EXPORTED_FUNCTIONS=[_getOutput,_cyclePerFrame,_getRom,_getIRam,_getWRam,_go,_run,_main] --lto diff --git a/src/nba/src/bus/bus.cpp b/src/nba/src/bus/bus.cpp index 5213abf..e351363 100644 --- a/src/nba/src/bus/bus.cpp +++ b/src/nba/src/bus/bus.cpp @@ -392,6 +392,10 @@ void Bus::Write(u32 address, int access, T value) { } StopPrefetch(); + if( (address & 0x080000cf) == address ){ + // 此处可以命中RTC or gpio + printf("Write rom at %08x using value %08x\n", address, value); + } // TODO: figure out how 8-bit and 32-bit accesses actually work. if constexpr(std::is_same_v) { @@ -416,6 +420,8 @@ void Bus::Write(u32 address, int access, T value) { StopPrefetch(); Step(wait16[0][0xE]); + printf("Write backup at %08x using value %08x\n", address, value); + if constexpr(std::is_same_v) value >>= (address & 1) << 3; if constexpr(std::is_same_v) value >>= (address & 3) << 3; diff --git a/src/nba/src/hw/dma/dma.cpp b/src/nba/src/hw/dma/dma.cpp index 2d55701..9b17e5d 100644 --- a/src/nba/src/hw/dma/dma.cpp +++ b/src/nba/src/hw/dma/dma.cpp @@ -389,6 +389,7 @@ void DMA::OnChannelWritten(Channel& channel, bool enable_old) { * since we cannot always determine the size at load time. */ if(channel.dst_addr >= 0x0D000000) { + printf("seems using dma3 to read eeprom\n"); int length = channel.length; if(length == 9 || length == 73) {