See Screen, See Pic On Screen
Today we'll put a picture on the screen.
Patater GBAGuy Mirror
Make a 320x240 bitmap in MSPaint, save in C:\n64asm\ as pic.bmp.
Next, goto Dextrose and download the
patch to the GroundZero Devkit, what we want is the BMP2N64 program. Copy
BMP2N64.exe to your n64 assembly folder. Open a DOS Prompt and type:
cd your assembly folder path
bmp2n64 -in:pic.bmp -out:pic -label:pic -16
Two files should be created, you can delete the .H file, but keep the .S file.
The .S File may work as is, but I recommend you delete the lines before
the label and replace all ".half"s with "dh" (no quotes).
The code for this isn't that much different than we've seen before
or that you could have come up with on your own. So here we go (the whole thing):
org $80000400 ; starting point
li t1,8 ; crash protection
lui t0,$bfc0 ; I still don't know what this specifically does.
la t0,$A4400000 ; start of VI regs. ; this block initializes Video
li t1, $103002
la t1,$a0200000 ; the frame buffer address
la t2,MKImage ; MKImage should be the label in your .S file
sh t4,0(t0) ; there's probably a better way, but oh well :)
sub t1,t1,t3 ; there's a better place for this that'll be discussed later
include MKImage.S ; MKImage.S should be the filename of your .S File
This Day In Review
I hope you take the time to understand code and not just rip it :)!
Until Next Time!,
- Mike H a.k.a GbaGuy
Intro - Day 7