Codigo ping pong

Solo disponible en BuenasTareas
  • Páginas : 13 (3098 palabras )
  • Descarga(s) : 0
  • Publicado : 8 de septiembre de 2012
Leer documento completo
Vista previa del texto
* Este es el programa utilizado para este “Pic Ponng”
; PONG
__CONFIG 0x3F2A

up1b equ 3
down1b equ 2
left1b equ 4
right1b equ 5
fire1b equ 1
up2b equ 7
down2b equ 6
left2b equ 2
right2b equ 3
fire2b equ 1
up1p equ PORTB
down1p equ PORTB
left1p equ PORTB
right1p equ PORTB
fire1p equ PORTB
up2p equ PORTB
down2p equ PORTB
left2p equ PORTA
right2p equPORTA
fire2p equ PORTA

pl1_points equ 0x20
pl2_points equ 0x21
pl1_ypos equ 0x22
pl2_ypos equ 0x23
ball_xpos equ 0x24
ball_ypos equ 0x25
counter0 equ 0x26
counter1 equ 0x27
counter2 equ 0x28
videostuff equ 0x29
line equ 0x2A
pl equ 0x2B
counter5 equ 0x2C
delaycnt equ 0x2D
ball_xpart equ 0x2E
ball equ 0x2F
counter3 equ 0x30
counter4 equ 0x31
sound_counter equ 0x32sound_stuff equ 0x33
sound_counter2 equ 0x34
stuff equ 0x35
strptr equ 0x36
strptr2 equ 0x37
stringbuff equ 0x38

x_dir equ 0
x_speed equ 1
y_dir equ 2
y_speed equ 3
serve equ 4
wait equ 5

sound_length equ 0x3

delay MACRO
LOCAL label
movwf delaycnt
label decfsz delaycnt,f
goto label
ENDM

dnop MACRO
LOCAL label
label goto label+1
ENDM

org 0x000bcf STATUS,RP0
bcf STATUS,RP1
MOVLW 0x07 ;Turn comparators off and
MOVWF CMCON ;enable pins for I/O

goto menu

table
numbers addwf PCL,f
;number 0
retlw 0x1C
retlw 0x36
retlw 0x63
retlw 0x6B
retlw 0x63
retlw 0x36
retlw 0x1C
retlw 0x0
;number 1
retlw 0x18
retlw 0x1C
retlw 0x18
retlw 0x18
retlw 0x18
retlw 0x18
retlw 0x7E
retlw0x0
;number 2
retlw 0x3E
retlw 0x63
retlw 0x60
retlw 0x38
retlw 0xC
retlw 0x66
retlw 0x7F
retlw 0x0
;number 3
retlw 0x3E
retlw 0x63
retlw 0x60
retlw 0x3C
retlw 0x60
retlw 0x63
retlw 0x3E
retlw 0x0
;number 4
retlw 0x38
retlw 0x3C
retlw 0x36
retlw 0x33
retlw 0x7F
retlw 0x30
retlw 0x78
retlw 0x0
;number 5
retlw 0x7Fretlw 0x3
retlw 0x3
retlw 0x3F
retlw 0x60
retlw 0x63
retlw 0x3E
retlw 0x0
;number 6
retlw 0x1C
retlw 0x6
retlw 0x3
retlw 0x3F
retlw 0x63
retlw 0x63
retlw 0x3E
retlw 0x0
;number 7
retlw 0x7F
retlw 0x63
retlw 0x30
retlw 0x18
retlw 0xC
retlw 0xC
retlw 0xC
retlw 0x0
;number 8
retlw 0x3E
retlw 0x63
retlw 0x63retlw 0x3E
retlw 0x63
retlw 0x63
retlw 0x3E
retlw 0x0
;number 9
retlw 0x3E
retlw 0x63
retlw 0x63
retlw 0x7E
retlw 0x60
retlw 0x30
retlw 0x1E
retlw 0x0

;P
retlw 0x3F
retlw 0x66
retlw 0x66
retlw 0x3E
retlw 0x6
retlw 0x6
retlw 0xF
retlw 0x0
;L
retlw 0xF
retlw 0x6
retlw 0x6
retlw 0x6
retlw 0x46
retlw 0x66
retlw 0x7Fretlw 0x0
;.
retlw 0x0
retlw 0x0
retlw 0x0
retlw 0x0
retlw 0x0
retlw 0x18
retlw 0x18
retlw 0x0
; W
retlw 0x63
retlw 0x63
retlw 0x63
retlw 0x6B
retlw 0x6B
retlw 0x7F
retlw 0x36
retlw 0x0
; O
retlw 0x3E
retlw 0x63
retlw 0x63
retlw 0x63
retlw 0x63
retlw 0x63
retlw 0x3E
retlw 0x0
; N
retlw 0x63
retlw 0x67
retlw0x6F
retlw 0x7B
retlw 0x73
retlw 0x63
retlw 0x63
retlw 0x0
; G
retlw 0x3C
retlw 0x66
retlw 0x3
retlw 0x3
retlw 0x73
retlw 0x66
retlw 0x5C
retlw 0x0

; C
retlw 0x3C ;0xC3
retlw 0x42 ;0x99
retlw 0x99 ;0xFC
retlw 0x85 ;0xFC
retlw 0x85 ;0xFC
retlw 0x99 ;0x99
retlw 0x42 ;0xC3
retlw 0x3C ;0xFF
;R
retlw 0x3F
retlw 0x66
retlw 0x66retlw 0x3E
retlw 0x36
retlw 0x66
retlw 0x67
retlw 0x0
; U
retlw 0x63
retlw 0x63
retlw 0x63
retlw 0x63
retlw 0x63
retlw 0x63
retlw 0x3E
retlw 0x0
; E
retlw 0x7F
retlw 0x46
retlw 0x16
retlw 0x1E
retlw 0x16
retlw 0x46
retlw 0x7F
retlw 0x0
; space
retlw 0x0
retlw 0x0
retlw 0x0
retlw 0x0
retlw 0x0
retlw 0x0
retlw...
tracking img