35

Gameboy games use a CR2025 battery which over the years eventually dies stopping games from saving and causing previously saved games to disappear. Note however while the game is powered you can still save, however once you power down the save will be gone. In order to replace the battery you must open up the cartridge with a 3.8mm screwdriver security bit. ...


35

For Gameboy clocking 3 'generations' need to be seen All 'classic' Gameboy, that is the original all the way including micro run (the 8 bit CPU) from the same 4.194 MHz MHz crystal, divided by two, for a CPU clock of 2.097 MHz. Gameboy Color and later added a double speed mode, allowing the 8 bit CPU to run at 4.194 MHz Super Gameboy does as well run the ...


34

Game Boy games do not always need a manual save operation. There's no hardware reason that would prevent Game Boy games from saving in the way you describe. For the Game Boy hardware, RAM present on the cart can be used by games for whatever it needs. SRAM is RAM on the cartridge; most of the time, it's backed up by a battery and used to store save data, ...


33

Here's a selection of Game Boys I've dug out from my drawer: The original Game Boy displays a solid black rectangle (and a ®) which scroll down from the top of the screen, in the same way that the Nintendo logo would if a cartridge were inserted. This image remains on the screen until the Game Boy is switched off. (Note the difference with the picture of ...


32

Microprocessors have a minimum operating voltage spec, but that generally doesn't mark a threshold where they stop executing code. Instead, it specifies level below which they aren't guaranteed to execute instructions correctly. When a game is powered off, a processor may execute a few hundred or a few thousand instructions between the time the voltage ...


26

ROM and RAM bank switching is controlled by a memory bank controller present on the cartridge. By writing values to areas of read-only memory, a game or program is able to specify which ROM banks to access when read operations are performed. The simplest cartridges simply contained ROM and had only had 32 KBytes of space. It is mapped directly to $0000-$...


26

You'll need to manipulate the memory address 0xFF02, and shift the data (MSB first) into 0xFF01, as stated below. If there is no cable - ergo, no gameboy connected - then 0xFF is received, in 0xFF01. From Serial Data Transfer (Link Cable) Communication between two Gameboys happens one byte at a time. One Gameboy acts as the master, uses its internal ...


25

Neither. The level determines how fast the pieces drop. At level 9 a piece drops (assuming you don't press down) 1 row every 11 frames. So at the Gameboy's framerate of 59.73fps that means it drops at a speed of 1 row every 184ms. At level 10 it speeds up, dropping the piece every 10 frames. At level 20 it reaches a speed of 1 drop every 3 frames (50ms) and ...


23

I cannot speak about Pokémon in particular, but as a programmer for ~30 years, I'll answer thus: either laziness, incorrect assumption, or surprise. Laziness After an operation that overflows, you need to write extra code to check for the overflow, and then decide what to do about it. That's extra time, and extra work. Incorrect assumption (Often ...


22

Overflow doesn't mean what you think. That flag exposes the internal ALU carry from bit 6 -> bit 7. It's needed when you are handling the most significant byte of a 2-complement number, because you can't use the carry for that purpose here: it's jumbled by the MSB sign bit. When you don't add or subtract 2-complement numbers (MSB isn't meant as sign bit but ...


22

Firstly, the stretching isn't done in the vertical direction: Game Boy (and Color) games only used 144 rows of the 160 available on Advance screen, so there'd be black "letterbox" bars at the top and bottom, whether you stretched the image widescreen (with the shoulder buttons) or not. Horizontally, the image is definitely stretched. If the Advance had ...


20

I'm working on implementing the instructions of the z80 chip inside a gameboy for an emulator. Well, I guess that's the most important point here: The Gameboy doesn't feature a Z80, but an independent 8080 descendant. Using a Z80 opcode table will not get you anywhere. It's LR35902 CPU (*1) is, like the Z80, based on the 8080 with some extensions. The ...


19

To complement the previous answer on why this happens, the Game Boy contains a very small ROM that is executed by the CPU before running the cartridge. One of its routines include checking if the cartridge contains a Nintendo logo (Nintendo used this as a way of controlling game distribution by use of trademark law). Then another routine checks if the ...


19

Technically, the behaviour is what we call "undefined,"* meaning you can't know what will happen and the system is allowed to do anything it wants in response, up to and including launching a nuclear attack on another country. That, of course, is highly unlikely (or you clearly got your hands on a Game Boy you should not have). The most likely scenario in ...


18

None of the GameBoy series machine has a Z80, but instead a Sharp LR35902, which runs a "GBZ80" instruction set, which is if I'm not mistaking similar but incompatible with the genuine Z80, as it lacks the two registers sets (much like the 8080) and other instructions. Just like the 2A03 in the NES, the CPU is in the same chip as the sound generation ...


18

I don't know if this is correct, but it seems to fit. The SNES sound chip is a full processor. It can run its own program and play sounds independently of the main processor. It is also possible for a Game Boy ROM to load a sound program into the SNES sound chip via the Super Game Boy. Animaniacs is one those games. While the way the SNES sound chip is ...


17

Gameboy games use CR2025 battery, which will die and take all the data with it: It's lost for good. Saved games back in those days were preserved through the use of a battery right in the game pack, not stored on the gaming device itself like it is today. And when that battery dies, so does the saves with it. It's not about corruption of the save or ...


14

Note, this is a supplement to Greenonline's answer. Instead of emulating the bitwise transfer I would just emulate the bytewise transfer. If some game depends on the transmission time, you need to emulate this period for the reset of bit 7 of SC. When exactly in this period you transfer the bytes doesn't matter. If some game depends on the bitwise ...


13

I think your premise is wrong. Firstly "overflow" in most cases doesn't mean pure arithmetic overflow, it means overflow of some other limit, checking said limits would require more than a single extra instruction. Secondly in many of the glitches involving overflow the overflow is a secondary part of the glitch. Using a rare candy on a level 255 pokemon ...


13

According to Gameboy [sic] Development Wiki page The Cartridge Header, locations 0x104 through 0x133 in the cartridge contain a bitmap of the Nintendo logo that's displayed when the Game Boy is turned on. (Presumably that's the "Nintendo®" text/logo shown in this video.) After booting and displaying the logo, these data are checked by the GB (the first 0x18 ...


13

However, looking at some of the opcodes they don't seem compatible. There's your answer. The LR35902, the Z80 and the 8080 really are different CPUs. They are similar in many ways, such as the register set and much of the programming model. The Z80 does not have the HL postdecrement addressing mode you're talking about, and some things the Z80 has the ...


13

The documentation is correct. Tetris does not use the RST 38 instruction (restart vector $38 is a custom vector, not tied to any Game Boy hardware interrupt), so the emulator I assume you're developing is calling it by mistake. It's a common error, since uninitialized/unmapped memory on the Game Boy contains $FF, which is the RST 38 opcode. Since Tetris ...


12

A direct connection is not going to work - The Gameboy's pixel clock is much too low to drive a VGA screen: GameBoy VGA Pixel clock 4 MHz 25 MHz V-Sync 60 Hz 70 Hz H-Sync 9 kHz 31 kHz So, in a nutshell, this will not work without a significant investment into capturing the GBA ...


11

The Wikipedia comment is misleading. The Game Boy CPU has several components in one chip, including the Z80-alike CPU core and a sound generator among others. These components may all be in the same chip but they are functionally independent; you don't need the Z80 CPU to be able to produce audio. The Nintendo DS inherited the Game Boy sound generator ...


11

My question is, why did they use an LD B, B instruction, and not a proper NOP? LD B,B works like a NOP - at least as stated in the original 8080 manual (*1): The original 8080 had 8 NOPs at 00xxx000 but only the first was defined as 'the nop'. In addition there were 7 instructions of loading a register with itself (*2). Effective NOPs, but not defined as ...


10

Calling it a "memory range" is incorrect - and possibly what is leading you astray. The entire range 0000-FFFF is called the "address range" of the CPU - you can write a CPU instruction (or three) that can access a bit, byte or word at any of those addresses. What the hardware does with that access depends on what hardware is "at" that address. The first ...


10

The code for the decompression system has been decompiled and partially commented here. Essentially the compression used is a form of run-length encoding, with a few modifications to make it more efficient for Gameboy graphics. The main improvement is that graphics are split into bitplanes rather than being compressed as single bitmaps. That is, each pixel ...


10

This is what a GameBoy Pocket does: Two black blobs (and an ®) slowly descend from the top and come to rest half way down the screen. Taken from the (somewhat interesting) video, What it looks like when you turn on a game boy without a game. Other GameBoy versions (DMG, GBC) differ in behaviour, as Kaz's answer demonstrates.


9

Address Decoding Any computer system (including video game consoles) with more than one memory device needs hardware (usually) external to the CPU to determine which device to access for any particular address. This process is called address decoding. In the simplest case this could be a single device that looks at the address and makes the decision this ...


9

According to the Iwata Asks for G/S, Iwata created compression tools for the graphics in G/S (as well as other parts of other Pokémon games). Morimoto: What's more, there were the tools for compressing the Pokémon graphic code… Iwata: Ah yes, the compression tools. Morimoto: You were kind enough to create those tools. Iwata: Yes. (...


Only top voted, non community-wiki answers of a minimum length are eligible