/src/jpcsp/HLE/kernel/types/pspUsbGpsSatInfo.java

http://jpcsp.googlecode.com/ · Java · 56 lines · 32 code · 4 blank · 20 comment · 0 complexity · cc640c15d68e1cb614c4b5250ed3c400 MD5 · raw file

  1. /*
  2. This file is part of jpcsp.
  3. Jpcsp is free software: you can redistribute it and/or modify
  4. it under the terms of the GNU General Public License as published by
  5. the Free Software Foundation, either version 3 of the License, or
  6. (at your option) any later version.
  7. Jpcsp is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU General Public License for more details.
  11. You should have received a copy of the GNU General Public License
  12. along with Jpcsp. If not, see <http://www.gnu.org/licenses/>.
  13. */
  14. package jpcsp.HLE.kernel.types;
  15. /*
  16. * GPS Satellite Info Structure for sceUsbGpsGetData().
  17. * Based on MapThis! homebrew v5.2
  18. */
  19. public class pspUsbGpsSatInfo extends pspAbstractMemoryMappedStructure {
  20. public static final int SIZEOF = 8;
  21. public int id;
  22. public int elevation;
  23. public short azimuth;
  24. public int snr; // Signal-to-Noise Ratio
  25. public int good;
  26. public short garbage;
  27. @Override
  28. protected void read() {
  29. id = read8();
  30. elevation = read8();
  31. azimuth = (short) read16();
  32. snr = read8();
  33. good = read8();
  34. garbage = (short) read16();
  35. }
  36. @Override
  37. protected void write() {
  38. write8((byte) id);
  39. write8((byte) elevation);
  40. write16(azimuth);
  41. write8((byte) snr);
  42. write8((byte) good);
  43. write16(garbage);
  44. }
  45. @Override
  46. public int sizeof() {
  47. return SIZEOF;
  48. }
  49. }