Why does SMB2J Lost Levels need IRQ counter?

Discuss technical or other issues relating to programming the Nintendo Entertainment System, Famicom, or compatible systems.

Moderator: Moderators

Post Reply
krzysiobal
Posts: 589
Joined: Sun Jun 12, 2011 12:06 pm
Location: Poland

Why does SMB2J Lost Levels need IRQ counter?

Post by krzysiobal » Tue Oct 08, 2019 4:44 am

While the SMB1 uses sprite 0 hit of the coin sprite to split the screen under status bar, SMB2J needs external IRQ source.
* Various FDS ports - M2 counter
* Loopy's MMC3 port - A12 scanline counter
* Mario All Stars MMC5 hack - M2 counter
Why? Because FDS adapter has IRQ counter so the lazy programmers used it?
I thought SMB1 and SMB2J use the same engine, just with different levels/graphics

There appears to be one version without external IRQ hardware, but then the status bar is completely sticked to the background:
https://archive.org/details/youtube-M2-ovBQW978

-

Bonus question: Why does the SMB1 2 players hack (VRC6) also need IRQ counter?

User avatar
dougeff
Posts: 2617
Joined: Fri May 08, 2015 7:17 pm
Location: DIGDUG
Contact:

Re: Why does SMB2J Lost Levels need IRQ counter?

Post by dougeff » Tue Oct 08, 2019 5:33 am

lazy programmers
Every game that uses MMC3, and has a split screen uses an IRQ. Does it make you "lazy" to use the technology for its intended purpose?

No. It wastes CPU time polling the PPU to see if a Sprite zero has occurred. IRQ is better. They made a wise decision.
nesdoug.com -- blog/tutorial on programming for the NES

User avatar
rainwarrior
Posts: 7682
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

Re: Why does SMB2J Lost Levels need IRQ counter?

Post by rainwarrior » Tue Oct 08, 2019 10:34 am

The lazy thing would have been to not use the IRQ and keep the old code. :P

knight0fdragon
Posts: 15
Joined: Wed Sep 25, 2019 9:11 am

Re: Why does SMB2J Lost Levels need IRQ counter?

Post by knight0fdragon » Tue Oct 22, 2019 6:44 am

Using the IRQ would definitely be a lot cleaner and more resourceful.

No need to track or wait for a sprite 0 hit, no need to even waste the sprite in the top right corner.

I have to say, if you have the IRQ counter, use it.

Post Reply