Tutorial 3


In this tutorial, we will be making the Genesis display a solid color.

The tutorial starter files.

Refer to this page for info on how Genesis colors work.

What is our goal?

Display a solid color by changing the background color.

Let's start!

In the source.asm, you will see a some more included code.


The "setup_vdp" routine sets up the VDP's registers, and makes it ready to work. The "clear_vram" routine clears everything in video memory. Don't assume any memory will already be empty. Clear it!

The included "setup_vdp" routine makes this tutorial pretty easy. That routine will get the VDP ready to go, and leave it's data port in A4 and control port in A3. All you need to do is add two lines of code. "move.l #$C0000000,(a3)" writes that big number to the VDP control port, which tells the VDP that you want to write to the first slot of color memory. The "move.w #$00EE,(a4)" instruction tells the VDP to write the number $00EE (the color yellow) into memory. So, the first instruction is the where, and the second instruction is the what. The process is the same for all VDP reads and writes.


Compile and run the program. If all goes well, you should see a solid yellow background.


Go back to tutorials