pcx_view.pp 819 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. program pcx_view;
  2. uses
  3. ctypes, gba;
  4. {$l data/splash.pcx.o}
  5. var
  6. PaletteBuffer: array [0..255] of cuint16;
  7. frame: cuint;
  8. splash_pcx_end: array [0..0] of cuint8; cvar; external;
  9. splash_pcx: array [0..0] of cuint8; cvar; external;
  10. splash_pcx_size: array [0..0] of cuint32; cvar; external;
  11. procedure VblankInterrupt();
  12. begin
  13. frame := frame + 1;
  14. scanKeys();
  15. end;
  16. begin
  17. // Set up the interrupt handlers
  18. irqInit();
  19. irqSet(IRQ_VBLANK, @VblankInterrupt);
  20. // Enable Vblank Interrupt to allow VblankIntrWait
  21. irqEnable(IRQ_VBLANK);
  22. // Allow Interrupts
  23. REG_IME^ := 1;
  24. SetMode(MODE_4 or BG2_ON); // screen mode & background to display
  25. DecodePCX(@splash_pcx, pcuint16(VRAM), @PaletteBuffer);
  26. FadeToPalette(PaletteBuffer, 60);
  27. while true do
  28. VBlankIntrWait();
  29. end.