DIRECTO N-.5 JUGANDO CON LAS GRAFICAS 2DA PARTE

Después de las interrupciones que tuvimos en el capitulo anterior, proseguimos con el tutorial. donde finalizaremos los niveles de gráficos.

Después de haber explicado como se comportan los gráficos en pantalla en un atari, realizaremos las nuevas validaciones de niveles.

También explicaremos de forma didáctica, los procesos de copias de bytes que necesitaremos para crear nuestras pantallas.

dejamos el código fuente el cual estamos programando, para que puedas modificarlo a tu gusto.

principal.asm

	org $2000
consol	= 53279	; select option start
nivel
	.by 1
p1	= $cb
p2	= $80
contador
	.by 0,0
;una portada
;introduccion
;juego en si
;   ---- niveles
;		sta (niveles),y
;		1-9
;*********************************
dlsportada
:3	.by $70
	.by $46
	.wo showportada
:5	.by $70
	.by $06
:3	.by $70
	.by $06
:3	.by $70
:2	.by $06
	.by $41
	.wo dlsportada
showportada
	.sb "    juego nuevo     "
	.sb +64,"aprendiendo assemler"
	.sb "      NIVEL  "
muestronivel
	.sb "*      "
	.sb +128,"start para comenzar "
	.sb +128,"select para nivel   "
;*********************************
dlsnivel
:3	.by $70
	.by $42
	.wo datatexto
	.by $4a
	.wo datanivel00
:47	.by $0a
:3	.by $70
	.by $41
	.wo dlsnivel
datatexto
	.sb " puntaje 000000 nivel "
esnivel
	.sb "0 by dogdark 2020 "
;*********************************

;*********************************
pausita
	ldx #$10
	stx $021c
?pausita
	ldx $021c
	bne ?pausita
	rts
sueltastart
	lda consol
	cmp #6
	beq sueltastart
	rts
sueltaselect
	lda consol
	cmp #5
	beq sueltaselect
	rts
veonivel
	clc
	lda nivel
;	jmp *
	adc #$10
	sta muestronivel
	sta esnivel
	rts
cargonivel
	lda #$00
	sta contador
	sta contador+1

	lda #<datanivel00
	sta p1
	lda #>datanivel00
	sta p1+1
;
	lda nivel
	asl
	tax
	lda niveles,x
	sta p2
	lda niveles+1,x
	sta p2+1
cargonivel1
	ldy #0
	lda (p2),y
	sta (p1),y
	
	clc
	lda p1
	adc #1
	sta p1
	
	lda p1+1
	adc #0
	sta p1+1
	
	clc
	lda p2
	adc #1
	sta p2
	
	lda p2+1
	adc #0
	sta p2+1
	
	clc
	lda contador
	adc #1
	sta contador
	lda contador+1
	adc #0
	sta contador+1
	
	
	jsr pausita
	
	lda contador+1
	cmp #$03
	bne cargonivel1
	
	lda contador
	cmp #$c0
	bne cargonivel1
	rts
inicio
	ldx #<dlsportada
	ldy #>dlsportada
	stx $230
	sty $231	
;	lda #<dlsportada
;	sta $230
;	lda #>dlsportada
;	sta $231
inicio01
	jsr veonivel
inicio2
	lda consol
	cmp #6	;esstart
	beq comienzajuego
;	cmp #5	;es option
;	beq 
	cmp #5  ;es select
	beq subonivel
	jmp inicio2
	jmp *
subonivel
	ldx nivel
	inx
	stx nivel
	jsr sueltaselect
	cpx #10
	beq renuevonivel
	jmp inicio01
renuevonivel
	ldx #1
	stx nivel
	jmp inicio01
comienzajuego
	jsr sueltastart
	ldx #<dlsnivel
	stx $230
	ldy #>dlsnivel
	sty $231
	jsr veonivel
;	lda nivel
;	asl
;	tax
;	lda niveles,x
;	sta datanivel
;	lda niveles+1,x
;	sta datanivel+1
;	jmp *
	jsr cargonivel
	lda #$06
	sta 710
	sta 712
	jmp *
niveles
	.wo datanivel00,datanivel01,datanivel02
	icl 'data.asm'
	run inicio

