mirror of
https://github.com/bsnes-emu/bsnes.git
synced 2025-02-23 22:52:34 +01:00
byuu says: This updates higan to use the new Markup::Node changes. This is a really big change, and one slight typo anywhere could break certain classes of games from playing. I don't have ananke hooked up again yet, so I don't have the ability to test this much. If anyone with some v094 game folders wouldn't mind testing, I'd help out a great deal. I'm most concerned about testing one of each SNES special chip game. Most notably, systems like the SA-1, HitachiDSP and NEC-DSP were using the fancier lookups, eg node["rom[0]/name"], which I had to convert to a rather ugly node["rom"].at(0)["name"], which I'm fairly confident won't work. I'm going to blame that on the fumes from the shelves I just stained >.> Might work with node.find("rom[0]/name")(0) though ...? But so ugly ... ugh. That aside, this WIP adds the accuracy-PPU inlining, so the accuracy profile should run around 7.5% faster than before.
73 lines
1.4 KiB
C++
73 lines
1.4 KiB
C++
struct PPU : Thread, public PPUcounter {
|
|
uint8 vram[64 * 1024];
|
|
uint8 oam[544];
|
|
uint8 cgram[512];
|
|
|
|
enum : bool { Threaded = true };
|
|
alwaysinline void step(unsigned clocks);
|
|
alwaysinline void synchronize_cpu();
|
|
|
|
void latch_counters();
|
|
bool interlace() const;
|
|
bool overscan() const;
|
|
bool hires() const;
|
|
|
|
void enter();
|
|
void enable();
|
|
void power();
|
|
void reset();
|
|
|
|
void serialize(serializer&);
|
|
PPU();
|
|
~PPU();
|
|
|
|
privileged:
|
|
unsigned ppu1_version = 1; //allowed: 1
|
|
unsigned ppu2_version = 3; //allowed: 1, 2, 3
|
|
|
|
uint32* surface;
|
|
uint32* output;
|
|
|
|
struct {
|
|
bool interlace;
|
|
bool overscan;
|
|
} display;
|
|
|
|
#include "background/background.hpp"
|
|
#include "mmio/mmio.hpp"
|
|
#include "screen/screen.hpp"
|
|
#include "sprite/sprite.hpp"
|
|
#include "window/window.hpp"
|
|
|
|
Background bg1;
|
|
Background bg2;
|
|
Background bg3;
|
|
Background bg4;
|
|
Sprite sprite;
|
|
Window window;
|
|
Screen screen;
|
|
|
|
static void Enter();
|
|
alwaysinline void add_clocks(unsigned);
|
|
|
|
void scanline();
|
|
void frame();
|
|
|
|
friend class PPU::Background;
|
|
friend class PPU::Sprite;
|
|
friend class PPU::Window;
|
|
friend class PPU::Screen;
|
|
friend class Video;
|
|
|
|
struct Debugger {
|
|
hook<void (uint16, uint8)> vram_read;
|
|
hook<void (uint16, uint8)> oam_read;
|
|
hook<void (uint16, uint8)> cgram_read;
|
|
hook<void (uint16, uint8)> vram_write;
|
|
hook<void (uint16, uint8)> oam_write;
|
|
hook<void (uint16, uint8)> cgram_write;
|
|
} debugger;
|
|
};
|
|
|
|
extern PPU ppu;
|