r/retrogamedev • • 3h ago

Update on the GB 3D Engine, (Wall and Floor Textures!, aswell as complex geometry!)

66 Upvotes

Update on my Game Boy 3D engine! This is running on real hardware (my Analogue Pocket), with the original Game Boy version on the left and the new Game Boy Color version on the right. The colours on the left are just the Pocket's palette for original Game Boy games.

This isn't a flat grid maze. The level is a full 3D model made in Blender and converted into the engine: an old water mill (ment to be anyways) with different floor heights, ramps, stairs, a sluice, a wheel pit and thin walls, and you walk up and down all of it in real time. Nothing is pre-rendered.

In the video I'm cycling through the three render modes with the Select button. The number under the mode name in the bottom bar is the live frame rate.

ON is the default mode. It puts textures on the walls, with plain floors and ceilings.

FULL adds textures to the floors as well. It's the most detailed mode, but also the slowest.

OFF turns the textures off and just draws shaded walls, which is the fastest.

Under the hood, every frame is drawn in software into a buffer and streamed into video memory only in the short gaps when the screen isn't being drawn, with a timer trick to double the lines. The textures are mapped per column and have lower detail versions for walls far away, so they don't pop in.

The Game Boy Color version draws exactly the same black and white picture. It just uses the Color's double speed CPU and its DMA transfers, so it runs about twice as fast. Averaged over a walk through the level, that's about 12 fps on the original Game Boy against 28 on the Color with textures on, 9 against 22 in FULL, and 19 against 30 with textures off (the Color version is capped at 30).

For the Game Boy devs, here's how it works:

The level is 32 by 32 cells, and every cell can have its own floor and ceiling height, so there are stairs, ledges, windows, a slope down the sluice and open sky. Walls aren't solid blocks either. Each one is a thin plane on a grid line, with its own bottom and top.

Rendering is a raycaster with one ray per 8 pixel column. Every map cell stores small event codes for its neighbours, so a ray only stops where something actually changes (a floor or ceiling height, a step, a lintel or a wall) and jumps straight to a handler for that case. The ray maths uses no multiplies or divides: distances and heights are kept as logarithms, so projecting a height is one 16 bit add and a table lookup.

The picture is drawn as a 160 x 56 bitmap in RAM, laid out in tile order, and a timer interrupt moves the scroll register every other line so each line shows twice. Tiles that are one flat colour aren't drawn at all, they just point at 16 shared flat tiles, and columns that match their neighbour share tiles too, so most frames only need a few dozen real tiles. Two pictures alternate in VRAM, and the copy into VRAM only runs during HBlank and VBlank, using copy routines generated by a Python script with a cycle exact timing model. An accurate emulator confirms zero VRAM writes while the screen is being drawn.

The textures are mapped per column, with smaller copies and a matching flat tone for distance, all stored in ROM banks (the ROM is 512 KB, MBC5). The ROM's pictures are checked pixel for pixel against a Python model of the renderer. On the Game Boy Color build the CPU runs at double speed, and the picture goes into VRAM by DMA during VBlank, with a new picture every 2 frames.


r/retrogamedev • • 1d ago

Working on a 3d engine for the original Gameboy (not color)

588 Upvotes

This is the process so far!

No framebuffer, so tiles become one, the Game Boy can only show 8x8 tiles, so the 3D view is drawn into tile memory, then copied to the screen.

-Half the lines, same screen. It only draws 56 lines and shows each one twice, by changing the scroll position every two lines.

No multiply. The CPU has no multiply instruction, so the 3D maths uses lookup tables instead. (What wqs a bitch to get working

Drawing heights. Each column is drawn front to back, and a window shrinks as floors, steps and walls fill it, so nothing is drawn twice.

It gets around 12fps average, goal is 15 :)

Lmk what u think!


r/retrogamedev • • 4h ago

First live demo of my my new devit.

Thumbnail youtu.be
3 Upvotes

G'Day from Wrightwood, CA.

I have been working away on this for a little IDE/Compiler/Debugger for a while, because I wanted to write once and run everywhere for all the old consoles.

The lack of a real dev-kit was killing me so I decided to build one,

So far I have live re-flash, breakpoint, step through code, live watches, memory inspection and modification working pretty well.

My first generation of hardware has just landed ( Sega Genesis / Megadrive ) and I am hoping to have the funds to do master system or NES next.

