Hacker News new | ask | show | jobs
by smirutrandola 630 days ago
Yes that is really impressive.

Still it was done with 50% more memory, 1/3 of resolution and not implementing the whole game features.

1 comments

But with a fraction of CPU resources. Arduino Nano's Cortex M33 is overclocked at 135 MHz, while GBA's ARM7TDMI is running at mere 16.78 MHz.

ARM7TDMI takes 1-4 cycles to perform a simple 32bit x 32bit multiply, depending on the multiplier. I believe Cortex M33 takes just 1 cycle to do same. ARM7TDMI has no divide instruction and critically, no FPU that Quake requires.

GBA has only 32 kB of 0-wait state RAM (AKA internal working RAM). Versus 276 kB on the Arduino Nano.

GBA's 256 kB RAM block (external working RAM) has massive 6 cycle access time when loading a 32-bit value.

It's a true miracle someone managed to even get 1/3 of resolution on this weak hardware!

I think the article says the same. The gba port is impressive.

I guess FPU would not be even required with 120 pix horizontal resolution.

CM33 does in a single cycle even more: 2 16 bits multiplications, addition and accumulation, for instance.

Still it is the first time the "full" Quake was ported in less than 300 kB.

Agreed on other counts except for FPU.

Quake performs one FPU divide per pixel for texture mapping perspective correction.

ARM7TDMI does not have any kind of divide, so perspective correction is tricky, even if it's just 120 px horizontally.

Afaik, Quake does not do one divide per pixel, it is in steps of 8 pixels (see dscan.c in winquake). Yes, there is non divide but instead of taking hundreds of cycles, tables and other approximations could be used. Of course, div/vdiv which take only 14 cycles or less are a strong boost on CM4/33.
Oh, it divides only once every 8 pixels and interpolates in between and still looks so good? I stand corrected.

By the way, it's "d_scan.c" for anyone who's trying to web search for it.

It means almost an order of magnitude less divisions (and additional calculations as well).

Quake had to do this because it would have been too much especially for a low-end Pentium when it was released in 1996. Yes it is not even noticeable, especially at low res.