MBR Game Resources

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
XxSNIPER2000xX
Posts: 2
Joined: Thu Apr 28, 2022 3:09 pm

MBR Game Resources

Post by XxSNIPER2000xX »

Hi, I would like to try my hand at making a simple game that runs from the MBR.
I am inspired by the projects Tetros (and it's similar projects): https://github.com/daniel-e/tetros and lightsout: https://github.com/XlogicX/lightsout

Where can I find more resources on programming the BIOS/MBR? After skimming the source code of these projects and trying my hand at it myself. I am still unsure about a few things.
I would like to learn more ways of initializing the screen, more on text video mode ie what colours are available, and more on pushing to video memory.

Thanks :)
Octocontrabass
Member
Member
Posts: 5563
Joined: Mon Mar 25, 2013 7:01 pm

Re: MBR Game Resources

Post by Octocontrabass »

XxSNIPER2000xX wrote:Where can I find more resources on programming the BIOS/MBR?
If you're programming games instead of a bootloader, you probably only need old IBM manuals and Ralf Brown's Interrupt List. For VGA, you'll also need slightly less-old IBM manuals and possibly Michael Abrash's Graphics Programming Black Book.
XxSNIPER2000xX wrote:I would like to learn more ways of initializing the screen,
With such a limited amount of space, you'll probably rely on INT 0x10 to do most of the initialization. You actually can do a lot that way - remember those BIOS POST screens that were clearly in text mode yet somehow had a logo in the corner of the screen? That's done entirely with INT 0x10.
XxSNIPER2000xX wrote:more on text video mode ie what colours are available,
With CGA, there are 16 colors.

With EGA, there are 64 colors, and you may choose 16 of them. The BIOS functions select CGA-compatible colors by default.

With VGA, there are 262144 colors, and you may choose 16 of them. The BIOS functions select EGA-compatible color mappings to select CGA-compatible colors by default... yes, it's confusing.
XxSNIPER2000xX wrote:and more on pushing to video memory.
Michael Abrash explains most of the tricks, but I'm not sure how many of them will be useful to you if you're in text mode and limited to 512 bytes.
XxSNIPER2000xX
Posts: 2
Joined: Thu Apr 28, 2022 3:09 pm

Re: MBR Game Resources

Post by XxSNIPER2000xX »

thanks :D
EduBat
Posts: 2
Joined: Wed Aug 04, 2021 5:31 pm
Contact:

Re: MBR Game Resources

Post by EduBat »

Hi, look for the book "Programming Boot Sector Games" by Oscar Toledo Gutierrez.
The author also goes by the moniker nanochess and is a legendary master in this subject
https://github.com/nanochess?tab=repositories

Good luck
Post Reply