* fix IRQ regression in Power Rangers: Fighting Edition
This commit is contained in:
byuu 2019-08-06 02:48:28 +09:00
parent bad27bb8f3
commit 5757949023
6 changed files with 22 additions and 24 deletions

View File

@ -1,10 +1,9 @@
---------------------------------------------------------------------- ----------------------------------------------------------------------
bsnes - Suite of videogame console emulators bsnes - Super Nintendo emulator
icarus - Game library importer for higan
Copyright © 2004-2019 byuu Copyright © 2004-2019 byuu
https://byuu.org/ https://byuu.org
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
@ -21,12 +20,12 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
---------------------------------------------------------------------- ----------------------------------------------------------------------
---------------------------------------------------------------------- ----------------------------------------------------------------------
hiro - User interface toolkit libco - C cooperative threading library
libco - C cooperative threading library nall - C++ template library
nall - C++ template library ruby - Hardware abstraction library
ruby - Hardware abstraction layer hiro - User interface library
Copyright © 2006-2019 byuu Copyright © 2006-2019 byuu
Permission to use, copy, modify, and/or distribute this software for Permission to use, copy, modify, and/or distribute this software for
any purpose with or without fee is hereby granted, provided that the any purpose with or without fee is hereby granted, provided that the

View File

@ -31,7 +31,7 @@ using namespace nall;
namespace Emulator { namespace Emulator {
static const string Name = "bsnes"; static const string Name = "bsnes";
static const string Version = "108.5"; static const string Version = "108.6";
static const string Author = "byuu"; static const string Author = "byuu";
static const string License = "GPLv3"; static const string License = "GPLv3";
static const string Website = "https://byuu.org"; static const string Website = "https://byuu.org";

View File

@ -1,14 +1,12 @@
auto CPU::idle() -> void { auto CPU::idle() -> void {
status.irqLock = false;
status.clockCount = 6; status.clockCount = 6;
dmaEdge(); dmaEdge();
step<6,0>(); step<6,0>();
status.irqLock = 0;
aluEdge(); aluEdge();
} }
auto CPU::read(uint address) -> uint8 { auto CPU::read(uint address) -> uint8 {
status.irqLock = false;
if(address & 0x408000) { if(address & 0x408000) {
if(address & 0x800000 && io.fastROM) { if(address & 0x800000 && io.fastROM) {
status.clockCount = 6; status.clockCount = 6;
@ -38,6 +36,7 @@ auto CPU::read(uint address) -> uint8 {
step<8,1>(); step<8,1>();
} }
status.irqLock = 0;
auto data = bus.read(address, r.mdr); auto data = bus.read(address, r.mdr);
step<4,0>(); step<4,0>();
aluEdge(); aluEdge();
@ -47,7 +46,6 @@ auto CPU::read(uint address) -> uint8 {
} }
auto CPU::write(uint address, uint8 data) -> void { auto CPU::write(uint address, uint8 data) -> void {
status.irqLock = false;
aluEdge(); aluEdge();
if(address & 0x408000) { if(address & 0x408000) {
@ -79,6 +77,7 @@ auto CPU::write(uint address, uint8 data) -> void {
step<12,1>(); step<12,1>();
} }
status.irqLock = 0;
bus.write(address, r.mdr = data); bus.write(address, r.mdr = data);
} }

View File

@ -43,8 +43,8 @@ auto PPU::Line::renderMode7(PPU::IO::Background& self, uint source) -> void {
bool outOfBounds = (pixelX | pixelY) & ~1023; bool outOfBounds = (pixelX | pixelY) & ~1023;
uint15 tileAddress = tileY * 128 + tileX; uint15 tileAddress = tileY * 128 + tileX;
uint15 paletteAddress = ((pixelY & 7) << 3) + (pixelX & 7); uint15 paletteAddress = ((pixelY & 7) << 3) + (pixelX & 7);
uint8_t tile = io.mode7.repeat == 3 && outOfBounds ? 0 : ppu.vram[tileAddress] >> 0; uint8 tile = io.mode7.repeat == 3 && outOfBounds ? 0 : ppu.vram[tileAddress] >> 0;
uint8_t palette = io.mode7.repeat == 2 && outOfBounds ? 0 : ppu.vram[paletteAddress + (tile << 6)] >> 8; uint8 palette = io.mode7.repeat == 2 && outOfBounds ? 0 : ppu.vram[tile << 6 | paletteAddress] >> 8;
uint priority; uint priority;
if(source == Source::BG1) { if(source == Source::BG1) {

View File

@ -140,7 +140,7 @@ auto PPU::power(bool reset) -> void {
//$2102 OAMADDL //$2102 OAMADDL
//$2103 OAMADDH //$2103 OAMADDH
io.oamBaseAddress = random(); io.oamBaseAddress = random() & ~1;
io.oamAddress = random(); io.oamAddress = random();
io.oamPriority = random(); io.oamPriority = random();

View File

@ -28,16 +28,16 @@ private:
alwaysinline auto addressVRAM() const -> uint16; alwaysinline auto addressVRAM() const -> uint16;
alwaysinline auto readVRAM() -> uint16; alwaysinline auto readVRAM() -> uint16;
alwaysinline auto writeVRAM(bool byte, uint8 data) -> void; alwaysinline auto writeVRAM(bool byte, uint8 data) -> void;
alwaysinline auto readOAM(uint10 addr) -> uint8; alwaysinline auto readOAM(uint10 address) -> uint8;
alwaysinline auto writeOAM(uint10 addr, uint8 data) -> void; alwaysinline auto writeOAM(uint10 address, uint8 data) -> void;
alwaysinline auto readCGRAM(bool byte, uint8 addr) -> uint8; alwaysinline auto readCGRAM(bool byte, uint8 address) -> uint8;
alwaysinline auto writeCGRAM(uint8 addr, uint15 data) -> void; alwaysinline auto writeCGRAM(uint8 address, uint15 data) -> void;
auto readIO(uint addr, uint8 data) -> uint8; auto readIO(uint address, uint8 data) -> uint8;
auto writeIO(uint addr, uint8 data) -> void; auto writeIO(uint address, uint8 data) -> void;
auto updateVideoMode() -> void; auto updateVideoMode() -> void;
struct VRAM { struct VRAM {
auto& operator[](uint addr) { return data[addr & mask]; } auto& operator[](uint address) { return data[address & mask]; }
uint16 data[64 * 1024]; uint16 data[64 * 1024];
uint16 mask = 0x7fff; uint16 mask = 0x7fff;
} vram; } vram;