すくすくゴートうちゃん 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.

61 lines
1.2 KiB

  1. #ifndef __SETTING__
  2. #define __SETTING__
  3. #module \
  4. Setting
  5. #define FILE_NAME ("setting.dat")
  6. ; ユーザ ID
  7. #const USER_ID_OFFSET 0
  8. #const USER_ID_SIZE 4
  9. ; ユーザのパスコード
  10. #const USER_PASSCODE_OFFSET (USER_ID_OFFSET + USER_ID_SIZE)
  11. #const USER_PASSCODE_SIZE 16
  12. ; ユーザの引継ぎコード
  13. #const USER_INHERITANCE_CODE_OFFSET (USER_PASSCODE_OFFSET + USER_PASSCODE_SIZE)
  14. #const USER_INHERITANCE_CODE_SIZE 16
  15. #deffunc local \
  16. Load
  17. id@User = 0
  18. SDim pass@User, USER_PASSCODE_SIZE
  19. SDim inheritanceCode@User, USER_INHERITANCE_CODE_SIZE
  20. Exist FILE_NAME
  21. If strSize < 0 {
  22. Save
  23. Return
  24. }
  25. BLoad FILE_NAME, id@User, USER_ID_SIZE, USER_ID_OFFSET
  26. BLoad FILE_NAME, pass@User, USER_PASSCODE_SIZE, USER_PASSCODE_OFFSET
  27. BLoad FILE_NAME, inheritanceCode@User, USER_INHERITANCE_CODE_SIZE, USER_INHERITANCE_CODE_OFFSET
  28. Return
  29. #deffunc local \
  30. Save \
  31. local l_dummy
  32. Exist FILE_NAME
  33. If strSize < 0 {
  34. l_dummy = ""
  35. BSave FILE_NAME, l_dummy, 0
  36. }
  37. BSave FILE_NAME, id@User, USER_ID_SIZE, USER_ID_OFFSET
  38. BSave FILE_NAME, pass@User, USER_PASSCODE_SIZE, USER_PASSCODE_OFFSET
  39. BSave FILE_NAME, inheritanceCode@User, USER_INHERITANCE_CODE_SIZE, USER_INHERITANCE_CODE_OFFSET
  40. Load
  41. Return
  42. #global
  43. #endif ; not __SETTING__