# HG changeset patch # User Paul Boddie # Date 1496005865 -7200 # Node ID d7298bd864252ecdae537bd434a983600e270dfc # Parent 647180a1278b44b2a5f0ce1cb000f49496db5521 Transition between the picture and the pattern. diff -r 647180a1278b -r d7298bd86425 vga.S --- a/vga.S Sun May 28 22:02:02 2017 +0200 +++ b/vga.S Sun May 28 23:11:05 2017 +0200 @@ -161,21 +161,46 @@ /* Main program. */ - li $a1, 5000000 /* counter = 5000000 */ + li $a1, (3 << 24) /* counter ~= 50000000 */ + li $a2, 0xffffff /* test counter at every 1/4 of range */ + move $t2, $zero /* picture to show */ /* Monitoring loop. */ loop: addiu $a1, $a1, -1 /* counter -= 1 */ - bnez $a1, loop /* until counter == 0 */ + and $t1, $a2, $a1 + bnez $t1, loop nop - li $a1, 5000000 /* counter = 5000000 */ - la $t0, PORTA li $t1, (1 << 3) /* PORTA<3> = RA3 */ sw $t1, INV($t0) + bnez $a1, loop /* until counter == 0 */ + nop + + bnez $t2, _picture1 + nop + + /* Show picture 0. */ + + la $a0, screendata + jal init_framebuffer + nop + li $t2, 1 + j _next + nop + +_picture1: + /* Show picture 1. */ + + jal init_framebuffer_with_pattern + nop + move $t2, $zero + _next: + li $a1, (3 << 24) /* counter ~= 50000000 */ + li $a2, 0xffffff /* test counter at every 1/4 of range */ j loop nop