Skip to content

Commit

Permalink
Merge pull request #330 from ogamespec/main
Browse files Browse the repository at this point in the history
tabs
  • Loading branch information
ogamespec authored Mar 1, 2023
2 parents c9f14d0 + eb4de0c commit dfb46d6
Showing 1 changed file with 46 additions and 46 deletions.
92 changes: 46 additions & 46 deletions Breaknes/BreaksCore/BogusBoard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,74 +10,74 @@ namespace Breaknes
BogusBoard::BogusBoard(APUSim::Revision apu_rev, PPUSim::Revision ppu_rev) : Board (apu_rev, ppu_rev)
{
core = new M6502Core::M6502(false, false);
wram = new BaseBoard::SRAM(wram_bits);
wram = new BaseBoard::SRAM(wram_bits);

for (int i = 0; i < wram->Dbg_GetSize(); i++)
{
wram->Dbg_WriteByte(i, 0);
}
for (int i = 0; i < wram->Dbg_GetSize(); i++)
{
wram->Dbg_WriteByte(i, 0);
}

AddBoardMemDescriptors();
AddDebugInfoProviders();
AddBoardMemDescriptors();
AddDebugInfoProviders();
}

BogusBoard::~BogusBoard()
{
delete core;
delete wram;
delete wram;
}

void BogusBoard::Step()
{
uint32_t wram_addr;
bool dz = false;
uint32_t wram_addr;
bool dz = false;

// Memory (Read)
// Memory (Read)

if (RnW == TriState::One)
{
wram_addr = addr_bus;
wram->sim(TriState::Zero, RnW, NOT(RnW), &wram_addr, &data_bus, dz);
}
if (RnW == TriState::One)
{
wram_addr = addr_bus;
wram->sim(TriState::Zero, RnW, NOT(RnW), &wram_addr, &data_bus, dz);
}

// Core
// Core

TriState inputs[(size_t)M6502Core::InputPad::Max]{};
TriState outputs[(size_t)M6502Core::OutputPad::Max];
TriState inputs[(size_t)M6502Core::InputPad::Max]{};
TriState outputs[(size_t)M6502Core::OutputPad::Max];

inputs[(size_t)M6502Core::InputPad::n_NMI] = n_NMI;
inputs[(size_t)M6502Core::InputPad::n_IRQ] = n_IRQ;
inputs[(size_t)M6502Core::InputPad::n_RES] = n_RES;
inputs[(size_t)M6502Core::InputPad::PHI0] = CLK;
inputs[(size_t)M6502Core::InputPad::RDY] = RDY;
inputs[(size_t)M6502Core::InputPad::SO] = SO;
inputs[(size_t)M6502Core::InputPad::n_NMI] = n_NMI;
inputs[(size_t)M6502Core::InputPad::n_IRQ] = n_IRQ;
inputs[(size_t)M6502Core::InputPad::n_RES] = n_RES;
inputs[(size_t)M6502Core::InputPad::PHI0] = CLK;
inputs[(size_t)M6502Core::InputPad::RDY] = RDY;
inputs[(size_t)M6502Core::InputPad::SO] = SO;

core->sim(inputs, outputs, &addr_bus, &data_bus);
core->sim(inputs, outputs, &addr_bus, &data_bus);

PHI1 = outputs[(size_t)M6502Core::OutputPad::PHI1];
PHI2 = outputs[(size_t)M6502Core::OutputPad::PHI2];
RnW = outputs[(size_t)M6502Core::OutputPad::RnW];
SYNC = outputs[(size_t)M6502Core::OutputPad::SYNC];
PHI1 = outputs[(size_t)M6502Core::OutputPad::PHI1];
PHI2 = outputs[(size_t)M6502Core::OutputPad::PHI2];
RnW = outputs[(size_t)M6502Core::OutputPad::RnW];
SYNC = outputs[(size_t)M6502Core::OutputPad::SYNC];

// Memory (Write)
// Memory (Write)

if (RnW == TriState::Zero)
{
wram_addr = addr_bus;
wram->sim(TriState::Zero, RnW, NOT(RnW), &wram_addr, &data_bus, dz);
}
if (RnW == TriState::Zero)
{
wram_addr = addr_bus;
wram->sim(TriState::Zero, RnW, NOT(RnW), &wram_addr, &data_bus, dz);
}

CLK = NOT(CLK);
CLK = NOT(CLK);

if (IsNegedge(PrevCLK, CLK))
{
phi_counter++;
}
PrevCLK = CLK;
if (IsNegedge(PrevCLK, CLK))
{
phi_counter++;
}
PrevCLK = CLK;
}

size_t BogusBoard::GetPHICounter()
{
return phi_counter;
}
size_t BogusBoard::GetPHICounter()
{
return phi_counter;
}
}

0 comments on commit dfb46d6

Please sign in to comment.