Rename functions for consistency.

This commit is contained in:
byuu
2019-11-08 16:12:33 +09:00
parent ba3fca27ad
commit da7350ac5c
4 changed files with 10 additions and 10 deletions

View File

@@ -52,8 +52,8 @@ struct CPU : Processor::WDC65816, Thread, PPUcounter {
alwaysinline auto dmaEdge() -> void; alwaysinline auto dmaEdge() -> void;
//irq.cpp //irq.cpp
alwaysinline auto pollNMI() -> void; alwaysinline auto nmiPoll() -> void;
alwaysinline auto pollIRQ() -> void; alwaysinline auto irqPoll() -> void;
auto nmitimenUpdate(uint8 data) -> void; auto nmitimenUpdate(uint8 data) -> void;
auto rdnmi() -> bool; auto rdnmi() -> bool;
auto timeup() -> bool; auto timeup() -> bool;

View File

@@ -191,24 +191,24 @@ auto CPU::writeCPU(uint addr, uint8 data) -> void {
io.htime = (io.htime >> 2) - 1; io.htime = (io.htime >> 2) - 1;
io.htime = io.htime & 0x100 | data << 0; io.htime = io.htime & 0x100 | data << 0;
io.htime = (io.htime + 1) << 2; io.htime = (io.htime + 1) << 2;
pollIRQ(); //unverified irqPoll(); //unverified
return; return;
case 0x4208: //HTIMEH case 0x4208: //HTIMEH
io.htime = (io.htime >> 2) - 1; io.htime = (io.htime >> 2) - 1;
io.htime = io.htime & 0x0ff | (data & 1) << 8; io.htime = io.htime & 0x0ff | (data & 1) << 8;
io.htime = (io.htime + 1) << 2; io.htime = (io.htime + 1) << 2;
pollIRQ(); //unverified irqPoll(); //unverified
return; return;
case 0x4209: //VTIMEL case 0x4209: //VTIMEL
io.vtime = io.vtime & 0x100 | data << 0; io.vtime = io.vtime & 0x100 | data << 0;
pollIRQ(); //unverified irqPoll(); //unverified
return; return;
case 0x420a: //VTIMEH case 0x420a: //VTIMEH
io.vtime = io.vtime & 0x0ff | (data & 1) << 8; io.vtime = io.vtime & 0x0ff | (data & 1) << 8;
pollIRQ(); //unverified irqPoll(); //unverified
return; return;
case 0x420b: //DMAEN case 0x420b: //DMAEN

View File

@@ -1,10 +1,10 @@
//pollNMI() and pollIRQ() are called once every four clock cycles; //nmiPoll() and irqPoll() are called once every four clock cycles;
//as NMI steps by scanlines (divisible by 4) and IRQ by PPU 4-cycle dots. //as NMI steps by scanlines (divisible by 4) and IRQ by PPU 4-cycle dots.
// //
//ppu.(vh)counter(n) returns the value of said counters n-clocks before current time; //ppu.(vh)counter(n) returns the value of said counters n-clocks before current time;
//it is used to emulate hardware communication delay between opcode and interrupt units. //it is used to emulate hardware communication delay between opcode and interrupt units.
auto CPU::pollNMI() -> void { auto CPU::nmiPoll() -> void {
//NMI hold //NMI hold
if(status.nmiHold.lower() && io.nmiEnable) { if(status.nmiHold.lower() && io.nmiEnable) {
status.nmiTransition = 1; status.nmiTransition = 1;
@@ -16,7 +16,7 @@ auto CPU::pollNMI() -> void {
} }
} }
auto CPU::pollIRQ() -> void { auto CPU::irqPoll() -> void {
//IRQ hold //IRQ hold
status.irqHold = 0; status.irqHold = 0;
if(status.irqLine && io.irqEnable) { if(status.irqLine && io.irqEnable) {

View File

@@ -11,7 +11,7 @@ auto CPU::joypadCounter() const -> uint {
auto CPU::stepOnce() -> void { auto CPU::stepOnce() -> void {
counter.cpu += 2; counter.cpu += 2;
tick(); tick();
if(hcounter() & 2) pollNMI(), pollIRQ(); if(hcounter() & 2) nmiPoll(), irqPoll();
if(joypadCounter() == 0) joypadEdge(); if(joypadCounter() == 0) joypadEdge();
} }