images.h 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. /* Hey EMACS -*- linux-c -*- */
  2. /* $Id: images.h 2268 2006-11-06 17:18:51Z roms $ */
  3. /* TiEmu - Tiemu Is an EMUlator
  4. *
  5. * Copyright (c) 2000-2001, Thomas Corvazier, Romain Lievin
  6. * Copyright (c) 2001-2003, Romain Lievin
  7. * Copyright (c) 2003, Julien Blache
  8. * Copyright (c) 2004, Romain Liévin
  9. * Copyright (c) 2005, Romain Liévin
  10. *
  11. * This program is free software; you can redistribute it and/or modify
  12. * it under the terms of the GNU General Public License as published by
  13. * the Free Software Foundation; either version 2 of the License, or
  14. * (at your option) any later version.
  15. *
  16. * This program is distributed in the hope that it will be useful,
  17. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  18. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  19. * GNU General Public License for more details.
  20. *
  21. * You should have received a copy of the GNU General Public License
  22. * along with this program; if not, write to the Free Software
  23. * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
  24. */
  25. #ifndef __TI68K_IMAGES__
  26. #define __TI68K_IMAGES__
  27. #include <stdint.h>
  28. /*
  29. Definitions
  30. */
  31. #define IMG_SIGN "TiEmu img v2.00"
  32. #define IMG_REV 2 // increase this number when changing the structure below
  33. // Please update the docs/TiEmu_img_format.txt documentation when making changes
  34. // on the structure below
  35. // dc = don't care for rom/tib
  36. typedef struct
  37. {
  38. char signature[16]; // "TiEmu img v2.00" (dc)
  39. long revision; // structure revision (compatibility)
  40. long header_size; // size of this structure and offset to pure data (dc)
  41. char calc_type; // calculator type
  42. char version[5]; // firmware revision
  43. char flash; // EPROM or FLASH
  44. char has_boot; // FLASH upgrade does not have boot
  45. long size; // size of pure data
  46. char hw_type; // hw1 or hw2
  47. uint8_t rom_base; // ROM base address (MSB)
  48. char fill[0x40-42]; // round up struct to 0x40 bytes
  49. char* data; // pure data (temporary use, 8 bytes)
  50. } IMG_INFO;
  51. /*
  52. Functions
  53. */
  54. int ti68k_is_a_rom_file(const char *filename);
  55. int ti68k_is_a_tib_file(const char *filename);
  56. int ti68k_is_a_img_file(const char *filename);
  57. int ti68k_get_rom_infos(const char *filename, IMG_INFO *rom, int preload);
  58. int ti68k_get_tib_infos(const char *filename, IMG_INFO *tib, int preload);
  59. int ti68k_get_img_infos(const char *filename, IMG_INFO *img);
  60. int ti68k_convert_tib_to_image(IMG_INFO *src, unsigned char *dst);
  61. int ti68k_load_image(const char *filename, IMG_INFO *img);
  62. #endif