|
6 | 6 | <template>
|
7 | 7 | <div>
|
8 | 8 | <div v-show="loading == 0" @click="start()">
|
9 |
| - <center> |
10 |
| - <i class="pi pi-play" style="font-size: 5rem"></i> <br /> |
11 |
| - <h4>Click here to start the emulation</h4> |
12 |
| - </center> |
| 9 | + <i class="pi pi-play" style="font-size: 5rem"></i> <br /> |
| 10 | + <h4>Click here to start the emulation</h4> |
13 | 11 | </div>
|
14 | 12 |
|
15 | 13 | <div
|
@@ -196,31 +194,33 @@ export default {
|
196 | 194 | },
|
197 | 195 | methods: {
|
198 | 196 | start: function () {
|
199 |
| - // Expose the context to the non-vue emulator code below so it can access the canvas and the emulator settings. |
200 |
| - window.vm = this; |
201 |
| - |
202 |
| - // Download the ROM from the found endpoint |
203 |
| - fetch(this.romEndpoint).then((response) => { |
204 |
| - let gameblob = response.blob().then((blob) => { |
205 |
| - // Get the Blob |
206 |
| - this.gamerom = blob; |
207 |
| - this.loading = 1; |
208 |
| - // Lesssssgooooooo |
209 |
| - this.playROM(); |
210 |
| - // Let's check if there are some query param we should honor |
211 |
| - if (this.$route.query.palette) { |
212 |
| - // Set the desired palette |
213 |
| - let queryvalue = parseInt(this.$route.query.palette); |
214 |
| - if (queryvalue < 0) { |
215 |
| - queryvalue = 0; |
216 |
| - } else if (queryvalue > 85) { |
217 |
| - queryvalue = 85; |
| 197 | + if (this.loading == 0) { |
| 198 | + // Expose the context to the non-vue emulator code below so it can access the canvas and the emulator settings. |
| 199 | + window.vm = this; |
| 200 | + |
| 201 | + // Download the ROM from the found endpoint |
| 202 | + fetch(this.romEndpoint).then((response) => { |
| 203 | + let gameblob = response.blob().then((blob) => { |
| 204 | + // Get the Blob |
| 205 | + this.gamerom = blob; |
| 206 | + this.loading = 1; |
| 207 | + // Lesssssgooooooo |
| 208 | + this.playROM(); |
| 209 | + // Let's check if there are some query param we should honor |
| 210 | + if (this.$route.query.palette) { |
| 211 | + // Set the desired palette |
| 212 | + let queryvalue = parseInt(this.$route.query.palette); |
| 213 | + if (queryvalue < 0) { |
| 214 | + queryvalue = 0; |
| 215 | + } else if (queryvalue > 85) { |
| 216 | + queryvalue = 85; |
| 217 | + } |
| 218 | + this.pal = queryvalue; |
| 219 | + this.setPal(queryvalue); |
218 | 220 | }
|
219 |
| - this.pal = queryvalue; |
220 |
| - this.setPal(queryvalue); |
221 |
| - } |
| 221 | + }); |
222 | 222 | });
|
223 |
| - }); |
| 223 | + } |
224 | 224 | },
|
225 | 225 | togglemute: function () {
|
226 | 226 | if (this.mute) {
|
|
0 commit comments