mirror of
https://github.com/bsnes-emu/bsnes.git
synced 2025-02-24 07:02:27 +01:00
byuu says: Note: balanced/performance profiles still broken, sorry. Changelog: - added nall/GNUmakefile unique() function; used on linking phase of higan - added nall/unique_pointer - target-tomoko and {System}::Video updated to use unique_pointer<ClassName> instead of ClassName* [1] - locate() updated to search multiple paths [2] - GB: pass gekkio's if_ie_registers and boot_hwio-G test ROMs - FC, GB, GBA: merge video/ into the PPU cores - ruby: fixed ~AudioXAudio2() typo [1] I expected this to cause new crashes on exit due to changing the order of destruction of objects (and deleting things that weren't deleted before), but ... so far, so good. I guess we'll see what crops up, especially on OS X (which is already crashing for unknown reasons on exit.) [2] right now, the search paths are: programpath(), {configpath(), "higan/"}, {localpath(), "higan/"}; but we can add as many more as we want, and we can also add platform-specific versions.
110 lines
1.9 KiB
C++
110 lines
1.9 KiB
C++
#include "video.hpp"
|
|
|
|
struct PPU : Thread {
|
|
static auto Main() -> void;
|
|
auto main() -> void;
|
|
auto tick() -> void;
|
|
|
|
auto scanline() -> void;
|
|
auto frame() -> void;
|
|
|
|
auto power() -> void;
|
|
auto reset() -> void;
|
|
|
|
auto read(uint16 addr) -> uint8;
|
|
auto write(uint16 addr, uint8 data) -> void;
|
|
|
|
auto ciram_read(uint16 addr) -> uint8;
|
|
auto ciram_write(uint16 addr, uint8 data) -> void;
|
|
|
|
auto cgram_read(uint16 addr) -> uint8;
|
|
auto cgram_write(uint16 addr, uint8 data) -> void;
|
|
|
|
auto raster_enable() const -> bool;
|
|
auto nametable_addr() const -> uint;
|
|
auto scrollx() const -> uint;
|
|
auto scrolly() const -> uint;
|
|
auto sprite_height() const -> uint;
|
|
|
|
auto chr_load(uint16 addr) -> uint8;
|
|
|
|
auto scrollx_increment() -> void;
|
|
auto scrolly_increment() -> void;
|
|
|
|
auto raster_pixel() -> void;
|
|
auto raster_sprite() -> void;
|
|
auto raster_scanline() -> void;
|
|
|
|
auto serialize(serializer&) -> void;
|
|
|
|
struct Status {
|
|
uint8 mdr;
|
|
|
|
bool field;
|
|
uint lx;
|
|
uint ly;
|
|
|
|
uint8 bus_data;
|
|
|
|
bool address_latch;
|
|
|
|
uint15 vaddr;
|
|
uint15 taddr;
|
|
uint8 xaddr;
|
|
|
|
bool nmi_hold;
|
|
bool nmi_flag;
|
|
|
|
//$2000
|
|
bool nmi_enable;
|
|
bool master_select;
|
|
bool sprite_size;
|
|
uint bg_addr;
|
|
uint sprite_addr;
|
|
uint vram_increment;
|
|
|
|
//$2001
|
|
uint3 emphasis;
|
|
bool sprite_enable;
|
|
bool bg_enable;
|
|
bool sprite_edge_enable;
|
|
bool bg_edge_enable;
|
|
bool grayscale;
|
|
|
|
//$2002
|
|
bool sprite_zero_hit;
|
|
bool sprite_overflow;
|
|
|
|
//$2003
|
|
uint8 oam_addr;
|
|
} status;
|
|
|
|
struct Raster {
|
|
uint16 nametable;
|
|
uint16 attribute;
|
|
uint16 tiledatalo;
|
|
uint16 tiledatahi;
|
|
|
|
uint oam_iterator;
|
|
uint oam_counter;
|
|
|
|
struct OAM {
|
|
uint8 id;
|
|
uint8 y;
|
|
uint8 tile;
|
|
uint8 attr;
|
|
uint8 x;
|
|
|
|
uint8 tiledatalo;
|
|
uint8 tiledatahi;
|
|
} oam[8], soam[8];
|
|
} raster;
|
|
|
|
uint32 buffer[256 * 262];
|
|
uint8 ciram[2048];
|
|
uint8 cgram[32];
|
|
uint8 oam[256];
|
|
};
|
|
|
|
extern PPU ppu;
|