Yes, the Apple II MouseCard IRQ is synced to the VBL

60 mmphosis 24 5/8/2025, 12:19:55 PM colino.net ↗

Comments (24)

alain94040 · 7h ago
I have fond memories of the IRQ from the mouse card. It was the only source of regular interrupts you could get on the Apple II (that I'm aware of). So in 1987, I tried to write a preemptive switcher, so you could run two code paths at the same time.

The development of that code was very painful. At the time, there was no external debugger. The moment you enabled the interrupt, your interrupt handler would get called, and it would try to program a context switch (something the 6502 is definitely not supposed to do). If you had any bug in there, your Apple II would be completely frozen, all you could do is reboot, and try to guess what went wrong and try again.

deater · 6h ago
you can also get a regular interrupt from a Mockingboard sound card, these days it's probably more likely people will have one of those (especially if they are running under emulation) than a mouse card.

when writing demos and games that have mockingboard support it's always tempting to take advantage of the timers on the 6522 chips on it, though it does mean that the programs wouldn't have been useful for most people back in the 80s/90s

geocar · 3h ago
Fun. Mind if I ask what you were preemptively doing?

If you ever get a time machine: The SSC could make an interrupt. So could the Microsoft card. There was also something called the Thunderclock card that could do like 100hz.

vardump · 9h ago
Such an odd choice not to have a timer interrupt on Apple II and then having to do this kind of trickery on a MouseCard. I guess this saved a few bucks...
AndrewStephens · 8h ago
I had an Apple][+ back in the day. You have to understand that the Apple][ predates what we think of as 8-bit computers by a few years and the fact it was cheap enough to mass produce was a minor miracle. Corners were cut everywhere, the Apple][+ didn't even have lowercase letters, a way to detect key up events, or a sensible frame buffer in hires mode.

In its defense, it also predates a lot of what we take for granted. The idea that a game might want to scroll smoothly or update at 50/60 FPS without flickering just didn't occur to people in 1979.

mrob · 8h ago
Galaxian was released in 1979 and features a smooth scrolling background and non-flickering sprites, all at 60 FPS. It's especially notable because it was the first game to use dedicated tiles + sprites graphics hardware, which would become the standard for arcade and console hardware and the main reason why those games looked different from computer games. The earlier Space Invaders (1978) had the CPU draw to a computer-style frame buffer with minimal hardware acceleration (only a barrel shifter to speed up horizontal movement). This was too slow to update all the aliens at 60 FPS so they would only speed up as the number remaining decreased (which worked out well from a gameplay point of view, but the original reason was a technical limitation).
AndrewStephens · 8h ago
OK, you are technically (the best kind of) correct. Some people were thinking of scrolling and sprites in 1979 but those people were using expensive dedicated hardware that would take a few years to filter down to home computers once people saw the advantages.
wat10000 · 7h ago
It’s easy to forget how far apart the low and and high end used to be. When the 8-bit Apple ][ was the hot home computer, you could buy machines with 32-bit CPUs with megabytes of RAM, virtual memory, and floating point, running a multitasking, multiuser OS. But such a thing cost more than a luxury car, maybe more than a nice house.

Cost was the innovation for those early home computers. They weren’t doing anything remarkable, except for doing it at a price ordinary people could actually afford. If you were willing to spend more (because the computer ran your payroll, or because the computer got people to drop quarters into it all day long) you could get much more capable stuff.

These days you can drop a few hundred bucks and get something that’s not too far off from the best that money can buy. The main difference between a cheap PC and what passes for a “supercomputer” these days is that the supercomputer has much better interconnects and there’s just a lot more of it.

philiplu · 2h ago
My first computer, purchased in 1978 for about $700, was an 8k Commodore PET. I've just finished building my first new PC in 15 years; a Zen 5 9950X with 96G RAM and a 4TB PCIe-5 SSD for about $2800. That's roughly the same, inflation-adjusted, as that PET!

It's been a real trip watching the accumulation of exponential improvements the past 50 years.

wat10000 · 1h ago
And if you managed to go out and spend a million dollars on a computer instead, it wouldn’t be all that different from what you bought here. The CPUs would be very similar, similar RAM and storage, etc. It would be a lot more powerful, but that mostly comes from scaling horizontally. More RAM, more CPUs, more everything. But it will run the same sort of software and run most of it about as fast, just more of it at once.
vardump · 6h ago
https://en.wikipedia.org/wiki/Atari_8-bit_computers

Atari 800 Home Computer System was released in 1979 and had both bitmap and character graphics as well as sprites.

AndrewStephens · 5h ago
The Atari really did have amazing graphics capabilities but the basic Apple][ design predates it by at least 2 years. Apple were slow to add graphical enhancements to the ][ line, perhaps not wanting to be labeled as a mere "gaming" machine.
EvanAnderson · 5h ago
Atari had the capital to use custom ASICs to provide that functionality. The Apple II was all off-the-shelf parts.
zellyn · 9h ago
That sentence is the Apple II hardware in a nutshell! save a chip or two but completely scramble the video buffer? Absolutely!

The Commodore 64 is _so_ much better for graphics and sound it's not even funny, but if you look at the timelines, it came along a _while_ later than the Apple II.

colinlm · 8h ago
To be fair, starting with the Apple IIe, the $C019 softswitch is a good, light way of syncing to VBL. Doing it with the mouse IRQ has an advantage when one requires a mouse, though: it works the same way on the whole line of Apple II computers, starting with the II+.

Without the mouse IRQ, if one wants to support the whole line of Apple II computers, one has to vapor lock on the II+, remember that the IIgs's $C019 high bit means the inverse than the IIe, and the //c requires more trickery around it. (cf https://github.com/cc65/cc65/blob/master/libsrc/apple2/waitv...)

thought_alarm · 5h ago
It's not odd at all for a machine that was designed in 1976/77.

However, for a machine released in 1983 (the Apple IIe) it is indeed very odd. But the IIe is an odd machine in many ways.

The Apple II platform stagnated as Apple poured all their resources into the Apple III (which has all those features and much more).

The Apple II refused to die, so Apple assigned a pair of engineers to design a cost-reduced version of the Apple II, and this became the IIe. The goal was only to minimize manufacturing costs, so the new features like timers were off the table.

The IIe became an unexpected smash hit in the home and education markets (stealing those markets from the 128k Mac), and only then did Apple devote some new resources to the platform (and reposition the 128k Mac as a laughably underpowered productivity machine).

The Apple IIc (1984) was the first Apple II to get a proper modern makeover. Of course it was a flop, while the odd-ball IIe continued to fly off the shelves.

mjevans · 7h ago
Everything was _way_ more expensive back then, and the CRT monitors had to be driven with electron beam steering gaps (blanks) while the output cycled to the next row.

Thus there was downtime for an otherwise idle chip to do some work, and yes, saving a few dollars or 10s of dollars in 1970s money was a LOT of money!

empressplay · 8h ago
That mouse card is tricky to emulate. I'm surprised actually that the author's shufflepuck port seems to work fine in our Apple IIe emulator, microM8, since our mouse code is a bit of a mess!
NBJack · 7h ago
Oof, that website is not vision friendly. I'm all for cool fonts, but thin fonts that are also faded grey? My eyes hurt trying to read it.
Narishma · 7h ago
Use reader mode.
crazygringo · 7h ago
That is not a helpful reply.

Lots of browsers don't have reader mode, or it sucks. Chrome, for example, puts it in a tiny narrow sidebar where it is ironically difficult to read. Images are removed or mangled. It's a mess. And you don't always have a choice of which browser you get to use anyways.

The responsibility to ensure text is readable lies with websites, not with browser features that a user may or may not have.

kevin_thibedeau · 5h ago
Chrome is an ad delivery platform and reader mode subverts ads. You're getting what you paid for.
crazygringo · 3h ago
I'm getting what I paid for with Firefox too. Their funding mostly comes from Google which comes from ads too. What's your point?
wat10000 · 6h ago
It’s helpful if you want to be helped and not just complain.

Your browser doesn’t have it, or it’s bad? Use a different one!

Responsibility? Responsibility and five bucks will get you a coffee at Starbucks.

You can solve the problem, or talk about how other people should solve it. Do whichever one you prefer, but only one of them actually produces the desired outcome.