yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
spc700_reset_test.cc
Go to the documentation of this file.
1#include <gtest/gtest.h>
2
3#include "app/emu/audio/apu.h"
5
6namespace yaze {
7namespace emu {
8
9TEST(Spc700ResetTest, ResetVectorExecutesIplSequence) {
10 MemoryImpl mem;
11 std::vector<uint8_t> dummy_rom(0x200000, 0);
12 mem.Initialize(dummy_rom);
13
14 Apu apu(mem);
15 apu.Init();
16 apu.Reset();
17
18 // After reset, running some cycles should advance SPC PC from IPL entry
19 uint16_t pc_before = apu.spc700().PC;
20 for (int i = 0; i < 64; ++i) {
21 apu.spc700().RunOpcode();
22 apu.Cycle();
23 }
24 uint16_t pc_after = apu.spc700().PC;
25 EXPECT_NE(pc_after, pc_before);
26}
27
28} // namespace emu
29} // namespace yaze
30
The Apu class represents the Audio Processing Unit (APU) of a system.
Definition apu.h:53
auto spc700() -> Spc700 &
Definition apu.h:71
void Init()
Definition apu.cc:45
void Reset()
Definition apu.cc:52
void Cycle()
Definition apu.cc:161
Implementation of the Memory interface for emulating memory in a SNES system.
Definition memory.h:118
void Initialize(const std::vector< uint8_t > &romData, bool verbose=false)
Definition memory.cc:12
TEST(Spc700ResetTest, ResetVectorExecutesIplSequence)
Main namespace for the application.