datafile.asm

;portada general del archivo
datanivel00
:960	.by $00
;primer nivel del juego
datanivel01
	.BYTE $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
 .BYTE $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
 .BYTE $00,$00,$00,$00,$00,$55,$55,$55,$55,$55,$54,$00,$00,$00,$00,$00,$00,$00,$00,$00
 .BYTE $00,$00,$00,$00,$00,$55,$55,$55,$55,$55,$54,$00,$00,$00,$00,$00,$00,$00,$00,$00
 .BYTE $00,$00,$00,$00,$00,$55,$55,$55,$55,$55,$54,$00,$00,$00,$00,$00,$00,$00,$00,$00
 .BYTE $00,$00,$00,$00,$00,$55,$55,$55,$55,$55,$54,$00,$00,$00,$00,$00,$00,$00,$00,$00
 .BYTE $00,$00,$00,$00,$00,$55,$55,$55,$55,$55,$54,$00,$00,$00,$00,$00,$00,$00,$00,$00
 .BYTE $00,$00,$00,$00,$00,$55,$55,$55,$55,$55,$54,$00,$00,$00,$00,$00,$00,$00,$00,$00
 .BYTE $00,$00,$00,$00,$00,$55,$55,$55,$55,$55,$54,$00,$00,$00,$00,$00,$00,$00,$00,$00
 .BYTE $00,$00,$00,$00,$00,$55,$55,$55,$55,$55,$54,$00,$00,$00,$00,$00,$00,$00,$00,$00
 .BYTE $00,$00,$00,$00,$00,$00,$00,$00,$5,$55,$54,$00,$00,$00,$00,$00,$00,$00,$00,$00
 .BYTE $00,$00,$00,$00,$00,$00,$00,$00,$5,$55,$54,$00,$00,$00,$00,$00,$00,$00,$00,$00
 .BYTE $00,$00,$00,$00,$00,$00,$00,$00,$5,$55,$54,$00,$00,$00,$00,$00,$00,$00,$00,$00
 .BYTE $00,$00,$00,$00,$00,$00,$00,$00,$5,$55,$54,$00,$00,$00,$00,$00,$00,$00,$00,$00
 .BYTE $00,$00,$00,$00,$00,$00,$00,$00,$5,$55,$54,$00,$00,$00,$00,$00,$00,$00,$00,$00
 .BYTE $00,$00,$00,$00,$00,$00,$00,$00,$5,$55,$54,$00,$00,$00,$00,$00,$00,$00,$00,$00
 .BYTE $00,$00,$00,$00,$00,$00,$00,$00,$5,$55,$54,$00,$00,$00,$00,$00,$00,$00,$00,$00
 .BYTE $00,$00,$00,$00,$00,$00,$00,$00,$5,$55,$54,$00,$00,$00,$00,$00,$00,$00,$00,$00
 .BYTE $00,$00,$00,$00,$00,$00,$00,$00,$5,$55,$54,$00,$00,$00,$00,$00,$00,$00,$00,$00
 .BYTE $00,$00,$00,$00,$00,$00,$00,$00,$5,$55,$54,$00,$00,$00,$00,$00,$00,$00,$00,$00
 .BYTE $00,$00,$00,$00,$00,$00,$00,$00,$5,$55,$54,$00,$00,$00,$00,$00,$00,$00,$00,$00
 .BYTE $00,$00,$00,$00,$00,$00,$00,$00,$5,$55,$54,$00,$00,$00,$00,$00,$00,$00,$00,$00
 .BYTE $00,$00,$00,$00,$00,$00,$00,$00,$5,$55,$54,$00,$00,$00,$00,$00,$00,$00,$00,$00
 .BYTE $00,$00,$00,$00,$00,$00,$00,$00,$5,$55,$54,$00,$00,$00,$00,$00,$00,$00,$00,$00
 .BYTE $00,$00,$00,$00,$00,$00,$00,$00,$5,$55,$54,$00,$00,$00,$00,$00,$00,$00,$00,$00
 .BYTE $00,$00,$00,$00,$00,$00,$00,$00,$5,$55,$54,$00,$00,$00,$00,$00,$00,$00,$00,$00
 .BYTE $00,$00,$00,$00,$00,$00,$00,$00,$5,$55,$54,$00,$00,$00,$00,$00,$00,$00,$00,$00
 .BYTE $00,$00,$00,$00,$00,$00,$00,$00,$5,$55,$54,$00,$00,$00,$00,$00,$00,$00,$00,$00
 .BYTE $00,$00,$00,$00,$00,$00,$00,$00,$5,$55,$54,$00,$00,$00,$00,$00,$00,$00,$00,$00
 .BYTE $00,$00,$00,$00,$00,$00,$00,$00,$5,$55,$54,$00,$00,$00,$00,$00,$00,$00,$00,$00
 .BYTE $00,$00,$00,$00,$00,$00,$00,$00,$5,$55,$54,$00,$00,$00,$00,$00,$00,$00,$00,$00
 .BYTE $00,$00,$00,$00,$00,$00,$00,$00,$5,$55,$54,$00,$00,$00,$00,$00,$00,$00,$00,$00
 .BYTE $00,$00,$00,$00,$00,$00,$00,$00,$5,$55,$54,$00,$00,$00,$00,$00,$00,$00,$00,$00
 .BYTE $00,$00,$00,$00,$00,$00,$00,$00,$5,$55,$54,$00,$00,$00,$00,$00,$00,$00,$00,$00
 .BYTE $00,$00,$00,$00,$00,$00,$00,$00,$5,$55,$54,$00,$00,$00,$00,$00,$00,$00,$00,$00
 .BYTE $00,$00,$00,$00,$00,$00,$00,$00,$5,$55,$54,$00,$00,$00,$00,$00,$00,$00,$00,$00
 .BYTE $00,$00,$00,$00,$00,$00,$00,$00,$5,$55,$54,$00,$00,$00,$00,$00,$00,$00,$00,$00
 .BYTE $00,$00,$00,$00,$1,$55,$55,$55,$55,$55,$55,$55,$55,$55,$50,$00,$00,$00,$00,$00
 .BYTE $00,$00,$00,$00,$1,$55,$55,$55,$55,$55,$55,$55,$55,$55,$50,$00,$00,$00,$00,$00
 .BYTE $00,$00,$00,$00,$1,$55,$55,$55,$55,$55,$55,$55,$55,$55,$50,$00,$00,$00,$00,$00
 .BYTE $00,$00,$00,$00,$1,$55,$55,$55,$55,$55,$55,$55,$55,$55,$50,$00,$00,$00,$00,$00
 .BYTE $00,$00,$00,$00,$1,$55,$55,$55,$55,$55,$55,$55,$55,$55,$50,$00,$00,$00,$00,$00
 .BYTE $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
 .BYTE $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
 .BYTE $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
 .BYTE $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
 .BYTE $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
 .BYTE $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
