text.c 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. #include <stdlib.h>
  2. #include <sys/text.h>
  3. #include "wonx.h"
  4. #include "WonxDisplay.h"
  5. void text_screen_init(void)
  6. {
  7. if (wonx_display == NULL) Wonx_Create();
  8. }
  9. void text_window_init(int x, int y, int w, int h, unsigned font_base)
  10. {
  11. if (wonx_display == NULL) Wonx_Create();
  12. }
  13. void text_set_mode(int mode)
  14. {
  15. if (wonx_display == NULL) Wonx_Create();
  16. }
  17. int text_get_mode(void)
  18. {
  19. if (wonx_display == NULL) Wonx_Create();
  20. return (0);
  21. }
  22. void text_put_char(int x, int y, unsigned int c)
  23. {
  24. if (wonx_display == NULL) Wonx_Create();
  25. printf("%c", (unsigned char)c);
  26. }
  27. int text_put_string(int x, int y, char * s)
  28. {
  29. if (wonx_display == NULL) Wonx_Create();
  30. printf("%s\n", s);
  31. return (0);
  32. }
  33. int text_put_substring(int x, int y, char * s, int len)
  34. {
  35. int i;
  36. if (wonx_display == NULL) Wonx_Create();
  37. for (i = 0; i < len; i++)
  38. printf("%c", s[i]);
  39. printf("\n");
  40. return (0);
  41. }
  42. void text_put_numeric(int x, int y, int len, int format, int number)
  43. {
  44. if (wonx_display == NULL) Wonx_Create();
  45. printf("%d\n", number);
  46. }
  47. void text_store_numeric(char * buffer, int len, int format, int number)
  48. {
  49. if (wonx_display == NULL) Wonx_Create();
  50. sprintf(buffer, "%d", number);
  51. }
  52. void text_fill_char(int x, int y, int len, int code)
  53. {
  54. if (wonx_display == NULL) Wonx_Create();
  55. printf("%c\n", (unsigned char)code);
  56. }
  57. void text_set_palette(int palette_num)
  58. {
  59. if (wonx_display == NULL) Wonx_Create();
  60. }
  61. int text_get_palette(void)
  62. {
  63. if (wonx_display == NULL) Wonx_Create();
  64. return (0);
  65. }
  66. void text_set_ank_font(int font_base_num, int is_color, int font_count,
  67. void * font)
  68. {
  69. if (wonx_display == NULL) Wonx_Create();
  70. }
  71. void text_set_sjis_font(void * font_address)
  72. {
  73. if (wonx_display == NULL) Wonx_Create();
  74. }
  75. void text_get_fontdata(int char_code, void * fontdata_buffer)
  76. {
  77. if (wonx_display == NULL) Wonx_Create();
  78. }
  79. void text_set_screen(int screen)
  80. {
  81. if (wonx_display == NULL) Wonx_Create();
  82. }
  83. int text_get_screen(void)
  84. {
  85. if (wonx_display == NULL) Wonx_Create();
  86. return (0);
  87. }
  88. void cursor_display(int cursor_enable)
  89. {
  90. if (wonx_display == NULL) Wonx_Create();
  91. }
  92. int cursor_status(void)
  93. {
  94. if (wonx_display == NULL) Wonx_Create();
  95. return (0);
  96. }
  97. void cursor_set_location(int x, int y, int w, int h)
  98. {
  99. if (wonx_display == NULL) Wonx_Create();
  100. }
  101. unsigned long cursor_get_location(void)
  102. {
  103. if (wonx_display == NULL) Wonx_Create();
  104. return (0);
  105. }
  106. void cursor_set_type(int palette_num, int blink_interval)
  107. {
  108. if (wonx_display == NULL) Wonx_Create();
  109. }
  110. unsigned long cursor_get_type(void)
  111. {
  112. if (wonx_display == NULL) Wonx_Create();
  113. return (0);
  114. }
  115. int text_printf(int x, int y, const char *format, ...)
  116. {
  117. if (wonx_display == NULL) Wonx_Create();
  118. return (0);
  119. }