At the moment I am finishing up the firmware, awaiting custom shell cases, and need to work on some polish but I expect in the next week or 2 to have some devkits available for sale.

Anyway, what do you guys think ? Questions?


r/retrogamedev • • 21h ago

Been working on an action roguelike for the Game Boy Color - fight zombies using only office supplies in "Corporate Rot!"

Post image
52 Upvotes

r/retrogamedev • • 13h ago

What recompiling a late PS1 game taught me about how it was built: ordering tables, culling, overlays, and the PAL→NTSC conversion (C-12: Final Resistance)

Thumbnail gallery
5 Upvotes

I've been statically recompiling C-12: Final Resistance (SCE Cambridge, 2001) into a native PC program, which meant reading a lot of its code. I wrote up how it all works here:

https://github.com/spartaque12/c12-recomp/blob/main/docs/TECHNICAL.md

A few things in it that might interest PS1 developers:

  • Frame structure: one game frame takes two VBlanks (25 fps PAL, 30 NTSC). The display list built in one frame is submitted in the next, while the frame before that is on screen.
  • One ordering table per view: the world, the menus' item icons and the HUD each get their own, cleared in reverse and drawn with their own DrawOTag call in priority order.
  • Culling by four frustum corner rays built from a fixed 160×120 half-screen, walking a cell grid for up to 150 visible cells. Widening those four rays was all widescreen needed.
  • Level code in relocatable overlays the game loads and fixes up itself. 12 levels carry identical copies of the same fire-particle routine.
  • The controller library patches the BIOS at boot. It reads two instructions from the exception handler to decide where to put its hook. With a placeholder BIOS that address landed in the game's own code and hung one cutscene hours into the game. That matters for anyone high-level-emulating the BIOS.
  • What the US conversion changed: timers ×1.2 (25→30), screen constants for 240 lines (256→240, 128→120), and per-frame animations left alone, so effects run 20% faster on the US disc.

The doc also covers how the game's scene is pulled out of RAM and redrawn as real 3D (no PS1 wobble), frame blending on a steady clock, and save states of native coroutine stacks.

Code (needs your own disc; no game data is included): https://github.com/spartaque12/c12-recomp

Happy to answer questions about any of the internals.


r/retrogamedev • • 16h ago

Supergrafx is a powerful console for sure!

Post image
3 Upvotes

r/retrogamedev • • 1d ago

POCKET PIT WALL: my real-time racing manager for the GBC, with 16 cars simulated live and Game Boy Printer support

Thumbnail gallery
38 Upvotes

Hi all! I wanted to share my second Game Boy project, POCKET PIT WALL, which came out this week.

It's a motorsport management game where the races play out live: 16 cars on track, a timing tower and a track map on one 160x144 screen. You make the calls (tyres, pace, pit stops) while the weather changes, safety cars come out and cars retire.

Around that there's a full career. You can pick any season from 1988 to 2050, each with the rules of its era, and work your way up through 25 championships, from regional series to the world title, on 512 real circuits.

On the hardware side, it runs on original hardware (MBC5 with a 32 KB battery save; I tested it on my GBA SP with a flash cart) and it prints on the Game Boy Printer: race sheets, lap charts and a card for each circuit.

It's free, with a browser build and the GBC ROM: https://studio77dev.itch.io/pocket-pit-wall

Gameplay trailer: https://www.youtube.com/watch?v=96VuSrGXRvU

If this doesn't sound like your sort of thing, my previous game, SPEED KIDD, a free top-down racer for the Game Boy, is on itch too: https://studio77dev.itch.io/speedkidd


r/retrogamedev • • 1d ago

A Developer Has Spent Sixteen Years Reconstructing Pizza Tycoon

Thumbnail handheldhideout.neocities.org
4 Upvotes

r/retrogamedev • • 1d ago

Retro Coder 2000: you write, compile and run real programs on a 90s PC you build yourself. Even the benchmark in this trailer is a player-readable program

3 Upvotes

r/retrogamedev • • 1d ago

PONTO FINAL - Game Boy Color homebrew game by OuroborosMaker featuring interesting visual techniques

Thumbnail bsky.app
5 Upvotes

r/retrogamedev • • 1d ago

Parrot Cart for ColecoVision

Thumbnail youtu.be
2 Upvotes

r/retrogamedev • • 1d ago

Rogue: Amulet of Aivilo (NES) is available now :-)

