0 Members and 1 Guest are viewing this topic.
10 SYS(32768)20 PRINT PEEK(2)30 GOTO 10
*=$1000;Set sprite pointer0 to $2000 ($80*$40) lda #$80 sta $07f8;Enable sprites lda #$01 sta $d015;Expand X,Y sta $d01d sta $d017;Set X position of sprite0 (128) lda #$80 sta $d000 sta $d001loop inc $d001 ldx #$00delay1 ldy #$05delay2 dey bne delay2 dex bne delay1 lda $d001 lsr a lsr a lsr a lsr a sta $d027 jmp loop rts
*=$2000; Metroid BYTE $01,$FF,$80 BYTE $07,$FF,$E0 BYTE $0E,$63,$F0 BYTE $19,$99,$F8 BYTE $33,$3D,$FC BYTE $37,$3D,$FC BYTE $66,$3C,$FE BYTE $68,$18,$3E BYTE $79,$42,$9E BYTE $CB,$A5,$DF BYTE $F3,$C3,$DF BYTE $F9,$E7,$BF BYTE $8C,$C3,$31 BYTE $87,$18,$E1 BYTE $59,$C3,$9A BYTE $3C,$FF,$3C BYTE $3A,$3C,$5C BYTE $34,$DB,$2C BYTE $10,$81,$08 BYTE $08,$C3,$10 BYTE $00,$42,$00
joy2 = 56320vic = $d000spr0_x = $00spr0_y = $01screen0H = $04screen1H = $08ptr0 = $FCptr1 = $FEdefm incw inc /1 bne @no_carry inc /1 + $01@no_carry endm*=$1000start loop ldx #0 stx ptr0 ;ptr0L stx ptr1 ;ptr1L ldx #screen0H stx ptr0+$01 ;ptr0H ldx #screen1H stx ptr1+$01 ;ptr1H ldx #$08 jsr copy_loop1 lda #$25 sta vic + $18 ldx #0 stx ptr0 ;ptr0L stx ptr1 ;ptr1L ldx #screen0H stx ptr0+$01 ;ptr0H ldx #screen1H stx ptr1+$01 ;ptr1H ldx #$08 jsr copy_loop0 lda #$15 sta vic + $18 jmp loop ;;;;;;;;;;;;;;;;copy_loop1 ;Start of program. ldy #0 lda (ptr0),y ;Copy from screen0 incw ptr0 ldy #1 sta (ptr1),y ;Save to screen1. incw ptr1 cpx ptr0 + $01 ; Stop if end of screen is reached. bne copy_loop1 rts copy_loop0 ;Start of program. ldy #0 lda (ptr1),y ;Copy from screen0 incw ptr1 ldy #1 sta (ptr0),y ;Save to screen1. incw ptr0 cpx ptr0 + $01 ; Stop if end of screen is reached. bne copy_loop0 rts
$0000 a2 01 ldx #$01 $0002 e8 inx $0003 86 06 stx $06 $0005 4c 00 00 jmp $0000
CON 'Set up the clock mode _clkmode = xtal1 + pll16x _xinfreq = 5_000_000 '5 MHz clock * 16x PLL = 80 MHz system clock speed VAR 'Globally accessible variables byte ph0 byte rw byte reset byte a byte mode long addr byte progmem[$2000] OBJ 'in leiu of Parallax Serial Terminal, FullDuplexSerial is being used to communicate with the terminal serial : "FullDuplexSerial" PUB Main | i{{ Starts execution This test program attempts to test all aspects of the FullDuplexSerial object. It executs each public method call provided by FullDuplexSerial. Set your terminal to a baud rate of 9600 baud to see the output. parameters: none return: none example usage: N/A - executes on startup}} ph0 := 27 rw := 26 reset := 25 mode := 0 addr := 0 dira[7..0]:=$00 dira[20..8]:=$00 dira[ph0]:=1 dira[rw]:=0 dira[reset]:=1 outa[ph0]:=1 outa[7..0]:=$00 { $0000 a2 01 ldx #$01 $0002 e8 inx $0003 86 06 stx $06 $0005 4c 00 00 jmp $0000 } progmem[$0000]:=$a2 progmem[$0001]:=$01 progmem[$0002]:=$e8 progmem[$0003]:=$86 progmem[$0004]:=$06 progmem[$0005]:=$4c progmem[$0006]:=$00 progmem[$0007]:=$00 progmem[$1FFC]:=$00 progmem[$1FFD]:=$00 'pulse reset outa[reset]:=0 repeat 8 outa[ph0]:=0 outa[ph0]:=1 outa[reset]:=1 repeat 4 Wait_1_Second 'start the FullDuplexSerial object serial.Start(31, 30, %0000, 9_600) 'requires 1 cog for operation 'Main loop for ram emulator + control signal generator repeat 'Clock low outa[ph0]:=0 'Read R/W line if ina[rw]==0 dira[7..0]:=0 serial.tx(87)'w mode := 0 else dira[7..0]:=$ff serial.tx(82) mode := 1 'Display address bus value serial.tx(32) addr:=ina[20..8] serial.hex(addr,4) 'Read/write byte from/to data bus if mode == 1 outa[7..0] := progmem[addr] serial.tx(32) 'Clock high outa[ph0]:=1 if mode == 0 progmem[addr] := ina[7..0] 'Look at Data bus serial.hex(ina[7..0],2) serial.tx(32) serial.tx(13)PUB Wait_1_Second{{ Pauses the calling cog's execution for approximately one second. parameters: none return: none example usage: Wait_1_Second}} waitcnt(cnt + clkfreq)pub Wait_100_Ms waitcnt(clkfreq/10 + cnt)
*=2lda #01sta $00loop0:lda $01and #2beq loop0:loop1:lda $01and #2bne loop1:lda $01and #1eor #1sta $01jmp loop0:.end
Cool ! Also, you both need to grow some hair.