summaryrefslogtreecommitdiff
path: root/fpcsrc/packages/libgbafpc/examples/graphics/PCXView/PcxView.pp
blob: a2ee725107e1b6d95af997fb7cccc02f5acf4594 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
program PcxView;

uses
  ctypes, gba;

{$l build/splash.pcx.o}


{$include inc/splash.pcx.inc}

var
  PaletteBuffer: array [0..255] of cuint16;
  frame: cuint;


procedure VblankInterrupt();
begin
  frame := frame + 1;
  scanKeys();
end;



begin
  // Set up the interrupt handlers
  irqInit();
  irqSet(IRQ_VBLANK, @VblankInterrupt);
  
  // Enable Vblank Interrupt to allow VblankIntrWait
  irqEnable(IRQ_VBLANK);
  
  // Allow Interrupts
  REG_IME^ := 1;
  
  SetMode(MODE_4 or BG2_ON);		// screen mode & background to display
  
  DecodePCX(@splash_pcx, pcuint16(VRAM), @PaletteBuffer);
  
  FadeToPalette(PaletteBuffer, 60);
  
  while true do
    VBlankIntrWait();
end.