News for hackers. Stuff that matters.
Re:A blog post about implementing Minesweeper game clone for... by kogus on Tuesday December 26, 2023 @11:58PM (#38779237)
This code is surprisingly readable. For a Gameboy Advance, I expected piles of assembler. Many years ago, early in my career, I implemented a Minesweeper clone in Delphi. It's still there, a testament to how terrible code can be, and how much fun it is anyway:

https://sourceforge.net/projects/delphisweeper/files/delphis...

Re:A blog post about implementing Minesweeper game clone for... by twaw on Wednesday December 27, 2023 @12:41AM (#38779428)
You can rewrite the code and add a "Russian mode", when a cleared area will be remined again after a random period of time.
Re:A blog post about implementing Minesweeper game clone for... by Frictus on Wednesday December 27, 2023 @01:15AM (#38779552)
So now you could rewrite it for the gba with very high level libraries like for exemple Butano in C++ (no assembly, no registers) : https://gbadev.net/getting-started.html#high-level-developme...
Re:A blog post about implementing Minesweeper game clone for... by akdas on Wednesday December 27, 2023 @01:24AM (#38779583)
All things considered, the GBA is a pretty powerful machine. Running an ARM processor is helpful too, as high-level language compilers that output high-quality ARM code are common. It's for this reason the GBA is one of my favorite machines, since it hits that sweet spot between simplicity and power.

It's the Gameboy and the NES, running a Z80-style and a 6502-style processor respectively, that typically need more hand-holding from manually written assembly code. It's not just the processor but the lack of hardware features (such as lacking multiple background layers, the relatively low number of sprites that can be on screen at a time, etc.) that result in squeezing out extra performance to overcome these limitations in creative ways. Compare that to the minesweeper game just rendering all the board cells as sprites!