31
c64 / VIC kursu preview
« : 12.01.2007 16:04:01 »
sağolun hocam. ramboya da Teşekkürler. çok makbule geçti.
Bu özellik size üyenin attığı tüm iletileri gösterme olanağı sağlayacaktır . Not sadece size izin verilen bölümlerdeki iletilerini görebilirsiniz
[SIZE=1][COLOR=#000040]
[/COLOR][/SIZE][SIZE=4][COLOR=#008000]!to[/COLOR][COLOR=#800080]"sprite2.prg"[/COLOR][/SIZE][COLOR=#000040][SIZE=4],cbm[/SIZE]
[/COLOR][SIZE=4][COLOR=#008000]*=[/COLOR][COLOR=#804000]$1000
[/COLOR][/SIZE][COLOR=#000040]
[/COLOR][COLOR=#808080][SIZE=4]; Sprite Bas[/SIZE]
[/COLOR][COLOR=#000040][SIZE=4]lda [/SIZE][/COLOR][SIZE=4][COLOR=#008080]#[/COLOR][COLOR=#804000]$01
[/COLOR][/SIZE][COLOR=#000040][SIZE=4]sta [/SIZE][/COLOR][COLOR=#804000][SIZE=4]$d015[/SIZE]
[/COLOR][COLOR=#000040]
[SIZE=4]lda [/SIZE][/COLOR][SIZE=4][COLOR=#008080]#[/COLOR][COLOR=#804000]$10[/COLOR][COLOR=#808080];c0 ; $c0*$40 = $3000 adresindeki spriteı göster
[/COLOR][/SIZE][COLOR=#000040][SIZE=4]sta [/SIZE][/COLOR][COLOR=#804000][SIZE=4]$07f8[/SIZE]
[/COLOR][COLOR=#000040]
[SIZE=4]lda [/SIZE][/COLOR][SIZE=4][COLOR=#008080]#[/COLOR][COLOR=#804000]$98
[/COLOR][/SIZE][COLOR=#000040][SIZE=4]sta [/SIZE][/COLOR][SIZE=4][COLOR=#804000]$d000[/COLOR][COLOR=#808080]; spriteın x koordinatı
[/COLOR][/SIZE][COLOR=#000040]
[SIZE=4]lda [/SIZE][/COLOR][SIZE=4][COLOR=#008080]#[/COLOR][COLOR=#804000]$72
[/COLOR][/SIZE][COLOR=#000040][SIZE=4]sta [/SIZE][/COLOR][SIZE=4][COLOR=#804000]$d001[/COLOR][COLOR=#808080]; spriteın y koordinatı
[/COLOR][/SIZE][COLOR=#000040]
[/COLOR][COLOR=#808080][SIZE=4]; Interruptı Hazırla[/SIZE]
[/COLOR][COLOR=#000040][SIZE=4]sei[/SIZE]
[SIZE=4]lda [/SIZE][/COLOR][SIZE=4][COLOR=#008080]#[/COLOR][COLOR=#804000]$7f
[/COLOR][/SIZE][COLOR=#000040][SIZE=4]sta [/SIZE][/COLOR][COLOR=#804000][SIZE=4]$dc0d[/SIZE]
[/COLOR][COLOR=#000040]
[SIZE=4]lda [/SIZE][/COLOR][SIZE=4][COLOR=#008080]#[/COLOR][COLOR=#804000]$01
[/COLOR][/SIZE][COLOR=#000040][SIZE=4]sta [/SIZE][/COLOR][COLOR=#804000][SIZE=4]$d01a[/SIZE]
[/COLOR][COLOR=#000040]
[SIZE=4]lda [/SIZE][/COLOR][SIZE=4][COLOR=#008080]#[/COLOR][COLOR=#804000]$1b
[/COLOR][/SIZE][COLOR=#000040][SIZE=4]sta [/SIZE][/COLOR][COLOR=#804000][SIZE=4]$d011[/SIZE]
[/COLOR][COLOR=#000040]
[SIZE=4]lda [/SIZE][/COLOR][SIZE=4][COLOR=#008080]#[/COLOR][COLOR=#804000]$00
[/COLOR][/SIZE][COLOR=#000040][SIZE=4]sta [/SIZE][/COLOR][COLOR=#804000][SIZE=4]$d012[/SIZE]
[/COLOR][COLOR=#000040]
[SIZE=4]lda [/SIZE][/COLOR][SIZE=4][COLOR=#008080]#[/COLOR][/SIZE][COLOR=#000040][SIZE=4]<irq_rutini[/SIZE]
[SIZE=4]sta [/SIZE][/COLOR][COLOR=#804000][SIZE=4]$0314[/SIZE]
[/COLOR][COLOR=#000040]
[SIZE=4]lda [/SIZE][/COLOR][SIZE=4][COLOR=#008080]#[/COLOR][/SIZE][COLOR=#000040][SIZE=4]>irq_rutini[/SIZE]
[SIZE=4]sta [/SIZE][/COLOR][COLOR=#804000][SIZE=4]$0315[/SIZE]
[/COLOR][COLOR=#000040]
[SIZE=4]cli[/SIZE]
[/COLOR][COLOR=#808080][SIZE=4]; Space kontrolü[/SIZE]
[/COLOR][COLOR=#000040][SIZE=4]space [/SIZE]
[SIZE=4]lda [/SIZE][/COLOR][COLOR=#804000][SIZE=4]$dc01[/SIZE]
[/COLOR][COLOR=#000040][SIZE=4]cmp [/SIZE][/COLOR][SIZE=4][COLOR=#008080]#[/COLOR][COLOR=#804000]$ef
[/COLOR][/SIZE][COLOR=#000040]
[SIZE=4]bne space[/SIZE]
[/COLOR][COLOR=#808080][SIZE=4]; Spriteları kapa[/SIZE]
[/COLOR][COLOR=#808080][SIZE=4];lda #$00[/SIZE]
[/COLOR][COLOR=#808080][SIZE=4];sta $d015[/SIZE]
[/COLOR][COLOR=#000040]
[/COLOR][COLOR=#808080][SIZE=4]; Basic'e dön[/SIZE]
[/COLOR][COLOR=#000040][SIZE=4]sei[/SIZE]
[SIZE=4]lda [/SIZE][/COLOR][SIZE=4][COLOR=#008080]#[/COLOR][COLOR=#804000]$81
[/COLOR][/SIZE][COLOR=#000040][SIZE=4]sta [/SIZE][/COLOR][COLOR=#804000][SIZE=4]$dc0d[/SIZE]
[/COLOR][COLOR=#000040]
[SIZE=4]lda [/SIZE][/COLOR][SIZE=4][COLOR=#008080]#[/COLOR][COLOR=#804000]$f0
[/COLOR][/SIZE][COLOR=#000040][SIZE=4]sta [/SIZE][/COLOR][COLOR=#804000][SIZE=4]$d01a[/SIZE]
[/COLOR][COLOR=#000040]
[SIZE=4]lda [/SIZE][/COLOR][SIZE=4][COLOR=#008080]#[/COLOR][COLOR=#804000]$31
[/COLOR][/SIZE][COLOR=#000040][SIZE=4]sta [/SIZE][/COLOR][COLOR=#804000][SIZE=4]$0314[/SIZE]
[/COLOR][COLOR=#000040]
[SIZE=4]lda [/SIZE][/COLOR][SIZE=4][COLOR=#008080]#[/COLOR][COLOR=#804000]$ea
[/COLOR][/SIZE][COLOR=#000040][SIZE=4]sta [/SIZE][/COLOR][COLOR=#804000][SIZE=4]$0315[/SIZE]
[/COLOR][COLOR=#000040]
[SIZE=4]cli[/SIZE]
[SIZE=4]rts[/SIZE]
[/COLOR][COLOR=#808080][SIZE=4]; Interrupt Rutini[/SIZE]
[/COLOR][COLOR=#000040][SIZE=4]int [/SIZE]
[SIZE=4]inc [/SIZE][/COLOR][SIZE=4][COLOR=#804000]$d000[/COLOR][COLOR=#808080]; Sprite'ın X koordinatını 1 arttır
[/COLOR][/SIZE][COLOR=#000040][SIZE=4]lda [/SIZE][/COLOR][SIZE=4][COLOR=#804000]$d000[/COLOR][COLOR=#808080]; Eğer sprite 255'i geçmediyse
[/COLOR][/SIZE][COLOR=#000040][SIZE=4]bne out [/SIZE][/COLOR][COLOR=#808080][SIZE=4]; interruptın çıkışına git[/SIZE]
[/COLOR][COLOR=#000040]
[SIZE=4]lda [/SIZE][/COLOR][SIZE=4][COLOR=#804000]$d010[/COLOR][COLOR=#808080]; Sprite 255'i geçtiyse
[/COLOR][/SIZE][COLOR=#000040][SIZE=4]eor [/SIZE][/COLOR][SIZE=4][COLOR=#008080]#[/COLOR][COLOR=#804000]$01[/COLOR][COLOR=#808080]; 9.bitini değiştir
[/COLOR][/SIZE][COLOR=#000040][SIZE=4]sta [/SIZE][/COLOR][SIZE=4][COLOR=#804000]$d010[/COLOR][COLOR=#808080]; 0 ise 1 yap, 1 ise 0 yap
[/COLOR][/SIZE][COLOR=#000040][SIZE=4]out [/SIZE]
[SIZE=4]inc [/SIZE][/COLOR][COLOR=#804000][SIZE=4]$d019[/SIZE]
[/COLOR][COLOR=#000040]
[SIZE=4]jmp [/SIZE][/COLOR][SIZE=4][COLOR=#804000]$ea81[/COLOR][/SIZE][COLOR=#000040]
[SIZE=4]irq_rutini:[/SIZE]
[SIZE=4]inc [/SIZE][/COLOR][COLOR=#804000][SIZE=4]$d019[/SIZE]
[/COLOR][COLOR=#000040][SIZE=4]jsr sprite_pozisyonunu_guncelle[/SIZE]
[SIZE=4]jmp [/SIZE][/COLOR][COLOR=#804000][SIZE=4]$ea81[/SIZE]
[/COLOR][COLOR=#000040]
[SIZE=4]sprite_pozisyonunu_guncelle:[/SIZE]
[SIZE=4]lda hareket_yonu[/SIZE]
[SIZE=4]cmp [/SIZE][/COLOR][SIZE=4][COLOR=#008080]#[/COLOR][/SIZE][COLOR=#000040][SIZE=4]SAGA_HAREKET[/SIZE]
[SIZE=4]beq saga_kaydir[/SIZE]
[SIZE=4]jmp sola_kaydir[/SIZE]
[SIZE=4]saga_kaydir:[/SIZE]
[SIZE=4]ldx [/SIZE][/COLOR][COLOR=#804000][SIZE=4]$d000[/SIZE]
[/COLOR][COLOR=#000040][SIZE=4]inx [/SIZE]
[SIZE=4]beq sola_don[/SIZE]
[SIZE=4]stx [/SIZE][/COLOR][COLOR=#804000][SIZE=4]$d000[/SIZE]
[/COLOR][COLOR=#000040][SIZE=4]jmp irq_rutini_sonu[/SIZE]
[SIZE=4]sola_don:[/SIZE]
[SIZE=4]lda [/SIZE][/COLOR][SIZE=4][COLOR=#008080]#[/COLOR][/SIZE][COLOR=#000040][SIZE=4]SOLA_HAREKET[/SIZE]
[SIZE=4]sta hareket_yonu[/SIZE]
[SIZE=4]lda [/SIZE][/COLOR][SIZE=4][COLOR=#008080]#[/COLOR][COLOR=#804000]$fe
[/COLOR][/SIZE][COLOR=#000040][SIZE=4]sta [/SIZE][/COLOR][COLOR=#804000][SIZE=4]$d000[/SIZE]
[/COLOR][COLOR=#000040][SIZE=4]jmp irq_rutini_sonu[/SIZE]
[SIZE=4]sola_kaydir:[/SIZE]
[SIZE=4]ldx [/SIZE][/COLOR][COLOR=#804000][SIZE=4]$d000[/SIZE]
[/COLOR][COLOR=#000040][SIZE=4]dex [/SIZE]
[SIZE=4]beq saga_don[/SIZE]
[SIZE=4]stx [/SIZE][/COLOR][COLOR=#804000][SIZE=4]$d000[/SIZE]
[/COLOR][COLOR=#000040][SIZE=4]jmp irq_rutini_sonu[/SIZE]
[SIZE=4]saga_don:[/SIZE]
[SIZE=4]lda [/SIZE][/COLOR][SIZE=4][COLOR=#008080]#[/COLOR][/SIZE][COLOR=#000040][SIZE=4]SAGA_HAREKET[/SIZE]
[SIZE=4]sta hareket_yonu[/SIZE]
[SIZE=4]lda [/SIZE][/COLOR][SIZE=4][COLOR=#008080]#[/COLOR][COLOR=#804000]$00
[/COLOR][/SIZE][COLOR=#000040][SIZE=4]sta [/SIZE][/COLOR][COLOR=#804000][SIZE=4]$d000[/SIZE]
[/COLOR][COLOR=#000040][SIZE=4]jmp irq_rutini_sonu[/SIZE]
[SIZE=4]irq_rutini_sonu:[/SIZE]
[SIZE=4]rts[/SIZE]
[SIZE=4]hareket_yonu:[/SIZE]
[/COLOR][SIZE=4][COLOR=#008000]!by[/COLOR][/SIZE][COLOR=#000040][SIZE=4] SAGA_HAREKET[/SIZE]
[SIZE=4]SAGA_HAREKET = 1[/SIZE]
[SIZE=4]SOLA_HAREKET = 2[/SIZE]
[/COLOR][SIZE=4][COLOR=#008000]*=[/COLOR][COLOR=#804000]$3000
[/COLOR][/SIZE][SIZE=4][COLOR=#008000]!fill[/COLOR][COLOR=#000040] 63,255 [/COLOR][COLOR=#808080]; Sprite haritasını 255 ile doldur
[/COLOR][/SIZE][COLOR=#808080][SIZE=4];!fill 31,0 ; Sprite haritasını 255 ile doldur[/SIZE]
[/COLOR][COLOR=#808080][SIZE=4];!fill 1,1 ; Sprite haritasını 255 ile doldur[/SIZE]
[/COLOR][SIZE=1][COLOR=#808080][SIZE=4];!fill 31,0 ; Sprite haritasını 255 ile doldur[/SIZE]
[/COLOR][/SIZE]
Kod: [Seç]lda #$c0 ; [B]$c0*$40[/B] = $3000 adresindeki spriteı göster