Thumbnail gallery
9 Upvotes

(Matt writing) I'm not really sure if I'm already able to post here. If this post didn't got deleted: It's a pleasure to be around.

The game is available now!!!

Release notes: https://www.cuppachaosgames.com/lets-celebrate-the-release-of-rogue-amulet-of-aivilo/

Who we are

We are people from the 70s and 80s who are interested in the (mathematical) mechanisms behind video games. The story should take centre stage. The graphics should unfold in the player’s mind.

If you’d like to know how we taught the NES the concept of ‘randomness’:

We love math. When you take nerdy topics like statistics, chance, and probability and turn them into a game, the result is "Rogue: The Amulet of Aivilo".
How to outwit chance: Dive into our ‘Developer's Handbook’ and join us as we delve into the technical basics of the game. You might want to have a glass of water to hand - the topic might be a bit dry. 😜

The Game's Story

Centuries of rule cast in a dark shadow. The legend of the first king’s daughter. Was she really abducted? Did she really exist?

The legend of a lone individual who must endure the punishment of discovering whether the Amulet of Aivilo truly exists is now being written. Shed light on the darkness of uncertainty.

Prove the amulet’s existence and clear the rulers’ names of the accusation that their reign is built on a lie.

Websites to get further details:
https://www.cuppachaosgames.com/rogue/
itch.io: https://cuppachaosgames.itch.io/rogue

Player's Handbook
https://www.cuppachaosgames.com/players-handbook/

Developer's Handbook
https://www.cuppachaosgames.com/rogue-developers-handbook/


r/retrogamedev • • 1d ago

You can use your PSP as a Dreamcast controller, VMU and memory card

Thumbnail youtu.be
1 Upvotes

r/retrogamedev • • 2d ago

[Release] I built a GTA-style game engine for the Virtual Boy

Thumbnail youtu.be
5 Upvotes

r/retrogamedev • • 2d ago

Alien vs Predator on Saturn 🪐 (Best Jaguar Game?)

Thumbnail youtube.com
3 Upvotes

r/retrogamedev • • 2d ago

Baby steps in CD-i homebrew development: I've been slowly figuring out how to write code for CD-i

Thumbnail cfretro.net
3 Upvotes

r/retrogamedev • • 2d ago

AIVector MS-DOS Asteroids clone release.

2 Upvotes

I have created an Asteroids clone for MS-DOS using DJGPP and Allegro 4.2. I wanted to find out if a local LLM running on modest mid range gaming hardware with the right instructions and documentation could write good, well optimized code in a somewhat less familiar language for an outdated platform, all things which should be less prominent in the training data of a modern LLM.

Turns out it can, but requires a fair bit of human oversight from someone who knows the tricks of the era. I have released it open source. The downloadable build runs on a well set up fast 486 DX2-66 with a good VLB graphics card on normal details. High detail was tested on a 133Mhz AM5x86. DOSBox on a modern computer obviously runs it well too.

Game download on itch: https://wolfbayne.itch.io/aivector
More technical info and source on git: https://github.com/Wolfbayne77/AIVector


r/retrogamedev • • 2d ago

Should we add horizon line + some mountains on our nameless cat game?

Thumbnail x.com
3 Upvotes

I was considering doing so to also make a water line effect to add more live to the backgrounds but without a horizon line the water effect feels very odd.


r/retrogamedev • • 3d ago

Not sure if anyone is interested, but would you like to have a custom program on your Neo2?

Thumbnail gallery
9 Upvotes

r/retrogamedev • • 3d ago

Porting Unreal (1998) to the Nintendo 64 on top of my own custom SDK & RSP microcode [WIP]

Thumbnail youtu.be
4 Upvotes

r/retrogamedev • • 3d ago

Tiny Hat 1.0.8 is out, now with experimental support for ZX Spectrum

Thumbnail roboticoverlords.org
2 Upvotes

r/retrogamedev • • 3d ago

Unofficial PC port of Devil's Crush - full table visible, designed for virtual pinball tables

Post image
3 Upvotes

r/retrogamedev • • 3d ago

I got two unreleased 1996 PlayStation games running again from their original source code

Thumbnail youtube.com
2 Upvotes

r/retrogamedev • • 4d ago

Plumbob Engine - a native Sims 1 engine I've been working on (Mac/Win/Linux) with Seasons, dynamic lighting

Thumbnail gallery
9 Upvotes