====== FLI display routine ====== This is a simple FLI display routine. It works for standard multicolor FLI but it can also be modified to display IFLI by adding a simple $DD00 switch code. You also can use this for hires FLI, however the first 3 char columns will only show a light grey area. To remove this area, a sprite would be required which takes 5 extra clock cycles per rasterline. This is possible if you unroll the main FLI display loop. This displayer also opens the upper and lower border, because otherwise it would not be possible to display 200 rasterlines of FLI. Rasterlines $F8-$FF don't allow color DMA, so the last 3 rasterlines in the normal bitmap area are affected by that. To avoid those rasterlines, the bitmap is moved 3 pixels up. However, this moves the top 3 rasterlines into the border area. To display those, the border has to be opened. This code was used for this release: http://noname.c64.org/csdb/release/?id=47685 (You can also get the raw FLI picture data there) V1.1 update: PAL/NTSC fix added. tab18 = $0e00 tab11 = $0f00 *= $1000 jmp start irq0: pha lda $d019 sta $d019 inc $d012 lda #nmi sta $fffb ; dummy NMI to avoid crashing due to RESTORE lda #irq0 sta $ffff lda #$01 sta $d01a ; enable raster IRQs jsr initgfx jsr inittables jsr ntscfix lda $d019 dec $d019 ; clear raster IRQ flag cli jmp * ; that's it, no more action needed initgfx: lda #$00 sta $d015 ; disable sprites sta $d020 ; border color black lda #$00 ; background color sta $d021 lda #$ff sta $7fff ; upper/lower border black lda #$18 sta $d016 lda #$08 sta $d018 lda #$96 ; VIC bank $4000-$7FFF sta $dd00 ldy #$04 ldx #$00 ll: lda fli,x sta $d800,x ; copy color RAM data inx bne ll inc ll+2 inc ll+5 dey bne ll rts inittables: ldx #$00 l2: txa asl asl asl asl and #$70 ; color RAMs at $4000 ora #$08 ; bitmap data at $6000 sta tab18,x ; calculate $D018 table txa and #$07 ora #$38 ; bitmap sta tab11,x ; calculate $D011 table inx bne l2 rts ntscfix: bit $d011 bmi *-3 bit $d011 ; wait for rasterline 256 bpl *-3 lda #$00 test: cmp $d012 bcs nt lda $d012 ; get rasterline low byte nt: bit $d011 bmi test cmp #$20 ; PAL: $37, NTSC: $05 or $06 bcs pal lda #$ea sta ntsc1 sta ntsc2 sta ntsc3 dec ntsc4+1 pal: rts ; link a demo picture *= $3c00 fli: .binclude "bitfellas.fli",2