Changeset 49 in Thomson for tools/gfx2mo5/libraw2mo5.c
- Timestamp:
- 17/03/2014 10:51:11 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tools/gfx2mo5/libraw2mo5.c
r41 r49 7 7 8 8 #include <stdbool.h> 9 #include <stdint.h> 9 10 #include <stdio.h> 10 11 #include <stdlib.h> 11 12 #include <string.h> 12 13 13 unsigned char *raw2mo5(unsigned char *input, int height, int fixup )14 unsigned char *raw2mo5(unsigned char *input, int height, int fixup, bool to) 14 15 { 15 16 unsigned char *tmpBuffer; 16 17 int x,y; 17 18 int previous = 0; 19 bool lfo = false; 20 uint8_t val; 18 21 19 22 tmpBuffer = (unsigned char*)calloc(0x4000,1); … … 25 28 #define width 320 26 29 27 bool lfo = false;28 30 for (y = 0; y < height; y++) 29 31 for (x = 0; x < 320; x+=8) { … … 71 73 // are both FORME or both FOND, else we get an ugly glitch on the 72 74 // EFGJ033 Gate Array MO5! 73 if(fixup > 0 && oldlfo == !(tmpBuffer[(y*320+x)/8] & 0x80)) 75 val = tmpBuffer[(y*320+x)/8]; 76 if(fixup > 0 && ((oldlfo == !(val & 0x80) && val != 0) || val == 0xFF)) 74 77 { 75 previous = (previous >> 4)| (previous << 4);78 previous = 7 | (previous << 4); 76 79 tmpBuffer[(y*320+x)/8] ^= 0xFF; 77 80 78 81 lfo = !lfo; 82 } 83 84 // TO8 mode 85 if(to) 86 { 87 previous = (previous & 0x7) | ((previous & 0xF0) >> 1) | ((previous & 0x8) << 4); 88 previous ^= 0xC0; 79 89 } 80 90
Note: See TracChangeset
for help on using the changeset viewer.