tios.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /* tios.h: Definitions for TIOS files (including host-wrapped)
  2. Copyright (C) 2002-2003 Sebastian Reichelt
  3. This program 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 2, or (at your option)
  6. any later version.
  7. This program 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 this program; if not, write to the Free Software Foundation,
  13. Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
  14. #ifndef TIOS_H
  15. #define TIOS_H
  16. #include "../generic.h"
  17. #include "../integers.h"
  18. // *** Constants ***
  19. #define MAX_TIOS_FILE_SIZE 0xFFEA
  20. #define TIOS_TAG_STR 0x2D
  21. #define TIOS_TAG_PRGM 0xDC
  22. #define TIOS_TAG_ASM 0xF3
  23. #define TIOS_TAG_OTH 0xF8
  24. #define TIOS_LINK_TYPE_STR 0x0C
  25. #define TIOS_LINK_TYPE_PRGM 0x12
  26. #define TIOS_LINK_TYPE_ASM 0x21
  27. #define TIOS_LINK_TYPE_OTH 0x1C
  28. // *** File Mapping Definitions ***
  29. typedef struct ATTRIBUTE_PACKED {
  30. char Signature[8]; // "**TI92**", "**TI89**", or "**TI92P*".
  31. I1 Reserved1[2]; // 01 00
  32. char FolderName[8]; // Folder name.
  33. char Desc[40]; // Not used.
  34. I1 Reserved2[6]; // 01 00 52 00 00 00
  35. char VarName[8]; // Variable name.
  36. HI1 LinkType; // Variable link type (see above).
  37. I1 Reserved3[3]; // 00 00 00
  38. HI4 FileSize; // File size from Signature to CheckSum.
  39. I1 Reserved4[6]; // A5 5A 00 00 00 00
  40. } TIOS_HOST_FILE_HEADER;
  41. typedef struct ATTRIBUTE_PACKED {
  42. HI2 CheckSum; // Checksum from DataSize to Tag.
  43. } TIOS_HOST_FILE_FOOTER;
  44. #endif