base:logo_swing
no way to compare when less than two revisions
Differences
This shows you the differences between two versions of the page.
— | base:logo_swing [2015-04-17 04:32] (current) – created - external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | === Logo Swing === | ||
+ | |||
+ | Many classic C64 intros or demos in the demo scene in the 1980's and early 1990' | ||
+ | |||
+ | So then, how does this work? Well, it is really hard for me to explain it properly but I can vaguely know what happens. Well, if you remember the smooth scroll method that triggers $D016 then you should hopefully be familiar with that. Actually the logo swing sort of works a similar kind of way, except that instead of reading a scroll text, you're actually reading the logo data instead. This data is called the MATRIX. | ||
+ | |||
+ | The source for the logo swing will be coming up shortly, but first a logo will need to be drawn. A logo can only be 3 colours. So I recommend that you download a painting program, and then use [[http:// | ||
+ | |||
+ | Secondly before you can actually swing your logo, it is recommended that you use the [[http:// | ||
+ | |||
+ | Now then, you'll want to do some logo swinging, so below is the ACME source. What this does is calculate the value of the sinus (movement) of the logo and also the position of the matrix, so that you can see the logo swinging forwards and backwards. | ||
+ | |||
+ | Source: | ||
+ | < | ||
+ | ;Logo swing routine | ||
+ | |||
+ | swingpointer = $02 | ||
+ | swingstore = $03 | ||
+ | !to " | ||
+ | * = $0810 | ||
+ | sei | ||
+ | jsr $ff81 ;Init screen | ||
+ | lda #$18 | ||
+ | sta $d018 ;Logo font at $2000 | ||
+ | lda #$00 | ||
+ | sta $d020 | ||
+ | sta $d021 | ||
+ | |||
+ | ;Fill the whole screen colours to cyan multicolour as we are using | ||
+ | ;the most popular blue scheme. | ||
+ | |||
+ | ldx #$00 | ||
+ | shadeitcyan | ||
+ | sta $d800,x | ||
+ | sta $d900,x | ||
+ | sta $da00,x | ||
+ | sta $dae8,x | ||
+ | inx | ||
+ | bne shadeitcyan | ||
+ | lda #$06 | ||
+ | ldx #$0e | ||
+ | sta $d022 | ||
+ | stx $d023 | ||
+ | |||
+ | ;Now for the IRQ init routine | ||
+ | |||
+ | |||
+ | lda #<irq | ||
+ | ldx #>irq | ||
+ | sta $0314 | ||
+ | stx $0315 | ||
+ | lda #$31 | ||
+ | ldx #$7f | ||
+ | sta $d012 | ||
+ | stx $dc0d | ||
+ | lda #$1b | ||
+ | sta $d011 | ||
+ | lda #$01 | ||
+ | sta $d01a | ||
+ | cli | ||
+ | loop lda #$00 | ||
+ | sta $06 | ||
+ | synchronize | ||
+ | beq synchronize | ||
+ | jsr logoswing | ||
+ | jmp loop | ||
+ | |||
+ | ;Main IRQ routine for the logo swing | ||
+ | |||
+ | irq inc $d019 | ||
+ | lda #$32 | ||
+ | sta $d012 | ||
+ | lda swingstore | ||
+ | sta $d016 | ||
+ | jmp $ea7e | ||
+ | swinglogo lda #$ff | ||
+ | sec | ||
+ | ldx swingpointer | ||
+ | sbc $3800,x ;Value of sinus (Which I made in Bonzai' | ||
+ | lsr | ||
+ | lsr | ||
+ | lsr | ||
+ | tax | ||
+ | ldy #$00 | ||
+ | screen | ||
+ | sta $0400,y ;Screen loc. to write to | ||
+ | lda $3000+64,x | ||
+ | sta $0400+40,y | ||
+ | lda $3000+64*2, | ||
+ | sta $0400+80,y | ||
+ | lda $3000+64*3, | ||
+ | sta $0400+120,y | ||
+ | lda $3000+64*4, | ||
+ | sta $0400+160,y | ||
+ | lda $3000+64*5, | ||
+ | sta $0400+200,y | ||
+ | lda $3000+64*6, | ||
+ | sta $0400+240,y | ||
+ | inx | ||
+ | iny | ||
+ | cpy #$27 ;Read y 39 times | ||
+ | bne screen | ||
+ | ldx swingpointer | ||
+ | lda $3800,x | ||
+ | and #$07 | ||
+ | ora #$d0 ;Kill this if your logo is not multicolour | ||
+ | sta swingstore ;The value to put into $D016 | ||
+ | inc swingpointer ;Add 1 to the swing pointer | ||
+ | rts | ||
+ | |||
+ | ;Binaries for the source. | ||
+ | |||
+ | * = $2000-2 | ||
+ | !binary " | ||
+ | * = $3000-2 | ||
+ | !binary " | ||
+ | * = $3800-2 | ||
+ | !binary " | ||
+ | </ | ||
+ | |||
base/logo_swing.txt · Last modified: 2015-04-17 04:32 by 127.0.0.1