I wasn't convinced everybody who showed up understood today's class. By
Monday please make sure you can answer the questions below, so you know
whether or not you "get" it:
Object Attribute Memory (OAM):
- Read over writing to OAM in
http://cratel.wichita.edu/cratel/ECE238Spr08/tutorials/GameBoyVideo.
Email the list with anything that doesn't make sense
- Look at lines 217-233 in hello-sprite-no-interrupts.asm. You'll
find the defs for the constants in hello-sprite.inc.
- what is the purpose of the code in lines 217-233? Why is it
necessary?
- what is the purpose of the loop labeled dma_wait? What would
happen if we removed this loop?
- does line 230 have to be a jr instruction or could we use jp
instead?
- in line 59 of hello-sprite-no-interrupts.asm you'll see the call
to init-dma. What does that code do? What is that code for?
- why is DMACODELOC set to $ff80? Could we set it to any other
values instead? If so, what values?
- why is there no call to the dmacode label in
hello-sprite-no-interrupts.asm? Does that code ever get called then?
- what is the purpose of OAMDATALENGTH in
hello-sprite-no-interrupts.inc and why is it set to $a0?
- why is the following assembler command *not* valid on the GameBoy
platform:
SECTION "DMATransfer",HOME[$FF80]
General questions:
- can your code write to memory location $0? how about $7000?
$a000? C000? F000? FF80?
- can you load code in memory location $0? how about $7000? $a000?
C000? F000? FF80?
- what are the GameBoy I/O registers and how are they the same or
not the same as memory in the GameBoy?
Assembler Commands:
- where is the documentation for the assembler and linker?
- what does \1 and \2 mean within a macro? How do you make use of
them?
- what is the difference between HOME and BSS within a SECTION
command?
- if I add a printv statment in my code, when and what can I print?
What about printt? How about printf?
- what is the difference between SET and EQU? When would you use
SET and when would you use EQU?
- what is the difference between a macro and a subroutine?
- imagine this code:
include "hello-sprite.inc"
LoByteVar VarX
LoByteVar VarY
LoByteVar VarZ
- what will be the values of VarX, VarY, VarZ, and LoRamBase after
these macros are executed? Why?
- I'll go over RSSET and RB at the beginning of class on Monday,
but in the meantime, look them up in the documentation for the
assembler. It's not too hard to figure out. The rest of the
hello-sprite.inc file should now make sense. If it doesn't, email the
list with questions.
I expect that everybody in the class will be able to confidently answer
these questions by Monday. I will be around Friday 4:30-6:30 for office
hours in the cratel lab. I will also be in the lab 1:30 to 3:30 on
Friday but I give priority to Tech Art and Sound by Design students
during that time. If I don't see or hear from you, that means you
understand, right? RIGHT? RIIIGHHHTTT?
-John
--
John Harrison
http://alumni.media.mit.edu/~harrison