Mercurial > hg > forks > multipaint-js
comparison 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 |
comparison
equal
deleted
inserted
replaced
211:6d866e284dd2 | 212:b3579297e04e |
---|---|
231 | 231 |
232 | 232 |
233 // XXX TODO: Make this support other platforms than C64 | 233 // XXX TODO: Make this support other platforms than C64 |
234 boolean mpLoadPalette(String fname) | 234 boolean mpLoadPalette(String fname) |
235 { | 235 { |
236 byte fdata[] = mpLoadbinaryFile(fname); | 236 String ffname = "palettes/"+ g_map[13] +"/"+ fname; |
237 byte fdata[] = mpLoadBinaryFile(ffname); | |
238 | |
237 if (fdata == null || | 239 if (fdata == null || |
238 fdata.length != 772 || | 240 fdata.length != 772 || |
239 fdata[0x301] != byte(0x10) || | 241 fdata[0x301] != 0x10 || |
240 fdata[0x302] != byte(0xff) || | 242 fdata[0x302] != 0xff || |
241 fdata[0x303] != byte(0xff)) | 243 fdata[0x303] != 0xff) |
242 { | 244 { |
245 console.log("Could not load palette file '"+ ffname +"'."); | |
243 return false; | 246 return false; |
244 } | 247 } |
245 | 248 |
246 for (int n = 0; n < 16; n++) | 249 for (int n = 0; n < 16; n++) |
247 { | 250 { |