Rev 3905 | Rev 6270 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 3905 | Rev 3930 | ||
---|---|---|---|
Line 12... | Line 12... | ||
12 | fg2color equ 0x00E0B0A0 ;colorref |
12 | fg2color equ 0x00E0B0A0 ;colorref |
13 | fg3color equ 0x007F7F55 |
13 | fg3color equ 0x007F7F55 |
14 | btcolor equ 0x005B6200 |
14 | btcolor equ 0x005B6200 |
Line 15... | Line 15... | ||
15 | 15 | ||
- | 16 | include '..\..\macros.inc' |
|
- | 17 | include 'lang.inc' |
|
- | 18 | ; fetch the UTF-8 character in string+offs to char |
|
- | 19 | ; common part for all encodings: translate pseudographics |
|
- | 20 | ; Pseudographics for the boot screen: |
|
- | 21 | ; 0x2500 -> 0xC4, 0x2502 -> 0xB3, 0x250C -> 0xDA, 0x2510 -> 0xBF, |
|
- | 22 | ; 0x2514 -> 0xC0, 0x2518 -> 0xD9, 0x252C -> 0xC2, 0x2534 -> 0xC1, 0x2551 -> 0xBA |
|
- | 23 | macro fetch_utf8_char string, offs, char, graph |
|
- | 24 | { local first_byte, b |
|
- | 25 | virtual at 0 |
|
- | 26 | db string |
|
- | 27 | if offs >= $ |
|
- | 28 | char = -1 |
|
- | 29 | else |
|
- | 30 | ; fetch first byte |
|
- | 31 | load first_byte byte from offs |
|
- | 32 | if first_byte < 0x80 |
|
- | 33 | char = first_byte |
|
- | 34 | offs = offs + 1 |
|
- | 35 | else if first_byte < 0xC0 |
|
- | 36 | .err Invalid UTF-8 string |
|
- | 37 | else if first_byte < 0xE0 |
|
- | 38 | char = first_byte and 0x1F |
|
- | 39 | load b byte from offs + 1 |
|
- | 40 | char = (char shl 6) + (b and 0x3F) |
|
- | 41 | offs = offs + 2 |
|
- | 42 | else if first_byte < 0xF0 |
|
- | 43 | char = first_byte and 0xF |
|
- | 44 | load b byte from offs + 1 |
|
- | 45 | char = (char shl 6) + (b and 0x3F) |
|
- | 46 | load b byte from offs + 2 |
|
- | 47 | char = (char shl 6) + (b and 0x3F) |
|
- | 48 | offs = offs + 3 |
|
- | 49 | else if first_byte < 0xF8 |
|
- | 50 | char = first_byte and 0x7 |
|
- | 51 | load b byte from offs + 1 |
|
- | 52 | char = (char shl 6) + (b and 0x3F) |
|
- | 53 | load b byte from offs + 2 |
|
- | 54 | char = (char shl 6) + (b and 0x3F) |
|
- | 55 | load b byte from offs + 3 |
|
- | 56 | char = (char shl 6) + (b and 0x3F) |
|
- | 57 | offs = offs + 4 |
|
- | 58 | else |
|
- | 59 | .err Invalid UTF-8 string |
|
- | 60 | end if |
|
- | 61 | end if |
|
- | 62 | end virtual |
|
- | 63 | if char = 0x2500 |
|
- | 64 | graph = 0xC4 |
|
- | 65 | else if char = 0x2502 |
|
- | 66 | graph = 0xB3 |
|
- | 67 | else if char = 0x250C |
|
- | 68 | graph = 0xDA |
|
- | 69 | else if char = 0x2510 |
|
- | 70 | graph = 0xBF |
|
- | 71 | else if char = 0x2514 |
|
- | 72 | graph = 0xC0 |
|
- | 73 | else if char = 0x2518 |
|
- | 74 | graph = 0xD9 |
|
- | 75 | else if char = 0x252C |
|
- | 76 | graph = 0xC2 |
|
- | 77 | else if char = 0x2534 |
|
- | 78 | graph = 0xC1 |
|
- | 79 | else if char = 0x2551 |
|
- | 80 | graph = 0xBA |
|
- | 81 | else |
|
- | 82 | graph = 0 |
|
- | 83 | end if |
|
- | 84 | } |
|
- | 85 | ; Latin-1 encoding |
|
- | 86 | ; 0x00-0xFF - trivial map |
|
- | 87 | macro latin1 [arg] |
|
- | 88 | { local offs, char, graph |
|
- | 89 | offs = 0 |
|
- | 90 | while 1 |
|
- | 91 | fetch_utf8_char arg, offs, char, graph |
|
- | 92 | if char = -1 |
|
- | 93 | break |
|
- | 94 | end if |
|
- | 95 | if graph |
|
- | 96 | db graph |
|
- | 97 | else if char < 0x100 |
|
- | 98 | db char |
|
- | 99 | else |
|
- | 100 | .err Failed to convert to Latin-1 |
|
- | 101 | end if |
|
16 | include '..\..\macros.inc' |
102 | end while |
17 | 103 | } |
|
Line 18... | Line 104... | ||
18 | use32 |
104 | use32 |
Line 19... | Line 105... | ||
19 | 105 | ||
Line 321... | Line 407... | ||
321 | mov eax,13 ;clear time and score area |
407 | mov eax,13 ;clear time and score area |
322 | mov ebx,50 shl 16 +15 |
408 | mov ebx,50 shl 16 +15 |
323 | mov ecx,395 shl 16 +15 |
409 | mov ecx,395 shl 16 +15 |
324 | mov edx,bgcolor |
410 | mov edx,bgcolor |
325 | mcall |
411 | mcall |
- | 412 | if lang eq et |
|
- | 413 | add ebx,60 shl 16 + 30 |
|
- | 414 | else |
|
326 | add ebx,60 shl 16 + 20 |
415 | add ebx,60 shl 16 + 20 |
- | 416 | end if |
|
327 | mcall |
417 | mcall |
328 | add ebx,80 shl 16 |
418 | add ebx,80 shl 16 |
329 | mcall |
419 | mcall |
330 | mov eax,47 |
420 | mov eax,47 |
331 | mov ebx,0x20000 |
421 | mov ebx,0x20000 |
Line 333... | Line 423... | ||
333 | mov edx,50*65536+398 |
423 | mov edx,50*65536+398 |
334 | mov esi,fg2color |
424 | mov esi,fg2color |
335 | mcall |
425 | mcall |
336 | mov ebx,0x50000 |
426 | mov ebx,0x50000 |
337 | mov ecx,[score] |
427 | mov ecx,[score] |
- | 428 | if lang eq et |
|
- | 429 | add edx,70 shl 16 |
|
- | 430 | else |
|
338 | add edx,60 shl 16 |
431 | add edx,60 shl 16 |
- | 432 | end if |
|
339 | mcall |
433 | mcall |
340 | mov ebx,0x20000 |
434 | mov ebx,0x20000 |
341 | mov ecx,[level] |
435 | mov ecx,[level] |
342 | add edx,80 shl 16 |
436 | add edx,80 shl 16 |
343 | mcall |
437 | mcall |
Line 594... | Line 688... | ||
594 | popa |
688 | popa |
595 | ret |
689 | ret |
Line 596... | Line 690... | ||
596 | 690 | ||
- | 691 | ||
- | 692 | ; DATA AREA |
|
- | 693 | if lang eq et |
|
- | 694 | title db 'Torud',0 |
|
- | 695 | lbl_gameover: |
|
- | 696 | db 19 |
|
- | 697 | latin1 'M ä n g L ä b i !' |
|
- | 698 | lbl_start_a_new_game: |
|
597 | 699 | db 21 |
|
- | 700 | latin1 'Alusta enne uut mängu' |
|
- | 701 | lbl_win: |
|
- | 702 | db 32 |
|
- | 703 | latin1 ' T u b l i ! ' |
|
- | 704 | latin1 ' Lähme edasi! ' |
|
- | 705 | lbl_yscore: |
|
- | 706 | db 12 |
|
- | 707 | latin1 'Sinu tulemus:' |
|
- | 708 | lbl_toolbar: |
|
- | 709 | db 43 |
|
- | 710 | latin1 'Uus mäng: Lihtne Keskmine Raske' |
|
- | 711 | lbl_copy: |
|
- | 712 | db 24 |
|
- | 713 | latin1 'v1.21 2006,Mario Birkner' |
|
- | 714 | lbl_score: |
|
598 | ; DATA AREA |
715 | db 28 |
599 | 716 | latin1 'Aeg: Tulemus: Tase:' |
|
600 | 717 | else |
|
601 | title db 'Pipes',0 |
718 | title db 'Pipes',0 |
602 | lbl_gameover: |
719 | lbl_gameover: |
603 | db 19 |
720 | db 19 |
Line 619... | Line 736... | ||
619 | db 24 |
736 | db 24 |
620 | db 'v1.21 2006,Mario Birkner' |
737 | db 'v1.21 2006,Mario Birkner' |
621 | lbl_score: |
738 | lbl_score: |
622 | db 28 |
739 | db 28 |
623 | db 'Time: Score: Level:' |
740 | db 'Time: Score: Level:' |
- | 741 | end if |
|
624 | stat db 3 ;0=gameplay 1=won 2-lost 3=stopped |
742 | stat db 3 ;0=gameplay 1=won 2-lost 3=stopped |
625 | speed db 0 |
743 | speed db 0 |
626 | time dd 0 |
744 | time dd 0 |
627 | diffic db 0 ;1=hard 3=moderate 5=easy 8=dedicated to Wildwest - try it out! |
745 | diffic db 0 ;1=hard 3=moderate 5=easy 8=dedicated to Wildwest - try it out! |
628 | score dd 0 |
746 | score dd 0 |