Baixe o app para aproveitar ainda mais
Esta é uma pré-visualização de arquivo. Entre para ver o arquivo original
.data teclas: .ascii "1", "2", "3", "4" melodia: .byte args: .word 0,0 Art9: .byte 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0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1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0, 0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, color11: .word 0x000000 #0xfef1ba color12: .word 0xe6e6e6 #0xffefaa color13: .word 0xb3b3b3 #0xfceaa0 color21: .word 0xcc8800 #0xfaf1c8 color22: .word 0x663300 #marrom color23: .word 0xe6ffff #azul fumaça color24: .word 0xadad85 #cinza claro color25: .word 0xff1a1a #vermelho opening: .asciiz "Congratulations, you are the proud new owner of a small Coffe Shop!! \n Now go make some money... " msg: .asciiz "current money: " actionMsg: .asciiz "(press 0 to brew coffe) (+10$)\n" msg2: .asciiz "current profit per day: " msg3: .asciiz "Buy coffe maker? (+1$ per day) [press 1] Price: " msg4: .asciiz "Hire workers (+10$ per day) [press 2] Price: " msg5: .asciiz "Fancy Cappucino Machines (+5$ per day) [press 3] Price: " msg6: .asciiz "Luxury Cocoa Beverages Machines (+10$ per day) [press 4] Price: " msg7: .asciiz "Open more Cappa Caffés Around the world (+500$ per day) [press 5] Price: " msg8: .asciiz "Become the most famous Caffé in the world (WIN THE GAME) [press 6] Price: " msgr: .asciiz "Research the secrets of Coffe (unlock more upgrades) [press 7] Price: " msgr1: .asciiz "[[[ Learn the basics of coffe making: Expreso, Cappucino, Milk,... ]]]" msgr2: .asciiz "[[[ Learn how to make luxury cocoa drinks: Mocha, Ganache Chocolate Drink,... ]]]" msgr3: .asciiz "[[[ Learn how to open more coffe shops around the world ]]]" msgb: .asciiz "Invest in your business (Increase current daily profits) [press 8] Price: " msgb1: .asciiz "[[[ Buy Ads in local journal *2x DAILY PROFITS* ]]]" msgb2: .asciiz "[[[ Theme Investment: Maid Cafe *2x DAILY PROFITS + Current workers become twice as effective* ]]]" msgb3: .asciiz "[[[Import High Quality Coffe Beans *2x DAILY PROFITS + All coffe machines variations become double as effective* ]]]" msgb4: .asciiz "[[[Invest in Prime Time TV Ads *4x DAILY PROFITS* ]]]" currentAmount: .asciiz " - Current Amount: " newline: .asciiz "\n" newblock: .asciiz "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n" clear: .byte 0x1B,0x5B,0x33,0x3B,0x4A,0x1B,0x5B,0x48,0x1B,0x5B,0x32,0x4A cm: .word 20 cmN: .word 0 hw: .word 180 hwN: .word 0 fcm: .word 80 fcmN: .word 0 lcbm: .word 150 lcbmN: .word 0 rp: .word 1000 bp: .word 1000 rl: .word 1 bl: .word 1 ecs: .word 8000 ecsN: .word 0 WINTHEGAME: .word 100000 .text .globl main main: li $a0,0 li $a2,0 li $s1,0 li $s2,0 li $s2, 0 li $s3, 0 la $a0, newblock li $v0,4 syscall la $a0, opening # load str1 address into $a0 li $v0, 4 # load I/O code for string output syscall li $t5,10000 op_delay: subiu $t5,$t5,1 bnez $t5,op_delay main_loop: add $s2, $s2, $s3 screen: la $a2,128($gp) jal BitmapPixelArt # clear the screen #la $a0,clear la $a0, newblock li $v0, 4 syscall #Dispkay Current Money and Profits la $a0, msg # load str1 address into $a0 li $v0, 4 # load I/O code for string output syscall move $a0, $s2 li $v0, 1 syscall la $a0, newline # load str1 address into $a0 li $v0, 4 # load I/O code for string output syscall la $a0, msg2 # load str1 address into $a0 li $v0, 4 # load I/O code for string output syscall move $a0, $s3 li $v0, 1 syscall la $a0, newline # load str1 address into $a0 li $v0, 4 # load I/O code for string output syscall la $a0, actionMsg # load str1 address into $a0 li $v0, 4 # load I/O code for string output syscall #Dispkay Upgrades Store lw $t5, cm blt $s2, $t5, HireWorkers # if less or equals to 20 la $a0, msg3 li $v0, 4 syscall move $a0, $t5 li $v0, 1 syscall la $a0, currentAmount # load str1 address into $a0 li $v0, 4 # load I/O code for string output syscall lw $t5, cmN move $a0, $t5 li $v0, 1 syscall la $a0, newline # load str1 address into $a0 li $v0, 4 # load I/O code for string output syscall HireWorkers: lw $t5, hw blt $s2, $t5, FancyCoffe # if less or equals to 150 la $a0, msg4 li $v0, 4 syscall move $a0, $t5 li $v0, 1 syscall la $a0, currentAmount # load str1 address into $a0 li $v0, 4 # load I/O code for string output syscall lw $t5, hwN move $a0, $t5 li $v0, 1 syscall la $a0, newline # load str1 address into $a0 li $v0, 4 # load I/O code for string output syscall FancyCoffe: lw $t7, rl blt $t7, 2, afterFancyCoffe lw $t5, fcm blt $s2, $t5, afterFancyCoffe la $a0, msg5 li $v0, 4 syscall move $a0, $t5 li $v0, 1 syscall la $a0, currentAmount # load str1 address into $a0 li $v0, 4 # load I/O code for string output syscall lw $t5, fcmN move $a0, $t5 li $v0, 1 syscall la $a0, newline # load str1 address into $a0 li $v0, 4 # load I/O code for string output syscall afterFancyCoffe: lw $t7, rl blt $t7, 3, afterLuxuryCocoa lw $t5, lcbm blt $s2, $t5, afterLuxuryCocoa la $a0, msg6 li $v0, 4 syscall move $a0, $t5 li $v0, 1 syscall la $a0, currentAmount # load str1 address into $a0 li $v0, 4 # load I/O code for string output syscall lw $t5, lcbmN move $a0, $t5 li $v0, 1 syscall la $a0, newline # load str1 address into $a0 li $v0, 4 # load I/O code for string output syscall afterLuxuryCocoa: lw $t7, rl blt $t7, 4, afterExtraStores lw $t5, ecs blt $s2, $t5, afterExtraStores la $a0, msg7 li $v0, 4 syscall move $a0, $t5 li $v0, 1 syscall la $a0, currentAmount # load str1 address into $a0 li $v0, 4 # load I/O code for string output syscall lw $t5, ecsN move $a0, $t5 li $v0, 1 syscall la $a0, newline # load str1 address into $a0 li $v0, 4 # load I/O code for string output syscall afterExtraStores: lw $t7, rl blt $t7, 4, endUpgrades lw $t7, bl blt $t7, 5, endUpgrades lw $t5, WINTHEGAME blt $s2, $t5, endUpgrades la $a0, msg8 li $v0, 4 syscall move $a0, $t5 li $v0, 1 syscall endUpgrades: la $a0, newline # load str1 address into $a0 li $v0, 4 # load I/O code for string output syscall startResearch: lw $t5, rp blt $s2, $t5, endResearch # if less or equals to price of research lw $t7, rl # switch-case for research level rl bne $t7, 1, C2 la $a0, msgr1 li $v0, 4 syscall la $a0, newline # load str1 address into $a0 li $v0, 4 # load I/O code for string output syscall j researchMessage C2: bne $t7, 2, C3 la $a0, msgr2 li $v0, 4 syscall la $a0, newline # load str1 address into $a0 li $v0, 4 # load I/O code for string output syscall j researchMessage C3: bne $t7, 3, researchMessage la $a0, msgr3 li $v0, 4 syscall la $a0, newline # load str1 address into $a0 li $v0, 4 # load I/O code for string output syscall researchMessage: lw $t7, rl bgt $t7, 3, endResearch # if above current maximum research level la $a0, msgr li $v0, 4 syscall move $a0, $t5 li $v0, 1 syscall la $a0, currentAmount # load str1 address into $a0 li $v0, 4 # load I/O code for string output syscall lw $t5, rl move $a0, $t5 li $v0, 1 syscall la $a0, newline # load str1 address into $a0 li $v0, 4 # load I/O code for string output syscall endResearch: lw $t5, bp blt $s2, $t5, endInvestment # if less or equals to price of investment lw $t7, bl bne $t7, 1, C2B la $a0, msgb1 li $v0, 4 syscall la $a0, newline # load str1 address into $a0 li $v0, 4 # load I/O code for string output syscall j investmentMessage C2B: bne $t7, 2, C3B la $a0, msgb2 li $v0, 4 syscall la $a0, newline # load str1 address into $a0 li $v0, 4 # load I/O code for string output syscall j investmentMessage C3B: bne $t7, 3, C4B la $a0, msgb3 li $v0, 4 syscall la $a0, newline # load str1 address into $a0 li $v0, 4 # load I/O code for string output syscall j investmentMessage C4B: bne $t7, 4, investmentMessage la $a0, msgb4 li $v0, 4 syscall la $a0, newline # load str1 address into $a0 li $v0, 4 # load I/O code for string output syscall investmentMessage: lw $t7, bl bgt $t7, 4, endInvestment# if above current maximum investment level la $a0, msgb li $v0, 4 syscall move $a0, $t5 li $v0, 1 syscall la $a0, currentAmount # load str1 address into $a0 li $v0, 4 # load I/O code for string output syscall lw $t5, bl move $a0, $t5 li $v0, 1 syscall la $a0, newline # load str1 address into $a0 li $v0, 4 # load I/O code for string output syscall endInvestment: checkIfAction: lw $t5, 0xFFFF0004 # check to see which key has been pressed bnez $t5, finishedCoffe # check to see if key is 0 # wait a bit wait: li $t6,20000 main_delay: lw $t5, 0xFFFF0004 # check to see which key has been pressed beq $t5, 0x00000030, brewCoffe # 0 pressed beq $t5, 0x00000031, buyCoffeMaker # 1 pressed beq $t5, 0x00000032, hireWorker # 2 pressed beq $t5, 0x00000033, buyFancyMachines # 3 pressed beq $t5, 0x00000034, buyLuxuryCocoa # 4 pressed beq $t5, 0x00000035, buyCappaCafe # 5 pressed beq $t5, 0x00000036, WINGAME # 6 pressed beq $t5, 0x00000037, researchUpgrade beq $t5, 0x00000038, businessInvestment afterAction: subiu $t6,$t6,1 bgtz $t6,main_delay j main_loop brewCoffe: addi $s2, $s2, 1 j screen finishedCoffe: move $t5, $zero sb $t5, 0xFFFF0004 j afterAction buyCoffeMaker: jal musica lw $t5, cm lw $t7, cmN blt $s2, $t5, finishedCoffe # if less or equals to 200 sub $s2, $s2, $t5 mul $t5, $t5, 2 addi $t7, $t7, 1 addi $s3, $s3, 1 sw $t7, cmN sw $t5, cm j screen buyFancyMachines: jal musica lw $t5, fcm lw $t7, fcmN blt $s2, $t5, finishedCoffe # if less or equals to 200 lw $t0, rl blt $t0, 2, NOTYET sub $s2, $s2, $t5 mul $t5, $t5, 2 addi $t7, $t7, 1 addi $s3, $s3, 5 sw $t7, fcmN sw $t5, fcm j screen buyLuxuryCocoa: jal musica lw $t5, lcbm lw $t7, lcbmN blt $s2, $t5, finishedCoffe # if less or equals to 200 lw $t0, rl blt $t0, 3, NOTYET sub $s2, $s2, $t5 mul $t5, $t5, 2 addi $t7, $t7, 1 addi $s3, $s3, 10 sw $t7, lcbmN sw $t5, lcbm j screen buyCappaCafe: jal musica lw $t5, ecs lw $t7, ecsN blt $s2, $t5, finishedCoffe # if less or equals to 200 lw $t0, rl blt $t0, 4, NOTYET sub $s2, $s2, $t5 mul $t5, $t5, 2 addi $t7, $t7, 1 addi $s3, $s3, 500 sw $t7, ecsN sw $t5, ecs j screen hireWorker: jal musica lw $t5, hw lw $t7, hwN blt $s2, $t5, finishedCoffe # if less or equals to 200 sub $s2, $s2, $t5 mul $t5, $t5, 2 addi $s3, $s3, 10 addi $t7, $t7, 1 sw $t7, hwN sw $t5, hw j screen researchUpgrade: jal musica lw $t5, rp lw $t7, rl blt $s2, $t5, finishedCoffe #if less or equal to price of research sub $s2, $s2, $t5 mul $t5, $t5, 5 addi $t7, $t7, 1 sw $t7, rl sw $t5, rp j screen businessInvestment: jal musica lw $t5, bp lw $t7, bl blt $s2, $t5, finishedCoffe # if less or equals to price of investment sub $s2, $s2, $t5 mul $s3, $s3, 2 mul $t5, $t5, 5 sw $t5, bp bne $t7, 2, bLevel3 lw $t7, hwN mul $t7, $t7, 10 add $s3, $s3, $t7 bLevel3: bne $t7, 3, bLevel4 lw $t7, cmN add $s3, $s3, $t7 lw $t7, fcmN mul $t7, $t7, 5 add $s3, $s3, $t7 lw $t7, lcbmN mul $t7, $t7, 10 add $s3, $s3, $t7 bLevel4: bne $t7, 4, bicontinue mul $s3, $s3, 2 bicontinue: lw $t5, bl addi $t5, $t5, 1 sw $t5, bl j screen ################################################################# # BitmapPixelArt # ################################################################# BitmapPixelArt : bgt $s3, 1, smallCoffeShop la $t0,Art9 j readyCoffeShop smallCoffeShop: bgt $s3, 100, mediumCoffeShop la $a2,0($gp) la $t0,Art2 j readyCoffeShop mediumCoffeShop: bgt $s3, 1000, bigCoffeShop la $t0,Art0 j readyCoffeShop bigCoffeShop: la $a2,256($gp) la $t0,Art1 readyCoffeShop: li $t1,-1 li $t3,0 la $t4,($ra) printPixelArt: lb $a0,0($t0) jal colorSwitch move $a1,$v0 addi $t0,$t0,1 addi $t1,$t1,1 addi $t3,$t3,1 bne $t1,32,tagPixelArt add $a2,$a2,512 li $t1,0 tagPixelArt: mul $t2,$t1,4 add $t2,$a2,$t2 sw $a1,0($t2) bne $t3,1024,printPixelArt la $ra,($t4) jr $ra ################################################################# # colorSwitch # # $a0 -> nĂşmero da cor # # retorna $v0 -> cĂłdigo da cor # ################################################################# colorSwitch: TestaCor0: bne $a0,0,TestaCor1 #color number lw $v0,color11 #colorcode j Fim TestaCor1: bne $a0,1,TestaCor2 lw $v0,color12 j Fim TestaCor2: bne $a0,2,TestaCor3 lw $v0,color13 j Fim TestaCor3: bne $a0,3,TestaCor4 lw $v0,color21 j Fim TestaCor4: bne $a0,4,TestaCor5 lw $v0,color22 j Fim TestaCor5: bne $a0,5,TestaCor6 lw $v0,color23 j Fim TestaCor6: bne $a0,7,TestaCor7 lw $v0,color25 j Fim TestaCor7: bne $a0,6,Fim lw $v0,color24 j Fim Fim: jr $ra # retorna $v0 musica: li $t6,0 # progresso inicial da melodia li $t7,1 # final do progresso da melodia la $t3,teclas # carrega a label 'teclas' no registrador lbu $s3,($t3) # carrega a posicao da tecla verde no registrador lbu $s5,1($t3) # carrega a posicao da tecla vermelha no registrador lbu $s7,2($t3) # carrega a posicao da tecla azul no registrador lbu $s0,3($t3) # carrega a posicao da tecla amarela no registrador la $s3,melodia # carrega a label melodia no registrador # o registrador que receber a label melodia ($s1) tera um espaco de # bytes disponivel para ir empilhando notas novas aleotorias la $t1, melodia li $v0,42 # $v0 recebe o codigo de syscall de sorteio de numeros naturais li $a1,22 # $a1 especifica que o sorteio eh para numeros menores que 4 (0 <= numero < 4) syscall # gera uma nota aleatoria em $a0 # $t3 recebe o valor da nota aleatoria gerada addu $t3,$t3,$a0 # adiciona em $t3 o valor da nota que esta em $a0 # $t3 esta acumulando o endereco base de teclas # e com a soma de $a0 sorteado ele vai para uma das 4 teclas do jogo # lbu pega o endereďż˝o (de um tamanho de 1 byte) que representa a nota sorteada # lbu tambem extende esse valor para 32 bits para ter certeza de que ele sera positivo lbu $t3,($t3) # extende $t3 para 32 bits # sb pega o byte menos significativo e $t3 e o armazena em $s1, # de forma que $s1 contera a ultima nota aleatoria sb $t3,($s3) ### o valor de $s1 eh utilizado depois em 3.2 addu $t3,$s3,$t6 # soma-se ao endereco base das teclas o progresso para se chegar ao tom atual lbu $t3,($t3) # carregar nota em $t3 extendendo-a para 32 bits sem sinal li $v0,33 # codigo para a chamada ao syscall li $a2,2 # escolha do instrumento85 li $a3,127 # volume da melodia # se a nota carregada aleatoriamente for igual a uma tecla da label 'teclas' li $a0,44 # nota li $a1,500 # duracao syscall # som melodia addi $t6,$t6,1 # registrador contador de desenhos de quadrados da melodia ja feitos ++ li $t6,0 # contador em 0 sw $zero,($s4) # se uma tecla ĂŠ pressionada enquanto a melodia tocava, anula-se seu valor jr $ra WINGAME: lw $t0, bl blt $t0, 5, NOTYET lw $t0, rl blt $t0, 4, NOTYET li $v0,10 syscall NOTYET: j finishedCoffe
Compartilhar