disp.c 32 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277
  1. /*****************************************************************************/
  2. /* ここから */
  3. /*****************************************************************************/
  4. #include <stdio.h>
  5. #include <stdlib.h>
  6. #include "sys/disp.h"
  7. #include "Wonx.h"
  8. /*****************************************************************************/
  9. /* 互換関数の定義 */
  10. /*****************************************************************************/
  11. /*
  12. * Xサーバとの同期の整合性がとれなくなるなどの問題が考えられるので,
  13. * 互換関数の内部は UNIXTimer_Pause(), UNIXTimer_Unpause() でくくり,
  14. * タイマ割り込みを一時停止して処理を行う.また,unpause するまえに,
  15. * かならず sync するようにする.
  16. */
  17. /*
  18. * タイマの一時停止の2重解除の問題が出てくるので,
  19. * 互換関数から互換関数を呼んではいけない.
  20. * (一時停止はネストされるが,いちおう)
  21. * 似たような処理をする関数の場合は,必ず static な別関数に処理をまとめ,
  22. * そっちを呼び出すようにすること.
  23. * 引数の表示の問題もあるしね.
  24. */
  25. void display_control(unsigned int flags)
  26. {
  27. WWDisplay ww_display;
  28. if (!Wonx_IsCreated()) Wonx_Create();
  29. /* タイマを一時停止する */
  30. UNIXTimer_Pause(WonxSystem_GetUNIXTimer(Wonx_GetWonxSystem()));
  31. printf("call : display_control() : flags = 0x%04x\n", (int)flags);
  32. fflush(stdout);
  33. ww_display = WonxDisplay_GetWWDisplay(Wonx_GetWonxDisplay());
  34. WWScreen_SetEnable(WWDisplay_GetScreen(ww_display, SCREEN1),
  35. (flags & DCM_SCR1) ? 1 : 0);
  36. WWScreen_SetEnable(WWDisplay_GetScreen(ww_display, SCREEN2),
  37. (flags & DCM_SCR2) ? 1 : 0);
  38. WWDisplay_SetSpriteEnable(ww_display, (flags & DCM_SPR) ? 1 : 0);
  39. WWDisplay_SetSpriteWindowEnable(ww_display, (flags & DCM_SPR_WIN) ? 1 : 0);
  40. if ((flags & 0x0030) == DCM_SCR2_WIN_INSIDE)
  41. WWScreen_SetMode(WWDisplay_GetScreen(ww_display, SCREEN2),
  42. WWSCREEN_INSIDE_ONLY);
  43. else if ((flags & 0x0030) == DCM_SCR2_WIN_OUTSIDE)
  44. WWScreen_SetMode(WWDisplay_GetScreen(ww_display, SCREEN2),
  45. WWSCREEN_OUTSIDE_ONLY);
  46. WWDisplay_SetBorder(ww_display, (flags & DCM_BORDER_COLOR) >> 7);
  47. WonxDisplay_Flush(Wonx_GetWonxDisplay());
  48. printf("call : display_control() : return value = none\n"); fflush(stdout);
  49. /* タイマをもとに戻す */
  50. UNIXTimer_Unpause(WonxSystem_GetUNIXTimer(Wonx_GetWonxSystem()));
  51. return;
  52. }
  53. unsigned int display_status()
  54. {
  55. WWDisplay ww_display;
  56. unsigned short int ret;
  57. if (!Wonx_IsCreated()) Wonx_Create();
  58. /* タイマを一時停止する */
  59. UNIXTimer_Pause(WonxSystem_GetUNIXTimer(Wonx_GetWonxSystem()));
  60. printf("call : display_status() : \n"); fflush(stdout);
  61. ww_display = WonxDisplay_GetWWDisplay(Wonx_GetWonxDisplay());
  62. ret = 0;
  63. if (WWScreen_GetEnable(WWDisplay_GetScreen(ww_display, SCREEN1)))
  64. ret |= DCM_SCR1;
  65. if (WWScreen_GetEnable(WWDisplay_GetScreen(ww_display, SCREEN2)))
  66. ret |= DCM_SCR2;
  67. if (WWDisplay_GetSpriteEnable(ww_display))
  68. ret |= DCM_SPR;
  69. if (WWDisplay_GetSpriteWindowEnable(ww_display))
  70. ret |= DCM_SPR_WIN;
  71. switch (WWScreen_GetMode(WWDisplay_GetScreen(ww_display, SCREEN2))) {
  72. case WWSCREEN_INSIDE_ONLY:
  73. ret |= DCM_SCR2_WIN_INSIDE;
  74. break;
  75. case WWSCREEN_OUTSIDE_ONLY:
  76. ret |= DCM_SCR2_WIN_OUTSIDE;
  77. break;
  78. default:
  79. }
  80. ret |= WWDisplay_GetBorder(ww_display) << 7;
  81. WonxDisplay_Sync(Wonx_GetWonxDisplay());
  82. printf("call : display_status() : return value = %u\n", (int)ret);
  83. fflush(stdout);
  84. /* タイマをもとに戻す */
  85. UNIXTimer_Unpause(WonxSystem_GetUNIXTimer(Wonx_GetWonxSystem()));
  86. return (ret);
  87. }
  88. void font_set_monodata(unsigned int number, unsigned int count, void * data)
  89. {
  90. WWCharacter c;
  91. int i, x, y, n, p;
  92. int f, b;
  93. unsigned char * d;
  94. WWDisplay ww_display;
  95. if (!Wonx_IsCreated()) Wonx_Create();
  96. /* タイマを一時停止する */
  97. UNIXTimer_Pause(WonxSystem_GetUNIXTimer(Wonx_GetWonxSystem()));
  98. printf("call : font_set_monodata() : number = %u, count = %u, data = %p\n",
  99. (int)number, (int)count, data); fflush(stdout);
  100. ww_display = WonxDisplay_GetWWDisplay(Wonx_GetWonxDisplay());
  101. n = 0;
  102. d = (unsigned char *)data; /* ひとつのキャラクタデータは8バイト */
  103. f = WWDisplay_GetForegroundColor(ww_display);
  104. b = WWDisplay_GetBackgroundColor(ww_display);
  105. for (i = 0; i < count; i++) {
  106. c = WWDisplay_GetCharacter(ww_display, number + i);
  107. for (y = 0; y < 8; y++) {
  108. for (x = 0; x < 8; x++) {
  109. p = (d[n] & (1 << (7 - x))) ? f : b; /*これでよいのか?*/
  110. WWCharacter_SetPixel(c, x, y, p);
  111. }
  112. n++;
  113. }
  114. }
  115. WonxDisplay_Flush(Wonx_GetWonxDisplay());
  116. printf("call : font_set_monodata() : return value = none\n");
  117. fflush(stdout);
  118. /* タイマをもとに戻す */
  119. UNIXTimer_Unpause(WonxSystem_GetUNIXTimer(Wonx_GetWonxSystem()));
  120. return;
  121. }
  122. void font_set_colordata(unsigned int number,
  123. unsigned int count, void * data)
  124. {
  125. WWCharacter c;
  126. int i, x, y, n, p;
  127. unsigned char * d;
  128. if (!Wonx_IsCreated()) Wonx_Create();
  129. /* タイマを一時停止する */
  130. UNIXTimer_Pause(WonxSystem_GetUNIXTimer(Wonx_GetWonxSystem()));
  131. printf("call : font_set_colordata() : number = %u, count = %u, data = %p\n",
  132. (int)number, (int)count, data); fflush(stdout);
  133. n = 0;
  134. d = (unsigned char *)data; /* ひとつのキャラクタデータは16バイト */
  135. for (i = 0; i < count; i++) {
  136. c = WWDisplay_GetCharacter(WonxDisplay_GetWWDisplay(Wonx_GetWonxDisplay()),
  137. number + i);
  138. for (y = 0; y < 8; y++) {
  139. for (x = 0; x < 8; x++) {
  140. /*これでよいのか?*/
  141. p = ((d[n] & (1 << (7-x))) ? 2 : 0)
  142. + ((d[n + 1] & (1 << (7-x))) ? 1 : 0);
  143. WWCharacter_SetPixel(c, x, y, p);
  144. }
  145. n++;
  146. n++;
  147. }
  148. }
  149. WonxDisplay_Flush(Wonx_GetWonxDisplay());
  150. printf("call : font_set_colordata() : return value = none\n");
  151. fflush(stdout);
  152. /* タイマをもとに戻す */
  153. UNIXTimer_Unpause(WonxSystem_GetUNIXTimer(Wonx_GetWonxSystem()));
  154. return;
  155. }
  156. void font_get_data(unsigned int number,
  157. unsigned int count, void * data)
  158. {
  159. /* 関数の仕様がわからんので適当に書くぞ */
  160. WWCharacter c;
  161. int i, x, y, n, p;
  162. unsigned char * d;
  163. if (!Wonx_IsCreated()) Wonx_Create();
  164. /* タイマを一時停止する */
  165. UNIXTimer_Pause(WonxSystem_GetUNIXTimer(Wonx_GetWonxSystem()));
  166. printf("call : font_get_data() : number = %u, count = %u, data = %p\n",
  167. (int)number, (int)count, data); fflush(stdout);
  168. n = 0;
  169. d = (unsigned char *)data; /* ひとつのキャラクタデータは16バイト? */
  170. for (i = 0; i < count; i++) {
  171. c = WWDisplay_GetCharacter(WonxDisplay_GetWWDisplay(Wonx_GetWonxDisplay()),
  172. number + i);
  173. for (y = 0; y < 8; y++) {
  174. d[n ] = 0;
  175. d[n+1] = 0;
  176. for (x = 0; x < 8; x++) {
  177. p = WWCharacter_GetPixel(c, x, y);
  178. /* これでよいのか? */
  179. d[n ] |= (((unsigned char)p & 0x02) ? 1 : 0) << (7-x);
  180. d[n+1] |= (((unsigned char)p & 0x01) ? 1 : 0) << (7-x);
  181. }
  182. n++;
  183. n++;
  184. }
  185. }
  186. WonxDisplay_Sync(Wonx_GetWonxDisplay());
  187. printf("call : font_get_data() : return value = none\n");
  188. fflush(stdout);
  189. /* タイマをもとに戻す */
  190. UNIXTimer_Unpause(WonxSystem_GetUNIXTimer(Wonx_GetWonxSystem()));
  191. return;
  192. }
  193. void font_set_color(unsigned int colors)
  194. {
  195. WWDisplay dis;
  196. if (!Wonx_IsCreated()) Wonx_Create();
  197. /* タイマを一時停止する */
  198. UNIXTimer_Pause(WonxSystem_GetUNIXTimer(Wonx_GetWonxSystem()));
  199. printf("call : font_set_color() : colors = 0x%04x\n", (int)colors);
  200. fflush(stdout);
  201. dis = WonxDisplay_GetWWDisplay(Wonx_GetWonxDisplay());
  202. WWDisplay_SetForegroundColor(dis, colors & 0x03);
  203. WWDisplay_SetBackgroundColor(dis, (colors >> 2) & 0x03);
  204. WonxDisplay_Flush(Wonx_GetWonxDisplay());
  205. printf("call : font_set_color() : return value = none\n"); fflush(stdout);
  206. /* タイマをもとに戻す */
  207. UNIXTimer_Unpause(WonxSystem_GetUNIXTimer(Wonx_GetWonxSystem()));
  208. return;
  209. }
  210. unsigned int font_get_color(void)
  211. {
  212. unsigned short int ret;
  213. WWDisplay dis;
  214. if (!Wonx_IsCreated()) Wonx_Create();
  215. /* タイマを一時停止する */
  216. UNIXTimer_Pause(WonxSystem_GetUNIXTimer(Wonx_GetWonxSystem()));
  217. printf("call : font_get_color() : \n"); fflush(stdout);
  218. dis = WonxDisplay_GetWWDisplay(Wonx_GetWonxDisplay());
  219. ret = 0;
  220. ret |= WWDisplay_GetForegroundColor(dis);
  221. ret |= WWDisplay_GetBackgroundColor(dis) << 2;
  222. WonxDisplay_Sync(Wonx_GetWonxDisplay());
  223. printf("call : font_get_color() : return value = 0x%04x\n", (int)ret);
  224. fflush(stdout);
  225. /* タイマをもとに戻す */
  226. UNIXTimer_Unpause(WonxSystem_GetUNIXTimer(Wonx_GetWonxSystem()));
  227. return (ret);
  228. }
  229. static void _screen_set_char1(int screen, int x, int y,
  230. unsigned short int data)
  231. {
  232. int horizontal; /* 横方向反転フラグ */
  233. int vertical; /* 縦方向反転フラグ */
  234. int palette_num; /* パレット番号 */
  235. int character_num; /* 表示キャラクタ */
  236. WWDisplay display;
  237. WWScreen s;
  238. WWPalette p;
  239. WWCharacter c;
  240. display = WonxDisplay_GetWWDisplay(Wonx_GetWonxDisplay());
  241. s = WWDisplay_GetScreen(display, screen);
  242. horizontal = (data & (1 << 15)) ? 1 : 0;
  243. vertical = (data & (1 << 14)) ? 1 : 0;
  244. palette_num = (data >> 9) & 0x0f;
  245. character_num = data & 0x1ff;
  246. p = WWDisplay_GetPalette(display, palette_num);
  247. c = WWDisplay_GetCharacter(display, character_num);
  248. WWScreen_SetHorizontal(s, x, y, horizontal);
  249. WWScreen_SetVertical( s, x, y, vertical);
  250. WWScreen_SetPalette( s, x, y, p);
  251. WWScreen_SetCharacter( s, x, y, c);
  252. return;
  253. }
  254. void screen_set_char(int screen, int x, int y, int w, int h, void * data)
  255. {
  256. int i, j;
  257. unsigned short int * d;
  258. if (!Wonx_IsCreated()) Wonx_Create();
  259. /* タイマを一時停止する */
  260. UNIXTimer_Pause(WonxSystem_GetUNIXTimer(Wonx_GetWonxSystem()));
  261. printf("call : screen_set_char() : screen = %d, x = %d, y = %d, w = %d, h = %d, data = %p\n",
  262. screen, x, y, w, h, data);
  263. fflush(stdout);
  264. d = (unsigned short int *)data;
  265. for (j = 0; j < h; j++) {
  266. for (i = 0; i < w; i++) {
  267. _screen_set_char1(screen, x + i, y + j, *d);
  268. d++;
  269. }
  270. }
  271. WonxDisplay_Flush(Wonx_GetWonxDisplay());
  272. printf("call : screen_set_char() : return value = none\n");
  273. fflush(stdout);
  274. /* タイマをもとに戻す */
  275. UNIXTimer_Unpause(WonxSystem_GetUNIXTimer(Wonx_GetWonxSystem()));
  276. return;
  277. }
  278. static unsigned int _screen_get_char1(int screen, int x, int y)
  279. {
  280. int horizontal; /* 横方向反転フラグ */
  281. int vertical; /* 縦方向反転フラグ */
  282. int palette_num; /* パレット番号 */
  283. int character_num; /* 表示キャラクタ */
  284. WWScreen s;
  285. WWPalette p;
  286. WWCharacter c;
  287. unsigned short int ret;
  288. s = WWDisplay_GetScreen(WonxDisplay_GetWWDisplay(Wonx_GetWonxDisplay()),
  289. screen);
  290. horizontal = WWScreen_GetHorizontal(s, x, y);
  291. vertical = WWScreen_GetVertical( s, x, y);
  292. p = WWScreen_GetPalette( s, x, y);
  293. c = WWScreen_GetCharacter( s, x, y);
  294. palette_num = WWPalette_GetNumber(p);
  295. character_num = WWCharacter_GetNumber(c);
  296. ret = 0;
  297. ret |= horizontal << 15;
  298. ret |= vertical << 14;
  299. ret |= palette_num << 9;
  300. ret |= character_num;
  301. return (ret);
  302. }
  303. void screen_get_char(int screen, int x, int y, int w, int h, void * data)
  304. {
  305. int i, j;
  306. unsigned short int * d;
  307. if (!Wonx_IsCreated()) Wonx_Create();
  308. /* タイマを一時停止する */
  309. UNIXTimer_Pause(WonxSystem_GetUNIXTimer(Wonx_GetWonxSystem()));
  310. printf("call : screen_get_char() : screen = %d, x = %d, y = %d, w = %d, h = %d, data = %p\n",
  311. screen, x, y, w, h, data);
  312. fflush(stdout);
  313. d = (unsigned short int *)data;
  314. for (j = 0; j < h; j++) {
  315. for (i = 0; i < w; i++) {
  316. *d = _screen_get_char1(screen, x, y);
  317. d++;
  318. }
  319. }
  320. WonxDisplay_Sync(Wonx_GetWonxDisplay());
  321. printf("call : screen_get_char() : return value = none\n");
  322. fflush(stdout);
  323. /* タイマをもとに戻す */
  324. UNIXTimer_Unpause(WonxSystem_GetUNIXTimer(Wonx_GetWonxSystem()));
  325. return;
  326. }
  327. unsigned int screen_get_char1(int screen, int x, int y)
  328. {
  329. unsigned short int ret;
  330. if (!Wonx_IsCreated()) Wonx_Create();
  331. /* タイマを一時停止する */
  332. UNIXTimer_Pause(WonxSystem_GetUNIXTimer(Wonx_GetWonxSystem()));
  333. printf("call : screen_get_char1() : screen = %d, x = %d, y = %d\n",
  334. screen, x, y);
  335. fflush(stdout);
  336. ret = _screen_get_char1(screen, x, y);
  337. WonxDisplay_Sync(Wonx_GetWonxDisplay());
  338. printf("call : screen_get_char1() : return value = 0x%04x\n", (int)ret);
  339. fflush(stdout);
  340. /* タイマをもとに戻す */
  341. UNIXTimer_Unpause(WonxSystem_GetUNIXTimer(Wonx_GetWonxSystem()));
  342. return (ret);
  343. }
  344. void screen_fill_char(int screen, int x, int y, int w, int h,
  345. unsigned int data)
  346. {
  347. int i, j;
  348. if (!Wonx_IsCreated()) Wonx_Create();
  349. /* タイマを一時停止する */
  350. UNIXTimer_Pause(WonxSystem_GetUNIXTimer(Wonx_GetWonxSystem()));
  351. printf("call : screen_fill_char() : screen = %d, x = %d, y = %d, w = %d, h = %d, data = 0x%04x\n",
  352. screen, x, y, w, h, (int)data);
  353. fflush(stdout);
  354. for (j = 0; j < h; j++) {
  355. for (i = 0; i < w; i++) {
  356. _screen_set_char1(screen, x + i, y + j, data);
  357. }
  358. }
  359. WonxDisplay_Flush(Wonx_GetWonxDisplay());
  360. printf("call : screen_fill_char() : return value = none\n"); fflush(stdout);
  361. /* タイマをもとに戻す */
  362. UNIXTimer_Unpause(WonxSystem_GetUNIXTimer(Wonx_GetWonxSystem()));
  363. return;
  364. }
  365. void screen_fill_attr(int screen, int x, int y, int w, int h,
  366. unsigned int data, unsigned int mask)
  367. {
  368. int i, j;
  369. unsigned short int c;
  370. if (!Wonx_IsCreated()) Wonx_Create();
  371. /* タイマを一時停止する */
  372. UNIXTimer_Pause(WonxSystem_GetUNIXTimer(Wonx_GetWonxSystem()));
  373. printf("call : screen_fill_attr() : screen = %d, x = %d, y = %d, w = %d, h = %d, data = 0x%04x, mask = 0x%04x\n",
  374. screen, x, y, w, h, (int)data, (int)mask); fflush(stdout);
  375. for (j = 0; j < h; j++) {
  376. for (i = 0; i < w; i++) {
  377. c = _screen_get_char1(screen, x + i, y + j);
  378. c &= mask;
  379. c |= data;
  380. _screen_set_char1(screen, x + i, y + j, c);
  381. }
  382. }
  383. WonxDisplay_Flush(Wonx_GetWonxDisplay());
  384. printf("call : screen_fill_attr() : return value = none\n");
  385. fflush(stdout);
  386. /* タイマをもとに戻す */
  387. UNIXTimer_Unpause(WonxSystem_GetUNIXTimer(Wonx_GetWonxSystem()));
  388. return;
  389. }
  390. void sprite_set_range(unsigned int sprite_start, unsigned int sprite_count)
  391. {
  392. if (!Wonx_IsCreated()) Wonx_Create();
  393. /* タイマを一時停止する */
  394. UNIXTimer_Pause(WonxSystem_GetUNIXTimer(Wonx_GetWonxSystem()));
  395. printf("call : sprite_set_range() : start = %u, count = %u\n",
  396. (int)sprite_start, (int)sprite_count); fflush(stdout);
  397. WWDisplay_SetSpriteStart(WonxDisplay_GetWWDisplay(Wonx_GetWonxDisplay()),
  398. sprite_start);
  399. WWDisplay_SetSpriteCount(WonxDisplay_GetWWDisplay(Wonx_GetWonxDisplay()),
  400. sprite_count);
  401. WonxDisplay_Flush(Wonx_GetWonxDisplay());
  402. printf("call : sprite_set_range() : return value = none\n");
  403. fflush(stdout);
  404. /* タイマをもとに戻す */
  405. UNIXTimer_Unpause(WonxSystem_GetUNIXTimer(Wonx_GetWonxSystem()));
  406. return;
  407. }
  408. static void _sprite_set_char(unsigned int sprite_num, unsigned int data)
  409. {
  410. WWSprite s;
  411. WWPalette p;
  412. WWCharacter c;
  413. s = WWDisplay_GetSprite(WonxDisplay_GetWWDisplay(Wonx_GetWonxDisplay()),
  414. sprite_num);
  415. WWSprite_SetHorizontal(s, (data >> 15) ? 1 : 0);
  416. WWSprite_SetVertical( s, (data >> 14) ? 1 : 0);
  417. WWSprite_SetPriority( s, (data >> 13) ? 1 : 0);
  418. WWSprite_SetClipping( s, (data >> 12) ? 1 : 0);
  419. p = WWDisplay_GetPalette(WonxDisplay_GetWWDisplay(Wonx_GetWonxDisplay()),
  420. (data >> 9) & 0x07);
  421. c = WWDisplay_GetCharacter(WonxDisplay_GetWWDisplay(Wonx_GetWonxDisplay()),
  422. data & 0x1ff);
  423. WWSprite_SetPalette(s, p);
  424. WWSprite_SetCharacter(s, c);
  425. return;
  426. }
  427. void sprite_set_char(unsigned int sprite_num, unsigned int data)
  428. {
  429. if (!Wonx_IsCreated()) Wonx_Create();
  430. /* タイマを一時停止する */
  431. UNIXTimer_Pause(WonxSystem_GetUNIXTimer(Wonx_GetWonxSystem()));
  432. printf("call : sprite_set_char() : number = %u, data = 0x%04x\n",
  433. (int)sprite_num, (int)data); fflush(stdout);
  434. _sprite_set_char(sprite_num, data);
  435. WonxDisplay_Flush(Wonx_GetWonxDisplay());
  436. printf("call : sprite_set_char() : return value = none\n");
  437. fflush(stdout);
  438. /* タイマをもとに戻す */
  439. UNIXTimer_Unpause(WonxSystem_GetUNIXTimer(Wonx_GetWonxSystem()));
  440. return;
  441. }
  442. static unsigned int _sprite_get_char(unsigned int sprite_num)
  443. {
  444. WWSprite s;
  445. WWPalette p;
  446. WWCharacter c;
  447. unsigned short int ret;
  448. s = WWDisplay_GetSprite(WonxDisplay_GetWWDisplay(Wonx_GetWonxDisplay()),
  449. sprite_num);
  450. ret = 0;
  451. ret |= (WWSprite_GetHorizontal(s) ? 1 : 0) << 15;
  452. ret |= (WWSprite_GetVertical( s) ? 1 : 0) << 14;
  453. ret |= (WWSprite_GetPriority( s) ? 1 : 0) << 13;
  454. ret |= (WWSprite_GetClipping( s) ? 1 : 0) << 12;
  455. p = WWSprite_GetPalette(s);
  456. c = WWSprite_GetCharacter(s);
  457. ret |= (WWPalette_GetNumber(p) & 0x07) << 9;
  458. ret |= WWCharacter_GetNumber(c);
  459. return (ret);
  460. }
  461. unsigned int sprite_get_char(unsigned int sprite_num)
  462. {
  463. unsigned short int ret;
  464. if (!Wonx_IsCreated()) Wonx_Create();
  465. /* タイマを一時停止する */
  466. UNIXTimer_Pause(WonxSystem_GetUNIXTimer(Wonx_GetWonxSystem()));
  467. printf("call : sprite_get_char() : number = %u\n", (int)sprite_num);
  468. fflush(stdout);
  469. ret = _sprite_get_char(sprite_num);
  470. WonxDisplay_Sync(Wonx_GetWonxDisplay());
  471. printf("call : sprite_get_char() : return value = 0x%04x\n", (int)ret);
  472. fflush(stdout);
  473. /* タイマをもとに戻す */
  474. UNIXTimer_Unpause(WonxSystem_GetUNIXTimer(Wonx_GetWonxSystem()));
  475. return (ret);
  476. }
  477. static void _sprite_set_location(unsigned int sprite_num, int x, int y)
  478. {
  479. WWSprite s;
  480. s = WWDisplay_GetSprite(WonxDisplay_GetWWDisplay(Wonx_GetWonxDisplay()),
  481. sprite_num);
  482. WWSprite_SetPosition(s, x, y);
  483. return;
  484. }
  485. void sprite_set_location(unsigned int sprite_num, int x, int y)
  486. {
  487. if (!Wonx_IsCreated()) Wonx_Create();
  488. /* タイマを一時停止する */
  489. UNIXTimer_Pause(WonxSystem_GetUNIXTimer(Wonx_GetWonxSystem()));
  490. printf("call : sprite_set_location() : number = %u, x = %d, y = %d\n",
  491. (int)sprite_num, x, y);
  492. fflush(stdout);
  493. _sprite_set_location(sprite_num, x, y);
  494. WonxDisplay_Flush(Wonx_GetWonxDisplay());
  495. printf("call : sprite_set_location() : return value = none\n");
  496. fflush(stdout);
  497. /* タイマをもとに戻す */
  498. UNIXTimer_Unpause(WonxSystem_GetUNIXTimer(Wonx_GetWonxSystem()));
  499. return;
  500. }
  501. static unsigned int _sprite_get_location(unsigned int sprite_num)
  502. {
  503. WWSprite s;
  504. unsigned short int ret;
  505. s = WWDisplay_GetSprite(WonxDisplay_GetWWDisplay(Wonx_GetWonxDisplay()),
  506. sprite_num);
  507. ret = (WWSprite_GetY(s) << 8) | WWSprite_GetX(s);
  508. return (ret);
  509. }
  510. unsigned int sprite_get_location(unsigned int sprite_num)
  511. {
  512. unsigned short int ret;
  513. if (!Wonx_IsCreated()) Wonx_Create();
  514. /* タイマを一時停止する */
  515. UNIXTimer_Pause(WonxSystem_GetUNIXTimer(Wonx_GetWonxSystem()));
  516. printf("call : sprite_get_location() : number = %u\n", (int)sprite_num);
  517. fflush(stdout);
  518. ret = _sprite_get_location(sprite_num);
  519. WonxDisplay_Sync(Wonx_GetWonxDisplay());
  520. printf("call : sprite_get_location() : return value = 0x%04x\n", (int)ret);
  521. fflush(stdout);
  522. /* タイマをもとに戻す */
  523. UNIXTimer_Unpause(WonxSystem_GetUNIXTimer(Wonx_GetWonxSystem()));
  524. return (ret);
  525. }
  526. static void _sprite_set_char_location(unsigned int sprite_num,
  527. unsigned int data, int x, int y)
  528. {
  529. _sprite_set_char(sprite_num, data);
  530. _sprite_set_location(sprite_num, x, y);
  531. return;
  532. }
  533. void sprite_set_char_location(unsigned int sprite_num,
  534. unsigned int data, int x, int y)
  535. {
  536. if (!Wonx_IsCreated()) Wonx_Create();
  537. /* タイマを一時停止する */
  538. UNIXTimer_Pause(WonxSystem_GetUNIXTimer(Wonx_GetWonxSystem()));
  539. printf("call : sprite_set_char_location() : number = %u, data = 0x%04x, x = %d, y = %d\n",
  540. (int)sprite_num, (int)data, x, y);
  541. fflush(stdout);
  542. _sprite_set_char_location(sprite_num, data, x, y);
  543. WonxDisplay_Flush(Wonx_GetWonxDisplay());
  544. printf("call : sprite_set_char_location() : return value = none\n");
  545. fflush(stdout);
  546. /* タイマをもとに戻す */
  547. UNIXTimer_Unpause(WonxSystem_GetUNIXTimer(Wonx_GetWonxSystem()));
  548. return;
  549. }
  550. unsigned long int sprite_get_char_location(unsigned int sprite_num)
  551. {
  552. unsigned long int ret;
  553. if (!Wonx_IsCreated()) Wonx_Create();
  554. /* タイマを一時停止する */
  555. UNIXTimer_Pause(WonxSystem_GetUNIXTimer(Wonx_GetWonxSystem()));
  556. printf("call : sprite_get_char_location() : number = %u\n", (int)sprite_num);
  557. fflush(stdout);
  558. ret = 0;
  559. ret |= ((unsigned long int)_sprite_get_char(sprite_num));
  560. ret |= (unsigned long int)_sprite_get_location(sprite_num) << 16;
  561. WonxDisplay_Sync(Wonx_GetWonxDisplay());
  562. printf("call : sprite_get_char_location() : return value = 0x%08x\n",
  563. (int)ret);
  564. fflush(stdout);
  565. /* タイマをもとに戻す */
  566. UNIXTimer_Unpause(WonxSystem_GetUNIXTimer(Wonx_GetWonxSystem()));
  567. return (ret);
  568. }
  569. void sprite_set_data(unsigned int sprite_num, unsigned int count, void * data)
  570. {
  571. int i;
  572. unsigned long int * n;
  573. if (!Wonx_IsCreated()) Wonx_Create();
  574. /* タイマを一時停止する */
  575. UNIXTimer_Pause(WonxSystem_GetUNIXTimer(Wonx_GetWonxSystem()));
  576. printf("call : sprite_set_data() : number = %u, count = %u, data = %p\n",
  577. (int)sprite_num, (int)count, data);
  578. fflush(stdout);
  579. n = (unsigned long int *)data;
  580. for (i = 0; i < count; i++) {
  581. _sprite_set_char_location(sprite_num + i,
  582. n[i] >> 16,
  583. (n[i] >> 8) & 0xff,
  584. n[i] & 0xff);
  585. }
  586. WonxDisplay_Flush(Wonx_GetWonxDisplay());
  587. printf("call : sprite_set_data() : return value = none\n");
  588. fflush(stdout);
  589. /* タイマをもとに戻す */
  590. UNIXTimer_Unpause(WonxSystem_GetUNIXTimer(Wonx_GetWonxSystem()));
  591. return;
  592. }
  593. void screen_set_scroll(int screen, int x, int y)
  594. {
  595. WWScreen s;
  596. if (!Wonx_IsCreated()) Wonx_Create();
  597. /* タイマを一時停止する */
  598. UNIXTimer_Pause(WonxSystem_GetUNIXTimer(Wonx_GetWonxSystem()));
  599. printf("call : screen_set_scroll() : screen = %d, x = %d, y = %d\n",
  600. screen, x, y);
  601. fflush(stdout);
  602. s = WWDisplay_GetScreen(WonxDisplay_GetWWDisplay(Wonx_GetWonxDisplay()),
  603. screen);
  604. WWScreen_SetRollX(s, x);
  605. WWScreen_SetRollY(s, y);
  606. WonxDisplay_Flush(Wonx_GetWonxDisplay());
  607. printf("call : screen_set_scroll() : return value = none\n");
  608. fflush(stdout);
  609. /* タイマをもとに戻す */
  610. UNIXTimer_Unpause(WonxSystem_GetUNIXTimer(Wonx_GetWonxSystem()));
  611. return;
  612. }
  613. unsigned int screen_get_scroll(int screen)
  614. {
  615. unsigned short int ret;
  616. WWScreen s;
  617. if (!Wonx_IsCreated()) Wonx_Create();
  618. /* タイマを一時停止する */
  619. UNIXTimer_Pause(WonxSystem_GetUNIXTimer(Wonx_GetWonxSystem()));
  620. printf("call : screen_get_scroll() : screen = %d\n", screen); fflush(stdout);
  621. s = WWDisplay_GetScreen(WonxDisplay_GetWWDisplay(Wonx_GetWonxDisplay()),
  622. screen);
  623. ret = 0;
  624. ret |= WWScreen_GetRollX(s);
  625. ret |= WWScreen_GetRollY(s) << 8;
  626. WonxDisplay_Sync(Wonx_GetWonxDisplay());
  627. printf("call : screen_get_scroll() : return value = %u\n", (int)ret);
  628. fflush(stdout);
  629. /* タイマをもとに戻す */
  630. UNIXTimer_Unpause(WonxSystem_GetUNIXTimer(Wonx_GetWonxSystem()));
  631. return (ret);
  632. }
  633. void screen2_set_window(int x, int y, int w, int h)
  634. {
  635. WWScreen s;
  636. if (!Wonx_IsCreated()) Wonx_Create();
  637. /* タイマを一時停止する */
  638. UNIXTimer_Pause(WonxSystem_GetUNIXTimer(Wonx_GetWonxSystem()));
  639. printf("call : screen2_set_window() : x = %d, y = %d, width = %d, height = %d\n",
  640. x, y, w, h); fflush(stdout);
  641. s = WWDisplay_GetScreen(WonxDisplay_GetWWDisplay(Wonx_GetWonxDisplay()),
  642. SCREEN2);
  643. WWScreen_SetDrawX(s, x);
  644. WWScreen_SetDrawY(s, y);
  645. WWScreen_SetDrawWidth( s, w);
  646. WWScreen_SetDrawHeight(s, h);
  647. WonxDisplay_Flush(Wonx_GetWonxDisplay());
  648. printf("call : screen2_set_window() : return value = none\n");
  649. fflush(stdout);
  650. /* タイマをもとに戻す */
  651. UNIXTimer_Unpause(WonxSystem_GetUNIXTimer(Wonx_GetWonxSystem()));
  652. return;
  653. }
  654. unsigned long int screen2_get_window(void)
  655. {
  656. WWScreen s;
  657. unsigned short int xy;
  658. unsigned short int wh;
  659. unsigned long int ret;
  660. if (!Wonx_IsCreated()) Wonx_Create();
  661. /* タイマを一時停止する */
  662. UNIXTimer_Pause(WonxSystem_GetUNIXTimer(Wonx_GetWonxSystem()));
  663. printf("call : screen2_get_window() : \n"); fflush(stdout);
  664. s = WWDisplay_GetScreen(WonxDisplay_GetWWDisplay(Wonx_GetWonxDisplay()),
  665. SCREEN2);
  666. xy =
  667. (((unsigned short int)WWScreen_GetDrawY(s) << 8) & 0xff00) |
  668. ((unsigned short int)WWScreen_GetDrawX(s) & 0x00ff);
  669. wh =
  670. (((unsigned short int)WWScreen_GetDrawHeight(s) << 8) & 0xff00) |
  671. ((unsigned short int)WWScreen_GetDrawWidth(s) & 0x00ff);
  672. ret = ((unsigned long int)wh) << 16 | xy;
  673. WonxDisplay_Sync(Wonx_GetWonxDisplay());
  674. printf("call : screen2_get_window() : return value = 0x%08x\n", (int)ret);
  675. fflush(stdout);
  676. /* タイマをもとに戻す */
  677. UNIXTimer_Unpause(WonxSystem_GetUNIXTimer(Wonx_GetWonxSystem()));
  678. return (ret);
  679. }
  680. void sprite_set_window(int x, int y, int w, int h)
  681. {
  682. WWDisplay d;
  683. if (!Wonx_IsCreated()) Wonx_Create();
  684. /* タイマを一時停止する */
  685. UNIXTimer_Pause(WonxSystem_GetUNIXTimer(Wonx_GetWonxSystem()));
  686. printf("call : sprite_set_window() : x = %d, y = %d, w = %d, h = %d\n",
  687. x, y, w, h);
  688. fflush(stdout);
  689. d = WonxDisplay_GetWWDisplay(Wonx_GetWonxDisplay());
  690. WWDisplay_SetSpriteWindowX(d, x);
  691. WWDisplay_SetSpriteWindowY(d, y);
  692. WWDisplay_SetSpriteWindowWidth(d, w);
  693. WWDisplay_SetSpriteWindowHeight(d, h);
  694. WonxDisplay_Flush(Wonx_GetWonxDisplay());
  695. printf("call : sprite_set_window() : return value = none\n");
  696. fflush(stdout);
  697. /* タイマをもとに戻す */
  698. UNIXTimer_Unpause(WonxSystem_GetUNIXTimer(Wonx_GetWonxSystem()));
  699. return;
  700. }
  701. unsigned long int sprite_get_window(void)
  702. {
  703. WWDisplay d;
  704. unsigned short int xy;
  705. unsigned short int wh;
  706. unsigned long int ret;
  707. if (!Wonx_IsCreated()) Wonx_Create();
  708. /* タイマを一時停止する */
  709. UNIXTimer_Pause(WonxSystem_GetUNIXTimer(Wonx_GetWonxSystem()));
  710. printf("call : sprite_get_window() : \n");
  711. fflush(stdout);
  712. d = WonxDisplay_GetWWDisplay(Wonx_GetWonxDisplay());
  713. xy =
  714. (((unsigned short int)WWDisplay_GetSpriteWindowY(d) << 8) & 0xff00) |
  715. ((unsigned short int)WWDisplay_GetSpriteWindowX(d) & 0x00ff);
  716. wh =
  717. (((unsigned short int)WWDisplay_GetSpriteWindowHeight(d) << 8) & 0xff00) |
  718. ((unsigned short int)WWDisplay_GetSpriteWindowWidth(d) & 0x00ff);
  719. ret = ((unsigned long int)wh) << 16 | xy;
  720. WonxDisplay_Sync(Wonx_GetWonxDisplay());
  721. printf("call : sprite_get_window() : return value = 0x%08x\n", (int)ret);
  722. fflush(stdout);
  723. /* タイマをもとに戻す */
  724. UNIXTimer_Unpause(WonxSystem_GetUNIXTimer(Wonx_GetWonxSystem()));
  725. return (ret);
  726. }
  727. void palette_set_color(unsigned int palette_num,
  728. unsigned int colors)
  729. {
  730. int mapped_colors[4];
  731. WWPalette palette;
  732. if (!Wonx_IsCreated()) Wonx_Create();
  733. /* タイマを一時停止する */
  734. UNIXTimer_Pause(WonxSystem_GetUNIXTimer(Wonx_GetWonxSystem()));
  735. printf("call : palette_set_color() : number = %u, colors = 0x%04x\n",
  736. (int)palette_num, (int)colors); fflush(stdout);
  737. mapped_colors[0] = colors & 0x07;
  738. mapped_colors[1] = (colors >> 4) & 0x07;
  739. mapped_colors[2] = (colors >> 8) & 0x07;
  740. mapped_colors[3] = (colors >> 12) & 0x07;
  741. palette =
  742. WWDisplay_GetPalette(WonxDisplay_GetWWDisplay(Wonx_GetWonxDisplay()),
  743. palette_num);
  744. WWPalette_SetMappedColors(palette, mapped_colors);
  745. WonxDisplay_Flush(Wonx_GetWonxDisplay());
  746. printf("call : palette_set_color() : return value = none\n");
  747. fflush(stdout);
  748. /* タイマをもとに戻す */
  749. UNIXTimer_Unpause(WonxSystem_GetUNIXTimer(Wonx_GetWonxSystem()));
  750. return;
  751. }
  752. unsigned int palette_get_color(unsigned int palette_num)
  753. {
  754. int mapped_colors[4];
  755. WWPalette palette;
  756. unsigned short int ret;
  757. if (!Wonx_IsCreated()) Wonx_Create();
  758. /* タイマを一時停止する */
  759. UNIXTimer_Pause(WonxSystem_GetUNIXTimer(Wonx_GetWonxSystem()));
  760. printf("call : palette_get_color() : number = %u\n", (int)palette_num);
  761. fflush(stdout);
  762. palette =
  763. WWDisplay_GetPalette(WonxDisplay_GetWWDisplay(Wonx_GetWonxDisplay()),
  764. palette_num);
  765. WWPalette_GetMappedColors(palette, mapped_colors);
  766. ret = 0;
  767. ret |= mapped_colors[0] & 0x07;
  768. ret |= (mapped_colors[1] & 0x07) << 4;
  769. ret |= (mapped_colors[2] & 0x07) << 8;
  770. ret |= (mapped_colors[3] & 0x07) << 12;
  771. WonxDisplay_Sync(Wonx_GetWonxDisplay());
  772. printf("call : palette_get_color() : return value = %u\n", (int)ret);
  773. fflush(stdout);
  774. /* タイマをもとに戻す */
  775. UNIXTimer_Unpause(WonxSystem_GetUNIXTimer(Wonx_GetWonxSystem()));
  776. return (ret);
  777. }
  778. void lcd_set_color(unsigned int colors0, unsigned int colors1)
  779. {
  780. WWColorMap color_map;
  781. int lcd_colors[8];
  782. if (!Wonx_IsCreated()) Wonx_Create();
  783. /* タイマを一時停止する */
  784. UNIXTimer_Pause(WonxSystem_GetUNIXTimer(Wonx_GetWonxSystem()));
  785. printf("call : lcd_set_color() : colors0 = 0x%04x, colors1 = 0x%04x\n",
  786. (int)colors0, (int)colors1); fflush(stdout);
  787. lcd_colors[0] = colors0 & 0x0f;
  788. lcd_colors[1] = (colors0 >> 4) & 0x0f;
  789. lcd_colors[2] = (colors0 >> 8) & 0x0f;
  790. lcd_colors[3] = (colors0 >> 12) & 0x0f;
  791. lcd_colors[4] = colors1 & 0x0f;
  792. lcd_colors[5] = (colors1 >> 4) & 0x0f;
  793. lcd_colors[6] = (colors1 >> 8) & 0x0f;
  794. lcd_colors[7] = (colors1 >> 12) & 0x0f;
  795. color_map =
  796. WWDisplay_GetColorMap(WonxDisplay_GetWWDisplay(Wonx_GetWonxDisplay()));
  797. WWColorMap_SetLCDColors(color_map, lcd_colors);
  798. WonxDisplay_Flush(Wonx_GetWonxDisplay());
  799. printf("call : lcd_set_color() : return value = none\n");
  800. fflush(stdout);
  801. /* タイマをもとに戻す */
  802. UNIXTimer_Unpause(WonxSystem_GetUNIXTimer(Wonx_GetWonxSystem()));
  803. return;
  804. }
  805. unsigned long int lcd_get_color(void)
  806. {
  807. WWColorMap color_map;
  808. int lcd_colors[8];
  809. unsigned long int ret;
  810. if (!Wonx_IsCreated()) Wonx_Create();
  811. /* タイマを一時停止する */
  812. UNIXTimer_Pause(WonxSystem_GetUNIXTimer(Wonx_GetWonxSystem()));
  813. printf("call : lcd_get_color() : \n"); fflush(stdout);
  814. color_map =
  815. WWDisplay_GetColorMap(WonxDisplay_GetWWDisplay(Wonx_GetWonxDisplay()));
  816. WWColorMap_GetLCDColors(color_map, lcd_colors);
  817. ret = 0;
  818. ret |= (unsigned long int)lcd_colors[0] & 0x0f;
  819. ret |= ((unsigned long int)lcd_colors[1] & 0x0f) << 4;
  820. ret |= ((unsigned long int)lcd_colors[2] & 0x0f) << 8;
  821. ret |= ((unsigned long int)lcd_colors[3] & 0x0f) << 12;
  822. ret |= (unsigned long int)lcd_colors[0] & 0x0f;
  823. ret |= ((unsigned long int)lcd_colors[1] & 0x0f) << 4;
  824. ret |= ((unsigned long int)lcd_colors[2] & 0x0f) << 8;
  825. ret |= ((unsigned long int)lcd_colors[3] & 0x0f) << 12;
  826. WonxDisplay_Sync(Wonx_GetWonxDisplay());
  827. printf("call : lcd_get_color() : return value = 0x%08x\n", (int)ret);
  828. fflush(stdout);
  829. /* タイマをもとに戻す */
  830. UNIXTimer_Unpause(WonxSystem_GetUNIXTimer(Wonx_GetWonxSystem()));
  831. return (ret);
  832. }
  833. void lcd_set_segments(unsigned segments)
  834. {
  835. if (!Wonx_IsCreated()) Wonx_Create();
  836. /* タイマを一時停止する */
  837. UNIXTimer_Pause(WonxSystem_GetUNIXTimer(Wonx_GetWonxSystem()));
  838. /* セグメント表示は未サポートか? */
  839. WonxDisplay_Flush(Wonx_GetWonxDisplay());
  840. /* タイマをもとに戻す */
  841. UNIXTimer_Unpause(WonxSystem_GetUNIXTimer(Wonx_GetWonxSystem()));
  842. return;
  843. }
  844. unsigned int lcd_get_segments(void)
  845. {
  846. if (!Wonx_IsCreated()) Wonx_Create();
  847. /* タイマを一時停止する */
  848. UNIXTimer_Pause(WonxSystem_GetUNIXTimer(Wonx_GetWonxSystem()));
  849. /* セグメント表示は未サポートか? */
  850. WonxDisplay_Sync(Wonx_GetWonxDisplay());
  851. /* タイマをもとに戻す */
  852. UNIXTimer_Unpause(WonxSystem_GetUNIXTimer(Wonx_GetWonxSystem()));
  853. return (0);
  854. }
  855. void lcd_set_sleep(unsigned slp)
  856. {
  857. if (!Wonx_IsCreated()) Wonx_Create();
  858. /* タイマを一時停止する */
  859. UNIXTimer_Pause(WonxSystem_GetUNIXTimer(Wonx_GetWonxSystem()));
  860. /* ? */
  861. WonxDisplay_Sync(Wonx_GetWonxDisplay());
  862. /* タイマをもとに戻す */
  863. UNIXTimer_Unpause(WonxSystem_GetUNIXTimer(Wonx_GetWonxSystem()));
  864. return;
  865. }
  866. unsigned int lcd_get_sleep(void)
  867. {
  868. if (!Wonx_IsCreated()) Wonx_Create();
  869. /* タイマを一時停止する */
  870. UNIXTimer_Pause(WonxSystem_GetUNIXTimer(Wonx_GetWonxSystem()));
  871. /* ? */
  872. WonxDisplay_Sync(Wonx_GetWonxDisplay());
  873. /* タイマをもとに戻す */
  874. UNIXTimer_Unpause(WonxSystem_GetUNIXTimer(Wonx_GetWonxSystem()));
  875. return (0);
  876. }
  877. void screen_set_vram(int screen, int locationID)
  878. {
  879. if (!Wonx_IsCreated()) Wonx_Create();
  880. /* タイマを一時停止する */
  881. UNIXTimer_Pause(WonxSystem_GetUNIXTimer(Wonx_GetWonxSystem()));
  882. /* 未サポート */
  883. WonxDisplay_Sync(Wonx_GetWonxDisplay());
  884. /* タイマをもとに戻す */
  885. UNIXTimer_Unpause(WonxSystem_GetUNIXTimer(Wonx_GetWonxSystem()));
  886. return;
  887. }
  888. void sprite_set_vram(int locationID)
  889. {
  890. if (!Wonx_IsCreated()) Wonx_Create();
  891. /* タイマを一時停止する */
  892. UNIXTimer_Pause(WonxSystem_GetUNIXTimer(Wonx_GetWonxSystem()));
  893. /* 未サポート */
  894. WonxDisplay_Sync(Wonx_GetWonxDisplay());
  895. /* タイマをもとに戻す */
  896. UNIXTimer_Unpause(WonxSystem_GetUNIXTimer(Wonx_GetWonxSystem()));
  897. return;
  898. }
  899. /*****************************************************************************/
  900. /* ここまで */
  901. /*****************************************************************************/
  902. /*****************************************************************************/
  903. /* End of File. */
  904. /*****************************************************************************/