datanivel02
	 .BYTE $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
 .BYTE $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
 .BYTE $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
 .BYTE $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
 .BYTE $00,$00,$00,$00,$00,$AA,$AA,$AA,$AA,$AA,$AA,$AA,$AA,$A0,$00,$00,$00,$00,$00,$00
 .BYTE $00,$00,$00,$00,$00,$AA,$AA,$AA,$AA,$AA,$AA,$AA,$AA,$A0,$00,$00,$00,$00,$00,$00
 .BYTE $00,$00,$00,$00,$00,$AA,$AA,$AA,$AA,$AA,$AA,$AA,$AA,$A0,$00,$00,$00,$00,$00,$00
 .BYTE $00,$00,$00,$00,$00,$AA,$AA,$AA,$AA,$AA,$AA,$AA,$AA,$A0,$00,$00,$00,$00,$00,$00
 .BYTE $00,$00,$00,$00,$00,$AA,$AA,$AA,$AA,$AA,$AA,$AA,$AA,$A0,$00,$00,$00,$00,$00,$00
 .BYTE $00,$00,$00,$00,$00,$AA,$AA,$AA,$AA,$AA,$AA,$AA,$AA,$A0,$00,$00,$00,$00,$00,$00
 .BYTE $00,$00,$00,$00,$00,$AA,$AA,$AA,$AA,$AA,$AA,$AA,$AA,$A0,$00,$00,$00,$00,$00,$00
 .BYTE $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$2A,$A0,$00,$00,$00,$00,$00,$00
 .BYTE $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$2A,$A0,$00,$00,$00,$00,$00,$00
 .BYTE $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$2A,$A0,$00,$00,$00,$00,$00,$00
 .BYTE $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$2A,$A0,$00,$00,$00,$00,$00,$00
 .BYTE $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$2A,$A0,$00,$00,$00,$00,$00,$00
 .BYTE $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$2A,$A0,$00,$00,$00,$00,$00,$00
 .BYTE $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$2A,$A0,$00,$00,$00,$00,$00,$00
 .BYTE $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$2A,$A0,$00,$00,$00,$00,$00,$00
 .BYTE $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$2A,$A0,$00,$00,$00,$00,$00,$00
 .BYTE $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$2A,$A0,$00,$00,$00,$00,$00,$00
 .BYTE $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$2A,$A0,$00,$00,$00,$00,$00,$00
 .BYTE $00,$00,$00,$00,$00,$00,$AA,$AA,$AA,$AA,$AA,$AA,$AA,$A0,$00,$00,$00,$00,$00,$00
 .BYTE $00,$00,$00,$00,$00,$00,$AA,$AA,$AA,$AA,$AA,$AA,$AA,$A0,$00,$00,$00,$00,$00,$00
 .BYTE $00,$00,$00,$00,$A,$AA,$AA,$AA,$AA,$AA,$AA,$AA,$AA,$80,$00,$00,$00,$00,$00,$00
 .BYTE $00,$00,$00,$00,$A,$AA,$AA,$AA,$AA,$AA,$AA,$AA,$AA,$80,$00,$00,$00,$00,$00,$00
 .BYTE $00,$00,$00,$00,$A,$AA,$AA,$AA,$AA,$AA,$AA,$AA,$AA,$80,$00,$00,$00,$00,$00,$00
 .BYTE $00,$00,$00,$00,$A,$AA,$AA,$AA,$AA,$AA,$AA,$AA,$AA,$80,$00,$00,$00,$00,$00,$00
 .BYTE $00,$00,$00,$00,$A,$AA,$A0,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
 .BYTE $00,$00,$00,$00,$A,$AA,$A0,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
 .BYTE $00,$00,$00,$00,$A,$AA,$A0,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
 .BYTE $00,$00,$00,$00,$A,$AA,$A0,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
 .BYTE $00,$00,$00,$00,$A,$AA,$A0,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
 .BYTE $00,$00,$00,$00,$A,$AA,$A0,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
 .BYTE $00,$00,$00,$00,$A,$AA,$A0,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
 .BYTE $00,$00,$00,$00,$A,$AA,$AA,$AA,$AA,$AA,$AA,$AA,$AA,$A0,$00,$00,$00,$00,$00,$00
 .BYTE $00,$00,$00,$00,$A,$AA,$AA,$AA,$AA,$AA,$AA,$AA,$AA,$A0,$00,$00,$00,$00,$00,$00
 .BYTE $00,$00,$00,$00,$A,$AA,$AA,$AA,$AA,$AA,$AA,$AA,$AA,$A0,$00,$00,$00,$00,$00,$00
 .BYTE $00,$00,$00,$00,$A,$AA,$AA,$AA,$AA,$AA,$AA,$AA,$AA,$A0,$00,$00,$00,$00,$00,$00
 .BYTE $00,$00,$00,$00,$A,$AA,$AA,$AA,$AA,$AA,$AA,$AA,$AA,$A0,$00,$00,$00,$00,$00,$00
 .BYTE $00,$00,$00,$00,$A,$AA,$AA,$AA,$AA,$AA,$AA,$AA,$AA,$A0,$00,$00,$00,$00,$00,$00
 .BYTE $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
 .BYTE $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
 .BYTE $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
 .BYTE $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
 .BYTE $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
 .BYTE $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
 .BYTE $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
	

VIDEO TUTORIAL

DONACIONES


Deja un comentario

Tu dirección de correo electrónico no será publicada. Los campos obligatorios están marcados con *