template.pp 782 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. program template;
  2. uses
  3. ctypes, gba;
  4. var
  5. frame: integer = 0;
  6. zbuffer: array [0..239, 0..159] of u8; cvar; external; //EWRAM_BSS;
  7. procedure Vblank();
  8. begin
  9. frame := frame + 1;
  10. end;
  11. begin
  12. // the vblank interrupt must be enabled for VBlankIntrWait() to work
  13. // since the default dispatcher handles the bios flags no vblank handler
  14. // is required
  15. irqInit();
  16. irqSet(IRQ_VBLANK, @Vblank);
  17. irqEnable(IRQ_VBLANK);
  18. consoleInit(0, 4, 0, nil, 0, 15);
  19. BG_COLORS[0] := RGB8(58,110,165);
  20. BG_COLORS[241] := RGB5(31,31,31);
  21. SetMode(MODE_0 or BG0_ON);
  22. // ansi escape sequence to set print co-ordinates
  23. // /x1b[line;columnH
  24. iprintf(#27'[10;10H' + 'Hello World!'#10);
  25. iprintf('%x', getmem(200));
  26. while true do
  27. begin
  28. VBlankIntrWait();
  29. scanKeys();
  30. end;
  31. end.