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) {