すくすくゴートうちゃん Android 版(黒歴史)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

char.mod.hsp 1.4 KiB

1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. #module \
  2. Char
  3. #const CHAR_WIDTH 32
  4. #const UNKNOWN 52
  5. #defcfunc local \
  6. New \
  7. str p_text
  8. If insNum <= 0 {
  9. SDim charDict, 384
  10. SDim text, 1024
  11. BLoad "dict.dat", charDict
  12. }
  13. text.insNum = p_text
  14. posX.insNum = gInfo_cX
  15. posY.insNum = gInfo_cY
  16. size.insNum = CHAR_WIDTH
  17. exists.insNum = True
  18. insNum++
  19. Return insNum - 1
  20. #deffunc local \
  21. Destroy \
  22. int p_insId
  23. exists.insNum = False
  24. Return
  25. #deffunc local \
  26. Draw \
  27. local l_cnt,\
  28. local l_found
  29. Repeat insNum
  30. If exists.cnt {
  31. l_cnt = cnt
  32. Repeat StrLen (text.l_cnt) / 3
  33. l_found = MyInStr (charDict, 0, StrMid (text.l_cnt, cnt * 3, 3)) / 3
  34. If darw_found < 0 {
  35. l_found = UNKNOWN
  36. }
  37. Pos posX.l_cnt + cnt * size.l_cnt, posY.l_cnt
  38. l_zoom = Double (size.l_cnt) / CHAR_WIDTH
  39. CelPut BUFFER_CHAR, l_found, l_zoom, l_zoom
  40. Loop
  41. }
  42. Loop
  43. Return
  44. #defcfunc local \
  45. MyInStr \
  46. str p_haystack,\
  47. int p_offset,\
  48. str p_needle
  49. myInStr_haystack = p_haystack
  50. myInStr_flag = True
  51. Repeat StrLen (myInStr_haystack) / 3
  52. SDim myInStr_work, 3
  53. myInStr_cnt = cnt
  54. Repeat 3
  55. Poke myInStr_work, cnt, Peek (myInStr_haystack, myInStr_cnt * 3 + cnt)
  56. Loop
  57. If myInStr_work = p_needle {
  58. myInStr_flag = False
  59. Break
  60. }
  61. Loop
  62. If myInStr_flag {
  63. Return -1
  64. }
  65. Return myInStr_cnt * 3
  66. #defcfunc local \
  67. MyStrMid \
  68. str p_string,\
  69. int p_offset,\
  70. int p_length,\
  71. int p_test
  72. myStrMid_string = p_string
  73. SDim myStrMid_return, p_length
  74. Return myStrMid_return
  75. #global