PcxView.pp 678 B

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