Advertisement
Guest User

Untitled

a guest
May 22nd, 2019
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.91 KB | None | 0 0
  1. /*  PRINT AT - Write a char buffer to the screen at a given starting position.
  2.    
  3.     Args:
  4.      * Char - Char pointer to the buffer to output
  5.  
  6.     Returns:
  7.      void -
  8. */
  9. int print_at(char* cb_p int index) {
  10.     char* start_p = cb_p;
  11.     while (*cb_p) {
  12.         print_c_at(*cb_p index + (cb_p - start_p));
  13.         cb_p = cb_p + 1;
  14.     }
  15. }
  16.  
  17. /*  PRINT SPRITE - Write a char buffer to the screen at a given starting position.
  18.                    New line breaks the printing and jumps to the same cursor index
  19.                    on the line below.
  20.    
  21.     Args:
  22.      * Char - Char pointer to the buffer to output
  23.  
  24.     Returns:
  25.      void -
  26. */
  27. int print_sprite(char* cb_p int index) {
  28.     char* start_p = cb_p;
  29.     while (*cb_p) {
  30.         if (*cb_p == '\n') {
  31.             index = index + VIDEO_TILE_WIDTH;
  32.         }
  33.         print_c_at(*cb_p index + (cb_p - start_p));
  34.         cb_p = cb_p + 1;
  35.     }
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement