Comment: | Add possibility of additional code pages. |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
99598608898c0473fd2ce3eb5ae1d8f7 |
User & Date: | user on 2021-04-22 03:00:57 |
Other Links: | manifest | tags |
2021-04-24
| ||
19:09 | Implement BroadcastAnd and BroadcastList instructions. check-in: a833709837 user: user tags: trunk | |
2021-04-22
| ||
03:00 | Add possibility of additional code pages. check-in: 9959860889 user: user tags: trunk | |
2021-04-20
| ||
02:32 | Add the possibility to specify the level version number when importing (optional) check-in: 2885d776fc user: user tags: trunk | |
Modified .fossil-settings/binary-glob from [1669c0f851] to [e54f583c29].
1 | 1 2 | + | *.gz codepage.har |
Modified class.c from [bf6a8e2243] to [51b2fb5418].
︙ | |||
1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 | 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 | + + + + + + + | if(tokent!=TF_CLOSE) ParseError("Expected close parenthesis\n"); break; case OP_MISC4: define_user_flags(0x1000,0x101F); break; case OP_MISC5: define_user_flags(0x1020,0x103F); break; case OP_MISC6: define_user_flags(0x1040,0x105F); break; case OP_MISC7: define_user_flags(0x1060,0x107F); break; case OP_COLLISIONLAYERS: define_user_flags(0x1C80,0x1C87); break; case OP_CODEPAGE: nxttok(); if(tokent!=TF_INT || tokenv<1 || tokenv>65535) ParseError("Number from 1 to 65535 expected\n"); set_code_page(tokenv); nxttok(); if(tokent!=TF_CLOSE) ParseError("Expected close parenthesis\n"); break; default: ParseError("Invalid top level definition: %s\n",tokenstr); } } else { ParseError("Invalid top level definition\n"); } } |
︙ |
Modified class.doc from [4a0d10f48c] to [1c976b6d38].
︙ | |||
201 202 203 204 205 206 207 208 209 210 211 212 213 214 | 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 | + + + + | Set the limit for logical animations, from 1 to 255. The default is 32. (Background <number> [<number>]) Set the background colour, from 0 to 255. The default value is 1. You can optionally specify a second number, which is the background colour for the inventory; if not specified, uses the same colour for both. (CodePage <number>) Define the code page, from 1 to 65535. If not specified, then the default code page is used. (CollisionLayers <userflags...>) Define user flags as CollisionLayers bits; the first defined flag is bit0. Up to 8 flags can be defined in this way. (Misc4 <userflags...>) Define user flags as Misc4 bits; the first defined flag is bit0. Up to 32 flags can be defined in this way. |
︙ |
Added codepage.har version [cc6c7e2d15].
cannot compute difference between binary files
Modified config.doc from [cff0358f5d] to [2295add04a].
︙ | |||
23 24 25 26 27 28 29 30 31 32 33 34 35 36 | 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 | + + + + | .autoSave If true, saves changes to the level and solution files when the program terminates. If false (default), they are only saved to the user cache database; to copy the changes to the level and solution files, you must use the .u command in SQL mode (-x). .codepage The path to the code page file. If not specified, then code pages other than 437 are not available (code page 437 is built-in). .editTitle The window title to use in edit mode. A tilde is replaced by the name of the puzzle set. .gameTitle The window title to use in game mode. A tilde is replaced by the name of the puzzle set. |
︙ |
Modified default.heromeshrc from [322c2f0dbe] to [b105198fc2].
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | + | ! Hero Mesh configuration settings ?.screenWidth: 800 ?.screenHeight: 600 ?.imageSize: 24 ?.traceAll: true ?.showInventory: 0 ?.maxTrigger: 32767 ?.pasteCommand: xclip -o ?.codepage: /home/user/freeheromesh/codepage.har ! Game inputs ?.gameKey.A: 'A ?.gameKey.B: 'B ?.gameKey.C: 'C ?.gameKey.D: 'D ?.gameKey.E: 'E |
︙ |
Modified heromesh.h from [7ea394ee1c] to [e799f3d4f3].
︙ | |||
93 94 95 96 97 98 99 100 101 102 103 104 105 106 | 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 | + | extern SDL_Surface*screen; extern Uint16 picture_size; extern int left_margin; void init_palette(void); void init_screen(void); void load_pictures(void); void set_code_page(Uint16 n); // Use only when screen is unlocked void draw_picture(int x,int y,Uint16 img); void draw_cell(int x,int y); // Use only when screen is locked void draw_text(int x,int y,const unsigned char*t,int bg,int fg); |
︙ |
Modified instruc from [69544eab48] to [271efa52f9].
︙ | |||
192 193 194 195 196 197 198 199 200 201 202 203 204 205 | 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 | + | MoveNumber Level Key =Finished ; Class definitions -Background ; used at top level only; not in a class -CodePage ; used at top level only; not in a class -Input -Quiz -InPlace -DefaultImage -Help -EditorHelp -SUBS |
︙ |
Modified instruc.h from [e02ef5707d] to [53b9bd40aa].
︙ | |||
279 280 281 282 283 284 285 | 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 | + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - - + + - - - + + + - + - - - - + + + + - + + - + - - + + - - - + + + - + - + - - + + - - - + + + - - + + - - + + - + - + - - - + + + - + - - - + + + - - + + - - + + - + - - - + + + - - - - - - - - - - + + + + + + + + + + - - + + - + - + - + - - - - + + + + - + - + - + - + - + - - - + + + - + - + | #define OP_ARG3_E 36987 #define OP_MOVENUMBER 32892 #define OP_LEVEL 32893 #define OP_KEY 32894 #define OP_FINISHED 32895 #define OP_FINISHED_E 36991 #define OP_BACKGROUND 32896 #define OP_CODEPAGE 32897 |
︙ | |||
701 702 703 704 705 706 707 | 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 | - - + + - + - + - + - + - + - + | {"bit7",8388736}, {"bit8",8423400}, {"bit9",8423401}, {"bnot",8421412}, {"bor",8421410}, {"bxor",8421411}, {"c?",8421427}, |
Modified pcfont.h from [13abeae76c] to [b9c5627019].
| 1 2 3 4 5 6 7 8 | - + |
|
︙ |
Modified picture.c from [9d616d2335] to [e07c9a379a].
︙ | |||
23 24 25 26 27 28 29 30 31 32 33 34 35 36 | 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 | + | SDL_Surface*screen; Uint16 picture_size; int left_margin; static SDL_Surface*picts; static Uint8*curpic; static const unsigned char*fontdata; static const char default_palette[]= "C020FF " "000000 222222 333333 444444 555555 666666 777777 888888 999999 AAAAAA BBBBBB CCCCCC DDDDDD EEEEEE FFFFFF " "281400 412300 5F3200 842100 A05000 C35F14 E1731E FF8232 FF9141 FFA050 FFAF5F FFBE73 FFD282 FFE191 FFF0A0 " "321E1E 412220 5F2830 823040 A03A4C BE4658 E15464 FF6670 FF7F7B FF8E7F FF9F7F FFAF7F FFBF7F FFCF7F FFDF7F " "280D0D 401515 602020 802A2A A03535 C04040 E04A4A FF5555 FF6764 FF6F64 FF7584 FF849D FF94B7 FF9FD1 FFAEEA " |
︙ | |||
749 750 751 752 753 754 755 756 757 758 759 760 761 762 | 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 | + | fprintf(stderr,"Done\n"); } void init_screen(void) { const char*v; int w,h,i; if(main_options['x']) return; if(!fontdata) fontdata=pcfont; optionquery[1]=Q_screenWidth; w=strtol(xrm_get_resource(resourcedb,optionquery,optionquery,2)?:"800",0,10); optionquery[1]=Q_screenHeight; h=strtol(xrm_get_resource(resourcedb,optionquery,optionquery,2)?:"600",0,10); optionquery[1]=Q_screenFlags; v=xrm_get_resource(resourcedb,optionquery,optionquery,2)?:""; if(SDL_Init(SDL_INIT_VIDEO|(strchr(v,'z')?SDL_INIT_NOPARACHUTE:0)|SDL_INIT_TIMER)) fatal("Error initializing SDL: %s\n",SDL_GetError()); |
︙ | |||
782 783 784 785 786 787 788 789 790 791 792 793 794 795 | 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | } else { SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY,SDL_DEFAULT_REPEAT_INTERVAL); } SDL_EnableUNICODE(1); optionquery[1]=Q_margin; left_margin=strtol(xrm_get_resource(resourcedb,optionquery,optionquery,2)?:"65",0,10); } void set_code_page(Uint16 n) { int c,i,j,s; const char*v; unsigned char*d; Uint8 b[32]; FILE*fp; if(!n) return; if(fontdata && fontdata!=pcfont) fatal("Multiple code page specifications\n"); optionquery[1]=Q_codepage; v=xrm_get_resource(resourcedb,optionquery,optionquery,2); if(!v || !*v) { if(n==437) return; fatal("Cannot load code page %d; code page file is not configured\n",n); } fp=fopen(v,"r"); if(!fp) { perror(0); fatal("Cannot open code page file\n"); } fontdata=d=malloc(0x800); if(!d) fatal("Allocation failed\n"); memcpy(d,pcfont,0x800); name: s=i=0; for(;;) { c=fgetc(fp); if(c<0) { if(n!=437) fatal("Cannot find code page %d\n",n); goto done; } if(!c) break; if(!s) { if(c<'0' || c>'9') s=1; else if(c=='0' && !i) s=1; else i=10*i+c-'0'; if(i>65535) s=1; } } if(s || i!=n) goto skip; i=fgetc(fp)<<16; i|=fgetc(fp)<<24; i|=fgetc(fp)<<0; i|=fgetc(fp)<<8; if(i==0x800) { fread(d,8,256,fp); goto done; } else if(i==0x400) { fread(d+0x400,8,128,fp); } else if(i<32 || i>0x800) { fatal("Unrecognized format of code page %d\n",n); } else { fread(b,32,1,fp); for(s=0;s<256;s++) if(!(b[s>>3]&(1<<(s&7)))) { if(c=fgetc(fp)) { i=fgetc(fp); if(i&~255) fatal("Error reading data for character %d in code page %d\n",s,n); if(i!=s) memcpy(d+s*8,d+i*8,8); } for(j=0;j<8;j++) if(!(c&(1<<j))) d[j+s*8]=fgetc(fp); } } memset(d,0,8); goto done; skip: i=fgetc(fp)<<16; i|=fgetc(fp)<<24; i|=fgetc(fp)<<0; i|=fgetc(fp)<<8; fseek(fp,i,SEEK_CUR); goto name; done: fclose(fp); } // Widgets static void draw_scrollbar(int*cur,int page,int max,int x0,int y0,int x1,int y1) { Uint8*pix=screen->pixels; Uint16 pitch=screen->pitch; int x,y,m0,m1; |
︙ |
Modified quarks from [57706df161] to [6347a65352].
︙ | |||
216 217 218 219 220 221 222 223 | 216 217 218 219 220 221 222 223 224 | + | traceAll traceObject showInventory progress autoSave maxTrigger pasteCommand codepage |
Modified quarks.h from [2ea9aca83b] to [93005ce16b].
︙ | |||
181 182 183 184 185 186 187 188 189 190 191 192 193 194 | 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 | + | #define Q_traceAll 182 #define Q_traceObject 183 #define Q_showInventory 184 #define Q_progress 185 #define Q_autoSave 186 #define Q_maxTrigger 187 #define Q_pasteCommand 188 #define Q_codepage 189 static const char*const global_quarks[]={ "screenWidth", "screenHeight", "margin", "palette", "popupColors", "imageSize", |
︙ | |||
369 370 371 372 373 374 375 376 377 378 379 380 381 382 | 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 | + | "traceAll", "traceObject", "showInventory", "progress", "autoSave", "maxTrigger", "pasteCommand", "codepage", 0}; #ifdef HEROMESH_BINDINGS static const SDLKey quark_to_key[Q_undo+1-Q_backspace]={ SDLK_BACKSPACE, SDLK_TAB, SDLK_CLEAR, SDLK_RETURN, |
︙ |