base:simple_sprite-multiplexer_using_sprite_1
no way to compare when less than two revisions
Differences
This shows you the differences between two versions of the page.
— | base:simple_sprite-multiplexer_using_sprite_1 [2015-04-17 04:33] (current) – created - external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | !to " | ||
+ | |||
+ | ; | ||
+ | ; | ||
+ | ; | ||
+ | ; | ||
+ | ; Basics : IRQ | ||
+ | ; @L Wait for Y-Pos | ||
+ | ; write (new) Y-Position | ||
+ | ; write (new) Sprite-Pointer | ||
+ | ; set some other registers according to the sprite | ||
+ | ; wait 21+1 (Spriteheight+1) Rasterlines | ||
+ | ; JMP @L | ||
+ | ; | ||
+ | ; | ||
+ | ; | ||
+ | ; Compiler : ACME | ||
+ | ; | ||
+ | ; Michael Sachse, 20. Maerz 2007 | ||
+ | ; | ||
+ | ; | ||
+ | |||
+ | |||
+ | ;-- Basicstart | ||
+ | |||
+ | *= $0800 | ||
+ | !byte $00, | ||
+ | |||
+ | *= $0810 | ||
+ | |||
+ | ; | ||
+ | |||
+ | lda #00 | ||
+ | sta $d020 | ||
+ | sta $d021 | ||
+ | lda #147 | ||
+ | jsr $ffd2 | ||
+ | jsr setup_sprite ; init Sprite 1 | ||
+ | ; | ||
+ | ; New Raster-IRQ | ||
+ | ; | ||
+ | |||
+ | | ||
+ | lda #<int | ||
+ | sta $0314 | ||
+ | lda #>int | ||
+ | sta $0315 ; new IRQ | ||
+ | lda #$00 | ||
+ | sta $d012 | ||
+ | lda #$7f | ||
+ | sta $dc0d ; Timer off | ||
+ | lda #$01 | ||
+ | sta $d019 | ||
+ | sta $d01a | ||
+ | cli | ||
+ | jmp * | ||
+ | |||
+ | ; | ||
+ | |||
+ | int lda $d019 | ||
+ | and #$01 | ||
+ | sta $d019 | ||
+ | bne irq | ||
+ | jmp $ea81 | ||
+ | |||
+ | ; | ||
+ | |||
+ | irq lda #$00 | ||
+ | sta $d012 | ||
+ | |||
+ | jsr animate | ||
+ | |||
+ | |||
+ | l0 lda $d012 | ||
+ | cmp #78 ; y = 78 | ||
+ | bne l0 | ||
+ | sta $d001 | ||
+ | lda #$28 ; Spritepointer Sprite 1 | ||
+ | sta $07f8 ; $0a00 = $28*$40 | ||
+ | |||
+ | l1 lda $d012 | ||
+ | cmp #100 ; y = 100 | ||
+ | bne l1 | ||
+ | sta $d001 | ||
+ | lda #$29 ; write Sprite-Pointer again | ||
+ | sta $07f8 | ||
+ | lda #6 ; a new color | ||
+ | sta $d026 | ||
+ | |||
+ | l2 lda $d012 | ||
+ | cmp #122 ; y = 122 | ||
+ | bne l2 | ||
+ | sta $d001 | ||
+ | lda #$28 ; write Sprite-Pointer again | ||
+ | sta $07f8 | ||
+ | lda #3 | ||
+ | sta $d026 | ||
+ | |||
+ | l3 lda $d012 | ||
+ | cmp #144 ; y =144 | ||
+ | bne l3 | ||
+ | sta $d001 | ||
+ | lda #$29 ; write Sprite-Pointer again | ||
+ | sta $07f8 | ||
+ | lda #2 | ||
+ | sta $d026 ; a new color | ||
+ | |||
+ | le lda $d012 | ||
+ | cmp #255 | ||
+ | bne le | ||
+ | jmp $ea81 | ||
+ | |||
+ | ; | ||
+ | ; move sprite | ||
+ | ; | ||
+ | |||
+ | animate | ||
+ | lda $d000 | ||
+ | bne ex | ||
+ | lda #50 | ||
+ | sta $d000 | ||
+ | ex rts | ||
+ | |||
+ | ; | ||
+ | ; | ||
+ | ; | ||
+ | |||
+ | setup_sprite | ||
+ | |||
+ | lda #1 ; Colors | ||
+ | sta $d025 | ||
+ | lda #11 | ||
+ | sta $d026 | ||
+ | lda #15 | ||
+ | sta $d027 ; | ||
+ | lda #64 | ||
+ | sta $d000 ; X-Position | ||
+ | lda #$01 ; | ||
+ | sta $d015 ; Sprite 1 on | ||
+ | sta $d01c ; Multicolor | ||
+ | rts | ||
+ | |||
+ | ; | ||
+ | ; 2 Sprites | ||
+ | ; | ||
+ | |||
+ | *=$0a00 | ||
+ | |||
+ | !byte $ff, | ||
+ | !byte $00, | ||
+ | !byte $f0, | ||
+ | !byte $03, | ||
+ | |||
+ | ; $0a40 | ||
+ | |||
+ | !byte $FF, | ||
+ | !byte $FF, | ||
+ | !byte $FF, | ||
+ | !byte $FF, |
base/simple_sprite-multiplexer_using_sprite_1.txt · Last modified: 2015-04-17 04:33 by 127.0.0.1