base:techtech_fli
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
base:techtech_fli [2016-04-21 12:52] – Created this page compyx | base:techtech_fli [2016-04-22 12:41] (current) – added a screenshot compyx | ||
---|---|---|---|
Line 3: | Line 3: | ||
===== Introduction ===== | ===== Introduction ===== | ||
- | Below is an example of a tech-tech effect, achieved using a so-called FLI-routine. This is **not** a tech-tech with a FLI logo, its a simple | + | Below is an example of a tech-tech effect, achieved using a so-called FLI-routine. This is **not** a tech-tech with a FLI logo, its a simple |
+ | |||
+ | The routine differs from [[magazines: | ||
+ | |||
+ | {{: | ||
I wrote this code as part of an attempt to regain my old VIC-trickery skills, it's been about 25 years since I did a tech-tech. As such, the code may not be up to today' | I wrote this code as part of an attempt to regain my old VIC-trickery skills, it's been about 25 years since I did a tech-tech. As such, the code may not be up to today' | ||
+ | |||
+ | Note: I don't explain FLI in detail in this article, there are other articles here which explain FLI properly. | ||
The code can be assembled by using [[https:// | The code can be assembled by using [[https:// | ||
Line 11: | Line 17: | ||
- | + | ===== The Theory ===== | |
- | ====== The Theory ===== | + | |
//I'll use the word ' | //I'll use the word ' | ||
Line 46: | Line 51: | ||
This code we need to do for each (raster)line of the logo. But we have a problem... | This code we need to do for each (raster)line of the logo. But we have a problem... | ||
- | ===== The problem | + | ===== The Problem |
Manipulating $d016 on each raster line works fine, manipulating $d018 doesn' | Manipulating $d016 on each raster line works fine, manipulating $d018 doesn' | ||
- | ===== The solution | + | ===== The Solution ===== |
+ | |||
+ | Using the so-called FLI technique, we can trigger bad lines at every raster line, allowing us to manipulate the videoram pointer at every raster line. | ||
+ | |||
+ | So our basic tech-tech display routine would look like this: (loop unrolled to keep the FLI bug at three characters while using a single sprite to cover the bug) | ||
+ | <code 6502tasm> | ||
+ | ; sinus = 0 | ||
+ | lda #$1b | ||
+ | sta $d011 | ||
+ | lda #$00 ; 0 & 7 == 0 | ||
+ | sta $d016 | ||
+ | lda #$20 ; column 0 | ||
+ | sta $d018 | ||
+ | |||
+ | ; sinus = 3 | ||
+ | ; next rasterline | ||
+ | lda #$1c | ||
+ | sta $d011 | ||
+ | lda #$03 | ||
+ | sta $d016 | ||
+ | lda #$20 ; still column 0 | ||
+ | sta $d018 | ||
+ | |||
+ | ; sinus = 6 | ||
+ | lda #$1d | ||
+ | sta $d011 | ||
+ | lda #$06 | ||
+ | sta $d016 | ||
+ | lda #$20 | ||
+ | sta $d018 | ||
+ | |||
+ | ; sinus = 9 | ||
+ | lda #$1e | ||
+ | sta $d011 | ||
+ | lda #$01 ; 9 & 7 == 1 | ||
+ | sta $d016 | ||
+ | lda #$30 | ||
+ | sta $d018 ; column 1: 9 pixels means we need to select | ||
+ | ; the second videoram bank to move the logo | ||
+ | ; one column to the right | ||
+ | |||
+ | ; and so on for each line of the logo, wrapping the $d011 | ||
+ | ; value around from $1f to $18 | ||
+ | </ | ||
+ | |||
+ | Now we can tech-tech the logo by storing the correct values for $d016 and $d018 in the unrolled code, using for example a sinus table. The example code contains a routine which pre-calculates the $d016 and $d018 values from a sinus table for faster performance and another unrolled loop to store these values in the FLI-routine each frame, again for performance. | ||
+ | |||
+ | |||
+ | ===== The Code ===== | ||
- | Using the so-called | + | Here' |
- | + | Before assembling, one should probably comment out the references to the music, I would be surprised to see everyone having their HVSC at "/ | |
<code 6502tasm> | <code 6502tasm> |
base/techtech_fli.1461235970.txt.gz · Last modified: 2016-04-21 12:52 by compyx