annotate exporters.pde @ 92:4161d798cb64

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