diff files.pde @ 212:b3579297e04e

Implement rest of the stuff needed for selecting external palettes in the launcher and actual Multipaint code.
author Matti Hamalainen <ccr@tnsp.org>
date Mon, 03 Sep 2018 14:22:20 +0300
parents 13aed87e472a
children d3eba28c26e5
line wrap: on
line diff
--- a/files.pde	Wed Aug 29 20:27:00 2018 +0300
+++ b/files.pde	Mon Sep 03 14:22:20 2018 +0300
@@ -233,13 +233,16 @@
 // XXX TODO: Make this support other platforms than C64
 boolean mpLoadPalette(String fname)
 {
-    byte fdata[] = mpLoadbinaryFile(fname);
+    String ffname = "palettes/"+ g_map[13] +"/"+ fname;
+    byte fdata[] = mpLoadBinaryFile(ffname);
+
     if (fdata == null ||
         fdata.length != 772 ||
-        fdata[0x301] != byte(0x10) ||
-        fdata[0x302] != byte(0xff) ||
-        fdata[0x303] != byte(0xff))
+        fdata[0x301] != 0x10 ||
+        fdata[0x302] != 0xff ||
+        fdata[0x303] != 0xff)
     {
+        console.log("Could not load palette file '"+ ffname +"'.");
         return false;
     }