bsnes/higan/sfc/ppu/ppu.hpp
Tim Allen 810cbdafb4 Update to v097r16 release.
byuu says:

Changelog:
- sfc/ppu/sprite updated to use new .bit(s) functions; masked sizes
  better; added valid flags instead of using magic numbers
- ws/ppu updates to use new .bit(s) functions
- ws/ppu: added line compare interrupt support
- added ws/eeprom; emulation of WS/WSC internal EEPROM and cartridge
  EEPROM (1kbit - 16kbit supported)
- added basic read/write handlers for remaining WS/WSC PPU registers

WS EEPROM emulation is basically a direct copy of trap15's code. Still
some unknown areas in there, but hopefully it's enough to get further
into games that depend on EEPROM support. Note that you'll have to
manually add the eeprom line to the manifest for now, as icarus doesn't
know how to detect EEPROM/sizes yet.

I figured the changes to the SNES PPU sprites would slow it down a tad,
but it actually sped it up. Most of the impact from the integer classes
are gone now.
2016-03-13 11:22:10 +11:00

75 lines
1.6 KiB
C++

#include "video.hpp"
struct PPU : Thread, public PPUcounter {
enum : bool { Threaded = true };
PPU();
~PPU();
alwaysinline auto step(uint clocks) -> void;
alwaysinline auto synchronizeCPU() -> void;
auto latch_counters() -> void;
auto interlace() const -> bool;
auto overscan() const -> bool;
auto main() -> void;
auto enable() -> void;
auto power() -> void;
auto reset() -> void;
auto serialize(serializer&) -> void;
uint8 vram[64 * 1024];
uint8 oam[544];
uint8 cgram[512];
privileged:
uint ppu1_version = 1; //allowed: 1
uint ppu2_version = 3; //allowed: 1, 2, 3
uint32* output = nullptr;
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 auto Enter() -> void;
alwaysinline auto add_clocks(uint) -> void;
auto scanline() -> void;
auto frame() -> void;
friend class PPU::Background;
friend class PPU::Sprite;
friend class PPU::Window;
friend class PPU::Screen;
friend class Video;
struct Debugger {
hook<auto (uint16, uint8) -> void> vram_read;
hook<auto (uint16, uint8) -> void> oam_read;
hook<auto (uint16, uint8) -> void> cgram_read;
hook<auto (uint16, uint8) -> void> vram_write;
hook<auto (uint16, uint8) -> void> oam_write;
hook<auto (uint16, uint8) -> void> cgram_write;
} debugger;
};
extern PPU ppu;