3 ; Copyright (C) 2007 Daniel Serpell <daniel.serpell@gmail.com>
5 ; Redistribution and use in source and binary forms, with or without
6 ; modification, are permitted provided that the following conditions are met:
8 ; 1. Redistributions of source code must retain the above copyright notice,
9 ; this list of conditions and the following disclaimer.
11 ; 2. Redistributions in binary form must reproduce the above copyright notice,
12 ; this list of conditions and the following disclaimer in the documentation
13 ; and/or other materials provided with the distribution.
15 ; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
16 ; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17 ; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18 ; ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
19 ; LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
20 ; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
21 ; SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
22 ; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
23 ; CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
24 ; ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
25 ; POSSIBILITY OF SUCH DAMAGE.
28 ; Variable definitions
49 ; Used in "gira" and "circ"
65 ; Include routines and macros
67 : ===========================================================================
68 : !source "fillRect.asm"
69 : ===========================================================================
74 ; params: param0, param1
82 fillRect_buffer = param0
83 .buf = fillRect_buffer
86 ; Fill a rectangle of 8x8 pixels with a color.
87 ; input: A = color index
88 ; .buffer = output buffer (address)
89 !macro fillRect .buffer {
98 ; Fill a rectangle of 8x8 pixels with a color.
99 ; input: .color = color index
100 ; .buffer = output buffer (address)
101 !macro fillRect .buffer, .color {
132 : ===========================================================================
134 : ===========================================================================
139 ; define "gira_pos" and "gira_scr" before including
143 .scr01 = gira_scr + $8
144 .scr10 = gira_scr + $100
145 .scr11 = gira_scr + $108
154 +fillRect gira_scr-1, 1
155 +fillRect gira_scr+7, 2
156 +fillRect gira_scr+$107, 3
204 !byte 224, 192, 160, 128, 96, 225, 64, 193, 161, 226, 129, 32, 194, 97, 162, 227
205 !byte 195, 130, 228, 65, 163, 196, 98, 229, 131, 164, 197, 230, 231, 132, 165, 198
206 !byte 99, 66, 33, 0, 199, 166, 133, 100, 167, 67, 134, 101, 135, 34, 68, 102
207 !byte 103, 69, 35, 70, 71, 36, 1, 37, 38, 39, 2, 3, 4, 5, 6, 7
211 : ===========================================================================
213 : ===========================================================================
217 ; define "circ_pos" before including
222 .scr01 = circ_scr + $8
223 .scr10 = circ_scr + $100
224 .scr11 = circ_scr + $108
250 !byte 0, 32, 1, 33, 64, 2, 65, 34, 96, 66, 3, 97, 35, 98, 67, 128
251 !byte 4, 129, 36, 99, 130, 68, 160, 5, 161, 131, 100, 37, 162, 69, 132, 192
252 !byte 163, 101, 6, 193, 38, 194, 70, 164, 133, 195, 102, 224, 7, 225, 39, 165
253 !byte 226, 196, 134, 71, 227, 103, 197, 166, 228, 135, 198, 229, 167, 230, 199, 231
258 : ===========================================================================
259 !source "mapcopy.asm"
260 : ===========================================================================
265 ; define "show_pos" and "show_scr" before including
268 .source = show_source
287 show_source_addr = .source_label + 1
288 show_dest_addr = .dest_label + 1
291 !byte 195, 227, 194, 162, 228, 97, 226, 128, 129, 130, 225, 64, 161, 163, 224, 96
292 !byte 160, 193, 196, 32, 98, 192, 65, 0, 131, 229, 164, 33, 99, 197, 66, 132
293 !byte 1, 230, 34, 165, 67, 100, 198, 2, 3, 68, 6, 35, 133, 166, 5, 101
294 !byte 4, 199, 7, 36, 231, 69, 134, 167, 37, 38, 102, 135, 70, 232, 71, 39
295 !byte 103, 136, 200, 168, 8, 11, 10, 169, 233, 104, 9, 12, 137, 201, 13, 40
296 !byte 44, 72, 43, 170, 42, 45, 41, 105, 73, 202, 14, 138, 234, 74, 75, 106
297 !byte 203, 76, 171, 46, 77, 235, 107, 139, 15, 108, 172, 174, 140, 173, 141, 142
298 !byte 204, 109, 206, 207, 205, 78, 175, 47, 236, 239, 143, 237, 238, 110, 240, 241
299 !byte 111, 208, 16, 79, 176, 209, 242, 48, 144, 243, 80, 177, 244, 112, 210, 17
300 !byte 49, 178, 179, 52, 53, 147, 18, 81, 211, 145, 19, 146, 51, 85, 180, 20
301 !byte 54, 113, 148, 22, 50, 84, 212, 21, 55, 115, 245, 83, 114, 116, 23, 82
302 !byte 86, 88, 89, 87, 118, 117, 119, 149, 213, 56, 57, 181, 214, 90, 121, 122
303 !byte 150, 151, 182, 183, 215, 246, 58, 120, 247, 24, 153, 184, 152, 216, 25, 26
304 !byte 59, 91, 248, 123, 185, 27, 60, 217, 154, 28, 92, 249, 29, 155, 186, 61
305 !byte 218, 93, 124, 250, 187, 30, 251, 62, 156, 94, 125, 219, 188, 31, 252, 254
306 !byte 220, 253, 63, 126, 255, 157, 221, 95, 159, 191, 222, 127, 189, 223, 158, 190
311 : ===========================================================================
313 : ===========================================================================
319 ; "text_state": 8 bytes of internal state
320 ; "text_scr" : output screen address
321 ; "text_data" : text character data
323 text_char = text_state + 0
324 .fps = text_state + 1
325 text_pixel = text_state + 2
326 text_skip = text_state + 3
328 .fsz = text_state + 5
329 text_endFlag = text_state + 6
338 ; "pos" pointer to the next character
339 ; "cxy" screen position
340 ; "fps" position in font data of current character
341 ; "fsz" remaining bytes of current character
342 ; "skp" skip data, used in spaces, begining and ending
343 ; "cb" current output byte (8 bits, one column)
365 !macro textInit2 .scrOut {
383 bne .putpixel ; If we have more pixels, put them
392 ; If we are in "skip" mode, skip :-)
397 ; skip this step (filling with blanks)
408 ; Skip just one column if just at the end of character
411 bpl .nextcolumn ; More columns
419 ; A > 128, skip "A-128" characters
423 ; If skip == 127 (value=255), signal the end of text data
447 ; skip over to putpixel
463 text_base_color = .base_color + 1
464 text_dest_addr = .dest_label + 1
468 !byte 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 3, 2, 3, 3, 3, 3, 3, 1, 2, 3, 1
469 !byte 5, 3, 3, 3, 3, 3, 2, 2, 3, 3, 5, 4, 3, 3, 5, 4, 4, 4, 3, 3, 4, 4
470 !byte 1, 3, 4, 3, 5, 5, 5, 4, 5, 4, 4, 3, 4, 4, 7, 4, 4, 4, 2, 1
472 !byte 0, 3, 6, 9, 12, 15, 18, 21, 24, 27, 30, 32, 35
473 !byte 35, 38, 40, 43, 46, 49, 50, 52, 4, 55, 55, 60, 63
474 !byte 65, 68, 71, 73, 75, 78, 78, 33, 83, 86, 89, 94, 98
475 !byte 102, 106, 109, 112, 116, 94, 120, 123, 127, 130, 134, 139, 144
476 !byte 148, 153, 157, 161, 164, 167, 171, 178, 171, 182, 186, 5
478 !byte 56, 68, 56, 36,124, 4, 76, 84, 36, 68, 84, 40, 24, 40,124,100
479 !byte 84, 88, 56, 84, 72, 76, 80, 96, 40, 84, 40, 36, 84, 56, 44, 28
480 !byte 124, 36, 24, 24, 36,124, 24, 52, 16, 60, 80, 24, 37, 30,124, 32
481 !byte 28,188, 1,190,124, 24, 36, 60, 32, 28, 32, 28, 24, 36, 24, 63
482 !byte 36, 24, 36, 63, 60, 16, 32, 52, 44,120, 36, 56, 4, 60, 56, 4
483 !byte 56, 4, 56, 57, 6, 56, 44, 52, 36, 12, 48,208, 48, 12,252,164
484 !byte 164, 88,120,132,132, 72,252,132,132,120,252,164,132,252,160,128
485 !byte 120,132,164, 56,252, 32, 32,252, 8, 4,248,252, 48, 80,140,252
486 !byte 4, 4, 252, 64, 60, 64,252, 64, 48, 8,252,120,132,132,132,120
487 !byte 252,144,144, 96,120,132,134,133,120,252,144,144,108, 68,164,164
488 !byte 152,128,252,128,248, 4, 4,248, 4, 8,240,224, 28, 16,224, 28
489 !byte 16,224,204, 48, 48,204,140,148,164,196, 0, 0
493 !byte (128+5), 41, 10, 28, 29, 63, 63, 63
494 !byte (128+8), 15, 10, 28, 29, 14, 27, 63, 63, 63
495 !byte (128+4), 55, 17, 18, 28, 62, 18, 28, 62, 10
496 !byte (128+8), 27, 14, 10, 21, 21, 34
497 !byte (128+15), 15, 10, 28, 29
498 !byte (128+14), 39, 40, 48, 50
500 !byte (128+17), 10, 23, 13, 62, 23, 24, 32
501 !byte (128+8), 28, 24, 22, 14
502 !byte (128+8), 11, 14, 10, 30, 29, 18, 15, 30, 21
503 !byte (128+0), 14, 15, 15, 14, 12, 29, 28, 63, 63, 63
507 !byte 55, 17, 18, 28, 62, 18, 28, 62, 10, 21, 21
508 !byte (128+1), 15, 24, 27, 62, 23, 24, 32
509 !byte (128+8), 11, 34, 14, 63, 63, 63
510 !byte (128+13), 63, 63, 63, 11, 34, 14
513 !byte (128+15), 11, 34, 62, 39, 48, 54, 38
514 !byte 2, 0, 0, 7, 63, 5, 63, 2, 9
515 !byte 11, 34, 62, 39, 48, 54, 38
516 !byte 2, 0, 0, 7, 63, 5, 63, 2, 9
517 !byte 11, 34, 62, 39, 48, 54, 38
518 !byte 2, 0, 0, 7, 63, 5, 63, 2, 9
526 : ===========================================================================
527 !source "moireSmooth.asm"
528 : ===========================================================================
532 ; Parameters (consts)
541 .iter = moire_temp + 10
542 .valStartX = moire_temp + 11
543 .deltaX = moire_temp + 12
544 .deltaY = moire_temp + 13
545 .yPos = moire_temp + 14
552 !macro add16 .var, .value {
562 !macro sto16 .var, .value {
613 +sto16 .o1, .scr + $01E0
614 +sto16 .o2, .scr + $0200
615 +sto16 .o3, .scr + $01F0
616 +sto16 .o4, .scr + $0210
667 !byte 0,11,12,15,1,15,12,11
668 !byte 0,11,12,15,1,15,12,11
669 !byte 0,11,12,15,1,15,12,11
670 !byte 0,11,12,15,1,15,12,11
674 : ===========================================================================
686 ; Start show-pos from middle of screen
694 ; Clear old text image
710 bne notChangeTextColor
730 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
731 ; End of first text, do moire!
735 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
736 ; End of moire, do ending text