talk

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

29 (729B)


      1 
      2 
      3 			Top level overview
      4 			---------------
      5 
      6 			printscreen
      7 
      8 			Equivilent C function:	void printscreen(char *map);
      9 
     10 			Use:					Draws the entire map around the player
     11 
     12 			How: 				For loop + maths
     13 
     14 			Code:
     15 
     16 
     17 			printscreen:
     18 				save
     19 
     20 				/* map arg in rsi */
     21 
     22 				mov %r8, %r10			/* decide where to draw the screen (centers the player) */
     23 				mov %r9, %r11
     24 				sub $10, %r10
     25 				sub $10, %r11
     26 				mov %rsi, %r12
     27 				mov $1000, %rax
     28 				mul %r11
     29 				lea (%rax,%r12), %r12
     30 
     31 				mov $0, %r13			/* draw the camera's view */
     32 				mov $21, %r14
     33 				mov $0, %r15
     34 			.putlines:
     35 				lea (%r15,%r12), %rdi
     36 				mov %r10, %rsi
     37 				call putline
     38 				add $1000, %r15
     39 				add $1, %r13
     40 				cmp %r13, %r14
     41 				jne .putlines
     42 
     43 				restore
     44 				ret
     45 
     46