Ci sto diventando scemo ... ma non capisco ...
Vediamo se qualche altra anima pia ci capisce più di me ...
program hello_world;
{$DEFINE arm9}
{$mode objfpc}
uses
ctypes,
nds9,
Classes,
colors;
var
frame: integer;
touchXY: touchPosition;
procedure tick();
begin
Inc(frame);
end;
var
video_buffer_main: PWORD;
video_buffer_sub: PWORD;
x, y: word;
begin
irqSet(IRQ_VBLANK, @tick);
irqEnable(IRQ_VBLANK);
powerOn(POWER_ALL_2D);
video_buffer_main := PWORD(BG_BMP_RAM(0));
video_buffer_sub := PWORD(BG_BMP_RAM_SUB(0));
videoSetMode(MODE_5_2D or DISPLAY_BG3_ACTIVE);
videoSetModeSub(MODE_5_2D or DISPLAY_BG3_ACTIVE);
vramSetBankA(VRAM_A_MAIN_BG);
vramSetBankC(VRAM_C_SUB_BG);
bgInit(3, BgType_Bmp16, BgSize_B16_256x256, 0, 0);
bgInitSub(3, BgType_Bmp16, BgSize_B16_256x256, 0, 0);
for x := 0 to SCREEN_WIDTH - 1 do
for y := 0 to SCREEN_HEIGHT - 1 do
begin
video_buffer_main[x + y * SCREEN_WIDTH] := clBackground;
video_buffer_sub[x + y * SCREEN_WIDTH] := clBackground;
end;
while True do
begin
swiWaitForVBlank();
end;
end.
la unit contiene la definizione dei colori in termini di WORD e non di TColor ... ma i nomi sono gli stessi e hanno la stessa rappresentazione RGB per il tema di default di Windows (sfondo azzurro, finestre grighie .... per intenderci).
Mi aspettavo di avere il "desktop" colorato del colore clBackground. Ma sembra che il mio codice e l'emulatore per NDS non ci intendiamo gran chè.
Mi cresha la rom ... e non capisco il motivo :(