EmuProxyZA / osd write.c

From TivoZA

Back to emuProxyZA.
Download source (You will need to rename it to: osd_write.c)

To update the below source file, select Upload file and upload your new osd_write.c file (there is no need to upload it as a .txt). If you do upload a new version, please add a brief description to the change log at the bottom of this page indicating what changes you made and why.

Source

  1. #include <stdio.h>
  2. #include <sys/types.h>
  3. #include <fcntl.h>
  4.  
  5. void osd_out(const char* str) {
  6. int fd = open("/tmp/osdconsole", O_WRONLY);
  7. write(fd, str, strlen(str));
  8. close(fd);
  9. }
  10.  
  11. void osd_write(const char* str) {
  12. char outStr[1024];
  13. sprintf(outStr, "\033\133H%s\033\133J", str);
  14. osd_out(outStr);
  15. }
  16.  
  17. void osd_init() {
  18. //Set context init string
  19. char init[500] = "\033\133+p"; // Reset to initial state
  20. strcat(init, "\033\1331;5;05;0y"); // Change Black
  21. strcat(init, "\033\1331;5;11;1y"); // Change Red
  22. strcat(init, "\033\1331;5;10;2y"); // Change Green
  23. strcat(init, "\033\1331;5;12;3y"); // Change Yellow
  24. strcat(init, "\033\1331;5;15;4y"); // Change Blue
  25. strcat(init, "\033\1331;5;01;5y"); // Change Magenta
  26. strcat(init, "\033\1331;5;10;6y"); // Change Cyan
  27. strcat(init, "\033\1331;5;04;7y"); // Change White
  28. strcat(init, "\033\1331;5;00;8y"); // Change Transparent
  29. strcat(init, "\033\1331;5;14;9y"); // Change Charcoal Transparent
  30. strcat(init, "\033\1331;2;7;46y"); // Change offsets
  31. strcat(init, "\033\1331;4;2y"); // Change number of usable rows
  32. strcat(init, "\033\1331;1y"); // Clear Page Buffer
  33. strcat(init, "\033\13337;48m"); // Default colors
  34.  
  35. osd_out(init);
  36. }
  37.  
  38. void osd_clear() {
  39. char *clear = "\033\133H\033\133J";
  40.  
  41. osd_out(clear);
  42. }

Change Log

20 Oct 2006 - TivoZA: Uploaded the file

Advertisement