ppu2c0x & vsnes privatize variables (nw)

This commit is contained in:
angelosa 2017-05-10 05:46:55 +02:00
parent b77b373fec
commit e7819b59af
2 changed files with 53 additions and 49 deletions

View File

@ -191,6 +191,26 @@ public:
required_device<cpu_device> m_cpu;
// some bootleg / clone hardware appears to ignore this
static void use_sprite_write_limitation_disable(device_t &device)
{
ppu2c0x_device &dev = downcast<ppu2c0x_device &>(device);
dev.m_use_sprite_write_limitation = false;
}
protected:
int m_scanlines_per_frame; /* number of scanlines per frame */
int m_security_value; /* 2C05 protection */
int m_vblank_first_scanline; /* the very first scanline where VBLANK occurs */
private:
static const device_timer_id TIMER_HBLANK = 0;
static const device_timer_id TIMER_NMI = 1;
static const device_timer_id TIMER_SCANLINE = 2;
inline uint8_t readbyte(offs_t address);
inline void writebyte(offs_t address, uint8_t data);
std::unique_ptr<bitmap_ind16> m_bitmap; /* target bitmap */
std::unique_ptr<uint8_t[]> m_spriteram; /* sprite ram */
std::unique_ptr<pen_t[]> m_colortable; /* color table modified at run time */
@ -215,9 +235,6 @@ public:
int m_color_base;
uint8_t m_palette_ram[0x20]; /* shouldn't be in main memory! */
int m_scan_scale; /* scan scale */
int m_scanlines_per_frame; /* number of scanlines per frame */
int m_vblank_first_scanline; /* the very first scanline where VBLANK occurs */
int m_security_value; /* 2C05 protection */
int m_tilecount; /* MMC5 can change attributes to subsets of the 34 visible tiles */
int m_draw_phase; /* MMC5 uses different regs for BG and OAM */
ppu2c0x_latch_delegate m_latch;
@ -226,23 +243,8 @@ public:
emu_timer *m_hblank_timer; /* hblank period at end of each scanline */
emu_timer *m_nmi_timer; /* NMI timer */
emu_timer *m_scanline_timer; /* scanline timer */
// some bootleg / clone hardware appears to ignore this
static void use_sprite_write_limitation_disable(device_t &device)
{
ppu2c0x_device &dev = downcast<ppu2c0x_device &>(device);
dev.m_use_sprite_write_limitation = false;
}
bool m_use_sprite_write_limitation;
private:
static const device_timer_id TIMER_HBLANK = 0;
static const device_timer_id TIMER_NMI = 1;
static const device_timer_id TIMER_SCANLINE = 2;
inline uint8_t readbyte(offs_t address);
inline void writebyte(offs_t address, uint8_t data);
};
class ppu2c02_device : public ppu2c0x_device {

View File

@ -29,35 +29,6 @@ public:
optional_memory_region m_gfx1_rom;
int m_coin;
int m_do_vrom_bank;
int m_input_latch[4];
int m_sound_fix;
uint8_t m_last_bank;
std::unique_ptr<uint8_t[]> m_vram;
uint8_t* m_vrom[2];
std::unique_ptr<uint8_t[]> m_nt_ram[2];
uint8_t* m_nt_page[2][4];
uint32_t m_vrom_size[2];
int m_vrom_banks;
int m_zapstore;
int m_old_bank;
int m_drmario_shiftreg;
int m_drmario_shiftcount;
int m_size16k;
int m_switchlow;
int m_vrom4k;
int m_MMC3_cmd;
int m_MMC3_prg_bank[4];
int m_MMC3_chr_bank[6];
int m_MMC3_prg_mask;
int m_IRQ_enable;
int m_IRQ_count;
int m_IRQ_count_latch;
int m_VSindex;
int m_supxevs_prot_index;
int m_security_counter;
int m_ret;
DECLARE_WRITE8_MEMBER(sprite_dma_0_w);
DECLARE_WRITE8_MEMBER(sprite_dma_1_w);
DECLARE_WRITE8_MEMBER(vsnes_coin_counter_w);
@ -129,7 +100,38 @@ public:
DECLARE_WRITE8_MEMBER(bootleg_sound_write);
DECLARE_READ8_MEMBER(vsnes_bootleg_z80_data_r);
DECLARE_READ8_MEMBER(vsnes_bootleg_z80_address_r);
private:
int m_coin;
int m_do_vrom_bank;
int m_input_latch[4];
int m_sound_fix;
uint8_t m_last_bank;
std::unique_ptr<uint8_t[]> m_vram;
uint8_t* m_vrom[2];
std::unique_ptr<uint8_t[]> m_nt_ram[2];
uint8_t* m_nt_page[2][4];
uint32_t m_vrom_size[2];
int m_vrom_banks;
int m_zapstore;
int m_old_bank;
int m_drmario_shiftreg;
int m_drmario_shiftcount;
int m_size16k;
int m_switchlow;
int m_vrom4k;
int m_MMC3_cmd;
int m_MMC3_prg_bank[4];
int m_MMC3_chr_bank[6];
int m_MMC3_prg_mask;
int m_IRQ_enable;
int m_IRQ_count;
int m_IRQ_count_latch;
int m_VSindex;
int m_supxevs_prot_index;
int m_security_counter;
int m_ret;
uint8_t m_bootleg_sound_offset;
uint8_t m_bootleg_sound_data;
};