Actually, the current info regarding RAMBO-1 IRQs is... wrong. I've updated the wiki (discussion page) with my suggestion of how it should work. Of course, I'm guessing and... it's working better than ever.
Is Kevtris around to analyse a RAMBO-1 board and its IRQ timing, like in the old days? He did even a RE of the mapper 90 IRQs!
Skull & Crossbones - Split Screen Shakes - Nestopia
Moderator: Moderators
Re: Skull & Crossbones - Split Screen Shakes - Nestopia
I believe I have figured out how RAMBO-1 IRQ timing works.
http://wiki.nesdev.com/w/index.php/Talk ... IRQ_timing
http://wiki.nesdev.com/w/index.php/Talk ... IRQ_timing
- *Spitfire_NES*
- Posts: 306
- Joined: Fri May 21, 2010 4:10 pm
Re: Skull & Crossbones - Split Screen Shakes - Nestopia
Is this still accurate information Zepper? Nestopia is very close to this IRQ in the undead implementation, and i would like to implement the rest of it if it is.Zepper wrote:I believe I have figured out how RAMBO-1 IRQ timing works.
http://wiki.nesdev.com/w/index.php/Talk ... IRQ_timing
writes to $E001: irq_enable=true; IRQ acknowledge by CPU.
Nestopia was missing this in $E001 and i added it, but it does not seem like hard drivin works correctly with this. Can you confirm?
Re: Skull & Crossbones - Split Screen Shakes - Nestopia
What is the collateral effect?
- *Spitfire_NES*
- Posts: 306
- Joined: Fri May 21, 2010 4:10 pm
Re: Skull & Crossbones - Split Screen Shakes - Nestopia
Well i need to do a little more testing but using that write to $E001: (irq_enable=true; IRQ acknowledge by CPU) makes hard drivin lose it's status bar before passing through the first gate.
At the moment, i am using Zxbdragon's implementation of code from when he added support for hard drivin. This code here:
After looking through what is posted on the talk link for the proper behavior, it is somewhat similar to that but not quite the same. One problem i am running into is not being able to outright add the line for irq_delay firing after 4 cycles due to the level of abstraction. In the hpp file for NstTengenRambo1.hpp i do see this though:
So maybe i can just change that to 4 there after fixing the line of code above. One thing to note is martin's original code for this are used to be this:
At the moment, i am using Zxbdragon's implementation of code from when he added support for hard drivin. This code here:
Code: Select all
// From dragon2snow
if (reload) {
if (latch < 1) {
count = latch + 1;
}
else {
count = latch + 2;
}
reload = false;
}
else if (!count) {
count = latch + 1;
}
count--;
if (!count && enabled) {
/* wait one M2 cycle, then trigger IRQ */
return true;
}
return false;
Code: Select all
struct Irq
{
Irq(Cpu&,Ppu&);
void Update();
enum
{
M2_CLOCK = 4,
A12_FILTER = 16,
IRQ_DELAY = 2,
SOURCE_PPU = 0x0,
SOURCE_CPU = 0x1,
SOURCE = 0x1
};
Code: Select all
bool Rambo1::Irq::Unit::Clock()
{
if (!reload)
{
if (count)
{
return !--count && enabled;
}
else
{
count = latch;
return false;
}
}
else
{
reload = false;
count = latch + 1;
return false;
}
Re: Skull & Crossbones - Split Screen Shakes - Nestopia
Here's my current C code.
Code: Select all
static inline void rambo1_clock(void)
{
if(MMC.irq_reset) {
MMC.irq_counter = MMC.irq_latch+1;
MMC.irq_reset = 0;
} else if(0 == MMC.irq_counter) {
MMC.irq_counter = MMC.irq_latch;
} else {
MMC.irq_counter--;
if((0 == MMC.irq_counter) && MMC.irq_flag && (-1 == m64_irq)) {
MMC.irq_reset = 1;
m64_irq = 3; }
}
}
/* runs at every CPU cycle.
ppuflag is PPUADDR & $1000
*/
static void irq_rambo1(const unsigned int scanline, const unsigned int ppuflag)
{
if(m64_irq > 0)
m64_irq--;
if(0 == m64_irq) {
cpu_irqtrigger(TIRQ_MPR);
m64_irq = -1;
}
if(0 != MMC.write) {
if(0 == MMC.irq_timing) {
rambo1_clock();
MMC.irq_timing = 3;
} else
MMC.irq_timing--;
} else {
if( !ppu_is_rendering() ) { irq_latency = 8; return; }
if(irq_latency > 0)
irq_latency--;
if(!irq_latency && ppuflag)
rambo1_clock();
if(ppuflag)
irq_latency = 8;
}
}
- *Spitfire_NES*
- Posts: 306
- Joined: Fri May 21, 2010 4:10 pm
Re: Skull & Crossbones - Split Screen Shakes - Nestopia
I'll keep messing with it, thanks for posting that up zepper, but is this info still accurate?:
http://wiki.nesdev.com/w/index.php/Talk ... IRQ_timing
http://wiki.nesdev.com/w/index.php/Talk ... IRQ_timing
Re: Skull & Crossbones - Split Screen Shakes - Nestopia
It's a try-and-error result.*Spitfire_NES* wrote:but is this info still accurate?:
http://wiki.nesdev.com/w/index.php/Talk ... IRQ_timing