2016-08-17 12:31:22 +00:00
|
|
|
#include <ms/ms.hpp>
|
|
|
|
|
|
|
|
namespace MasterSystem {
|
|
|
|
|
|
|
|
VDP vdp;
|
|
|
|
|
|
|
|
auto VDP::Enter() -> void {
|
|
|
|
while(true) scheduler.synchronize(), vdp.main();
|
|
|
|
}
|
|
|
|
|
|
|
|
auto VDP::main() -> void {
|
2016-08-19 14:11:26 +00:00
|
|
|
for(uint y : range(262)) {
|
|
|
|
for(uint x : range(342)) {
|
|
|
|
step(1);
|
|
|
|
}
|
|
|
|
if(y == 240) scheduler.exit(Scheduler::Event::Frame);
|
|
|
|
}
|
2016-08-17 12:31:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
auto VDP::step(uint clocks) -> void {
|
|
|
|
Thread::step(clocks);
|
2016-08-19 14:11:26 +00:00
|
|
|
synchronize(cpu);
|
|
|
|
}
|
|
|
|
|
|
|
|
auto VDP::refresh() -> void {
|
|
|
|
Emulator::video.refresh(buffer, 256 * sizeof(uint32), 256, 240);
|
|
|
|
}
|
|
|
|
|
2016-08-27 04:48:21 +00:00
|
|
|
auto VDP::in(uint8 addr) -> uint8 {
|
|
|
|
switch(addr) {
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0xb0;
|
|
|
|
}
|
|
|
|
|
|
|
|
auto VDP::out(uint8 addr, uint8 data) -> void {
|
|
|
|
switch(addr) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-08-19 14:11:26 +00:00
|
|
|
auto VDP::power() -> void {
|
|
|
|
}
|
|
|
|
|
|
|
|
auto VDP::reset() -> void {
|
|
|
|
create(VDP::Enter, system.colorburst());
|
2016-08-17 12:31:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|