Mercurial > hg > forks > multipaint-js
annotate exporters.pde @ 84:025efefd1704
Rename few functions and a variable.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Thu, 05 Jul 2018 23:43:28 +0300 |
parents | 7ee5e0c590bd |
children | db97aef4e159 |
rev | line source |
---|---|
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1 // machine definitions |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
2 // source writer and other export/import functions |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
3 // the machine_export() makes use of bitmapexport() and colorexport() below |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
4 // remember hexdump -C ! |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
5 |
50 | 6 String g_formatname, g_formatext; |
84
025efefd1704
Rename few functions and a variable.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
7 int g_dataoffs; |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
8 int[] g_grids = new int[16]; |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
9 int OLD = 0; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
10 int NEW = 1; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
11 int g_gridmode = OLD; |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
12 |
49 | 13 |
84
025efefd1704
Rename few functions and a variable.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
14 void mpSetByte(int moffs, int toffs) |
025efefd1704
Rename few functions and a variable.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
15 { |
025efefd1704
Rename few functions and a variable.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
16 g_map[moffs ] = byte((g_template[toffs] & 128) >> 7); |
025efefd1704
Rename few functions and a variable.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
17 g_map[moffs + 1] = byte((g_template[toffs] & 64) >> 6); |
025efefd1704
Rename few functions and a variable.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
18 g_map[moffs + 2] = byte((g_template[toffs] & 32) >> 5); |
025efefd1704
Rename few functions and a variable.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
19 g_map[moffs + 3] = byte((g_template[toffs] & 16) >> 4); |
025efefd1704
Rename few functions and a variable.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
20 g_map[moffs + 4] = byte((g_template[toffs] & 8) >> 3); |
025efefd1704
Rename few functions and a variable.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
21 g_map[moffs + 5] = byte((g_template[toffs] & 4) >> 2); |
025efefd1704
Rename few functions and a variable.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
22 g_map[moffs + 6] = byte((g_template[toffs] & 2) >> 1); |
025efefd1704
Rename few functions and a variable.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
23 g_map[moffs + 7] = byte( g_template[toffs] & 1); |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
24 } |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
25 |
29
249c4f5742f3
Refactor the import/export stuff a bit and the GUI bits for JS.
Matti Hamalainen <ccr@tnsp.org>
parents:
14
diff
changeset
|
26 |
84
025efefd1704
Rename few functions and a variable.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
27 void mpSetDataOffs(int offs) |
025efefd1704
Rename few functions and a variable.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
28 { |
025efefd1704
Rename few functions and a variable.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
29 g_dataoffs = offs; |
025efefd1704
Rename few functions and a variable.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
30 } |
025efefd1704
Rename few functions and a variable.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
31 |
025efefd1704
Rename few functions and a variable.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
32 |
025efefd1704
Rename few functions and a variable.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
33 void mpWriteByte(int bb) |
025efefd1704
Rename few functions and a variable.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
34 { |
025efefd1704
Rename few functions and a variable.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
35 g_template[g_dataoffs++] = byte(bb); |
025efefd1704
Rename few functions and a variable.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
36 } |
025efefd1704
Rename few functions and a variable.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
37 |
025efefd1704
Rename few functions and a variable.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
38 |
025efefd1704
Rename few functions and a variable.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
39 void mpLoadTemplate(String fname) |
025efefd1704
Rename few functions and a variable.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
40 { |
025efefd1704
Rename few functions and a variable.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
41 g_template = mpLoadBinaryFile("templates/" + fname); |
025efefd1704
Rename few functions and a variable.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
42 } |
025efefd1704
Rename few functions and a variable.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
43 |
025efefd1704
Rename few functions and a variable.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
44 |
025efefd1704
Rename few functions and a variable.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
45 bool mpImportFormat(byte[] fdata) |
025efefd1704
Rename few functions and a variable.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
46 { |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
47 int x, y, x2, y2, y3, head, xx, yy, yp, ad, valu; |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
48 int p1, p2, p3; |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
49 head = 0; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
50 |
29
249c4f5742f3
Refactor the import/export stuff a bit and the GUI bits for JS.
Matti Hamalainen <ccr@tnsp.org>
parents:
14
diff
changeset
|
51 g_template = fhd; |
249c4f5742f3
Refactor the import/export stuff a bit and the GUI bits for JS.
Matti Hamalainen <ccr@tnsp.org>
parents:
14
diff
changeset
|
52 |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
53 if (machine == SPECTRUM) //SCR=SCREEN$ |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
54 { |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
55 // 32*24*8 bytes of bitmap |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
56 // 32*24 bytes of attributes |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
57 if (g_template.length < 6912) { |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
58 message("FALSE"); |
49 | 59 return false; |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
60 } |
49 | 61 for (y = 0; y < 3; y++) |
62 for (y2 = 0; y2 < 8; y2++) | |
63 for (yy = 0; yy < 8; yy++) | |
64 for (x = 0; x < 32; x++) | |
65 { | |
66 yp = y * 64 + yy * 8 + y2; | |
67 ad = 1024 + yp * 256 + x * 8; | |
84
025efefd1704
Rename few functions and a variable.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
68 mpSetByte(ad, head); |
49 | 69 head++; |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
70 } |
49 | 71 |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
72 for (y = 0; y <= 23; y++) { |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
73 for (x = 0; x <= 31; x++) { |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
74 ad = 65536 + x + y * (32 * 8); |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
75 valu = g_template[head]; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
76 int ink = valu & 7; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
77 int pap = valu & 56; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
78 pap = pap >> 3; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
79 int bri = valu & 64; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
80 bri = bri >> 6; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
81 ink = ink + bri * 8; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
82 pap = pap + bri * 8; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
83 if (pap == 8) { |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
84 pap = 0; |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
85 } |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
86 for (y2 = 0; y2 <= 7; y2++) { |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
87 g_map[ad + y2 * 32] = byte(ink); |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
88 g_map[ad + y2 * 32 + MX * MY * 8] = byte(pap); |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
89 } |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
90 head++; |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
91 } |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
92 } |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
93 } |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
94 |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
95 if (machine == C64) { |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
96 //0x0002->bitmap |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
97 //0x1f42->colormap |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
98 //0x232a=border (take the lower nybble) |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
99 if (g_template.length < 9006) { |
29
249c4f5742f3
Refactor the import/export stuff a bit and the GUI bits for JS.
Matti Hamalainen <ccr@tnsp.org>
parents:
14
diff
changeset
|
100 message("FALSE "+ str(g_template.length)); |
49 | 101 return false; |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
102 } |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
103 if (g_template.length >= 0x232a) { |
5
a2d09299dce5
Regreplace s/ & 15/ & 0x0f/g; s/ & 240/ & 0xf0/g
Matti Hamalainen <ccr@tnsp.org>
parents:
2
diff
changeset
|
104 g_map[0] = byte(g_template[0x232a] & 0x0f); |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
105 } |
49 | 106 for (y = 0; y < 25; y++) |
107 for (x = 0; x < 40; x++) | |
108 for (y2 = 0; y2 <= 7; y2++) | |
109 { | |
110 head = 2 + x * 8 + y * (40 * 8) + y2; | |
111 ad = 1024 + x * 8 + y * (320 * 8) + y2 * 320; | |
84
025efefd1704
Rename few functions and a variable.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
112 mpSetByte(ad, head); |
49 | 113 p1 = g_template[0x1f42 + x + y * 40] & 0x0f; |
114 p2 = g_template[0x1f42 + x + y * 40] & 0xf0; | |
115 p2 = p2 >> 4; | |
116 g_map[65536 + x + y * 40 * 8 + y2 * 40] = byte(p2); | |
117 g_map[65536 + MX * MY * 8 + x + y * 40 * 8 + y2 * 40] = byte(p1); | |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
118 } |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
119 } |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
120 |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
121 if (machine == PLUS4) { // Botticelli |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
122 //g.hires.prg = botticelli |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
123 //2 - luminance 40*25 |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
124 //1026 - colors 40*25 |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
125 //2050 - bitmappi 40*25*8 |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
126 if (g_template.length < 10050) { |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
127 message("FALSE"); |
49 | 128 return false; |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
129 } |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
130 int l1, l2; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
131 for (y = 0; y < 25; y++) { |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
132 for (x = 0; x < 40; x++) { |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
133 for (y2 = 0; y2 <= 7; y2++) { |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
134 head = 2050 + x * 8 + y * (40 * 8) + y2; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
135 ad = 1024 + x * 8 + y * (320 * 8) + y2 * 320; |
84
025efefd1704
Rename few functions and a variable.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
136 mpSetByte(ad, head); |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
137 |
5
a2d09299dce5
Regreplace s/ & 15/ & 0x0f/g; s/ & 240/ & 0xf0/g
Matti Hamalainen <ccr@tnsp.org>
parents:
2
diff
changeset
|
138 p1 = g_template[1026 + x + y * 40] & 0x0f; |
a2d09299dce5
Regreplace s/ & 15/ & 0x0f/g; s/ & 240/ & 0xf0/g
Matti Hamalainen <ccr@tnsp.org>
parents:
2
diff
changeset
|
139 p2 = g_template[1026 + x + y * 40] & 0xf0; |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
140 p2 = p2 >> 4; |
5
a2d09299dce5
Regreplace s/ & 15/ & 0x0f/g; s/ & 240/ & 0xf0/g
Matti Hamalainen <ccr@tnsp.org>
parents:
2
diff
changeset
|
141 l1 = g_template[2 + x + y * 40] & 0x0f; |
a2d09299dce5
Regreplace s/ & 15/ & 0x0f/g; s/ & 240/ & 0xf0/g
Matti Hamalainen <ccr@tnsp.org>
parents:
2
diff
changeset
|
142 l2 = g_template[2 + x + y * 40] & 0xf0; |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
143 l2 = l2 >> 4; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
144 g_map[65536 + x + y * 40 * 8 + y2 * 40] = byte(convertlumi(l1, p2)); |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
145 g_map[65536 + MX * MY * 8 + x + y * 40 * 8 + y2 * 40] = byte(convertlumi(l2, p1)); |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
146 } |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
147 } |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
148 } |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
149 |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
150 } |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
151 |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
152 if (machine == PLUS4M) { // Multi Botticelli |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
153 //m.multi.prg = multi botticelli |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
154 //2- lumins 40*25 |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
155 //1024 - bäkki1 |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
156 //1025 - bäkki2 |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
157 //1026 - colors 40*25 |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
158 //2050 - bitmap 40*25*8 |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
159 if (g_template.length < 10050) { |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
160 message("FALSE"); |
49 | 161 return false; |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
162 } |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
163 int l1, l2; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
164 for (y = 0; y < 25; y++) { |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
165 for (x = 0; x < 40; x++) { |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
166 for (y2 = 0; y2 <= 7; y2++) { |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
167 head = 2050 + x * 8 + y * (40 * 8) + y2; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
168 ad = 1024 + x * 8 + y * (320 * 8) + y2 * 320; |
84
025efefd1704
Rename few functions and a variable.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
169 mpSetByte(ad, head); |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
170 |
5
a2d09299dce5
Regreplace s/ & 15/ & 0x0f/g; s/ & 240/ & 0xf0/g
Matti Hamalainen <ccr@tnsp.org>
parents:
2
diff
changeset
|
171 p1 = g_template[1026 + x + y * 40] & 0x0f; |
a2d09299dce5
Regreplace s/ & 15/ & 0x0f/g; s/ & 240/ & 0xf0/g
Matti Hamalainen <ccr@tnsp.org>
parents:
2
diff
changeset
|
172 p2 = g_template[1026 + x + y * 40] & 0xf0; |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
173 p2 = p2 >> 4; |
5
a2d09299dce5
Regreplace s/ & 15/ & 0x0f/g; s/ & 240/ & 0xf0/g
Matti Hamalainen <ccr@tnsp.org>
parents:
2
diff
changeset
|
174 l1 = g_template[2 + x + y * 40] & 0x0f; |
a2d09299dce5
Regreplace s/ & 15/ & 0x0f/g; s/ & 240/ & 0xf0/g
Matti Hamalainen <ccr@tnsp.org>
parents:
2
diff
changeset
|
175 l2 = g_template[2 + x + y * 40] & 0xf0; |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
176 l2 = l2 >> 4; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
177 g_map[65536 + x + y * 40 + 1000] = byte(convertlumi(l1, p2)); |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
178 g_map[65536 + x + y * 40 + 0000] = byte(convertlumi(l2, p1)); |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
179 } |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
180 } |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
181 } |
5
a2d09299dce5
Regreplace s/ & 15/ & 0x0f/g; s/ & 240/ & 0xf0/g
Matti Hamalainen <ccr@tnsp.org>
parents:
2
diff
changeset
|
182 p1 = int(g_template[1025]) & 0xf0; |
a2d09299dce5
Regreplace s/ & 15/ & 0x0f/g; s/ & 240/ & 0xf0/g
Matti Hamalainen <ccr@tnsp.org>
parents:
2
diff
changeset
|
183 l1 = int(g_template[1025]) & 0x0f; |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
184 p1 = p1 >> 4; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
185 g_map[1] = byte(convertlumi(l1, p1)); |
5
a2d09299dce5
Regreplace s/ & 15/ & 0x0f/g; s/ & 240/ & 0xf0/g
Matti Hamalainen <ccr@tnsp.org>
parents:
2
diff
changeset
|
186 p1 = int(g_template[1024]) & 0xf0; |
a2d09299dce5
Regreplace s/ & 15/ & 0x0f/g; s/ & 240/ & 0xf0/g
Matti Hamalainen <ccr@tnsp.org>
parents:
2
diff
changeset
|
187 l1 = int(g_template[1024]) & 0x0f; |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
188 p1 = p1 >> 4; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
189 g_map[2] = byte(convertlumi(l1, p1)); |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
190 } |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
191 |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
192 if (machine == C64M) { //advanced art studio |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
193 //adv. art studio (=multicolor) 10018 bytes |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
194 //0x0002 bitmap (40*25*8) |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
195 //0x1f42 colors1 (40*25) |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
196 //0x232a border |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
197 //0x232b background |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
198 //0x233a colors2 (40*25) |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
199 if (g_template.length < 10018) { |
29
249c4f5742f3
Refactor the import/export stuff a bit and the GUI bits for JS.
Matti Hamalainen <ccr@tnsp.org>
parents:
14
diff
changeset
|
200 message("FALSE "+ str(g_template.length)); |
49 | 201 return false; |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
202 } |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
203 for (y = 0; y < 25; y++) { |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
204 for (x = 0; x < 40; x++) { |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
205 for (y2 = 0; y2 < 8; y2++) { |
8 | 206 ad = 1024 + x * 8 + y * (320 * 8) + y2 * 320; |
207 | |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
208 head = 2 + x * 8 + y * (40 * 8) + y2; |
84
025efefd1704
Rename few functions and a variable.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
209 mpSetByte(ad, head); |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
210 |
5
a2d09299dce5
Regreplace s/ & 15/ & 0x0f/g; s/ & 240/ & 0xf0/g
Matti Hamalainen <ccr@tnsp.org>
parents:
2
diff
changeset
|
211 p1 = g_template[0x1f42 + x + y * 40] & 0x0f; |
8 | 212 p2 = (g_template[0x1f42 + x + y * 40] >> 4) & 0x0f; |
5
a2d09299dce5
Regreplace s/ & 15/ & 0x0f/g; s/ & 240/ & 0xf0/g
Matti Hamalainen <ccr@tnsp.org>
parents:
2
diff
changeset
|
213 p3 = g_template[0x233a + x + y * 40] & 0x0f; |
11 | 214 |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
215 g_map[65536 + x + y * 40] = byte(p1); |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
216 g_map[65536 + x + y * 40 + 1000] = byte(p2); |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
217 g_map[65536 + x + y * 40 + 2000] = byte(p3); |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
218 } |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
219 } |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
220 } |
11 | 221 g_map[0] = byte(g_template[0x232a] & 0x0f); //bord |
222 g_map[1] = byte(g_template[0x232b] & 0x0f); //baku | |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
223 } |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
224 |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
225 if (machine == MSX) { // sc2 |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
226 // 7=bitmap 32*24*8 |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
227 // 7+(32*24*8)=colormap 32*24 |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
228 if (g_template.length < 14343) { |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
229 message("FALSE"); |
49 | 230 return false; |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
231 } |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
232 for (y = 0; y < 24; y++) { |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
233 for (x = 0; x < 32; x++) { |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
234 for (y2 = 0; y2 <= 7; y2++) { |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
235 head = 7 + x * 8 + y * (32 * 8) + y2; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
236 ad = 1024 + x * 8 + y * (256 * 8) + y2 * 256; |
84
025efefd1704
Rename few functions and a variable.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
237 mpSetByte(ad, head); |
5
a2d09299dce5
Regreplace s/ & 15/ & 0x0f/g; s/ & 240/ & 0xf0/g
Matti Hamalainen <ccr@tnsp.org>
parents:
2
diff
changeset
|
238 p1 = g_template[(8199) + x * 8 + ((y * 8 * 32) + y2)] & 0x0f; |
a2d09299dce5
Regreplace s/ & 15/ & 0x0f/g; s/ & 240/ & 0xf0/g
Matti Hamalainen <ccr@tnsp.org>
parents:
2
diff
changeset
|
239 p2 = g_template[(8199) + x * 8 + ((y * 8 * 32) + y2)] & 0xf0; |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
240 p2 = p2 >> 4; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
241 if (p1 == 0) { |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
242 p1 = 1; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
243 } |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
244 if (p2 == 0) { |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
245 p2 = 1; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
246 } |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
247 g_map[65536 + x + y * 32 * 8 + y2 * 32] = byte(p2); |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
248 g_map[65536 + MX * MY * 8 + x + y * 32 * 8 + y2 * 32] = byte(p1); |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
249 } |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
250 } |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
251 } |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
252 } |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
253 |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
254 if (machine == CPC) { // a studio? |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
255 message("Not|Working"); |
49 | 256 return false; |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
257 } |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
258 |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
259 consistency(); |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
260 refresh(); |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
261 g_boxreconstruct = 2; |
49 | 262 return true; |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
263 } |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
264 |
49 | 265 |
266 void format_export(String fname) | |
267 { | |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
268 int val1, val2, val3; |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
269 int y, y2, yy, x, yp, xp, ad, valu, valu2, bri; |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
270 |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
271 if (machine == PLUS4) { // botticelli hires |
84
025efefd1704
Rename few functions and a variable.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
272 mpLoadTemplate("g.hires.prg"); |
025efefd1704
Rename few functions and a variable.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
273 mpSetDataOffs(0x02); |
025efefd1704
Rename few functions and a variable.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
274 mpExportColorData(40, 25, 65536, 5); //lumis |
025efefd1704
Rename few functions and a variable.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
275 mpSetDataOffs(1026); |
025efefd1704
Rename few functions and a variable.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
276 mpExportColorData(40, 25, 65536, 4); //colors |
025efefd1704
Rename few functions and a variable.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
277 mpSetDataOffs(2050); |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
278 bitmapexport(40, 25); |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
279 export_program(fname); |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
280 } |
49 | 281 else |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
282 if (machine == PLUS4M) { // multi botticelli multicolor |
84
025efefd1704
Rename few functions and a variable.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
283 mpLoadTemplate("m.multi.prg"); |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
284 val2 = getpluscolor(int(g_map[1])); |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
285 val1 = getplusluminance(int(g_map[1])); |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
286 val3 = val2 * 16 + val1; |
84
025efefd1704
Rename few functions and a variable.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
287 mpSetDataOffs(1025); |
025efefd1704
Rename few functions and a variable.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
288 mpWriteByte(val3); |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
289 val2 = getpluscolor(int(g_map[2])); |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
290 val1 = getplusluminance(int(g_map[2])); |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
291 val3 = val2 * 16 + val1; |
84
025efefd1704
Rename few functions and a variable.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
292 mpSetDataOffs(1024); |
025efefd1704
Rename few functions and a variable.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
293 mpWriteByte(val3); |
025efefd1704
Rename few functions and a variable.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
294 mpSetDataOffs(1026); |
025efefd1704
Rename few functions and a variable.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
295 mpExportColorData(40, 25, 65536, 6); //colors |
025efefd1704
Rename few functions and a variable.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
296 mpSetDataOffs(2); |
025efefd1704
Rename few functions and a variable.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
297 mpExportColorData(40, 25, 65536, 7); //lumis |
025efefd1704
Rename few functions and a variable.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
298 mpSetDataOffs(2050); |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
299 bitmapexport(40, 25); |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
300 export_program(fname); |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
301 } |
49 | 302 else |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
303 if (machine == C64) { |
84
025efefd1704
Rename few functions and a variable.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
304 mpLoadTemplate("hires.art"); |
025efefd1704
Rename few functions and a variable.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
305 mpSetDataOffs(2); |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
306 bitmapexport(40, 25); |
84
025efefd1704
Rename few functions and a variable.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
307 mpSetDataOffs(0x1f42); |
025efefd1704
Rename few functions and a variable.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
308 mpExportColorData(40, 25, 65536, 0); |
025efefd1704
Rename few functions and a variable.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
309 mpSetDataOffs(0x232a); |
025efefd1704
Rename few functions and a variable.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
310 mpWriteByte(int(g_map[0])); |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
311 export_program(fname); |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
312 } |
49 | 313 else |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
314 if (machine == C64M) { |
49 | 315 if (fname.indexOf(".kla") >= 0) |
316 { | |
317 // Koala Painter | |
84
025efefd1704
Rename few functions and a variable.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
318 mpLoadTemplate("multic.kla"); |
025efefd1704
Rename few functions and a variable.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
319 mpSetDataOffs(2); |
49 | 320 bitmapexport(40, 25); |
84
025efefd1704
Rename few functions and a variable.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
321 mpSetDataOffs(0x1f42); |
025efefd1704
Rename few functions and a variable.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
322 mpExportColorData(40, 25, 65536, 1); |
025efefd1704
Rename few functions and a variable.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
323 mpSetDataOffs(0x232a); |
025efefd1704
Rename few functions and a variable.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
324 mpExportColorData(40, 25, 65536 + 2000, 2); |
025efefd1704
Rename few functions and a variable.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
325 mpSetDataOffs(0x2712); |
025efefd1704
Rename few functions and a variable.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
326 mpWriteByte(int(g_map[1] & 0x0f)); |
49 | 327 } |
328 else | |
329 { | |
330 // Advanced Art Studio | |
84
025efefd1704
Rename few functions and a variable.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
331 mpLoadTemplate("multic.ocp"); |
025efefd1704
Rename few functions and a variable.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
332 mpSetDataOffs(2); |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
333 bitmapexport(40, 25); |
84
025efefd1704
Rename few functions and a variable.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
334 mpSetDataOffs(0x1f42); |
025efefd1704
Rename few functions and a variable.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
335 mpExportColorData(40, 25, 65536, 1); |
025efefd1704
Rename few functions and a variable.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
336 mpSetDataOffs(0x233a); |
025efefd1704
Rename few functions and a variable.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
337 mpExportColorData(40, 25, 65536 + 2000, 2); |
025efefd1704
Rename few functions and a variable.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
338 mpSetDataOffs(0x232a); |
025efefd1704
Rename few functions and a variable.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
339 mpWriteByte(int(g_map[0])); |
025efefd1704
Rename few functions and a variable.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
340 mpSetDataOffs(0x232b); |
025efefd1704
Rename few functions and a variable.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
341 mpWriteByte(int(g_map[1])); |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
342 } |
49 | 343 export_program(fname); |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
344 } |
49 | 345 else |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
346 if (machine == MSX) { |
84
025efefd1704
Rename few functions and a variable.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
347 mpLoadTemplate("msx-screen2.sc2"); |
025efefd1704
Rename few functions and a variable.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
348 mpSetDataOffs(7); |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
349 bitmapexport(32, 24); |
84
025efefd1704
Rename few functions and a variable.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
350 mpSetDataOffs(7 + (32 * 24 * 8) + 768 + 1280); |
025efefd1704
Rename few functions and a variable.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
351 mpExportColorData(32, 24, 65536, 3); //there's an exception for msx-style |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
352 export_program(fname); |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
353 } |
49 | 354 else |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
355 if (machine == SPECTRUM) { |
84
025efefd1704
Rename few functions and a variable.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
356 mpLoadTemplate("zx-screen.scr"); |
025efefd1704
Rename few functions and a variable.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
357 mpSetDataOffs(0); |
49 | 358 for (y = 0; y < 3; y++) |
359 for (y2 = 0; y2 < 8; y2++) | |
360 for (yy = 0; yy < 8; yy++) | |
361 for (x = 0; x < 32; x++) | |
362 { | |
363 yp = y * 64 + yy * 8 + y2; | |
364 ad = 1024 + yp * 256 + x * 8; | |
365 | |
366 valu = g_map[ad + 0] * 128 + | |
367 g_map[ad + 1] * 64 + | |
368 g_map[ad + 2] * 32 + | |
369 g_map[ad + 3] * 16 + | |
370 g_map[ad + 4] * 8 + | |
371 g_map[ad + 5] * 4 + | |
372 g_map[ad + 6] * 2 + | |
373 g_map[ad + 7] * 1; | |
374 | |
84
025efefd1704
Rename few functions and a variable.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
375 mpWriteByte(int(valu)); |
49 | 376 } |
377 | |
378 for (y = 0; y < 24; y++) | |
379 for (x = 0; x <= 31; x++) { | |
380 ad = 65536 + x + y * 256; | |
381 valu = int(g_map[ad]); | |
382 valu2 = int(g_map[ad + MX * MY * 8]); | |
383 bri = 0; | |
384 if (valu >= 8) { | |
385 bri = 1; | |
386 valu = valu - 8; | |
387 valu2 = valu2 - 8; | |
388 if (valu2 <= 0) { | |
389 valu2 = 0; | |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
390 } |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
391 } |
49 | 392 if (bri == 1) { |
393 valu += 64; | |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
394 } |
84
025efefd1704
Rename few functions and a variable.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
395 mpWriteByte(int(valu + valu2 * 8)); |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
396 } |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
397 export_program(fname); |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
398 } |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
399 } |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
400 |
49 | 401 |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
402 void machine_export(String fname, int sorsa) { |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
403 int yy, xx, x, y2, y, checksum; |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
404 int xp, yp; |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
405 int valu, valu2; |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
406 int val1, val2, val3; |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
407 int ad, by; |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
408 int bri, skyp; |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
409 g_sorsaa = sorsa; //aargh another global |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
410 |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
411 if (sorsa == 1) { |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
412 exwriter = createWriter(fname); |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
413 } |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
414 |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
415 // any common text headers |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
416 by = 0; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
417 skyp = 0; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
418 outputter(";machine=" + str(machine) + " (" + g_name + ")", true); |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
419 |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
420 if (machine == C64) { //C64 HIRES |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
421 |
84
025efefd1704
Rename few functions and a variable.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
422 mpLoadTemplate("c64show.prg"); |
025efefd1704
Rename few functions and a variable.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
423 mpSetDataOffs(0X0227); |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
424 bitmapexport(40, 25); |
84
025efefd1704
Rename few functions and a variable.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
425 mpSetDataOffs(0X2167); |
025efefd1704
Rename few functions and a variable.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
426 mpWriteByte(g_map[0]); //=border |
025efefd1704
Rename few functions and a variable.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
427 mpSetDataOffs(0X2168); |
025efefd1704
Rename few functions and a variable.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
428 mpWriteByte(g_map[1]); //=background mutta ei tarvita |
025efefd1704
Rename few functions and a variable.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
429 mpSetDataOffs(0X2169); |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
430 outputter("; The following two first values are border and background", true); |
84
025efefd1704
Rename few functions and a variable.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
431 mpExportColorData(40, 25, 65536, 0); |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
432 export_program(fname); |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
433 |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
434 //c64show.prg |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
435 //offsets |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
436 //0x0227->bitmappi (40x25 x 8 bytee) |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
437 //0x2167:borderi väri |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
438 //0x2169->värikartta (40x25 bytee, nyppelit foreg/backg) |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
439 } |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
440 |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
441 if (machine == C64M) { //C64 MULTICOLOR |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
442 |
84
025efefd1704
Rename few functions and a variable.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
443 mpLoadTemplate("c64mshow.prg"); |
025efefd1704
Rename few functions and a variable.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
444 mpSetDataOffs(0x0239); |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
445 bitmapexport(40, 25); |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
446 |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
447 // first color information |
84
025efefd1704
Rename few functions and a variable.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
448 mpSetDataOffs(0x2179); |
025efefd1704
Rename few functions and a variable.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
449 mpWriteByte(g_map[0]); |
025efefd1704
Rename few functions and a variable.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
450 mpSetDataOffs(0x217A); |
025efefd1704
Rename few functions and a variable.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
451 mpWriteByte(g_map[1]); |
025efefd1704
Rename few functions and a variable.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
452 mpSetDataOffs(0x217B); |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
453 outputter("; The following two first values are border and background", true); |
84
025efefd1704
Rename few functions and a variable.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
454 mpExportColorData(40, 25, 65536, 1); |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
455 |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
456 // second color information |
84
025efefd1704
Rename few functions and a variable.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
457 mpSetDataOffs(0x2563); |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
458 outputter("; The following goes to $D800 onwards", true); |
84
025efefd1704
Rename few functions and a variable.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
459 mpExportColorData(40, 25, 65536 + 2000, 2); |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
460 export_program(fname); |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
461 |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
462 //c64 multicolor |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
463 //offsets |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
464 //0x0239->bitmappi (40x25 x 8 bytee) |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
465 //0x2179:borderi väri |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
466 //0x217A:bäkkis väri |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
467 //0x217B->värikartta 1 (40x25 bytee, nyppelit foreg/backg ilmeisesti) |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
468 //0x2563->värikartta 2 (40x25 bytee, nyppeli 3-väri nepan osoitteessa $d800-) |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
469 } |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
470 |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
471 if (machine == PLUS4M) { //PLUS4 MULTICOLOR |
84
025efefd1704
Rename few functions and a variable.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
472 mpLoadTemplate("showpfourm.prg"); |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
473 outputter(" .global _bitmap", true); |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
474 outputter(" .global _color1", true); |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
475 outputter(" .global _color2", true); |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
476 outputter(" .global _border", true); |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
477 outputter(" .global _back1", true); |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
478 outputter(" .global _back2", true); |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
479 outputter("_bitmap:", true); |
84
025efefd1704
Rename few functions and a variable.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
480 mpSetDataOffs(0x013e); |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
481 bitmapexport(40, 25); |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
482 outputter("_border:", true); |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
483 val1 = getpluscolor(int(g_map[0])); |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
484 val2 = getplusluminance(int(g_map[0])); |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
485 val3 = val2 * 16 + val1; |
84
025efefd1704
Rename few functions and a variable.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
486 mpSetDataOffs(0x207e); |
025efefd1704
Rename few functions and a variable.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
487 mpWriteByte(val3); |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
488 outputter(" .byte " + val3, true); |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
489 outputter("_back1:", true); |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
490 val1 = getpluscolor(int(g_map[1])); |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
491 val2 = getplusluminance(int(g_map[1])); |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
492 val3 = val2 * 16 + val1; |
84
025efefd1704
Rename few functions and a variable.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
493 mpSetDataOffs(0x207f); |
025efefd1704
Rename few functions and a variable.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
494 mpWriteByte(val3); |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
495 outputter(" .byte " + val3, true); |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
496 outputter("_back2:", true); |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
497 val1 = getpluscolor(int(g_map[2])); |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
498 val2 = getplusluminance(int(g_map[2])); |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
499 val3 = val2 * 16 + val1; |
84
025efefd1704
Rename few functions and a variable.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
500 mpSetDataOffs(0x2080); |
025efefd1704
Rename few functions and a variable.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
501 mpWriteByte(val3); |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
502 outputter(" .byte " + val3, true); |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
503 outputter("_color1:", true); |
84
025efefd1704
Rename few functions and a variable.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
504 mpSetDataOffs(0x2081); |
025efefd1704
Rename few functions and a variable.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
505 mpExportColorData(40, 25, 65536, 6); |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
506 outputter("_color2:", true); |
84
025efefd1704
Rename few functions and a variable.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
507 mpSetDataOffs(0x2469); |
025efefd1704
Rename few functions and a variable.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
508 mpExportColorData(40, 25, 65536, 7); |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
509 export_program(fname); |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
510 //plus4 multic |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
511 //0x013e bitmap (40 x 25 x 8) |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
512 //0x207e border |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
513 //0x207f background 1 |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
514 //0x2080 background 2 |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
515 //0x2081 colors (40 x 25) |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
516 //0x2469 luminance (40 x 25) |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
517 } |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
518 |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
519 if (machine == PLUS4) { // Plus 4 hires |
84
025efefd1704
Rename few functions and a variable.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
520 mpLoadTemplate("showpfour.prg"); |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
521 outputter(" .global _bitmap", true); |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
522 outputter(" .global _color", true); |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
523 outputter(" .global _lumi", true); |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
524 outputter(" .global _border", true); |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
525 outputter("_bitmap:", true); |
84
025efefd1704
Rename few functions and a variable.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
526 mpSetDataOffs(0x0137); |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
527 bitmapexport(40, 25); |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
528 val1 = getpluscolor(int(g_map[0])); |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
529 val2 = getplusluminance(int(g_map[0])); |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
530 val3 = val2 * 16 + val1; |
84
025efefd1704
Rename few functions and a variable.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
531 mpSetDataOffs(0x2077); |
025efefd1704
Rename few functions and a variable.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
532 mpWriteByte(val3); //border |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
533 |
84
025efefd1704
Rename few functions and a variable.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
534 mpSetDataOffs(0x2078); |
025efefd1704
Rename few functions and a variable.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
535 mpExportColorData(40, 25, 65536, 4); //colors |
025efefd1704
Rename few functions and a variable.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
536 mpSetDataOffs(0x2460); |
025efefd1704
Rename few functions and a variable.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
537 mpExportColorData(40, 25, 65536, 5); //lumis |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
538 export_program(fname); |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
539 //plus4 hires |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
540 //0x0137 bitmap (40 x 25 x 8) |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
541 //0x2077 borderi |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
542 //0x2078 colors (40 x 25) |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
543 //0x2460 luminance (40 x 25) |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
544 } |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
545 |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
546 if (machine == MSX) { // MSX |
84
025efefd1704
Rename few functions and a variable.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
547 mpLoadTemplate("msxshow.com"); |
025efefd1704
Rename few functions and a variable.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
548 mpSetDataOffs(0x00f9); |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
549 outputter(char(9) + ".globl _nimi1,_nimi2", true); |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
550 outputter(char(9) + ".area _CODE", true); |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
551 outputter("_nimi1:", true); |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
552 bitmapexport(32, 24); |
84
025efefd1704
Rename few functions and a variable.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
553 mpSetDataOffs(0x18f9); |
025efefd1704
Rename few functions and a variable.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
554 //mpWriteByte(g_map[1]); //backg |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
555 //outputter("; The first following value is background", true); |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
556 outputter("_nimi2:", true); |
84
025efefd1704
Rename few functions and a variable.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
557 mpExportColorData(32, 24, 65536, 3); //there's an exception for msx-style |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
558 export_program(fname); |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
559 //msx comm |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
560 //0x00f9 bitmap (32x24 x 8 bytes) |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
561 //0x18f9 background color |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
562 //0x18fa colors (32*24 bytes) |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
563 } |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
564 |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
565 if (machine == SPECTRUM) { // ZX Spectrum |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
566 |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
567 //would need some cleaning up |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
568 |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
569 // outputter(" .area _DATA",true); |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
570 // outputter(" .globl _taustakuva",true); |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
571 // outputter("",true); |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
572 // outputter("_taustakuva:",true); |
84
025efefd1704
Rename few functions and a variable.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
573 mpLoadTemplate("specshow.tap"); |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
574 int stad; |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
575 |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
576 checksum = 0xc9; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
577 for (y = 0x1d24; y <= 0x1d3d; y++) { //1d3e |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
578 checksum = checksum ^ int(g_template[y]); |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
579 } |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
580 //TAP requires fiddling with the checksum |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
581 //println("Checksum:"+hex(checksum,2)); |
84
025efefd1704
Rename few functions and a variable.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
582 mpSetDataOffs(0x0223); |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
583 outputter(".byte " + (str(g_map[0])) + " ;border", true); |
84
025efefd1704
Rename few functions and a variable.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
584 mpWriteByte(int(g_map[0])); |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
585 checksum = checksum ^ int(g_map[0]); |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
586 for (y = 0; y <= 2; y++) { |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
587 for (y2 = 0; y2 <= 7; y2++) { |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
588 for (yy = 0; yy <= 7; yy++) { |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
589 |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
590 outputter(".byte ", false); |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
591 for (x = 0; x <= 31; x++) { |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
592 yp = y * 64 + yy * 8 + y2; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
593 xp = x; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
594 ad = 1024 + yp * 256 + x * 8; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
595 valu = g_map[ad + 0] * 128 + g_map[ad + 1] * 64 + g_map[ad + 2] * 32 + g_map[ad + 3] * 16 + g_map[ad + 4] * 8 + g_map[ad + 5] * 4 + g_map[ad + 6] * 2 + g_map[ad + 7] * 1; |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
596 outputter(str(int(valu)), false); |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
597 by++; |
84
025efefd1704
Rename few functions and a variable.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
598 mpWriteByte(int(valu)); |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
599 checksum = checksum ^ int(valu); |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
600 if (x <= 30) { |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
601 outputter(",", false); |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
602 } |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
603 } |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
604 outputter("", true); |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
605 } |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
606 } |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
607 } |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
608 |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
609 outputter("; attributes", true); |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
610 for (y = 0; y <= 23; y++) { |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
611 outputter(".byte ", false); |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
612 for (x = 0; x <= 31; x++) { |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
613 ad = 65536 + x + y * 256; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
614 valu = int(g_map[ad]); |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
615 valu2 = int(g_map[ad + MX * MY * 8]); |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
616 bri = 0; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
617 if (valu >= 8) { |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
618 bri = 1; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
619 valu = valu - 8; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
620 valu2 = valu2 - 8; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
621 if (valu2 <= 0) { |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
622 valu2 = 0; |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
623 } |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
624 } |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
625 if (bri == 1) { |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
626 valu = valu + 64; |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
627 } |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
628 outputter(str(valu + valu2 * 8), false); |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
629 by++; |
84
025efefd1704
Rename few functions and a variable.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
630 mpWriteByte(int(valu + valu2 * 8)); |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
631 checksum = checksum ^ int(valu + valu2 * 8); |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
632 if (x <= 30) { |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
633 outputter(",", false); |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
634 } |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
635 } |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
636 outputter("", true); |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
637 } |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
638 //println("checksum:"+hex(checksum,2)); |
84
025efefd1704
Rename few functions and a variable.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
639 mpSetDataOffs(0x1d3e); |
025efefd1704
Rename few functions and a variable.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
640 mpWriteByte(int(checksum)); |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
641 export_program(fname); |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
642 } |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
643 |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
644 if (machine == CPC) { |
84
025efefd1704
Rename few functions and a variable.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
645 mpLoadTemplate("cpc-mode0.bin"); |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
646 |
84
025efefd1704
Rename few functions and a variable.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
647 mpSetDataOffs(69); //bitmap offset |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
648 bitmapexport_cpc(160, 200); |
84
025efefd1704
Rename few functions and a variable.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
649 mpSetDataOffs(16453); |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
650 outputter(";palette", true); |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
651 outputter(".byte ", false); |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
652 for (int i = 0; i < g_maxcolors; i++) { //fixed # of palette entries, just trying to be generic |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
653 val1 = int(g_g[i] / (256 / g_palsteps)); |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
654 val2 = int(g_r[i] / (256 / g_palsteps)); |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
655 val3 = int(g_b[i] / (256 / g_palsteps)); |
84
025efefd1704
Rename few functions and a variable.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
656 mpWriteByte(val1 * 9 + val2 * 3 + val3); |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
657 outputter(str(val1 * 9 + val2 * 3 + val3), false); |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
658 if (i < g_maxcolors - 1) { |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
659 outputter(",", false); |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
660 } |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
661 } |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
662 outputter("", true); |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
663 outputter(";border", true); |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
664 outputter(".byte ", false); |
84
025efefd1704
Rename few functions and a variable.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
665 mpSetDataOffs(16469); |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
666 valu = int(g_map[0]); |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
667 val1 = int(g_g[valu] / (256 / g_palsteps)); |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
668 val2 = int(g_r[valu] / (256 / g_palsteps)); |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
669 val3 = int(g_b[valu] / (256 / g_palsteps)); |
84
025efefd1704
Rename few functions and a variable.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
670 mpWriteByte(val1 * 9 + val2 * 3 + val3); |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
671 outputter(str(val1 * 9 + val2 * 3 + val3), false); |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
672 //cpc |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
673 //69 bitmap 16384 bytes |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
674 //16453 palette 16 bytes (0..26) |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
675 //16469 border color (0..26) |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
676 export_program(fname); |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
677 } |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
678 |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
679 // any common lead-outs |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
680 |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
681 if (sorsa == 1) { |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
682 exwriter.flush(); |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
683 exwriter.close(); |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
684 } |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
685 } |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
686 |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
687 void bitmapexport_cpc(int xwid, int yy) { |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
688 int x, y, ad, val1, val2, y2; |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
689 int pix0b0, pix0b1, pix0b2, pix0b3; |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
690 int pix1b0, pix1b1, pix1b2, pix1b3; |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
691 int pp; |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
692 pp = 0; |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
693 outputter(";bitmap", true); |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
694 for (y2 = 0; y2 <= 7; y2++) { |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
695 for (y = 0; y < 25; y++) { |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
696 outputter(" .byte ", false); |
7
c848a6133cfc
Fix many calculations (divisions) that assume integer variable division
Matti Hamalainen <ccr@tnsp.org>
parents:
6
diff
changeset
|
697 for (x = 0; x < int(xwid / 2); x++) { |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
698 ad = 1024 + (y * 8) * X + (y2 * X) + x * 4; |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
699 |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
700 val1 = int(g_map[ad]); |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
701 pix0b0 = 0; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
702 pix0b1 = 0; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
703 pix0b2 = 0; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
704 pix0b3 = 0; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
705 if ((val1 & 1) != 0) pix0b0 = 1; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
706 if ((val1 & 2) != 0) pix0b1 = 1; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
707 if ((val1 & 4) != 0) pix0b2 = 1; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
708 if ((val1 & 8) != 0) pix0b3 = 1; |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
709 |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
710 val1 = int(g_map[ad + 2]); |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
711 |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
712 pix1b0 = 0; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
713 pix1b1 = 0; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
714 pix1b2 = 0; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
715 pix1b3 = 0; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
716 if ((val1 & 1) != 0) pix1b0 = 1; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
717 if ((val1 & 2) != 0) pix1b1 = 1; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
718 if ((val1 & 4) != 0) pix1b2 = 1; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
719 if ((val1 & 8) != 0) pix1b3 = 1; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
720 |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
721 val2 = pix1b3 + pix0b3 * 2 + pix1b1 * 4 + pix0b1 * 8 + pix1b2 * 16 + pix0b2 * 32 + pix1b0 * 64 + pix0b0 * 128; |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
722 outputter(str(int(val2)), false); |
84
025efefd1704
Rename few functions and a variable.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
723 mpWriteByte(val2); |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
724 pp++; |
7
c848a6133cfc
Fix many calculations (divisions) that assume integer variable division
Matti Hamalainen <ccr@tnsp.org>
parents:
6
diff
changeset
|
725 if (x < int(xwid / 2) - 1) { |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
726 outputter(",", false); |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
727 } |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
728 } |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
729 outputter("", true); |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
730 } |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
731 outputter(" .byte ", false); |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
732 for (int j = 0; j <= 47; j++) { |
84
025efefd1704
Rename few functions and a variable.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
733 mpWriteByte(0); |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
734 outputter(str(int(0)), false); |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
735 pp++; |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
736 if (j < 47) { |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
737 outputter(",", false); |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
738 } |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
739 } |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
740 outputter("", true); |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
741 } |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
742 outputter("", true); |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
743 } |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
744 |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
745 void bitmapexport(int xx, int yy) { |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
746 int xwid, ywid, x, y, y2, value, ad, linep; |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
747 linep = 0; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
748 xwid = xx * 8; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
749 ywid = yy * 8; |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
750 //outputter("unsigned char img[]={",false); |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
751 |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
752 for (y = 0; y < yy; y++) { |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
753 for (x = 0; x < xx; x++) { |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
754 // outputter(" .byte ", false); |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
755 outputter(char(9) + ".db ", false); |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
756 for (y2 = 0; y2 <= 7; y2++) { |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
757 ad = 1024 + y * (xwid * 8) + (y2 * xwid) + x * 8; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
758 value = g_map[ad + 0] * 128 + g_map[ad + 1] * 64 + g_map[ad + 2] * 32 + g_map[ad + 3] * 16 + g_map[ad + 4] * 8 + g_map[ad + 5] * 4 + g_map[ad + 6] * 2 + g_map[ad + 7] * 1; |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
759 outputter(str(int(value)), false); |
84
025efefd1704
Rename few functions and a variable.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
760 mpWriteByte(int(value)); |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
761 if (y2 <= 6) { |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
762 outputter(",", false); |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
763 } |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
764 } |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
765 outputter("", true); |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
766 linep++; |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
767 if (linep == xx) { |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
768 linep = 0; |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
769 outputter("", true); |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
770 } |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
771 } |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
772 } |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
773 outputter("", true); |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
774 } |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
775 |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
776 int convertlumi(int l, int f) { |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
777 int res = 0; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
778 if (f == 0) return 0; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
779 if (l == 0) res = 0 + f; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
780 if (l == 1) res = 15 + f; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
781 if (l == 2) res = 30 + f; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
782 if (l == 3) res = 45 + f; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
783 if (l == 4) res = 60 + f; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
784 if (l == 5) res = 75 + f; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
785 if (l == 6) res = 90 + f; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
786 if (l == 7) res = 105 + f; |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
787 return res; |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
788 } |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
789 |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
790 int getplusluminance(int c) { |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
791 int res = 0; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
792 if (c == 0) res = 0; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
793 if (c >= 1 && c <= 15) res = 0; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
794 if (c >= 16 && c <= 30) res = 1; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
795 if (c >= 31 && c <= 45) res = 2; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
796 if (c >= 46 && c <= 60) res = 3; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
797 if (c >= 61 && c <= 75) res = 4; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
798 if (c >= 76 && c <= 90) res = 5; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
799 if (c >= 91 && c <= 105) res = 6; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
800 if (c >= 106 && c <= 120) res = 7; |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
801 return res; |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
802 } |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
803 |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
804 int getpluscolor(int c) { |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
805 int res = 0; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
806 if (c == 0) res = 0; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
807 if (c >= 1 && c <= 15) res = c; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
808 if (c >= 16 && c <= 30) res = c - 15; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
809 if (c >= 31 && c <= 45) res = c - 30; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
810 if (c >= 46 && c <= 60) res = c - 45; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
811 if (c >= 61 && c <= 75) res = c - 60; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
812 if (c >= 76 && c <= 90) res = c - 75; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
813 if (c >= 91 && c <= 105) res = c - 90; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
814 if (c >= 106 && c <= 120) res = c - 105; |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
815 return res; |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
816 } |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
817 |
84
025efefd1704
Rename few functions and a variable.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
818 void mpExportColorData(int xx, int yy, int source, int param) { |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
819 int x, y, y2, valu, valu2, kalu, muista, ad, linep, xwid, ywid, xoor, yline, myrpsi; |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
820 xwid = xx * 8; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
821 ywid = yy * 8; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
822 valu = 0; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
823 valu2 = 0; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
824 myrpsi = 0; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
825 xoor = xx; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
826 if (param == 0 || param == 4 || param == 5) { |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
827 xoor = xx * 8; |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
828 } |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
829 if (machine == MSX) { |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
830 myrpsi = 7; |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
831 } |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
832 if (param < 2) { |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
833 outputter("colora:", true); |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
834 } |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
835 if (param == 2) { |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
836 outputter("colorb:", true); |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
837 } |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
838 if (param < 2) { |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
839 outputter(" .byte " + int(g_map[0]) + "," + int(g_map[1]), true); |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
840 } |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
841 if (param == 3) { |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
842 // outputter("color:", true); |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
843 // outputter(" .byte ", false); |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
844 // outputter(g_map[0]+" ", true); |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
845 xoor = xx * 8; |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
846 } |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
847 if (param == 4) { |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
848 outputter("_border:", true); |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
849 outputter(" .byte ", false); |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
850 kalu = getpluscolor(int(g_map[0])); |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
851 valu2 = getplusluminance(int(g_map[0])); |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
852 valu = valu2 * 16 + kalu; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
853 outputter(valu + " ", true); |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
854 outputter("_color:", true); |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
855 } |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
856 if (param == 5) { |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
857 outputter("_lumi:", true); |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
858 } |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
859 for (y = 0; y < yy; y++) { |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
860 //outputter(" .byte ", false); |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
861 outputter(char(9) + ".db ", false); |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
862 for (x = 0; x < xx; x++) { |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
863 for (yline = 0; yline <= myrpsi; yline++) { |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
864 ad = source + x + y * xoor + yline * xx; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
865 if (param == 0) { |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
866 valu = int(g_map[ad]); |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
867 valu2 = int(g_map[ad + MX * MY * 8]); |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
868 } |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
869 if (param == 1) { |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
870 valu2 = int(g_map[ad]); |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
871 valu = int(g_map[ad + 1000]); |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
872 } |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
873 if (param == 2) { |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
874 valu2 = int(g_map[ad]); |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
875 valu = 0; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
876 } |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
877 if (param == 3) { |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
878 valu = int(g_map[ad]); |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
879 valu2 = int(g_map[ad + MX * MY * 8]); |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
880 } |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
881 |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
882 if (param == 4) { //plus4 colortable |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
883 kalu = int(g_map[ad]); |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
884 valu = getpluscolor(kalu); |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
885 kalu = int(g_map[ad + MX * MY * 8]); |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
886 valu2 = getpluscolor(kalu); |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
887 } |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
888 |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
889 if (param == 5) { //plus4 lumitable |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
890 kalu = int(g_map[ad]); |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
891 valu2 = getplusluminance(kalu); |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
892 kalu = int(g_map[ad + MX * MY * 8]); |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
893 valu = getplusluminance(kalu); |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
894 } |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
895 |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
896 if (param == 6) { //plus4 multic1 |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
897 valu2 = getpluscolor(int(g_map[ad])); |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
898 valu = getpluscolor(int(g_map[ad + 1000])); |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
899 } |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
900 |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
901 if (param == 7) { //plus4 multic2 |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
902 valu = getplusluminance(int(g_map[ad])); |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
903 valu2 = getplusluminance(int(g_map[ad + 1000])); |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
904 } |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
905 |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
906 outputter(str(valu * 16 + valu2), false); |
84
025efefd1704
Rename few functions and a variable.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
907 mpWriteByte(int(valu * 16 + valu2)); |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
908 if (x < (xx - 1) || yline < myrpsi) { |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
909 outputter(",", false); |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
910 } |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
911 } |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
912 } |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
913 outputter("", true); |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
914 } |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
915 outputter("", true); |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
916 } |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
917 |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
918 void import_program(String fname) { |
29
249c4f5742f3
Refactor the import/export stuff a bit and the GUI bits for JS.
Matti Hamalainen <ccr@tnsp.org>
parents:
14
diff
changeset
|
919 g_template = mpLoadBinaryFile(fname); |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
920 } |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
921 |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
922 void export_program(String fname) { |
29
249c4f5742f3
Refactor the import/export stuff a bit and the GUI bits for JS.
Matti Hamalainen <ccr@tnsp.org>
parents:
14
diff
changeset
|
923 if (g_sorsaa != 1) |
249c4f5742f3
Refactor the import/export stuff a bit and the GUI bits for JS.
Matti Hamalainen <ccr@tnsp.org>
parents:
14
diff
changeset
|
924 mpSaveBinaryFile(fname, g_template); |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
925 } |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
926 |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
927 void outputter(String oput, boolean eol) { |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
928 if (g_sorsaa == 0) return; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
929 if (eol == false) exwriter.print(oput); |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
930 if (eol == true) exwriter.println(oput); |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
931 } |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
932 |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
933 |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
934 void import_image(String name) { |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
935 PImage image; |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
936 image = loadImage(name); |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
937 int balx, baly, xx, yy, x2, y2, rr, gg, bb, avg, molox, i, j, target; |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
938 int cx, cy; |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
939 int aas, bbs, swap, idefix, avx, avy; |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
940 int[] pixut = new int[260]; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
941 int[] idx = new int[260]; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
942 int[] histog = new int[8192]; |
14
cecc594d1559
Remove unused code and variables.
Matti Hamalainen <ccr@tnsp.org>
parents:
12
diff
changeset
|
943 float ww, hh, fld, compa; |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
944 color c; |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
945 int xcolors, limitter, vertti, erkki; |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
946 int rh, gh, bh; |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
947 |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
948 xcolors = g_maxcolors; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
949 vertti = 8; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
950 erkki = 1; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
951 limitter = 2; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
952 if (g_britemode == 1) { |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
953 xcolors = 8; |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
954 } |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
955 if (g_attrimode == 0) { |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
956 vertti = 1; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
957 erkki = 8; |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
958 } |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
959 if (g_multic == 1) { |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
960 limitter = 4; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
961 } //because zero color can be anywhere? |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
962 if (g_multic == 2) { |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
963 limitter = 16; |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
964 } |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
965 molox = 1; |
6
07ddf9cfc6c2
Cast char to int where needed and other related operations.
Matti Hamalainen <ccr@tnsp.org>
parents:
5
diff
changeset
|
966 command(int('O')); //special clear screen |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
967 if (g_multic == 1 || g_hzoomer == 2) { |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
968 molox = 2; |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
969 } |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
970 ww = image.width; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
971 hh = image.height; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
972 if (ww <= 16 || hh <= 16) { |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
973 return; |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
974 } |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
975 balx = int(ww / X); |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
976 balx = balx * molox; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
977 baly = int(hh / Y); |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
978 if (balx < 1) { |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
979 balx = 1; |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
980 } |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
981 if (baly < 1) { |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
982 baly = 1; |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
983 } |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
984 |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
985 if (g_palsteps > 0) { |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
986 for (i = 0; i < g_maxcolors; i++) { |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
987 makecolor(i, 0, 0, 0); |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
988 } |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
989 |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
990 int maxhis, palls, psteps; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
991 psteps = int(g_palsteps - 1); |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
992 maxhis = 0; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
993 palls = int(255 / psteps); |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
994 for (cy = 0; cy < MY * erkki; cy++) { |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
995 for (cx = 0; cx < MX; cx++) { |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
996 for (yy = cy * vertti; yy <= cy * vertti + vertti - 1; yy++) { |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
997 for (xx = cx * 8; xx <= cx * 8 + 7; xx = xx + molox) { |
7
c848a6133cfc
Fix many calculations (divisions) that assume integer variable division
Matti Hamalainen <ccr@tnsp.org>
parents:
6
diff
changeset
|
998 x2 = int(ww / X) * xx; |
c848a6133cfc
Fix many calculations (divisions) that assume integer variable division
Matti Hamalainen <ccr@tnsp.org>
parents:
6
diff
changeset
|
999 y2 = int(hh / Y) * yy; |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1000 rr = 0; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1001 gg = 0; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1002 bb = 0; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1003 avg = 0; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1004 |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1005 for (avy = 0; avy < baly; avy++) { |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1006 for (avx = 0; avx < balx; avx++) { |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1007 c = image.get(x2 + avx, y2 + avy); |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1008 rr = rr + int(red(c)); |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1009 gg = gg + int(green(c)); |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1010 bb = bb + int(blue(c)); |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1011 avg++; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1012 } |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1013 } |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1014 rh = rr / (avg); |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1015 gh = gg / (avg); |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1016 bh = bb / (avg); |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1017 rh = int(rh) / palls; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1018 gh = int(gh) / palls; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1019 bh = int(bh) / palls; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1020 histog[int(rh * (g_palsteps * g_palsteps) + gh * (g_palsteps) + bh)]++; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1021 if (histog[int(rh * (g_palsteps * g_palsteps) + gh * (g_palsteps) + bh)] > maxhis) { |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1022 maxhis = histog[int(rh * (g_palsteps * g_palsteps) + gh * (g_palsteps) + bh)]; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1023 } |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1024 } |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1025 } |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1026 } |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1027 } |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1028 |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1029 int step; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1030 step = 0; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1031 for (j = maxhis; j > 0; j--) { |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1032 for (i = 0; i <= 4096; i++) { |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1033 if (histog[i] == j) { |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1034 rh = i / int(g_palsteps * g_palsteps); |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1035 gh = i - int(rh * (g_palsteps * g_palsteps)); |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1036 gh = gh / int(g_palsteps); |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1037 bh = i - int(rh * (g_palsteps * g_palsteps)); |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1038 bh = bh - int(gh * g_palsteps); |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1039 rh = rh * int(palls); |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1040 gh = gh * int(palls); |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1041 bh = bh * int(palls); |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1042 if (step < g_maxcolors) { |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1043 makecolor(step, rh, gh, bh); |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1044 step++; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1045 } |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1046 } |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1047 } |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1048 } |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1049 |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1050 } |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1051 |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1052 for (cy = 0; cy < MY * erkki; cy++) { |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1053 for (cx = 0; cx < MX; cx++) { |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1054 for (i = 0; i < xcolors; i++) { |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1055 pixut[i] = 0; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1056 idx[i] = i; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1057 } |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1058 for (yy = cy * vertti; yy <= cy * vertti + vertti - 1; yy++) { |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1059 for (xx = cx * 8; xx <= cx * 8 + 7; xx = xx + molox) { |
7
c848a6133cfc
Fix many calculations (divisions) that assume integer variable division
Matti Hamalainen <ccr@tnsp.org>
parents:
6
diff
changeset
|
1060 x2 = int(ww / X) * xx; |
c848a6133cfc
Fix many calculations (divisions) that assume integer variable division
Matti Hamalainen <ccr@tnsp.org>
parents:
6
diff
changeset
|
1061 y2 = int(hh / Y) * yy; |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1062 rr = 0; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1063 gg = 0; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1064 bb = 0; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1065 avg = 0; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1066 for (avy = 0; avy < baly; avy++) { |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1067 for (avx = 0; avx < balx; avx++) { |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1068 c = image.get(x2 + avx, y2 + avy); |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1069 rr = rr + int(red(c)); |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1070 gg = gg + int(green(c)); |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1071 bb = bb + int(blue(c)); |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1072 avg++; |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1073 } |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1074 } |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1075 rr = rr / (avg); |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1076 gg = gg / (avg); |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1077 bb = bb / (avg); |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1078 g_farge = 0; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1079 target = -1; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1080 compa = 9999; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1081 for (i = 0; i < xcolors; i++) { |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1082 fld = dist(rr, gg, bb, g_r[i], g_g[i], g_b[i]); |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1083 if (fld < compa) { |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1084 compa = fld; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1085 target = i; |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1086 } |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1087 } |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1088 |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1089 g_farge = target; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1090 pixut[target]++; //histogramming |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1091 } |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1092 } |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1093 |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1094 for (aas = 0; aas < xcolors; aas++) { |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1095 for (bbs = 0; bbs <= aas; bbs++) { |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1096 if (pixut[aas] > pixut[bbs]) { |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1097 swap = pixut[aas]; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1098 pixut[aas] = pixut[bbs]; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1099 pixut[bbs] = swap; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1100 swap = idx[aas]; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1101 idx[aas] = idx[bbs]; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1102 idx[bbs] = swap; |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1103 } |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1104 } |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1105 } |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1106 |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1107 for (idefix = 0; idefix < limitter; idefix++) { |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1108 i = idx[idefix]; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1109 for (yy = cy * vertti; yy <= cy * vertti + vertti - 1; yy++) { |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1110 for (xx = cx * 8; xx <= cx * 8 + 7; xx = xx + molox) { |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1111 |
7
c848a6133cfc
Fix many calculations (divisions) that assume integer variable division
Matti Hamalainen <ccr@tnsp.org>
parents:
6
diff
changeset
|
1112 x2 = int(ww / X) * xx; |
c848a6133cfc
Fix many calculations (divisions) that assume integer variable division
Matti Hamalainen <ccr@tnsp.org>
parents:
6
diff
changeset
|
1113 y2 = int(hh / Y) * yy; |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1114 |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1115 rr = 0; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1116 gg = 0; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1117 bb = 0; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1118 avg = 0; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1119 for (avy = 0; avy < baly; avy++) { |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1120 for (avx = 0; avx < balx; avx++) { |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1121 c = image.get(x2 + avx, y2 + avy); |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1122 rr = rr + int(red(c)); |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1123 gg = gg + int(green(c)); |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1124 bb = bb + int(blue(c)); |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1125 avg++; |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1126 } |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1127 } |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1128 rr = rr / (avg); |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1129 gg = gg / (avg); |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1130 bb = bb / (avg); |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1131 g_farge = 0; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1132 target = -1; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1133 compa = 9999; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1134 for (j = 0; j < limitter; j++) { |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1135 fld = dist(rr, gg, bb, g_r[idx[j]], g_g[idx[j]], g_b[idx[j]]); |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1136 if (fld < compa) { |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1137 compa = fld; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1138 target = idx[j]; |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1139 } |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1140 } |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1141 if (i == target) { |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1142 |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1143 g_farge = target; |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1144 makepoint(xx, yy); |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1145 } |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1146 } |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1147 } |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1148 if (idefix == 0) { |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1149 |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1150 for (yy = cy * vertti; yy <= cy * vertti + vertti - 1; yy++) { |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1151 for (xx = cx * 8; xx <= cx * 8 + 7; xx = xx + molox) { |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1152 g_farge = idx[0]; |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1153 makepoint(xx, yy); |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1154 } |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1155 } |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1156 } |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1157 } |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1158 } |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1159 } |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1160 |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1161 } |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1162 |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1163 void export_image(String name) { |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1164 //output the visible graphics as image |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1165 //with border |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1166 //processing style |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1167 int xx, yy, f, x2; |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1168 color c; |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1169 for (xx = 0; xx < output.width; xx++) { |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1170 for (yy = 0; yy < output.width; yy++) { |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1171 c = color(g_r[259], g_g[259], g_b[259]); |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1172 output.set(xx, yy, c); |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1173 } |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1174 } |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1175 |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1176 for (xx = 0; xx < X; xx++) { |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1177 for (yy = 0; yy < Y; yy++) { |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1178 x2 = xx; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1179 f = getabsa(x2, yy, 0); |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1180 if (g_multic == 1 || g_hzoomer == 2) { |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1181 x2 = xx / 2; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1182 x2 = x2 * 2; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1183 f = getmultic(x2, yy, 0); |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1184 } |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1185 if (machine == MSX) { |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1186 if (f == 0) { |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1187 f = g_map[1]; |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1188 } |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1189 } |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1190 c = color(g_r[f], g_g[f], g_b[f]); |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1191 for (int vertti = 0; vertti <= g_omag; vertti++) { |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1192 for (int mortti = 0; mortti <= g_omag; mortti++) { |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1193 output.set((g_bordh * g_omag) / 2 + xx * g_omag + mortti, (g_bordv * g_omag) / 2 + yy * g_omag + vertti, c); |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1194 } |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1195 } |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1196 } |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1197 } |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1198 output.save(name); |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1199 } |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1200 |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1201 void export_image_sans_border(String name) { |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1202 //output the visible graphics as image |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1203 //processing style |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1204 //without border |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1205 int xx, yy, f, x2; |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1206 color c; |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1207 |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1208 for (xx = 0; xx < outputsans.width; xx++) { |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1209 for (yy = 0; yy < outputsans.width; yy++) { |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1210 c = color(g_r[259], g_g[259], g_b[259]); |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1211 outputsans.set(xx, yy, c); |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1212 } |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1213 } |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1214 |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1215 for (xx = 0; xx < X; xx++) { |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1216 for (yy = 0; yy < Y; yy++) { |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1217 x2 = xx; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1218 f = getabsa(x2, yy, 0); |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1219 if (g_multic == 1 || g_hzoomer == 2) { |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1220 x2 = xx / 2; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1221 x2 = x2 * 2; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1222 f = getmultic(x2, yy, 0); |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1223 } |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1224 |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1225 if (machine == MSX) { |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1226 if (f == 0) { |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1227 f = g_map[1]; |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1228 } |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1229 } |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1230 c = color(g_r[f], g_g[f], g_b[f]); |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1231 for (int vertti = 0; vertti <= g_omag; vertti++) { |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1232 for (int mortti = 0; mortti <= g_omag; mortti++) { |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1233 outputsans.set(xx * g_omag + mortti, yy * g_omag + vertti, c); |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1234 } |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1235 } |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1236 } |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1237 } |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1238 outputsans.save(name); |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1239 } |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1240 |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1241 void make_c64_palette() { |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1242 // Pepto's murky C64 palette: http://www.pepto.de/projects/colorvic |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1243 int rgb[] = { |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1244 0xff000000, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1245 0xffFFFFFF, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1246 0xff68372B, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1247 0xff70A4B2, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1248 0xff6F3D86, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1249 0xff588D43, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1250 0xff352879, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1251 0xffB8C76F, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1252 0xff6F4F25, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1253 0xff433900, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1254 0xff9A6759, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1255 0xff444444, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1256 0xff6C6C6C, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1257 0xff9AD284, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1258 0xff6C5EB5, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1259 0xff959595 |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1260 }; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1261 for (int i = 0; i < g_maxcolors; i++) { |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1262 rgb[i] = rgb[i] & 0xffffff; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1263 g_grids[i] = rgb[i] + 0xff282828; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1264 makecolor(i, rgb[i] >> 16, (rgb[i] & 0xff00FF00) >> 8, rgb[i] & 0xff0000FF); |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1265 } |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1266 g_grids[1] = 0xffd0d0d0; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1267 g_gridmode = NEW; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1268 g_map[13] = byte(C64); |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1269 } |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1270 |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1271 void make_plus4_palette() { |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1272 int rgb[] = { |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1273 0xff000000, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1274 0xff2C2C2C, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1275 0xff621307, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1276 0xff00424C, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1277 0xff510378, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1278 0xff004E00, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1279 0xff27188E, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1280 0xff303E00, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1281 0xff582100, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1282 0xff463000, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1283 0xff244400, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1284 0xff630448, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1285 0xff004E0C, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1286 0xff0E2784, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1287 0xff33118E, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1288 0xff184800, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1289 0xff3B3B3B, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1290 0xff702419, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1291 0xff00505A, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1292 0xff601685, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1293 0xff125D00, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1294 0xff36289B, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1295 0xff3F4C00, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1296 0xff663100, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1297 0xff553F00, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1298 0xff345200, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1299 0xff711656, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1300 0xff005C1D, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1301 0xff1F3691, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1302 0xff42229B, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1303 0xff285700, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1304 0xff424242, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1305 0xff772C21, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1306 0xff055861, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1307 0xff661E8C, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1308 0xff1B6400, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1309 0xff3E30A2, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1310 0xff475400, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1311 0xff6D3900, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1312 0xff5C4700, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1313 0xff3B5900, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1314 0xff771F5D, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1315 0xff046325, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1316 0xff273E98, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1317 0xff492AA1, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1318 0xff305E00, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1319 0xff515151, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1320 0xff843B31, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1321 0xff17656F, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1322 0xff742E99, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1323 0xff2B7100, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1324 0xff4C3FAF, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1325 0xff556200, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1326 0xff7A4709, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1327 0xff6A5500, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1328 0xff4A6700, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1329 0xff852F6B, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1330 0xff177135, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1331 0xff364CA5, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1332 0xff5739AE, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1333 0xff3F6B00, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1334 0xff7A7A7A, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1335 0xffAC665C, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1336 0xff468E97, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1337 0xff9C5AC0, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1338 0xff57992E, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1339 0xff766AD5, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1340 0xff7E8A13, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1341 0xffA2713A, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1342 0xff927E20, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1343 0xff748F14, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1344 0xffAC5A93, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1345 0xff459960, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1346 0xff6276CB, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1347 0xff8064D4, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1348 0xff6A9419, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1349 0xff959595, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1350 0xffC58178, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1351 0xff62A8B1, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1352 0xffB675D9, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1353 0xff73B34C, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1354 0xff9185ED, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1355 0xff99A433, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1356 0xffBB8C57, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1357 0xffAC993E, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1358 0xff8FAA34, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1359 0xffC676AD, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1360 0xff62B37B, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1361 0xff7D91E4, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1362 0xff9B80ED, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1363 0xff85AE38, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1364 0xffAFAFAF, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1365 0xffDE9B93, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1366 0xff7DC2CA, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1367 0xffCF90F2, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1368 0xff8DCD68, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1369 0xffAB9FFF, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1370 0xffB3BE51, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1371 0xffD5A673, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1372 0xffC6B35B, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1373 0xffA9C351, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1374 0xffDF91C7, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1375 0xff7DCC96, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1376 0xff97ABFD, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1377 0xffB59AFF, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1378 0xff9FC755, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1379 0xffE1E1E1, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1380 0xffFFCFC6, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1381 0xffB2F4FC, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1382 0xffFFC4FF, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1383 0xffC1FE9D, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1384 0xffDDD2FF, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1385 0xffE5F088, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1386 0xffFFD9A8, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1387 0xffF7E591, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1388 0xffDBF588, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1389 0xffFFC4F9, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1390 0xffB1FEC9, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1391 0xffCBDDFF, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1392 0xffE7CDFF, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1393 0xffD2F98C |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1394 }; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1395 for (int i = 0; i < g_maxcolors; i++) { |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1396 rgb[i] = rgb[i] & 0xffffff; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1397 makecolor(i, rgb[i] >> 16, (rgb[i] & 0xff00FF00) >> 8, rgb[i] & 0xff0000FF); |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1398 } |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1399 } |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1400 |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1401 void make_msx_palette() { |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1402 int rgb[] = { |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1403 0xff000000, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1404 0xff000000, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1405 0xff3EB849, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1406 0xff74D07D, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1407 0xff5955E0, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1408 0xff8076F1, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1409 0xffB95E51, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1410 0xff65DBEF, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1411 0xffDB6559, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1412 0xffFF897D, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1413 0xffCCC35E, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1414 0xffDED087, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1415 0xff3AA241, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1416 0xffB766B5, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1417 0xffCCCCCC, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1418 0xffFFFFFF |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1419 }; |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1420 |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1421 for (int i = 0; i < g_maxcolors; i++) { |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1422 rgb[i] = rgb[i] & 0xffffff; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1423 g_grids[i] = rgb[i] + 0xff1f1f1f; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1424 makecolor(i, (rgb[i] >> 16), (rgb[i] & 0xff00FF00) >> 8, rgb[i] & 0xff0000FF); |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1425 } |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1426 g_grids[5] = 0xff9f95Ff; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1427 g_grids[7] = 0xff84faEF; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1428 g_grids[9] = 0xffffa99d; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1429 g_grids[15] = 0xffd8d8d8; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1430 g_gridmode = NEW; |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1431 } |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1432 |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1433 void make_spectrum_palette() { |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1434 int rgb[] = { |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1435 0xff000000, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1436 0xff0000C0, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1437 0xffC00000, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1438 0xffC000C0, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1439 0xff00C000, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1440 0xff00C0C0, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1441 0xffC0C000, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1442 0xffC0C0C0, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1443 0xff000000, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1444 0xff0000FF, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1445 0xffFF0000, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1446 0xffFF00FF, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1447 0xff00FF00, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1448 0xff00FFFF, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1449 0xffFFFF00, |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1450 0xffFFFFFF |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1451 }; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1452 |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1453 g_grids[9] = 0xff0000d8; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1454 g_grids[10] = 0xffd80000; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1455 g_grids[11] = 0xffd800d8; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1456 g_grids[12] = 0xff00d800; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1457 g_grids[13] = 0xff00d8d8; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1458 g_grids[14] = 0xffd8d800; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1459 g_grids[15] = 0xffd8d8d8; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1460 for (int i = 0; i < g_maxcolors; i++) { |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1461 rgb[i] = rgb[i] & 0xffffff; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1462 if (i <= 8) { |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1463 g_grids[i] = rgb[i] + 0xff282828; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1464 } |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1465 makecolor(i, (rgb[i] >> 16), (rgb[i] & 0xff00FF00) >> 8, rgb[i] & 0xff0000FF); |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1466 } |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1467 g_gridmode = NEW; |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1468 } |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1469 |
49 | 1470 |
81
7ee5e0c590bd
Clean set_machine() and rename to mpSetupMachine()
Matti Hamalainen <ccr@tnsp.org>
parents:
78
diff
changeset
|
1471 void mpSetupMachine(int m) |
49 | 1472 { |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1473 machine = m; |
50 | 1474 g_exportext = "none"; |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1475 g_map[3] = byte(machine); |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1476 g_map[13] = byte(machine); |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1477 g_palsteps = 0; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1478 g_farge = 1; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1479 g_backg = 0; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1480 g_britemode = 0; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1481 g_charlimit = 0; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1482 g_hzoomer = 1; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1483 g_backmode = 0; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1484 g_formatname = ""; |
50 | 1485 g_formatext = ""; |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1486 g_maxcolors = 16; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1487 X = 320; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1488 Y = 200; |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1489 |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1490 if (machine == C64) { //c64 hires |
12
a0a00f80b042
Make the machine setup sections a bit more uniform in order.
Matti Hamalainen <ccr@tnsp.org>
parents:
11
diff
changeset
|
1491 g_name = "c64"; |
50 | 1492 g_exportext = "prg"; |
51
f9da5fe9a891
Define g_exportname for name of the format that the export is done in.
Matti Hamalainen <ccr@tnsp.org>
parents:
50
diff
changeset
|
1493 g_exportname = "PRG file"; |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1494 g_formatname = "Art Studio"; |
50 | 1495 g_formatext = "art"; |
12
a0a00f80b042
Make the machine setup sections a bit more uniform in order.
Matti Hamalainen <ccr@tnsp.org>
parents:
11
diff
changeset
|
1496 |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1497 g_attrimode = 1; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1498 g_map[1] = byte(255); |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1499 g_map[0] = 6; |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1500 make_c64_palette(); |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1501 } |
81
7ee5e0c590bd
Clean set_machine() and rename to mpSetupMachine()
Matti Hamalainen <ccr@tnsp.org>
parents:
78
diff
changeset
|
1502 else |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1503 if (machine == CPC) { //Amstrad CPC mode 0 |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1504 g_name = "cpc"; |
50 | 1505 g_exportext = "bin"; |
51
f9da5fe9a891
Define g_exportname for name of the format that the export is done in.
Matti Hamalainen <ccr@tnsp.org>
parents:
50
diff
changeset
|
1506 g_exportname = "BIN file" |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1507 g_formatname = ""; |
50 | 1508 g_formatext = ""; |
12
a0a00f80b042
Make the machine setup sections a bit more uniform in order.
Matti Hamalainen <ccr@tnsp.org>
parents:
11
diff
changeset
|
1509 |
a0a00f80b042
Make the machine setup sections a bit more uniform in order.
Matti Hamalainen <ccr@tnsp.org>
parents:
11
diff
changeset
|
1510 g_hzoomer = 2; |
a0a00f80b042
Make the machine setup sections a bit more uniform in order.
Matti Hamalainen <ccr@tnsp.org>
parents:
11
diff
changeset
|
1511 g_palsteps = 3; |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1512 g_multic = 2; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1513 g_attrimode = 0; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1514 g_map[1] = byte(255); |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1515 g_map[0] = 1; |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1516 |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1517 makecolor(0, 0, 0, 0); |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1518 makecolor(1, 0x0, 0x0, 0x80); |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1519 makecolor(2, 0x00, 0x00, 0xFF); |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1520 makecolor(3, 0x80, 0x00, 0x00); |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1521 makecolor(4, 0x80, 0x00, 0x80); |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1522 makecolor(5, 0x80, 0x00, 0xFF); |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1523 makecolor(6, 0xFF, 0x00, 0x00); |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1524 makecolor(7, 0xFF, 0x00, 0x80); |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1525 makecolor(8, 0xFF, 0x00, 0xFF); |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1526 makecolor(9, 0x00, 0x80, 0x00); |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1527 makecolor(10, 0x00, 0x80, 0x80); |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1528 makecolor(11, 0x00, 0x80, 0xFF); |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1529 makecolor(12, 0x80, 0x80, 0x00); |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1530 makecolor(13, 0x80, 0x80, 0x80); |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1531 makecolor(14, 0x80, 0x80, 0xFF); |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1532 makecolor(15, 0xFF, 0xFF, 0xFF); |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1533 } |
81
7ee5e0c590bd
Clean set_machine() and rename to mpSetupMachine()
Matti Hamalainen <ccr@tnsp.org>
parents:
78
diff
changeset
|
1534 else |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1535 if (machine == MSX) { // MSX |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1536 g_name = "msx"; |
50 | 1537 g_exportext = "com"; |
51
f9da5fe9a891
Define g_exportname for name of the format that the export is done in.
Matti Hamalainen <ccr@tnsp.org>
parents:
50
diff
changeset
|
1538 g_exportname = "COM file"; |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1539 g_formatname = "Screen 2"; |
68
59731a72ce8b
Remove dots from format exts.
Matti Hamalainen <ccr@tnsp.org>
parents:
61
diff
changeset
|
1540 g_formatext = "sc2"; |
12
a0a00f80b042
Make the machine setup sections a bit more uniform in order.
Matti Hamalainen <ccr@tnsp.org>
parents:
11
diff
changeset
|
1541 |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1542 X = 256; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1543 Y = 192; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1544 g_attrimode = 0; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1545 g_backmode = 1; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1546 g_farge = 15; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1547 g_backg = 0; |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1548 |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1549 //TI99 variant |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1550 /* |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1551 makecolor(0,0,0,0); |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1552 makecolor(1,0,0,0); |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1553 |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1554 makecolor(2,0x21,0xc8,0x42); //21c842 medgreen |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1555 makecolor(3,0x5e,0xdc,0x78);//5edc78 light green |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1556 makecolor(4,0x54,0x55,0xed);//5455ed dark blue |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1557 makecolor(5,0x7d,0x76,0xFc);//7d76fc light blue |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1558 |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1559 makecolor(6,0xd4,0x52,0x4d); //d4524d dark red |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1560 makecolor(7,0x42,0xeb,0xf5); //42ebf5 cyan |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1561 makecolor(8,0xfc,0x55,0x54); //fc5554 medium red |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1562 makecolor(9,0xff,0x79,0x78); //ff7978 light red |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1563 makecolor(10,0xd4,0xc1,0x54);// d4c154 dark yellow |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1564 makecolor(11,0xe6,0xce,0x80);// e6ce80 light yellow |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1565 makecolor(12,0x21,0xb0,0x3b);// 21b03b dark green |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1566 makecolor(13,0xc9,0x5b,0xba);// c95bba magenta |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1567 makecolor(14,0xCc,0xcc,0xCc);// gray |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1568 makecolor(15,0xFF,0xFF,0xFF); |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1569 */ |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1570 make_msx_palette(); |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1571 } |
81
7ee5e0c590bd
Clean set_machine() and rename to mpSetupMachine()
Matti Hamalainen <ccr@tnsp.org>
parents:
78
diff
changeset
|
1572 else |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1573 if (machine == SPECTRUM) { // ZX Spectrum |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1574 g_name = "spec"; |
50 | 1575 g_exportext = "tap"; |
51
f9da5fe9a891
Define g_exportname for name of the format that the export is done in.
Matti Hamalainen <ccr@tnsp.org>
parents:
50
diff
changeset
|
1576 g_exportname = "TAP file"; |
12
a0a00f80b042
Make the machine setup sections a bit more uniform in order.
Matti Hamalainen <ccr@tnsp.org>
parents:
11
diff
changeset
|
1577 g_formatname = "Screen$"; |
68
59731a72ce8b
Remove dots from format exts.
Matti Hamalainen <ccr@tnsp.org>
parents:
61
diff
changeset
|
1578 g_formatext = "scr"; |
12
a0a00f80b042
Make the machine setup sections a bit more uniform in order.
Matti Hamalainen <ccr@tnsp.org>
parents:
11
diff
changeset
|
1579 |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1580 X = 256; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1581 Y = 192; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1582 g_farge = 7; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1583 g_backg = 0; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1584 g_attrimode = 1; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1585 g_britemode = 1; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1586 g_map[0] = 1; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1587 g_map[1] = byte(255); |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1588 make_spectrum_palette(); |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1589 } |
81
7ee5e0c590bd
Clean set_machine() and rename to mpSetupMachine()
Matti Hamalainen <ccr@tnsp.org>
parents:
78
diff
changeset
|
1590 else |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1591 if (machine == TIMEX) { // timex sinclair |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1592 g_name = "tmx"; |
12
a0a00f80b042
Make the machine setup sections a bit more uniform in order.
Matti Hamalainen <ccr@tnsp.org>
parents:
11
diff
changeset
|
1593 |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1594 X = 256; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1595 Y = 192; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1596 g_farge = 7; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1597 g_backg = 0; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1598 g_attrimode = 0; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1599 g_britemode = 1; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1600 g_map[1] = byte(255); |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1601 make_spectrum_palette(); |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1602 } |
81
7ee5e0c590bd
Clean set_machine() and rename to mpSetupMachine()
Matti Hamalainen <ccr@tnsp.org>
parents:
78
diff
changeset
|
1603 else |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1604 if (machine == JR200) { // Panasonic JR200 |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1605 g_name = "jr200"; |
12
a0a00f80b042
Make the machine setup sections a bit more uniform in order.
Matti Hamalainen <ccr@tnsp.org>
parents:
11
diff
changeset
|
1606 |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1607 X = 256; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1608 Y = 192; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1609 g_maxcolors = 8; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1610 g_farge = 7; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1611 g_backg = 0; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1612 g_attrimode = 1; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1613 g_map[1] = byte(255); |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1614 make_spectrum_palette(); //cheating |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1615 } |
81
7ee5e0c590bd
Clean set_machine() and rename to mpSetupMachine()
Matti Hamalainen <ccr@tnsp.org>
parents:
78
diff
changeset
|
1616 else |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1617 if (machine == PLUS4M || machine == PLUS4) { // Commodore plus/4 |
12
a0a00f80b042
Make the machine setup sections a bit more uniform in order.
Matti Hamalainen <ccr@tnsp.org>
parents:
11
diff
changeset
|
1618 g_name = "plus4m"; |
50 | 1619 g_exportext = "prg"; |
51
f9da5fe9a891
Define g_exportname for name of the format that the export is done in.
Matti Hamalainen <ccr@tnsp.org>
parents:
50
diff
changeset
|
1620 g_exportname = "PRG file"; |
12
a0a00f80b042
Make the machine setup sections a bit more uniform in order.
Matti Hamalainen <ccr@tnsp.org>
parents:
11
diff
changeset
|
1621 g_formatname = "M.Botticelli"; |
68
59731a72ce8b
Remove dots from format exts.
Matti Hamalainen <ccr@tnsp.org>
parents:
61
diff
changeset
|
1622 g_formatext = "prg"; |
12
a0a00f80b042
Make the machine setup sections a bit more uniform in order.
Matti Hamalainen <ccr@tnsp.org>
parents:
11
diff
changeset
|
1623 |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1624 g_backmode = 1; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1625 g_multic = 1; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1626 g_attrimode = 1; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1627 g_maxcolors = 121; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1628 g_charlimit = 2; |
12
a0a00f80b042
Make the machine setup sections a bit more uniform in order.
Matti Hamalainen <ccr@tnsp.org>
parents:
11
diff
changeset
|
1629 g_map[0] = 6; |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1630 g_map[1] = 0; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1631 g_map[2] = 61; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1632 g_farge = 61; |
12
a0a00f80b042
Make the machine setup sections a bit more uniform in order.
Matti Hamalainen <ccr@tnsp.org>
parents:
11
diff
changeset
|
1633 |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1634 if (machine == PLUS4) { // plus/4 hires |
12
a0a00f80b042
Make the machine setup sections a bit more uniform in order.
Matti Hamalainen <ccr@tnsp.org>
parents:
11
diff
changeset
|
1635 g_name = "plus4"; |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1636 g_formatname = "Botticelli"; |
68
59731a72ce8b
Remove dots from format exts.
Matti Hamalainen <ccr@tnsp.org>
parents:
61
diff
changeset
|
1637 g_formatext = "prg"; |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1638 g_multic = 0; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1639 g_backmode = 0; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1640 g_charlimit = 0; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1641 g_attrimode = 1; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1642 g_map[1] = byte(255); |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1643 } |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1644 make_plus4_palette(); |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1645 } |
81
7ee5e0c590bd
Clean set_machine() and rename to mpSetupMachine()
Matti Hamalainen <ccr@tnsp.org>
parents:
78
diff
changeset
|
1646 else |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1647 if (machine == C64M) { //c64 multicolor |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1648 g_name = "c64m"; |
50 | 1649 g_exportext = "prg"; |
51
f9da5fe9a891
Define g_exportname for name of the format that the export is done in.
Matti Hamalainen <ccr@tnsp.org>
parents:
50
diff
changeset
|
1650 g_exportname = "PRG file"; |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1651 g_formatname = "A. A. Studio"; |
68
59731a72ce8b
Remove dots from format exts.
Matti Hamalainen <ccr@tnsp.org>
parents:
61
diff
changeset
|
1652 g_formatext = "ocp"; |
12
a0a00f80b042
Make the machine setup sections a bit more uniform in order.
Matti Hamalainen <ccr@tnsp.org>
parents:
11
diff
changeset
|
1653 |
a0a00f80b042
Make the machine setup sections a bit more uniform in order.
Matti Hamalainen <ccr@tnsp.org>
parents:
11
diff
changeset
|
1654 g_backmode = 1; |
a0a00f80b042
Make the machine setup sections a bit more uniform in order.
Matti Hamalainen <ccr@tnsp.org>
parents:
11
diff
changeset
|
1655 g_charlimit = 3; |
a0a00f80b042
Make the machine setup sections a bit more uniform in order.
Matti Hamalainen <ccr@tnsp.org>
parents:
11
diff
changeset
|
1656 g_multic = 1; |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1657 g_attrimode = 1; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1658 g_map[1] = byte(0); |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1659 g_map[0] = 6; |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1660 make_c64_palette(); |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1661 } |
81
7ee5e0c590bd
Clean set_machine() and rename to mpSetupMachine()
Matti Hamalainen <ccr@tnsp.org>
parents:
78
diff
changeset
|
1662 else |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1663 if (machine == AMIGA) { //generic 16bit |
12
a0a00f80b042
Make the machine setup sections a bit more uniform in order.
Matti Hamalainen <ccr@tnsp.org>
parents:
11
diff
changeset
|
1664 g_name = "test"; |
50 | 1665 g_exportext = ""; |
51
f9da5fe9a891
Define g_exportname for name of the format that the export is done in.
Matti Hamalainen <ccr@tnsp.org>
parents:
50
diff
changeset
|
1666 g_exportname = ""; |
49 | 1667 g_formatname = ""; |
50 | 1668 g_formatext = ""; |
49 | 1669 |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1670 g_backmode = 1; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1671 g_maxcolors = 32; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1672 g_palsteps = 16; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1673 g_multic = 2; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1674 g_attrimode = 2; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1675 g_map[1] = byte(0); |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1676 for (int z = 0; z < g_maxcolors; z++) { |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1677 if (z < 16) { |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1678 makecolor(z, z * 17, z * 17, z * 17); |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1679 } else { |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1680 makecolor(z, (z - 16) * 17, 0, 0); |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1681 } |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1682 } |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1683 } |
81
7ee5e0c590bd
Clean set_machine() and rename to mpSetupMachine()
Matti Hamalainen <ccr@tnsp.org>
parents:
78
diff
changeset
|
1684 else |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1685 if (machine == C64FLI) { //c64 hires FLI = AFLI |
49 | 1686 g_name = "afli"; |
50 | 1687 g_exportext = "prg"; |
51
f9da5fe9a891
Define g_exportname for name of the format that the export is done in.
Matti Hamalainen <ccr@tnsp.org>
parents:
50
diff
changeset
|
1688 g_exportname = "PRG file"; |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1689 g_formatname = ""; |
50 | 1690 g_formatext = ""; |
12
a0a00f80b042
Make the machine setup sections a bit more uniform in order.
Matti Hamalainen <ccr@tnsp.org>
parents:
11
diff
changeset
|
1691 |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1692 g_attrimode = 0; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1693 g_map[1] = byte(255); |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1694 g_map[0] = 6; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1695 make_c64_palette(); |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1696 } |
81
7ee5e0c590bd
Clean set_machine() and rename to mpSetupMachine()
Matti Hamalainen <ccr@tnsp.org>
parents:
78
diff
changeset
|
1697 else |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1698 if (machine == C64FLIM) { //C64 FLI multicolor |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1699 g_name = "fli"; |
50 | 1700 g_exportext = ""; |
51
f9da5fe9a891
Define g_exportname for name of the format that the export is done in.
Matti Hamalainen <ccr@tnsp.org>
parents:
50
diff
changeset
|
1701 g_exportname = "PRG file"; |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1702 g_formatname = ""; |
50 | 1703 g_formatext = ""; |
12
a0a00f80b042
Make the machine setup sections a bit more uniform in order.
Matti Hamalainen <ccr@tnsp.org>
parents:
11
diff
changeset
|
1704 |
a0a00f80b042
Make the machine setup sections a bit more uniform in order.
Matti Hamalainen <ccr@tnsp.org>
parents:
11
diff
changeset
|
1705 g_hzoomer = 2; |
a0a00f80b042
Make the machine setup sections a bit more uniform in order.
Matti Hamalainen <ccr@tnsp.org>
parents:
11
diff
changeset
|
1706 g_maxcolors = 16; |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1707 g_multic = 2; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1708 g_attrimode = 0; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1709 g_map[1] = byte(255); |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1710 g_map[0] = 6; |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1711 make_c64_palette(); |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1712 } |
81
7ee5e0c590bd
Clean set_machine() and rename to mpSetupMachine()
Matti Hamalainen <ccr@tnsp.org>
parents:
78
diff
changeset
|
1713 else |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1714 if (machine == FAKEX) { // Fake 8-bit computer |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1715 g_name = "fake"; |
50 | 1716 g_exportext = ""; |
51
f9da5fe9a891
Define g_exportname for name of the format that the export is done in.
Matti Hamalainen <ccr@tnsp.org>
parents:
50
diff
changeset
|
1717 g_exportname = ""; |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1718 g_formatname = ""; |
50 | 1719 g_formatext = ""; |
11 | 1720 |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1721 X = 320; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1722 Y = 200; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1723 g_multic = 2; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1724 g_attrimode = 2; //g_palsteps=4; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1725 g_farge = 15; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1726 g_backg = 0; |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1727 make_c64_palette(); |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1728 } |
81
7ee5e0c590bd
Clean set_machine() and rename to mpSetupMachine()
Matti Hamalainen <ccr@tnsp.org>
parents:
78
diff
changeset
|
1729 else |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1730 if (machine == PICO8) { // Pico-8 fantasy console |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1731 g_name = "pico8"; |
50 | 1732 g_exportext = ""; |
51
f9da5fe9a891
Define g_exportname for name of the format that the export is done in.
Matti Hamalainen <ccr@tnsp.org>
parents:
50
diff
changeset
|
1733 g_exportname = ""; |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1734 g_formatname = ""; |
50 | 1735 g_formatext = ""; |
11 | 1736 |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1737 X = 128; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1738 Y = 128; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1739 g_farge = 15; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1740 g_backg = 0; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1741 g_multic = 2; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1742 g_attrimode = 2; |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1743 makecolor(0, 0, 0, 0); |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1744 makecolor(1, 32, 51, 123); |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1745 makecolor(2, 126, 37, 83); |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1746 makecolor(3, 0, 144, 61); |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1747 makecolor(4, 171, 82, 54); |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1748 makecolor(5, 52, 54, 53); |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1749 makecolor(6, 194, 195, 199); |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1750 makecolor(7, 255, 241, 232); |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1751 makecolor(8, 255, 0, 77); |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1752 makecolor(9, 255, 155, 0); |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1753 makecolor(10, 255, 231, 39); |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1754 makecolor(11, 0, 226, 50); |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1755 makecolor(12, 41, 173, 255); |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1756 makecolor(13, 132, 112, 169); |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1757 makecolor(14, 255, 119, 168); |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1758 makecolor(15, 255, 214, 197); |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1759 } |
81
7ee5e0c590bd
Clean set_machine() and rename to mpSetupMachine()
Matti Hamalainen <ccr@tnsp.org>
parents:
78
diff
changeset
|
1760 else |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1761 if (machine == UNIA) { // Unia digital palette |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1762 g_name = "unia"; |
50 | 1763 g_exportext = ""; |
51
f9da5fe9a891
Define g_exportname for name of the format that the export is done in.
Matti Hamalainen <ccr@tnsp.org>
parents:
50
diff
changeset
|
1764 g_exportname = ""; |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1765 g_formatname = ""; |
50 | 1766 g_formatext = ""; |
11 | 1767 |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1768 X = 256; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1769 Y = 192; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1770 g_farge = 15; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1771 g_backg = 0; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1772 g_multic = 2; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1773 g_attrimode = 2; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1774 makecolor(0, 0, 0, 0); |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1775 makecolor(1, 0xff, 0xff, 0xff); |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1776 makecolor(2, 0xff, 0xfd, 0x38); |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1777 makecolor(3, 0xff, 0xc5, 0x00); |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1778 makecolor(4, 0xff, 0x00, 0x00); |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1779 makecolor(5, 0xff, 0x3c, 0xb4); |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1780 makecolor(6, 0xa0, 0x23, 0xbc); |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1781 makecolor(7, 0x1b, 0xa1, 0xfc); |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1782 makecolor(8, 0xe1, 0xe1, 0xe1); |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1783 makecolor(9, 0xb9, 0x63, 0x00); |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1784 makecolor(10, 0xff, 0xaa, 0xbe); |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
1785 makecolor(11, 0xd2, 0x9b, 0xd7); |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1786 makecolor(12, 0xad, 0xad, 0xad); |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1787 makecolor(13, 0x00, 0xb7, 0xb7); |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1788 makecolor(14, 0x23, 0xaf, 0x32); |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1789 makecolor(15, 0x29, 0xf7, 0xa7); |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1790 } |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1791 } |