base:fld
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revisionNext revisionBoth sides next revision | ||
base:fld [2015-04-17 04:31] – external edit 127.0.0.1 | base:fld [2019-07-22 15:34] – martin_piper | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== FLD - Flexible Line Distance ====== | ||
+ | |||
+ | FLD means the ability to move blocks of graphics vertically on the screen. More precisely FLD operates on char-lines (8 pixels high) as its smallest element. With FLD you can make gaps between char-lines, thus the graphics below the FLD will be pushed down on the screen. | ||
+ | |||
+ | {{: | ||
+ | |||
+ | Here is a short piece of code that shows a very basic FLD-effect. FLD does not require exact timing and doesn' | ||
+ | |||
+ | /HCL | ||
+ | |||
+ | Binary: {{: | ||
+ | |||
+ | < | ||
+ | sei | ||
+ | loop1 | ||
+ | bit $d011 ; Wait for new frame | ||
+ | bpl *-3 | ||
+ | bit $d011 | ||
+ | bmi *-3 | ||
+ | |||
+ | lda #$1b ; Set y-scroll to normal position (because we do FLD later on..) | ||
+ | sta $d011 | ||
+ | |||
+ | jsr CalcNumLines ; Call sinus substitute routine | ||
+ | |||
+ | lda #$40 ; Wait for position where we want FLD to start | ||
+ | cmp $d012 | ||
+ | bne *-3 | ||
+ | |||
+ | ldx NumFLDLines | ||
+ | beq loop1 ; Skip if we want 0 lines FLD | ||
+ | loop2 | ||
+ | lda $d012 ; Wait for beginning of next line | ||
+ | cmp $d012 | ||
+ | beq *-3 | ||
+ | |||
+ | clc ; Do one line of FLD | ||
+ | lda $d011 | ||
+ | adc #1 | ||
+ | and #7 | ||
+ | ora #$18 | ||
+ | sta $d011 | ||
+ | |||
+ | dex ; Decrease counter | ||
+ | bne loop2 ; Branch if counter not 0 | ||
+ | |||
+ | jmp loop1 ; Next frame | ||
+ | |||
+ | CalcNumLines | ||
+ | lda #0 | ||
+ | bpl *+4 | ||
+ | eor #$ff | ||
+ | lsr | ||
+ | lsr | ||
+ | lsr | ||
+ | sta NumFLDLines | ||
+ | inc CalcNumLines+1 | ||
+ | rts | ||
+ | |||
+ | NumFLDLines | ||
+ | .byte 0 | ||
+ | |||
+ | </ | ||
+ | |||
+ | An example of [[https:// | ||
base/fld.txt · Last modified: 2019-07-22 15:38 by martin_piper