Wave

Category - Games

What Is Going on Inside Their Head: the Pokémon Emerald Random Number Generator

Forbidden Tempura 6/16/2024

In Pokémon Emerald, there are several random number generators. The main one, pp_rand(), uses the following generator: seed = (1103515245 * seed + 24691) as u32 return (seed >> 16) as u16 Where do these constants come from? The 1103515245 constant is easily explained: It is what ISO/IEC 9899 in all editions provides as an example for how to implement rand(), which itself traces back to 70s UNIX libc rand.c. That function returns a signed 16-bit integer with RAND_MAX == 32767. Game Freak, however, wanted to have an unsigned 16-bit integer. Therefore, they doubled RAND_MAX to be 65535 instead of 32767. Unsure if this was safe, they also doubled the increment from 12345 to 24690 and added 1 to make sure it was relatively prime to 1103515245, as evidenced by the following comment in calctool.c: // 12345*2+1 (RAND_MAX=32727の時に12345なら65535の時は倍必要なのではないか?テスト) In other words, Game Freak was unsure if they also needed to double the increment when doubling RAND_MAX, displaying a failure t

Games

A Brief Look at the 3DS Cartridge Protocol

Forbidden Tempura 6/2/2024

About a week ago, there has been a little addition to the 3dbrew wiki page about 3DS cartridges (carts) that outlines the technical details of how the 3DS cartridge controller and a 3DS cartridge talk to each other. I would like to take this opportunity to also include the 3DS itself in the conversation to illuminate which part of which device performs which step. I will then proceed to outline where I think the corresponding design decisions originate. Finally, I will conclude with some concrete ideas for improvement. But first, we need to talk about parallel universes This protocol makes no sense unless you have a basic overview of the 3DS AES engine. The 3DS AES engine can load 128-bit AES keys in two ways: Using key-derivation from a keyX and keyY (officially called KeyId and KeySeed, respectively). Directly specifying a full AES key. The key derivation from a keyX and keyY works as follows: AES key = (((keyX ROL 2) XOR keyY) + C1) ROR 41, where ROL is left rotation on a 128-bit

ITGamesInfodump

Reconstructing the 3DS Bootstrapping Process at the Factory

Forbidden Tempura 5/13/2024

Motivation The Nintendo 3DS was a fairly popular console. In spite of that, surprisingly little is known about how it is put together at the factory. Working with information that was uncovered during the so-called Gigaleak, I will try to recover as much information as I can about the manufacturing process up and until the point the 3DS is able to complete a normal boot sequence. One-Time Programmable (OTP) region Every 3DS ships with 0x100 of one-time programmable persistent memory at 0x10012000-0x10012100, containing console-unique keys and information. This obviously has to occur before any normal firmware runs on the system because significant amounts of all data written would fail to account for console-unique information and thus the encrypted values would be all encrypted for the wrong keys. An interesting observations: ctr.7z (SHA-256: 8b05072361254437277576d53c08b95e5f076c6b33a2871fad74eaa5561d1d38) ctr/sources/bootrom/CTR/private/build/bootrom/ctr_bootrom/ARM9/main.c has a pr

ITGamesInfodump

Generation 3 of Pokémon is held together by duct tape and I can prove it

Forbidden Tempura 4/16/2024

The problem space Pokémon is a franchise that needs no introduction. Millions upon millions of people have had some exposure thereto. I would like to focus on one tiny implementation detail of the games that formed the third generation of Pokémon: Ruby, Sapphire, FireRed, LeafGreen, and Emerald. In this generation of the games, the developers of the series first started trying to discourage cheating. To understand what they did, I first need to introduce a few concepts. A Pokémon is an individual member of a Pokémon species. Think of it like a specific individual, just like how there is a sheep that you encounter and there is the species of sheep, of which the aforementioned individual of a member. Every Pokémon has a 32-bit personality value (also commonly called personality ID or PID for short). A (Pokémon) trainer is a concept in the games: Trainers go around and make their Pokémon fight against other Pokémon. They hold contests to find out who is the strongest trainer. Supposedly

Game DevelopmentGamesInfodump

Balatro - My New Vampire Survivors

Mia Rose Winter 3/17/2024

As someone with ADHD and a lot of other issues, my way to engage with games is something probably somewhat similar to many people, but more extreme in some ways. I love games, I wanna make them too, but my way to actually play them is a bit.. weird I feel. I sometimes don't play games for weeks or months, only to discover a new one that hits just right, and I binge it for 50h to 100h (pretty much that amount every time) and then completely drop it. No matter how far I got, it is rare I can really complete anything. As such, the open world game is a genre I've been avoiding for years, as well as other big budget games. The stuff that hit me in recent memory was Divinity: Original Sin 2 (I am not getting into Baldurs Gate until I have summer break) or Vampire Survivors. The Neurospicy gaymer Vampire Survivors is a special game, as you will probably have heard from other people, especially the ones with exploitable character traits like me. The way it is set up, with the combination of it

ReviewGames
Powered by Wave