Advertisement
Guest User

Untitled

a guest
Sep 18th, 2018
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. void setPC()
  2. {
  3. data::titleData tmp;
  4. tmp.setExtdata(0xF000000B);
  5. if(fs::openArchive(tmp, ARCHIVE_SHARED_EXTDATA))
  6. {
  7. fs::fsfile playCoin(fs::getSaveArch(), "/gamecoin.dat", FS_OPEN_READ | FS_OPEN_WRITE);
  8.  
  9. int coinAmount = 0;
  10. playCoin.seek(0x4, fs::seek_beg);
  11. coinAmount = playCoin.getByte() | playCoin.getByte() << 8;
  12.  
  13. coinAmount = getInt("Enter a number between 0 and 300", coinAmount, 300);
  14. if(coinAmount != -1)
  15. {
  16. playCoin.seek(-2, fs::seek_cur);
  17. playCoin.putByte(coinAmount);
  18. playCoin.putByte(coinAmount >> 8);
  19. }
  20.  
  21. fs::closeSaveArch();
  22. }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement