OAM
GameBoyは8*8 or 8*16のスプライトを40個まで画面に表示可能
しかしハードウェアの制約上、各スキャンラインには10個までしかスプライトを表示できない
スプライトパターンはBGタイルと同じフォーマットだが、$ 8000-8FFFにあるスプライトパターンテーブルから取得され、符号なしの番号が付けられている
OAM: Object Attribute Memory(スプライト属性テーブル)は$FE00-$FE9F(160バイト)に配置されるスプライトのプロパティを定義しているテーブル
1エントリ4バイトなのでOAMには160/4 = 40スプライト分のプロパティを格納できる
各エントリは
0byte: スプライトのY座標(px)
1byte: スプライトのX座標(px)
2byte: タイル番号
Specifies the sprites Tile Number (00-FF). This (unsigned) value selects a tile from memory at 8000h-8FFFh. In CGB Mode this could be either in VRAM Bank 0 or 1, depending on Bit 3 of the following byte. In 8x16 mode, the lower bit of the tile number is ignored. IE: the upper 8x8 tile is "NN AND FEh", and the lower 8x8 tile is "NN OR 01h".
00-ffのタイル番号 スプライトの大きさが8*16のときはタイルの下位ビットは無視される
3byte: スプライトの属性
を定義している