changeset 39:3ce9d2198193

Grab the actual loading address from data block if PSID header loadAddr value is 0.
author Matti Hamalainen <ccr@tnsp.org>
date Sat, 27 Sep 2014 15:30:25 +0300
parents 810dc2fae474
children eabee1428b0a
files sidinfo.c
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/sidinfo.c	Fri Sep 26 04:57:05 2014 +0300
+++ b/sidinfo.c	Sat Sep 27 15:30:25 2014 +0300
@@ -384,6 +384,9 @@
                 THERR("Error reading song data, unexpectedly small file.\n");
                 goto error;
             }
+            
+            // Grab the actual load address
+            psid->loadAddress = TH_LE16_TO_NATIVE(*(uint16_t *) fileData);
 
             // Strip load address (2 first bytes)
             th_md5_append(&state, &fileData[2], read - 2);