掌上游戏机GBA颂
An Ode to the Game Boy Advance

原始链接: https://brainbaking.com/post/2025/03/an-ode-to-the-game-boy-advance/

Game Boy Advance(GBA)于2001年推出,是其前辈产品的一次重大升级,它配备了32位ARM CPU,能够实现SNES级别的游戏品质。GBA在保持价格亲民和向下兼容性的同时,强调其先进的技术,其上市游戏例如《恶魔城:月轮》和《超级马里奥Advance》就体现了这一点。 尽管功能强大,但GBA的屏幕没有背光,这在后来的GBA SP中得到了解决,GBA SP采用了翻盖设计,可充电电池,并最终配备了背光屏幕。后来的改进版Game Boy Micro则优先考虑便携性,采用了小巧的设计和清晰的屏幕,但牺牲了向下兼容性。 与早期的Game Boy相比,GBA的架构在内存和处理能力方面都有所提高。其设计注重经济性,没有配备专门的音频硬件,而是依赖于基于软件的混音。尽管寿命短暂,但GBA衍生出众多配件,并且拥有蓬勃发展的自制游戏开发场景,使其成为学习硬件架构和软件开发的平台。

Hacker News 最新 | 过去 | 评论 | 提问 | 展示 | 招聘 | 提交 登录 致敬Game Boy Advance (brainbaking.com) 5 分,来自 Brajeshwar,59 分钟前 | 隐藏 | 过去 | 收藏 | 讨论 加入我们,参加6月16日至17日在旧金山举办的AI创业学校! 指南 | 常见问题 | 列表 | API | 安全 | 法律 | 申请 YC | 联系我们 搜索:
相关文章
  • (评论) 2024-04-23
  • (评论) 2023-12-28
  • Game Boy / 色彩架构 2023-12-28
  • 世嘉土星架构 – 实用分析 (2021) 2024-03-27
  • (评论) 2024-08-23

  • 原文

    In March 2001, Nintendo introduced an advanced portable model to the gaming market with the release of the Game Boy Advance (GBA, codenamed Advanced Game Boy or AGB). Equipped with a modernized 32-bit ARM CPU running at twice the speed of the Game Boy Color (GBC), this small device was more than capable of playing SNES-like games—still at the price of only two AA batteries.

    The third major Game Boy revision indeed again proved to be a smashing hit, breaking various sales records during its relatively short lifespan. According to Eurogamer, in the United Kingdom, the GBA sold four times as much units in its first first week of release as the PlayStation 2. Although Gunpei Yoko’s “Lateral Thinking with Withered Technology” design philosophy was still applied (the system was still cheap: priced at $99.99—About $146.37 in 2020), it was clear that the technical specifications of the GBA were put into the spotlight. Why else would you name something “Advance” or put “32 bit” on the box? It almost feels like a poor apology: “We’re sorry about the GBC. This time, the model really is advanced, we promise!”

    It becomes even more obvious when looking at a selection of the system’s launch titles that liked to brag about the capabilities of the new Game Boy model:

    • Castlevania: Circle of the Moon. Phenomenal music, a huge castle to explore, and nimble Vampire Killing moves that were not even seen in Castlevania IV for the SNES.
    • Super Mario Advance. Don’t dismiss this as a bleak adaptation of Super Mario Bros. 2 (which, in turn, is an adaptation of Doki Doki Panic): Nintendo R&D2 put a lot of effort in embedding rotating, popping, whooshing, bouncing, and stretching animations. The message is clear: “Dear game devs, look at this! The GBA has hardware-acceleration for this! Now go make games for it!”
    • F-Zero: Maximum Velocity. A handheld that can do Mode-7 tricks such as rotating, scaling, and skewing background layers? Finally! No more archaic HDMA tricks are required to master.

    Next to showcasing the GBA’s strengths, the games also showed its biggest weakness: there was still no backlit screen. This became especially painful for Castlevania fans like me: the grim setting did not exactly benefit from highly contrasting colors like the more cheerful Super Mario Advance did. Without a proper light source, this often resulted in a dark gooey mess that made an already punishing difficulty even more frustrating. Complaints about the contrast even made Konami go all out on the colors for their the next GBA Castlevania game, Harmony of Dissonance, that was criticized for… it’s too bright color palette.

    Castlevania: Circle of the Moon, played indoors on a cloudy day (left, simulated). You better mash that attack button since the background and foreground are barely distinguishable... Right: running in the mGBA emulator. With the ample contrast from a PC screen, the Skeleton Bomber on the right stands out.

    This problem was not new but made even more pressing since, compared to its predecessor, the palette size dramatically increased and the picture resolution was boosted by 66%. These features delivered sharp pictures with little motion blur—as long as you could see what you were doing. Circle of the Moon did age beautifully, provided you play it on a more modern system that enables you to easily spot the eminent dangers in the castle corridors.

    Instead of only attracting newcomers to the handheld gaming scene, engineers at Nintendo made sure to keep their regular customers happy as well by shipping the hardware with a second CPU: the trusty old Sharp LR35902. This enabled GBA machines to play GB and GBC games with no compromises. Since the GBA screen is horizontally-oriented and the original Game Boy was not, players were given the option to either play at the intended aspect ratio or to stretch the image to fill the GBA’s screen by pressing L orR. Both options come at a cost: either the actual image size is smaller than the original handheld, or the image is blurry.

    Backwards compatibility was, and still is, a huge selling point. In the fall of 2001, home console players would be left in the cold again as Nintendo finally switched from cartridge-based games on the N64 to mini-DVDs on the GameCube. Fortunately, Nintendo handheld consoles were consistently developed with compatibility in mind: the GBC plays GB games, the GBA plays GB and GBC games, the Nintendo DS plays GBA games, and the Nintendo 3DS plays DS games. In addition, the Nintendo 3DS eShop sold various older handheld games. And yes, the Goomba Color emulator technically allows you to play GB/GBC games on your Game Boy Micro or Nintendo DS using a GBA flash cart.

    Inspecting the lifespan of the Nintendo handhelds yields a few interesting facts. The clever decision to engineer revisions of the original hardware significantly prolonged the lifespan of the Game Boy, by then already going strong for seven years. The frequent hardware revision strategy became common for all Nintendo handhelds.

    The lifespan of Nintendo handhelds and consoles. First group (lightgreen): the Game Boy family. Second group (darkgreen): the GBA family. Consoles are marked in orange. The Nintendo 3DS (not pictured), part of the eighth generation, saw the light in 2011.

    The GBA was only two years old when it got its first revision, the SP—that’s a lot quicker than the seven year gap between the original and the Pocket. That faster cadence was maintained when looking at the Nintendo DS and 3DS. However, the total lifespan of the GBA—apart from the eccentric GB Micro—was much shorter than the GB family: the GBA came in 2001 and went in 2004 as the DS was released.

    And yet, Nintendo did not at all drop support for the GBA. Then why would a company release another handheld that poses a threat to its own product? An IGN press report from November 2003 sheds some light on this:

    Early Thursday morning Nintendo confirmed that it had posted a loss for the beginning half of the fiscal year, the first time ever in the company’s history. It also said it would develop a new game product which would not be the successor to GameCube or GBA for release in 2004, but no further details were specified.

    The company was struggling to keep up in the console race, with Sony’s PlayStation stealing N64’s thunder and Microsoft entering the market with the Xbox in 2001. The GameCube was doing pretty bad compared to the PS2. Nintendo initially did not intend for the Nintendo DS to succeed the GBA, although in the end, it of course did. Instead, they were looking for something in-between a console and classic gaming handheld, something that would appeal to a much broader audience than just gamers. A slew of successful non-gamer friendly software titles such as Dr. Kawashima’s Brain Training and Nintendogs did just that.

    Ultimately, the Nintendo DS family sold almost twice as much as the GBA family. The huge success of the DS launch did not stop Nintendo from releasing another revision for the GBA, though: the tiny Game Boy Micro. With dimensions of only 50×101×17.2 mm and a weight of 80 g, tiny is definitely the correct word to use. According to the then Vice President George Harrison, the Game Boy line was Nintendo’s testbed where they continuously and intentionally aspired to invent instead of merely reiterate.

    However, inventing does not necessarily mean commercial success. Indeed, according to financial reports in 2007, the Game Boy Micro was Nintendo’s worst selling handheld ever, only clocking in about 2.5 million units. Then Nintendo President Satoru Iwata later admitted that the Nintendo DS may have kept the Micro from performing better sales-wise:

    The sales of Micro did not meet our expectations. Micro showed different sales in and outside Japan. In Japan, initial sales of Micro were rather good and it did become a rather hot topic. So, there was the possibility for this product to grow in Japan. However, toward the end of 2005, Nintendo had to focus almost all of our energies on the marketing of DS, which must have deprived the Micro of its momentum. This is why Micro couldn’t meet our expectations in Japan.

    Project Atlantis, the fitting codename for a new Game Boy, was sunk in 1997 for the same reason: Nintendo feared a new model would get in the way of the original Game Boy that still had a firm grasp of the handheld market. Atlantis was designed to be a proper successor to the original Game Boy, supposedly equipped with a 32-bit processor and a color screen. Instead, Nintendo again showed its conservative side by prolonging the Game Boy lifespan with the GBC. The 32-bit CPU idea was preserved in the freezer until 2001.

    The overlapping lifespans of consoles compared to the handhelds is also worth looking at. When the GBC saw the light in 1998, the Nintendo 64 was already trying to prove itself as the SNES successor for two years. The lifespan of successive consoles and handhelds did shorten a little as the hardware engineering time decreased, eventually coinciding the lifespan of handhelds with consoles of the previous generation.

    Several NES games were ported to GBC, sometimes even boasting improved graphics (Dragon Quest I/II, Super Mario Bros.). The GBA has jokingly be called “a portable SNES”, and the Nintendo DS hardware made it possible to run a modified version of Super Mario 64 and Diddy Kong Racing on it, before the 3DS brought the big guns with The Legend of Zelda: Ocarina of Time 3D and even excellent ports of GameCube games such as Luigi’s Mansion.

    The GBA PCBs, front (top) and back (bottom), revision 03.

    There’s surprisingly little to see on the PCBs pictured above, as most components, including the second CPU, are embedded into the CPU-AGB casing in the middle. The chip on the top right is the 256 KB WRAM. The crystal to the left of the CPU runs at 4.194 MHz, as indicated on top o it: that is the same speed as the original Game Boy. The effective CPU speed was doubled for GBC and quadrupled for GBA games! The last visible chip on the front of the PCB is the LCD regulator marked AGB-REG, at the far left.

    The back of the motherboard showcases the amplifier on the lower left (AMP AGB), close to the volume potentiometer and the speaker. The messy ribbon connector and red wire is the result of my unprofessional attempt at replacing the stock screen with a backlit one. The new screen taps into the power supply of the GBA via that wire. Since the CPU is located at the back of the PCB this time, no aluminum shield is required to separate it from the cartridge slot. However, great care is needed when reassembling the unit with a thicker custom screen that puts a fair amount of pressure on the CPU casing.

    Technically, the GBA was about twice as fast as the GBC and had eight times that much memory:

    Specification Value
    CPU 16.8 MHz 32-bit ARM7TDMI and Sharp co-processor
    Memory 256 KB work WRAM, 128 KB video VRAM
    Cartridges up to 32 MB
    Screen 240 width x 160 height (3:2 aspect ratio)
    Colors 15-bit RGB
    Audio Two 8-bit Digital-to-Analog Converters (DAC), four legacy channels from the original GB
    Audio output Stereo

    At first sight, these numbers look impressive compared to Nintendo’s SNES that housed the slower 16-bit Ricoh 5A22 processor. Both PPUs have similar capabilities, also including DMA and HDMA systems for speedy memory read/write cycles. However, perhaps the most noticeable difference is the lack of a proper audio subsystem. The two DAC components merely stream and convert bytes into analog audio waves (at a painfully low 8-bit resolution): mixing and applying effects had to be done in software, consuming precious CPU cycles. Nintendo hoped game developers partially relied on the Sharp co-processor to produce 8-bit sound effects, which in the end few games utilized efficiently.

    Another feature borrowed from the SNES was the addition of the shoulder buttons. The action buttons X and Y had to wait until the DS. Whether the GBA designers borrowed the horizontal handheld layout from Sega’s Game Gear, we’ll probably never know. The decision did make the system more comfortable to hold and play for longer periods.

    The screen of the GBC could already handle 15-bit RGB values but the small memory footprint of the hardware limited the color palette. The GBA, with its more comfortable memory size, increased the color range from 56 to 256 for the foreground and another 256 for the background.

    The GBA SP

    Instead of waiting seven years to redesign the first Advanced model, The GBA “SP” (codenamed AGS) was released only two years after the original GBA. The fairly new horizontal layout was promptly thrown out of the window in favor of a model that resembles the GBC, except that the clamshell design enabled you to fold it in half. A closed GBA SP, measuring only about 8.4 cm, was finally the ultimate pocketable gaming machine.

    According to Nintendo, the redesign was issued to address two major complaints of the original design. First, it was supposedly uncomfortable to use, hence the new layout. In practice, most players complained that it was in fact the SP model that hurt their hands, locking fingers in a cramped position because of the new clamshell design.

    Second, the complaints about the contrast of the screen were finally taken into account. Well, not entirely. The first SP model (AGS-001) included an internal front-light that could be toggled on and off. It acts as a Game Boy with an embedded Light Boy accessory. The result was better than the first GBA, but still not great, as frontlit LCD screens tend to have washed out colors. Fortunately, the revised revision (AGS-101) finally included a proper backlit screen—although you had to wait another two years for that, and Europeans were disadvantaged again with the extremely limited availability.

    The GBA SP ended an era of hauling a slew of AA (or, in the case of the Pocket, AAA) batteries together with your favorite handheld system. An integrated rechargeable lithium-ion battery compartment was finally introduced, that, according to the official specifications, should keep you busy up to eighteen hours, provided the screen light is disabled. The comfort that was gained with the charging system was suddenly lost once you wanted to plug in your headphones: the headphone jack disappeared, in favor of an awkward adapter—to be bought separately, of course—that plugs into the same AC port as the power charger. Without even more adapters, it was impossible to use headphones and charge the system simultaneously. Take that, spare AA batteries.

    The Game Boy Micro

    In 2005, Nintendo brought back the horizontal layout by introducing the Game Boy Micro, codenamed OXY. It looks like the result of a how-small-can-we-possibly-go contest: measuring just 10 cm wide and 5 cm long, and weighing only 80 g, this petite Game Boy could even slip in the same pocket as your keys. Although you better not do that since the casing was metallic this time and thus scratches easily. Also, you run into the risk of fishing out your Micro instead of your car key since both are equally small.

    A comparison of Game Boy screen sizes (actual size). Dimensions in millimeter. GBA aspect ratios are 3:2 (in purple), while GB aspect ratios are approximately 10:9 (in orange for GBC, in gray for Pocket and Classic).

    Roughly one third of the screen size disappeared. However, the reduced size did deliver extremely crisp images as the pixels per inch or PPI increased from 99 to 144. Together with a nice and bright backlit screen, the Micro almost creates the illusion of being able to play GBA games at High Definition image quality. Oh, and the headphone jack returned.

    Is this the one Game Boy system to rule them all? That depends on whether backwards compatibility is high on your priority list, as Nintendo decided, for the very first time in their handheld division, to drop support for older Game Boy cartridges. It might not come to a big surprise considering the physical size of the machine. A small portion of the 8-bit Sharp CPU is still present since GBA games could make use of its 4-channel APU.

    A comparison of Game Boy device sizes (actual size). Dimensions in millimeter.

    The GBA CPU Architecture

    A simplified schematic of the GBA hardware architecture. Memory components are marked in orange (BIOS ROMs not depicted). Components are connected with a hybrid 8-bit (GBC ROM, SRAM) Based on Rodrigo Copetti's Game Boy Diagram.

    Twelve years of technological progress since the original Game Boy is clearly reflected in the GBA architecture. For example, the meager 8KB RAM module that used to sit on the PCB next to the CPU has now been partially embedded by splitting RAM into bigger IWRAM (Internal Work RAM) and EWRAM (External Work RAM) chunks, thus enabling faster data access speeds.

    The presence of the 8-bit Sharp CPU did not mean work could be offloaded to this co-processor. It was only there to make sure the machine was backwards compatible with older game cartridges. However, programmers could still access the older CPU’s APU unit to produce retro sounds. A hardware cartridge selector switch determines which CPU and BIOS to activate.

    Even if the CPU can indeed work with 32-bit data without consuming extra cycles, most components, including most memory blocks (except IWRAM), are connected to the central system using only a 16-bit bus. This decision, and the absence of a proper music chip, further reduced manufacturing costs.

    Another difference compared to the original GB is the lack of a MBC component on GBA cartridges. The full 32 MB ROM data is mapped onto the address space without having to read in chunks of a few kilobytes. The GBA still relies on the memory-mapped IO concept and there is, for better or for worse, still no Operating System to deal with. The address space did increase from 16-bit ($0000 to $FFFF on the GB) to 32-bit ($00000000 to $FFFFFFFF) to accommodate the increased size of most subsystems. The full address space looks like this:

    A visual representation of the GBA's 32-bit address space. Based on DuoDreamer's DreamScape Game Boy Memory Map.

    • $00000000-$00003FFF—16 KB, 32-bit: System ROM, containing the BIOSes and special system functions that could be executed (such as DMA and calculating the square root) but not read.
    • $02000000-$02030000—256 KB, 16-bit: EWRAM. Address space used to store temporary variables, external to the CPU.
    • $03000000-$03007FFF—32 KB, 32-bit: IWRAM. Faster but smaller RAM to store temporary variables, internal to the CPU.
    • $04000000-$040003FF—1 KB, 16-bit: IO Registers. Various external inputs and interrupts can be controlled here. This is a very dense area: almost every bit has a special meaning.
    • $05000000-$070003FF—98 KB, 16-bit: VRAM. The first kilobyte stores two palettes of 256 color entries. The last kilobyte contains object data. The rest of the 96 KB is reserved for tiles and background data used by the PPU to draw the screen.
    • $08000000-$????????—?? KB, 16-bit: Cartridge ROM, that can take up to 32 MB in space, 16 times the depicted purple block. The same anti-piracy protection persisted that required game developers to license and store the Nintendo logo at a specific location.
    • $0E000000-$????????—?? KB, 8-bit: Cartridge RAM. This RAM is external and optional. Contrary to most older GB games, GBA games almost always come equipped with a RAM chip, on average about 64 KB.

    In essence, programming on the GBA did not differ much from the GB. It was still a machine that required you to fiddle with addresses. Fortunately, this time, it came with the advantages of software development in the early twenty-first century: high level programming languages, proper debug tools, better compilers and documentation, and last but not least: internet access in case things go awry.

    Games were written in the C programming language, so developers were finally relieved of constructing intricate but tiresome assembly routines. Sadly, the latter statement turned out to be too good to be true.

    Processing Instructions

    The GBA CPU chip came with a few perks that were absolutely essential to master. Instead of its older brother, the 8-bit Sharp CPU, the 32-bit ARM7TDMI RISC CPU did not come equipped with one but with two instruction sets!

    The ARM company created their own standard instruction set for all ARM CPUs, thoughtfully called the ARM instruction set. The CPU understands 32-bit A32 instructions, which is an ARM dialect in pre-ARMV8 architectures. Instead of the 8-bit Game Boy load instruction LD A,B, we now write LDR A,B. The result is the same: LD (LoaD) or LDR (Load RegisteR) are just verbs of different languages. Since the ARM core is much more advanced than the older Sharp core, its instruction set is more powerful. Remember, the ARM7 processor has 16 32-bit registers available.

    However, ARM code translates into 32 occupied bits. That is a lot on a limited machine. 00010111000000000001100000000111 is just one instruction. To increase the code density, programmers could decide to use the second available instruction set instead, called Thumb mode. These Thumb instructions are a subset of ARM: everything that can be expressed as Thumb can also be written as ARM, but not (that easily) the other way around. Thumb instructions only occupy 16 bits, half of the size of ARM code.

    The most compelling reason to use Thumb was not its reduced size, but its increased speed while accessing 16-bit bus subsystems such as EWRAM. The problem with using a 32-bit based instruction set such as ARM is that everything will be expressed as 32-bit data. That means 16-bit data will get converted into 32-bit data, wasting a precious cycle in the process. Since most GBA subsystems have 16-bit buses, it only makes sense to use a 16-bit instruction set: Thumb.

    In practice, both ARM and Thumb saw its use. Most C code would get compiled into Thumb assembly, after which hand optimizing crucial sections will be done in ARM, also making use of the 32-bit IWRAM. Creating games that brought out the best of the GBA ultimately required proficiency of three programming languages: C, ARM assembly, and Thumb assembly.

    Another big advantage of the ARM7TDMI core is the embedded three-stage pipeline. A typical fetch/decode/execute machine cycle is a sequential process: the next fetch will have to wait until the decode and execute steps have been completed. With instruction pipelining, parallelism can be achieved on a single processor.

    The idea is simple: keep all parts of the CPU as busy as possible. Once the first instruction has been fetched, it can be decoded. But the part responsible for fetching should not idle: instead, it can already fetch the second instruction, and so forth. Pipelining significantly reduces throughput time, as visible in the figure below.

    Pipelining instructions comes with its own set of problems. For instance, what if the second instruction is dependent on the output of the first? There are multiple workarounds possible that go far beyond the scope of this article. Pipelining is also easier to achieve on the GBA than on the GB since a RISC processor guarantees each execute block will take only one cycle.

    A three-stage instruction pipeline model: the second instruction starts its fetching procedure while the first is still decoding.

    Imagine your mother doing laundry. In the above figure, replace “Fetch” with washing, “Decode” with drying, and “Execute” with ironing. The GBA CPU (or should we call it mom?) is able to put clothes from the washing machine directly into the dryer, enabling a second batch to be immediately washed. In the meantime, dried clothes can be ironed. The original Game Boy puts clothes in the washing machine and waits for the program to finish. It then transfers them to the dryer to wait some more. Hopefully it is clear that the GBA mother is a lot more efficient in doing laundry!

    Thanks to the rise of online communities, the GBA homebrew development scene is still thriving. Toolchains such as devkitPro make it easy for enthusiasts to create GBA games using newer multi-paradigm programming languages like Rust and C++. This makes the GBA an excellent choice for learning about both hardware architecture and software development: its predecessor lacked software development tools and its successor increased the hardware complexity.

    GBA Accessories

    Hardware accessory producers rejoiced every time Nintendo released a new revision of their popular Game Boy franchise, and the release of the GBA was no different. Since it took two years for Nintendo to ship a GBA with any kind of screen light, different “Afterburner” products sold well. With these modification kits, you could install a frontlight on your GBA yourself, although sometimes soldering and tinkering with the plastic housing was required.

    The Pokémon FireRed/LeafGreen GBA remakes included an official Wireless Adapter that finally got rid of the Link Cable, allowing players to catch ’em all without catching each other. More than thirty players could simultaneously join a lobby to battle or trade. In the end, only a few games supported Wireless play, since it was released in 2004, the same year as the Nintendo DS launched. Many accessories, including this one, were incompatible with the smaller Game Boy Micro.

    If you squint your eyes, the Wireless Adapter even looks like a Pokémon.

    A successor to the SNES Super Game Boy called the Game Boy Player allowed you to play GB, GBC, and GBA games on your GameCube. Some games even provided force feedback through the GameCube controllers. The Nintendo GameCube GBA Cable was an equally impressive way to connect the GBA to the GC, allowing you to play minigames or even use the GBA as an extra screen for a second player.

    In case you don’t own a GameCube: the unofficial Super Retro Advance cartridge allows you to play GBA games on your SNES. It has its own separate composite-video only output. You’ve been warned. A (very expensive) Nintendo 64 solution also exists, called Wide Boy 64.

    Then there’s the e-Reader, a Game Changer that lets you put three games in it and change on-the-fly, the obligatory cheat device, a Japan-only cartridge that lets you play movies and music from an SD card called Play-Yan, a car charger, and a battery replacement kit.

    There was sadly nothing that could top the original Game Boy’s Sonar Sensor…


    This article is part of a technical essay bundle entitled Inside The Game Boy Game Loop. See also: An Ode To Game Boy Cartridges (2023) and Historical Usage of Memory Bank Controllers in Game Boy Carts (2023).

    retro   gameboy 

    联系我们 contact @ memedata.com