RCS file: /cvsroot/scummvm/scummvm/simon/simon.cpp,v
retrieving revision 1.44
diff -u -d -b -u -r1.44 simon.cpp
|
|
|
1529 | 1529 | _fcs_unk_1 = 0; |
1530 | 1530 | if (_fcs_ptr_array_3[0] != 0) { |
1531 | 1531 | _fcs_ptr_1 = _fcs_ptr_array_3[0]; |
1532 | | showmessage_helper_3(_fcs_ptr_1->unk6, _fcs_ptr_1->unk7); |
| 1532 | showmessage_helper_3(_fcs_ptr_1->textLength, |
| 1533 | _fcs_ptr_1->textMaxLength); |
1533 | 1534 | } |
1534 | 1535 | _mortal_flag = false; |
1535 | 1536 | } |
… |
… |
|
2306 | 2307 | |
2307 | 2308 | fcs = _fcs_ptr_array_3[5]; |
2308 | 2309 | |
2309 | | fcs->unk2 = unk132_result; |
2310 | | fcs->unk1 = 2; |
2311 | | fcs->unk3 = 2; |
2312 | | fcs->unk6 = 3; |
| 2310 | fcs->textRow = unk132_result; |
| 2311 | |
| 2312 | // init x offset with a 2 character savegame number + a period (18 pix) |
| 2313 | fcs->textColumn = 2; |
| 2314 | fcs->textColumnOffset = 2; |
| 2315 | fcs->textLength = 3; |
2313 | 2316 | |
2314 | 2317 | name = buf + i * 18; |
2315 | 2318 | |
| 2319 | // now process entire savegame name to get correct x offset for cursor |
2316 | 2320 | name_len = 0; |
2317 | 2321 | while (name[name_len]) { |
2318 | | fcs->unk6++; |
2319 | | fcs->unk3 += 6; |
| 2322 | fcs->textLength++; |
| 2323 | fcs->textColumnOffset += 6; |
2320 | 2324 | if (name[name_len] == 'i' || name[name_len] == 'l') |
2321 | | fcs->unk3 -= 2; |
2322 | | if (fcs->unk3 >= 8) { |
2323 | | fcs->unk3 -= 8; |
2324 | | fcs->unk1++; |
| 2325 | fcs->textColumnOffset -= 2; |
| 2326 | if (fcs->textColumnOffset >= 8) { |
| 2327 | fcs->textColumnOffset -= 8; |
| 2328 | fcs->textColumn++; |
2325 | 2329 | } |
2326 | 2330 | name_len++; |
2327 | 2331 | } |
… |
… |
|
2666 | 2670 | |
2667 | 2671 | |
2668 | 2672 | |
2669 | | void SimonState::fcs_proc_1(FillOrCopyStruct *fcs, uint value) |
| 2673 | void SimonState::fcs_setTextColor(FillOrCopyStruct *fcs, uint value) |
2670 | 2674 | { |
2671 | 2675 | fcs->text_color = value; |
2672 | 2676 | } |
… |
… |
|
2746 | 2750 | startUp_helper_3(); |
2747 | 2751 | _fcs_ptr_1 = _fcs_ptr_array_3[a]; |
2748 | 2752 | |
2749 | | showmessage_helper_3(_fcs_ptr_1->unk6, _fcs_ptr_1->unk7); |
| 2753 | showmessage_helper_3(_fcs_ptr_1->textLength, _fcs_ptr_1->textMaxLength); |
2750 | 2754 | } |
2751 | 2755 | |
2752 | 2756 | |
… |
… |
|
2768 | 2772 | fcs->flags = flags; |
2769 | 2773 | fcs->fill_color = fill_color; |
2770 | 2774 | fcs->text_color = unk4; |
2771 | | fcs->unk1 = 0; |
2772 | | fcs->unk2 = 0; |
2773 | | fcs->unk3 = 0; |
2774 | | fcs->unk7 = fcs->width * 8 / 6; |
| 2775 | fcs->textColumn = 0; |
| 2776 | fcs->textRow = 0; |
| 2777 | fcs->textColumnOffset = 0; |
| 2778 | fcs->textMaxLength = fcs->width * 8 / 6; // characters are 6 pixels |
2775 | 2779 | return fcs; |
2776 | 2780 | } |
2777 | 2781 | |
… |
… |
|
2897 | 2901 | else |
2898 | 2902 | video_erase(fcs); |
2899 | 2903 | |
2900 | | fcs->unk1 = 0; |
2901 | | fcs->unk2 = 0; |
2902 | | fcs->unk3 = 0; |
2903 | | fcs->unk6 = 0; |
| 2904 | fcs->textColumn = 0; |
| 2905 | fcs->textRow = 0; |
| 2906 | fcs->textColumnOffset = 0; |
| 2907 | fcs->textLength = 0; |
2904 | 2908 | } |
2905 | 2909 | |
2906 | 2910 | /* ok */ |
… |
… |
|
3163 | 3167 | showmessage_helper_2(); |
3164 | 3168 | if (!_showmessage_flag) { |
3165 | 3169 | _fcs_ptr_array_3[0] = _fcs_ptr_1; |
3166 | | showmessage_helper_3(_fcs_ptr_1->unk6, _fcs_ptr_1->unk7); |
| 3170 | showmessage_helper_3(_fcs_ptr_1->textLength, |
| 3171 | _fcs_ptr_1->textMaxLength); |
3167 | 3172 | } |
3168 | 3173 | _showmessage_flag = true; |
3169 | 3174 | _fcs_data_1[_fcs_unk_1] = 1; |
… |
… |
|
3241 | 3246 | if (c == 0xC) { |
3242 | 3247 | video_fill_or_copy_from_3_to_2(fcs); |
3243 | 3248 | } else if (c == 0xD || c == 0xA) { |
3244 | | video_putchar_helper(fcs); |
| 3249 | video_putchar_newline(fcs); |
3245 | 3250 | } else if (c == 8 || c == 1) { |
3246 | 3251 | int8 val = (c == 8) ? 6 : 4; |
3247 | | if (fcs->unk6 != 0) { |
3248 | | fcs->unk6--; |
3249 | | fcs->unk3 -= val; |
3250 | | if ((int8)fcs->unk3 < val) { |
3251 | | fcs->unk3 += 8; |
3252 | | fcs->unk1--; |
| 3252 | if (fcs->textLength != 0) { |
| 3253 | fcs->textLength--; |
| 3254 | fcs->textColumnOffset -= val; |
| 3255 | if ((int8)fcs->textColumnOffset < val) { |
| 3256 | fcs->textColumnOffset += 8; |
| 3257 | fcs->textColumn--; |
3253 | 3258 | } |
3254 | 3259 | } |
3255 | 3260 | } else if (c >= 0x20) { |
3256 | | if (fcs->unk6 == fcs->unk7) { |
3257 | | video_putchar_helper(fcs); |
3258 | | } else if (fcs->unk2 == fcs->height) { |
3259 | | video_putchar_helper(fcs); |
3260 | | fcs->unk2--; |
| 3261 | if (fcs->textLength == fcs->textMaxLength) { |
| 3262 | video_putchar_newline(fcs); |
| 3263 | } else if (fcs->textRow == fcs->height) { |
| 3264 | video_putchar_newline(fcs); |
| 3265 | fcs->textRow--; |
3261 | 3266 | } |
3262 | 3267 | |
3263 | | video_putchar_helper_2(fcs, fcs->unk1 + fcs->x, fcs->unk2 * 8 + fcs->y, c); |
| 3268 | video_putchar_drawchar(fcs, fcs->textColumn + fcs->x, |
| 3269 | fcs->textRow * 8 + fcs->y, c); |
3264 | 3270 | |
3265 | | fcs->unk6++; |
3266 | | fcs->unk3 += 6; |
| 3271 | fcs->textLength++; |
| 3272 | fcs->textColumnOffset += 6; |
3267 | 3273 | if (c == 'i' || c == 'l') |
3268 | | fcs->unk3 -= 2; |
| 3274 | fcs->textColumnOffset -= 2; |
3269 | 3275 | |
3270 | | if (fcs->unk3 >= 8) { |
3271 | | fcs->unk3 -= 8; |
3272 | | fcs->unk1++; |
| 3276 | if (fcs->textColumnOffset >= 8) { |
| 3277 | fcs->textColumnOffset -= 8; |
| 3278 | fcs->textColumn++; |
3273 | 3279 | } |
3274 | 3280 | } |
3275 | 3281 | } |
3276 | 3282 | |
3277 | | void SimonState::video_putchar_helper(FillOrCopyStruct *fcs) |
| 3283 | void SimonState::video_putchar_newline(FillOrCopyStruct *fcs) |
3278 | 3284 | { |
3279 | | fcs->unk3 = 0; |
3280 | | fcs->unk6 = 0; |
3281 | | fcs->unk1 = 0; |
| 3285 | fcs->textColumnOffset = 0; |
| 3286 | fcs->textLength = 0; |
| 3287 | fcs->textColumn = 0; |
3282 | 3288 | |
3283 | | if (fcs->unk2 != fcs->height) |
3284 | | fcs->unk2++; |
| 3289 | if (fcs->textRow != fcs->height) |
| 3290 | fcs->textRow++; |
3285 | 3291 | } |
3286 | 3292 | |
3287 | 3293 | static const byte video_font[] = { |
… |
… |
|
3385 | 3391 | 240, 240, 240, 240, 240, 240, 240, 240, |
3386 | 3392 | }; |
3387 | 3393 | |
3388 | | void SimonState::video_putchar_helper_2(FillOrCopyStruct *fcs, uint x, uint y, byte chr) |
| 3394 | void SimonState::video_putchar_drawchar(FillOrCopyStruct *fcs, uint x, uint y, byte chr) |
3389 | 3395 | { |
3390 | 3396 | const byte *src; |
3391 | 3397 | byte color, *dst; |
… |
… |
|
3394 | 3400 | _lock_word |= 0x8000; |
3395 | 3401 | |
3396 | 3402 | dst = dx_lock_2(); |
3397 | | dst += y * _dx_surface_pitch + x * 8 + fcs->unk3; |
| 3403 | dst += y * _dx_surface_pitch + x * 8 + fcs->textColumnOffset; |
3398 | 3404 | |
3399 | 3405 | src = video_font + (chr - 0x20) * 8; |
3400 | 3406 | |
RCS file: /cvsroot/scummvm/scummvm/simon/simon.h,v
retrieving revision 1.23
diff -u -d -b -u -r1.23 simon.h
|
|
|
127 | 127 | byte flags; |
128 | 128 | uint16 x, y; |
129 | 129 | uint16 width, height; |
130 | | uint16 unk1, unk2; |
131 | | uint8 unk3, unk6, unk7, fill_color, text_color, unk5; |
| 130 | uint16 textColumn, textRow; |
| 131 | uint8 textColumnOffset, textLength, textMaxLength; |
| 132 | uint8 fill_color, text_color, unk5; |
132 | 133 | FillOrCopyData *fcs_data; |
133 | 134 | }; |
| 135 | // note on text offset: |
| 136 | // the actual x-coordinate is: textColumn * 8 + textColumnOffset |
| 137 | // the actual y-coordinate is: textRow * 8 |
134 | 138 | |
135 | 139 | |
136 | 140 | enum { |
… |
… |
|
943 | 947 | |
944 | 948 | bool vc_get_bit(uint bit); |
945 | 949 | |
946 | | void fcs_proc_1(FillOrCopyStruct *fcs, uint value); |
| 950 | void fcs_setTextColor(FillOrCopyStruct *fcs, uint value); |
947 | 951 | |
948 | 952 | void video_copy_if_flag_0x8_c(FillOrCopyStruct *fcs); |
949 | 953 | void delete_hitarea_by_index(uint index); |
… |
… |
|
1010 | 1014 | void showmessage_helper_2(); |
1011 | 1015 | void print_char_helper_6(uint i); |
1012 | 1016 | |
1013 | | void video_putchar_helper(FillOrCopyStruct *fcs); |
1014 | | void video_putchar_helper_2(FillOrCopyStruct *fcs, uint x, uint y, byte chr); |
| 1017 | void video_putchar_newline(FillOrCopyStruct *fcs); |
| 1018 | void video_putchar_drawchar(FillOrCopyStruct *fcs, uint x, uint y, byte chr); |
1015 | 1019 | |
1016 | 1020 | void initSound(); |
1017 | 1021 | void playVoice(uint voice); |
RCS file: /cvsroot/scummvm/scummvm/simon/simonverb.cpp,v
retrieving revision 1.3
diff -u -d -b -u -r1.3 simonverb.cpp
|
|
|
99 | 99 | if (fcs == NULL || fcs->text_color == 0) |
100 | 100 | return; |
101 | 101 | |
102 | | fcs->unk1 = x >> 3; |
103 | | fcs->unk3 = x & 7; |
| 102 | fcs->textColumn = x >> 3; |
| 103 | fcs->textColumnOffset = x & 7; |
104 | 104 | |
105 | 105 | for (; *string; string++) |
106 | 106 | video_putchar(fcs, *string); |
RCS file: /cvsroot/scummvm/scummvm/simon/simonitems.cpp,v
retrieving revision 1.3
diff -u -d -b -u -r1.3 simonitems.cpp
|
|
|
1576 | 1576 | |
1577 | 1577 | void SimonState::o_unk_160(uint a) |
1578 | 1578 | { |
1579 | | fcs_proc_1(_fcs_ptr_array_3[_fcs_unk_1], a); |
| 1579 | fcs_setTextColor(_fcs_ptr_array_3[_fcs_unk_1], a); |
1580 | 1580 | } |
1581 | 1581 | |
1582 | 1582 | void SimonState::o_unk_103() |
… |
… |
|
1621 | 1621 | |
1622 | 1622 | if (a == _fcs_unk_1) { |
1623 | 1623 | _fcs_ptr_1 = _fcs_ptr_array_3[a]; |
1624 | | showmessage_helper_3(_fcs_ptr_1->unk6, _fcs_ptr_1->unk7); |
| 1624 | showmessage_helper_3(_fcs_ptr_1->textLength, |
| 1625 | _fcs_ptr_1->textMaxLength); |
1625 | 1626 | } |
1626 | 1627 | } |