Files
yaze/test/unit/emu/spc700_reset_test.cc
scawful a881c0f8e1 feat: Refactor Emulator to Accept ROM Parameter and Enhance Logging
- Updated Emulator::Run method to accept a Rom* parameter, improving flexibility in ROM handling.
- Refactored texture creation and ROM data initialization to utilize the new parameter.
- Enhanced logging in Snes class to provide detailed information during initialization, reset, and frame processing, aiding in debugging and performance monitoring.
- Introduced cycle tracking in Apu and Spc700 classes for accurate synchronization and debugging.
- Added unit tests for APU DSP functionality and IPL ROM handshake to ensure reliability and correctness of audio processing.
2025-10-06 11:41:33 -04:00

31 lines
641 B
C++

#include <gtest/gtest.h>
#include "app/emu/audio/apu.h"
#include "app/emu/memory/memory.h"
namespace yaze {
namespace emu {
TEST(Spc700ResetTest, ResetVectorExecutesIplSequence) {
MemoryImpl mem;
std::vector<uint8_t> dummy_rom(0x200000, 0);
mem.Initialize(dummy_rom);
Apu apu(mem);
apu.Init();
apu.Reset();
// After reset, running some cycles should advance SPC PC from IPL entry
uint16_t pc_before = apu.spc700().PC;
for (int i = 0; i < 64; ++i) {
apu.spc700().RunOpcode();
apu.Cycle();
}
uint16_t pc_after = apu.spc700().PC;
EXPECT_NE(pc_after, pc_before);
}
} // namespace emu
} // namespace yaze