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