logo

oasis

Own branch of Oasis Linux (upstream: <https://git.sr.ht/~mcf/oasis/>) git clone https://anongit.hacktivis.me/git/oasis.git

0005-GBA-Memory-Change-type-of-sequence-arrays-to-prevent.patch (1605B)


  1. From 2de8da98e15392b70c468fdb5123b958b10a6187 Mon Sep 17 00:00:00 2001
  2. From: Michael Forney <mforney@mforney.org>
  3. Date: Sat, 7 Nov 2020 14:54:14 -0800
  4. Subject: [PATCH] GBA Memory: Change type of sequence arrays to prevent
  5. overflow
  6. These arrays contain values > 0x7F, which cannot be represented in
  7. int8_t (or char if it is signed). Since they are only used in memcmp,
  8. change their type to uint8_t[].
  9. ---
  10. src/gba/vfame.c | 6 +++---
  11. 1 file changed, 3 insertions(+), 3 deletions(-)
  12. diff --git a/src/gba/vfame.c b/src/gba/vfame.c
  13. index 0ac834cc9..67c0ed1dc 100644
  14. --- a/src/gba/vfame.c
  15. +++ b/src/gba/vfame.c
  16. @@ -29,11 +29,11 @@ static const uint8_t VALUE_REORDERING_GEORGE[4][16] = {
  17. { 5, 2, 1, 6, 7, 0, 3, 4 }
  18. };
  19. -static const int8_t MODE_CHANGE_START_SEQUENCE[5] = { 0x99, 0x02, 0x05, 0x02, 0x03 };
  20. -static const int8_t MODE_CHANGE_END_SEQUENCE[5] = { 0x99, 0x03, 0x62, 0x02, 0x56 };
  21. +static const uint8_t MODE_CHANGE_START_SEQUENCE[5] = { 0x99, 0x02, 0x05, 0x02, 0x03 };
  22. +static const uint8_t MODE_CHANGE_END_SEQUENCE[5] = { 0x99, 0x03, 0x62, 0x02, 0x56 };
  23. // A portion of the initialisation routine that gets copied into RAM - Always seems to be present at 0x15C in VFame game ROM
  24. -static const char INIT_SEQUENCE[16] = { 0xB4, 0x00, 0x9F, 0xE5, 0x99, 0x10, 0xA0, 0xE3, 0x00, 0x10, 0xC0, 0xE5, 0xAC, 0x00, 0x9F, 0xE5 };
  25. +static const uint8_t INIT_SEQUENCE[16] = { 0xB4, 0x00, 0x9F, 0xE5, 0x99, 0x10, 0xA0, 0xE3, 0x00, 0x10, 0xC0, 0xE5, 0xAC, 0x00, 0x9F, 0xE5 };
  26. static bool _isInMirroredArea(uint32_t address, size_t romSize);
  27. static uint32_t _getPatternValue(uint32_t addr);
  28. --
  29. 2.29.2