Rev 205 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 205 | Rev 485 | ||
---|---|---|---|
Line 5... | Line 5... | ||
5 | ; last update: 21/07/2004 |
5 | ; last update: 21/07/2004 |
6 | ; written by: Alexandr Gorbovets |
6 | ; written by: Alexandr Gorbovets |
7 | ; e-mail: gorsash@mail.ru |
7 | ; e-mail: gorsash@mail.ru |
Line 8... | Line 8... | ||
8 | 8 | ||
9 | 9 | ||
Line 10... | Line 10... | ||
10 | include "macros.inc" |
10 | include "..\..\macros.inc" |
11 | meos_app_start |
11 | meos_app_start |
12 | 12 | ||
Line 13... | Line 13... | ||
13 | code |
13 | code |
14 | call randomize |
14 | call randomize |
15 | call draw_window |
15 | call draw_window |
Line 16... | Line 16... | ||
16 | 16 | ||
17 | wait_event: |
17 | wait_event: |
18 | mov eax, 10 |
18 | mov eax, 10 |
19 | int 0x40 |
19 | mcall |
Line 34... | Line 34... | ||
34 | jmp wait_event |
34 | jmp wait_event |
Line 35... | Line 35... | ||
35 | 35 | ||
36 | 36 | ||
37 | key: ; key event handler |
37 | key: ; key event handler |
Line 38... | Line 38... | ||
38 | mov eax, 2 ; get key code |
38 | mov eax, 2 ; get key code |
Line 39... | Line 39... | ||
39 | int 0x40 |
39 | mcall |
40 | 40 | ||
41 | jmp wait_event |
41 | jmp wait_event |
Line 42... | Line 42... | ||
42 | 42 | ||
43 | button: ; button event handler |
43 | button: ; button event handler |
Line 44... | Line 44... | ||
44 | mov eax, 17 ; get button identifier |
44 | mov eax, 17 ; get button identifier |
Line 66... | Line 66... | ||
66 | jmp wait_event |
66 | jmp wait_event |
Line 67... | Line 67... | ||
67 | 67 | ||
68 | 68 | ||
69 | exit_app: |
69 | exit_app: |
Line 70... | Line 70... | ||
70 | mov eax, -1 ; exit application |
70 | mov eax, -1 ; exit application |
71 | int 0x40 |
71 | mcall |
72 | 72 | ||
73 | common_card: |
73 | common_card: |
Line 594... | Line 594... | ||
594 | draw_window: |
594 | draw_window: |
595 | mov eax,48 ; get system colors |
595 | mov eax,48 ; get system colors |
596 | mov ebx,3 |
596 | mov ebx,3 |
597 | mov ecx,syscolors |
597 | mov ecx,syscolors |
598 | mov edx,sizeof.system_colors |
598 | mov edx,sizeof.system_colors |
599 | int 0x40 |
599 | mcall |
Line 600... | Line 600... | ||
600 | 600 | ||
601 | 601 | ||
602 | mov eax, 12 ; start drawing |
602 | mov eax, 12 ; start drawing |
Line 603... | Line 603... | ||
603 | mov ebx, 1 |
603 | mov ebx, 1 |
604 | int 0x40 |
604 | mcall |
605 | 605 | ||
606 | mov eax, 0 ; create and draw the window |
606 | mov eax, 0 ; create and draw the window |
607 | mov ebx, 100 * 65536 + 8 * cardwidth + 10 + 7 * columnspace |
607 | mov ebx, 100 * 65536 + 8 * cardwidth + 10 + 7 * columnspace |
608 | mov ecx, 100 * 65536 + 500 |
608 | mov ecx, 100 * 65536 + 500 |
Line 609... | Line 609... | ||
609 | mov edx, 0x13008000 |
609 | mov edx, 0x13008000 |
610 | mov edi, header |
610 | mov edi, title |
611 | int 0x40 |
611 | mcall |
612 | 612 | ||
Line 613... | Line 613... | ||
613 | mov eax, 9 ; getting window info |
613 | mov eax, 9 ; getting window info |
614 | mov ebx, process_info |
614 | mov ebx, process_info |
Line 615... | Line 615... | ||
615 | mov ecx, -1 ; we want to know info of our window |
615 | mov ecx, -1 ; we want to know info of our window |
616 | int 0x40 |
616 | mcall |
Line 617... | Line 617... | ||
617 | 617 | ||
618 | 618 | ||
Line 619... | Line 619... | ||
619 | mov eax, [process_info.y_size] |
619 | mov eax, [process_info.box.height] |
620 | mov [WindowHeight], ax |
620 | mov [WindowHeight], ax |
621 | 621 | ||
622 | mov eax, [process_info.x_size] |
622 | mov eax, [process_info.box.width] |
623 | mov [WindowWidth], ax |
623 | mov [WindowWidth], ax |
624 | 624 | ||
625 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
625 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
626 | ; draw top panel |
626 | ; draw top panel |
Line 627... | Line 627... | ||
627 | 627 | ||
Line 628... | Line 628... | ||
628 | mov eax, 13 |
628 | mov eax, 13 |
629 | mov ebx, 5 |
629 | mov ebx, 5 |
630 | shl ebx, 16 |
630 | shl ebx, 16 |
631 | add bx, word [process_info.x_size] |
631 | add bx, word [process_info.box.width] |
632 | sub bx, 9 |
632 | sub bx, 9 |
633 | mov ecx, 22 shl 16 + topbuttonsbarheight - 1 |
633 | mov ecx, 22 shl 16 + topbuttonsbarheight - 1 |
Line 634... | Line 634... | ||
634 | mov edx, [syscolors.work_graph] |
634 | mov edx, [syscolors.work_graph] |
635 | int $40 |
635 | mcall |
636 | 636 | ||
637 | ; draw button "new game" |
637 | ; draw button "new game" |
638 | 638 | ||
639 | mov eax, 8 |
639 | mov eax, 8 |
Line 640... | Line 640... | ||
640 | mov ebx, 5 shl 16 + 80 |
640 | mov ebx, 5 shl 16 + 80 |
641 | mov ecx, 22 shl 16 + topbuttonsbarheight - 2 |
641 | mov ecx, 22 shl 16 + topbuttonsbarheight - 2 |
642 | mov edx, 1 + 8 + 4 + 4 + 1 ;button id |
642 | mov edx, 1 + 8 + 4 + 4 + 1 ;button id |
643 | mov esi, [syscolors.work_button] |
643 | mov esi, [syscolors.work_button] |
644 | int $40 |
644 | mcall |
645 | 645 | ||
646 | mov eax, 4 |
646 | mov eax, 4 |
Line 647... | Line 647... | ||
647 | mov ebx, 20 shl 16 + 22 + topbuttonsbarheight/2 - 4 |
647 | mov ebx, 20 shl 16 + 22 + topbuttonsbarheight/2 - 4 |
648 | mov ecx, [syscolors.work_button_text] |
648 | mov ecx, [syscolors.work_button_text] |
649 | mov edx, new_game |
649 | mov edx, new_game |
650 | mov esi, new_game_len |
650 | mov esi, new_game_len |
651 | int $40 |
651 | mcall |
652 | 652 | ||
653 | 653 | ||
654 | ; draw button "exit" |
654 | ; draw button "exit" |
655 | mov eax, 8 |
655 | mov eax, 8 |
656 | mov ebx, (5 + 85) shl 16 + 80 + 5 |
656 | mov ebx, (5 + 85) shl 16 + 80 + 5 |
657 | mov ecx, 22 shl 16 + topbuttonsbarheight - 2 |
657 | mov ecx, 22 shl 16 + topbuttonsbarheight - 2 |
658 | mov edx, 1 + 8 + 4 + 4 + 2 ;button id |
658 | mov edx, 1 + 8 + 4 + 4 + 2 ;button id |
659 | mov esi, [syscolors.work_button] |
659 | mov esi, [syscolors.work_button] |
660 | int $40 |
660 | mcall |
661 | 661 | ||
Line 662... | Line 662... | ||
662 | mov eax, 4 |
662 | mov eax, 4 |
663 | mov ebx, (40 + 80) shl 16 + 22 + topbuttonsbarheight/2 - 4 |
663 | mov ebx, (40 + 80) shl 16 + 22 + topbuttonsbarheight/2 - 4 |
664 | mov ecx, [syscolors.work_button_text] |
664 | mov ecx, [syscolors.work_button_text] |
665 | mov edx, exit |
665 | mov edx, exit |
666 | mov esi, exit_len |
666 | mov esi, exit_len |
667 | int $40 |
667 | mcall |
668 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
668 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
Line 669... | Line 669... | ||
669 | ; draw separators between home, temp and common cells |
669 | ; draw separators between home, temp and common cells |
Line 689... | Line 689... | ||
689 | shl ebx, 16 |
689 | shl ebx, 16 |
690 | add bx, 1 |
690 | add bx, 1 |
691 | mov ecx, (21 + topbuttonsbarheight) shl 16 + cardheight + columnspace |
691 | mov ecx, (21 + topbuttonsbarheight) shl 16 + cardheight + columnspace |
692 | mov edx, [syscolors.work_graph] |
692 | mov edx, [syscolors.work_graph] |
693 | mov eax, 13 |
693 | mov eax, 13 |
694 | int $40 |
694 | mcall |
Line 695... | Line 695... | ||
695 | 695 | ||
696 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
696 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
Line 697... | Line 697... | ||
697 | ; draw temp buttons |
697 | ; draw temp buttons |
Line 719... | Line 719... | ||
719 | ; number of column where lay card |
719 | ; number of column where lay card |
Line 720... | Line 720... | ||
720 | 720 | ||
721 | mov [row], eax |
721 | mov [row], eax |
Line 722... | Line 722... | ||
722 | mov [column], edx |
722 | mov [column], edx |
723 | 723 | ||
724 | mov eax, [process_info.x_size] ; width of window |
724 | mov eax, [process_info.box.width] ; width of window |
725 | sub eax, 10 |
725 | sub eax, 10 |
726 | sub eax, cardwidth |
726 | sub eax, cardwidth |
727 | mov ebx, 7 |
727 | mov ebx, 7 |
Line 766... | Line 766... | ||
766 | shl ecx, 16 |
766 | shl ecx, 16 |
767 | add cx, cardheight - 1 |
767 | add cx, cardheight - 1 |
768 | mov edx, [column] |
768 | mov edx, [column] |
769 | add edx, 01000000000000000000000000000000b + 2 + 8; button id = column |
769 | add edx, 01000000000000000000000000000000b + 2 + 8; button id = column |
770 | ; id = 1 reserved as close button |
770 | ; id = 1 reserved as close button |
771 | int $40 |
771 | mcall |
Line 772... | Line 772... | ||
772 | 772 | ||
773 | 773 | ||
774 | inc [j] |
774 | inc [j] |
Line 802... | Line 802... | ||
802 | ; number of column where lay card |
802 | ; number of column where lay card |
Line 803... | Line 803... | ||
803 | 803 | ||
804 | mov [row], eax |
804 | mov [row], eax |
Line 805... | Line 805... | ||
805 | mov [column], edx |
805 | mov [column], edx |
806 | 806 | ||
807 | mov eax, [process_info.x_size] ; width of window |
807 | mov eax, [process_info.box.width] ; width of window |
808 | sub eax, 10 |
808 | sub eax, 10 |
809 | sub eax, cardwidth |
809 | sub eax, cardwidth |
810 | mov ebx, 7 |
810 | mov ebx, 7 |
Line 838... | Line 838... | ||
838 | add cx, cardheight - 1 |
838 | add cx, cardheight - 1 |
839 | mov edx, [column] |
839 | mov edx, [column] |
840 | add edx, 01000000000000000000000000000000b + 2 + 8 + 4 ; button id |
840 | add edx, 01000000000000000000000000000000b + 2 + 8 + 4 ; button id |
Line 841... | Line 841... | ||
841 | 841 | ||
842 | ; id = 1 reserved as close button |
842 | ; id = 1 reserved as close button |
Line 843... | Line 843... | ||
843 | int $40 |
843 | mcall |
844 | 844 | ||
845 | 845 | ||
Line 882... | Line 882... | ||
882 | ; number of column where lay card |
882 | ; number of column where lay card |
Line 883... | Line 883... | ||
883 | 883 | ||
884 | mov [row], eax |
884 | mov [row], eax |
Line 885... | Line 885... | ||
885 | mov [column], edx |
885 | mov [column], edx |
886 | 886 | ||
887 | mov eax, [process_info.x_size] ; width of window |
887 | mov eax, [process_info.box.width] ; width of window |
888 | sub eax, 10 |
888 | sub eax, 10 |
889 | sub eax, cardwidth |
889 | sub eax, cardwidth |
890 | mov ebx, 7 |
890 | mov ebx, 7 |
Line 953... | Line 953... | ||
953 | shl ecx, 16 |
953 | shl ecx, 16 |
954 | add cx, cardheight - 1 |
954 | add cx, cardheight - 1 |
955 | mov edx, [column] |
955 | mov edx, [column] |
956 | add edx, 01000000000000000000000000000000b + 2; button id = column + 2, |
956 | add edx, 01000000000000000000000000000000b + 2; button id = column + 2, |
957 | ; id = 1 reserved as close button |
957 | ; id = 1 reserved as close button |
958 | int $40 |
958 | mcall |
Line 959... | Line 959... | ||
959 | 959 | ||
Line 960... | Line 960... | ||
960 | 960 | ||
Line 969... | Line 969... | ||
969 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
969 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
Line 970... | Line 970... | ||
970 | 970 | ||
971 | 971 | ||
972 | mov eax, 12 ; finish drawing |
972 | mov eax, 12 ; finish drawing |
Line 973... | Line 973... | ||
973 | mov ebx, 2 |
973 | mov ebx, 2 |
Line 974... | Line 974... | ||
974 | int $40 |
974 | mcall |
Line 1048... | Line 1048... | ||
1048 | jmp .later |
1048 | jmp .later |
Line 1049... | Line 1049... | ||
1049 | 1049 | ||
1050 | 1050 | ||
1051 | .exit: |
1051 | .exit: |
Line 1052... | Line 1052... | ||
1052 | mov eax, -1 |
1052 | mov eax, -1 |
Line 1053... | Line 1053... | ||
1053 | int $40 |
1053 | mcall |
Line 1103... | Line 1103... | ||
1103 | 1103 | ||
1104 | mov ecx, [ypos] |
1104 | mov ecx, [ypos] |
1105 | add ecx, 2 |
1105 | add ecx, 2 |
1106 | shl ecx, 16 |
1106 | shl ecx, 16 |
1107 | mov cx, cardheight - 4 |
1107 | mov cx, cardheight - 4 |
Line 1108... | Line 1108... | ||
1108 | int $40 |
1108 | mcall |
Line 1109... | Line 1109... | ||
1109 | 1109 | ||
1110 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
1110 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
Line 1117... | Line 1117... | ||
1117 | add ecx, 5 |
1117 | add ecx, 5 |
1118 | shl ecx, 16 |
1118 | shl ecx, 16 |
1119 | xor cx, cx |
1119 | xor cx, cx |
1120 | mov cx, cardheight - 2 * radius - 2 |
1120 | mov cx, cardheight - 2 * radius - 2 |
1121 | mov edx, [blackcolor] |
1121 | mov edx, [blackcolor] |
1122 | int $40 |
1122 | mcall |
Line 1123... | Line 1123... | ||
1123 | 1123 | ||
1124 | mov ebx, [xpos] ; left white line |
1124 | mov ebx, [xpos] ; left white line |
1125 | inc ebx |
1125 | inc ebx |
1126 | shl ebx, 16 |
1126 | shl ebx, 16 |
1127 | mov bx, 1 |
1127 | mov bx, 1 |
1128 | mov edx, [bgcolor] |
1128 | mov edx, [bgcolor] |
Line 1129... | Line 1129... | ||
1129 | int $40 |
1129 | mcall |
1130 | 1130 | ||
1131 | mov ebx, [xpos] ; right black line |
1131 | mov ebx, [xpos] ; right black line |
1132 | add ebx, cardwidth - 1 |
1132 | add ebx, cardwidth - 1 |
1133 | shl ebx, 16 |
1133 | shl ebx, 16 |
1134 | mov bx, 1 |
1134 | mov bx, 1 |
Line 1135... | Line 1135... | ||
1135 | mov edx, [blackcolor] |
1135 | mov edx, [blackcolor] |
1136 | int $40 |
1136 | mcall |
1137 | 1137 | ||
1138 | mov ebx, [xpos] ; right white line |
1138 | mov ebx, [xpos] ; right white line |
1139 | add ebx, cardwidth - 2 |
1139 | add ebx, cardwidth - 2 |
1140 | shl ebx, 16 |
1140 | shl ebx, 16 |
Line 1141... | Line 1141... | ||
1141 | mov bx, 1 |
1141 | mov bx, 1 |
Line 1142... | Line 1142... | ||
1142 | mov edx, [bgcolor] |
1142 | mov edx, [bgcolor] |
1143 | int $40 |
1143 | mcall |
Line 1151... | Line 1151... | ||
1151 | mov ebx, [xpos] |
1151 | mov ebx, [xpos] |
1152 | add ebx, 5 |
1152 | add ebx, 5 |
1153 | shl ebx, 16 |
1153 | shl ebx, 16 |
1154 | mov bx, cardwidth - 2 * radius - 2 |
1154 | mov bx, cardwidth - 2 * radius - 2 |
1155 | mov edx, [blackcolor] |
1155 | mov edx, [blackcolor] |
1156 | int $40 |
1156 | mcall |
Line 1157... | Line 1157... | ||
1157 | 1157 | ||
1158 | mov ecx, [ypos] ; top white line |
1158 | mov ecx, [ypos] ; top white line |
1159 | inc ecx |
1159 | inc ecx |
1160 | shl ecx, 16 |
1160 | shl ecx, 16 |
1161 | mov cx, 1 |
1161 | mov cx, 1 |
1162 | mov edx, [bgcolor] |
1162 | mov edx, [bgcolor] |
Line 1163... | Line 1163... | ||
1163 | int $40 |
1163 | mcall |
1164 | 1164 | ||
1165 | mov ecx, [ypos] ; bottom black line |
1165 | mov ecx, [ypos] ; bottom black line |
1166 | add ecx, cardheight - 1 |
1166 | add ecx, cardheight - 1 |
1167 | shl ecx, 16 |
1167 | shl ecx, 16 |
1168 | mov cx, 1 |
1168 | mov cx, 1 |
Line 1169... | Line 1169... | ||
1169 | mov edx, [blackcolor] |
1169 | mov edx, [blackcolor] |
1170 | int $40 |
1170 | mcall |
1171 | 1171 | ||
1172 | mov ecx, [ypos] ; bottom white line |
1172 | mov ecx, [ypos] ; bottom white line |
1173 | add ecx, cardheight - 2 |
1173 | add ecx, cardheight - 2 |
1174 | shl ecx, 16 |
1174 | shl ecx, 16 |
Line 1175... | Line 1175... | ||
1175 | mov cx, 1 |
1175 | mov cx, 1 |
Line 1176... | Line 1176... | ||
1176 | mov edx, [bgcolor] |
1176 | mov edx, [bgcolor] |
1177 | int $40 |
1177 | mcall |
Line 1178... | Line 1178... | ||
1178 | 1178 | ||
1179 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
1179 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
1180 | 1180 | ||
1181 | mov eax, 1 ; drawing points |
1181 | mov eax, 1 ; drawing points |
1182 | mov edx, [blackcolor] ; black color for all pixels |
1182 | mov edx, [blackcolor] ; black color for all pixels |
Line 1183... | Line 1183... | ||
1183 | 1183 | ||
1184 | mov ebx, [xpos] ; draw top left corner |
1184 | mov ebx, [xpos] ; draw top left corner |
Line 1185... | Line 1185... | ||
1185 | mov ecx, [ypos] |
1185 | mov ecx, [ypos] |
1186 | inc ebx |
1186 | inc ebx |
1187 | add ecx, 4 |
1187 | add ecx, 4 |
Line 1188... | Line 1188... | ||
1188 | int $40 |
1188 | mcall |
1189 | 1189 | ||
1190 | dec ecx |
1190 | dec ecx |
Line 1191... | Line 1191... | ||
1191 | int $40 |
1191 | mcall |
1192 | 1192 | ||
Line 1193... | Line 1193... | ||
1193 | dec ecx |
1193 | dec ecx |
1194 | inc ebx |
1194 | inc ebx |
1195 | int $40 |
1195 | mcall |
1196 | 1196 | ||
1197 | dec ecx |
1197 | dec ecx |
Line 1198... | Line 1198... | ||
1198 | inc ebx |
1198 | inc ebx |
1199 | int $40 |
1199 | mcall |
Line 1200... | Line 1200... | ||
1200 | 1200 | ||
1201 | inc ebx |
1201 | inc ebx |
1202 | int $40 |
1202 | mcall |
Line 1203... | Line 1203... | ||
1203 | 1203 | ||
1204 | mov ebx, [xpos] ;drawing top right corner |
1204 | mov ebx, [xpos] ;drawing top right corner |
1205 | mov ecx, [ypos] |
1205 | mov ecx, [ypos] |
Line 1206... | Line 1206... | ||
1206 | add ebx, cardwidth - 2 |
1206 | add ebx, cardwidth - 2 |
1207 | add ecx, 4 |
1207 | add ecx, 4 |
1208 | int $40 |
1208 | mcall |
1209 | 1209 | ||
1210 | dec ecx |
1210 | dec ecx |
1211 | int $40 |
1211 | mcall |
1212 | 1212 | ||
1213 | dec ebx |
1213 | dec ebx |
Line 1214... | Line 1214... | ||
1214 | dec ecx |
1214 | dec ecx |
1215 | int $40 |
1215 | mcall |
Line 1216... | Line 1216... | ||
1216 | 1216 | ||
1217 | dec ebx |
1217 | dec ebx |
1218 | dec ecx |
1218 | dec ecx |
Line 1219... | Line 1219... | ||
1219 | int $40 |
1219 | mcall |
1220 | 1220 | ||
1221 | dec ebx |
1221 | dec ebx |
Line 1222... | Line 1222... | ||
1222 | int $40 |
1222 | mcall |
1223 | ;drawing bottom left corner |
1223 | ;drawing bottom left corner |
1224 | mov ebx, [xpos] |
1224 | mov ebx, [xpos] |
1225 | mov ecx, [ypos] |
1225 | mov ecx, [ypos] |
1226 | inc ebx |
1226 | inc ebx |
1227 | add ecx, cardheight - 5 |
1227 | add ecx, cardheight - 5 |
1228 | int $40 |
1228 | mcall |
1229 | 1229 | ||
Line 1230... | Line 1230... | ||
1230 | inc ecx |
1230 | inc ecx |
1231 | int $40 |
1231 | mcall |
Line 1232... | Line 1232... | ||
1232 | 1232 | ||
1233 | inc ebx |
1233 | inc ebx |
1234 | inc ecx |
1234 | inc ecx |
Line 1235... | Line 1235... | ||
1235 | int $40 |
1235 | mcall |
1236 | 1236 | ||
1237 | inc ebx |
1237 | inc ebx |
Line 1238... | Line 1238... | ||
1238 | inc ecx |
1238 | inc ecx |
1239 | int $40 |
1239 | mcall |
Line 1240... | Line 1240... | ||
1240 | 1240 | ||
1241 | inc ebx |
1241 | inc ebx |
Line 1301... | Line 1301... | ||
1301 | mov [color], esi |
1301 | mov [color], esi |
1302 | mov [imageaddr], heart |
1302 | mov [imageaddr], heart |
1303 | mov [imageflipaddr], heart_updown |
1303 | mov [imageflipaddr], heart_updown |
Line 1304... | Line 1304... | ||
1304 | 1304 | ||
1305 | mov ebx, heart_small |
1305 | mov ebx, heart_small |
Line 1306... | Line 1306... | ||
1306 | int $40 |
1306 | mcall |
Line 1307... | Line 1307... | ||
1307 | 1307 | ||
1308 | jmp .selnumber |
1308 | jmp .selnumber |
1309 | 1309 | ||
1310 | .diamond: |
1310 | .diamond: |
1311 | mov esi, [redcolor] |
1311 | mov esi, [redcolor] |
Line 1312... | Line 1312... | ||
1312 | mov [color], esi |
1312 | mov [color], esi |
1313 | mov [imageaddr], diamond |
1313 | mov [imageaddr], diamond |
Line 1314... | Line 1314... | ||
1314 | mov [imageflipaddr], diamond_updown |
1314 | mov [imageflipaddr], diamond_updown |
Line 1315... | Line 1315... | ||
1315 | 1315 | ||
1316 | mov ebx, diamond_small |
1316 | mov ebx, diamond_small |
1317 | int $40 |
1317 | mcall |
1318 | 1318 | ||
1319 | jmp .selnumber |
1319 | jmp .selnumber |
Line 1320... | Line 1320... | ||
1320 | 1320 | ||
1321 | .club: |
1321 | .club: |
Line 1322... | Line 1322... | ||
1322 | mov esi, [blackcolor] |
1322 | mov esi, [blackcolor] |
Line 1323... | Line 1323... | ||
1323 | mov [color], esi |
1323 | mov [color], esi |
1324 | mov [imageaddr], club |
1324 | mov [imageaddr], club |
1325 | mov [imageflipaddr], club_updown |
1325 | mov [imageflipaddr], club_updown |
1326 | 1326 | ||
1327 | mov ebx, club_small |
1327 | mov ebx, club_small |
Line 1328... | Line 1328... | ||
1328 | int $40 |
1328 | mcall |
1329 | 1329 | ||
Line 1330... | Line 1330... | ||
1330 | jmp .selnumber |
1330 | jmp .selnumber |
Line 1417... | Line 1417... | ||
1417 | .ace: |
1417 | .ace: |
1418 | mov eax, 4 |
1418 | mov eax, 4 |
1419 | mov [s], byte 'A' |
1419 | mov [s], byte 'A' |
1420 | mov edx, s |
1420 | mov edx, s |
1421 | mov esi, 1 |
1421 | mov esi, 1 |
1422 | int $40 |
1422 | mcall |
Line 1423... | Line 1423... | ||
1423 | 1423 | ||
1424 | call draw_1 |
1424 | call draw_1 |
Line 1425... | Line 1425... | ||
1425 | jmp .end |
1425 | jmp .end |
1426 | 1426 | ||
1427 | .two: |
1427 | .two: |
1428 | mov eax, 4 |
1428 | mov eax, 4 |
1429 | mov [s], byte '2' |
1429 | mov [s], byte '2' |
1430 | mov edx, s |
1430 | mov edx, s |
Line 1431... | Line 1431... | ||
1431 | mov esi, 1 |
1431 | mov esi, 1 |
1432 | int $40 |
1432 | mcall |
Line 1433... | Line 1433... | ||
1433 | 1433 | ||
1434 | call draw_2 |
1434 | call draw_2 |
1435 | jmp .end |
1435 | jmp .end |
1436 | 1436 | ||
1437 | 1437 | ||
1438 | .three: |
1438 | .three: |
Line 1439... | Line 1439... | ||
1439 | mov eax, 4 |
1439 | mov eax, 4 |
1440 | mov [s], byte '3' |
1440 | mov [s], byte '3' |
Line 1441... | Line 1441... | ||
1441 | mov edx, s |
1441 | mov edx, s |
Line 1450... | Line 1450... | ||
1450 | .four: |
1450 | .four: |
1451 | mov eax, 4 |
1451 | mov eax, 4 |
1452 | mov [s], byte '4' |
1452 | mov [s], byte '4' |
1453 | mov edx, s |
1453 | mov edx, s |
1454 | mov esi, 1 |
1454 | mov esi, 1 |
1455 | int $40 |
1455 | mcall |
Line 1456... | Line 1456... | ||
1456 | 1456 | ||
1457 | call draw_3 |
1457 | call draw_3 |
Line 1458... | Line 1458... | ||
1458 | jmp .end |
1458 | jmp .end |
1459 | 1459 | ||
1460 | .five: |
1460 | .five: |
1461 | mov eax, 4 |
1461 | mov eax, 4 |
1462 | mov [s], byte '5' |
1462 | mov [s], byte '5' |
1463 | mov edx, s |
1463 | mov edx, s |
Line 1464... | Line 1464... | ||
1464 | mov esi, 1 |
1464 | mov esi, 1 |
1465 | int $40 |
1465 | mcall |
Line 1466... | Line 1466... | ||
1466 | 1466 | ||
Line 1472... | Line 1472... | ||
1472 | .six: |
1472 | .six: |
1473 | mov eax, 4 |
1473 | mov eax, 4 |
1474 | mov [s], byte '6' |
1474 | mov [s], byte '6' |
1475 | mov edx, s |
1475 | mov edx, s |
1476 | mov esi, 1 |
1476 | mov esi, 1 |
1477 | int $40 |
1477 | mcall |
Line 1478... | Line 1478... | ||
1478 | 1478 | ||
1479 | call draw_3 |
1479 | call draw_3 |
Line 1480... | Line 1480... | ||
1480 | call draw_4 |
1480 | call draw_4 |
Line 1484... | Line 1484... | ||
1484 | .seven: |
1484 | .seven: |
1485 | mov eax, 4 |
1485 | mov eax, 4 |
1486 | mov [s], byte '7' |
1486 | mov [s], byte '7' |
1487 | mov edx, s |
1487 | mov edx, s |
1488 | mov esi, 1 |
1488 | mov esi, 1 |
1489 | int $40 |
1489 | mcall |
Line 1490... | Line 1490... | ||
1490 | 1490 | ||
1491 | call draw_3 |
1491 | call draw_3 |
1492 | call draw_4 |
1492 | call draw_4 |
Line 1497... | Line 1497... | ||
1497 | .eight: |
1497 | .eight: |
1498 | mov eax, 4 |
1498 | mov eax, 4 |
1499 | mov [s], byte '8' |
1499 | mov [s], byte '8' |
1500 | mov edx, s |
1500 | mov edx, s |
1501 | mov esi, 1 |
1501 | mov esi, 1 |
1502 | int $40 |
1502 | mcall |
Line 1503... | Line 1503... | ||
1503 | 1503 | ||
1504 | call draw_3 |
1504 | call draw_3 |
Line 1505... | Line 1505... | ||
1505 | call draw_5 |
1505 | call draw_5 |
Line 1509... | Line 1509... | ||
1509 | .nine: |
1509 | .nine: |
1510 | mov eax, 4 |
1510 | mov eax, 4 |
1511 | mov [s], byte '9' |
1511 | mov [s], byte '9' |
1512 | mov edx, s |
1512 | mov edx, s |
1513 | mov esi, 1 |
1513 | mov esi, 1 |
1514 | int $40 |
1514 | mcall |
Line 1515... | Line 1515... | ||
1515 | 1515 | ||
1516 | call draw_3 |
1516 | call draw_3 |
1517 | call draw_5 |
1517 | call draw_5 |
Line 1522... | Line 1522... | ||
1522 | .ten: |
1522 | .ten: |
1523 | mov eax, 4 |
1523 | mov eax, 4 |
1524 | mov [s], word '10' |
1524 | mov [s], word '10' |
1525 | mov edx, s |
1525 | mov edx, s |
1526 | mov esi, 2 |
1526 | mov esi, 2 |
1527 | int $40 |
1527 | mcall |
Line 1528... | Line 1528... | ||
1528 | 1528 | ||
1529 | call draw_3 |
1529 | call draw_3 |
1530 | call draw_5 |
1530 | call draw_5 |
1531 | call draw_6 |
1531 | call draw_6 |
Line 1536... | Line 1536... | ||
1536 | .jack: |
1536 | .jack: |
1537 | mov eax, 4 |
1537 | mov eax, 4 |
1538 | mov [s], byte 'J' |
1538 | mov [s], byte 'J' |
1539 | mov edx, s |
1539 | mov edx, s |
1540 | mov esi, 1 |
1540 | mov esi, 1 |
1541 | int $40 |
1541 | mcall |
Line 1542... | Line 1542... | ||
1542 | 1542 | ||
Line 1543... | Line 1543... | ||
1543 | jmp .end |
1543 | jmp .end |
1544 | 1544 | ||
1545 | .queen: |
1545 | .queen: |
1546 | mov eax, 4 |
1546 | mov eax, 4 |
1547 | mov [s], byte 'Q' |
1547 | mov [s], byte 'Q' |
1548 | mov edx, s |
1548 | mov edx, s |
Line 1549... | Line 1549... | ||
1549 | mov esi, 1 |
1549 | mov esi, 1 |
Line 1550... | Line 1550... | ||
1550 | int $40 |
1550 | mcall |
1551 | 1551 | ||
1552 | jmp .end |
1552 | jmp .end |
1553 | 1553 | ||
1554 | .king: |
1554 | .king: |
1555 | mov eax, 4 |
1555 | mov eax, 4 |
Line 1556... | Line 1556... | ||
1556 | mov [s], byte 'K' |
1556 | mov [s], byte 'K' |
Line 1557... | Line 1557... | ||
1557 | mov edx,s |
1557 | mov edx,s |
Line 1640... | Line 1640... | ||
1640 | add edx, cardwidth/2 - 8 |
1640 | add edx, cardwidth/2 - 8 |
1641 | shl edx, 16 |
1641 | shl edx, 16 |
1642 | mov dx, word [ypos] |
1642 | mov dx, word [ypos] |
1643 | add dx, cardheight/2 - 8 |
1643 | add dx, cardheight/2 - 8 |
1644 | mov eax, 7 |
1644 | mov eax, 7 |
1645 | int $40 |
1645 | mcall |
1646 | ret |
1646 | ret |
Line 1647... | Line 1647... | ||
1647 | 1647 | ||
Line 1656... | Line 1656... | ||
1656 | add edx, 40 - 8 |
1656 | add edx, 40 - 8 |
1657 | shl edx, 16 |
1657 | shl edx, 16 |
1658 | mov dx, word [ypos] |
1658 | mov dx, word [ypos] |
1659 | add dx, margin |
1659 | add dx, margin |
1660 | mov eax, 7 |
1660 | mov eax, 7 |
1661 | int $40 |
1661 | mcall |
1662 | ;draw bottom image |
1662 | ;draw bottom image |
1663 | mov ebx, [imageflipaddr] |
1663 | mov ebx, [imageflipaddr] |
1664 | mov edx, [xpos] |
1664 | mov edx, [xpos] |
1665 | add edx, cardwidth/2 - 8 |
1665 | add edx, cardwidth/2 - 8 |
1666 | shl edx, 16 |
1666 | shl edx, 16 |
1667 | mov dx, word [ypos] |
1667 | mov dx, word [ypos] |
1668 | add dx, cardheight - 16 - margin |
1668 | add dx, cardheight - 16 - margin |
1669 | mov eax, 7 |
1669 | mov eax, 7 |
1670 | int $40 |
1670 | mcall |
1671 | ret |
1671 | ret |
Line 1672... | Line 1672... | ||
1672 | 1672 | ||
Line 1673... | Line 1673... | ||
1673 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
1673 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
Line 1680... | Line 1680... | ||
1680 | add edx, margin |
1680 | add edx, margin |
1681 | shl edx, 16 |
1681 | shl edx, 16 |
1682 | mov dx, word [ypos] |
1682 | mov dx, word [ypos] |
1683 | add dx, margin |
1683 | add dx, margin |
1684 | mov eax, 7 |
1684 | mov eax, 7 |
1685 | int $40 |
1685 | mcall |
1686 | ;draw bottom left image |
1686 | ;draw bottom left image |
1687 | mov ebx, [imageflipaddr] |
1687 | mov ebx, [imageflipaddr] |
1688 | mov edx, [xpos] |
1688 | mov edx, [xpos] |
1689 | add edx, margin |
1689 | add edx, margin |
1690 | shl edx, 16 |
1690 | shl edx, 16 |
1691 | mov dx, word [ypos] |
1691 | mov dx, word [ypos] |
1692 | add dx, cardheight - margin - 16 |
1692 | add dx, cardheight - margin - 16 |
1693 | mov eax, 7 |
1693 | mov eax, 7 |
1694 | int $40 |
1694 | mcall |
1695 | ;draw top right image |
1695 | ;draw top right image |
1696 | mov ebx, [imageaddr] |
1696 | mov ebx, [imageaddr] |
1697 | mov edx, [xpos] |
1697 | mov edx, [xpos] |
1698 | add edx, cardwidth - margin - 16 |
1698 | add edx, cardwidth - margin - 16 |
1699 | shl edx, 16 |
1699 | shl edx, 16 |
1700 | mov dx, word [ypos] |
1700 | mov dx, word [ypos] |
1701 | add dx, margin |
1701 | add dx, margin |
1702 | mov eax, 7 |
1702 | mov eax, 7 |
1703 | int $40 |
1703 | mcall |
1704 | ;draw bottom right image |
1704 | ;draw bottom right image |
1705 | mov ebx, [imageflipaddr] |
1705 | mov ebx, [imageflipaddr] |
1706 | mov edx, [xpos] |
1706 | mov edx, [xpos] |
1707 | add edx, cardwidth - margin - 16 |
1707 | add edx, cardwidth - margin - 16 |
1708 | shl edx, 16 |
1708 | shl edx, 16 |
1709 | mov dx, word [ypos] |
1709 | mov dx, word [ypos] |
1710 | add dx, cardheight - margin - 16 |
1710 | add dx, cardheight - margin - 16 |
1711 | mov eax, 7 |
1711 | mov eax, 7 |
1712 | int $40 |
1712 | mcall |
1713 | ret |
1713 | ret |
Line 1714... | Line 1714... | ||
1714 | 1714 | ||
Line 1715... | Line 1715... | ||
1715 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
1715 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
Line 1722... | Line 1722... | ||
1722 | add edx, margin |
1722 | add edx, margin |
1723 | shl edx, 16 |
1723 | shl edx, 16 |
1724 | mov dx, word [ypos] |
1724 | mov dx, word [ypos] |
1725 | add dx, cardheight/2 - 8 |
1725 | add dx, cardheight/2 - 8 |
1726 | mov eax, 7 |
1726 | mov eax, 7 |
1727 | int $40 |
1727 | mcall |
1728 | ;draw center right image |
1728 | ;draw center right image |
1729 | mov edx, [xpos] |
1729 | mov edx, [xpos] |
1730 | add edx, cardwidth - margin - 16 |
1730 | add edx, cardwidth - margin - 16 |
1731 | shl edx, 16 |
1731 | shl edx, 16 |
1732 | mov dx, word [ypos] |
1732 | mov dx, word [ypos] |
1733 | add dx, cardheight/2 - 8 |
1733 | add dx, cardheight/2 - 8 |
1734 | mov eax, 7 |
1734 | mov eax, 7 |
1735 | int $40 |
1735 | mcall |
1736 | ret |
1736 | ret |
Line 1737... | Line 1737... | ||
1737 | 1737 | ||
Line 1738... | Line 1738... | ||
1738 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
1738 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
Line 1745... | Line 1745... | ||
1745 | add edx, margin |
1745 | add edx, margin |
1746 | shl edx, 16 |
1746 | shl edx, 16 |
1747 | mov dx, word [ypos] |
1747 | mov dx, word [ypos] |
1748 | add dx, cardheight * 3 / 9 |
1748 | add dx, cardheight * 3 / 9 |
1749 | mov eax, 7 |
1749 | mov eax, 7 |
1750 | int $40 |
1750 | mcall |
1751 | ;draw bottom left image |
1751 | ;draw bottom left image |
1752 | mov ebx, [imageflipaddr] |
1752 | mov ebx, [imageflipaddr] |
1753 | mov edx, [xpos] |
1753 | mov edx, [xpos] |
1754 | add edx, 16 |
1754 | add edx, 16 |
1755 | shl edx, 16 |
1755 | shl edx, 16 |
1756 | mov dx, word [ypos] |
1756 | mov dx, word [ypos] |
1757 | add dx, cardheight * 5 / 9 |
1757 | add dx, cardheight * 5 / 9 |
1758 | mov eax, 7 |
1758 | mov eax, 7 |
1759 | int $40 |
1759 | mcall |
1760 | ;draw top right image |
1760 | ;draw top right image |
1761 | mov ebx, [imageaddr] |
1761 | mov ebx, [imageaddr] |
1762 | mov edx, [xpos] |
1762 | mov edx, [xpos] |
1763 | add edx, cardwidth - margin - 16 |
1763 | add edx, cardwidth - margin - 16 |
1764 | shl edx, 16 |
1764 | shl edx, 16 |
1765 | mov dx, word [ypos] |
1765 | mov dx, word [ypos] |
1766 | add dx, cardheight * 3 / 9 |
1766 | add dx, cardheight * 3 / 9 |
1767 | mov eax, 7 |
1767 | mov eax, 7 |
1768 | int $40 |
1768 | mcall |
1769 | ;draw bottom right image |
1769 | ;draw bottom right image |
1770 | mov ebx, [imageflipaddr] |
1770 | mov ebx, [imageflipaddr] |
1771 | mov edx, [xpos] |
1771 | mov edx, [xpos] |
1772 | add edx, cardwidth - margin - 16 |
1772 | add edx, cardwidth - margin - 16 |
1773 | shl edx, 16 |
1773 | shl edx, 16 |
1774 | mov dx, word [ypos] |
1774 | mov dx, word [ypos] |
1775 | add dx, cardheight * 5 / 9 |
1775 | add dx, cardheight * 5 / 9 |
1776 | mov eax, 7 |
1776 | mov eax, 7 |
1777 | int $40 |
1777 | mcall |
1778 | ret |
1778 | ret |
Line 1779... | Line 1779... | ||
1779 | 1779 | ||
Line 1780... | Line 1780... | ||
1780 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
1780 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
Line 1786... | Line 1786... | ||
1786 | add edx, cardwidth/2 - 8 |
1786 | add edx, cardwidth/2 - 8 |
1787 | shl edx, 16 |
1787 | shl edx, 16 |
1788 | mov dx, word [ypos] |
1788 | mov dx, word [ypos] |
1789 | add dx, cardheight * 2 / 9 |
1789 | add dx, cardheight * 2 / 9 |
1790 | mov eax, 7 |
1790 | mov eax, 7 |
1791 | int $40 |
1791 | mcall |
1792 | ret |
1792 | ret |
Line 1793... | Line 1793... | ||
1793 | 1793 | ||
1794 | 1794 | ||
Line 1800... | Line 1800... | ||
1800 | add edx, cardwidth/2 - 8 |
1800 | add edx, cardwidth/2 - 8 |
1801 | shl edx, 16 |
1801 | shl edx, 16 |
1802 | mov dx, word [ypos] |
1802 | mov dx, word [ypos] |
1803 | add dx, cardheight * 6 / 9 |
1803 | add dx, cardheight * 6 / 9 |
1804 | mov eax, 7 |
1804 | mov eax, 7 |
1805 | int $40 |
1805 | mcall |
1806 | ret |
1806 | ret |
Line 1807... | Line 1807... | ||
1807 | 1807 | ||
1808 | 1808 | ||
1809 | ;****************************************************************************** |
1809 | ;****************************************************************************** |
Line 1810... | Line 1810... | ||
1810 | randomize: |
1810 | randomize: |
1811 | push eax |
1811 | push eax |
Line 1812... | Line 1812... | ||
1812 | 1812 | ||
1813 | mov eax, 3 |
1813 | mov eax, 3 |
1814 | int 0x40 |
1814 | mcall |
1815 | 1815 | ||
Line 1976... | Line 1976... | ||
1976 | 1976 | ||
Line 1977... | Line 1977... | ||
1977 | ;****************************************************************************** |
1977 | ;****************************************************************************** |
1978 | 1978 | ||
1979 | ; <--- initialised data ---> |
1979 | ; <--- initialised data ---> |
Line 1980... | Line 1980... | ||
1980 | data |
1980 | data |
1981 | header db 'Freecell',0 |
1981 | title db 'Freecell',0 |
Line 1982... | Line 1982... | ||
1982 | 1982 |