Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- *-----------------------------------------------------------
- * Title : VISUALIZADOR GRÁFICO EN 68k PARA BUBBLE SHOOTER
- * Written by : FULGENCIO
- * Date : 2019
- * Description:
- *-----------------------------------------------------------
- BLACK EQU $00000000
- RED EQU $000000FF
- GREEN EQU $0000FF00
- YELLOW EQU $0000FFFF
- BLUE EQU $00FF0000
- WHITE EQU $00FFFFFF
- CYAN EQU $00FFFF00
- MAGENTA EQU $00FF00FF
- SIZE EQU 30
- ORIX EQU 20
- ORIY EQU 20
- ORG $1000
- START * Programa Principal
- JSR SHOWMAP * Muestra Mapa
- SIMHALT ; halt simulator
- *************************************************************************
- SHOWMAP ******************************** Subrutina que muestra el estado del mapa en las coordenadas ORIX, ORIY ************************************
- MOVE.L #ORIX,D1
- MOVE.L #ORIY,D2 *Coordenadas iniciales del tablero
- MOVE.L #MAPA+13,A3 *Posición de la primera casilla real
- LOOPMAP
- MOVE.B (A3)+,D0 *Obtiene el contenido
- CMP.B #$80,D0
- BEQ NEXTROW
- *CMP.B #$00,D0
- *BEQ EMPTY *Está vacía
- FILLED *Dibuja burbuja
- JSR BUBBLE
- ADD.L #SIZE,D1
- JMP LOOPMAP
- EMPTY
- ADD.L #SIZE,D1
- JMP LOOPMAP
- NEXTROW
- MOVE.L #ORIX,D1 *Retorno coordenada X inicial
- ADD.L #SIZE,D2 *Avance coordenada Y
- CMP.B #$40,(A3)+ *Comprueba línea par/impar
- BNE NODESP
- ADD.L #SIZE/2,D1 *Si tiene un $40, la fila se desplaza medio hueco a derecha
- NODESP
- CMP.B #$80,(A3)
- BNE LOOPMAP
- RTS
- **************************************************************************
- BUBBLE
- MOVEM.L D0-D4,-(A7)
- JSR FILLCOLOR *Elijo un color de relleno
- MOVE.L #88,D0 *Circulo CON relleno
- MOVE.L D1,D3
- MOVE.L D2,D4 *Copio coordenadas esquina izquierda en D3,D4
- ADD.L #SIZE,D3
- ADD.L #SIZE,D4 *Creo coordenadas esquina derecha separándolas SIZE pixels
- TRAP #15
- MOVEM.L (A7)+,D0-D4
- RTS
- FILLCOLOR
- MOVEM.L D0-D1/A1,-(A7)
- MOVE.L #TABLACOLOR,A1
- MULU #4,D0 *La tabla es de LONG
- MOVE.L (A1,D0),D1 *D1 tiene color de la bola
- MOVE.L #81,D0 *Color relleno
- TRAP #15
- MOVE.L #80,D0 *Color linea
- TRAP #15
- MOVEM.L (A7)+,D0-D1/A1
- RTS
- * Put variables and constants here
- ORG $4000
- *El borde izquierdo está marcado con $80 o $40, para indicar fila par o impar
- MAPA
- DC.B $80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80
- DC.B $80,$02,$03,$06,$04,$05,$03,$01,$05,$01,$05,$80
- DC.B $40,$03,$03,$05,$02,$01,$05,$04,$04,$03,$03,$80
- DC.B $80,$01,$03,$01,$06,$04,$04,$01,$04,$01,$02,$80
- DC.B $40,$02,$04,$05,$02,$06,$01,$04,$05,$04,$01,$80
- DC.B $80,$00,$06,$06,$02,$01,$06,$05,$06,$05,$01,$80
- DC.B $40,$02,$04,$02,$02,$02,$01,$04,$03,$03,$06,$80
- DC.B $80,$00,$00,$04,$06,$06,$04,$05,$03,$02,$04,$80
- DC.B $40,$05,$05,$06,$00,$04,$05,$03,$02,$06,$02,$80
- DC.B $80,$00,$02,$05,$00,$02,$02,$03,$05,$05,$04,$80
- DC.B $40,$00,$02,$04,$05,$00,$06,$05,$02,$00,$06,$80
- DC.B $80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80
- TABLACOLOR
- DC.L BLACK
- DC.L RED
- DC.L GREEN
- DC.L BLUE
- DC.L MAGENTA
- DC.L YELLOW
- DC.L CYAN
- END START
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement