about summary refs log tree commit diff stats
path: root/504test-screen.mu
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2021-11-09 06:35:53 -0800
committerKartik Agaram <vc@akkartik.com>2021-11-09 06:35:53 -0800
commit8eae94e8609cab18342bbf44f6cd0f2b03dc9e1b (patch)
tree10936c5e8d4ce6211198a139e2bb5d37e7cacb63 /504test-screen.mu
parent2bac01fb7b4e43a2f7e707b7848d1b925d598cda (diff)
downloadmu-8eae94e8609cab18342bbf44f6cd0f2b03dc9e1b.tar.gz
clean up VSCode extension
Diffstat (limited to '504test-screen.mu')
0 files changed, 0 insertions, 0 deletions
>^
7bf8adb8 ^
0daf12c5 ^

74f1512f ^
0daf12c5 ^
0daf12c5 ^

74f1512f ^
0daf12c5 ^
1e02d840 ^

0f5b9a15 ^
0daf12c5 ^






1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28


                                                               
                                                   
         
                             
     
                                                           
 
                                                                                  

                          
                                      
               

                            
                                        
                 

                                  
                              






                    
# Test out the video mode by filling in the screen with pixels.
#
# To build a disk image:
#   ./translate ex2.mu             # emits code.img
# To run:
#   qemu-system-i386 code.img
# Or:
#   bochs -f bochsrc               # bochsrc loads code.img

fn main screen: (addr screen), keyboard: (addr keyboard), data-disk: (addr disk) {
  var y/eax: int <- copy 0
  {
    compare y, 0x300/screen-height=768
    break-if->=
    var x/edx: int <- copy 0
    {
      compare x, 0x400/screen-width=1024
      break-if->=
      var color/ecx: int <- copy x
      color <- and 0xff
      pixel screen x, y, color
      x <- increment
      loop
    }
    y <- increment
    loop
  }
}