From 2b9251a75b34845f33f08354acdd6efb3ff8754c Mon Sep 17 00:00:00 2001 From: Francois Date: Sun, 26 Apr 2020 02:58:13 +0200 Subject: [PATCH] Initial commit --- +AMOS_Includes.s | 74 + +B.s | 2985 ++ +CEqu.s | 224 + +Debug.s | 32 + +Edit.s | 15408 +++++++++ +Editor_Config.s | 1167 + +Equ.s | 2409 ++ +ILib.s | 7773 +++++ +Interpreter_Config.s | 193 + +Lib.s | 28451 ++++++++++++++++ +Monitor.s | 4317 +++ +Verif.s | 5321 +++ +Version.s | 33 + +W.s | 16797 +++++++++ +WEqu.s | 383 + .gitattributes | 2 + AMOS.info | Bin 0 -> 2228 bytes AMOS/AMOSPro | Bin 0 -> 22624 bytes AMOS/AMOSPro.info | Bin 0 -> 3338 bytes AMOS/AMOSPro_Compiler_Config | Bin 0 -> 1532 bytes AMOS/AMOSPro_Interpreter_Config | Bin 0 -> 792 bytes AMOS/APSystem.info | Bin 0 -> 900 bytes AMOS/APSystem/AMOS.library | Bin 0 -> 46948 bytes AMOS/APSystem/AMOSPro.Lib | Bin 0 -> 98188 bytes AMOS/APSystem/AMOSPro_Compact.Lib | Bin 0 -> 1540 bytes AMOS/APSystem/AMOSPro_Compiler.Lib | Bin 0 -> 3952 bytes AMOS/APSystem/AMOSPro_CompilerA_Resource.Abk | Bin 0 -> 10182 bytes AMOS/APSystem/AMOSPro_Compiler_Resource.Abk | Bin 0 -> 15834 bytes AMOS/APSystem/AMOSPro_Default_Resource.Abk | Bin 0 -> 9946 bytes AMOS/APSystem/AMOSPro_Editor | Bin 0 -> 37248 bytes AMOS/APSystem/AMOSPro_Editor_Config | Bin 0 -> 18868 bytes AMOS/APSystem/AMOSPro_Editor_Macros | Bin 0 -> 56 bytes AMOS/APSystem/AMOSPro_Editor_Resource.Abk | Bin 0 -> 21500 bytes AMOS/APSystem/AMOSPro_IOPorts.Lib | Bin 0 -> 3680 bytes AMOS/APSystem/AMOSPro_Monitor | Bin 0 -> 11864 bytes AMOS/APSystem/AMOSPro_Music.Lib | Bin 0 -> 12712 bytes AMOS/APSystem/AMOSPro_Request.Lib | Bin 0 -> 264 bytes AMOS/APSystem/APCmp | Bin 0 -> 29528 bytes AMOS/APSystem/Compiler.Lib | Bin 0 -> 29276 bytes AMOS/APSystem/Def_Compiled.info | Bin 0 -> 1122 bytes AMOS/APSystem/Def_icon.info | Bin 0 -> 2901 bytes AMOS/APSystem/Header_AMOS.AMOS | Bin 0 -> 186 bytes AMOS/APSystem/Header_Backstart.Lib | Bin 0 -> 3436 bytes AMOS/APSystem/Header_CLI.Lib | Bin 0 -> 2928 bytes AMOS/Accessories.info | Bin 0 -> 900 bytes AMOS/Accessories/AMAL_Editor.AMOS | Bin 0 -> 54932 bytes .../AMOSPro_Help/AMOSPro_Help.AMOS | Bin 0 -> 15916 bytes .../Accessories/AMOSPro_Help/AMOSPro_Help.Map | Bin 0 -> 12278 bytes .../Accessories/AMOSPro_Help/AMOSPro_Help.Txt | 9438 +++++ .../AMOSPro_Help/Compiler_Help.Map | Bin 0 -> 963 bytes .../AMOSPro_Help/Compiler_Help.Txt | 1076 + .../AMOSPro_Help/LatestNews_112.Map | Bin 0 -> 145 bytes .../AMOSPro_Help/LatestNews_112.Txt | 738 + .../AMOSPro_Help/LatestNews_200.Map | Bin 0 -> 87 bytes .../AMOSPro_Help/LatestNews_200.Txt | 277 + AMOS/Accessories/Disc_Manager.AMOS | Bin 0 -> 98644 bytes AMOS/Accessories/Font8x8_Editor.AMOS | Bin 0 -> 368 bytes AMOS/Accessories/IFF_Compactor.AMOS | Bin 0 -> 362 bytes AMOS/Accessories/Menu_Editor.AMOS | Bin 0 -> 358 bytes AMOS/Accessories/Object_Editor.AMOS | Bin 0 -> 113476 bytes AMOS/Accessories/Resource_Bank_Maker.AMOS | Bin 0 -> 47746 bytes AMOS/Accessories/Sample_Bank_Maker.AMOS | Bin 0 -> 63746 bytes AMOS/Accessories/System_Iffs/AMOSPro.Iff | Bin 0 -> 16262 bytes .../System_Iffs/Default_Resource.Iff | Bin 0 -> 11268 bytes .../Accessories/System_Iffs/Tutor_Buttons.Iff | Bin 0 -> 26406 bytes AMOS/Compiler/Compiler_Shell.AMOS | Bin 0 -> 79460 bytes AMOS/Compiler/Tiny_Shell.AMOS | Bin 0 -> 16362 bytes AMOS/Compiler_Shell | Bin 0 -> 136092 bytes AMOS/Compiler_Shell.info | Bin 0 -> 3338 bytes AMOS/Editor_Config.AMOS | Bin 0 -> 17196 bytes AMOS/Examples.info | Bin 0 -> 900 bytes AMOS/Examples/Examples/H-0/Help_1.AMOS | Bin 0 -> 4632 bytes AMOS/Examples/Examples/H-0/Help_2.AMOS | Bin 0 -> 4254 bytes AMOS/Examples/Examples/H-0/Help_3.AMOS | Bin 0 -> 5600 bytes AMOS/Examples/Examples/H-0/Help_4.AMOS | Bin 0 -> 5870 bytes AMOS/Examples/Examples/H-0/Help_5.AMOS | Bin 0 -> 5434 bytes AMOS/Examples/Examples/H-0/Help_6.AMOS | Bin 0 -> 3674 bytes AMOS/Examples/Examples/H-0/Help_7.AMOS | Bin 0 -> 5738 bytes AMOS/Examples/Examples/H-0/Help_8.AMOS | Bin 0 -> 7616 bytes AMOS/Examples/Examples/H-0/Help_9.AMOS | Bin 0 -> 5832 bytes AMOS/Examples/Examples/H-1/Help_10.AMOS | Bin 0 -> 3692 bytes AMOS/Examples/Examples/H-1/Help_11.AMOS | Bin 0 -> 5618 bytes AMOS/Examples/Examples/H-1/Help_12.AMOS | Bin 0 -> 4042 bytes AMOS/Examples/Examples/H-1/Help_13.AMOS | Bin 0 -> 6672 bytes AMOS/Examples/Examples/H-1/Help_14.AMOS | Bin 0 -> 5400 bytes AMOS/Examples/Examples/H-1/Help_15.AMOS | Bin 0 -> 3696 bytes AMOS/Examples/Examples/H-1/Help_16.AMOS | Bin 0 -> 5828 bytes AMOS/Examples/Examples/H-1/Help_17.AMOS | Bin 0 -> 5958 bytes AMOS/Examples/Examples/H-1/Help_18.AMOS | Bin 0 -> 4896 bytes AMOS/Examples/Examples/H-1/Help_19.AMOS | Bin 0 -> 8180 bytes AMOS/Examples/Examples/H-2/Help_20.AMOS | Bin 0 -> 6132 bytes AMOS/Examples/Examples/H-2/Help_21.AMOS | Bin 0 -> 6216 bytes AMOS/Examples/Examples/H-2/Help_22.AMOS | Bin 0 -> 4016 bytes AMOS/Examples/Examples/H-2/Help_23.AMOS | Bin 0 -> 5204 bytes AMOS/Examples/Examples/H-2/Help_24.AMOS | Bin 0 -> 6310 bytes AMOS/Examples/Examples/H-2/Help_25.AMOS | Bin 0 -> 6042 bytes AMOS/Examples/Examples/H-2/Help_26.AMOS | Bin 0 -> 7736 bytes AMOS/Examples/Examples/H-2/Help_27.AMOS | Bin 0 -> 5760 bytes AMOS/Examples/Examples/H-2/Help_28.AMOS | Bin 0 -> 6392 bytes AMOS/Examples/Examples/H-2/Help_29.AMOS | Bin 0 -> 4734 bytes AMOS/Examples/Examples/H-3/Help_30.AMOS | Bin 0 -> 5408 bytes AMOS/Examples/Examples/H-3/Help_31.AMOS | Bin 0 -> 5208 bytes AMOS/Examples/Examples/H-3/Help_32.AMOS | Bin 0 -> 4950 bytes AMOS/Examples/Examples/H-3/Help_33.AMOS | Bin 0 -> 6926 bytes AMOS/Examples/Examples/H-3/Help_34.AMOS | Bin 0 -> 8138 bytes AMOS/Examples/Examples/H-3/Help_35.AMOS | Bin 0 -> 6144 bytes AMOS/Examples/Examples/H-3/Help_36.AMOS | Bin 0 -> 5472 bytes AMOS/Examples/Examples/H-3/Help_37.AMOS | Bin 0 -> 6756 bytes AMOS/Examples/Examples/H-3/Help_38.AMOS | Bin 0 -> 5294 bytes AMOS/Examples/Examples/H-3/Help_39.AMOS | Bin 0 -> 6944 bytes AMOS/Examples/Examples/H-4/Help_40.AMOS | Bin 0 -> 4598 bytes AMOS/Examples/Examples/H-4/Help_41.AMOS | Bin 0 -> 5392 bytes AMOS/Examples/Examples/H-4/Help_42.AMOS | Bin 0 -> 4922 bytes AMOS/Examples/Examples/H-4/Help_43.AMOS | Bin 0 -> 5282 bytes AMOS/Examples/Examples/H-4/Help_44.AMOS | Bin 0 -> 8428 bytes AMOS/Examples/Examples/H-4/Help_45.AMOS | Bin 0 -> 7030 bytes AMOS/Examples/Examples/H-4/Help_46.AMOS | Bin 0 -> 6698 bytes AMOS/Examples/Examples/H-4/Help_47.AMOS | Bin 0 -> 6774 bytes AMOS/Examples/Examples/H-4/Help_48.AMOS | Bin 0 -> 6224 bytes AMOS/Examples/Examples/H-4/Help_49.AMOS | Bin 0 -> 7158 bytes AMOS/Examples/Examples/H-5/Help_50.AMOS | Bin 0 -> 7574 bytes AMOS/Examples/Examples/H-5/Help_51.AMOS | Bin 0 -> 6496 bytes AMOS/Examples/Examples/H-5/Help_52.AMOS | Bin 0 -> 5646 bytes AMOS/Examples/Examples/H-5/Help_53.AMOS | Bin 0 -> 5180 bytes AMOS/Examples/Examples/H-5/Help_54.AMOS | Bin 0 -> 6152 bytes AMOS/Examples/Examples/H-5/Help_55.AMOS | Bin 0 -> 6872 bytes AMOS/Examples/Examples/H-5/Help_56.AMOS | Bin 0 -> 7230 bytes AMOS/Examples/Examples/H-5/Help_57.AMOS | Bin 0 -> 4104 bytes AMOS/Examples/Examples/H-5/Help_58.AMOS | Bin 0 -> 4240 bytes AMOS/Examples/Examples/H-5/Help_59.AMOS | Bin 0 -> 3758 bytes AMOS/Examples/Examples/H-6/Help_60.AMOS | Bin 0 -> 5162 bytes AMOS/Examples/Examples/H-6/Help_61.AMOS | Bin 0 -> 3394 bytes AMOS/Examples/Examples/H-6/Help_62.AMOS | Bin 0 -> 5288 bytes AMOS/Examples/Examples/H-6/Help_63.AMOS | Bin 0 -> 4880 bytes AMOS/Examples/Examples/H-6/Help_64.AMOS | Bin 0 -> 6052 bytes AMOS/Examples/Examples/H-6/Help_65.AMOS | Bin 0 -> 5966 bytes AMOS/Examples/Examples/H-6/Help_66.AMOS | Bin 0 -> 7654 bytes AMOS/Examples/Examples/H-6/Help_67.AMOS | Bin 0 -> 5086 bytes AMOS/Examples/Examples/H-6/Help_68.AMOS | Bin 0 -> 7160 bytes AMOS/Examples/Examples/H-6/Help_69.AMOS | Bin 0 -> 6288 bytes AMOS/Examples/Examples/H-6/Jokes | 20 + AMOS/Examples/Examples/H-7/Help_70.AMOS | Bin 0 -> 6694 bytes AMOS/Examples/Examples/H-7/Help_71.AMOS | Bin 0 -> 5186 bytes AMOS/Examples/Examples/H-7/Help_72.AMOS | Bin 0 -> 6810 bytes AMOS/Examples/Examples/H-7/Help_73.AMOS | Bin 0 -> 6300 bytes AMOS/Examples/Examples/H-7/Help_74.AMOS | Bin 0 -> 9368 bytes AMOS/Examples/Examples/H-7/Help_75.AMOS | Bin 0 -> 6974 bytes AMOS/Examples/Examples/H-7/Help_76.AMOS | Bin 0 -> 12042 bytes AMOS/Examples/Examples/H-7/Help_77.AMOS | Bin 0 -> 7426 bytes AMOS/Examples/Examples/H-7/Help_78.AMOS | Bin 0 -> 7462 bytes AMOS/Examples/Examples/H-7/Help_79.AMOS | Bin 0 -> 6594 bytes AMOS/Examples/Examples/H-8/Help_80.AMOS | Bin 0 -> 5058 bytes AMOS/Examples/Examples/H-8/Help_81.AMOS | Bin 0 -> 7102 bytes AMOS/Examples/Examples/H-8/Help_82.AMOS | Bin 0 -> 682 bytes AMOS/Examples/Examples/H-8/Help_82.Asc | 46 + AMOS/Examples/Examples/H-8/Help_83.AMOS | Bin 0 -> 4786 bytes AMOS/Examples/Examples/H-8/Help_84.AMOS | Bin 0 -> 5094 bytes AMOS/Examples/Iff/Logo.iff | Bin 0 -> 35970 bytes AMOS/Examples/Music/Med_Module | Bin 0 -> 51108 bytes AMOS/Examples/Music/Mod.Tracker | Bin 0 -> 42964 bytes AMOS/Examples/Music/Music.abk | Bin 0 -> 56818 bytes AMOS/Examples/Objects/Bobs.abk | Bin 0 -> 13710 bytes AMOS/Examples/Objects/Faces_A.abk | Bin 0 -> 1666 bytes AMOS/Examples/Objects/Faces_B.abk | Bin 0 -> 1666 bytes AMOS/Examples/Objects/Faces_C.abk | Bin 0 -> 1666 bytes AMOS/Examples/Objects/Ronnio.abk | Bin 0 -> 1138 bytes AMOS/Examples/Samples/Instruments.abk | Bin 0 -> 31572 bytes AMOS/Examples/Samples/Mixture.abk | Bin 0 -> 21480 bytes AMOS/Interpreter_Config | Bin 0 -> 75656 bytes AMOS/Productivity1.info | Bin 0 -> 900 bytes .../Equates/AMOSPro_System_Equates | 2507 ++ .../Equates/Editor_Commands.AMOS | Bin 0 -> 606 bytes .../Productivity1/Equates/Editor_Commands.Doc | 433 + AMOS/Productivity1/Equates/Equates.Doc | 311 + AMOS/Productivity1/Equates/Make_Equates.AMOS | Bin 0 -> 16990 bytes AMOS/Productivity1/Fileo'fax.AMOS | Bin 0 -> 73934 bytes AMOS/Productivity1/Menu_Editor.AMOS | Bin 0 -> 62728 bytes AMOS/Productivity1/Planet_Zybex/Zybex.AMOS | Bin 0 -> 126082 bytes .../Planet_Zybex/level1_screen.abk | Bin 0 -> 17284 bytes .../Planet_Zybex/level2_screen.abk | Bin 0 -> 32526 bytes .../Planet_Zybex/level3_screen.abk | Bin 0 -> 31556 bytes .../Planet_Zybex/level4_screen.abk | Bin 0 -> 33850 bytes .../Planet_Zybex/level5_screen.abk | Bin 0 -> 18810 bytes .../Planet_Zybex/level6_screen.abk | Bin 0 -> 24074 bytes .../Planet_Zybex/level7_screen.abk | Bin 0 -> 25900 bytes AMOS/Productivity1/Quatro.AMOS | Bin 0 -> 142054 bytes AMOS/Productivity1/SuperBlockout.AMOS | Bin 0 -> 134106 bytes AMOS/Productivity2.info | Bin 0 -> 900 bytes AMOS/Productivity2/Font8x8_Editor.AMOS | Bin 0 -> 7240 bytes AMOS/Productivity2/IFF_Compactor.AMOS | Bin 0 -> 23184 bytes AMOS/Productivity2/Procedures/AMAL/Bobs.abk | Bin 0 -> 970 bytes .../Procedures/AMAL/_Single_Step.AMOS | Bin 0 -> 2566 bytes .../Procedures/Audio/_Number_to_Speech.AMOS | Bin 0 -> 18456 bytes .../Procedures/Audio/_Number_to_Speech.Bak | Bin 0 -> 18106 bytes AMOS/Productivity2/Procedures/Bobs/RMask | Bin 0 -> 372 bytes AMOS/Productivity2/Procedures/Bobs/Rmask.S | 147 + .../Procedures/Bobs/Squashed_Bobs.Abk | Bin 0 -> 6978 bytes .../Procedures/Bobs/_Make_Mask.AMOS | Bin 0 -> 3262 bytes .../Procedures/Bobs/_Squash_A_Bob.AMOS | Bin 0 -> 3938 bytes .../Procedures/Bobs/_Squash_Procs.AMOS | Bin 0 -> 2782 bytes .../Procedures/Copper/_Dump_Copper.AMOS | Bin 0 -> 1286 bytes .../Procedures/Copper/_Rainbow_Example.AMOS | Bin 0 -> 4510 bytes .../Procedures/Disc/_DIR_First_Next.AMOS | Bin 0 -> 11292 bytes .../Procedures/Disc/_Disc_Info.AMOS | Bin 0 -> 3902 bytes .../Fractals/_Julia_Set_Fractals.AMOS | Bin 0 -> 4850 bytes .../Fractals/_Mandelbrot_Fractals.AMOS | Bin 0 -> 4516 bytes .../Fractals/_OLSys_Plant_Fractals.AMOS | Bin 0 -> 9344 bytes .../Procedures/Fractals/_Quatrals.AMOS | Bin 0 -> 4732 bytes .../Procedures/Graphics/_Fade_All.AMOS | Bin 0 -> 962 bytes .../Procedures/Graphics/_Polygons.AMOS | Bin 0 -> 2286 bytes .../Procedures/Graphics/_Splines.AMOS | Bin 0 -> 3736 bytes .../Procedures/Plasma/Plasma1_pal.IFF | Bin 0 -> 144 bytes .../Procedures/Plasma/Plasma2_pal.IFF | Bin 0 -> 144 bytes .../Procedures/Plasma/Plasma3_pal.IFF | Bin 0 -> 144 bytes .../Procedures/Plasma/Plasma4_pal.IFF | Bin 0 -> 144 bytes .../Procedures/Plasma/Plasma5_pal.IFF | Bin 0 -> 144 bytes .../Procedures/Plasma/Plasma6_pal.IFF | Bin 0 -> 144 bytes .../Procedures/Plasma/Plasma7_pal.IFF | Bin 0 -> 144 bytes .../Procedures/Plasma/Plasma8_pal.IFF | Bin 0 -> 144 bytes .../Procedures/Plasma/_Edit_Colours.AMOS | Bin 0 -> 15770 bytes .../Procedures/Plasma/_Plasma1.AMOS | Bin 0 -> 9146 bytes .../Procedures/Plasma/_Plasma2.AMOS | Bin 0 -> 11674 bytes .../Procedures/Screen_FX/Sine_Pic.iff | Bin 0 -> 3592 bytes .../Procedures/Screen_FX/_3D_Landscape.AMOS | Bin 0 -> 10296 bytes .../Procedures/Screen_FX/_3D_Scroller.AMOS | Bin 0 -> 8050 bytes .../Procedures/Screen_FX/_Fancy_Wipes.AMOS | Bin 0 -> 48614 bytes .../Procedures/Screen_FX/_Formula_Pics.AMOS | Bin 0 -> 2686 bytes .../Procedures/Screen_FX/_Pause_Scroll.AMOS | Bin 0 -> 2790 bytes .../Procedures/Screen_FX/_Screen_Saver.AMOS | Bin 0 -> 4094 bytes .../Procedures/Screen_FX/_Screen_Sine.AMOS | Bin 0 -> 3742 bytes .../Procedures/Screen_FX/_Scroll.AMOS | Bin 0 -> 4638 bytes .../Procedures/Screen_FX/_Slide.AMOS | Bin 0 -> 1192 bytes .../Procedures/Screen_FX/_Titchy_Scroll.AMOS | Bin 0 -> 2028 bytes .../Procedures/Screen_FX/_Wipe1.AMOS | Bin 0 -> 2332 bytes .../Procedures/Screen_FX/_Wipe2.AMOS | Bin 0 -> 2338 bytes .../Procedures/Screen_FX/_Wipe3.AMOS | Bin 0 -> 1422 bytes .../System/AMOS_Workbench_Demo.AMOS | Bin 0 -> 9672 bytes .../Procedures/System/_Get_DOS_Error.AMOS | Bin 0 -> 2892 bytes .../Procedures/System/_Get_Time.AMOS | Bin 0 -> 2724 bytes .../Procedures/System/_Wind_Execute.AMOS | Bin 0 -> 5362 bytes .../Procedures/System/_Wind_Input.AMOS | Bin 0 -> 7244 bytes .../Procedures/System/_Wind_Open.AMOS | Bin 0 -> 4180 bytes .../Procedures/System/_Wind_Print.AMOS | Bin 0 -> 5202 bytes .../Procedures/Techniques/Hiscores.SCR | 20 + .../Procedures/Techniques/_3D_Stars.AMOS | Bin 0 -> 2262 bytes .../Procedures/Techniques/_Hi_Scores.AMOS | Bin 0 -> 23586 bytes .../Procedures/Techniques/_Memory_Array.AMOS | Bin 0 -> 5280 bytes .../Procedures/Techniques/_Radar.AMOS | Bin 0 -> 26876 bytes .../Procedures/Text/_Double_Height.AMOS | Bin 0 -> 1562 bytes .../Procedures/Text/_Text_Highlight.AMOS | Bin 0 -> 1836 bytes .../Procedures/Text/_Type_Writer.AMOS | Bin 0 -> 1532 bytes .../Procedures/Text/_Vertical_Text.AMOS | Bin 0 -> 1110 bytes .../Procedures/Text/_Wavy_Text.AMOS | Bin 0 -> 2708 bytes .../Productivity2/Wonderland/Editor_Panel.Iff | Bin 0 -> 4716 bytes AMOS/Productivity2/Wonderland/Game1.lev | Bin 0 -> 7205 bytes AMOS/Productivity2/Wonderland/Game2.lev | Bin 0 -> 7205 bytes AMOS/Productivity2/Wonderland/Landscape.Iff | Bin 0 -> 20138 bytes AMOS/Productivity2/Wonderland/Score_Panel.Iff | Bin 0 -> 4372 bytes .../Productivity2/Wonderland/Title_Screen.Iff | Bin 0 -> 7044 bytes AMOS/Productivity2/Wonderland/Wonderland.AMOS | Bin 0 -> 51424 bytes .../Wonderland/Wonderland_Samples.Abk | Bin 0 -> 20814 bytes AMOS/Tutorial.info | Bin 0 -> 900 bytes AMOS/Tutorial/Extensions/Extension_ReadMe.Asc | 117 + AMOS/Tutorial/Extensions/__uae____Cequ_s | 133 + AMOS/Tutorial/Extensions/__uae____Compact | Bin 0 -> 1832 bytes AMOS/Tutorial/Extensions/__uae____LEqu_s | 1002 + AMOS/Tutorial/Extensions/__uae____Music_s | 4614 +++ .../Extensions/__uae____amos_includes_s | 24 + AMOS/Tutorial/Extensions/__uae____compact_s | 717 + AMOS/Tutorial/Extensions/__uae____equ_s | 1884 + AMOS/Tutorial/Extensions/__uae____io_Ports_s | 1029 + .../Tutorial/Extensions/__uae____liboffsets_s | 460 + AMOS/Tutorial/Extensions/__uae____pointe_s | 335 + AMOS/Tutorial/Extensions/__uae____request_s | 797 + AMOS/Tutorial/Extensions/__uae____wequ_s | 318 + .../Extra_Configs/Compiler_Config.Backup | Bin 0 -> 1532 bytes .../Extra_Configs/Editor_Config.Backup | Bin 0 -> 18868 bytes .../Extra_Configs/Interpreter_Config.Backup | Bin 0 -> 792 bytes AMOS/Tutorial/Iff/Example_resource.Iff | Bin 0 -> 14686 bytes AMOS/Tutorial/Iff/Window.Iff | Bin 0 -> 24248 bytes AMOS/Tutorial/Iff_Anim/AMOS.Anim | Bin 0 -> 117988 bytes AMOS/Tutorial/Objects/Amal_Bobs.Abk | Bin 0 -> 5410 bytes AMOS/Tutorial/Objects/Bobs.Abk | Bin 0 -> 13710 bytes AMOS/Tutorial/Objects/Col.Abk | Bin 0 -> 526 bytes AMOS/Tutorial/Objects/Menu_Bobs.Abk | Bin 0 -> 2440 bytes AMOS/Tutorial/Objects/Play_Bobs.Abk | Bin 0 -> 1394 bytes AMOS/Tutorial/Objects/Sprites.Abk | Bin 0 -> 3542 bytes AMOS/Tutorial/ReTokenise.AMOS | Bin 0 -> 3298 bytes AMOS/Tutorial/Tutorials/AMAL/AMAL_1.AMOS | Bin 0 -> 7598 bytes AMOS/Tutorial/Tutorials/AMAL/AMAL_2.AMOS | Bin 0 -> 7654 bytes AMOS/Tutorial/Tutorials/AMAL/AMAL_3.AMOS | Bin 0 -> 6412 bytes AMOS/Tutorial/Tutorials/AMAL/AMAL_4.AMOS | Bin 0 -> 7076 bytes AMOS/Tutorial/Tutorials/AMAL/AMAL_5.AMOS | Bin 0 -> 6544 bytes AMOS/Tutorial/Tutorials/AMAL/AMAL_6.AMOS | Bin 0 -> 5138 bytes AMOS/Tutorial/Tutorials/AMAL/AMAL_7.AMOS | Bin 0 -> 11922 bytes AMOS/Tutorial/Tutorials/AMAL/PLay_Data.Abk | Bin 0 -> 1452 bytes AMOS/Tutorial/Tutorials/Appear.AMOS | Bin 0 -> 4062 bytes AMOS/Tutorial/Tutorials/Arrays.AMOS | Bin 0 -> 4724 bytes .../Tutorial/Tutorials/Autoback_&_Update.AMOS | Bin 0 -> 8492 bytes .../Tutorials/Collision_Detection.AMOS | Bin 0 -> 10776 bytes AMOS/Tutorial/Tutorials/Computed_Sprites.AMOS | Bin 0 -> 7374 bytes AMOS/Tutorial/Tutorials/Error_Handling_1.AMOS | Bin 0 -> 8810 bytes AMOS/Tutorial/Tutorials/Error_Handling_2.AMOS | Bin 0 -> 4304 bytes AMOS/Tutorial/Tutorials/Fade.AMOS | Bin 0 -> 8970 bytes AMOS/Tutorial/Tutorials/Hardware_Sprites.AMOS | Bin 0 -> 16878 bytes AMOS/Tutorial/Tutorials/Iff_Animation.AMOS | Bin 0 -> 7622 bytes .../Tutorials/Interface/Autocentering.AMOS | Bin 0 -> 1526 bytes .../Tutorials/Interface/Button_Types.AMOS | Bin 0 -> 10892 bytes .../Tutorials/Interface/Communication.AMOS | Bin 0 -> 3316 bytes .../Tutorials/Interface/Editing_Zones.AMOS | Bin 0 -> 2332 bytes .../Tutorials/Interface/Example_Resource.Abk | Bin 0 -> 7048 bytes .../Tutorials/Interface/Full_Example.AMOS | Bin 0 -> 8860 bytes .../Tutorials/Interface/Graphics.AMOS | Bin 0 -> 5426 bytes .../Tutorials/Interface/Simple_Requester.AMOS | Bin 0 -> 1164 bytes .../Tutorial/Tutorials/Interface/Sliders.AMOS | Bin 0 -> 10120 bytes .../Tutorials/Interface/Working_Buttons.AMOS | Bin 0 -> 3520 bytes AMOS/Tutorial/Tutorials/Menus/Data.Menu | Bin 0 -> 10562 bytes AMOS/Tutorial/Tutorials/Menus/Menus_1.AMOS | Bin 0 -> 4804 bytes AMOS/Tutorial/Tutorials/Menus/Menus_2.AMOS | Bin 0 -> 2956 bytes AMOS/Tutorial/Tutorials/Menus/Menus_3.AMOS | Bin 0 -> 5092 bytes AMOS/Tutorial/Tutorials/Menus/Menus_4.AMOS | Bin 0 -> 5110 bytes AMOS/Tutorial/Tutorials/Menus/Menus_5.AMOS | Bin 0 -> 6810 bytes AMOS/Tutorial/Tutorials/Menus/Menus_6.AMOS | Bin 0 -> 7604 bytes AMOS/Tutorial/Tutorials/Menus/Menus_7.AMOS | Bin 0 -> 5538 bytes AMOS/Tutorial/Tutorials/Menus/Menus_8.AMOS | Bin 0 -> 7828 bytes AMOS/Tutorial/Tutorials/Menus/Menus_9.AMOS | Bin 0 -> 7592 bytes AMOS/Tutorial/Tutorials/Multi_Rainbows.AMOS | Bin 0 -> 11958 bytes AMOS/Tutorial/Tutorials/Multi_Rainbows.V1_00 | Bin 0 -> 11958 bytes AMOS/Tutorial/Tutorials/Procedures_1.AMOS | Bin 0 -> 6546 bytes AMOS/Tutorial/Tutorials/Procedures_2.AMOS | Bin 0 -> 9564 bytes AMOS/Tutorial/Tutorials/Rainbows.AMOS | Bin 0 -> 9688 bytes AMOS/Tutorial/Tutorials/Sprites_v_Bobs.AMOS | Bin 0 -> 11772 bytes AMOSPro Sources/(Compiler_Config.o) | Bin 0 -> 1568 bytes AMOSPro Sources/(Convert.o) | Bin 0 -> 14008 bytes AMOSPro Sources/(Editor_Config.o) | Bin 0 -> 18812 bytes AMOSPro Sources/(FSel.o) | Bin 0 -> 6156 bytes AMOSPro Sources/(Interpreter_Config.o) | Bin 0 -> 808 bytes AMOSPro Sources/(b.o) | Bin 0 -> 100704 bytes AMOSPro Sources/+3d.s | 1558 + AMOSPro Sources/+CLib_Labels.s | 33 + AMOSPro Sources/+CLib_Size.s | 34 + AMOSPro Sources/+Compact_Labels.s | 53 + AMOSPro Sources/+Compact_Size.s | 35 + AMOSPro Sources/+Compext_Labels.s | 68 + AMOSPro Sources/+Compext_Size.s | 35 + AMOSPro Sources/+CreateCompiler | 3 + AMOSPro Sources/+CreateExtras | 3 + AMOSPro Sources/+Debug0.s | 4 + AMOSPro Sources/+Debug1.s | 4 + AMOSPro Sources/+Debug_2On | 4 + AMOSPro Sources/+Debug_On | 4 + AMOSPro Sources/+ILib_Functions.s | 6 + AMOSPro Sources/+ILib_Size.s | 5 + AMOSPro Sources/+IO_Ports_Labels.s | 57 + AMOSPro Sources/+IO_Ports_Size.s | 5 + AMOSPro Sources/+Lib_Title.s | 5 + AMOSPro Sources/+MakeCompiler | 4 + AMOSPro Sources/+MakeExtras | 3 + AMOSPro Sources/+Request_Labels.s | 8 + AMOSPro Sources/+Request_Size.s | 5 + AMOSPro Sources/+Token.s | 1043 + AMOSPro Sources/+Toktab_Verif.Bin | Bin 0 -> 3112 bytes AMOSPro Sources/+Toktab_Verif.s | Bin 0 -> 3104 bytes AMOSPro Sources/+assigns | 7 + AMOSPro Sources/+bugs.s | 35 + AMOSPro Sources/+comp.s | 6678 ++++ AMOSPro Sources/+copyall | 3 + AMOSPro Sources/+copycompiler | 47 + AMOSPro Sources/+copyextras | 36 + AMOSPro Sources/+copyfiles | 24 + AMOSPro Sources/+debug2.s | 4 + AMOSPro Sources/+internal_jumps.s | 160 + AMOSPro Sources/+lequ.s | 1493 + AMOSPro Sources/+lib_Labels.s | 1045 + AMOSPro Sources/+lib_size.s | 5 + AMOSPro Sources/+liboffsets.s | 460 + AMOSPro Sources/+music.s_Labels.s | 114 + AMOSPro Sources/+music.s_Size.s | 5 + AMOSPro Sources/+music_Labels.s | 113 + AMOSPro Sources/+music_Size.s | 5 + AMOSPro Sources/+pro2.s | 695 + AMOSPro Sources/+w.s.auts.info | Bin 0 -> 366 bytes AMOSPro Sources/AMOSProDrip | 5 + AMOSPro Sources/AP2 | Bin 0 -> 22624 bytes AMOSPro Sources/APCmp | Bin 0 -> 29528 bytes AMOSPro Sources/Bug.AMOS | Bin 0 -> 7616 bytes AMOSPro Sources/Bug.Anim | Bin 0 -> 117988 bytes AMOSPro Sources/Bug.Anim.info | Bin 0 -> 1280 bytes AMOSPro Sources/Compiler | 2 + AMOSPro Sources/Compiler_Editor_Config | Bin 0 -> 18776 bytes AMOSPro Sources/Compiler_Interpreter_Config | Bin 0 -> 824 bytes AMOSPro Sources/Dbl_Source/Compiler_Dbl.Asc | 344 + AMOSPro Sources/Dbl_Source/Tiny_Shell_Dbl.Asc | 72 + AMOSPro Sources/Default_DBL.Bin | Bin 0 -> 3532 bytes AMOSPro Sources/Default_Editor_Config | Bin 0 -> 18776 bytes AMOSPro Sources/Default_Interpreter_Config | Bin 0 -> 772 bytes AMOSPro Sources/Docs/Compiler_250593.FC | Bin 0 -> 6704 bytes AMOSPro Sources/Docs/Compiler_250593.FC.info | Bin 0 -> 461 bytes AMOSPro Sources/Docs/Compiler_260493.Doc | 320 + AMOSPro Sources/Docs/Compiler_270593.FC | Bin 0 -> 15292 bytes AMOSPro Sources/Docs/Compiler_270593.FC.info | Bin 0 -> 461 bytes AMOSPro Sources/Docs/Compiler_Discs.Asc | 263 + AMOSPro Sources/Docs/Compiler_Errors.Final | Bin 0 -> 19272 bytes .../Docs/Compiler_Errors.Final.info | Bin 0 -> 461 bytes AMOSPro Sources/Docs/Compiler_Foreword.Asc | 35 + AMOSPro Sources/Docs/Compiler_PPDoc.FC | Bin 0 -> 10214 bytes AMOSPro Sources/Docs/Compiler_PPDoc.FC.info | Bin 0 -> 461 bytes AMOSPro Sources/Docs/Compiler_install.Doc | 124 + AMOSPro Sources/Docs/Dom_Public_list.Asc | 78 + AMOSPro Sources/Docs/Fr_Scheurer_list.Asc | 77 + AMOSPro Sources/Docs/Last_Sheddule.FC | Bin 0 -> 7608 bytes AMOSPro Sources/Docs/Last_Sheddule.FC.info | Bin 0 -> 457 bytes AMOSPro Sources/Docs/PCOSReport_260393.Asc | 57 + AMOSPro Sources/Docs/Report_260393.asc | 582 + AMOSPro Sources/Docs/Requests_JBB.Asc | 22 + AMOSPro Sources/Docs/System_disks_list.Asc | 266 + AMOSPro Sources/Docs/bugs_&_fun.lzh | Bin 0 -> 362044 bytes AMOSPro Sources/Dot_AMOS/+Version.s | 4 + AMOSPro Sources/Dot_AMOS/AA_Logo | Bin 0 -> 26664 bytes AMOSPro Sources/Dot_AMOS/AA_Logo.AMOS | Bin 0 -> 7704 bytes AMOSPro Sources/Dot_AMOS/AA_Logo.info | Bin 0 -> 1122 bytes AMOSPro Sources/Dot_AMOS/Check_CLib | Bin 0 -> 30728 bytes AMOSPro Sources/Dot_AMOS/Check_CLib.info | Bin 0 -> 1122 bytes AMOSPro Sources/Dot_AMOS/Compiler_Install | Bin 0 -> 156128 bytes .../Dot_AMOS/Compiler_Install.AMOS | Bin 0 -> 100196 bytes .../Dot_AMOS/Compiler_Install.info | Bin 0 -> 1122 bytes AMOSPro Sources/Dot_AMOS/File_Compare | Bin 0 -> 22048 bytes AMOSPro Sources/Dot_AMOS/File_Compare.AMOS | Bin 0 -> 706 bytes AMOSPro Sources/Dot_AMOS/File_Compare.info | Bin 0 -> 1122 bytes AMOSPro Sources/Dot_AMOS/Hunt_String | Bin 0 -> 33416 bytes AMOSPro Sources/Dot_AMOS/Hunt_String.AMOS | Bin 0 -> 7626 bytes AMOSPro Sources/Dot_AMOS/Hunt_String.info | Bin 0 -> 1122 bytes AMOSPro Sources/Dot_AMOS/Insert_DBL | Bin 0 -> 70260 bytes AMOSPro Sources/Dot_AMOS/Insert_DBL.AMOS | Bin 0 -> 14710 bytes AMOSPro Sources/Dot_AMOS/Insert_DBL.info | Bin 0 -> 1122 bytes AMOSPro Sources/Dot_AMOS/Install_Banks.Abs | Bin 0 -> 42112 bytes AMOSPro Sources/Dot_AMOS/Library_Digest | Bin 0 -> 34920 bytes AMOSPro Sources/Dot_AMOS/Library_Digest.info | Bin 0 -> 1122 bytes AMOSPro Sources/Dot_AMOS/Library_Handler | Bin 0 -> 34868 bytes AMOSPro Sources/Dot_AMOS/Library_Handler.AMOS | Bin 0 -> 11302 bytes AMOSPro Sources/Dot_AMOS/Library_Handler.info | Bin 0 -> 1122 bytes AMOSPro Sources/Dot_AMOS/Locate_APSystem.AMOS | Bin 0 -> 10914 bytes AMOSPro Sources/Dot_AMOS/Make_Checklist.AMOS | Bin 0 -> 11974 bytes AMOSPro Sources/Dot_AMOS/Make_Help.AMOS | Bin 0 -> 1698 bytes AMOSPro Sources/Dot_AMOS/Make_Linked.AMOS | Bin 0 -> 7062 bytes AMOSPro Sources/Dot_AMOS/version.amos | Bin 0 -> 6180 bytes AMOSPro Sources/EComp.Asc | 1446 + AMOSPro Sources/Editor_DBL.Bin | Bin 0 -> 7640 bytes AMOSPro Sources/Francois | 2 + AMOSPro Sources/Francois_Editor_Config | Bin 0 -> 18936 bytes AMOSPro Sources/Francois_Interpreter_Config | Bin 0 -> 866 bytes AMOSPro Sources/GenAm.opts | 3 + AMOSPro Sources/GenAm2 | Bin 0 -> 23744 bytes AMOSPro Sources/GetChunk.info | Bin 0 -> 1122 bytes AMOSPro Sources/Icons.Abk | Bin 0 -> 5844 bytes AMOSPro Sources/Instruction_List.Asc | 716 + AMOSPro Sources/JBB_grafics/1_Turbo.anim | Bin 0 -> 96666 bytes AMOSPro Sources/JBB_grafics/2_Boost.Anim | Bin 0 -> 43654 bytes AMOSPro Sources/JBB_grafics/Mouse2.Abk | Bin 0 -> 334 bytes AMOSPro Sources/JBB_grafics/editor.AMOS4c.iff | Bin 0 -> 11594 bytes AMOSPro Sources/JBB_grafics/editor.WB4c.iff | Bin 0 -> 13564 bytes AMOSPro Sources/JBB_grafics/editor.WB8c.iff | Bin 0 -> 17942 bytes .../JBB_progs/AMOSPro_CompilerA_Res_WB.Abk | Bin 0 -> 10656 bytes .../JBB_progs/AMOSPro_Compiler_Res_WB.Abk | Bin 0 -> 18988 bytes .../JBB_progs/AMOSPro_Compiler_Res_WB2.Abk | Bin 0 -> 15452 bytes .../JBB_progs/AMOSPro_Default_Res_WB.Abk | Bin 0 -> 9728 bytes .../JBB_progs/AMOSPro_Default_Res_secu.Abk | Bin 0 -> 9934 bytes .../JBB_progs/AMOSPro_Editor_Res_WB.Abk | Bin 0 -> 20508 bytes AMOSPro Sources/JBB_progs/Hexa_Editor.AMOS | Bin 0 -> 20280 bytes AMOSPro Sources/Library_handler | Bin 0 -> 34556 bytes AMOSPro Sources/MergeDBL | 2 + AMOSPro Sources/Object_Pics.Abk | Bin 0 -> 13750 bytes AMOSPro Sources/ReOrg.prefs | Bin 0 -> 416 bytes AMOSPro Sources/Version.info | Bin 0 -> 1122 bytes AMOSPro Sources/a3d | 1 + AMOSPro Sources/acompd | 3 + AMOSPro Sources/adebug.prefs | Bin 0 -> 117 bytes AMOSPro Sources/adebug.var | 655 + AMOSPro Sources/adefaultdbl | 3 + AMOSPro Sources/aeditdbl | 3 + AMOSPro Sources/alib2 | 1 + AMOSPro Sources/aprod | 2 + AMOSPro Sources/c3d.lib | Bin 0 -> 47696 bytes AMOSPro Sources/ddrip | 2 + AMOSPro Sources/debug0 | 3 + AMOSPro Sources/debug1 | 3 + AMOSPro Sources/debug2 | 3 + AMOSPro Sources/defaultdbl | 3 + AMOSPro Sources/dir_clone | Bin 0 -> 36564 bytes AMOSPro Sources/dir_clone.amos | Bin 0 -> 16918 bytes AMOSPro Sources/editdbl | 3 + AMOSPro Sources/enf | 3 + AMOSPro Sources/includes.info | Bin 0 -> 628 bytes AMOSPro Sources/includes/devices/audio.i | 59 + AMOSPro Sources/includes/devices/bootblock.i | 34 + AMOSPro Sources/includes/devices/clipboard.i | 65 + AMOSPro Sources/includes/devices/console.i | 98 + AMOSPro Sources/includes/devices/conunit.i | 87 + AMOSPro Sources/includes/devices/gameport.i | 52 + AMOSPro Sources/includes/devices/hardblocks.i | 195 + AMOSPro Sources/includes/devices/keyboard.i | 25 + AMOSPro Sources/includes/devices/keymap.i | 71 + AMOSPro Sources/includes/devices/narrator.i | 87 + AMOSPro Sources/includes/devices/scsidisk.i | 96 + AMOSPro Sources/includes/devices/trackdisk.i | 181 + AMOSPro Sources/includes/exec/ables.i | 98 + AMOSPro Sources/includes/exec/alerts.i | 226 + AMOSPro Sources/includes/exec/errors.i | 21 + AMOSPro Sources/includes/exec/exec_lib.i | 115 + AMOSPro Sources/includes/exec/execbase.i | 152 + AMOSPro Sources/includes/exec/execname.i | 18 + AMOSPro Sources/includes/exec/initializers.i | 54 + AMOSPro Sources/includes/exec/resident.i | 48 + AMOSPro Sources/includes/exec/strings.i | 59 + AMOSPro Sources/includes/graphics/display.i | 40 + AMOSPro Sources/includes/graphics/gels.i | 204 + AMOSPro Sources/includes/graphics/gfxbase.i | 78 + AMOSPro Sources/includes/graphics/regions.i | 28 + AMOSPro Sources/includes/graphics/sprite.i | 21 + AMOSPro Sources/includes/hardware/adkbits.i | 52 + AMOSPro Sources/includes/hardware/blit.i | 88 + AMOSPro Sources/includes/hardware/cia.i | 173 + AMOSPro Sources/includes/hardware/custom.i | 123 + AMOSPro Sources/includes/hardware/dmabits.i | 49 + AMOSPro Sources/includes/libraries/.fastdir | Bin 0 -> 458 bytes .../includes/libraries/configregs.i | 192 + .../includes/libraries/configvars.i | 48 + AMOSPro Sources/includes/libraries/diskfont.i | 72 + AMOSPro Sources/includes/libraries/dos_lib.i | 57 + .../includes/libraries/expansion.i | 21 + .../includes/libraries/expansionbase.i | 69 + .../includes/libraries/filehandler.i | 122 + .../includes/libraries/mathlibrary.i | 42 + .../includes/libraries/romboot_base.i | 48 + .../includes/libraries/translator.i | 17 + AMOSPro Sources/includes/resources/cia.i | 21 + AMOSPro Sources/includes/resources/disk.i | 118 + .../includes/resources/filesysres.i | 52 + .../includes/resources/mathresource.i | 55 + AMOSPro Sources/includes/resources/misc.i | 47 + AMOSPro Sources/includes/resources/potgo.i | 19 + AMOSPro Sources/includes/workbench/icon.i | 24 + AMOSPro Sources/includes/workbench/startup.i | 39 + .../includes/workbench/workbench.i | 106 + AMOSPro Sources/info.abk | Bin 0 -> 914 bytes AMOSPro Sources/lrout | 2 + AMOSPro Sources/make_linked | Bin 0 -> 31532 bytes AMOSPro Sources/monam2.inf | Bin 0 -> 78 bytes AMOSPro Sources/parnetcopy | 21 + AMOSPro Sources/secu | 36 + AMOSPro Sources/squash.amos | Bin 0 -> 4734 bytes AMOSPro Sources/unfrancois | 2 + LICENSE | 3 +- README.md | 55 +- aall | 18 + acomp | 6 + adata | 15 + aedit | 2 + aext | 5 + alib | 9 + amon | 2 + apro | 7 + atools | 14 + aw | 4 + bin/+AMOSPro_Mouse.abk | Bin 0 -> 1824 bytes bin/+Dialog_Funcs.bin | Bin 0 -> 158 bytes bin/+WFont.bin | Bin 0 -> 512 bytes bin/Editor_Menus.asc | Bin 0 -> 3419 bytes bin/Editor_Menus.bin | Bin 0 -> 1593 bytes bin/ReqPic.bin | Bin 0 -> 2416 bytes c/Check_CLib | Bin 0 -> 24964 bytes c/Check_CLib.AMOS | Bin 0 -> 6474 bytes c/Get_Chunk | Bin 0 -> 20792 bytes c/Get_Chunk.AMOS | Bin 0 -> 6706 bytes c/Library_Digest | Bin 0 -> 29536 bytes c/Library_Digest.AMOS | Bin 0 -> 11574 bytes c/Make_Labels | Bin 0 -> 29108 bytes c/Make_Labels.AMOS | Bin 0 -> 10900 bytes c/Make_Toktable | Bin 0 -> 12652 bytes c/Make_Toktable.AMOS | Bin 0 -> 2098 bytes c/genam | Bin 0 -> 64188 bytes c/genim2 | Bin 0 -> 29104 bytes compiler/+APComp.s | 12053 +++++++ compiler/+CLib.s | 12191 +++++++ compiler/+CompExt.s | 1606 + compiler/+Compiler_Config.s | 185 + compiler/+Header.s | 1261 + compiler/+Header_Backstart.s | 134 + compiler/acdata | 10 + compiler/aclib | 6 + compiler/acomp | 3 + compiler/acompext | 5 + compiler/aheader | 3 + extensions/+Compact.s | 672 + extensions/+IO_Ports.s | 1194 + extensions/+Music.s | 4867 +++ extensions/+Request.s | 185 + extensions/Intuition-41.95/AMOS/Cequ.s | 139 + extensions/Intuition-41.95/AMOS/LEqu.s | 1001 + .../Intuition-41.95/AMOS/amos_includes.s | 24 + extensions/Intuition-41.95/AMOS/equ.s | 1883 + extensions/Intuition-41.95/AMOS/liboffsets.s | 473 + extensions/Intuition-41.95/AMOS/wequ.s | 318 + extensions/Intuition-41.95/AMOS1.3/cequ.s | 138 + extensions/Intuition-41.95/AMOS1.3/equ.s | 1119 + .../Intuition-41.95/Intuition/ASSEMPRO.INF | Bin 0 -> 2098 bytes extensions/Intuition-41.95/Intuition/IVread | Bin 0 -> 112 bytes .../Intuition-41.95/Intuition/IVread.asm | 40 + .../Intuition/IntuiViewer.AMOS.info | Bin 0 -> 2901 bytes .../Intuition/IntuiViewer.guide | 62 + .../Intuition/IntuiViewer.info | Bin 0 -> 1122 bytes .../Intuition/Intuition.guide.info | Bin 0 -> 504 bytes .../Intuition/Intuition.lib.info | Bin 0 -> 1718 bytes .../Intuition-41.95/Intuition/Shanghai.guide | 201 + .../Intuition-41.95/Intuition/aic-test.amos | Bin 0 -> 210 bytes extensions/Intuition-41.95/Intuition/backup | 7 + .../Intuition-41.95/Intuition/bugs/1.3a-1.txt | 51 + .../Intuition/bugs/1.3b-0.readme | 63 + .../Intuition-41.95/Intuition/bugs/1.3b-0.uu | 165 + .../Intuition-41.95/Intuition/bugs/1.3b-1.txt | 73 + .../Intuition/bugs/1.3b-10.asc | 27 + .../Intuition/bugs/1.3b-10.txt | 31 + .../Intuition/bugs/1.3b-11.txt | 28 + .../Intuition/bugs/1.3b-12.txt | 155 + .../Intuition-41.95/Intuition/bugs/1.3b-2.txt | 146 + .../Intuition-41.95/Intuition/bugs/1.3b-3.uu | 41 + .../Intuition-41.95/Intuition/bugs/1.3b-4.uu | 44 + .../Intuition-41.95/Intuition/bugs/1.3b-5.txt | 28 + .../Intuition-41.95/Intuition/bugs/1.3b-6.txt | 32 + .../Intuition-41.95/Intuition/bugs/1.3b-7.txt | 43 + .../Intuition-41.95/Intuition/bugs/1.3b-8.txt | 30 + .../Intuition-41.95/Intuition/bugs/1.3b-9.64 | 145 + .../Intuition-41.95/Intuition/bugs/bug6.asc | 58 + .../Intuition-41.95/Intuition/bugs/docbugs1 | 45 + .../Intuition-41.95/Intuition/bugs/docbugs2 | 55 + .../Intuition/bugs/fontreq-bug.uu | 143 + .../Intuition-41.95/Intuition/bugs/int.msg1 | 54 + .../Intuition-41.95/Intuition/bugs/int.ph | 203 + .../Intuition-41.95/Intuition/bugs/int.ph2 | 45 + .../Intuition-41.95/Intuition/bugs/intbug13.0 | 95 + .../Intuition/bugs/iplayer.bug1 | 2 + .../Intuition-41.95/Intuition/bugs/test2.asc | 195 + extensions/Intuition-41.95/Intuition/cmdlist | 110 + .../Intuition-41.95/Intuition/drawer.info | Bin 0 -> 900 bytes extensions/Intuition-41.95/Intuition/e | 3 + .../Intuition-41.95/Intuition/error.iff | Bin 0 -> 8794 bytes .../Intuition-41.95/Intuition/iflood.doc | 42 + .../Intuition-41.95/Intuition/igadbank.doc | 57 + .../Intuition-41.95/Intuition/imenu.doc | 50 + .../Intuition-41.95/Intuition/intuition.guide | 4090 +++ extensions/Intuition-41.95/Intuition/lc | 1 + extensions/Intuition-41.95/Intuition/makefile | 200 + .../Intuition-41.95/Intuition/obj/amosfuncs.o | Bin 0 -> 1004 bytes .../Intuition/obj/creator/amosfuncs.o | Bin 0 -> 1440 bytes .../Intuition/obj/creator/errors.o | Bin 0 -> 1804 bytes .../Intuition/obj/creator/extcode | Bin 0 -> 9160 bytes .../Intuition/obj/creator/graphics.o | Bin 0 -> 732 bytes .../Intuition/obj/creator/input.o | Bin 0 -> 1380 bytes .../Intuition/obj/creator/intmisc.o | Bin 0 -> 748 bytes .../Intuition/obj/creator/iutils.o | Bin 0 -> 264 bytes .../Intuition/obj/creator/jumptable.o | Bin 0 -> 1744 bytes .../Intuition/obj/creator/memory.o | Bin 0 -> 1008 bytes .../Intuition/obj/creator/screens.o | Bin 0 -> 2172 bytes .../Intuition/obj/creator/startup.o | Bin 0 -> 3276 bytes .../Intuition/obj/creator/windows.o | Bin 0 -> 3104 bytes .../Intuition-41.95/Intuition/obj/errors.o | Bin 0 -> 1804 bytes .../Intuition-41.95/Intuition/obj/extcode | Bin 0 -> 8784 bytes .../Intuition-41.95/Intuition/obj/graphics.o | Bin 0 -> 732 bytes .../Intuition-41.95/Intuition/obj/input.o | Bin 0 -> 1380 bytes .../Intuition-41.95/Intuition/obj/intmisc.o | Bin 0 -> 748 bytes .../Intuition-41.95/Intuition/obj/iutils.o | Bin 0 -> 264 bytes .../Intuition-41.95/Intuition/obj/jumptable.o | Bin 0 -> 1744 bytes .../Intuition-41.95/Intuition/obj/memory.o | Bin 0 -> 1008 bytes .../Intuition-41.95/Intuition/obj/screens.o | Bin 0 -> 2172 bytes .../Intuition-41.95/Intuition/obj/startup.o | Bin 0 -> 3276 bytes .../Intuition-41.95/Intuition/obj/windows.o | Bin 0 -> 3104 bytes .../Intuition/obju/creator/extcode | Bin 0 -> 9160 bytes .../Intuition-41.95/Intuition/obju/extcode | Bin 0 -> 8632 bytes .../Intuition-41.95/Intuition/obju/screens.o | Bin 0 -> 2156 bytes .../Intuition-41.95/Intuition/obju/windows.o | Bin 0 -> 2872 bytes .../Intuition/progs/bcollin.amos | Bin 0 -> 5656 bytes .../Intuition-41.95/Intuition/progs/bug1.amos | Bin 0 -> 2892 bytes .../Intuition-41.95/Intuition/progs/bug2.amos | Bin 0 -> 428 bytes .../Intuition-41.95/Intuition/progs/bug2.asc | 22 + .../Intuition-41.95/Intuition/progs/bug3.asc | 35 + .../Intuition-41.95/Intuition/progs/bug4.asc | 32 + .../Intuition/progs/inttest.Bak | Bin 0 -> 15622 bytes .../Intuition/progs/inttest.amos | Bin 0 -> 15622 bytes .../Intuition/progs/inttest1.amos | Bin 0 -> 2208 bytes .../Intuition/progs/inttest2.amos | Bin 0 -> 1908 bytes .../Intuition/progs/inttest3.amos | Bin 0 -> 1734 bytes .../Intuition/progs/inttest4.amos | Bin 0 -> 1640 bytes .../Intuition/progs/inttest5.amos | Bin 0 -> 406 bytes .../Intuition/progs/inttest6.amos | Bin 0 -> 2974 bytes .../Intuition/progs/intuiviewer.amos | Bin 0 -> 15860 bytes .../Intuition-41.95/Intuition/progs/test0 | Bin 0 -> 14984 bytes .../Intuition/progs/test0.amos | Bin 0 -> 2388 bytes .../Intuition-41.95/Intuition/routine.codes | 174 + .../Intuition-41.95/Intuition/screenmodes.txt | 37 + .../Intuition/src/IntRoutines.i | 63 + .../Intuition-41.95/Intuition/src/color.s | 386 + .../Intuition-41.95/Intuition/src/data.i | 122 + .../Intuition-41.95/Intuition/src/defs.i | 200 + .../Intuition-41.95/Intuition/src/errordefs.i | 43 + .../Intuition-41.95/Intuition/src/errors.s | 136 + .../Intuition/src/errorstubs.s | 166 + .../Intuition-41.95/Intuition/src/extcode.s | 30 + .../Intuition-41.95/Intuition/src/extutils.s | 79 + .../Intuition-41.95/Intuition/src/fonts.s | 169 + .../Intuition-41.95/Intuition/src/gadgets.bak | 1876 + .../Intuition-41.95/Intuition/src/gadgets.s | 1593 + .../Intuition-41.95/Intuition/src/graphics.s | 544 + .../Intuition-41.95/Intuition/src/iflood.s | 187 + .../Intuition-41.95/Intuition/src/input.s | 495 + .../Intuition-41.95/Intuition/src/intuition.s | 165 + .../Intuition/src/intuition.s.bak | 165 + .../Intuition-41.95/Intuition/src/itokens.s | 803 + .../Intuition-41.95/Intuition/src/jumptable.i | 69 + .../Intuition-41.95/Intuition/src/macros.i | 134 + .../Intuition-41.95/Intuition/src/macros2.i | 27 + .../Intuition-41.95/Intuition/src/menus.s | 314 + .../Intuition-41.95/Intuition/src/offsets.i | 7 + .../Intuition-41.95/Intuition/src/other.s | 268 + .../Intuition-41.95/Intuition/src/output.s | 580 + .../Intuition-41.95/Intuition/src/request.s | 722 + .../Intuition-41.95/Intuition/src/screens.s | 749 + .../Intuition-41.95/Intuition/src/text.s | 108 + .../Intuition-41.95/Intuition/src/windows.s | 654 + .../Intuition/src2/amosfuncs.s | 361 + .../Intuition-41.95/Intuition/src2/errors.s | 214 + .../Intuition-41.95/Intuition/src2/graphics.s | 184 + .../Intuition-41.95/Intuition/src2/input.s | 313 + .../Intuition-41.95/Intuition/src2/intmisc.s | 178 + .../Intuition-41.95/Intuition/src2/iutils.s | 84 + .../Intuition/src2/jumptable.s | 128 + .../Intuition-41.95/Intuition/src2/memory.s | 222 + .../Intuition-41.95/Intuition/src2/screens.s | 536 + .../Intuition-41.95/Intuition/src2/startup.s | 566 + .../Intuition-41.95/Intuition/src2/windows.s | 701 + extensions/Intuition-41.95/Intuition/todo | 31 + extensions/Intuition-41.95/Intuition/x.info | Bin 0 -> 1122 bytes extensions/Intuition-41.95/README.md | 19 + extensions/Intuition-41.95/autorev | Bin 0 -> 11196 bytes extensions/Intuition-41.95/autorev.c | 51 + extensions/Intuition-41.95/extasm | Bin 0 -> 15476 bytes extensions/Intuition-41.95/extasm.c | 491 + extensions/Intuition-41.95/labelinfo | Bin 0 -> 9516 bytes extensions/Intuition-41.95/labelinfo.c | 27 + extensions/Misc-1.0/AMOSPro_Misc.Lib | Bin 0 -> 868 bytes extensions/Misc-1.0/Manual.TXT | 76 + extensions/Misc-1.0/Manual.TXT.info | Bin 0 -> 501 bytes extensions/Misc-1.0/Misc_Extension.asm | 303 + extensions/Misc-1.0/Misc_Extension.asm.info | Bin 0 -> 501 bytes .../Personal-1.1a/AMOSPro_Personnal.Lib | Bin 0 -> 21580 bytes .../Personal-1.1a/AMOSPro_Personnal.Lib.s | 4534 +++ extensions/Personal-1.1a/Personnal1_1.README | 19 + .../Personal-1.1a/_TABLES/_CosTable.bin | Bin 0 -> 1440 bytes .../Personal-1.1a/_TABLES/_SinTable.bin | Bin 0 -> 1440 bytes .../Personal-1.1a/_TABLES/_TanTable.bin | Bin 0 -> 1440 bytes extensions/acompact | 5 + extensions/aio | 5 + extensions/amusic | 5 + extensions/arequest | 5 + includes/devices/input.i | 28 + includes/devices/inputevent.i | 145 + includes/devices/parallel.i | 112 + includes/devices/printer.i | 211 + includes/devices/prtbase.i | 169 + includes/devices/prtgfx.i | 73 + includes/devices/serial.i | 168 + includes/devices/timer.i | 41 + includes/exec/devices.i | 50 + includes/exec/exec.i | 23 + includes/exec/interrupts.i | 70 + includes/exec/io.i | 121 + includes/exec/libraries.i | 121 + includes/exec/lists.i | 153 + includes/exec/memory.i | 89 + includes/exec/nodes.i | 53 + includes/exec/ports.i | 64 + includes/exec/semaphores.i | 65 + includes/exec/tasks.i | 90 + includes/exec/types.i | 120 + includes/graphics/clip.i | 88 + includes/graphics/copper.i | 63 + includes/graphics/gfx.i | 34 + includes/graphics/layers.i | 51 + includes/graphics/rastport.i | 115 + includes/graphics/text.i | 67 + includes/graphics/view.i | 77 + includes/hardware/intbits.i | 51 + includes/intuition/intuition.i | 1009 + includes/intuition/intuitionbase.i | 54 + includes/intuition/preferences.i | 260 + includes/intuition/screens.i | 156 + includes/libraries/dos.i | 168 + includes/libraries/dosextens.i | 293 + includes/lvo/console_lib.i | 7 + includes/lvo/diskfont_lib.i | 19 + includes/lvo/dos_lib.i | 164 + includes/lvo/exec_lib.i | 131 + includes/lvo/graphics_lib.i | 181 + includes/lvo/icon_lib.i | 28 + includes/lvo/intuition_lib.i | 138 + includes/lvo/layers_lib.i | 37 + includes/lvo/mathffp_lib.i | 26 + includes/lvo/mathieeedoubbas_lib.i | 26 + includes/lvo/mathtrans_lib.i | 31 + includes/lvo/rexxsyslib_lib.i | 15 + includes/pp/powerpacker_lib.i | 43 + includes/pp/ppbase.h | 48 + includes/pp/ppbase.i | 45 + 812 files changed, 207025 insertions(+), 3 deletions(-) create mode 100644 +AMOS_Includes.s create mode 100644 +B.s create mode 100644 +CEqu.s create mode 100644 +Debug.s create mode 100644 +Edit.s create mode 100644 +Editor_Config.s create mode 100644 +Equ.s create mode 100644 +ILib.s create mode 100644 +Interpreter_Config.s create mode 100644 +Lib.s create mode 100644 +Monitor.s create mode 100644 +Verif.s create mode 100644 +Version.s create mode 100644 +W.s create mode 100644 +WEqu.s create mode 100644 .gitattributes create mode 100644 AMOS.info create mode 100644 AMOS/AMOSPro create mode 100644 AMOS/AMOSPro.info create mode 100644 AMOS/AMOSPro_Compiler_Config create mode 100644 AMOS/AMOSPro_Interpreter_Config create mode 100644 AMOS/APSystem.info create mode 100644 AMOS/APSystem/AMOS.library create mode 100644 AMOS/APSystem/AMOSPro.Lib create mode 100644 AMOS/APSystem/AMOSPro_Compact.Lib create mode 100644 AMOS/APSystem/AMOSPro_Compiler.Lib create mode 100644 AMOS/APSystem/AMOSPro_CompilerA_Resource.Abk create mode 100644 AMOS/APSystem/AMOSPro_Compiler_Resource.Abk create mode 100644 AMOS/APSystem/AMOSPro_Default_Resource.Abk create mode 100644 AMOS/APSystem/AMOSPro_Editor create mode 100644 AMOS/APSystem/AMOSPro_Editor_Config create mode 100644 AMOS/APSystem/AMOSPro_Editor_Macros create mode 100644 AMOS/APSystem/AMOSPro_Editor_Resource.Abk create mode 100644 AMOS/APSystem/AMOSPro_IOPorts.Lib create mode 100644 AMOS/APSystem/AMOSPro_Monitor create mode 100644 AMOS/APSystem/AMOSPro_Music.Lib create mode 100644 AMOS/APSystem/AMOSPro_Request.Lib create mode 100644 AMOS/APSystem/APCmp create mode 100644 AMOS/APSystem/Compiler.Lib create mode 100644 AMOS/APSystem/Def_Compiled.info create mode 100644 AMOS/APSystem/Def_icon.info create mode 100644 AMOS/APSystem/Header_AMOS.AMOS create mode 100644 AMOS/APSystem/Header_Backstart.Lib create mode 100644 AMOS/APSystem/Header_CLI.Lib create mode 100644 AMOS/Accessories.info create mode 100644 AMOS/Accessories/AMAL_Editor.AMOS create mode 100644 AMOS/Accessories/AMOSPro_Help/AMOSPro_Help.AMOS create mode 100644 AMOS/Accessories/AMOSPro_Help/AMOSPro_Help.Map create mode 100644 AMOS/Accessories/AMOSPro_Help/AMOSPro_Help.Txt create mode 100644 AMOS/Accessories/AMOSPro_Help/Compiler_Help.Map create mode 100644 AMOS/Accessories/AMOSPro_Help/Compiler_Help.Txt create mode 100644 AMOS/Accessories/AMOSPro_Help/LatestNews_112.Map create mode 100644 AMOS/Accessories/AMOSPro_Help/LatestNews_112.Txt create mode 100644 AMOS/Accessories/AMOSPro_Help/LatestNews_200.Map create mode 100644 AMOS/Accessories/AMOSPro_Help/LatestNews_200.Txt create mode 100644 AMOS/Accessories/Disc_Manager.AMOS create mode 100644 AMOS/Accessories/Font8x8_Editor.AMOS create mode 100644 AMOS/Accessories/IFF_Compactor.AMOS create mode 100644 AMOS/Accessories/Menu_Editor.AMOS create mode 100644 AMOS/Accessories/Object_Editor.AMOS create mode 100644 AMOS/Accessories/Resource_Bank_Maker.AMOS create mode 100644 AMOS/Accessories/Sample_Bank_Maker.AMOS create mode 100644 AMOS/Accessories/System_Iffs/AMOSPro.Iff create mode 100644 AMOS/Accessories/System_Iffs/Default_Resource.Iff create mode 100644 AMOS/Accessories/System_Iffs/Tutor_Buttons.Iff create mode 100644 AMOS/Compiler/Compiler_Shell.AMOS create mode 100644 AMOS/Compiler/Tiny_Shell.AMOS create mode 100644 AMOS/Compiler_Shell create mode 100644 AMOS/Compiler_Shell.info create mode 100644 AMOS/Editor_Config.AMOS create mode 100644 AMOS/Examples.info create mode 100644 AMOS/Examples/Examples/H-0/Help_1.AMOS create mode 100644 AMOS/Examples/Examples/H-0/Help_2.AMOS create mode 100644 AMOS/Examples/Examples/H-0/Help_3.AMOS create mode 100644 AMOS/Examples/Examples/H-0/Help_4.AMOS create mode 100644 AMOS/Examples/Examples/H-0/Help_5.AMOS create mode 100644 AMOS/Examples/Examples/H-0/Help_6.AMOS create mode 100644 AMOS/Examples/Examples/H-0/Help_7.AMOS create mode 100644 AMOS/Examples/Examples/H-0/Help_8.AMOS create mode 100644 AMOS/Examples/Examples/H-0/Help_9.AMOS create mode 100644 AMOS/Examples/Examples/H-1/Help_10.AMOS create mode 100644 AMOS/Examples/Examples/H-1/Help_11.AMOS create mode 100644 AMOS/Examples/Examples/H-1/Help_12.AMOS create mode 100644 AMOS/Examples/Examples/H-1/Help_13.AMOS create mode 100644 AMOS/Examples/Examples/H-1/Help_14.AMOS create mode 100644 AMOS/Examples/Examples/H-1/Help_15.AMOS create mode 100644 AMOS/Examples/Examples/H-1/Help_16.AMOS create mode 100644 AMOS/Examples/Examples/H-1/Help_17.AMOS create mode 100644 AMOS/Examples/Examples/H-1/Help_18.AMOS create mode 100644 AMOS/Examples/Examples/H-1/Help_19.AMOS create mode 100644 AMOS/Examples/Examples/H-2/Help_20.AMOS create mode 100644 AMOS/Examples/Examples/H-2/Help_21.AMOS create mode 100644 AMOS/Examples/Examples/H-2/Help_22.AMOS create mode 100644 AMOS/Examples/Examples/H-2/Help_23.AMOS create mode 100644 AMOS/Examples/Examples/H-2/Help_24.AMOS create mode 100644 AMOS/Examples/Examples/H-2/Help_25.AMOS create mode 100644 AMOS/Examples/Examples/H-2/Help_26.AMOS create mode 100644 AMOS/Examples/Examples/H-2/Help_27.AMOS create mode 100644 AMOS/Examples/Examples/H-2/Help_28.AMOS create mode 100644 AMOS/Examples/Examples/H-2/Help_29.AMOS create mode 100644 AMOS/Examples/Examples/H-3/Help_30.AMOS create mode 100644 AMOS/Examples/Examples/H-3/Help_31.AMOS create mode 100644 AMOS/Examples/Examples/H-3/Help_32.AMOS create mode 100644 AMOS/Examples/Examples/H-3/Help_33.AMOS create mode 100644 AMOS/Examples/Examples/H-3/Help_34.AMOS create mode 100644 AMOS/Examples/Examples/H-3/Help_35.AMOS create mode 100644 AMOS/Examples/Examples/H-3/Help_36.AMOS create mode 100644 AMOS/Examples/Examples/H-3/Help_37.AMOS create mode 100644 AMOS/Examples/Examples/H-3/Help_38.AMOS create mode 100644 AMOS/Examples/Examples/H-3/Help_39.AMOS create mode 100644 AMOS/Examples/Examples/H-4/Help_40.AMOS create mode 100644 AMOS/Examples/Examples/H-4/Help_41.AMOS create mode 100644 AMOS/Examples/Examples/H-4/Help_42.AMOS create mode 100644 AMOS/Examples/Examples/H-4/Help_43.AMOS create mode 100644 AMOS/Examples/Examples/H-4/Help_44.AMOS create mode 100644 AMOS/Examples/Examples/H-4/Help_45.AMOS create mode 100644 AMOS/Examples/Examples/H-4/Help_46.AMOS create mode 100644 AMOS/Examples/Examples/H-4/Help_47.AMOS create mode 100644 AMOS/Examples/Examples/H-4/Help_48.AMOS create mode 100644 AMOS/Examples/Examples/H-4/Help_49.AMOS create mode 100644 AMOS/Examples/Examples/H-5/Help_50.AMOS create mode 100644 AMOS/Examples/Examples/H-5/Help_51.AMOS create mode 100644 AMOS/Examples/Examples/H-5/Help_52.AMOS create mode 100644 AMOS/Examples/Examples/H-5/Help_53.AMOS create mode 100644 AMOS/Examples/Examples/H-5/Help_54.AMOS create mode 100644 AMOS/Examples/Examples/H-5/Help_55.AMOS create mode 100644 AMOS/Examples/Examples/H-5/Help_56.AMOS create mode 100644 AMOS/Examples/Examples/H-5/Help_57.AMOS create mode 100644 AMOS/Examples/Examples/H-5/Help_58.AMOS create mode 100644 AMOS/Examples/Examples/H-5/Help_59.AMOS create mode 100644 AMOS/Examples/Examples/H-6/Help_60.AMOS create mode 100644 AMOS/Examples/Examples/H-6/Help_61.AMOS create mode 100644 AMOS/Examples/Examples/H-6/Help_62.AMOS create mode 100644 AMOS/Examples/Examples/H-6/Help_63.AMOS create mode 100644 AMOS/Examples/Examples/H-6/Help_64.AMOS create mode 100644 AMOS/Examples/Examples/H-6/Help_65.AMOS create mode 100644 AMOS/Examples/Examples/H-6/Help_66.AMOS create mode 100644 AMOS/Examples/Examples/H-6/Help_67.AMOS create mode 100644 AMOS/Examples/Examples/H-6/Help_68.AMOS create mode 100644 AMOS/Examples/Examples/H-6/Help_69.AMOS create mode 100644 AMOS/Examples/Examples/H-6/Jokes create mode 100644 AMOS/Examples/Examples/H-7/Help_70.AMOS create mode 100644 AMOS/Examples/Examples/H-7/Help_71.AMOS create mode 100644 AMOS/Examples/Examples/H-7/Help_72.AMOS create mode 100644 AMOS/Examples/Examples/H-7/Help_73.AMOS create mode 100644 AMOS/Examples/Examples/H-7/Help_74.AMOS create mode 100644 AMOS/Examples/Examples/H-7/Help_75.AMOS create mode 100644 AMOS/Examples/Examples/H-7/Help_76.AMOS create mode 100644 AMOS/Examples/Examples/H-7/Help_77.AMOS create mode 100644 AMOS/Examples/Examples/H-7/Help_78.AMOS create mode 100644 AMOS/Examples/Examples/H-7/Help_79.AMOS create mode 100644 AMOS/Examples/Examples/H-8/Help_80.AMOS create mode 100644 AMOS/Examples/Examples/H-8/Help_81.AMOS create mode 100644 AMOS/Examples/Examples/H-8/Help_82.AMOS create mode 100644 AMOS/Examples/Examples/H-8/Help_82.Asc create mode 100644 AMOS/Examples/Examples/H-8/Help_83.AMOS create mode 100644 AMOS/Examples/Examples/H-8/Help_84.AMOS create mode 100644 AMOS/Examples/Iff/Logo.iff create mode 100644 AMOS/Examples/Music/Med_Module create mode 100644 AMOS/Examples/Music/Mod.Tracker create mode 100644 AMOS/Examples/Music/Music.abk create mode 100644 AMOS/Examples/Objects/Bobs.abk create mode 100644 AMOS/Examples/Objects/Faces_A.abk create mode 100644 AMOS/Examples/Objects/Faces_B.abk create mode 100644 AMOS/Examples/Objects/Faces_C.abk create mode 100644 AMOS/Examples/Objects/Ronnio.abk create mode 100644 AMOS/Examples/Samples/Instruments.abk create mode 100644 AMOS/Examples/Samples/Mixture.abk create mode 100644 AMOS/Interpreter_Config create mode 100644 AMOS/Productivity1.info create mode 100644 AMOS/Productivity1/Equates/AMOSPro_System_Equates create mode 100644 AMOS/Productivity1/Equates/Editor_Commands.AMOS create mode 100644 AMOS/Productivity1/Equates/Editor_Commands.Doc create mode 100644 AMOS/Productivity1/Equates/Equates.Doc create mode 100644 AMOS/Productivity1/Equates/Make_Equates.AMOS create mode 100644 AMOS/Productivity1/Fileo'fax.AMOS create mode 100644 AMOS/Productivity1/Menu_Editor.AMOS create mode 100644 AMOS/Productivity1/Planet_Zybex/Zybex.AMOS create mode 100644 AMOS/Productivity1/Planet_Zybex/level1_screen.abk create mode 100644 AMOS/Productivity1/Planet_Zybex/level2_screen.abk create mode 100644 AMOS/Productivity1/Planet_Zybex/level3_screen.abk create mode 100644 AMOS/Productivity1/Planet_Zybex/level4_screen.abk create mode 100644 AMOS/Productivity1/Planet_Zybex/level5_screen.abk create mode 100644 AMOS/Productivity1/Planet_Zybex/level6_screen.abk create mode 100644 AMOS/Productivity1/Planet_Zybex/level7_screen.abk create mode 100644 AMOS/Productivity1/Quatro.AMOS create mode 100644 AMOS/Productivity1/SuperBlockout.AMOS create mode 100644 AMOS/Productivity2.info create mode 100644 AMOS/Productivity2/Font8x8_Editor.AMOS create mode 100644 AMOS/Productivity2/IFF_Compactor.AMOS create mode 100644 AMOS/Productivity2/Procedures/AMAL/Bobs.abk create mode 100644 AMOS/Productivity2/Procedures/AMAL/_Single_Step.AMOS create mode 100644 AMOS/Productivity2/Procedures/Audio/_Number_to_Speech.AMOS create mode 100644 AMOS/Productivity2/Procedures/Audio/_Number_to_Speech.Bak create mode 100644 AMOS/Productivity2/Procedures/Bobs/RMask create mode 100644 AMOS/Productivity2/Procedures/Bobs/Rmask.S create mode 100644 AMOS/Productivity2/Procedures/Bobs/Squashed_Bobs.Abk create mode 100644 AMOS/Productivity2/Procedures/Bobs/_Make_Mask.AMOS create mode 100644 AMOS/Productivity2/Procedures/Bobs/_Squash_A_Bob.AMOS create mode 100644 AMOS/Productivity2/Procedures/Bobs/_Squash_Procs.AMOS create mode 100644 AMOS/Productivity2/Procedures/Copper/_Dump_Copper.AMOS create mode 100644 AMOS/Productivity2/Procedures/Copper/_Rainbow_Example.AMOS create mode 100644 AMOS/Productivity2/Procedures/Disc/_DIR_First_Next.AMOS create mode 100644 AMOS/Productivity2/Procedures/Disc/_Disc_Info.AMOS create mode 100644 AMOS/Productivity2/Procedures/Fractals/_Julia_Set_Fractals.AMOS create mode 100644 AMOS/Productivity2/Procedures/Fractals/_Mandelbrot_Fractals.AMOS create mode 100644 AMOS/Productivity2/Procedures/Fractals/_OLSys_Plant_Fractals.AMOS create mode 100644 AMOS/Productivity2/Procedures/Fractals/_Quatrals.AMOS create mode 100644 AMOS/Productivity2/Procedures/Graphics/_Fade_All.AMOS create mode 100644 AMOS/Productivity2/Procedures/Graphics/_Polygons.AMOS create mode 100644 AMOS/Productivity2/Procedures/Graphics/_Splines.AMOS create mode 100644 AMOS/Productivity2/Procedures/Plasma/Plasma1_pal.IFF create mode 100644 AMOS/Productivity2/Procedures/Plasma/Plasma2_pal.IFF create mode 100644 AMOS/Productivity2/Procedures/Plasma/Plasma3_pal.IFF create mode 100644 AMOS/Productivity2/Procedures/Plasma/Plasma4_pal.IFF create mode 100644 AMOS/Productivity2/Procedures/Plasma/Plasma5_pal.IFF create mode 100644 AMOS/Productivity2/Procedures/Plasma/Plasma6_pal.IFF create mode 100644 AMOS/Productivity2/Procedures/Plasma/Plasma7_pal.IFF create mode 100644 AMOS/Productivity2/Procedures/Plasma/Plasma8_pal.IFF create mode 100644 AMOS/Productivity2/Procedures/Plasma/_Edit_Colours.AMOS create mode 100644 AMOS/Productivity2/Procedures/Plasma/_Plasma1.AMOS create mode 100644 AMOS/Productivity2/Procedures/Plasma/_Plasma2.AMOS create mode 100644 AMOS/Productivity2/Procedures/Screen_FX/Sine_Pic.iff create mode 100644 AMOS/Productivity2/Procedures/Screen_FX/_3D_Landscape.AMOS create mode 100644 AMOS/Productivity2/Procedures/Screen_FX/_3D_Scroller.AMOS create mode 100644 AMOS/Productivity2/Procedures/Screen_FX/_Fancy_Wipes.AMOS create mode 100644 AMOS/Productivity2/Procedures/Screen_FX/_Formula_Pics.AMOS create mode 100644 AMOS/Productivity2/Procedures/Screen_FX/_Pause_Scroll.AMOS create mode 100644 AMOS/Productivity2/Procedures/Screen_FX/_Screen_Saver.AMOS create mode 100644 AMOS/Productivity2/Procedures/Screen_FX/_Screen_Sine.AMOS create mode 100644 AMOS/Productivity2/Procedures/Screen_FX/_Scroll.AMOS create mode 100644 AMOS/Productivity2/Procedures/Screen_FX/_Slide.AMOS create mode 100644 AMOS/Productivity2/Procedures/Screen_FX/_Titchy_Scroll.AMOS create mode 100644 AMOS/Productivity2/Procedures/Screen_FX/_Wipe1.AMOS create mode 100644 AMOS/Productivity2/Procedures/Screen_FX/_Wipe2.AMOS create mode 100644 AMOS/Productivity2/Procedures/Screen_FX/_Wipe3.AMOS create mode 100644 AMOS/Productivity2/Procedures/System/AMOS_Workbench_Demo.AMOS create mode 100644 AMOS/Productivity2/Procedures/System/_Get_DOS_Error.AMOS create mode 100644 AMOS/Productivity2/Procedures/System/_Get_Time.AMOS create mode 100644 AMOS/Productivity2/Procedures/System/_Wind_Execute.AMOS create mode 100644 AMOS/Productivity2/Procedures/System/_Wind_Input.AMOS create mode 100644 AMOS/Productivity2/Procedures/System/_Wind_Open.AMOS create mode 100644 AMOS/Productivity2/Procedures/System/_Wind_Print.AMOS create mode 100644 AMOS/Productivity2/Procedures/Techniques/Hiscores.SCR create mode 100644 AMOS/Productivity2/Procedures/Techniques/_3D_Stars.AMOS create mode 100644 AMOS/Productivity2/Procedures/Techniques/_Hi_Scores.AMOS create mode 100644 AMOS/Productivity2/Procedures/Techniques/_Memory_Array.AMOS create mode 100644 AMOS/Productivity2/Procedures/Techniques/_Radar.AMOS create mode 100644 AMOS/Productivity2/Procedures/Text/_Double_Height.AMOS create mode 100644 AMOS/Productivity2/Procedures/Text/_Text_Highlight.AMOS create mode 100644 AMOS/Productivity2/Procedures/Text/_Type_Writer.AMOS create mode 100644 AMOS/Productivity2/Procedures/Text/_Vertical_Text.AMOS create mode 100644 AMOS/Productivity2/Procedures/Text/_Wavy_Text.AMOS create mode 100644 AMOS/Productivity2/Wonderland/Editor_Panel.Iff create mode 100644 AMOS/Productivity2/Wonderland/Game1.lev create mode 100644 AMOS/Productivity2/Wonderland/Game2.lev create mode 100644 AMOS/Productivity2/Wonderland/Landscape.Iff create mode 100644 AMOS/Productivity2/Wonderland/Score_Panel.Iff create mode 100644 AMOS/Productivity2/Wonderland/Title_Screen.Iff create mode 100644 AMOS/Productivity2/Wonderland/Wonderland.AMOS create mode 100644 AMOS/Productivity2/Wonderland/Wonderland_Samples.Abk create mode 100644 AMOS/Tutorial.info create mode 100644 AMOS/Tutorial/Extensions/Extension_ReadMe.Asc create mode 100644 AMOS/Tutorial/Extensions/__uae____Cequ_s create mode 100644 AMOS/Tutorial/Extensions/__uae____Compact create mode 100644 AMOS/Tutorial/Extensions/__uae____LEqu_s create mode 100644 AMOS/Tutorial/Extensions/__uae____Music_s create mode 100644 AMOS/Tutorial/Extensions/__uae____amos_includes_s create mode 100644 AMOS/Tutorial/Extensions/__uae____compact_s create mode 100644 AMOS/Tutorial/Extensions/__uae____equ_s create mode 100644 AMOS/Tutorial/Extensions/__uae____io_Ports_s create mode 100644 AMOS/Tutorial/Extensions/__uae____liboffsets_s create mode 100644 AMOS/Tutorial/Extensions/__uae____pointe_s create mode 100644 AMOS/Tutorial/Extensions/__uae____request_s create mode 100644 AMOS/Tutorial/Extensions/__uae____wequ_s create mode 100644 AMOS/Tutorial/Extra_Configs/Compiler_Config.Backup create mode 100644 AMOS/Tutorial/Extra_Configs/Editor_Config.Backup create mode 100644 AMOS/Tutorial/Extra_Configs/Interpreter_Config.Backup create mode 100644 AMOS/Tutorial/Iff/Example_resource.Iff create mode 100644 AMOS/Tutorial/Iff/Window.Iff create mode 100644 AMOS/Tutorial/Iff_Anim/AMOS.Anim create mode 100644 AMOS/Tutorial/Objects/Amal_Bobs.Abk create mode 100644 AMOS/Tutorial/Objects/Bobs.Abk create mode 100644 AMOS/Tutorial/Objects/Col.Abk create mode 100644 AMOS/Tutorial/Objects/Menu_Bobs.Abk create mode 100644 AMOS/Tutorial/Objects/Play_Bobs.Abk create mode 100644 AMOS/Tutorial/Objects/Sprites.Abk create mode 100644 AMOS/Tutorial/ReTokenise.AMOS create mode 100644 AMOS/Tutorial/Tutorials/AMAL/AMAL_1.AMOS create mode 100644 AMOS/Tutorial/Tutorials/AMAL/AMAL_2.AMOS create mode 100644 AMOS/Tutorial/Tutorials/AMAL/AMAL_3.AMOS create mode 100644 AMOS/Tutorial/Tutorials/AMAL/AMAL_4.AMOS create mode 100644 AMOS/Tutorial/Tutorials/AMAL/AMAL_5.AMOS create mode 100644 AMOS/Tutorial/Tutorials/AMAL/AMAL_6.AMOS create mode 100644 AMOS/Tutorial/Tutorials/AMAL/AMAL_7.AMOS create mode 100644 AMOS/Tutorial/Tutorials/AMAL/PLay_Data.Abk create mode 100644 AMOS/Tutorial/Tutorials/Appear.AMOS create mode 100644 AMOS/Tutorial/Tutorials/Arrays.AMOS create mode 100644 AMOS/Tutorial/Tutorials/Autoback_&_Update.AMOS create mode 100644 AMOS/Tutorial/Tutorials/Collision_Detection.AMOS create mode 100644 AMOS/Tutorial/Tutorials/Computed_Sprites.AMOS create mode 100644 AMOS/Tutorial/Tutorials/Error_Handling_1.AMOS create mode 100644 AMOS/Tutorial/Tutorials/Error_Handling_2.AMOS create mode 100644 AMOS/Tutorial/Tutorials/Fade.AMOS create mode 100644 AMOS/Tutorial/Tutorials/Hardware_Sprites.AMOS create mode 100644 AMOS/Tutorial/Tutorials/Iff_Animation.AMOS create mode 100644 AMOS/Tutorial/Tutorials/Interface/Autocentering.AMOS create mode 100644 AMOS/Tutorial/Tutorials/Interface/Button_Types.AMOS create mode 100644 AMOS/Tutorial/Tutorials/Interface/Communication.AMOS create mode 100644 AMOS/Tutorial/Tutorials/Interface/Editing_Zones.AMOS create mode 100644 AMOS/Tutorial/Tutorials/Interface/Example_Resource.Abk create mode 100644 AMOS/Tutorial/Tutorials/Interface/Full_Example.AMOS create mode 100644 AMOS/Tutorial/Tutorials/Interface/Graphics.AMOS create mode 100644 AMOS/Tutorial/Tutorials/Interface/Simple_Requester.AMOS create mode 100644 AMOS/Tutorial/Tutorials/Interface/Sliders.AMOS create mode 100644 AMOS/Tutorial/Tutorials/Interface/Working_Buttons.AMOS create mode 100644 AMOS/Tutorial/Tutorials/Menus/Data.Menu create mode 100644 AMOS/Tutorial/Tutorials/Menus/Menus_1.AMOS create mode 100644 AMOS/Tutorial/Tutorials/Menus/Menus_2.AMOS create mode 100644 AMOS/Tutorial/Tutorials/Menus/Menus_3.AMOS create mode 100644 AMOS/Tutorial/Tutorials/Menus/Menus_4.AMOS create mode 100644 AMOS/Tutorial/Tutorials/Menus/Menus_5.AMOS create mode 100644 AMOS/Tutorial/Tutorials/Menus/Menus_6.AMOS create mode 100644 AMOS/Tutorial/Tutorials/Menus/Menus_7.AMOS create mode 100644 AMOS/Tutorial/Tutorials/Menus/Menus_8.AMOS create mode 100644 AMOS/Tutorial/Tutorials/Menus/Menus_9.AMOS create mode 100644 AMOS/Tutorial/Tutorials/Multi_Rainbows.AMOS create mode 100644 AMOS/Tutorial/Tutorials/Multi_Rainbows.V1_00 create mode 100644 AMOS/Tutorial/Tutorials/Procedures_1.AMOS create mode 100644 AMOS/Tutorial/Tutorials/Procedures_2.AMOS create mode 100644 AMOS/Tutorial/Tutorials/Rainbows.AMOS create mode 100644 AMOS/Tutorial/Tutorials/Sprites_v_Bobs.AMOS create mode 100644 AMOSPro Sources/(Compiler_Config.o) create mode 100644 AMOSPro Sources/(Convert.o) create mode 100644 AMOSPro Sources/(Editor_Config.o) create mode 100644 AMOSPro Sources/(FSel.o) create mode 100644 AMOSPro Sources/(Interpreter_Config.o) create mode 100644 AMOSPro Sources/(b.o) create mode 100644 AMOSPro Sources/+3d.s create mode 100644 AMOSPro Sources/+CLib_Labels.s create mode 100644 AMOSPro Sources/+CLib_Size.s create mode 100644 AMOSPro Sources/+Compact_Labels.s create mode 100644 AMOSPro Sources/+Compact_Size.s create mode 100644 AMOSPro Sources/+Compext_Labels.s create mode 100644 AMOSPro Sources/+Compext_Size.s create mode 100644 AMOSPro Sources/+CreateCompiler create mode 100644 AMOSPro Sources/+CreateExtras create mode 100644 AMOSPro Sources/+Debug0.s create mode 100644 AMOSPro Sources/+Debug1.s create mode 100644 AMOSPro Sources/+Debug_2On create mode 100644 AMOSPro Sources/+Debug_On create mode 100644 AMOSPro Sources/+ILib_Functions.s create mode 100644 AMOSPro Sources/+ILib_Size.s create mode 100644 AMOSPro Sources/+IO_Ports_Labels.s create mode 100644 AMOSPro Sources/+IO_Ports_Size.s create mode 100644 AMOSPro Sources/+Lib_Title.s create mode 100644 AMOSPro Sources/+MakeCompiler create mode 100644 AMOSPro Sources/+MakeExtras create mode 100644 AMOSPro Sources/+Request_Labels.s create mode 100644 AMOSPro Sources/+Request_Size.s create mode 100644 AMOSPro Sources/+Token.s create mode 100644 AMOSPro Sources/+Toktab_Verif.Bin create mode 100644 AMOSPro Sources/+Toktab_Verif.s create mode 100644 AMOSPro Sources/+assigns create mode 100644 AMOSPro Sources/+bugs.s create mode 100644 AMOSPro Sources/+comp.s create mode 100644 AMOSPro Sources/+copyall create mode 100644 AMOSPro Sources/+copycompiler create mode 100644 AMOSPro Sources/+copyextras create mode 100644 AMOSPro Sources/+copyfiles create mode 100644 AMOSPro Sources/+debug2.s create mode 100644 AMOSPro Sources/+internal_jumps.s create mode 100644 AMOSPro Sources/+lequ.s create mode 100644 AMOSPro Sources/+lib_Labels.s create mode 100644 AMOSPro Sources/+lib_size.s create mode 100644 AMOSPro Sources/+liboffsets.s create mode 100644 AMOSPro Sources/+music.s_Labels.s create mode 100644 AMOSPro Sources/+music.s_Size.s create mode 100644 AMOSPro Sources/+music_Labels.s create mode 100644 AMOSPro Sources/+music_Size.s create mode 100644 AMOSPro Sources/+pro2.s create mode 100644 AMOSPro Sources/+w.s.auts.info create mode 100644 AMOSPro Sources/AMOSProDrip create mode 100644 AMOSPro Sources/AP2 create mode 100644 AMOSPro Sources/APCmp create mode 100644 AMOSPro Sources/Bug.AMOS create mode 100644 AMOSPro Sources/Bug.Anim create mode 100644 AMOSPro Sources/Bug.Anim.info create mode 100644 AMOSPro Sources/Compiler create mode 100644 AMOSPro Sources/Compiler_Editor_Config create mode 100644 AMOSPro Sources/Compiler_Interpreter_Config create mode 100644 AMOSPro Sources/Dbl_Source/Compiler_Dbl.Asc create mode 100644 AMOSPro Sources/Dbl_Source/Tiny_Shell_Dbl.Asc create mode 100644 AMOSPro Sources/Default_DBL.Bin create mode 100644 AMOSPro Sources/Default_Editor_Config create mode 100644 AMOSPro Sources/Default_Interpreter_Config create mode 100644 AMOSPro Sources/Docs/Compiler_250593.FC create mode 100644 AMOSPro Sources/Docs/Compiler_250593.FC.info create mode 100644 AMOSPro Sources/Docs/Compiler_260493.Doc create mode 100644 AMOSPro Sources/Docs/Compiler_270593.FC create mode 100644 AMOSPro Sources/Docs/Compiler_270593.FC.info create mode 100644 AMOSPro Sources/Docs/Compiler_Discs.Asc create mode 100644 AMOSPro Sources/Docs/Compiler_Errors.Final create mode 100644 AMOSPro Sources/Docs/Compiler_Errors.Final.info create mode 100644 AMOSPro Sources/Docs/Compiler_Foreword.Asc create mode 100644 AMOSPro Sources/Docs/Compiler_PPDoc.FC create mode 100644 AMOSPro Sources/Docs/Compiler_PPDoc.FC.info create mode 100644 AMOSPro Sources/Docs/Compiler_install.Doc create mode 100644 AMOSPro Sources/Docs/Dom_Public_list.Asc create mode 100644 AMOSPro Sources/Docs/Fr_Scheurer_list.Asc create mode 100644 AMOSPro Sources/Docs/Last_Sheddule.FC create mode 100644 AMOSPro Sources/Docs/Last_Sheddule.FC.info create mode 100644 AMOSPro Sources/Docs/PCOSReport_260393.Asc create mode 100644 AMOSPro Sources/Docs/Report_260393.asc create mode 100644 AMOSPro Sources/Docs/Requests_JBB.Asc create mode 100644 AMOSPro Sources/Docs/System_disks_list.Asc create mode 100644 AMOSPro Sources/Docs/bugs_&_fun.lzh create mode 100644 AMOSPro Sources/Dot_AMOS/+Version.s create mode 100644 AMOSPro Sources/Dot_AMOS/AA_Logo create mode 100644 AMOSPro Sources/Dot_AMOS/AA_Logo.AMOS create mode 100644 AMOSPro Sources/Dot_AMOS/AA_Logo.info create mode 100644 AMOSPro Sources/Dot_AMOS/Check_CLib create mode 100644 AMOSPro Sources/Dot_AMOS/Check_CLib.info create mode 100644 AMOSPro Sources/Dot_AMOS/Compiler_Install create mode 100644 AMOSPro Sources/Dot_AMOS/Compiler_Install.AMOS create mode 100644 AMOSPro Sources/Dot_AMOS/Compiler_Install.info create mode 100644 AMOSPro Sources/Dot_AMOS/File_Compare create mode 100644 AMOSPro Sources/Dot_AMOS/File_Compare.AMOS create mode 100644 AMOSPro Sources/Dot_AMOS/File_Compare.info create mode 100644 AMOSPro Sources/Dot_AMOS/Hunt_String create mode 100644 AMOSPro Sources/Dot_AMOS/Hunt_String.AMOS create mode 100644 AMOSPro Sources/Dot_AMOS/Hunt_String.info create mode 100644 AMOSPro Sources/Dot_AMOS/Insert_DBL create mode 100644 AMOSPro Sources/Dot_AMOS/Insert_DBL.AMOS create mode 100644 AMOSPro Sources/Dot_AMOS/Insert_DBL.info create mode 100644 AMOSPro Sources/Dot_AMOS/Install_Banks.Abs create mode 100644 AMOSPro Sources/Dot_AMOS/Library_Digest create mode 100644 AMOSPro Sources/Dot_AMOS/Library_Digest.info create mode 100644 AMOSPro Sources/Dot_AMOS/Library_Handler create mode 100644 AMOSPro Sources/Dot_AMOS/Library_Handler.AMOS create mode 100644 AMOSPro Sources/Dot_AMOS/Library_Handler.info create mode 100644 AMOSPro Sources/Dot_AMOS/Locate_APSystem.AMOS create mode 100644 AMOSPro Sources/Dot_AMOS/Make_Checklist.AMOS create mode 100644 AMOSPro Sources/Dot_AMOS/Make_Help.AMOS create mode 100644 AMOSPro Sources/Dot_AMOS/Make_Linked.AMOS create mode 100644 AMOSPro Sources/Dot_AMOS/version.amos create mode 100644 AMOSPro Sources/EComp.Asc create mode 100644 AMOSPro Sources/Editor_DBL.Bin create mode 100644 AMOSPro Sources/Francois create mode 100644 AMOSPro Sources/Francois_Editor_Config create mode 100644 AMOSPro Sources/Francois_Interpreter_Config create mode 100644 AMOSPro Sources/GenAm.opts create mode 100644 AMOSPro Sources/GenAm2 create mode 100644 AMOSPro Sources/GetChunk.info create mode 100644 AMOSPro Sources/Icons.Abk create mode 100644 AMOSPro Sources/Instruction_List.Asc create mode 100644 AMOSPro Sources/JBB_grafics/1_Turbo.anim create mode 100644 AMOSPro Sources/JBB_grafics/2_Boost.Anim create mode 100644 AMOSPro Sources/JBB_grafics/Mouse2.Abk create mode 100644 AMOSPro Sources/JBB_grafics/editor.AMOS4c.iff create mode 100644 AMOSPro Sources/JBB_grafics/editor.WB4c.iff create mode 100644 AMOSPro Sources/JBB_grafics/editor.WB8c.iff create mode 100644 AMOSPro Sources/JBB_progs/AMOSPro_CompilerA_Res_WB.Abk create mode 100644 AMOSPro Sources/JBB_progs/AMOSPro_Compiler_Res_WB.Abk create mode 100644 AMOSPro Sources/JBB_progs/AMOSPro_Compiler_Res_WB2.Abk create mode 100644 AMOSPro Sources/JBB_progs/AMOSPro_Default_Res_WB.Abk create mode 100644 AMOSPro Sources/JBB_progs/AMOSPro_Default_Res_secu.Abk create mode 100644 AMOSPro Sources/JBB_progs/AMOSPro_Editor_Res_WB.Abk create mode 100644 AMOSPro Sources/JBB_progs/Hexa_Editor.AMOS create mode 100644 AMOSPro Sources/Library_handler create mode 100644 AMOSPro Sources/MergeDBL create mode 100644 AMOSPro Sources/Object_Pics.Abk create mode 100644 AMOSPro Sources/ReOrg.prefs create mode 100644 AMOSPro Sources/Version.info create mode 100644 AMOSPro Sources/a3d create mode 100644 AMOSPro Sources/acompd create mode 100644 AMOSPro Sources/adebug.prefs create mode 100644 AMOSPro Sources/adebug.var create mode 100644 AMOSPro Sources/adefaultdbl create mode 100644 AMOSPro Sources/aeditdbl create mode 100644 AMOSPro Sources/alib2 create mode 100644 AMOSPro Sources/aprod create mode 100644 AMOSPro Sources/c3d.lib create mode 100644 AMOSPro Sources/ddrip create mode 100644 AMOSPro Sources/debug0 create mode 100644 AMOSPro Sources/debug1 create mode 100644 AMOSPro Sources/debug2 create mode 100644 AMOSPro Sources/defaultdbl create mode 100644 AMOSPro Sources/dir_clone create mode 100644 AMOSPro Sources/dir_clone.amos create mode 100644 AMOSPro Sources/editdbl create mode 100644 AMOSPro Sources/enf create mode 100644 AMOSPro Sources/includes.info create mode 100644 AMOSPro Sources/includes/devices/audio.i create mode 100644 AMOSPro Sources/includes/devices/bootblock.i create mode 100644 AMOSPro Sources/includes/devices/clipboard.i create mode 100644 AMOSPro Sources/includes/devices/console.i create mode 100644 AMOSPro Sources/includes/devices/conunit.i create mode 100644 AMOSPro Sources/includes/devices/gameport.i create mode 100644 AMOSPro Sources/includes/devices/hardblocks.i create mode 100644 AMOSPro Sources/includes/devices/keyboard.i create mode 100644 AMOSPro Sources/includes/devices/keymap.i create mode 100644 AMOSPro Sources/includes/devices/narrator.i create mode 100644 AMOSPro Sources/includes/devices/scsidisk.i create mode 100644 AMOSPro Sources/includes/devices/trackdisk.i create mode 100644 AMOSPro Sources/includes/exec/ables.i create mode 100644 AMOSPro Sources/includes/exec/alerts.i create mode 100644 AMOSPro Sources/includes/exec/errors.i create mode 100644 AMOSPro Sources/includes/exec/exec_lib.i create mode 100644 AMOSPro Sources/includes/exec/execbase.i create mode 100644 AMOSPro Sources/includes/exec/execname.i create mode 100644 AMOSPro Sources/includes/exec/initializers.i create mode 100644 AMOSPro Sources/includes/exec/resident.i create mode 100644 AMOSPro Sources/includes/exec/strings.i create mode 100644 AMOSPro Sources/includes/graphics/display.i create mode 100644 AMOSPro Sources/includes/graphics/gels.i create mode 100644 AMOSPro Sources/includes/graphics/gfxbase.i create mode 100644 AMOSPro Sources/includes/graphics/regions.i create mode 100644 AMOSPro Sources/includes/graphics/sprite.i create mode 100644 AMOSPro Sources/includes/hardware/adkbits.i create mode 100644 AMOSPro Sources/includes/hardware/blit.i create mode 100644 AMOSPro Sources/includes/hardware/cia.i create mode 100644 AMOSPro Sources/includes/hardware/custom.i create mode 100644 AMOSPro Sources/includes/hardware/dmabits.i create mode 100644 AMOSPro Sources/includes/libraries/.fastdir create mode 100644 AMOSPro Sources/includes/libraries/configregs.i create mode 100644 AMOSPro Sources/includes/libraries/configvars.i create mode 100644 AMOSPro Sources/includes/libraries/diskfont.i create mode 100644 AMOSPro Sources/includes/libraries/dos_lib.i create mode 100644 AMOSPro Sources/includes/libraries/expansion.i create mode 100644 AMOSPro Sources/includes/libraries/expansionbase.i create mode 100644 AMOSPro Sources/includes/libraries/filehandler.i create mode 100644 AMOSPro Sources/includes/libraries/mathlibrary.i create mode 100644 AMOSPro Sources/includes/libraries/romboot_base.i create mode 100644 AMOSPro Sources/includes/libraries/translator.i create mode 100644 AMOSPro Sources/includes/resources/cia.i create mode 100644 AMOSPro Sources/includes/resources/disk.i create mode 100644 AMOSPro Sources/includes/resources/filesysres.i create mode 100644 AMOSPro Sources/includes/resources/mathresource.i create mode 100644 AMOSPro Sources/includes/resources/misc.i create mode 100644 AMOSPro Sources/includes/resources/potgo.i create mode 100644 AMOSPro Sources/includes/workbench/icon.i create mode 100644 AMOSPro Sources/includes/workbench/startup.i create mode 100644 AMOSPro Sources/includes/workbench/workbench.i create mode 100644 AMOSPro Sources/info.abk create mode 100644 AMOSPro Sources/lrout create mode 100644 AMOSPro Sources/make_linked create mode 100644 AMOSPro Sources/monam2.inf create mode 100644 AMOSPro Sources/parnetcopy create mode 100644 AMOSPro Sources/secu create mode 100644 AMOSPro Sources/squash.amos create mode 100644 AMOSPro Sources/unfrancois create mode 100644 aall create mode 100644 acomp create mode 100644 adata create mode 100644 aedit create mode 100644 aext create mode 100644 alib create mode 100644 amon create mode 100644 apro create mode 100644 atools create mode 100644 aw create mode 100644 bin/+AMOSPro_Mouse.abk create mode 100644 bin/+Dialog_Funcs.bin create mode 100644 bin/+WFont.bin create mode 100644 bin/Editor_Menus.asc create mode 100644 bin/Editor_Menus.bin create mode 100644 bin/ReqPic.bin create mode 100644 c/Check_CLib create mode 100644 c/Check_CLib.AMOS create mode 100644 c/Get_Chunk create mode 100644 c/Get_Chunk.AMOS create mode 100644 c/Library_Digest create mode 100644 c/Library_Digest.AMOS create mode 100644 c/Make_Labels create mode 100644 c/Make_Labels.AMOS create mode 100644 c/Make_Toktable create mode 100644 c/Make_Toktable.AMOS create mode 100644 c/genam create mode 100644 c/genim2 create mode 100644 compiler/+APComp.s create mode 100644 compiler/+CLib.s create mode 100644 compiler/+CompExt.s create mode 100644 compiler/+Compiler_Config.s create mode 100644 compiler/+Header.s create mode 100644 compiler/+Header_Backstart.s create mode 100644 compiler/acdata create mode 100644 compiler/aclib create mode 100644 compiler/acomp create mode 100644 compiler/acompext create mode 100644 compiler/aheader create mode 100644 extensions/+Compact.s create mode 100644 extensions/+IO_Ports.s create mode 100644 extensions/+Music.s create mode 100644 extensions/+Request.s create mode 100644 extensions/Intuition-41.95/AMOS/Cequ.s create mode 100644 extensions/Intuition-41.95/AMOS/LEqu.s create mode 100644 extensions/Intuition-41.95/AMOS/amos_includes.s create mode 100644 extensions/Intuition-41.95/AMOS/equ.s create mode 100644 extensions/Intuition-41.95/AMOS/liboffsets.s create mode 100644 extensions/Intuition-41.95/AMOS/wequ.s create mode 100644 extensions/Intuition-41.95/AMOS1.3/cequ.s create mode 100644 extensions/Intuition-41.95/AMOS1.3/equ.s create mode 100644 extensions/Intuition-41.95/Intuition/ASSEMPRO.INF create mode 100644 extensions/Intuition-41.95/Intuition/IVread create mode 100644 extensions/Intuition-41.95/Intuition/IVread.asm create mode 100644 extensions/Intuition-41.95/Intuition/IntuiViewer.AMOS.info create mode 100644 extensions/Intuition-41.95/Intuition/IntuiViewer.guide create mode 100644 extensions/Intuition-41.95/Intuition/IntuiViewer.info create mode 100644 extensions/Intuition-41.95/Intuition/Intuition.guide.info create mode 100644 extensions/Intuition-41.95/Intuition/Intuition.lib.info create mode 100644 extensions/Intuition-41.95/Intuition/Shanghai.guide create mode 100644 extensions/Intuition-41.95/Intuition/aic-test.amos create mode 100644 extensions/Intuition-41.95/Intuition/backup create mode 100644 extensions/Intuition-41.95/Intuition/bugs/1.3a-1.txt create mode 100644 extensions/Intuition-41.95/Intuition/bugs/1.3b-0.readme create mode 100644 extensions/Intuition-41.95/Intuition/bugs/1.3b-0.uu create mode 100644 extensions/Intuition-41.95/Intuition/bugs/1.3b-1.txt create mode 100644 extensions/Intuition-41.95/Intuition/bugs/1.3b-10.asc create mode 100644 extensions/Intuition-41.95/Intuition/bugs/1.3b-10.txt create mode 100644 extensions/Intuition-41.95/Intuition/bugs/1.3b-11.txt create mode 100644 extensions/Intuition-41.95/Intuition/bugs/1.3b-12.txt create mode 100644 extensions/Intuition-41.95/Intuition/bugs/1.3b-2.txt create mode 100644 extensions/Intuition-41.95/Intuition/bugs/1.3b-3.uu create mode 100644 extensions/Intuition-41.95/Intuition/bugs/1.3b-4.uu create mode 100644 extensions/Intuition-41.95/Intuition/bugs/1.3b-5.txt create mode 100644 extensions/Intuition-41.95/Intuition/bugs/1.3b-6.txt create mode 100644 extensions/Intuition-41.95/Intuition/bugs/1.3b-7.txt create mode 100644 extensions/Intuition-41.95/Intuition/bugs/1.3b-8.txt create mode 100644 extensions/Intuition-41.95/Intuition/bugs/1.3b-9.64 create mode 100644 extensions/Intuition-41.95/Intuition/bugs/bug6.asc create mode 100644 extensions/Intuition-41.95/Intuition/bugs/docbugs1 create mode 100644 extensions/Intuition-41.95/Intuition/bugs/docbugs2 create mode 100644 extensions/Intuition-41.95/Intuition/bugs/fontreq-bug.uu create mode 100644 extensions/Intuition-41.95/Intuition/bugs/int.msg1 create mode 100644 extensions/Intuition-41.95/Intuition/bugs/int.ph create mode 100644 extensions/Intuition-41.95/Intuition/bugs/int.ph2 create mode 100644 extensions/Intuition-41.95/Intuition/bugs/intbug13.0 create mode 100644 extensions/Intuition-41.95/Intuition/bugs/iplayer.bug1 create mode 100644 extensions/Intuition-41.95/Intuition/bugs/test2.asc create mode 100644 extensions/Intuition-41.95/Intuition/cmdlist create mode 100644 extensions/Intuition-41.95/Intuition/drawer.info create mode 100644 extensions/Intuition-41.95/Intuition/e create mode 100644 extensions/Intuition-41.95/Intuition/error.iff create mode 100644 extensions/Intuition-41.95/Intuition/iflood.doc create mode 100644 extensions/Intuition-41.95/Intuition/igadbank.doc create mode 100644 extensions/Intuition-41.95/Intuition/imenu.doc create mode 100644 extensions/Intuition-41.95/Intuition/intuition.guide create mode 100644 extensions/Intuition-41.95/Intuition/lc create mode 100644 extensions/Intuition-41.95/Intuition/makefile create mode 100644 extensions/Intuition-41.95/Intuition/obj/amosfuncs.o create mode 100644 extensions/Intuition-41.95/Intuition/obj/creator/amosfuncs.o create mode 100644 extensions/Intuition-41.95/Intuition/obj/creator/errors.o create mode 100644 extensions/Intuition-41.95/Intuition/obj/creator/extcode create mode 100644 extensions/Intuition-41.95/Intuition/obj/creator/graphics.o create mode 100644 extensions/Intuition-41.95/Intuition/obj/creator/input.o create mode 100644 extensions/Intuition-41.95/Intuition/obj/creator/intmisc.o create mode 100644 extensions/Intuition-41.95/Intuition/obj/creator/iutils.o create mode 100644 extensions/Intuition-41.95/Intuition/obj/creator/jumptable.o create mode 100644 extensions/Intuition-41.95/Intuition/obj/creator/memory.o create mode 100644 extensions/Intuition-41.95/Intuition/obj/creator/screens.o create mode 100644 extensions/Intuition-41.95/Intuition/obj/creator/startup.o create mode 100644 extensions/Intuition-41.95/Intuition/obj/creator/windows.o create mode 100644 extensions/Intuition-41.95/Intuition/obj/errors.o create mode 100644 extensions/Intuition-41.95/Intuition/obj/extcode create mode 100644 extensions/Intuition-41.95/Intuition/obj/graphics.o create mode 100644 extensions/Intuition-41.95/Intuition/obj/input.o create mode 100644 extensions/Intuition-41.95/Intuition/obj/intmisc.o create mode 100644 extensions/Intuition-41.95/Intuition/obj/iutils.o create mode 100644 extensions/Intuition-41.95/Intuition/obj/jumptable.o create mode 100644 extensions/Intuition-41.95/Intuition/obj/memory.o create mode 100644 extensions/Intuition-41.95/Intuition/obj/screens.o create mode 100644 extensions/Intuition-41.95/Intuition/obj/startup.o create mode 100644 extensions/Intuition-41.95/Intuition/obj/windows.o create mode 100644 extensions/Intuition-41.95/Intuition/obju/creator/extcode create mode 100644 extensions/Intuition-41.95/Intuition/obju/extcode create mode 100644 extensions/Intuition-41.95/Intuition/obju/screens.o create mode 100644 extensions/Intuition-41.95/Intuition/obju/windows.o create mode 100644 extensions/Intuition-41.95/Intuition/progs/bcollin.amos create mode 100644 extensions/Intuition-41.95/Intuition/progs/bug1.amos create mode 100644 extensions/Intuition-41.95/Intuition/progs/bug2.amos create mode 100644 extensions/Intuition-41.95/Intuition/progs/bug2.asc create mode 100644 extensions/Intuition-41.95/Intuition/progs/bug3.asc create mode 100644 extensions/Intuition-41.95/Intuition/progs/bug4.asc create mode 100644 extensions/Intuition-41.95/Intuition/progs/inttest.Bak create mode 100644 extensions/Intuition-41.95/Intuition/progs/inttest.amos create mode 100644 extensions/Intuition-41.95/Intuition/progs/inttest1.amos create mode 100644 extensions/Intuition-41.95/Intuition/progs/inttest2.amos create mode 100644 extensions/Intuition-41.95/Intuition/progs/inttest3.amos create mode 100644 extensions/Intuition-41.95/Intuition/progs/inttest4.amos create mode 100644 extensions/Intuition-41.95/Intuition/progs/inttest5.amos create mode 100644 extensions/Intuition-41.95/Intuition/progs/inttest6.amos create mode 100644 extensions/Intuition-41.95/Intuition/progs/intuiviewer.amos create mode 100644 extensions/Intuition-41.95/Intuition/progs/test0 create mode 100644 extensions/Intuition-41.95/Intuition/progs/test0.amos create mode 100644 extensions/Intuition-41.95/Intuition/routine.codes create mode 100644 extensions/Intuition-41.95/Intuition/screenmodes.txt create mode 100644 extensions/Intuition-41.95/Intuition/src/IntRoutines.i create mode 100644 extensions/Intuition-41.95/Intuition/src/color.s create mode 100644 extensions/Intuition-41.95/Intuition/src/data.i create mode 100644 extensions/Intuition-41.95/Intuition/src/defs.i create mode 100644 extensions/Intuition-41.95/Intuition/src/errordefs.i create mode 100644 extensions/Intuition-41.95/Intuition/src/errors.s create mode 100644 extensions/Intuition-41.95/Intuition/src/errorstubs.s create mode 100644 extensions/Intuition-41.95/Intuition/src/extcode.s create mode 100644 extensions/Intuition-41.95/Intuition/src/extutils.s create mode 100644 extensions/Intuition-41.95/Intuition/src/fonts.s create mode 100644 extensions/Intuition-41.95/Intuition/src/gadgets.bak create mode 100644 extensions/Intuition-41.95/Intuition/src/gadgets.s create mode 100644 extensions/Intuition-41.95/Intuition/src/graphics.s create mode 100644 extensions/Intuition-41.95/Intuition/src/iflood.s create mode 100644 extensions/Intuition-41.95/Intuition/src/input.s create mode 100644 extensions/Intuition-41.95/Intuition/src/intuition.s create mode 100644 extensions/Intuition-41.95/Intuition/src/intuition.s.bak create mode 100644 extensions/Intuition-41.95/Intuition/src/itokens.s create mode 100644 extensions/Intuition-41.95/Intuition/src/jumptable.i create mode 100644 extensions/Intuition-41.95/Intuition/src/macros.i create mode 100644 extensions/Intuition-41.95/Intuition/src/macros2.i create mode 100644 extensions/Intuition-41.95/Intuition/src/menus.s create mode 100644 extensions/Intuition-41.95/Intuition/src/offsets.i create mode 100644 extensions/Intuition-41.95/Intuition/src/other.s create mode 100644 extensions/Intuition-41.95/Intuition/src/output.s create mode 100644 extensions/Intuition-41.95/Intuition/src/request.s create mode 100644 extensions/Intuition-41.95/Intuition/src/screens.s create mode 100644 extensions/Intuition-41.95/Intuition/src/text.s create mode 100644 extensions/Intuition-41.95/Intuition/src/windows.s create mode 100644 extensions/Intuition-41.95/Intuition/src2/amosfuncs.s create mode 100644 extensions/Intuition-41.95/Intuition/src2/errors.s create mode 100644 extensions/Intuition-41.95/Intuition/src2/graphics.s create mode 100644 extensions/Intuition-41.95/Intuition/src2/input.s create mode 100644 extensions/Intuition-41.95/Intuition/src2/intmisc.s create mode 100644 extensions/Intuition-41.95/Intuition/src2/iutils.s create mode 100644 extensions/Intuition-41.95/Intuition/src2/jumptable.s create mode 100644 extensions/Intuition-41.95/Intuition/src2/memory.s create mode 100644 extensions/Intuition-41.95/Intuition/src2/screens.s create mode 100644 extensions/Intuition-41.95/Intuition/src2/startup.s create mode 100644 extensions/Intuition-41.95/Intuition/src2/windows.s create mode 100644 extensions/Intuition-41.95/Intuition/todo create mode 100644 extensions/Intuition-41.95/Intuition/x.info create mode 100644 extensions/Intuition-41.95/README.md create mode 100644 extensions/Intuition-41.95/autorev create mode 100644 extensions/Intuition-41.95/autorev.c create mode 100644 extensions/Intuition-41.95/extasm create mode 100644 extensions/Intuition-41.95/extasm.c create mode 100644 extensions/Intuition-41.95/labelinfo create mode 100644 extensions/Intuition-41.95/labelinfo.c create mode 100644 extensions/Misc-1.0/AMOSPro_Misc.Lib create mode 100644 extensions/Misc-1.0/Manual.TXT create mode 100644 extensions/Misc-1.0/Manual.TXT.info create mode 100644 extensions/Misc-1.0/Misc_Extension.asm create mode 100644 extensions/Misc-1.0/Misc_Extension.asm.info create mode 100644 extensions/Personal-1.1a/AMOSPro_Personnal.Lib create mode 100644 extensions/Personal-1.1a/AMOSPro_Personnal.Lib.s create mode 100644 extensions/Personal-1.1a/Personnal1_1.README create mode 100644 extensions/Personal-1.1a/_TABLES/_CosTable.bin create mode 100644 extensions/Personal-1.1a/_TABLES/_SinTable.bin create mode 100644 extensions/Personal-1.1a/_TABLES/_TanTable.bin create mode 100644 extensions/acompact create mode 100644 extensions/aio create mode 100644 extensions/amusic create mode 100644 extensions/arequest create mode 100644 includes/devices/input.i create mode 100644 includes/devices/inputevent.i create mode 100644 includes/devices/parallel.i create mode 100644 includes/devices/printer.i create mode 100644 includes/devices/prtbase.i create mode 100644 includes/devices/prtgfx.i create mode 100644 includes/devices/serial.i create mode 100644 includes/devices/timer.i create mode 100644 includes/exec/devices.i create mode 100644 includes/exec/exec.i create mode 100644 includes/exec/interrupts.i create mode 100644 includes/exec/io.i create mode 100644 includes/exec/libraries.i create mode 100644 includes/exec/lists.i create mode 100644 includes/exec/memory.i create mode 100644 includes/exec/nodes.i create mode 100644 includes/exec/ports.i create mode 100644 includes/exec/semaphores.i create mode 100644 includes/exec/tasks.i create mode 100644 includes/exec/types.i create mode 100644 includes/graphics/clip.i create mode 100644 includes/graphics/copper.i create mode 100644 includes/graphics/gfx.i create mode 100644 includes/graphics/layers.i create mode 100644 includes/graphics/rastport.i create mode 100644 includes/graphics/text.i create mode 100644 includes/graphics/view.i create mode 100644 includes/hardware/intbits.i create mode 100644 includes/intuition/intuition.i create mode 100644 includes/intuition/intuitionbase.i create mode 100644 includes/intuition/preferences.i create mode 100644 includes/intuition/screens.i create mode 100644 includes/libraries/dos.i create mode 100644 includes/libraries/dosextens.i create mode 100644 includes/lvo/console_lib.i create mode 100644 includes/lvo/diskfont_lib.i create mode 100644 includes/lvo/dos_lib.i create mode 100644 includes/lvo/exec_lib.i create mode 100644 includes/lvo/graphics_lib.i create mode 100644 includes/lvo/icon_lib.i create mode 100644 includes/lvo/intuition_lib.i create mode 100644 includes/lvo/layers_lib.i create mode 100644 includes/lvo/mathffp_lib.i create mode 100644 includes/lvo/mathieeedoubbas_lib.i create mode 100644 includes/lvo/mathtrans_lib.i create mode 100644 includes/lvo/rexxsyslib_lib.i create mode 100644 includes/pp/powerpacker_lib.i create mode 100644 includes/pp/ppbase.h create mode 100644 includes/pp/ppbase.i diff --git a/+AMOS_Includes.s b/+AMOS_Includes.s new file mode 100644 index 0000000..ecdf5b9 --- /dev/null +++ b/+AMOS_Includes.s @@ -0,0 +1,74 @@ +;--------------------------------------------------------------------- +; ** ** ** *** *** +; **** *** *** ** ** ** +; ** ** ** * ** ** ** *** +; ****** ** ** ** ** ** +; ** ** ** ** ** ** * ** +; ** ** ** ** *** *** +;--------------------------------------------------------------------- +; Includes all includes - Francois Lionet / Europress 1992 +;--------------------------------------------------------------------- +; +; Published under the MIT Licence +; +; Copyright (c) 1992 Europress Software +; Copyright (c) 2020 Francois Lionet +; +; Permission is hereby granted, free of charge, to any person +; obtaining a copy of this software and associated documentation +; files (the "Software"), to deal in the Software without +; restriction, including without limitation the rights to use, +; copy, modify, merge, publish, distribute, sublicense, and/or +; sell copies of the Software, and to permit persons to whom the +; Software is furnished to do so, subject to the following +; conditions: +; +; The above copyright notice and this permission notice shall be +; included in all copies or substantial portions of the Software. +; +; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +; EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +; OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +; NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +; HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +; WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +; ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR +; THE USE OR OTHER DEALINGS IN THE SOFTWARE. +; +;---------------------------------------------------------------------- + +; These ones are for me! + IFND Finale +Finale: equ 1 + ENDC + IFND VDemo +VDemo: equ 0 + ENDC + IFND ROnly +ROnly: equ 0 + ENDC +; + Incdir "includes/" + Include "lvo/exec_lib.i" + Include "lvo/dos_lib.i" + Include "lvo/layers_lib.i" + Include "lvo/graphics_lib.i" + Include "lvo/mathtrans_lib.i" + Include "lvo/rexxsyslib_lib.i" + Include "lvo/mathffp_lib.i" + Include "lvo/mathieeedoubbas_lib.i" + Include "lvo/intuition_lib.i" + Include "lvo/diskfont_lib.i" + Include "lvo/icon_lib.i" + Include "lvo/console_lib.i" + + Include "+Debug.s" Just one flag + Include "+Equ.s" + RsSet DataLong + Include "+CEqu.s" + Include "+WEqu.s" + Include "+LEqu.s" + + IFNE Debug + Include "+Music_Labels.s" + ENDC diff --git a/+B.s b/+B.s new file mode 100644 index 0000000..261f750 --- /dev/null +++ b/+B.s @@ -0,0 +1,2985 @@ +; ______________________________________________________________________________ +; .............................................................................. +; ...................................................................2222222.... +; ................................................................22222222220... +; ...................................................222........222222.....222.. +; ..............................................2202222222222..22000............ +; ..................................22000.....20222222222200000200002........... +; .................................2002202...2222200222.220000000200000000022... +; ....................220002......22222200..2200002.......2200000...20000000000. +; ....................22222202....2220000022200000..........200002........200000 +; .....200000.........2222200000222200220000000002..........200002........20000. +; .....00222202........2220022000000002200002000002........2000002000020000000.. +; ....2222200000.......220002200000002.2000000000000222222000000..2000000002.... +; ....220000200002......20000..200002..220000200000000000000002.......22........ +; ...2220002.220000 2....220002...22.....200002..0000000000002................... +; ...220000..222000002...20000..........200000......2222........................ +; ...000000000000000000..200000..........00002.................................. +; ..220000000022020000002.200002.........22.......______________________________ +; ..0000002........2000000220022.................| +; .200000............2002........................| AMOSPro Version 2 +; .200002........................................| Loader general +; 220002.........................................|______________________________ +; ______________________________________________________________________________ +; +; Published under the MIT Licence +; +; Copyright (c) 1992 Europress Software +; Copyright (c) 2020 Francois Lionet +; +; Permission is hereby granted, free of charge, to any person +; obtaining a copy of this software and associated documentation +; files (the "Software"), to deal in the Software without +; restriction, including without limitation the rights to use, +; copy, modify, merge, publish, distribute, sublicense, and/or +; sell copies of the Software, and to permit persons to whom the +; Software is furnished to do so, subject to the following +; conditions: +; +; The above copyright notice and this permission notice shall be +; included in all copies or substantial portions of the Software. +; +; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +; EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +; OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +; NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +; HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +; WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +; ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR +; THE USE OR OTHER DEALINGS IN THE SOFTWARE. +; +; ______________________________________________________________________________ +; + Include "+AMOS_Includes.s" + Include "+Version.s" +; ______________________________________________________________________________ + + +; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +; ROUTINES DE FIN / ROUTINES INTERNES +; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + SECTION "E",CODE +; - - - - - - - - - - - - - + +Hunk_1 jmp Cold_Start + + +; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +; FIN DE L'INITIALISATION : ENLEVE LE HUNK INIT! +; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Init_Fin +; - - - - - - - - - - - - - + +; Enleve le hunk init +; ~~~~~~~~~~~~~~~~~~~ + lea Hunk_1-8(pc),a0 + lea Hunk_2-8,a1 + move.l 4(a1),4(a0) Deconnecte le hunk 2 + move.l (a1),d0 Libere la memoire + move.l $4.w,a6 + jsr _LVOFreeMem(a6) + +; Ouvre une structure programme +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + move.l PI_DefSize(a5),d0 Structure programme + JJsr L_Prg_NewStructure + move.l d0,a6 + beq TheEnd_OOMem + +; Charge AUTOEXEC.AMOS ou le programme voulu +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + moveq #-2,d0 Pas d'ecran de fond + JJsr L_Prg_New + moveq #-1,d0 Toujours adapter + JJsr L_Prg_Load + bne .NoProg + moveq #-1,d0 Semi Init Graphique + lea RunErr_RunOnly,a1 En cas d'erreur + sub.l a2,a2 + JJsr L_Prg_RunIt Revient si out of memory! + +; Pas de programme: on se branche ïż½ l'editeur +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.NoProg jsr Sys_VerInstall Verification de l'installation + beq TheEnd_Install + jsr Edit_Load Charge l'editeur + bne.s TheEnd_Editor + moveq #-1,d0 DefRun normal + JJsr L_Prg_New + moveq #-1,d0 Titre + JJsr L_Ed_Cold + bne.s TheEnd_Editor + jsr WOption Affiche ou non! + JJsr L_Ed_Title Le titre + JJmp L_Ed_Loop Branche ïż½ la boucle + +; Message d'erreur panique residents +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +TheEnd_Editor + lea Panic_Editor(pc),a0 Cannot load editor + bra TheEndMm +TheEnd_OOMem + lea Panic_OOMem(pc),a0 Out of memory + bra TheEndMm +TheEnd_Install + lea Panic_Install(pc),a0 + bra TheEndMm + +; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +; SORTIE GENERALE +; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +TheEndMm + move.l a0,Panic +TheEnd + + tst.b Sys_LibStarted(a5) + beq .Nolib + +; Les librairies sont demarrees +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + lea Sys_EndRoutines(a5),a1 Les routines ajoutees + SyCall CallRoutines + + JJsr L_CloAll Fichiers, imprimante + JJsr L_PRT_Close + JJsr L_Equ_Free + + JJsr L_Includes_Clear Les includes du dernier programme + + tst.l Edit_Segment(a5) Arrete l'editeur + beq.s .NEd + JJsr L_Ed_End +.NEd + + move.l Edt_List(a5),d1 Les structures EDT restantes + beq.s .EdtX en cas de KILL editor +.ExtL move.l d1,a1 + move.l Edt_Next(a1),d1 + move.l #Edt_Long,d0 + SyCall MemFree + tst.l d1 + bne.s .ExtL + +.EdtX move.l Prg_List(a5),d0 Les structure PRG restantes + beq.s .PrgX +.PrgL move.l d0,a6 + JJsr L_Prg_DelStructure + move.l Prg_List(a5),d0 + bne.s .PrgL +.PrgX + bsr Edit_Free Enleve l'editeur + bsr Mon_Free Enleve le moniteur + banque + bsr EffFSel Enleve la resource file selector + bsr EffMouse Enleve la souris + JJsr L_WB_Open Ouvre le WB en fond + bsr Libraries_Stop STOP les librairies +.Nolib + +; Partie non dependantes des librairies +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + bsr D_Close Ferme le dernier fichier... + + tst.b Sys_WStarted(a5) Arrete W.Lib + beq.s .Skip0 + move.l Sys_WAd(a5),a0 + jsr 4(a0) +.Skip0 + lea Sys_Messages(a5),a0 Enleve config interpreteur + jsr A5_Free + lea PathAct(a5),a0 Enleve pathact + jsr A5_Free + move.l AdrIcon(a5),d0 Enleve l'icone + beq.s .SkipI + move.l d0,a0 + move.l IconBase(a5),a6 + jsr -90(a6) +.SkipI + move.l $4.w,a6 Ferme icon.library + move.l IconBase(a5),d0 + beq.s .Skip1 + move.l d0,a1 + jsr _LVOCloseLibrary(a6) +.Skip1 + move.l FloatBase(a5),d0 Ferme les librairies mathematiques + beq.s .SkipM1 + move.l d0,a1 + jsr _LVOCloseLibrary(a6) +.SkipM1 bsr Math_Close + + bsr Libraries_Free Libere les librairies + + move.l Sys_WAd(a5),a0 Enleve AMOS.Library + jsr 16(a0) + move.l DosBase(a5),a6 + move.l Sys_WSegment(a5),d1 + jsr _LVOUnLoadSeg(a6) + + move.l DosBase(a5),a3 Affiche le message d'erreur + move.l T_IntBase(a5),a4 + move.l Sys_Message(a5),d7 + bsr Panic_Message + + move.l $4.w,a6 Ferme graphics.library + move.l T_GfxBase(a5),d0 + beq.s .SkipG + move.l d0,a1 + jsr _LVOCloseLibrary(a6) +.SkipG + move.l DosBase(a5),a1 dos + jsr _LVOCloseLibrary(a6) + move.l T_IntBase(a5),a1 Intuition + jsr _LVOCloseLibrary(a6) + + move.l Sys_Message(a5),d7 Plus de datazone + move.l Sys_AData(a5),a1 + move.l Sys_LData(a5),d0 + move.l $4.w,a6 Liberation directe! + jsr _LVOFreeMem(a6) + +; Sortie d'AMOSPro! +; ~~~~~~~~~~~~~~~~~ +Get_Out move.l SaveSp(pc),a7 + tst.l d7 + beq.s .PaMe + move.l $4.w,a6 + jsr _LVOForbid(a6) + move.l d7,a1 + jsr -378(a6) +.PaMe moveq #0,d0 + rts + + +; Fermeture des librairies mathematiques +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Math_Close + move.l a6,-(sp) + move.l $4.w,a6 + move.l MathBase(a5),d0 + beq.s .SkipM2 + move.l d0,a1 + jsr _LVOCloseLibrary(a6) + clr.l MathBase(a5) +.SkipM2 move.l DFloatBase(a5),d0 + beq.s .SkipM3 + move.l d0,a1 + jsr _LVOCloseLibrary(a6) + clr.l DFloatBase(a5) +.SkipM3 move.l DMathBase(a5),d0 + beq.s .SkipM4 + move.l d0,a1 + jsr _LVOCloseLibrary(a6) + clr.l DMathBase(a5) +.SkipM4 move.l (sp)+,a6 + rts + +; Imprime le message d'erreur dans l'entree courante +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +; A3= DosBase +; A4= IntBase +; D7= Message +Panic_Message + move.l Panic(pc),d6 Un message? + beq.s .Exit + tst.l d7 Sous WB? + bne.s .Wb +; Sous DOS-> Message dans la fenetre courante + move.l a3,a6 Handle courant + jsr -60(a6) + move.l d0,d1 + beq.s .Exit + lea -128(sp),sp Buffer de travail + move.l sp,d2 + move.l d6,a0 + move.l d2,a1 +.Copy move.b (a0)+,(a1)+ + bne.s .Copy + move.b #10,-1(a1) + clr.b (a1) + move.l a1,d3 + sub.l d2,d3 + jsr _LVOWrite(a6) + lea 128(sp),sp +.Exit rts +; Sous WB-> ouvre une tchote fenetre +.Wb move.l a4,a6 IntBase + lea H_Click(pc),a0 + lea H_AutoBody(pc),a1 + move.l d6,12(a1) + lea H_AutoClick(pc),a3 + move.l a0,12(a3) + sub.l a2,a2 + sub.l a0,a0 + moveq #0,d0 + moveq #0,d1 + move.l #560,d2 + moveq #50,d3 + jsr -348(a6) + bra.s .Exit + +; Definition du petit requester +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +H_AutoBody dc.b 2,0 + dc.w 1 + dc.w 8,7 + dc.l 0 + dc.l 0 + dc.l 0 +H_AutoClick dc.b 0,1 + dc.w 1 + dc.w 5,4 + dc.l 0 + dc.l 0 + dc.l 0 +H_Click dc.b " Cancel ",0 + even + + +; Ne pas changer la position du nom, apres dos.library! +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + even + dc.l UserSecu-DosName +DosName dc.b "dos.library",0 +UserReg dc.w 14 + dc.b "R"^$73 0 + dc.b "E"^$73 1 + dc.b "G"^$73 2 + dc.b "I"^$73 3 + dc.b "S"^$73 4 + dc.b "T"^$73 5 + dc.b "R"^$73 6 + dc.b "A"^$73 7 + dc.b "T"^$73 8 + dc.b "I"^$73 9 + dc.b "O"^$73 10 + dc.b "N"^$73 11 + dc.b " "^$73 12 + dc.b "#"^$73 13 +UserName dc.w 14 + dc.b "N"^$A5 0 + dc.b "o"^$A5 1 + dc.b "t"^$A5 2 + dc.b " "^$A5 3 + dc.b "I"^$A5 4 + dc.b "n"^$A5 5 + dc.b "s"^$A5 6 + dc.b "t"^$A5 7 + dc.b "a"^$A5 8 + dc.b "l"^$A5 9 + dc.b "l"^$A5 10 + dc.b "e"^$A5 11 + dc.b "d"^$A5 12 + dc.b "!"^$A5 13 + ds.b 32-14+4 + even + +; Noms des Librairies +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +SaveSp dc.l 0 +Panic dc.l 0 + +; Marqueur de version +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +VersionN: dc.b " Version " + Version + dc.b 0,"$VER: " + Version + +; Messages d'erreur +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Panic_OOMem dc.b "Not enough free memory",0 +Panic_Editor dc.b "Cannot load editor",0 +Panic_Install dc.b 'Program not installed, start "Install.AMOS" first',0 + +; Charge l'editeur +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Edit_Load + lea Edit_Segment(a5),a0 + lea Edit_Debug(pc),a1 + moveq #6,d0 + moveq #L_Ed_Start,d1 + bsr Program_Load +.Err rts + +; Efface l'editeur +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Edit_Free + lea Edit_Segment(a5),a0 + bra Program_Free + +; Charge le moniteur +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Mon_Load + move.l Cur_Banks(a5),-(sp) +; Le moniteur lui-meme +; ~~~~~~~~~~~~~~~~~~~~ + lea Mon_Segment(a5),a0 + lea Mon_Debug(pc),a1 + moveq #10,d0 + moveq #L_Mon_Start,d1 + bsr Program_Load +; Charge la banque de resource, si necessaire +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.Skip1 tst.l Mon_Banks(a5) + bne.s .Skip2 + lea Mon_Banks(a5),a0 + move.l a0,Cur_Banks(a5) + moveq #11,d0 Nom de la banque + bsr Sys_GetMessage + bsr Sys_AddPath + path systeme + move.l #1005,d2 + bsr D_Open + beq.s .DErr + moveq #-1,d0 + JJsr L_Bnk.Load + bne .Err + bsr D_Close +.Skip2 +; Ok, pas d'erreur +; ~~~~~~~~~~~~~~~~ + move.l (sp)+,Cur_Banks(a5) + moveq #0,d0 + rts +; Erreur: efface tout! +; ~~~~~~~~~~~~~~~~~~~~ +.DErr moveq #-2,d0 File not found +.Err move.l (sp)+,Cur_Banks(a5) + move.w d0,-(sp) + bsr Mon_Free + move.w (sp)+,d0 + rts + +; Efface le moniteur +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Mon_Free + move.l Cur_Banks(a5),-(sp) +; Enleve le moniteur +; ~~~~~~~~~~~~~~~~~~ + lea Mon_Segment(a5),a0 + bsr Program_Free +; Enleve les banques +; ~~~~~~~~~~~~~~~~~~ +.Skip1 tst.l Mon_Banks(a5) + beq.s .Skip2 + lea Mon_Banks(a5),a0 + move.l a0,Cur_Banks(a5) + JJsr L_Bnk.EffAll +.Skip2 move.l (sp)+,Cur_Banks(a5) + rts + +; Charge le programme (a0) / Nom #D0 / Branchements D1 +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Program_Load + move.l a0,a2 Adresse du segment + move.l d1,d2 Numero de la premiere fonction + IFNE Debug=2 + move.l a1,(a2) + ENDC + IFEQ Debug=2 + tst.l (a2) + bne.s .Skip + bsr Sys_GetMessage Nom du programme + bsr Sys_AddPath + path systeme + move.l Name1(a5),d1 + move.l a6,-(sp) + move.l DosBase(a5),a6 + jsr _LVOLoadSeg(a6) + move.l (sp)+,a6 + move.l d0,(a2) + beq.s .Err + ENDC +; Loke les adresses des routines dans les branchements +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.Skip move.l (a2),d0 + IFEQ Debug=2 + lsl.l #2,d0 + addq.l #4,d0 + ENDC + move.l d0,a0 + move.l AdTokens(a5),a1 + lsl.w #2,d2 + add.w #LB_Size+4,d2 + sub.w d2,a1 + bra.s .In +.Loop add.l d0,d1 + move.l d1,-(a1) +.In move.l (a0)+,d1 + bne.s .Loop +; OK, pas d'erreur +; ~~~~~~~~~~~~~~~~ + moveq #0,d0 + rts +.Err moveq #1,d0 + rts +; Efface le programme A0 +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Program_Free + IFEQ Debug=2 + move.l (a0),d1 + beq.s .Skip + clr.l (a0) + move.l a6,-(sp) + move.l DosBase(a5),a6 + jsr _LVOUnLoadSeg(a6) + move.l (sp)+,a6 + ENDC +.Skip rts + +; Effacement du buffer mouse +; ~~~~~~~~~~~~~~~~~~~~~~~~~~ +EffMouse + lea PI_AdMouse(a5),a0 + jmp A5_Free + +; Efface la banque de resource file-selector +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +EffFSel lea Sys_Banks(a5),a0 + move.l a0,Cur_Banks(a5) + moveq #16,d0 + JJsr L_Bnk.Eff + rts + +; AddPath sur un nom+command line, retourne la command line en A0 +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Sys_AddPathCom + movem.l a1/d1,-(sp) + move.l a0,a1 +.Lim1 move.b (a1)+,d1 + beq.s .Lim2 + cmp.b #" ",d1 + bne. .Lim1 +.Lim2 move.b -1(a1),d1 + clr.b -1(a1) + bsr Sys_AddPath + move.b d1,-1(a1) + bne.s .Lim3 + subq.l #1,a1 +.Lim3 move.l a1,a0 + movem.l (sp)+,a1/d1 + rts + +; Additionne le pathname du dossier AMOS_System, si pas de path defini! +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Sys_AddPath + movem.l a1/a2,-(sp) + move.l Name1(a5),a2 + move.l a0,a1 +.Ess move.b (a1)+,d0 + cmp.b #":",d0 + beq.s .Cop2 + tst.b d0 + bne.s .Ess + lea Sys_Pathname(a5),a1 +.Cop1 move.b (a1)+,(a2)+ + bne.s .Cop1 + subq.l #1,a2 +.Cop2 move.b (a0)+,(a2)+ + bne.s .Cop2 + movem.l (sp)+,a1/a2 + rts + +; Retourne le message default_resource D0 +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Def_GetMessage + move.l Sys_Resource(a5),a0 + add.l 6(a0),a0 + bra.s GetMessage +; Routine, retourne le message systeme D0 +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Sys_GetMessage + move.l Sys_Messages(a5),a0 +GetMessage + move.w d1,-(sp) + clr.w d1 + cmp.l #0,a0 + beq.s .Big + addq.l #1,a0 + bra.s .In +.Loop move.b (a0),d1 + cmp.b #$ff,d1 + beq.s .Big + lea 2(a0,d1.w),a0 +.In subq.w #1,d0 + bgt.s .Loop +.Out move.w (sp)+,d1 + move.b (a0)+,d0 + rts +.Big lea .Fake(pc),a0 + bra.s .Out +.Fake dc.b 0,0,0,0 + + +; Verification de l'installation +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Sys_VerInstall + move.w d0,-(sp) + move.w UserName(pc),d0 + beq.s .Skip + move.w UserReg(pc),d0 +.Skip movem.w (sp)+,d0 + rts + +; Enleve le codage: D0=XOR +; ~~~~~~~~~~~~~~~~~~~~~~~~ +Sys_UnCode + movem.l a0/a1/d1/d2/d3,-(sp) + moveq #0,d2 + move.w (a0)+,d1 + move.w d1,(a1)+ + subq.w #1,d1 + bmi.s .Skip +.Loop move.b (a0)+,d3 + eor.b d0,d3 + add.b d3,d2 + move.b d3,(a1)+ + dbra d1,.Loop +.Skip move.w d2,d0 + movem.l (sp)+,a0/a1/d1/d2/d3 + rts + +****************************************************************** + dc.b $17,$09,$19,$92 +UserSecu ds.b 34 +****************************************************************** + +; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +; Clear CPU Caches, quel que soit le systeme +; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Sys_ClearCache +; - - - - - - - - - - - - - + movem.l a0-a1/a6/d0-d1,-(sp) + move.l $4.w,a6 + cmp.w #37,WB2.0(a5) A partir de V37 + bcc.s .Skip + jsr FindTask(a6) + bra.s .Exit +.Skip jsr _LVOCacheClearU(a6) CacheClearU +.Exit movem.l (sp)+,a0-a1/a6/d0-d1 + rts + + +; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +; Wait vbl multi tache +; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Sys_WaitMul +; - - - - - - - - - - - - - + movem.l a0-a1/a6/d0-d1,-(sp) +; Inhibition + SyCall Test_Cyclique +; Attente multitache + move.l T_GfxBase(a5),a6 + jsr -270(a6) + movem.l (sp)+,a0-a1/a6/d0-d1 + rts + +; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +; Force le recalcul des listes copper +; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +ReCop: SyCall WaitVbl + EcCall CopForce + rts + +; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +; ARRET DES LIBRAIRIES +; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Libraries_Stop +; - - - - - - - - - - - - - - - - + movem.l a2-a6/d2-d7,-(sp) + moveq #26-1,d2 + lea ExtAdr+26*16-16(a5),a2 +.Loop move.l 8(a2),d0 + beq.s .Next + move.l d0,a0 + movem.l a2/d2,-(sp) + jsr (a0) + movem.l (sp)+,a2/d2 +.Next lea -16(a2),a2 + dbra d2,.Loop + moveq #0,d0 + bra Ll_Out2 +; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +; EFFACEMENT DES LIBRARIES +; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Libraries_Free +; - - - - - - - - - - - - - - - - + bsr Libraries_FreeSizes + movem.l a2-a6/d2-d7,-(sp) + moveq #27-1,d2 + lea AdTokens(a5),a2 +.Loop move.l (a2),d0 + beq.s .Next + move.l d0,a0 La library elle meme... + clr.l (a2) + move.l LB_MemAd(a0),a1 + move.l LB_MemSize(a0),d0 + SyCall MemFree +.Next addq.l #4,a2 Library suivante... + dbra d2,.Loop + moveq #0,d0 + bra Ll_Out2 +; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +; LIBERATION DE LA TABLE DES TAILLES +; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Libraries_FreeSizes +; - - - - - - - - - - - - - - - - + movem.l d2-d7/a2-a6,-(sp) + lea AdTokens(a5),a2 + moveq #27-1,d2 +.Loop move.l (a2)+,d0 + beq.s .Skip + move.l d0,a0 + move.l LB_LibSizes(a0),d0 + beq.s .Skip + clr.l LB_LibSizes(a0) + move.l d0,a1 + move.l -(a1),d0 + addq.l #4,d0 + jsr RamFree +.Skip dbra d2,.Loop + moveq #0,d0 +Ll_Out2 movem.l (sp)+,d2-d7/a2-a6 + rts + + + +; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +; RESERVATION / LIBERATION MEMOIRE (ancienne!) +; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +; Mise a zero! +; ~~~~~~~~~~~~~~~~~~ +RamFast move.l a0,-(sp) + SyCall MemFastClear + move.l a0,d0 + move.l (sp)+,a0 + rts +RamChip move.l a0,-(sp) + SyCall MemChipClear + move.l a0,d0 + move.l (sp)+,a0 + rts +; NON mise a zero! +; ~~~~~~~~~~~~~~~~~~~~~~ +RamFast2 + move.l a0,-(sp) + SyCall MemFast + move.l a0,d0 + move.l (sp)+,a0 + rts +RamChip2 + move.l a0,-(sp) + SyCall MemChip + move.l a0,d0 + move.l (sp)+,a0 + rts +; Liberation +; ~~~~~~~~~~~~~~~~ +RamFree move.l a0,-(sp) + SyCall MemFree + move.l (sp)+,a0 + rts + +; Reserve / Libere le buffer temporaire +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +ResTempBuffer + movem.l d1/a1,-(sp) + move.l d0,d1 +; Libere l'ancien buffer + move.l TempBuffer(a5),d0 + beq.s .NoLib + move.l d0,a1 + move.l -(a1),d0 + addq.l #4,d0 + bsr.s RamFree + clr.l TempBuffer(a5) +; Reserve le nouveau +.NoLib move.l d1,d0 + beq.s .Exit + addq.l #4,d0 + bsr RamFast + beq.s .Exit + move.l d0,a0 + move.l d1,(a0)+ + move.l a0,TempBuffer(a5) + move.l d1,d0 +; Branche les routines de liberation automatique + movem.l a0-a2/d0-d1,-(sp) + lea .LibClr(pc),a1 + lea Sys_ClearRoutines(a5),a2 + SyCall AddRoutine + lea .LibErr(pc),a1 + lea Sys_ErrorRoutines(a5),a2 + SyCall AddRoutine + movem.l (sp)+,a0-a2/d0-d1 +.Exit movem.l (sp)+,d1/a1 + rts +; Structures liberation +; ~~~~~~~~~~~~~~~~~~~~~ +.LibClr dc.l 0 + moveq #0,d0 + bra.s ResTempBuffer +.LibErr dc.l 0 + moveq #0,d0 + bra.s ResTempBuffer + +; Reserve un espace mïż½moire sur (a5) +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +; A0= Adresse dans (a5) +; D0= Longueur +; D1= Flags +A5_Reserve + move.l a1,-(sp) + move.l a0,a1 + addq.l #4,d0 + SyCall MemReserve + beq.s .Out + subq.l #4,d0 + move.l d0,(a0)+ + move.l a0,(a1) +.Out move.l (sp)+,a1 + rts +; Efface un espace mïż½moire sur (a5) +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +; A0= Adresse dans (a5) +A5_Free + movem.l a0/a1/d0,-(sp) + move.l (a0),d0 + beq.s .Skip + clr.l (a0) + move.l d0,a1 + move.l -(a1),d0 + addq.l #4,d0 + SyCall MemFree +.Skip movem.l (sp)+,a0/a1/d0 + rts + +; +; NOUVELLE ROUTINES DISQUE +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +; +; OPEN: ouvre le fichier systeme (diskname1) access mode D2 +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +D_Open move.l Name1(a5),d1 +D_OpenD1 + move.l a6,-(sp) + move.l DosBase(a5),a6 + jsr _LVOOpen(a6) + move.l (sp)+,a6 + move.l d0,Handle(a5) + rts + +; READ fichier systeme D3 octets dans D2 +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +D_Read movem.l d1/a0/a1/a6,-(sp) + move.l Handle(a5),d1 + move.l DosBase(a5),a6 + jsr _LVORead(a6) + movem.l (sp)+,d1/a0/a1/a6 + cmp.l d0,d3 + rts + +; WRITE fichier systeme D3 octets de D2 +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +D_Write + movem.l d1/a0/a1/a6,-(sp) + move.l Handle(a5),d1 + move.l DosBase(a5),a6 + jsr _LVOWrite(a6) + movem.l (sp)+,d1/a0/a1/a6 + cmp.l d0,d3 + rts + +; SEEK fichier system D3 mode D2 deplacement +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +D_Seek move.l Handle(a5),d1 + move.l a6,-(sp) + move.l DosBase(a5),a6 + jsr _LVOSeek(a6) + move.l (sp)+,a6 + tst.l d0 + rts + +; CLOSE fichier systeme +; ~~~~~~~~~~~~~~~~~~~~~ +D_Close + movem.l d0/d1/a0/a1/a6,-(sp) + move.l Handle(a5),d1 + beq.s .Skip + clr.l Handle(a5) + move.l DosBase(a5),a6 + jsr _LVOClose(a6) +.Skip movem.l (sp)+,d0/d1/a0/a1/a6 + rts + +; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +; MONITOR +; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +InMonitor +; - - - - - - - - - - - - - + bsr Prg_FirstRun Autorise? + tst.l Edit_Segment(a5) + beq.s .ErrE + Ijsr L_Ed_CloseEditor + Ijsr L_Prg_ReSetBanks Remet les banques + bsr Mon_Load Charge le moniteur + bne.s .Err + Ijsr L_Mon_In_Program + bne.s .Mem + Ret_Inst +.ErrE moveq #13,d0 + Ijmp L_Error +.Err cmp.w #-1,d0 + beq.s .Mem + Ijmp L_DiskError +.Mem Ijmp L_OOfMem + +; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +; KILL EDITOR +; KILL EDITOR: ne fonctionne que le pour le premier programme! +; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +InKillEditor +; - - - - - - - - - - - - - + bsr Prg_FirstRun Autorise? + tst.l Edit_Segment(a5) Deja ferme? + beq.s KEExit +; Fait un close editor d'abord + tst.b PI_CloseEd(a5) Autorise? + beq.s CloCloX + Ijsr L_Ed_CloseEditor +; Peut-on faire le KILL editor? + tst.b PI_KillEd(a5) Autorise? + beq.s CloCloX + tst.l Mon_Base(a5) Pas si moniteur en route! + bne.s CloCloX + Ijsr L_Ed_KillEditor + bsr Edit_Free Enleve de la memoire + bsr Mon_Free Tant qu'ïż½ faire... + lea RunErr_NoEditor(pc),a0 + move.l a0,Prg_JError(a5) Branchement en fin de programme + clr.w T_AMOState(a5) Mode RUN-ONLY +; Sortie commune +CloCloX lea Equ_Base(a5),a0 Libere les equates + bsr A5_Free + Ijsr L_Prg_ReSetBanks Remet les banques + move.w ScOn(a5),d1 + beq.s KEExit + subq.w #1,d1 + EcCall Active +KEExit Ret_Inst + +; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +; CLOSE EDITOR +; ne fonctionne que pour le premier programme! +; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +InCloseEditor +; - - - - - - - - - - - - - + bsr Prg_FirstRun + tst.b PI_CloseEd(a5) Autorise? + beq.s KEExit + tst.l Edit_Segment(a5) Deja ferme? + beq.s KEExit + Ijsr L_Ed_CloseEditor + bra.s CloCloX + +; Peut-on fermer l'editeur ? +; ~~~~~~~~~~~~~~~~~~~~~~~~~~ +Prg_FirstRun + tst.w Direct(a5) + bne.s .Err + tst.b Prg_Accessory(a5) + bne.s .Non + move.l Prg_Runned(a5),a0 Un programme en dessous? + tst.l Prg_Previous(a0) + bne.s .Non + rts +.Non addq.l #4,sp + Ret_Inst +.Err moveq #17,d0 Illegal direct mode + Ijmp L_Error + +; __________________________________________________________________________ +; +; Erreurs RUN-ONLY +; __________________________________________________________________________ +; +RunErr_RunOnly + move.w #-1,-(sp) + bra.s RunErr_Reload +; __________________________________________________________________________ +; +; Erreurs editeur ferme... +; __________________________________________________________________________ +; +RunErr_NoEditor + clr.w -(sp) +RunErr_Reload + movem.l a0-a1/d0-d1,-(sp) + move.l Cur_Banks(a5),-(sp) Donnees courantes... + move.l Cur_Dialogs(a5),-(sp) + cmp.w #1002,d0 System? + beq TheEnd + bsr Sys_VerInstall Si pas installe! + beq TheEnd + bsr Reset_Request Requester back to AMOS + bsr Edit_Load Charge l'editeur + bne .Again + JJsr L_Ed_Cold + beq.s .Ok + cmp.b #1,d0 Out of memory? + bne TheEnd_Editor Fichiers introuvables : tant pis! +; Efface au maximum la memoire +.Again move.l (sp),Cur_Dialogs(a5) Banques du programme + move.l 4(sp),Cur_Banks(a5) + bsr MemMaximum Grab as much memory as possible + bsr Edit_Load Charge eventuellement + bne.s .AAgain + JJsr L_Ed_Cold + beq.s .Ok +; Efface les banques du programme! +.AAgain tst.w 6*4(sp) Un run-only? + bne TheEnd Oui: on stoppe tout... + move.l (sp),Cur_Dialogs(a5) Banques du programme + move.l 4(sp),Cur_Banks(a5) + bsr MemDelBanks Peut-on effacer les banques? + beq TheEnd_OOMem + JJsr L_Bnk.EffAll Efface les banques! + JJsr L_Bnk.Change + bsr Edit_Load Essaye encore! + bne TheEnd_Editor + JJsr L_Ed_Cold + bne TheEnd_Editor Tant pis! +; Branche ïż½ l'editeur +.Ok tst.l Edt_Runned(a5) Pas de programme >>> coldcold + bne.s .Go + move.l Edt_List(a5),Edt_Runned(a5) Donc, un seul prg! +.Go bsr WOption AMOS en 1er! + move.l (sp)+,Cur_Dialogs(a5) Remet les banques + move.l (sp)+,Cur_Banks(a5) + movem.l (sp)+,a0-a1/d0-d1 + tst.w (sp)+ + JJmpR L_Ed_ErrRun,a2 Erreurs normales + bra TheEnd + +; Requester back to AMOS +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Reset_Request + move.l ExtAdr+2*16+4(a5),d0 Request= ext #2 + beq.s .Skip + move.l d0,a0 + jsr (a0) +.Skip rts + +; Recupere autant de memoire que possible +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +MemMaximum + JJsr L_ClearVar Plus de variable + move.w #-2,DefFlag(a5) Plus d'ecran + JJsr L_DefRun1 + move.l PI_ParaTrap+16(a5),-(sp) Lignes sprites, MINI! + move.l #20,PI_ParaTrap+16(a5) + JJsr L_DefRun2 + move.l (sp)+,PI_ParaTrap+16(a5) + move.l #10000*1024,d0 Demande 10 megas de CHIP! + SyCall MemChip + tst.l Mon_Base(a5) Libere le moniteur + bne.s .Skip + bsr Mon_Free +.Skip rts + +; Ligne de confirmation de l'effacement du programme courant... +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +MemDelBanks + movem.l a2-a6/d2-d7,-(sp) + JJsr L_Bnk.GetLength Longueur des banques + add.l d2,d0 + add.l d1,d0 + beq .Tanpi Si zero: on ne fait rien! + + bsr .Puzzle Ouvre l'ecran + move.l a1,a0 + moveq #EcFsel,d0 + move.l #640,d1 + moveq #48,d2 + moveq #0,d3 + moveq #-1,d4 + JJsrR L_Dia_RScOpen,a3 + bne.s .Tanpi + bsr ReCop + + bsr .Puzzle Demarre le DBL + moveq #0,d0 + moveq #0,d1 + moveq #0,d2 + moveq #0,d3 + moveq #0,d4 + moveq #0,d5 + move.l #512,d6 Taille du buffer + lea .DBL(pc),a0 + JJsrR L_Dia_RunQuick,a3 + + movem.l d0/d1,-(sp) + EcCalD Del,EcFsel Efface l'ecran + movem.l (sp)+,d0/d1 + + tst.l d0 + bne.s .Tanpi + cmp.w #2,d1 + beq.s .Out + moveq #1,d0 + bra.s .Out +.Tanpi moveq #0,d0 +.Out movem.l (sp)+,d2-d7/a2-a6 + rts +; Retourne les adresses dans la banque par defaut +.Puzzle move.l Sys_Resource(a5),a0 + move.l a0,a1 + add.l 2+0(a0),a1 Base des graphiques + move.l a0,a2 + add.l 2+4(a0),a2 Base des messages + add.l 2+8(a0),a0 Base des programmes + rts +; Petit DBL de gestion de la ligne +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.DBL dc.w .Fin-.Debut +.Debut dc.b "SI SW,SH;" + dc.b "BA 0,0;" + dc.b "BO 0,0,1,SX,SY;" + dc.b "PO 21MECX,4,21ME,0,7;" + dc.b "PO 22MECX,14,22ME,2,3;" + dc.b "BU 1,16,SY22-,64,16,0,0,1;[UN 0,0,13BP+; PR 3MECXBP+,4,3ME,7;][BQ;]" + dc.b "KY 13,0;" + dc.b "BU 2,SX72-,YA,XBXA-,YBYA-,0,0,1;[UN 0,0,13BP+; PR 4MECXBP+,4,4ME,7;][BQ;]" + dc.b "KY 27,0;" + dc.b "BU 3,0,0,SX,SY,0,0,0;[][SM;]" + dc.b "RU 0,3;" + dc.b "EX;",0 +.Fin even + +; Fait passer l'AMOS en 1er juste avant le lancement du programme +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +WOption tst.b WBench(a5) + beq.s .Skip + EcCalD AMOS_WB,1 + clr.b WBench(a5) +.Skip rts + +; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +; Trouve le directory courant > +; >>> Buffer + 384 +; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +AskDir +; - - - - - - - - - - - - - + move.l Buffer(a5),a0 + clr.w (a0) + clr.w 384(a0) + move.l a0,d1 + moveq #-2,d2 + DosCall _LVOLock + tst.l d0 + bne.s AskDir2 + rts +; - - - - - - - - - - - - - +AskDir2 +; - - - - - - - - - - - - - + clr.l -(sp) +ADir0: move.l d0,-(sp) + move.l d0,d1 + DosCall _LVOParentDir + tst.l d0 + bne.s ADir0 +* Redescend les LOCKS en demandant le NOM! + move.l Buffer(a5),a2 + lea 384(a2),a2 + clr.b (a2) + moveq #":",d2 +ADir1: move.l (sp)+,d1 + beq.s ADir4 + move.l Buffer(a5),a1 + movem.l d1/d2/a1/a2,-(sp) + move.l a1,d2 + DosCall _LVOExamine + movem.l (sp)+,d1/d2/a1/a2 + tst.l d0 + beq.s ADir3 + lea 8(a1),a1 +ADir2: move.b (a1)+,(a2)+ + bne.s ADir2 + move.b d2,-1(a2) + clr.b (a2) + moveq #"/",d2 +ADir3 DosCall _LVOUnLock + bra.s ADir1 +ADir4 moveq #0,d0 + rts + + +; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +; Source: Memory.s +; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +; Gestion de liste simple NEXT.l LONG.l + +; Cree un element de liste en CHIP MEM +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Lst.ChipNew + move.l #Chip|Clear|Public,d1 + bra.s Lst.Cree +; Cree une element de liste en FAST MEM +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Lst.New + move.l #Clear|Public,d1 +; Cree un ïż½lïż½ment en tete de liste A0 / longueur D0 / Memoire D1 +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Lst.Cree + movem.l a0/d0,-(sp) + addq.l #8,d0 + SyCall MemReserve + move.l a0,a1 + movem.l (sp)+,a0/d1 + beq.s .Out + move.l (a0),(a1) + move.l a1,(a0) + move.l d1,4(a1) + move.l a1,d0 +.Out rts + +; Efface une liste entiere A0 +; ~~~~~~~~~~~~~~~~~~~~~~~~ +Lst.DelAll + bra.s .In +.Loop move.l d0,a1 + bsr Lst.Del +.In move.l (a0),d0 + bne.s .Loop + rts +; Efface un ïż½lïż½ment de liste A1 / Debut liste A0 +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Lst.Del + movem.l a0/d0-d2,-(sp) + move.l a1,d0 + move.l a0,a1 + move.l (a1),d2 + beq.s .NFound +.Loop move.l a1,d1 + move.l d2,a1 + cmp.l d0,a1 + beq.s .Found + move.l (a1),d2 + bne.s .Loop + bra.s .NFound +; Enleve de la liste +.Found move.l d1,a0 + move.l (a1),(a0) + move.l 4(a1),d0 + addq.l #8,d0 + SyCall MemFree +.NFound movem.l (sp)+,a0/d0-d2 + rts + +; INSERE un ïż½lïż½ment A1 en tete de liste A0 +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Lst.Insert + move.l (a0),(a1) + move.l a1,(a0) + rts + +; Enleve un ïż½lïż½ment de liste A1 / Debut liste A0 +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Lst.Remove + movem.l a0/a1/d0-d2,-(sp) + move.l a1,d0 + move.l a0,a1 + move.l (a1),d2 + beq.s .NFound +.Loop move.l a1,d1 + move.l d2,a1 + cmp.l d0,a1 + beq.s .Found + move.l (a1),d2 + bne.s .Loop + bra.s .NFound +; Enleve de la liste +.Found move.l d1,a0 + move.l (a1),(a0) +.NFound movem.l (sp)+,a0/a1/d0-d2 + rts + +; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +; BANQUES PROGRAMME PRECEDENT +; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Bnk.PrevProgram +; - - - - - - - - - - - - - + movem.l a0/a1/d0,-(sp) + tst.l Mon_Base(a5) Pas si moniteur! + bne.s .Non + tst.w Direct(a5) Pas en mode direct! + bne.s .Non + move.l Prg_Runned(a5),a0 Un programme en dessous + move.l Prg_Previous(a0),d0 + bne.s .Ok + move.l Edt_Current(a5),d0 NON! Un programme edite? + beq.s .Non + move.l d0,a1 + move.l Edt_Prg(a1),d0 Le meme??? + cmp.l d0,a0 + beq.s .Non +.Ok move.l d0,a0 On grabbe + lea Prg_Banks(a0),a0 + move.l a0,Cur_Banks(a5) + bra.s .Exit +.Non moveq #0,d0 +.Exit movem.l (sp)+,a0/a1/d0 + rts + +; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +; BANQUE DU PROGRAMME COURANT +; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Bnk.CurProgram +; - - - - - - - - - - - - - + movem.l a0/d0,-(sp) + move.l Prg_Runned(a5),a0 + lea Prg_Banks(a0),a0 + move.l a0,Cur_Banks(a5) + movem.l (sp)+,a0/d0 + rts + +; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +; CHANGEMENT DANS LES BANQUES +; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Bnk.Change +; - - - - - - - - - - - - - + movem.l a0-a3/d0-d7,-(sp) +; Appelle les extensions +; ~~~~~~~~~~~~~~~~~~~~~~ + lea ExtAdr(a5),a0 + moveq #26-1,d0 +.ELoop move.l 12(a0),d1 + beq.s .ESkip + move.l d1,a1 + movem.l a0/d0,-(sp) + move.l d1,a1 + move.l Cur_Banks(a5),a0 + move.l (a0),a0 + jsr (a1) + movem.l (sp)+,a0/d0 +.ESkip lea 16(a0),a0 + dbra d0,.ELoop +; Recherche la banque de sprites +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + JJsr L_Bnk.GetBobs + SyCall SetSpBank +; Ok! +; ~~~ + movem.l (sp)+,a0-a3/d0-d7 + tst.w d0 + rts + +; IFNE Debug +PreBug btst #6,$BFE001 + beq.s BugBug + rts +BugBug movem.l d0-d2/a0-a2,-(sp) +.Ll move.w #$FF0,$DFF180 + btst #6,$BFE001 + bne.s .Ll + move.w #20,d0 +.L0 move.w #10000,d1 +.L1 move.w d0,$DFF180 + dbra d1,.L1 + dbra d0,.L0 + btst #6,$BFE001 + beq.s .Ill + movem.l (sp)+,d0-d2/a0-a2 + rts +.Ill EcCalD AMOS_WB,0 + movem.l (sp)+,d0-d2/a0-a2 + illegal + rts +; ENDC + + +; Inclusion de la verification +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + Include "+Verif.s" + +; Charge le moniteur et l'editeur en mode debug +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + IFNE Debug=2 +Mon_Debug Include "+Monitor.s" +Edit_Debug Include "+Edit.s" + ENDC + IFEQ Debug=2 +Mon_Debug +Edit_Debug + ENDC + + +; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +; CHARGEMENT / INITIALISATION - Partie amovible! +; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + SECTION "I",CODE +; - - - - - - - - - - - - - + +Ext_Nb equ 5 +Ext_TkCmp equ 6 +Ext_TkCOp equ $14 +Ext_TkTston equ $28 +Ext_TkTstof equ $3a +Ext_TkTst equ $4e + +; Calcul de la taille des buffers de travail +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LDataWork equ 32+BbLong+12*2+(AAreaSize*5+6)+24+16+12+70*3+4+20+108+108+256+TBuffer + +; Buffer dans la pile pour debuter +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + RsReset +SP_Message rs.l 1 +SP_AutoLock rs.l 1 +SP_AutoName rs.b 128 +SP_Config rs.b 128 +SP_DefSize rs.l 1 +SP_DosBase rs.l 1 +SP_IntBase rs.l 1 +SP_Command rs.l 2 +SP_WSegment rs.l 1 +SP_WBench rs.w 1 +SP_CommandLine rs.l 1 +SP_Buffer equ __RS + + +; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +; DEMARRAGE A FROID +; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Hunk_2 +Cold_Start +; - - - - - - - - - - - - - + move.l sp,SaveSp + +; Reserve un buffer dans la pile, pour travailler +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + lea -SP_Buffer(sp),sp + movem.l a0/d0,SP_Command(sp) + +; Init dos.library +; ~~~~~~~~~~~~~~~~ + moveq #0,d0 + lea DosName,a1 + move.l $4.w,a6 + jsr _LVOOpenLibrary(a6) + move.l d0,SP_DosBase(sp) + +; Init INTUITION library / Find version! +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + move.l $4.w,a6 + moveq #0,d0 + move.l d0,d3 + lea IntName(pc),a1 + jsr _LVOOpenLibrary(a6) + move.l d0,SP_IntBase(sp) + +; CLI ou WORKBENCH? +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + clr.l SP_WSegment(sp) + clr.l SP_Message(sp) + clr.l SP_AutoLock(sp) + clr.l SP_DefSize(sp) + clr.w SP_AutoName(sp) + clr.w SP_Config(sp) + clr.l SP_CommandLine(sp) + move.b #1,SP_WBench(sp) + +; Workbench? +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + sub.l a1,a1 + move.l $4.w,a6 + jsr _LVOFindTask(a6) + move.l d0,a0 + tst.l $ac(a0) + bne.s FromCLI +; Recupere le message +; ~~~~~~~~~~~~~~~~~~~ + move.l $4.w,a6 + lea $5c(a0),a0 + move.l a0,-(sp) + jsr -384(a6) WaitPort + move.l (sp)+,a0 + jsr -372(a6) GetMsg + move.l d0,SP_Message(sp) + move.l d0,a2 + moveq #-1,d2 +; Change le directory >>> directory AMOS +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + move.l $24(a2),d0 + beq.s .PaLock + move.l d0,a0 + move.l (a0),d2 + beq.s .PaLock + move.l d2,d1 + move.l SP_DosBase(sp),a6 + jsr _LVOCurrentDir(a6) +.PaLock +; Un programme ïż½ charger? +; ~~~~~~~~~~~~~~~~~~~~~~~ + cmp.l #2,$1c(a2) + bne.s .PaAuto + move.l $24(a2),d0 + beq.s .PaAuto + move.l d0,a2 + move.l 8(a2),SP_AutoLock(sp) + move.l 12(a2),d0 + beq.s .PaAuto + move.l d0,a0 + lea SP_AutoName(sp),a1 +.Cop move.b (a0)+,(a1)+ + bne.s .Cop + tst.l d2 + bne.s .PaAuto + move.l SP_AutoLock(sp),d1 + beq.s .PaAuto + move.l SP_DosBase(sp),a6 + jsr _LVOCurrentDir(a6) +.PaAuto bra CommandX + +; CLI! +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +FromCLI movem.l SP_Command(sp),a0/d0 + cmp.w #1,d0 + bls CommandX + clr.b -1(a0,d0.w) +; Explore la ligne de commande +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +; Saute le dïż½but +.Cli0 move.b (a0)+,d0 + beq CommandX + cmp.b #" ",d0 + beq.s .Cli0 + cmp.b #"-",d0 + beq.s .CliO +; Nom du programme ïż½ charger? + subq.l #1,a0 + lea SP_AutoName(sp),a1 + bsr .CliNom +.Spc cmp.b #" ",(a0)+ Stocke le debut command line + beq.s .Spc + subq.l #1,a0 + move.l a0,SP_CommandLine(sp) + bra CommandX +; Options +.CliO move.b (a0)+,d0 + beq .CliE + cmp.b #"a",d0 + bcs.s .PAm + cmp.b #"z",d0 + bhi.s .PAm + sub.b #$20,d0 +.PAm cmp.b #"C",d0 + beq .ClioC + cmp.b #"W",d0 + beq .ClioW +; Erreur dans la command line +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.CliE move.l #Panic_Command,Panic + bra Boot_Fatal +; Option -C "fichier config" +; ~~~~~~~~~~~~~~~~~~~~~~~~~~ +.ClioC lea SP_Config(sp),a1 + bsr .CliNom + bra.s .Cli0 +; Option -W "workbench" +; ~~~~~~~~~~~~~~~~~~~~~ +.ClioW clr.b SP_WBench(sp) + bra.s .Cli0 +; Prend un nom dans la command line +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.CliNom move.b #" ",d1 + move.b (a0),d0 + beq.s .Clin1 + cmp.b #'"',d0 + beq.s .ClinB + cmp.b #"'",d0 + bne.s .Clin0 +.ClinB move.b d0,d1 + addq.l #1,a0 +.Clin0 move.b (a0),d0 + beq.s .Clin1 + addq.l #1,a0 + cmp.b d0,d1 + beq.s .Clin1 + move.b d0,(a1)+ + bra.s .Clin0 +.Clin1 clr.b (a1) + rts +; Fin de l'exploration des commandes +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +CommandX +; Charge amos.library: differents essais si pas installe! +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + move.l SP_DosBase(sp),a6 + lea LibName2(pc),a0 APSystem/amos.library + move.l a0,d1 + jsr _LVOLoadSeg(a6) + tst.l d0 + bne.s .Ok + lea LibName3(pc),a0 libs/amos.library + move.l a0,d1 + jsr _LVOLoadSeg(a6) + tst.l d0 + bne.s .Ok + lea LibName1(pc),a0 libs:amos.library + move.l a0,d1 + jsr _LVOLoadSeg(a6) + tst.l d0 + bne.s .Ok + move.l #Panic_Lib,Panic Message d'erreur + bra Boot_Fatal +.Ok move.l d0,SP_WSegment(sp) Segment library pour fatal! + lsl.l #2,d0 + addq.l #4,d0 + move.l d0,a4 + +; Reserve la zone de datas... +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + move.l #LDataWork,d0 ; Longueur buffers travail + add.l 8(a4),d0 ; + Longueur datas W + add.l #DataLong,d0 ; + Longueur datas BASIC + move.l d0,d2 + move.l #Public|Clear,d1 Flags + move.l $4.w,a6 Using default system function! + jsr _LVOAllocMem(a6) + tst.l d0 + beq .Mem + move.l d0,a5 + lea LDataWork(a5),a5 + move.l a5,a0 + add.l 8(a4),a5 + move.l d0,Sys_AData(a5) + move.l d2,Sys_LData(a5) +; Trouve toutes les adresses de buffers de travail +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + lea -32(a0),a0 + move.l a0,BufLabel(a5) Buffer label expression + lea -BbLong(a0),a0 + move.l a0,BufBob(a5) Buffer dessin d'un bob + lea -12*2(a0),a0 + move.l a0,MnTDraw(a5) Buffer outline menus + lea -(AAreaSize*5+6)(a0),a0 + move.l a0,AAreaBuf(a5) Zone pour les AREAFILL + lea -24(a0),a0 + move.l a0,AAreaInfo(a5) + lea -16(a0),a0 + move.l a0,BufAMSC(a5) Buffers chargement IFF + lea -12(a0),a0 + move.l a0,BufCCRT(a5) + lea -70*3(a0),a0 + move.l a0,BufCMAP(a5) + lea -4(a0),a0 + move.l a0,BufCAMG(a5) + lea -20(a0),a0 + move.l a0,BufBMHD(a5) + lea -108(a0),a0 + move.l a0,DirFNeg(a5) Filtre negatif directory + lea -108(a0),a0 + move.l a0,Name2(a5) Buffers nom disque + lea -256(a0),a0 + move.l a0,Name1(a5) + lea -TBuffer(a0),a0 + move.l a0,Buffer(a5) + move.w a0,d0 + and.w #$0003,d0 + beq.s .Skipu + illegal +.Mem move.l #Panic_OOMem,Panic Message d'erreur panique + bra Boot_Fatal +.Skipu + +; Poke les donnïż½es contenues dans SP +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + move.l SP_WSegment(sp),Sys_WSegment(a5) + move.l SP_Message(sp),Sys_Message(a5) + move.l SP_DosBase(sp),DosBase(a5) + move.l SP_IntBase(sp),T_IntBase(a5) + +; Start system function of the amos.library +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + move.l a4,Sys_WAd(a5) + move.l #"V2.0",d0 Magic! + move.w #$0200,d1 Version d'AMOSPro + jsr 12(a4) + cmp.l #"W2.0",d0 Verifie la version de la librairie + beq.s .Libok + move.l #Panic_Version,Panic + jmp TheEnd +.Libok + +; Stocke la version du systeme +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + move.l $4.w,a0 + cmp.w #36,$14(a0) + bcs.s .Pa20 + move.w $14(a0),WB2.0(a5) +.Pa20 + +; Charge la configuration de l'interpreteur +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + move.l #1005,d2 + lea SP_Config(sp),a0 Option -C" " + tst.b (a0) + bne.s .Conf + lea NDatas1(pc),a0 AMOSPro_Interpretor_Config + move.l a0,d1 + jsr D_OpenD1 + bne.s .Open + lea NDatas3(pc),a0 s/AMOSPro_Interpretor_Config + move.l a0,d1 + jsr D_OpenD1 + bne.s .Open + lea NDatas2(pc),a0 s:AMOSPro_Interpretor_Config +.Conf move.l a0,d1 + jsr D_OpenD1 + bne.s .Open + move.l #Panic_Config,Panic Message d'erreur + jmp TheEnd +.Open move.l Buffer(a5),d2 + move.l d2,a2 + +; Charge les donnïż½es dc.w +; ~~~~~~~~~~~~~~~~~~~~~~~ + moveq #8,d3 + jsr D_Read + bne TheEnd_Cantread + cmp.l #"PId1",(a2) + bne TheEnd_Cantread + move.l 4(a2),d3 + lea PI_Start(a5),a0 + move.l a0,d2 + jsr D_Read + bne TheEnd_Cantread +; Charge les donnïż½es texte +; ~~~~~~~~~~~~~~~~~~~~~~~~ + move.l a2,d2 + moveq #8,d3 + jsr D_Read + cmp.l #"PIt1",(a2) + bne TheEnd_Cantread + lea Sys_Messages(a5),a0 + move.l 4(a2),d0 + move.l d0,d3 + move.l #Clear|Public,d1 + jsr A5_Reserve + beq JTheEnd_OOMem + move.l a0,d2 + jsr D_Read + jsr D_Close +; La taille du buffer specifiee efface la precedente +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + move.l SP_DefSize(sp),d0 + beq.s .Skop + move.l d0,PI_DefSize(a5) +.Skop +; Buffer de pathact +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + move.l #256,d0 + move.l #Public|Clear,d1 + lea PathAct(a5),a0 + jsr A5_Reserve + beq JTheEnd_OOMem +; Trouve le path complet du systeme +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + moveq #1,d0 Acces au path + jsr Sys_GetMessage + move.l a0,d1 Demande le lock + moveq #-2,d2 + DosCall _LVOLock + tst.l d0 + beq TheEnd_APSystem + jsr AskDir2 Demande le directory + move.l Buffer(a5),a0 Copie le directory + lea 384(a0),a0 + lea Sys_Pathname(a5),a1 +.CC move.b (a0)+,(a1)+ + bne.s .CC +; Init FLOAT library +; ~~~~~~~~~~~~~~~~~~ + move.l $4.w,a6 + moveq #0,d0 + lea FloatName(pc),a1 + jsr _LVOOpenLibrary(a6) + move.l d0,FloatBase(a5) +; Init GRAPHICS Library +; ~~~~~~~~~~~~~~~~~~~~~ + moveq #0,d0 + lea GfxName(pc),a1 + jsr _LVOOpenLibrary(a6) + move.l d0,T_GfxBase(a5) + beq TheEnd_Cantread +; Init ICON Library +; ~~~~~~~~~~~~~~~~~ + tst.b PI_Icons(a5) + beq.s .PaIco + moveq #0,d0 + lea IconName(pc),a1 + jsr _LVOOpenLibrary(a6) + move.l d0,IconBase(a5) + beq.s .PaIco + move.l d0,a6 + moveq #4,d0 Nom de Def_Icon + jsr Sys_GetMessage + jsr Sys_AddPath + move.l Name1(a5),a0 + jsr -78(a6) Charge! + move.l d0,AdrIcon(a5) + beq.s .PaIco + move.l d0,a0 + move.l #$80000000,d0 RAZ position ecran + move.l d0,$3a(a0) + move.l d0,$3e(a0) +.PaIco + +; Charge les librairies +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + bsr Libraries_Load + bne TheEnd_Badext + bsr Library_Patch Insere les routines internes + bsr Libraries_Reloc + bne TheEnd_Badext + move.b #1,Sys_LibStarted(a5) Flag: les librairies sont demarrees! + +; Charge le fichier MOUSE +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + bsr LdMouse +; Charge la banque FSel_Resource +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + bsr LdFSel +; Fait les ASSIGNS automatiques +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + bsr AutoAssigns + +; Demarrage des interruptions +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + moveq #3,d0 A3= fonte / 0 + jsr Sys_GetMessage + move.l a0,a3 + lea PI_ParaTrap(a5),a0 A0= parametre demarrage + move.l PI_AdMouse(a5),a1 A1= mouse.bak / 0 + lea PI_DefEPa(a5),a2 A2= Palette par defaut + moveq #0,d0 D0= pas afficher les ecrans + move.l PI_DefAmigA(a5),d1 D1= default amiga-a + move.l Sys_WAd(a5),a6 + jsr (a6) + tst.l d0 + bne JTheEnd + move.b #-1,Sys_WStarted(a5) + +; Demarre les librairies +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + bsr Libraries_Init + bne TheEnd_Badext + +; Raz du pathact! +; ~~~~~~~~~~~~~~~ + move.l PathAct(a5),a0 + clr.b (a0) + +; Charger un programme? +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + move.l Name1(a5),a0 + clr.w (a0) + move.l SP_AutoLock(sp),d1 + beq.s .PaDir + move.l DosBase(a5),a6 + jsr _LVOCurrentDir(a6) +.PaDir lea SP_AutoName(sp),a0 Un programme en commande? + tst.b (a0) + bne.s .CoLo + moveq #5,d0 Non, essaie AUTOEXEC.AMOS + jsr Sys_GetMessage +.CoLo move.l Name1(a5),a1 +.CoCop move.b (a0)+,(a1)+ + bne.s .CoCop + move.b SP_WBench(sp),WBench(a5) Flag pour test + +; Poke la ligne de commande dans le buffer +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + move.l SP_CommandLine(sp),d0 + beq.s .Paco + move.l d0,a0 + move.l Buffer(a5),a1 + lea TBuffer-256-6(a1),a1 + move.l #"CmdL",(a1)+ + move.l a1,a2 + clr.w (a1)+ +.Cop move.b (a0)+,(a1)+ + bne.s .Cop + subq.l #1,a0 + sub.l d0,a0 + move.w a0,(a2) +.Paco + +; Depile +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + lea SP_Buffer(sp),sp + move.l sp,BasSp(a5) + +; Recupere la taille memoire totale au depart +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + move.l $4.w,a6 + tst.w WB2.0(a5) + bne.s .M20 +; En 1.3, demande simplement AVAILMEM>>> valeurs approximatives! + move.l #Public|Chip,d1 + jsr _LVOAvailMem(a6) + add.l #38*1024,d0 + move.l d0,d2 + move.l #Public|Fast,d1 + jsr _LVOAvailMem(a6) + tst.l d0 + beq.s .QChp + add.l #256*1024,d0 + bra.s .Mm +.QChp add.l #256*1024,d2 + bra.s .Mm +; En 2.0, demande la taille totale +.M20 move.l #Public|Chip|Total,d1 + jsr _LVOAvailMem(a6) + move.l d0,d2 + move.l #Public|Fast|Total,d1 + jsr _LVOAvailMem(a6) +.Mm move.l d0,MemFastTotal(a5) + move.l d2,MemChipTotal(a5) + +; Prend le path de depart +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + JJsr L_AskDir + JJsr L_CopyPath +; Fermeture automatique du WB +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + tst.b PI_AutoWB(a5) + beq.s .NoWB + jsr WOption + JJsr L_WB_Close +.NoWB + +; Branchement ïż½ la fin de l'initialisation +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + jmp Init_Fin + +; Relai de saut dans l'autre Hunk +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +JTheEnd_OOMem + jmp TheEnd_OOMem +JTheEnd jmp TheEnd +; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +; Fait les assigns automatiquement! +; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +AutoAssigns +; - - - - - - - - - - - - - + lea AssInst(pc),a0 ASSIGN present? + move.l Name1(a5),a1 +.CoCop move.b (a0)+,(a1)+ + bne.s .CoCop + JJsr L_RExist + beq.s .NoAss +; Fait les assigns... + JJsr L_AskDir + lea AssCon(pc),a0 Ouvre un NIL: + move.l a0,d1 + move.l #1004,d2 + DosCall _LVOOpen + tst.l d0 + beq.s .NoAss + move.l d0,ParamE(a5) + moveq #0,d2 + lea Ass1(pc),a0 Productivity1 + bsr.s DoAssign + add.w d0,d2 + lea Ass2(pc),a0 Productivity1 + bsr.s DoAssign + add.w d0,d2 + lea Ass3(pc),a0 Tutorial + bsr.s DoAssign + add.w d0,d2 + lea Ass4(pc),a0 Examples + bsr.s DoAssign + add.w d0,d2 + lea Ass5(pc),a0 Accessories + bsr.s DoAssign + add.w d0,d2 + lea Ass6(pc),a0 Compiler + bsr.s DoAssign + add.w d0,d2 + lea Ass7(pc),a0 Extras + bsr.s DoAssign + add.w d0,d2 + beq.s .Skip sur les accessoires, + lea Ass0(pc),a0 On assigne AMOSPro_System: + bsr.s DoAssign +.Skip move.l ParamE(a5),d1 + DosCall _LVOClose +.NoAss rts +* Routine, fait les assigns, si possible! +DoAssign + movem.l d1-d7/a0-a6,-(sp) + move.l a0,-(sp) + move.l Name1(a5),a1 * Regarde si existe deja! +.CoCop1 move.b (a0)+,(a1)+ + bne.s .CoCop1 + move.l a0,-(sp) + JJsr L_RExist + bne .NoAss + +; move.l Buffer(a5),a0 * Fabrique le path normal +; lea 384(a0),a0 +; move.l Name1(a5),a1 +;.CoCop2 move.b (a0)+,(a1)+ +; bne.s .CoCop2 +; subq.l #1,a1 +; move.l (sp),a0 +;.CoCop3 move.b (a0)+,(a1)+ +; bne.s .CoCop3 +; JJsr L_RExist +; bne.s .DoAss + + lea Sys_Pathname(a5),a0 * Essaie avec le directory APSystem! + move.l Name1(a5),a1 +.CoCup2 move.b (a0)+,(a1)+ + bne.s .CoCup2 + move.b #"/",-1(a1) En arriere un directory! + move.l (sp),a0 +.CoCup3 move.b (a0)+,(a1)+ + bne.s .CoCup3 + JJsr L_RExist + beq.s .NoAss + +.DoAss lea AssCall(pc),a0 * Appelle la commande + move.l Buffer(a5),a1 +.CoCop4 move.b (a0)+,(a1)+ + bne.s .CoCop4 + move.l 4(sp),a0 + subq.l #1,a1 +.CoCop5 move.b (a0)+,(a1)+ + bne.s .CoCop5 + move.b #32,-1(a1) + move.b #'"',(a1)+ + move.l Name1(a5),a0 +.CoCop6 move.b (a0)+,(a1)+ + bne.s .CoCop6 + move.b #'"',-1(a1) + clr.b (a1) + move.l Buffer(a5),d1 + move.l ParamE(a5),d2 + move.l ParamE(a5),d3 + move.l DosBase(a5),a6 + jsr -222(a6) + moveq #1,d0 + bra.s .Quit +.NoAss moveq #0,d0 +.Quit addq.l #8,sp + movem.l (sp)+,d1-d7/a0-a6 + rts + +; Charge / Efface la souris , fill patterns +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LdMouse + moveq #2,d0 Mouse.Abk + jsr Sys_GetMessage + tst.b (a0) Utiliser le defaut + beq.s .Skip +; Charge la banque + jsr Sys_AddPath + move.l #1005,d2 + jsr D_Open + beq TheEnd_Cantread + moveq #0,d2 Demande la taille du fichier + moveq #1,d3 + jsr D_Seek + moveq #0,d3 + jsr D_Seek + move.l d0,d3 +; Reserve un buffer de la taille des sprites + move.l #Chip|Public|Clear,d1 + lea PI_AdMouse(a5),a0 + jsr A5_Reserve + beq JTheEnd_OOMem + move.l a0,T_MouBank(a5) +; Lis le fichier dans le buffer + move.l a0,d2 + move.l a0,a2 + jsr D_Read + bne TheEnd_Cantread + cmp.l #"AmSp",(a2) + bne TheEnd_Cantread + cmp.w #4,(a2)+ + bcs TheEnd_Cantread +; Ferme le fichier! + jsr D_Close +.Skip rts + +; Charge/Efface la banque de resource file-selector +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LdFSel moveq #8,d0 + jsr Sys_GetMessage + jsr Sys_AddPath + lea Sys_Banks(a5),a0 + move.l a0,Cur_Banks(a5) + move.l #1005,d2 + jsr D_Open + beq TheEnd_Cantread + moveq #16,d0 + JJsr L_Bnk.Load + bne JTheEnd_OOMem + jsr D_Close +; Met l'adresse de la banque de resource + moveq #16,d0 + JJsr L_Bnk.GetAdr + cmp.l #"Reso",-8(a0) + bne TheEnd_Cantread + move.l a0,Sys_Resource(a5) + rts + +; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +; CHARGEMENT DES LIBRARIES + EXTENSIONS +; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Libraries_Load +; - - - - - - - - - - - - - - - - + +; Librairie principale AMOS +; ~~~~~~~~~~~~~~~~~~~~~~~~~ + moveq #14,d0 + jsr Sys_GetMessage + jsr Sys_AddPathCom + moveq #0,d0 + bsr Library_Load + bne.s .Err +; Extensions +; ~~~~~~~~~~ + moveq #1,d2 +.Loop move.l d2,d0 + add.w #16-1,d0 + jsr Sys_GetMessage + tst.b (a0) + beq.s .Next + jsr Sys_AddPathCom + move.w d2,d0 + bsr Library_Load + bne.s .Err +.Next addq.w #1,d2 + cmp.w #27,d2 + bne.s .Loop + moveq #0,d0 +.Err rts + +; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +; RELOCATION DES LIBRAIRIES +; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Libraries_Reloc +; - - - - - - - - - - - - - - - - + moveq #0,d2 +.Loop1 move.l d2,d0 + bsr Library_Reloc + bne.s .Err + addq.w #1,d2 + cmp.w #27,d2 + bne.s .Loop1 + jsr Libraries_FreeSizes + moveq #0,d2 +.Loop2 move.l d2,d0 + bsr Library_GetParams + bne.s .Err + addq.w #1,d2 + cmp.w #27,d2 + bne.s .Loop2 + moveq #0,d0 +.Err rts +; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +; INITIALISATION DES LIBRAIRIES +; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Libraries_Init +; - - - - - - - - - - - - - - - - + moveq #0,d2 +.Loop move.l d2,d0 + bsr Library_Init + bne.s .Err + addq.w #1,d2 + cmp.w #27,d2 + bne.s .Loop + moveq #0,d0 +.Err rts + +; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +; CHARGEMENT D'UNE LIBRAIRIE +; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +; Name1= Nom +; A0= Command line +; D0= Numero +; - - - - - - - - - - - - - - - - +Library_Load +; - - - - - - - - - - - - - - - - + movem.l d2-d7/a2-a6,-(sp) + + move.l d0,d6 + move.l a0,a4 + lea AdTokens(a5),a6 + lsl.w #2,d0 + add.w d0,a6 +; Ouvre le fichier +; ~~~~~~~~~~~~~~~~ + move.l #1005,d2 + jsr D_Open + beq Ll_Disc +; Lis l'entete dans le buffer + move.l Buffer(a5),d2 + move.l #$20+18,d3 + jsr D_Read + bne Ll_Disc + move.l d2,a3 + lea $20(a3),a3 + move.l (a3),d5 + lsr.l #1,d5 D5= nombre de fonctions +; Reserve la zone memoire... + move.l d5,d4 + lsl.l #2,d4 Taille des jumps + addq.l #4,d4 + Dernier jump (taille derniere routine) + moveq #LB_Size,d3 Data zone negative + add.l 4(a3),d3 + Tokens + add.l 8(a3),d3 + Librairie + add.l 12(a3),d3 + Titre + move.l d3,d0 + add.l d4,d0 + move.l d0,d1 + SyCall MemFastClear + beq Ll_OMem + lea LB_Size(a0,d4.l),a2 Saute les jumps et la datazone + move.l a2,(a6) Extension chargee!!! + move.l d1,LB_MemSize(a2) Taille de la zone memoire + move.l a0,LB_MemAd(a2) Adresse de base + move.l (a3),d3 Buffer temporaire pour les tailles + move.l d3,d0 + addq.l #4,d0 + SyCall MemFastClear + beq Ll_OMem + move.l d3,(a0)+ + move.l a0,LB_LibSizes(a2) +; Une nouvelle / ancienne librarie? + clr.w LB_Flags(a2) Flags + bset #LBF_20,LB_Flags(a2) + moveq #4,d3 + move.l Buffer(a5),d2 + jsr D_Read + bne Ll_Disc + move.l d2,a0 + cmp.l #"AP20",(a0) + beq.s .Suit + bclr #LBF_20,LB_Flags(a2) + moveq #-4,d2 + moveq #0,d3 + jsr D_Seek +; Charge les tailles des routines +.Suit move.l LB_LibSizes(a2),a0 + move.l -4(a0),d3 + move.l a0,d2 + jsr D_Read des routines + bne Ll_Disc +; Fabrique la table d'adresse des routines internes + move.w d5,d0 + subq.w #1,d0 + move.l a2,d1 Base des tokens + add.l 4(a3),d1 + Taille des tokens = Librairie + lea Ll_Rts(pc),a0 RTS pour les fonctions vides + move.l a0,d3 + move.l LB_LibSizes(a2),a0 Liste des fonctions + lea -LB_Size(a2),a1 Debut des adresses + moveq #0,d2 +.Loop1 move.l d1,-(a1) + move.w (a0)+,d2 + bne.s .Skip1 + move.l d3,(a1) Si routine vide>>> RTS +.Skip1 add.l d2,d1 + add.l d2,d1 + dbra d0,.Loop1 +; Charge tout le reste + move.l 4(a3),d3 Tokens + add.l 8(a3),d3 + Librairie + add.l 12(a3),d3 + Titre + move.l a2,d2 + jsr D_Read + bne Ll_Disc +; Ferme le fichier! + jsr D_Close +; Rempli la datazone + move.w d5,LB_NRout(a2) Nombre de routines + move.l 4(a3),d0 + add.l 8(a3),d0 + add.l a2,d0 + move.l d0,LB_Title(a2) Adresse du titre + move.l a4,LB_Command(a2) Command line +; Pas d'erreur + moveq #0,d0 + bra Ll_Out + +Ll_Rts illegal RTS pour les fonctions vides... + +; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +; INTEGRATION DES LIBRAIRIES INTERNES AMOS +; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +; +; - - - - - - - - - - - - - - - - +Library_Patch +; - - - - - - - - - - - - - - - - + movem.l a2-a6/d2-d7,-(sp) + move.l AdTokens(a5),a2 + move.l LB_LibSizes(a2),a3 + lea AMOSJmps,a1 + move.w (a1)+,d0 +.Loop lsl.w #1,d0 Plus de taille => plus de relocation + clr.w 0(a3,d0.w) + lsl.w #1,d0 Pointe dans la librarie + neg.w d0 + lea -LB_Size-4(a2,d0.w),a0 + move.l (a1)+,(a0) + move.w (a1)+,d0 + bne.s .Loop + moveq #0,d0 + bra Ll_Out + +; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +; RELOCATION D'UNE LIBRAIRIE +; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +; D0= Numero +; - - - - - - - - - - - - - - - - +Library_Reloc +; - - - - - - - - - - - - - - - - + movem.l d2-d7/a2-a6,-(sp) + move.l d0,d6 + lea AdTokens(a5),a3 + lsl.w #2,d0 + move.l 0(a3,d0.w),d0 + beq Ll_Out + move.l d0,a3 + +; Une librarie 2.0? +; ~~~~~~~~~~~~~~~~~~~~~~~ + btst #LBF_20,LB_Flags(a3) + bne.s .20 + +; Ancienne extension: reloge la table de tokenisation +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + move.l a3,a0 + move.l a0,d1 + lea 6(a0),a0 +.Loop2 move.w (a0),d0 + beq.s .Loop4 + bmi.s .Loop3 + lsl.w #2,d0 + neg.w d0 + move.l -LB_Size-4(a3,d0.w),d2 + sub.l d1,d2 + move.w d2,(a0) +.Loop3 move.w 2(a0),d0 + beq.s .Loop4 + bmi.s .Loop4 + lsl.w #2,d0 + neg.w d0 + move.l -LB_Size-4(a3,d0.w),d2 + sub.l d1,d2 + move.w d2,2(a0) +.Loop4 addq.l #4,a0 +.Loop5 tst.b (a0)+ + bpl.s .Loop5 +.Loop6 tst.b (a0)+ + bpl.s .Loop6 + move.w a0,d0 + and.w #$0001,d0 + add.w d0,a0 + tst.w (a0) + bne.s .Loop2 + bra .Fin20 + +; Nouvelle librarie: exploration de la table de tokens +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.20 move.l a3,a0 +.RLoop move.w 2(a0),d1 + move.w (a0),d0 + beq .RExit + bmi.s .RFonc + cmp.w #1,d0 + beq.s .RFonc +; Une Instruction / Instruction ET fonction +.RInst addq.w #1,d0 Instruction pointe direct +; bmi.s .INop Instruction NOP + lsl.w #2,d0 + neg.w d0 + move.w d0,(a0) + tst.w d1 Faire un flag? + bmi .RNext + moveq #0,d0 + bset #6,d0 Une instruction + cmp.w #1,d1 + ble.s .RSuit + bset #7,d0 Une instruction + fonction + bra.s .RSuit +;.INop move.w #1,(a0) Positif>>> Instruction NOP +; moveq #0,d0 +; bra.s .RNext +; Une fonction / Fonction mathematique +.RFonc cmp.w #1,d1 1, ou 0>>> VIDE!!! + ble.s .RSuit + lsl.w #2,d1 Fonction, pointe AVANT + neg.w d1 + move.w d1,(a0) + and.w #$FF00,d0 Fonction normale? + beq .RFn + and.w #%0111111100000000,d0 Faire un flag? + beq .RNext +.RFn bset #7,d0 Une fonction! +; Fabrication du flag parametres... +.RSuit lea 4(a0),a1 + moveq #0,d1 +.RNom tst.b (a1)+ Saute le nom + bpl.s .RNom + moveq #0,d2 Type de fonction + move.b (a1)+,d1 Definition fonction / instruciton + bmi.s .RDoke + cmp.b #"C",d1 Une constante + beq.s .RCst + cmp.b #"V",d1 Une variable reservee? + bne.s .RSkip1 + move.b (a1)+,d1 + bmi.s .RDoke + or.w #L_VRes,d0 Flag variable reservee +.RSkip1 move.b (a1)+,d1 Prend le parametre + bmi.s .RDoke Fini? + addq.w #1,d0 Un parametre de plus + sub.w #"0",d1 Pointeur + lsl.w #1,d1 + jmp .Jmp(pc,d1.w) +.Jmp bra.s .RSkip2 0 Entier, + bra.s .Float 1 Float: veut un parametre float + bra.s .RSkip2 2 String, + bra.s .RSkip2 3 Indifferent, accepte par le test + bra.s .Math 4 Math, appelle la fonction parametre +.Angle or.w #L_FAngle,d0 5 Angle, veut un float en radian + bra.s .RSkip2 +.Math or.w #L_FMath,d0 + bra.s .RSkip2 +.Float or.w #L_FFloat,d0 +.RSkip2 move.b (a1)+,d1 + bpl.s .RSkip1 +.RDoke move.w d0,2(a0) Doke le flag parametres + move.l a1,d0 On est deja a la fin + addq.l #1,d0 + and.w #$FFFE,d0 + move.l d0,a0 + bra .RLoop On peut donc reboucler +.RCst tst.b (a1)+ Une constante + bpl.s .RCst + bra.s .RDoke +.RNext clr.w 2(a0) Pas de flag + bsr Ll_TkNext Saute le token + bra .RLoop +.RExit + addq.l #2,a0 +; Swapper les routines floats? +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + cmp.l #"FSwp",(a0) + bne.s .NoFSwp + move.w 4(a0),LB_DFloatSwap(a3) + move.w 6(a0),LB_FFloatSwap(a3) + addq.l #8,a0 +.NoFSwp +; Des donnees pour le compilateur? +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + cmp.l #"ComP",(a0) Le code? + bne.s .NoComp + move.w 4(a0),d0 + lea 4+2(a0,d0.w),a0 On les saute +.NoComp +; Une table de verification rapide? +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + cmp.l #"KwiK",(a0) Le code? + bne.s .NoKwik + lea 4(a0),a0 + move.l a0,LB_Verif(a3) Poke l'adresse... +.NoKwik + +.Fin20 + +; Relocation des routines... +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + move.w LB_NRout(a3),d3 Nombre de routines + move.w d3,d5 Pour comparer... + subq.w #1,d3 + lea -LB_Size(a3),a2 + move.l LB_LibSizes(a3),a4 Tailles des routines + +GRou0 move.l -(a2),a0 Debut routine + moveq #0,d4 + move.w (a4)+,d4 + beq.s GRouN + lsl.l #1,d4 + add.l a0,d4 Fin routine +GRou1 move.b (a0),d0 + cmp.b #C_Code1,d0 + beq GRou10 +GRou2 addq.l #2,a0 + cmp.l d4,a0 + bcs.s GRou1 +GRouN dbra d3,GRou0 + bra GRouX +; Instruction speciale +GRou10 move.w (a0),d0 + move.b d0,d2 + and.b #$0F,d0 + cmp.b #C_Code2,d0 + bne GRou2 + and.w #$00F0,d2 + lsr.w #1,d2 + lea GRout(pc),a1 + jmp 0(a1,d2.w) +; Table des sauts +GRout bra GRouJ ; 0 - RJmp / Rjmptable + dc.w $4ef9 JMP + jmp (a0) + bra GRouJ ; 1 - RJsr / Rjsrtable + dc.w $4eb9 JSR + jsr (a0) + bra GRouB ; 2 - RBra + bra GRout + bra GRouB ; 3 - RBsr + bsr GRout + bra GRouB ; 4 - RBeq + beq GRout + bra GRouB ; 5 - RBne + bne GRout + bra GRouB ; 6 - RBcs + bcs GRout + bra GRouB ; 7 - RBcc + bcc GRout + bra GRouB ; 8 - RBlt + blt GRout + bra GRouB ; 9 - RBge + bge GRout + bra GRouB ; 10- RBls + bls GRout + bra GRouB ; 11- RBhi + bhi GRout + bra GRouB ; 12- RBle + ble GRout + bra GRouB ; 13- RBpl + bpl GRout + bra GRouB ; 14- RBmi + bmi GRout + bra GRouD ; 15- RData / Ret_Inst +GRouMve move.l 0(a4),a0 +GRlea lea $0.l,a0 +CJsr jsr 0(a4) +CRts rts +CNop nop +; RJMP / RJSR +GRouJ cmp.b #C_CodeJ,2(a0) + beq.s .Rjsr + cmp.b #C_CodeT,2(a0) + bne GRou2 +; Rjsrt / Rjmpt + move.b 3(a0),d0 + cmp.b #8,d0 + bcc.s .Rlea + and.w #$0007,d0 + move.w d0,d1 + lsl.w #8,d1 + lsl.w #1,d1 + or.w GRouMve(pc),d1 Move.l X(a4),ax + move.w d1,(a0)+ + move.w 2(a0),d1 + lsl.w #2,d1 + add.w #LB_Size+4,d1 + neg.w d1 + move.w d1,(a0)+ + or.w 6(a1,d2.w),d0 Jsr/Jmp (ax) + move.w d0,(a0)+ + bra GRou1 +; Rlea +.Rlea subq.b #8,d0 + cmp.b #8,d0 + bcc GRou2 + lsl.w #8,d0 + lsl.w #1,d0 + or.w GRlea(pc),d0 + move.w d0,(a0) + move.w 4(a0),d0 + moveq #0,d1 + addq.l #6,a0 + bra.s .Qq +; Rjsr / Rjmp direct +.Rjsr moveq #0,d1 Transforme en JSR direct + move.b 3(a0),d1 + cmp.b #27,d1 Numero de l'extension + bcc GRou2 + move.w 4(a1,d2.w),(a0) + move.w 4(a0),d0 + addq.l #6,a0 + ext.w d1 +; Extension quelconque +.Qq lsl.w #2,d1 + lea AdTokens(a5),a1 + move.l 0(a1,d1.w),d1 + beq Ll_BadExt + move.l d1,a1 Adresse des tokens de l'extension + btst #LBF_20,LB_Flags(a3) + bne.s .New + bsr Ext_OldLabel Converti en ancien label + bne.s .AA + bra Ll_BadExt +.New cmp.w LB_NRout(a1),d0 Superieur au maximum? + bcc Ll_BadExt +.AA lsl.w #2,d0 + neg.w d0 + move.l -LB_Size-4(a1,d0.w),-4(a0) + bra GRou1 +; RBRA etc.. +GRouB move.w 2(a0),d0 + cmp.w d5,d0 + bcc GRou2 + lsl.w #2,d0 + move.w 4(a1,d2.w),(a0)+ + neg.w d0 + move.l -LB_Size-4(a3,d0.w),d0 + sub.l a0,d0 + cmp.l #-32766,d0 + ble Gfaux + cmp.l #32766,d0 + bge Gfaux + move.w d0,(a0)+ + bra GRou1 +; Instruction RDATA / Ret_Inst +GRouD cmp.w #C_CodeD,2(a0) + bne GRou2 + move.w CNop(pc),d0 + move.w d0,(a0)+ + move.w d0,(a0)+ + bra GRouN +; Fini, pas d'erreur +GRouX jsr Sys_ClearCache Nettoie les caches + moveq #0,d0 + bra Ll_Out +Gfaux illegal + +; Sortie des chargements/relocation +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ll_BadExt + moveq #2,d0 + bra.s Ll_Err +Ll_Disc moveq #1,d0 + bra.s Ll_Err +Ll_OMem moveq #2,d0 +Ll_Err +Ll_Out movem.l (sp)+,d2-d7/a2-a6 + rts + +; Retrouve le nouveau label a partir des anciens +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ext_OldLabel + movem.l a0/d1,-(sp) + lea Ext_Convert(pc),a0 + bra.s .In +.Loop cmp.w d0,d1 + beq.s .Ok + addq.l #4,a0 +.In move.w (a0),d1 + bne.s .Loop +.Out movem.l (sp)+,a0/d1 + rts +.Ok move.w 2(a0),d0 + bra.s .Out +; Table de conversion des labels AMOSPro 1.0 >>> AMOSPro 2.0 +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ext_Convert + dc.w 1024,L_Error + dc.w 1025,L_ErrorExt + dc.w 207,L_Test_PaSaut + dc.w 956,L_WaitRout + dc.w 287,L_GetEc + dc.w 46,L_Demande + dc.w 432,L_RamFast + dc.w 433,L_RamChip + dc.w 434,L_RamFast2 + dc.w 435,L_RamChip2 + dc.w 436,L_RamFree + dc.w 1100,L_Bnk.GetAdr + dc.w 1101,L_Bnk.GetBobs + dc.w 1102,L_Bnk.GetIcons + dc.w 1103,L_Bnk.Reserve + dc.w 1104,L_Bnk.Eff + dc.w 1105,L_Bnk.EffA0 + dc.w 1106,L_Bnk.EffTemp + dc.w 1107,L_Bnk.EffAll + dc.w 1234,L_Bnk.Change + dc.w 1121,L_Bnk.OrAdr + dc.w 1119,L_Dsk.PathIt + dc.w 1120,L_Dsk.FileSelector + dc.w 1122,L_Dev.Open + dc.w 1123,L_Dev.Close + dc.w 1124,L_Dev.GetIO + dc.w 1125,L_Dev.AbortIO + dc.w 1126,L_Dev.DoIO + dc.w 1127,L_Dev.SendIO + dc.w 1128,L_Dev.CheckIO + dc.w 1129,L_Dev.Error + dc.w 0,0 + +; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +; Relocation des recoltes de parametres +; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Library_GetParams +; - - - - - - - - - - - - - + movem.l d2-d7/a2-a6,-(sp) + moveq #0,d5 + lsl.w #2,d0 + beq.s .Skip + moveq #20,d5 Offset aux routines si ext +.Skip move.l AdTokens(a5,d0.w),d0 + beq Ll_Out + move.l d0,a6 Base des tokens explores + btst #LBF_20,LB_Flags(a6) Une librarie 2.0??? + beq .No20 NON! + + move.l AdTokens(a5),a4 Base des routines principales + JLea L_Parameters,a3 Routines de recolte + move.l a6,a2 + +; Exploration de la table de tokens +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + move.w (a2),d3 +.Loop +; move.l 4(a2),d0 +; cmp.l #"x mo",d0 +; bne.s .Skkk +; jsr BugBug +.Skkk + move.w 2(a2),d4 + beq.s .Next +; Une instruction? +; ~~~~~~~~~~~~~~~~ + move.w d4,d1 + and.w #%0000000000111111,d1 Nombre de parametres + move.w d1,2(a2) + btst #6,d4 + beq.s .NoIns + move.w d4,d2 + lea -LB_Size(a6,d3.w),a1 + moveq #0,d0 + bsr .Rout +.NoIns +; Une fonction? +; ~~~~~~~~~~~~~ + btst #7,d4 + beq.s .NoFunc + move.w 2(a2),d1 + move.w d4,d2 + lea -LB_Size-4(a6,d3.w),a1 + moveq #2,d0 + bsr .Rout +.NoFunc +; Suivante +; ~~~~~~~~ +.Next addq.l #4,a2 +.Ins tst.b (a2)+ + bpl.s .Ins +.Ins2 tst.b (a2)+ + bpl.s .Ins2 + move.l a2,d0 + and.w #$0001,d0 + add.w d0,a2 + move.w (a2),d3 + bne.s .Loop +.No20 moveq #0,d0 + bra Ll_Out + +; Branche la routine +; ~~~~~~~~~~~~~~~~~~~~~~~~ +.Rout and.w #$7000,d2 Isole le code + rol.w #4,d2 Pointe la table + lsl.w #1,d2 + jmp .Jmps(pc,d2.w) Branche a la routine +.Jmps bra.s .Entier 0 + bra.s .Float 1 + bra.s .FAngle 2 + bra.s .FMath 3 + bra.s .Var 4 +.Float tst.w d1 Des parametres? + beq.s .Exit + addq.w #6,d1 Float + cmp.w #6+6,d1 + bcs.s .Doke + moveq #6+5,d1 + bra.s .Doke +.IVar add.w #12,d1 Variable reservee en instruction + cmp.w #12+6,d1 + bcs.s .Doke + moveq #12+5,d1 + bra.s .Doke +.FAngle moveq #0,d0 + moveq #18,d1 Fonction angle + bra.s .Doke +.FMath moveq #0,d0 + moveq #19,d1 Fonction math + bra.s .Doke +.Var tst.w d0 Variable reservee en fonction + beq.s .IVar +.Entier tst.w d1 Des parametres? + beq.s .Exit + cmp.w #6,d1 Entier + bcs.s .Doke + moveq #5,d1 +; Doke l'adresse de la fonction +.Doke add.w d5,d1 Plus offset general aux routines + lsl.w #1,d1 Pointe la table des adresses + move.w 0(a3,d1.w),d1 Delta au debut + sub.w d0,d1 Moins ADDQ.L #2,a6 si fonction + ext.l d1 + add.l a3,d1 Plus debut + sub.l a4,d1 Moins base + move.l (a1),a0 Adresse de la routine + move.w CJsr(pc),d0 + cmp.l #"GetP",-(a0) Un espace pour parametres? + beq.s .Ok + cmp.w 4(a0),d0 Deja fait? + beq.s .Exit + illegal +.Ok move.w d0,(a0)+ Met le JSR + move.w d1,(a0)+ Doke le delta + subq.l #4,(a1) Recule la fonction +.Exit rts + +; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +; INITIALISATION D'UNE LIBRAIRIE +; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Library_Init +; - - - - - - - - - - - - - - - - + movem.l d2-d7/a2-a6,-(sp) + lea AdTokens(a5),a3 + move.w d0,d1 + lsl.w #2,d0 + move.l 0(a3,d0.w),d0 + beq Ll_Out + move.l d0,a3 + subq.w #1,d1 Extension= number-1 + move.w d1,-(sp) + move.l -LB_Size-4(a3),a0 Adresse routine #0 + move.l LB_Command(a3),a1 Command Line + move.l #"APex",d1 Magic + move.l #VerNumber,d2 Numero de version + jsr (a0) + move.w (sp)+,d3 + tst.w d0 Refuse de charger... + bpl.s .Nomi + cmp.l #"Asci",d1 Un Message? + bne Ll_BadExt + move.l a0,d0 Un message? + bra Ll_Mess Oui, +.Nomi ext.w d0 + cmp.w d0,d3 Bon numero d'extension? + bne Ll_BadExt + moveq #0,d0 + bra Ll_Out +Ll_Mess bra Ll_BadExt Illegal + + +; Passe ïż½ le prochaine instruction +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ll_TkNext + addq.l #4,a0 +.Loop1 tst.b (a0)+ + bpl.s .Loop1 +.Loop2 tst.b (a0)+ + bpl.s .Loop2 + move.w a0,d0 + and.w #$0001,d0 + add.w d0,a0 + rts + +; Erreurs lors du chargement +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +TheEnd_Badext + lea Panic_Badext(pc),a0 + bra.s TheEndM +TheEnd_APSystem + lea Panic_APSystem(pc),a0 + bra.s TheEndM +TheEnd_Cantread + lea Panic_Cantread(pc),a0 +TheEndM move.l a0,Panic + jmp TheEnd + +; Erreur avec datazone non rïż½servïż½e +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Boot_Fatal +; Libere amos.library s'il faut + move.l SP_DosBase(sp),a6 + move.l SP_WSegment(sp),d1 + beq.s .Skip + jsr _LVOUnLoadSeg(a6) +; Affiche le message d'erreur +.Skip move.l SP_DosBase(sp),a3 + move.l SP_IntBase(sp),a4 + move.l SP_Message(sp),d7 + jsr Panic_Message +; Ferme DOS / INTUITION + move.l $4.w,a6 + move.l SP_DosBase(sp),a1 + jsr _LVOCloseLibrary(a6) + move.l SP_IntBase(sp),a1 + jsr _LVOCloseLibrary(a6) +; On peut maintenant sortir! + move.l SP_Message(sp),d7 +; Va a la sortie generale! + jmp Get_Out + + +; Data initialisation +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Nom_W ds.b 32 +NDatas2 dc.b "s:" +NDatas1 dc.b "AMOSPro_Interpreter_Config",0 +NDatas3 dc.b "s/AMOSPro_Interpreter_Config",0 +LibName1 dc.b "libs:amos.library",0 +LibName2 dc.b "APSystem/amos.library",0 +LibName3 dc.b "libs/amos.library",0 +IconName: dc.b "icon.library",0 +FloatName: dc.b "mathffp.library",0 +IntName: dc.b "intuition.library",0 +GfxName: dc.b "graphics.library",0 + +AssInst dc.b "c:assign",0 +AssCall dc.b "c:assign ",0 +Ass0 dc.b "AMOSPro_System:",0 + dc.b 0 +Ass1 dc.b "AMOSPro_Accessories:",0 + dc.b "Accessories",0 +Ass2 dc.b "AMOSPro_Productivity1:",0 + dc.b "Productivity1",0 +Ass3 dc.b "AMOSPro_Productivity2:",0 + dc.b "Productivity2",0 +Ass4 dc.b "AMOSPro_Tutorial:",0 + dc.b "Tutorial",0 +Ass5 dc.b "AMOSPro_Examples:",0 + dc.b "Examples",0 +Ass6 dc.b "AMOSPro_Compiler:",0 + dc.b "Compiler",0 +Ass7 dc.b "AMOSPro_Extras:",0 + dc.b "Extras",0 +AssCon dc.b "NIL:",0 + +; Messages d'erreur d'alerte +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Panic_APSystem dc.b "Cannot find APSystem folder.",0 +Panic_Lib dc.b "Cannot find AMOS.library.",0 +Panic_Config dc.b "Cannot find AMOSPro_Interpreter_Config.",0 +Panic_Command dc.b "Bad command line.",0 +Panic_Cantread dc.b "Cannot read system files: check APSystem folder.",0 +Panic_Badext dc.b "Cannot load extension: use default interpreter config.",0 +Panic_Version dc.b "I need AMOS.library V2.0 or over!",0 + even + +; Adresses des routines accessibles aux extensions +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +AMOSJmps Include "+Internal_Jumps.s" diff --git a/+CEqu.s b/+CEqu.s new file mode 100644 index 0000000..c1e1310 --- /dev/null +++ b/+CEqu.s @@ -0,0 +1,224 @@ +;--------------------------------------------------------------------- +; *** *** ** ** **** **** ** ** ** ** ** *** *** +; ** ** ** *** *** ** ** ** ** ** **** *** *** ** ** ** +; ** ** ** ** * ** ** ** ** ** ** ** ** ** * ** ** ** *** +; ** ** ** ** ** **** ** ** ****** ** ** ** ** ** +; ** ** ** ** ** ** ** ** ** ** ** ** ** ** * ** +; *** *** ** ** ** **** **** ** ** ** ** *** *** +;--------------------------------------------------------------------- +; EQUATES +;--------------------------------------------------------------------- +; +; Published under the MIT Licence +; +; Copyright (c) 1992 Europress Software +; Copyright (c) 2020 Francois Lionet +; +; Permission is hereby granted, free of charge, to any person +; obtaining a copy of this software and associated documentation +; files (the "Software"), to deal in the Software without +; restriction, including without limitation the rights to use, +; copy, modify, merge, publish, distribute, sublicense, and/or +; sell copies of the Software, and to permit persons to whom the +; Software is furnished to do so, subject to the following +; conditions: +; +; The above copyright notice and this permission notice shall be +; included in all copies or substantial portions of the Software. +; +; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +; EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +; OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +; NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +; HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +; WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +; ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR +; THE USE OR OTHER DEALINGS IN THE SOFTWARE. +; +;--------------------------------------------------------------------- +C_Code1 equ $FE +C_Code2 equ $01 +C_CodeD equ $6543 +C_CodeInst equ $6545 +C_CodeJ equ $F7 +C_CodeT equ $F5 + +CiJSR equ $4EB9 +CiJMP equ $4EF9 +CodeR equ $8F + +Ret_Int MACRO + moveq #0,d2 + rts + ENDM +Ret_Float MACRO + moveq #1,d2 + rts + ENDM +Ret_String MACRO + moveq #2,d2 + rts + ENDM + +Rjmpt MACRO + dc.b C_Code1,0*16+C_Code2 + dc.b C_CodeT,0 + dc.w \1 + ENDM +Rjsrt MACRO + dc.b C_Code1,1*16+C_Code2 + dc.b C_CodeT,0 + dc.w \1 + ENDM +RjsrtR MACRO + dc.b C_Code1,1*16+C_Code2 + dc.b C_CodeT,\2 + dc.w \1 + ENDM +RjmptR MACRO + dc.b C_Code1,0*16+C_Code2 + dc.b C_CodeT,\2 + dc.w \1 + ENDM +Rlea MACRO + dc.b C_Code1,1*16+C_Code2 + dc.b C_CodeT,8+\2 + dc.w \1 + ENDM +Rjmp MACRO + dc.b C_Code1,0*16+C_Code2 + dc.b C_CodeJ,0 + dc.w \1 + ENDM +Rjsr MACRO + dc.b C_Code1,1*16+C_Code2 + dc.b C_CodeJ,0 + dc.w \1 + ENDM +Ljmp MACRO + dc.b C_Code1,0*16+C_Code2 + dc.b C_CodeJ,\2 + dc.w \1 + ENDM +Ljsr MACRO + dc.b C_Code1,1*16+C_Code2 + dc.b C_CodeJ,\2 + dc.w \1 + ENDM +Rbra MACRO + dc.b C_Code1,2*16+C_Code2 + dc.w \1 + ENDM +Rbsr MACRO + dc.b C_Code1,3*16+C_Code2 + dc.w \1 + ENDM +Rbeq MACRO + dc.b C_Code1,4*16+C_Code2 + dc.w \1 + ENDM +Rbne MACRO + dc.b C_Code1,5*16+C_Code2 + dc.w \1 + ENDM +Rbcs MACRO + dc.b C_Code1,6*16+C_Code2 + dc.w \1 + ENDM +Rbcc MACRO + dc.b C_Code1,7*16+C_Code2 + dc.w \1 + ENDM +Rblt MACRO + dc.b C_Code1,8*16+C_Code2 + dc.w \1 + ENDM +Rbge MACRO + dc.b C_Code1,9*16+C_Code2 + dc.w \1 + ENDM +Rbls MACRO + dc.b C_Code1,10*16+C_Code2 + dc.w \1 + ENDM +Rbhi MACRO + dc.b C_Code1,11*16+C_Code2 + dc.w \1 + ENDM +Rble MACRO + dc.b C_Code1,12*16+C_Code2 + dc.w \1 + ENDM +Rbpl MACRO + dc.b C_Code1,13*16+C_Code2 + dc.w \1 + ENDM +Rbmi MACRO + dc.b C_Code1,14*16+C_Code2 + dc.w \1 + ENDM +Rdata MACRO + dc.b C_Code1,15*16+C_Code2 + dc.w C_CodeD + ENDM +Ret_Inst MACRO + rts +; dc.b C_Code1,15*16+C_Code2 +; dc.w C_CodeInst + ENDM +;Alea MACRO +; move.l a5,\2 +; add.w A\1(a5),\2 +; ENDM +* +GfxC MACRO + movem.l d0-d7/a0-a6,-(sp) + move.l T_GfxBase(a5),a6 + jsr \1(a6) + movem.l (sp)+,d0-d7/a0-a6 + ENDM + +Hunk_Public equ 0 +Hunk_Chip equ $40000000 + +N_HunkLib equ 1 Nombre de hunks amos.library +N_HunkSys equ 9 Nombre de hunks systeme + +NH_Header equ 0 Le header +NH_Prog equ 1 Le programme +NH_Libraries equ 2 Les librairies +NH_Reloc equ 3 La relocation +NH_amoslib equ 4 amos.library +NH_Mouse equ 5 La mouse.abk +NH_Env equ 6 L'environement +NH_DefaultBank equ 7 La banque par defaut +NH_ErrorMessage equ 8 Les messages d'erreur +NH_Banks equ 9 Debut des banques + +FHead_Run equ 0 +FHead_Short equ 1 +FHead_PRun equ 2 +FHead_Backed equ 3 + +FPrg_DefRunAcc equ 0 +FPrg_Default equ 1 +FPrg_Wb equ 2 + +; Zone de sauvegarde des donnïż½es short-run +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + RsReset +Short_Name rs.b 128 +Short_Path rs.b 256 +Short_Command rs.b 256 +Short_Save equ __RS + +; Header procedure compilee +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + RsReset +APrg_MathFlags rs.w 1 0 +APrg_Relocation rs.l 1 2 +APrg_EndProc rs.l 1 6 +APrg_OldReloc rs.l 1 10 + rs.b 16-__RS Jusqu'ïż½ 16 +APrg_Program equ __RS +;--------------------------------------------------------------------- diff --git a/+Debug.s b/+Debug.s new file mode 100644 index 0000000..8996eb2 --- /dev/null +++ b/+Debug.s @@ -0,0 +1,32 @@ +;--------------------------------------------------------------------- +; +; Published under the MIT Licence +; +; Copyright (c) 1992 Europress Software +; Copyright (c) 2020 Francois Lionet +; +; Permission is hereby granted, free of charge, to any person +; obtaining a copy of this software and associated documentation +; files (the "Software"), to deal in the Software without +; restriction, including without limitation the rights to use, +; copy, modify, merge, publish, distribute, sublicense, and/or +; sell copies of the Software, and to permit persons to whom the +; Software is furnished to do so, subject to the following +; conditions: +; +; The above copyright notice and this permission notice shall be +; included in all copies or substantial portions of the Software. +; +; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +; EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +; OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +; NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +; HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +; WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +; ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR +; THE USE OR OTHER DEALINGS IN THE SOFTWARE. +; +;--------------------------------------------------------------------- +; No Debugging! +; ~~~---~~~~~~~ +Debug set 0 diff --git a/+Edit.s b/+Edit.s new file mode 100644 index 0000000..be8f5b5 --- /dev/null +++ b/+Edit.s @@ -0,0 +1,15408 @@ +; ______________________________________________________________________________ +; .............................................................................. +; ...................................................................2222222.... +; ................................................................22222222220... +; ...................................................222........222222.....222.. +; ..............................................2202222222222..22000............ +; ..................................22000.....20222222222200000200002........... +; .................................2002202...2222200222.220000000200000000022... +; ....................220002......22222200..2200002.......2200000...20000000000. +; ....................22222202....2220000022200000..........200002........200000 +; .....200000.........2222200000222200220000000002..........200002........20000. +; .....00222202........2220022000000002200002000002........2000002000020000000.. +; ....2222200000.......220002200000002.2000000000000222222000000..2000000002.... +; ....220000200002......20000..200002..220000200000000000000002.......22........ +; ...2220002.2200002....220002...22.....200002..0000000000002................... +; ...220000..222000002...20000..........200000......2222........................ +; ...000000000000000000..200000..........00002.................................. +; ..220000000022020000002.200002.........22.......______________________________ +; ..0000002........2000000220022.................| +; .200000............2002........................| Editor +; .200002........................................| Modif +; 220002.........................................|______________________________ +; ______________________________________________________________________________ +; +; Published under the MIT Licence +; +; Copyright (c) 1992 Europress Software +; Copyright (c) 2020 Francois Lionet +; +; Permission is hereby granted, free of charge, to any person +; obtaining a copy of this software and associated documentation +; files (the "Software"), to deal in the Software without +; restriction, including without limitation the rights to use, +; copy, modify, merge, publish, distribute, sublicense, and/or +; sell copies of the Software, and to permit persons to whom the +; Software is furnished to do so, subject to the following +; conditions: +; +; The above copyright notice and this permission notice shall be +; included in all copies or substantial portions of the Software. +; +; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +; EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +; OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +; NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +; HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +; WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +; ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR +; THE USE OR OTHER DEALINGS IN THE SOFTWARE. +; +; ______________________________________________________________________________ + Include "+Debug.s" + IFEQ Debug=2 + Include "+AMOS_Includes.s" + Include "+Version.s" + ENDC +;_____________________________________________________________________________ + + +; Branchements internes ïż½ l'editeur +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +EDebut dc.l Ed_Cold-EDebut + dc.l Ed_Title-EDebut + dc.l Ed_End-EDebut + dc.l Ed_Loop-EDebut + dc.l Ed_ErrRun-EDebut + dc.l Ed_CloseEditor-EDebut + dc.l Ed_KillEditor-EDebut + dc.l Ed_ZapFonction-EDebut + dc.l Ed_ZapIn-EDebut + dc.l Ed_RunDirect-EDebut + dc.l Tokenise-EDebut + dc.l Detok-EDebut + dc.l Mon_Detok-EDebut + dc.l TInst-EDebut + dc.l 0 + +; ______________________________________________________________________________ + +Ed_AutoMarksNb equ 4 +;______________________________________________________________________________ +; +Ed_SlHDeltaG equ -2 +Ed_SlHDeltaD equ 1 +Ed_SlHDeltaH equ 2 +Ed_SlHSy equ 2 +Ed_SlVDeltaG equ 6 +Ed_SlVDeltaH equ 11 +Ed_SlVSx equ 4 +Ed_SlVDeltaB equ -1 +Ed_SlHDy equ 2 +Ed_SlVDx equ 4 + +Ed_ZBoutons equ 1000 +Ed_XScrollG equ 20 +Ed_XScrollD equ 10 +Ed_YScrollH equ 4 +Ed_YScrollB equ 4 + +Ed_YTop equ 0 +Ed_TitreSy equ 16 +Edt_EtatSy equ 11 +Edt_BasSy equ 5 +Edt_BtSx equ 24 + +; Images dans la banque +; ~~~~~~~~~~~~~~~~~~~~~ +Ed_Pics equ 1 +Ed_BtPics equ Ed_Pics+4 +Ed_BoutonsPics equ Ed_BtPics+2*3 +Ed_MemoryPics equ Ed_BoutonsPics+2*12 +Es_Pics equ Ed_MemoryPics+3 +Es_BoutonsPics equ Es_Pics+3 + +Ed_LogoSx equ 32*5 +Ed_MemorySy equ 2 +Ed_MemoryY1 equ Ed_YTop+3 +Ed_MemoryY2 equ Ed_YTop+10 +; Gros boutons +; ~~~~~~~~~~~~ +Ed_BoutonsSx equ 32 +Ed_BoutonsSy equ 16 +Ed_TitleSx equ Ed_BoutonsSx*5 +Ed_BoutonsX equ Ed_BoutonsSx+Ed_TitleSx +Ed_BoutonsY equ Ed_YTop +Ed_BoutonsZones equ 128 + +; Boutons Escape +; ~~~~~~~~~~~~~~ +Es_BoutonsSx equ 32 +Es_BoutonsSy equ 16 +Es_BoutonsZones equ 1 +Es_TitleSx equ Es_BoutonsSx*4 +Es_TitleSy equ 16 +Es_BoutonsX equ Es_BoutonsSx+Es_TitleSx +Es_BoutonsY equ 0 +Es_MiniSy equ Es_TitleSy+8 + +; Nombre maximum de programme hidden dans le menu +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +EdM_HiddenMax equ 12 + +; Numero du bouton ESCAPE +; ~~~~~~~~~~~~~~~~~~~~~~~ +Bt_Insert equ 10 + +; Messages +; ~~~~~~~~ +Ed_Mes equ 0 Debut des messages editeur + +Ed_DiaImages equ 66 Debut des images dialogue dans la banque +; IfEQ ROnly + +;______________________________________________________________________________ +; +; Initialisation de l'editeur +;______________________________________________________________________________ +; +Ed_Cold + clr.b Ed_Ok(a5) Pas en etat de marche! + bsr Ed_Available + cmp.l #50*1024,d1 Au moins 50k de CHIP + bcs.s .Mem + cmp.l #110*1024,d0 Au moins 110k de memoire en tout! + bcs.s .Mem + +; Warm ou Cold? +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + tst.b Ed_Warm(a5) + bne.s .UnKill +; Chargement vraiment ïż½ froid +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + bsr Ed_LoadAllConfig Charge les fichiers + bne.s .Err + bsr Ed_Computee Des fenetres vides + bne.s .Err + bsr Ed_OpenEditor Ouvre l'editeur + bne.s .Err + move.b #1,Ed_Warm(a5) Flag change! + move.w #-1,EsFlag(a5) Force appear + clr.w Direct(a5) Pas mode direct + moveq #0,d0 Pas d'erreur + rts +; Chargement apres un KILL EDITOR +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.UnKill bsr Ed_LoadAllConfig Recharge les configs + bne.s .Err + moveq #0,d0 + rts +; Une erreur +; ~~~~~~~~~~ +.Mem moveq #1,d0 +.Err move.l d0,-(sp) + bsr Ed_CloseEditor + bsr Ed_FreeAllConfig + move.l (sp)+,d0 + rts + +; Apparition du titre de l'editeur +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_Title + bsr Ed_Appear + bsr Ed_WarmStart Un Warmstart? + moveq #"A",d0 + bsr Ed_SamPlay Bonjour! + bsr Ed_About Titre + bsr Ed_Loca Curseur + rts + +; Fenetres d'origines dïż½ja computïż½es? +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_Computee + move.l Prg_List(a5),d0 + move.l Edt_List(a5),a4 + move.w #2,Ed_WMax(a5) Par default, au moins +.Loop move.l d0,a6 + tst.b Prg_Edited(a6) + bne.s .Deja + moveq #-1,d0 Visible + moveq #-1,d1 Pas de structure PRG + bsr Edt_OpWindow Va ouvrir >>> fenetre courante + bne.s .Err + move.l a6,Edt_Prg(a4) + addq.b #1,Prg_Edited(a6) +.Deja move.l Prg_Next(a6),d0 + bne.s .Loop + moveq #0,d0 + rts +.Err moveq #1,d0 Out of memory! + rts + +; Effacement de tous les fichiers de config +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_FreeAllConfig + bsr Ed_SamEnd Les sons + bsr EdMa_End Les macros + bsr EdC_Free Les configs + bsr Ed_ResourceFree La resource + rts +; Chargement de tous les fichiers de config +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_LoadAllConfig +; Charge la configuration de l'editeur +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + moveq #7,d0 + JJsr L_Sys_GetMessage + JJsrR L_Sys_AddPath,a1 + bsr EdC_Load + bne.s .Err +; Charge la banque de resource +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + moveq #45,d0 + bsr Ed_GetSysteme + JJsrR L_Sys_AddPath,a1 + bsr Ed_ResourceLoad + bne.s .Err +; Charge les macros par defaut +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + moveq #46,d0 + bsr Ed_GetSysteme + JJsrR L_Sys_AddPath,a1 + bsr EdMa_Load + bne.s .Err +; Charge les sons par defaut +; ~~~~~~~~~~~~~~~~~~~~~~~~~~ + bsr Ed_SamChanged + moveq #0,d0 +.Err rts + + +;______________________________________________________________________________ +; +; Fin +;______________________________________________________________________________ +; +Ed_System + JJmp L_TheEnd +Ed_End tst.b Ed_Ok(a5) Systeme installe? + beq.s .Skip + bsr Edt_DelWindows Enleve les fenetres +.Skip lea Ed_Prg2ReLoad(a5),a0 Programme a recharger + bsr Ed_MemFree + bsr Ed_CloseEditor Ferme l'editeur + bsr Ed_FreeAllConfig Delete les configs + rts + +;______________________________________________________________________________ +; +; CLOSE/OPEN EDITOR +;______________________________________________________________________________ +; + +Ed_OpenEditor + movem.l d1-d7/a0-a6,-(sp) + tst.b Ed_Opened(a5) + bne.s .Ok + + bsr Ed_OpenIt Premier essai + beq.s .Ok + + bsr Ed_CloseIt Out of mem, on efface + bsr EdM_Program Menus du programme + move.l Edt_Current(a5),a4 + move.l Edt_Prg(a4),a6 + JJsr L_Prg_SetBanks Change les banques + JJsr L_MemMaximum Nettoie au maximum! + + bsr Ed_OpenIt Deuxieme essai! + beq.s .Ok + bsr Ed_CloseIt + bsr EdM_Program + move.l Edt_Current(a5),a4 + move.l Edt_Prg(a4),a6 + JJsr L_Prg_SetBanks Change les banques + JJsr L_MemDelBanks Ligne: effacer les banques? + beq Ed_System NON: on sort! + JJsr L_Bnk.EffAll Efface toutes les banques + JJsr L_Bnk.Change Changement de banques + + bsr Ed_OpenIt + beq.s .Ok + bsr Ed_CloseIt + moveq #1,d0 Out of mem + bra.s .Out +.Ok move.b #1,Ed_Opened(a5) Flag! + moveq #0,d0 C'est bon! +.Out movem.l (sp)+,d1-d7/a0-a6 + rts + +; Routine d'ouverture de l'editeur... +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_OpenIt + bsr Ed_SetBanks + bsr EdM_Editor +; Verification de la taille des fenetres / Config +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + tst.b EdC_Modified(a5) + beq .ModX + clr.b EdC_Modified(a5) + move.l Edt_Current(a5),d0 Des fenetres? + beq .ModX +; Verification de la taille en Y + move.l d0,a4 Fenetre courante + moveq #-1,d0 Sans toucher les autres + bsr Edt_WMaxSize + cmp.w Edt_WindTy(a4),d0 Pareil? + beq.s .Mod5 + moveq #0,d0 Reduit les autres + bsr Edt_WSchrinkAll + moveq #-1,d0 + bsr Edt_WMaxSize Taille maxi acceptable + move.w d0,Edt_WindTy(a4) + bgt .Mod5 Ok! +.Mod2 move.w #1,Edt_WindTy(a4) Taille mini! + moveq #Ed_TitreSy,d1 Compte la taille necessaire! + move.l Edt_List(a5),d0 Toute la liste +.Mod3 move.l d0,a0 + tst.b Edt_Hidden(a0) Deja cachee + bne.s .Mod4 + add.w #Edt_EtatSy+Edt_BasSy,d1 + move.w Edt_WindTy(a0),d0 + lsl.w #3,d0 + add.w d0,d1 +.Mod4 move.l Edt_Next(a0),d0 + bne.s .Mod3 + move.w d1,Ed_Sy(a5) Change la config!!!! +; Verification de la position du curseur en X +.Mod5 move.w Ed_Sx(a5),d1 Derniere limite curseur + lsr.w #3,d1 + subq.w #3,d1 + move.l Edt_List(a5),d0 Toute la liste +.Mod6 move.l d0,a0 + tst.b Edt_Hidden(a0) Deja cachee + bne.s .Mod7 + move.w Edt_XCu(a0),d0 + cmp.w d1,d0 + bcs.s .Mod7 + move.w d1,Edt_XCu(a0) + sub.w d1,d0 + add.w d0,Edt_XPos(a0) +.Mod7 move.l Edt_Next(a0),d0 + bne.s .Mod6 +.ModX + bsr EdC_SetPalette Update de la palette + + moveq #EcFonc,d0 Ouverture de l'ecran de fonctions + move.w Ed_Sx(a5),d1 + ext.l d1 + moveq #Es_TitleSy,d2 + moveq #0,d3 + move.l Ed_Resource(a5),a0 + add.l 2(a0),a0 + moveq #0,d4 + JJsrR L_Dia_RScOpen,a1 + bne .Error + bset #BitHide,EcFlags(a0) + move.w Ed_Wx(a5),EcAWX(a0) + moveq #20,d1 + SyCall ResZone + bne .Error + + moveq #EcEdit,d0 Ouverture de l'ecran principal + move.w Ed_Sx(a5),d1 + ext.l d1 + move.w Ed_Sy(a5),d2 + addq.w #7,d2 + and.w #$FFF8,d2 + move.w d2,d3 + sub.w #16,d3 + sub.w #Ed_YTop,d3 + lsr.w #3,d3 + move.w d3,Ed_Ty(a5) + ext.l d2 + moveq #1,d3 + moveq #0,d4 Interlaced? + move.b Ed_Inter(a5),d4 + move.l Ed_Resource(a5),a0 + add.l 2(a0),a0 + JJsrR L_Dia_RScOpen,a1 + bne.s .Error + bset #BitHide,EcFlags(a0) + move.w Ed_Wx(a5),EcAWX(a0) + move.w Ed_Wy(a5),EcAWY(a0) + moveq #10,d0 + bsr Et_Print + + move.w Ed_Ty(a5),d0 Buffer d'edition + mulu #256,d0 + SyCall MemFast + move.l a0,Ed_BufE(a5) + beq .Error + + moveq #0,d0 Nombre maximum de programmes + move.w Ed_Ty(a5),d0 + subq.w #6,d0 + divu #3,d0 + move.w d0,Ed_WMax(a5) + + jsr Tok_Init Les tables de tokenisation + bne.s .Error + bsr Ed_InitDialogues Les dialogues + bne.s .Error + bsr EdM_Init Cree les menus + bne.s .Error + bsr Prg_CreateUndos Les buffers UNDOS de programmes + +; Pas d'erreur + clr.b EdC_Modified(a5) Config adaptee... + moveq #0,d0 Pas d'erreur! + rts +; Out of memory +.Error moveq #1,d0 Out of memory + rts + + +; Fermeture generale de l'editeur +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_KillEditor + bsr Ed_CloseEditor Plus rien + bsr Ed_FreeAllConfig Plus aucune configuration + clr.b Ed_Ok(a5) Plus en etat de marche... + rts + +; Fermeture de l'ïż½diteur +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_CloseEditor + tst.b Ed_Opened(a5) + beq.s .Skip + clr.b Ed_Opened(a5) + movem.l d0-d7/a0-a6,-(sp) + bsr Ed_CloseIt + movem.l (sp)+,d0-d7/a0-a6 +.Skip rts + +; Routine de fermeture.. +; ~~~~~~~~~~~~~~~~~~~~~~ +Ed_CloseIt + bsr Ed_SetBanks Banques de l'editeur + bsr Prg_FreeUndos Plus de buffer UNDOS + bsr Esc_KMemEnd Plus de touches de mode direct + bsr Ed_AllAverFin Plus d'avertissement + bsr Ed_BlocFree Plus de bloc + bsr EdM_End Plus de menus + bsr Ed_EndDialogues Plus de dialogues + bsr Edt_DelAllZones Plus de zones de fenetres + EcCalD Del,EcEdit Plus d'ecrans + EcCalD Del,EcFonc + jsr Tok_Del Plus de tokenisation + move.l Ed_BufE(a5),d0 Plus de buffer d'edition + beq.s .Skip + clr.l Ed_BufE(a5) + move.l d0,a1 + move.w Ed_Ty(a5),d0 + mulu #256,d0 + SyCall MemFree +.Skip rts + +; Retourne la memoire libre dans la machine +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_Available + movem.l a0/a1/a6,-(sp) + move.l $4.w,a6 + move.l #Public|Fast,d1 + jsr _LVOAvailMem(a6) + move.l d0,d2 + move.l #Public|Chip,d1 + jsr _LVOAvailMem(a6) + move.l d0,d1 + add.l d2,d0 + movem.l (sp)+,a0/a1/a6 + rts + +;______________________________________________________________________________ +; +; WARM START Charge le fichier / Prepare l'editeur +;______________________________________________________________________________ +; +Ed_WarmStart +; Fichier "Last Cession" present? + moveq #47,d0 + bsr Ed_GetSysteme + JJsrR L_Sys_AddPath,a1 + JJsr L_RExist + beq .Out +; Message + move.w #159,d0 + bsr Ed_AverMess +; Efface la premiere fenetre systeme + move.l Edt_List(a5),d0 + beq.s .No1 + move.l d0,a4 + bsr Edt_DelWindow +.No1 +; PHASE 1: re-creation des listes +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + move.l #1005,d2 Ouvre le fichier + bsr Ed_Open + beq .Err1 +; Verifie l'entete + move.l Buffer(a5),a3 + move.l a3,d2 + moveq #8,d3 + bsr Ed_Read + bne .Err0 + cmp.l #Ed_QuitHead,(a3) + bne .Err0 +; Charge dans un buffer + move.l 4(a3),d0 Taille necessaire + JJsr L_ResTempBuffer + beq .Err0 + move.l a0,d2 + move.l 4(a3),d3 + bsr Ed_Read + bne .Err0 + bsr Ed_Close +; Trouve les structures + move.l TempBuffer(a5),a6 A6= Structures programmes + move.l a6,a4 A4= Structures edition + moveq #-8,d0 +.GLoop lea 8(a4,d0.l),a4 + move.l 4(a4),d0 + tst.l (a4)+ + bne.s .GLoop +; Recree la liste PRG + lea Prg_List(a5),a2 + move.l a6,a3 +.PCree move.l #Prg_Long,d0 Reserve la memoire + SyCall MemFastClear + beq .Err + move.l a0,Prg_Next(a2) Branche dans la liste + move.l a0,a2 + move.l a0,8(a3) Stocke l'adresse + moveq #Prg_Long/2-1,d0 + lea 12(a3),a1 +.PCop move.w (a1)+,(a0)+ Copie les datas + dbra d0,.PCop + move.l Prg_StTTexte(a2),Prg_StBas(a2) + clr.l Prg_StTTexte(a2) + clr.l Prg_Dialogs(a2) Erase donnees importantes! + clr.l Prg_Banks(a2) + clr.l Prg_Undo(a2) + clr.l Prg_AdEProc(a2) + clr.l Prg_ZapData(a2) + clr.l Prg_RunData(a2) + clr.l Prg_Previous(a2) + move.l 4(a3),d0 Encore un? + lea 12(a3,d0.l),a3 + tst.l (a3) + bne.s .PCree +; Recree la liste EDT + lea Edt_List(a5),a2 + move.l a4,a3 +.ECree move.l #Edt_Long,d0 Reserve la memoire + SyCall MemFastClear + beq .Err + move.l a0,Edt_Next(a2) Branche dans la liste + move.l a0,a2 + move.l a0,8(a3) Change le pointeur + moveq #Edt_Long/2-1,d0 + lea 12(a3),a1 +.ECop move.w (a1)+,(a0)+ Copie les datas + dbra d0,.ECop + move.l 4(a3),d0 Encore un? + lea 12(a3,d0.l),a3 + tst.l (a3) + bne.s .ECree +; Relinke les fenetres + move.l Edt_List(a5),a3 +.LLoop lea Edt_Prg(a3),a0 Structure programme + move.l a6,a1 Explorer les programmes + bsr .Linke + lea Edt_LinkPrev(a3),a0 Link previous + move.l a4,a1 + bsr .Linke + lea Edt_LinkNext(a3),a0 Link next + move.l a4,a1 + bsr .Linke + lea Edt_LinkScroll(a3),a0 Link de scroll + move.l a4,a1 + bsr .Linke + tst.w Edt_Order(a3) Programme courant? + beq.s .Pac + move.l a3,Edt_Current(a5) +.Pac move.l Edt_Next(a3),d0 + move.l d0,a3 + bne.s .LLoop +; On peut effacer le buffer! + moveq #0,d0 + JJsr L_ResTempBuffer + +; PHASE 2 : recharge tous les programmes +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + move.l Prg_List(a5),a6 +.CLoop lea Prg_NamePrg(a6),a0 Recopie le nom + move.l Name1(a5),a1 + bsr EdCocop + move.l Prg_StBas(a6),d0 Change la taille du buffer + JJsr L_Prg_ChgTTexte + beq .Err + moveq #1,d0 Charge sans adapter + JJsr L_Prg_Load + bne .Err + tst.b Prg_NoNamed(a6) Enleve le nom si necessaire + beq.s .Name + clr.b Prg_NamePrg(a6) + clr.b Prg_NoNamed(a6) + move.b #1,Prg_Change(a6) Force une sauvegarde si close... + move.l a6,-(sp) + move.l Name1(a5),d1 Efface, si possible + move.l DosBase(a5),a6 Sans verification... + jsr _LVODeleteFile(a6) + move.l (sp)+,a6 +.Name move.l Prg_Next(a6),d0 + move.l d0,a6 + bne.s .CLoop + +; TERMINE: efface le fichier, puis raffiche les fenetres +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + bsr .DelFichier + bsr Prg_CreateUndos + bsr EdM_BranchAMOS + bsr Ed_DrawWindows +.Out rts + + +; Destruction du fichier d'informations +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.DelFichier + bsr Ed_Close + moveq #47,d0 + bsr Ed_GetSysteme + JJsrR L_Sys_AddPath,a1 + move.l Name1(a5),d1 + move.l DosBase(a5),a6 + jsr _LVODeleteFile(a6) + tst.l d0 + beq.s .DelPa + rts +.DelPa moveq #EdD_WarmDel,d0 + bsr Ed_Dialogue + cmp.w #1,d0 + beq.s .DelFichier +; Efface tout, puis FATAL! + bsr .Err + bra Ed_System + +; Change les pointeurs de fenetre +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.Linke move.l (a0),d0 + beq.s .PoX +.PoL cmp.l (a1),d0 + beq.s .PoF + move.l 4(a1),d1 + lea 12(a1,d1.w),a1 + tst.l (a1) + bne.s .PoL +.PoF move.l 8(a1),(a0) +.PoX rts + +; Erreur pendant le rechargement: efface tout! +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.Err +; Les programmes + move.l Prg_List(a5),d6 + bra.s .EPrg1 +.EPrg0 move.l d6,a6 + move.l Prg_Next(a6),d6 Stocke le suivant + moveq #0,d0 Buffer eventuellement reserve + JJsr L_Prg_ChgTTexte + move.l Prg_Banks(a6),Cur_Banks(a5) + JJsr L_Bnk.EffAll Banques eventuellement reservees + move.l a6,a1 Libere la memoire + move.l #Prg_Long,d0 + SyCall SyFree +.EPrg1 tst.l d6 Encore un? + bne.s .EPrg0 + clr.l Prg_List(a5) +; Les fenetres + move.l Edt_List(a5),d4 + bra.s .EEdt1 +.EEdt0 move.l d4,a4 + move.l Edt_Next(a4),d4 Stocke le suivant + move.l a4,a1 Libere la memoire + move.l #Edt_Long,d0 + SyCall SyFree +.EEdt1 tst.l d4 Encore un? + bne.s .EEdt0 + clr.l Edt_List(a5) +; Va effacer le fichier +.Err1 bsr .DelFichier +; Ferme le fichier courant +.Err0 bsr Ed_Close Ferme le fichier + moveq #0,d0 Efface le buffer + JJsr L_ResTempBuffer +; ROuvre la premiere fenetre + clr.l Edt_Current(a5) + moveq #-1,d0 Visible + move.l PI_DefSize(a5),d1 Taille + sub.l a4,a4 Pas de fenetre courante + bsr Edt_OpWindow + bsr EdM_BranchAMOS + bsr Ed_DrawWindows +; Boite de dialogue + moveq #EdD_WarmErr,d0 + bsr Ed_Dialogue + rts + +;______________________________________________________________________________ +; +; Dessin du titre +;______________________________________________________________________________ +; +Ed_DrawTop + + movem.l a2/d2-d7,-(sp) + +; +; Reserve les zones +; ~~~~~~~~~~~~~~~~~ + move.l #Ed_BoutonsZones+15,d1 + SyCall ResZone + move.w Ed_Sx(a5),d7 + +; Unpack le logo AMOS +; ~~~~~~~~~~~~~~~~~~~ + moveq #Ed_Pics,d0 + moveq #Ed_BoutonsSx,d1 + moveq #Ed_YTop,d2 + bsr Ed_Unpack + sub.w #Ed_TitleSx,d7 +; +; Cree les 12 boutons +; ~~~~~~~~~~~~~~~~~~~ + lea Ed_Boutons(a5),a2 + move.w #Ed_BoutonsX,d2 + moveq #Ed_BoutonsY,d3 + moveq #Ed_BoutonsPics,d4 + move.w #Ed_BoutonsZones,d5 + moveq #1,d6 +.Loop move.w d6,Bt_Number(a2) + cmp.w #1,d6 + bne.s .Pa1 + clr.w Bt_X(a2) Bouton DIRECT + bra.s .PaB +.Pa1 cmp.w #2,d6 + bne.s .Pa2 + move.w Ed_Sx(a5),Bt_X(a2) Bouton WB + sub.w #Ed_BoutonsSx,Bt_X(a2) + bra.s .PaB +.Pa2 move.w d2,Bt_X(a2) + add.w #Ed_BoutonsSx,d2 +.PaB move.w d3,Bt_Y(a2) + move.w d4,Bt_Image(a2) + move.w d5,Bt_Zone(a2) + lea Bt_RoutIn(pc),a0 + move.l a0,Bt_Routines(a2) + move.b #6,Bt_RDraw(a2) + clr.b Bt_RPos(a2) + clr.b Bt_RChange(a2) + clr.b Bt_Flags(a2) + clr.w Bt_Pos(a2) + cmp.w #Bt_Insert,d6 Bouton INSERT? + bne.s .PaI + bset #Bt_FlagOnOf,Bt_Flags(a2) + tst.b Ed_Insert(a5) + bne.s .PaI + move.w #1,Bt_Pos(a2) +.PaI move.b #Ed_BoutonsSx,Bt_Sx(a2) + move.b #Ed_BoutonsSy,Bt_Sy(a2) + addq.w #2,d4 + addq.w #1,d5 + move.l a2,a0 + moveq #1,d0 + JJsrR L_Bt_Init,a1 + sub.w #Ed_BoutonsSx,d7 + lea Bt_Long(a2),a2 + addq.w #1,d6 + cmp.w #12,d6 + bls .Loop + clr.w (a2) + +; Dessine les sliders de memoire +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + move.w d2,d1 + moveq #Ed_YTop,d2 + move.w d7,d3 + lea Ed_Unpack(pc),a2 + bsr Ed_MemoryDraw + bsr Ed_MemoryAff + +; Fini! +; ~~~~~ + movem.l (sp)+,a2/d2-d7 + rts + +; Dessine les sliders de memoire +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +; D1= X +; D2= Y +; D3= Largeur +; A2= Adresse UNPACK +Ed_MemoryDraw + move.w d3,d0 + sub.w #Ed_BoutonsSx+7,d0 + move.w d0,Ed_MemorySx(a5) + + moveq #Ed_MemoryPics,d0 La gauche + jsr (a2) + add.w #Ed_BoutonsSx,d1 + move.w d1,Ed_MemoryX(a5) + + divu #Ed_BoutonsSx,d3 + subq.w #2+1,d3 +.Loop moveq #Ed_MemoryPics+1,d0 + jsr (a2) + add.w #Ed_BoutonsSx,d1 + dbra d3,.Loop + moveq #Ed_MemoryPics+2,d0 + jmp (a2) + +; Dessine le contenu des sliders de memoire. +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_MemoryAff + move.l a6,-(sp) + move.l $4.w,a6 +; Dessin du slider de CHIP MEM +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + move.l #Chip|Public,d1 + jsr _LVOAvailMem(a6) + move.l d0,-(sp) + move.l MemChipTotal(a5),d4 + move.l d4,d3 + sub.l d0,d3 + move.w Ed_MemoryX(a5),d1 + move.w #Ed_MemoryY1,d2 + bsr .Memory +; Dessin du slider de FAST MEM + move.l #Public|Fast,d1 + jsr _LVOAvailMem(a6) + add.l d0,(sp) + move.l MemFastTotal(a5),d4 + move.l d4,d3 + sub.l d0,d3 + move.w Ed_MemoryX(a5),d1 + move.w #Ed_MemoryY2,d2 + bsr .Memory +; Stocke le resultat memoire globale + move.l (sp)+,Ed_MemCurrent(a5) + move.l (sp)+,a6 + rts + +; Routine de dessin +; ~~~~~~~~~~~~~~~~~ +.Memory +; Une place dans le buffer +; ~~~~~~~~~~~~~~~~~~~~~~~~ + move.l Buffer(a5),a2 + move.l a2,a0 + moveq #Sl_Long-1,d0 +.Loop clr.b (a0)+ + dbra d0,.Loop +; Longueur du slider + lsr.l #8,d4 + lsr.l #8,d3 + move.w d4,Sl_Global(a2) + move.w d3,Sl_Window(a2) +; Position + move.w d1,Sl_X(a2) + move.w d2,Sl_Y(a2) + move.w Ed_MemorySx(a5),Sl_Sx(a2) + move.w #Ed_MemorySy,Sl_Sy(a2) +; Couleurs + moveq #23,d0 + bsr Ed_GetSysteme + lea Sl_Inactive(a2),a1 + moveq #16-1,d0 +.Co moveq #0,d1 + move.b (a0)+,d1 + move.w d1,(a1)+ + dbra d0,.Co +; Appelle le dessin + move.l a2,a0 + JJsrR L_Sl_Init,a1 + rts + +;______________________________________________________________________________ +; +; Boucle principale de l'ïż½diteur +;______________________________________________________________________________ +; +Ed_Loop + + move.l BasSp(a5),sp + EcCalD Active,EcEdit + +; Flag: editeur en etat de marche! +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + move.b #1,Ed_Ok(a5) + move.w #1,T_AMOState(a5) Editeur present! + +; Efface une fenetre en rab +; __________________________ +; + move.l Ed_WindowToDel(a5),d0 + beq.s .PaDel + move.l d0,a4 + clr.l Ed_WindowToDel(a5) + tst.b Edt_Hidden(a4) + bne.s .Visi + bsr Ed_CloseWindow + bra Ed_Loop +.Visi bsr Edt_DelWindow + bsr EdM_BranchAMOS + bra Ed_Loop +.PaDel +; +; Eventuellement, efface tous les avertissements +; ______________________________________________ +; + bsr Ed_AllAverFin +; +; Recharge un programme apres PRG COMMAND +; _______________________________________ +; + move.l Ed_Prg2ReLoad(a5),d0 + bne Ed_PrgReLoad + + move.l Edt_Current(a5),a4 + move.l Edt_Prg(a4),a6 + move.b Prg_MathFlags(a6),MathFlags(a5) +; +; Securites +; __________________________ +; + clr.b Ed_FUndo(a5) Undo + clr.b Ed_RunnedHidden(a5) + +; +; Gestion des multi windows +; ___________________________ +; + moveq #0,d0 + move.l a4,a0 + or.b Ed_SCallFlags(a5),d0 + bsr Ed_Splitted + clr.b Ed_SCallFlags(a5) +; +; Gestion des scrollings lies +; _____________________________ +; + bsr Ed_LinkeScroll +; +; Gestion du curseur avec un bloc +; _______________________________ +; + bsr Ed_BlocAff +; +; Gestion de la fenetre d'informations pour toutes les fenetres +; _____________________________________________________________ +; +; Exploration de la liste + move.l Edt_List(a5),d0 +.Liip move.l d0,a4 + tst.b Edt_Hidden(a4) + bne.s .Naxt + move.l Edt_Prg(a4),a6 +; Affichage general +; ~~~~~~~~~~~~~~~~ + move.b Ed_EtatAff(a5),d0 + or.b d0,Edt_EtatAff(a4) +; Efface le message d'alerte? +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~ + tst.w Edt_EtMess(a4) + beq.s .PaMess + subq.w #1,Edt_EtMess(a4) + bne.s .PaMess + move.b #EtA_BAll,Edt_EtatAff(a4) +.PaMess +; Va reafficher la fenetre +; ~~~~~~~~~~~~~~~~~~~~~~~~ + bsr Ed_EtPrintD0 +; Affiche le slider +; ~~~~~~~~~~~~~~~~~ + tst.b Edt_ASlY(a4) + beq.s .PaSlY + subq.b #1,Edt_ASlY(a4) + bne.s .PaSlY + bsr Ed_AffSlV +.PaSlY +; Suivant +; ~~~~~~~ +.Naxt move.l Edt_Next(a4),d0 + bne.s .Liip + clr.b Ed_EtatAff(a5) + +; +; Demarre les menus si pas definis +; ________________________________ +; + tst.b Ed_Zappeuse(a5) Pas en zappeuse + bne.s .Menula + cmp.l #1024*72,Ed_MemCurrent(a5) Si moins de 72k + bcc.s .Domenu + tst.b Ed_NewAppear(a5) Peut-on essayer un clearvar? + beq.s .Menula + subq.b #1,Ed_NewAppear(a5) + bne.s .Deuse +; Fait un peu de place + JJsr L_Mon_Free Plus de moniteur + JJsr L_Math_Close Plus de librairie math + bsr Prg_RazUndos Plus d'UNDO + SyCall MemFlush Flush la memoire... +; Essaie d'ouvrir les menus... +.Deuse move.w #186,d0 Low memory! + bsr Ed_GetMessage + moveq #125,d0 + bsr Ed_AlertRts + clr.b Ed_Sounds(a5) Plus de sons + bsr Ed_SamChanged + bsr EdM_Program + move.l Edt_Current(a5),a4 + move.l Edt_Prg(a4),a6 + JJsr L_Prg_SetBanks + JJsr L_MemMaximum +.Domenu tst.l EdM_Table(a5) Les menus sont la? + bne.s .Menula + bsr EdM_Init + bra Ed_Loop +.Menula + +; +; Gestion du programme courant +; ____________________________________ +; + move.l Edt_Current(a5),a4 Fenetre + move.l Edt_Prg(a4),a6 + move.w Edt_Window(a4),d1 + WiCall QWindow + tst.b Ed_CuFlag(a5) Curseur + bne.s .PaCu + move.b #1,Ed_CuFlag(a5) + bsr Ed_CuOn +.PaCu + +; +; Scrolling pour recentrer le curseur? +; ____________________________________ +; +; 1. A gauche +; ~~~~~~~~~~~ + move.w Edt_XPos(a4),d0 + move.w Edt_XCu(a4),d1 + sub.w d0,d1 + cmp.w #Ed_XScrollG,d1 + bcc.s .SkipL + tst.w d0 + beq.s .SkipL + bsr Ed_CuOff + bsr Ed_CGo + bra Ed_Loop +.SkipL +; 2. A droite +; ~~~~~~~~~~~ + move.w Edt_WindTx(a4),d1 + sub.w Edt_XCu(a4),d1 + add.w d0,d1 + cmp.w #Ed_XScrollD,d1 + bcc.s .SkipD + cmp.w #200,d0 + bcc.s .SkipD + bsr Ed_CuOff + bsr Ed_CDr + bra Ed_Loop +.SkipD +; Haut / Bas, calcule les tailles +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + move.w Edt_WindTy(a4),d1 + cmp.w #2,d1 + bls.s .SEnd + moveq #1,d2 + moveq #1,d3 + cmp.w #7,d1 + bcs.s .SkipT + moveq #Ed_YScrollH/2,d2 + moveq #Ed_YScrollB/2,d3 + cmp.w #(Ed_YScrollH+Ed_YScrollB)*2,d1 + bcs.s .SkipT + move.w d1,d2 + mulu #Ed_YScrollH,d2 + divu #25,d2 + move.w d1,d3 + mulu #Ed_YScrollB,d3 + divu #25,d3 +.SkipT +; 3. En haut. +; ~~~~~~~~~~~ + cmp.w Edt_YCu(a4),d2 + bls.s .SkipH + tst.w Edt_YPos(a4) + beq.s .SkipH + bsr Ed_CuOff + bsr Ed_SHaut2 + addq.w #1,Edt_YCu(a4) + bsr Ed_Loca + bra Ed_Loop +.SkipH +; 4. En bas +; ~~~~~~~~~ + move.w Edt_WindTy(a4),d0 + sub.w Edt_YCu(a4),d0 + cmp.w d0,d3 + bcs.s .SEnd + move.w Edt_YPos(a4),d0 + add.w Edt_YCu(a4),d0 + cmp.w Prg_NLigne(a6),d0 + bcc .SEnd + bsr Ed_CuOff + bsr Ed_SBas2 + subq.w #1,Edt_YCu(a4) + bsr Ed_Loca + bra Ed_Loop +.SEnd + +; +; Un programme en tïż½lïż½commande? +; _____________________________ +; + tst.b Ed_Zappeuse(a5) + beq.s .PaProg + addq.w #1,Ed_ZapCounter(a5) Attend que l'editeur soit stabilisïż½ + cmp.w #5,Ed_ZapCounter(a5) + bcs Ed_Loop + clr.w Ed_ZapCounter(a5) + bra Ed_ZapOut +.PaProg +; +; Gestion du clavier +; __________________ +; + bsr Ed_Key + bne Ed_Loop + +; +; Gestion de la souris +; ____________________ +; + bsr Ed_Mouse + bne Ed_Loop + +; +; Reafficher le slider de memoire? +; ________________________________ +; + move.w T_VblCount+2(a5),d0 + and.w #63,d0 + bne.s .Skip + bsr Ed_MemoryAff + bra Ed_Loop +.Skip +; +; Autosave? +;____________ +; + move.l Ed_AutoSave(a5),d0 + beq.s .PaAS + tst.l Ed_AutoSaveRef(a5) + bpl.s .Pan + move.l T_VblCount(a5),Ed_AutoSaveRef(a5) +.Pan move.l T_VblCount(a5),d1 + sub.l Ed_AutoSaveRef(a5),d1 + cmp.l d0,d1 + bcs.s .PaAS + move.l Edt_Current(a5),a4 + tst.w Edt_LEdited(a4) Seulement si ligne non editee + bne.s .PaAS + move.l #-1,Ed_AutoSaveRef(a5) + bsr Ed_SaveAuto + bra Ed_Loop +.PaAS +; +; Multitache! +; ___________ +; + JJsr L_Sys_WaitMul + bra Ed_Loop + + +; __________________________________________________________________________ +; +; Teste la souris +; __________________________ +; +Ed_Mouse + + +; Une touche? +; ~~~~~~~~~~~ + SyCall MouseKey + move.b d1,Ed_MkIns(a5) + cmp.b Ed_OMKey(a5),d1 + bne.s .MkC + addq.w #1,Ed_MkCpt(a5) + bra.s .MkS +.MkC clr.w Ed_MkCpt(a5) + move.b d1,Ed_OMKey(a5) +.MkS moveq #1,d2 +.EdMk0 btst d2,Ed_MkFl(a5) + bne.s .EdMk1 +; Appuie sur la touche + btst d2,d1 + beq.s .EdMk2 + bset d2,Ed_MkFl(a5) + bset d2,Ed_MKey(a5) + bra.s .EdMk2 +; Doit relacher la touche +.EdMk1 bclr d2,Ed_MKey(a5) + btst d2,d1 + bne.s .EdMk2 + bclr d2,Ed_MkFl(a5) +.EdMk2 dbra d2,.EdMk0 + move.b Ed_MkIns(a5),d7 + and.w #3,d7 + beq Ed_MQuit + +; Une macro en route? +; ~~~~~~~~~~~~~~~~~~~ + tst.w EdMa_Tape(a5) + bne EdMa_Stop + tst.l EdMa_Play(a5) + beq.s .PaMacro + clr.l EdMa_Play(a5) +.PaMacro + +; Le menu? +; ~~~~~~~~ + btst #1,d7 + beq.s .NoMenu + bsr Ed_MnGere + beq Ed_MEnd + bmi.s .Err + moveq #0,d1 + bsr Ed_FCall + bra Ed_MEnd +.Err bsr EdM_Error + bra Ed_MEnd +.NoMenu + +; Une Zone? +; ~~~~~~~~~ + SyCall GetZone + cmp.w #EcEdit,d1 + bne Ed_MQuit + swap d1 + move.w d1,d6 +; Un bouton du haut? + cmp.w #Ed_BoutonsZones,d1 + bcc Ed_MBouton +; ___________________________ +; +; Bouge une separation? +; ___________________________ +; + move.w d6,d0 + and.w #$FFF8,d0 + move.w d6,d1 + and.w #$07,d1 + cmp.b #1,d1 + bne.s .NoZoHo + bsr Ed_TokCur + bsr Edt_GetAd + bsr Ed_MSepHaut + bra Ed_MEnd +.NoZoHo + cmp.w #2,d1 + bne.s .NoZoBa + bsr Ed_TokCur + bsr Edt_GetAd + bsr Ed_MSepBas + bra Ed_MEnd +.NoZoBa +; _____________________ +; +; Un bouton de fenetre +; _____________________ +; + tst.w d1 + beq.s .NoBt + bsr Edt_GetAd + beq.s .NoBt + lea Edt_Bt1(a0),a0 + JJsrR L_Bt_Gere,a1 + bne Ed_MEnd +.NoBt +; _____________________ +; +; Changement de fenetre +; _____________________ +; + move.w d6,d0 + and.w #$FFF8,d0 + cmp.w Edt_Window(a4),d0 + beq.s .Same +; Doit changer l'ïż½cran actuel + bsr Ed_TokCur + bsr Edt_GetAd + beq.s .Same + bsr Edt_Active + bra Ed_MEnd +.Same + +; ___________________ +; +; Click dans le texte +; ___________________ +; + SyCall XyMou + moveq #0,d3 + SyCall XyScr + SyCall XyWin + move.l d1,d3 + or.l d2,d1 + bmi .NoText + +; Positionne le curseur +; ~~~~~~~~~~~~~~~~~~~~~ + btst #0,d7 + beq.s .NoText + move.w Ed_MkCpt(a5),d0 + beq.s .Pos + cmp.w #20,d0 + bcs Ed_MQuit +.Pos + add.w Edt_XPos(a4),d3 + cmp.w #250,d3 + bcc Ed_MQuit + add.w Edt_YPos(a4),d2 + cmp.w Prg_NLigne(a6),d2 + bhi Ed_MQuit + sub.w Edt_YPos(a4),d2 + bsr Ed_CuOff + + cmp.w Edt_YCu(a4),d2 + beq.s .Notok + bsr Ed_TokCur +.Notok move.w Edt_YCu(a4),d0 + add.w Edt_YPos(a4),d0 + move.w d0,Edt_YOldBloc(a4) + +; Mode bloc / normal + cmp.w Edt_YCu(a4),d2 + bne.s .Noe + cmp.w Edt_XCu(a4),d3 + bne.s .Noe + tst.w Ed_MkCpt(a5) + bne Ed_MEnd + bsr Ed_BlocOn + bra Ed_MEnd +; Positionne le curseur +.Noe move.w d2,Edt_YCu(a4) + move.w d3,Edt_XCu(a4) + or.b #EtA_BXY,Edt_EtatAff(a4) + bsr Ed_Loca + bra Ed_MEnd +.NoText +; ______________________ +; +; Click dans les sliders +; ______________________ +; + lea Edt_SlV(a4),a0 + cmp.w Sl_Zone(a0),d6 + bne.s .NoSlV + bsr Ed_CuOff + bsr Ed_TokCur + JJsrR L_Sl_Clic,a1 + bra Ed_MQuit +.NoSlV bra Ed_MQuit + +; ____________________________ +; +; Click dans un bouton general +; ____________________________ +; +Ed_MBouton + lea Ed_Boutons(a5),a0 + JJsrR L_Bt_Gere,a1 + beq.s Ed_MEnd +; Appelle la fonction + move.l d0,a0 + move.w Bt_Number(a0),d2 + moveq #13,d0 + bsr Ed_GetSysteme + move.b -1(a0,d2.w),d2 + subq.w #1,d2 + bsr Ed_FCall +Ed_MEnd + clr.b Ed_CuFlag(a5) + moveq #-1,d0 + rts +Ed_MQuit + moveq #0,d0 + rts +; ____________________________ +; +; CHANGEMENT DE LA SEPARATION du haut, fenetre A0 +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_MSepHaut + movem.l a2-a6/d2-d7,-(sp) + move.l a0,a4 + tst.b Edt_First(a4) + bne.s .NoMve + bsr Ed_RShLimits + bsr Ed_MSep +; Calcule les changements + bsr Edt_WChangeHaut + beq.s .NoMve + bsr Edt_WVideNext +; Modifie l'affichage + bsr Ed_DrawWindows + moveq #-1,d0 + bra.s .EMve +.NoMve moveq #0,d0 +.EMve movem.l (sp)+,a2-a6/d2-d7 + rts +; Routine +Ed_RShLimits + moveq #0,d0 + bsr Edt_WMaxSize ; Positions max et min + tst.b Edt_Last(a4) + bne.s .Last +; Une fenetre au milieu, bouge tout! + move.w Edt_WindTy(a4),d0 + lsl.w #3,d0 + add.w #Edt_EtatSy+Edt_BasSy,d0 ; Taille ïż½ bouger + sub.w d0,d2 ; D2 max + move.w Edt_Y(a4),d3 ; Position initiale + rts +; La derniere, bouge juste le haut +.Last moveq #Edt_EtatSy,d0 ; Taille ïż½ bouger + sub.w #Edt_EtatSy+Edt_BasSy,d2 ; D2 max + move.w Edt_Y(a4),d3 ; Position initiale + rts + +; +; CHANGEMENT DE LA SEPARATION du bas, fenetre A0 +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_MSepBas + movem.l a2-a6/d2-d7,-(sp) + move.l a0,a4 + tst.b Edt_Last(a4) + bne.s .NoMve + bsr Ed_RSbLimits + bsr Ed_MSep +; Va calculer les changements + bsr Edt_WChangeBas + beq.s .NoMve + bsr Edt_WVideNext +; Modifie l'affichage + bsr Ed_DrawWindows + moveq #-1,d0 + bra.s .EMve +.NoMve moveq #0,d0 +.EMve movem.l (sp)+,a2-a6/d2-d7 + rts +; Routine +Ed_RSbLimits + moveq #0,d0 + bsr Edt_WMaxSize ; Positions max et min + moveq #Edt_BasSy,d0 ; Taille ïż½ bouger + add.w #Edt_EtatSy,d1 + move.w Edt_BasY(a4),d3 ; Position initiale + rts +; Separation du haut vers le haut +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_EtatUp + moveq #-8,d0 + bra.s Ed_EtatMove +; +; Separation du haut vers le bas +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_EtatDown + moveq #8,d0 + bra.s Ed_EtatMove +; +; Separation du bas vers le haut +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_BasUp + moveq #-8,d0 + bra.s Ed_BasMove +; +; Separation du bas vers le bas +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_BasDown + moveq #8,d0 + bra.s Ed_BasMove +; +; Mouvement relatif de la separation du haut +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_EtatMove + bsr Ed_TokCur + tst.b Edt_First(a4) + bne.s .NoMve + move.w d0,d4 + bsr Ed_RShLimits + add.w d4,d3 + cmp.w d1,d3 + bls.s .NoMve + cmp.w d2,d3 + bge.s .NoMve +; Calcule les changements + move.w d3,d0 + bsr Edt_WChangeHaut + beq.s .NoMve + bsr Edt_WVideNext + bsr Ed_DrawWindows +.NoMve rts +; +; CHANGEMENT relatif de la DE LA SEPARATION du bas +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_BasMove + bsr Ed_TokCur + tst.b Edt_Last(a4) + bne.s .NoMve + move.w d0,d4 + bsr Ed_RSbLimits + add.w d4,d3 + cmp.w d1,d3 + bls.s .NoMve + cmp.w d2,d3 + bge.s .NoMve +; Va calculer les changements + move.w d3,d0 + bsr Edt_WChangeBas + beq.s .NoMve + bsr Edt_WVideNext + bsr Ed_DrawWindows +.NoMve rts + + +; __________________________________________________________________________ +; +; Teste le clavier +; __________________________ +; +Ed_Key + +; Une macro en lecture? +; ~~~~~~~~~~~~~~~~~~~~~ + move.l EdMa_Play(a5),d0 + beq.s .PaMacro + addq.l #3,d0 + move.l d0,a0 + move.l d0,EdMa_Play(a5) + move.b -(a0),d1 + lsl.w #8,d1 + move.b -(a0),d1 + swap d1 + clr.w d1 + move.b -(a0),d1 La fin est marquee par -1 + cmp.b #-1,d1 + bne.s .EndMac + clr.l EdMa_Play(a5) +.PaMacro +; Simule le CONTROL-C +; ~~~~~~~~~~~~~~~~~~~~ + bclr #BitControl-8,T_Actualise(a5) * Simule CONTROL-C + beq.s .EdPaCc + move.l #$08330043,d1 + bra.s .MacIn +.EdPaCc + +; Prend les touches +; ~~~~~~~~~~~~~~~~~ + SyCall Inkey +.MacIn tst.l d1 + beq Ed_KEnd + +; Une macro en enregistrement? +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + move.w EdMa_Tape(a5),d0 + beq.s .UneMac + move.l EdMa_List(a5),a0 + lea 8+4-1(a0,d0.w),a0 + cmp.b #-1,(a0) + beq.s .2Big + move.l d1,d0 + move.b d0,(a0)+ + swap d0 + move.b d0,(a0)+ + lsr.w #8,d0 + move.b d0,(a0)+ + addq.w #3,EdMa_Tape(a5) +.2Big bra.s .EndMac +; La touche en question est-elle une macro? +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.UneMac bsr EdMa_Adr + beq.s .EndMac + lea 12(a1),a1 + move.l a1,EdMa_Play(a5) + bra Ed_Key +.EndMac + +; Une fonction? +; ~~~~~~~~~~~~~ + bsr Ed_Ky2Fonc + beq.s .Char + bsr Ed_FCall + moveq #-1,d0 + bra Ed_KEnd +; Stocke la lettre dans le buffer +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.Char move.l d1,d7 + move.b Ed_Insert(a5),d6 + bsr Ed_PKey + moveq #"C",d0 + bsr Ed_SamPlay + moveq #-1,d0 +; +; Fini pour les touches +; ~~~~~~~~~~~~~~~~~~~~~ +Ed_KEnd rts + + +; Appelle le menu editeur et retourne le choix, si choix +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_MnGere + bsr EdM_Editor + tst.l MnBase(a5) Menus definis? + beq.s .Err + move.l a6,-(sp) + move.l $4.w,a6 + move.l #Public,d1 + jsr _LVOAvailMem(a6) Au moins 40k de libre! + move.l (sp)+,a6 + cmp.l #40*1024,d0 + bcs.s .Err + moveq #"H",d0 Va faire du bruit! + bsr Ed_SamPlay + JJsr L_MnGere + bne.s .Err + moveq #"H",d0 Va faire du bruit! + bsr Ed_SamPlay + tst.w MnChoice(a5) + beq .NoChoix + clr.w MnChoice(a5) + lea MnChoix(a5),a0 + moveq #3,d1 +.MnL lsl.l #8,d0 + addq.l #1,a0 + move.b (a0)+,d0 + dbra d1,.MnL + move.l EdM_Table(a5),a0 + bra.s .MnM1 +.MnM0 addq.l #8,a0 +.MnM1 move.l (a0),d1 + beq.s .NoChoix + cmp.l d0,d1 + bne.s .MnM0 + moveq #0,d2 + move.b 6(a0),d2 + subq.w #1,d2 + bmi .NoChoix + moveq #1,d0 + rts +; Pas de choix finalement.... +.NoChoix + moveq #0,d0 + rts +; Erreur out of memory +.Err moveq #-1,d0 + rts + +; Explore la table des touches de fonctions +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +; D1= Touche +Ed_Ky2Fonc + movem.l d1/d3-d7,-(sp) + move.b d1,d7 + cmp.b #"a",d7 * D7= lettre majuscule + bcs.s .EdL5 + cmp.b #"z",d7 + bhi.s .EdL5 + sub.b #"a"-"A",d7 +.EdL5 swap d1 + move.b d1,d6 * D6= scancode + lsr.w #8,d1 + and.b #%11111011,d1 + move.b d1,d5 * D5= shifts + swap d1 +* Recherche dans la table +.EdL5a clr.w d2 + lea Ed_KFonc(a5),a0 +.EdL6 move.b d5,d4 + move.b (a0),d0 * Boucle de comparaison + bpl.s .EdL7 + cmp.b #$FF,d0 + beq .EdL10 + and.b #$7f,d0 * Compare au scancode + cmp.b d0,d6 + bne.s .EdL9 + bra.s .EdL8 +.EdL7 beq.s .EdLN * Rien, passe au suivant + cmp.b d0,d7 * Compare au code ASCII + bne.s .EdL9 +.EdL8 move.b 1(a0),d3 * Compare le SHIFTS... + bne.s .EdL8a + tst.b d4 + bne.s .EdL9 + bra.s .EdLG +.EdL8a move.b d4,d0 + and.b #Shf,d0 * Teste les shifts + beq.s .EdL8b + and.b d3,d0 + beq.s .EdL9 + and.b #255^Shf,d3 + and.b #255^Shf,d4 + beq.s .EdLG +.EdL8b move.b d4,d0 + and.b #Ctr,d0 * Teste CONTROL + beq.s .EdL8c + and.b d3,d0 + beq.s .EdL9 + and.b #255^Ctr,d3 + and.b #255^Ctr,d4 + beq.s .EdLG +.EdL8c move.b d4,d0 + and.b #Alt,d0 * Teste ALTERNATE + beq.s .EdL8d + and.b d3,d0 + beq.s .EdL9 + and.b #255^Alt,d3 + and.b #255^Alt,d4 + beq.s .EdLG +.EdL8d move.b d4,d0 + and.b #Ami,d0 * Teste AMIGA + beq.s .EdL9 + and.b d3,d0 + beq.s .EdL9 + and.b #255^Ami,d3 + and.b #255^Ami,d4 + beq.s .EdLG +.EdL9 lea 2(a0),a0 + bra .EdL6 +.EdLN addq.w #1,d2 + addq.l #1,a0 + bra .EdL6 +.EdLG: or.b d4,d3 + bne.s .EdL9 + moveq #-1,d0 + bra.s .Out +.EdL10 moveq #0,d0 +.Out movem.l (sp)+,d1/d3-d7 + rts + +; Pointe la touche affectee ïż½ une fonction +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +; D0= Fonction +; +Ed_Fonc2Ky + lea Ed_KFonc(a5),a0 + bra.s .Skip4 +.Loop4 addq.l #2,a0 + tst.b (a0) + bne.s .Loop4 + addq.l #1,a0 + cmp.b #$FF,(a0) + beq.s .NoKey +.Skip4 subq.b #1,d0 + bne.s .Loop4 + move.l a0,d0 + rts +.NoKey moveq #0,d0 + rts + +; +; Stocke la lettre dans le buffer +; D6= Insert mode? +; D7= caractere +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_PKey + cmp.b #32,d7 + bcs .EdL15 +* Positionne a la fin de la ligne + bsr Ed_LCourant + bne Ed_NotEdit Line not editable + cmp.w d0,d1 + bls.s .EdL10a + move.w d0,d1 + lea 0(a0,d1.w),a1 + move.w d1,Edt_XCu(a4) + movem.l a0/a1/d0/d1,-(sp) + bsr Ed_Cent + movem.l (sp)+,a0/a1/d0/d1 +* Recupere le code Ascii +.EdL10a +* Gestion UNDO + bsr Un_Debut + bne.s .Skip + move.b #$01,(a2) Flag Lettre + move.b #-1,4(a2) Move insert + move.b d7,5(a2) Caractere +.Skip +* Recupere le code ASCII + tst.b d6 + bne.s .EdL11 +* Mode OVERWRITE + cmp.w d0,d1 + beq.s .EdL13 + move.b (a1),4(a2) Ancien caractere + bra.s .EdL14 +* Mode INSERT +.EdL11 cmp.w #250,d0 + bcc Ed_LToLong + cmp.w d0,d1 + beq.s .EdL13 + lea 1(a0,d0.w),a2 +.EdL12 move.b -(a2),1(a2) + cmp.l a1,a2 + bhi.s .EdL12 +.EdL13 addq.w #1,d0 +.EdL14 move.b d7,(a1) + move.w d0,-2(a0) + addq.w #1,Edt_LEdited(a4) * Flag ligne editee +; Bouge le curseur + bsr Ed_CDroite + move.w Edt_YCu(a4),d1 + bsr Ed_ALigne +; Reaffiche la ligne +.EdL15 bsr Ed_Loca +; Si la fenetre est splitee + move.b #%01,Ed_SCallFlags(a5) + rts + +; +; Insere le mot A0/long D0 dans la ligne courante +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +R_InsChar + movem.l a0-a3/d0-d2,-(sp) + move.l a0,a2 + move.w d0,d2 + bsr Ed_LCourant + add.w d2,d0 + cmp.w #250,d0 + bls.s .Ok + sub.w #250,d0 + sub.w d0,d2 + move.w #250,d0 +.Ok tst.w d2 + beq.s .Out + add.w d2,-2(a0) + lea 0(a0,d0.w),a0 + move.l a0,a3 + sub.w d2,a3 + bra.s .Test +.Copy move.b -(a3),-(a0) +.Test cmp.l a1,a3 + bhi.s .Copy + subq.w #1,d2 +.Loop move.b (a2)+,(a1)+ + dbra d2,.Loop + addq.w #1,Edt_LEdited(a4) +.Out movem.l (sp)+,a0-a3/d0-d2 + rts +; +; Enleve D0 caracteres en position courante +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +R_DelChar + move.w d0,d2 + bsr Ed_LCourant + cmp.w d0,d2 + bhi.s .Skip + sub.w d2,-2(a0) + lea 0(a1,d2.w),a0 + sub.w d1,d0 + sub.w d2,d0 + subq.w #1,d0 + bmi.s .Del2 +.Del1 move.b (a0)+,(a1)+ + dbra d0,.Del1 +.Del2 addq.w #1,Edt_LEdited(a4) +.Skip rts + +; _________________________________________________________________________ +; +; GESTION UNDO MULTIPLE +; _________________________________________________________________________ +; + + +; UNDO +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_Undo move.l Prg_PUndo(a6),a2 + bsr Un_Prev + move.b (a2),d0 + beq Ed_NoUndo + move.l a2,Prg_PUndo(a6) +; Appele la fonction + and.w #$7f,d0 + lsl.w #2,d0 + lea JUndo(pc),a0 + addq.b #1,Ed_FUndo(a5) + jsr -4(a0,d0.w) + subq.b #1,Ed_FUndo(a5) + rts + +; REDO +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_Redo move.l Prg_PUndo(a6),a2 + move.b (a2),d0 + beq Ed_NoRedo +; Appelle la fonction + and.w #$7f,d0 + lsl.w #2,d0 + lea JRedo(pc),a0 + addq.b #1,Ed_FUndo(a5) + jsr -4(a0,d0.w) + subq.b #1,Ed_FUndo(a5) +; Passe au suivant + move.l Prg_PUndo(a6),a2 + bsr Un_Next + move.l a2,Prg_PUndo(a6) +.Out rts + + +; Cree les buffer UNDO de toutes les fenetres +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Prg_CreateUndos + movem.l d0/a6,-(sp) + move.l Prg_List(a5),d0 + beq.s .Out +.Loop move.l d0,a6 + bsr Prg_UndoCreate + move.l Prg_Next(a6),d0 + bne.s .Loop +.Out movem.l (sp)+,d0/a6 + rts +; Efface les buffer UNDO de toutes les fenetres +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Prg_FreeUndos + movem.l d0/a6,-(sp) + move.l Prg_List(a5),d0 + beq.s .Out +.Loop move.l d0,a6 + bsr Prg_UndoFree + move.l Prg_Next(a6),d0 + bne.s .Loop +.Out movem.l (sp)+,d0/a6 + rts +; Mise ïż½ zero de tous les buffers UNDO +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Prg_RazUndos + movem.l d0/a6,-(sp) + move.l Prg_List(a5),d0 + beq.s .Out +.Loop move.l d0,a6 + bsr Prg_UndoRaz + move.l Prg_Next(a6),d0 + bne.s .Loop +.Out movem.l (sp)+,d0/a6 + rts +; +; Cree le buffer UNDO +; ~~~~~~~~~~~~~~~~~~~ +Prg_UndoCreate + bsr Prg_UndoFree + movem.l d0/d1/a0/a1,-(sp) + move.l Ed_NUndo(a5),d0 + beq.s .Skip + addq.l #3,d0 + mulu #6,d0 + move.l d0,d1 + SyCall MemFastClear + beq.s .Skip + move.l d1,Prg_LUndo(a6) + move.l a0,Prg_Undo(a6) + move.l a0,a1 + move.b #$FF,(a1) + addq.l #6,a1 + move.l a1,Prg_PUndo(a6) + lea -12(a1,d1.l),a1 + move.b #$FF,(a1) + clr.l Prg_TUndo(a6) +.Skip movem.l (sp)+,d0/d1/a0/a1 + rts +; +; Efface tous les mouvements UNDO +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Prg_UndoRaz + movem.l d0-d2/a0-a2,-(sp) + move.l Prg_Undo(a6),d0 + beq.s .Skip + move.l d0,a2 + lea 6(a2),a2 + move.l a2,Prg_PUndo(a6) +.Loop bsr Un_Del + addq.l #6,a2 + cmp.b #$FF,(a2) + bne.s .Loop +.Skip movem.l (sp)+,d0-d2/a0-a2 + rts +; +; Efface le buffer UNDO +; ~~~~~~~~~~~~~~~~~~~~~ +Prg_UndoFree + bsr Prg_UndoRaz + movem.l a0/a1/d0,-(sp) + move.l Prg_Undo(a6),d0 + beq.s .Skip + clr.l Prg_Undo(a6) + move.l d0,a1 + move.l Prg_LUndo(a6),d0 + SyCall MemFree +.Skip movem.l (sp)+,a0/a1/d0 + rts + + +JUndo bra Un_Char 1- Simple caractere + bra Un_Delete 2- Delete + bra Un_Clear 3- Effacement ligne / Fin de ligne + bra Un_DLine 4- Delete ligne du programme + bra Un_Token 5- Tokenisation + bra Un_ILine 6- Insertion ligne + bra Un_Split 7- Split Line + bra Un_Join 8- Join Line +JRedo bra Re_Char 1- Simple caractere + bra Re_Delete 2- Delete + bra Re_Clear 3- Effacement ligne / Fin de ligne + bra Re_DLine 4- Delete ligne du programme + bra Re_Token 5- Tokenisation + bra Re_ILine 6- Insertion ligne + bra Re_Split 7- Split Line + bra Re_Join 8- Join Line +; +; UNDO: un caractere +; ~~~~~~~~~~~~~~~~~~ +Un_Char + bsr Un_XY + move.b 4(a2),d0 + bpl.s .Over +; En INSERT + bsr Ed_Delete + rts +; En OVERWRITE +.Over bsr Ed_LCourant + move.b 4(a2),(a1) + addq.w #1,Edt_LEdited(a4) + bsr Ed_EALiCu + rts +; +; REDO: un caractere +; ~~~~~~~~~~~~~~~~~~ +Re_Char bsr Un_XY + moveq #0,d6 + tst.b 4(a2) + bpl.s .Skip + moveq #1,d6 +.Skip move.b 5(a2),d7 + bsr Ed_PKey + rts +; +; UNDO: Delete +; ~~~~~~~~~~~~ +Un_Delete + bsr Un_XY + move.b 5(a2),d7 + moveq #1,d6 + bsr Ed_PKey + rts +; +; REDO: Delete +; ~~~~~~~~~~~~ +Re_Delete + bsr Un_XY + bsr Ed_Delete + rts +; +; UNDO: Effacement dans la ligne +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Un_Clear + bsr Un_XYSto +Un_C2 + move.w (a2),d0 + subq.w #4,d0 + bls.s .Skip + lea 4(a2),a0 + bsr R_InsChar + bsr Ed_EALiCu +.Skip rts +; +; REDO: Effacement dans la ligne +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Re_Clear + bsr Un_XYSto + move.w (a2),d0 + subq.w #4,d0 + bls.s .Skip + bsr R_DelChar +.Skip bsr Ed_EALiCu + rts +; +; UNDO: Ligne effacee du programme +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Un_DLine + bsr Un_XYSto + move.l a2,-(sp) + bsr Ed_InsLine + move.l (sp)+,a2 + bra.s Un_C2 +; +; REDO: Ligne effacee du programme +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Re_DLine + bsr Un_XYSto + bsr Ed_DelLiCu + rts +; +; UNDO: Tokenisation +; ~~~~~~~~~~~~~~~~~~ +Un_Token + bsr Un_XYSto + bsr Ed_LCourant +; Recopie l'ancienne ligne + lea 6(a2),a1 + moveq #0,d0 + move.b (a1)+,d0 + move.w d0,-2(a0) + subq.w #1,d0 + bmi.s .Skip +.Loop move.b (a1)+,(a0)+ + dbra d0,.Loop +; Une ligne de moins? +.Skip move.w 4(a2),d0 + sub.w d0,Prg_NLigne(a6) + addq.w #1,Edt_LEdited(a4) + bsr Ed_EALiCu + rts +; +; REDO: Tokenisation +; ~~~~~~~~~~~~~~~~~~ +Re_Token + bsr Un_XYSto + addq.w #1,Edt_LEdited(a4) + bsr Ed_TokCur + rts +; +; UNDO: Un-Split line +; ~~~~~~~~~~~~~~~~~~~ +Re_Join +Un_Split + move.l a2,-(sp) + bsr Un_XYSto + bsr Ed_DelLiCu + move.l (sp)+,a2 + bsr Un_XYSto + bsr Un_RepLine + rts +; +; UNDO: Un-Join line +; ~~~~~~~~~~~~~~~~~~ +Re_Split +Un_Join + bsr Un_XYSto + bsr Un_RepLine + bsr Ed_ReturnQuiet + rts +; +; Recopie integrale de la ligne +Un_RepLine + bsr Ed_LCourant + move.w (a2),d0 + subq.w #4,d0 + lea 4(a2),a1 + move.w d0,-2(a0) + subq.w #1,d0 + bmi.s .Skip +.Loop move.b (a1)+,(a0)+ + dbra d0,.Loop +.Skip bsr Ed_EALiCu + addq.w #1,Edt_LEdited(a4) + rts +; +; UNDO: Ligne inseree dans le programme +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Un_ILine + bsr Un_XY + bsr Ed_DelLiCu + rts +; +; REDO: Ligne inseree dans le programme +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Re_ILine + bsr Un_XY + bsr Ed_InsLine + rts +; +; Pointe la ligne stockee +; ~~~~~~~~~~~~~~~~~~~~~~~ +Un_XYSto + bsr Un_X + move.l 2(a2),a2 + move.w 2(a2),d0 + bsr Ed_GotoY + rts +; +; Positionne le curseur sur la ligne UNDO +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Un_XY move.w 2(a2),d0 + bsr Ed_GotoY +Un_X moveq #0,d0 + move.b 1(a2),d0 + bsr Ed_GotoX + rts + +; +; STOCKE en UNDO (A0) D0 caracteres +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Un_CLine + move.l a2,-(sp) + bsr Un_Debut + bne.s .Skip + movem.l a0-a1/d0-d2,-(sp) + move.l a0,a1 + ext.l d0 + move.w d0,d1 + addq.w #4,d0 + SyCall MemFast + beq.s .No + move.w d0,(a0) + add.l d0,Prg_TUndo(a6) + move.w 2(a2),2(a0) + move.b #$83,(a2) + move.l a0,2(a2) + subq.l #1,d1 + bmi.s .No + addq.l #4,a0 +.Loop move.b (a1)+,(a0)+ + dbra d1,.Loop +.No moveq #0,d0 + movem.l (sp)+,a0-a1/d0-d2 +.Skip move.l (sp)+,a2 + rts + +; +; Stocke les coordonnees du curseur +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Un_Debut + tst.b Ed_FUndo(a5) Autorise? + bne.s .OutNo + tst.l Prg_Undo(a6) Buffer defini? + beq.s .OutNo + move.l d2,-(sp) + move.l Prg_PUndo(a6),a2 + bsr Un_Del + move.b Edt_XCu+1(a4),1(a2) + move.w Edt_YPos(a4),d2 + add.w Edt_YCu(a4),d2 + move.w d2,2(a2) + bsr Un_Avance + movem.l (sp)+,d2 + move.w #%00100,CCR BEQ: undo en route + rts +.OutNo move.w #%00000,CCR BNE: pas d'undo! + rts + +; +; Avance UNDO d'un cran +; ~~~~~~~~~~~~~~~~~~~~~ +Un_Avance + move.l a2,-(sp) + move.l Prg_PUndo(a6),a2 + bsr Un_Next + bsr Un_Del + move.l a2,Prg_PUndo(a6) + move.l (sp)+,a2 + rts +; +; Efface le cran UNDO (a2) +; ~~~~~~~~~~~~~~~~~~~~~~~~ +Un_Del + movem.l a0/a1/d0,-(sp) + move.b (a2),d0 + bpl.s .Out + move.l 2(a2),d0 + beq.s .Out + move.l d0,a1 + moveq #0,d0 + move.w (a1),d0 + sub.l d0,Prg_TUndo(a6) + SyCall MemFree +.Out clr.b (a2) + movem.l (sp)+,a0/a1/d0 + rts + + +; Va un cran en arriere +; ~~~~~~~~~~~~~~~~~~~~~~ +Un_Prev + subq.l #6,a2 + cmp.b #$FF,(a2) + bne.s .Skip + move.l Prg_Undo(a6),a2 + add.l Prg_LUndo(a6),a2 + lea -12(a2),a2 +.Skip rts +; +; Va un cran en avant +; ~~~~~~~~~~~~~~~~~~~ +Un_Next + addq.l #6,a2 + cmp.b #$FF,(a2) + bne.s .Skip + move.l Prg_Undo(a6),a2 + addq.l #6,a2 +.Skip rts +; __________________________________________________________________________ +; + + + +; __________________________________________________________________________ +; +; GESTION DES FENETRES LIEES EN SCROLLING +; __________________________________________________________________________ +; + +; +; Link cursor's movements +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_LinkCursor + bsr Ed_TokCur + moveq #1,d0 + bsr Ed_AverMess + clr.l Edt_LinkScroll(a4) +; Attend le choix +; ~~~~~~~~~~~~~~~ +.Loop JJsr L_Sys_WaitMul + SyCall MouseKey + btst #0,d1 + beq.s .Loop + SyCall GetZone + cmp.w #EcEdit,d1 + bne Ed_NotDone + swap d1 + cmp.w Edt_Window(a4),d1 + beq Ed_NotDone + move.w d1,d0 + bsr Edt_GetAd + beq Ed_NotDone + bsr Edt_DelLinkScroll + move.l a0,Edt_LinkScroll(a4) + move.w Edt_YPos(a4),d0 + add.w Edt_YCu(a4),d0 + move.w d0,Edt_LinkYOld(a4) + bsr Ed_AverFin + JJsr L_Dia_NoMKey + rts +; +; Enleve les links de scrolling sur la fenetre A0 +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Edt_DelLinkScroll + move.l Edt_List(a5),d1 +.Loop move.l d1,a1 + cmp.l Edt_LinkScroll(a1),a0 + bne.s .Skip + clr.l Edt_LinkScroll(a1) +.Skip move.l Edt_Next(a1),d1 + bne.s .Loop + rts + +; Gestion proprement dite +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_LinkeScroll + tst.l Edt_LinkScroll(a4) + beq.s .Nolink + bsr .Recurse Fait le changement + move.w Edt_Window(a4),d1 Reactive la fenetre + WiCall QWindow +.Nolink rts +; Routine recursive +; ~~~~~~~~~~~~~~~~~ +.Recurse + move.l Edt_LinkScroll(a4),d0 + beq.s .Out + move.w Edt_YCu(a4),d1 + add.w Edt_YPos(a4),d1 + cmp.w Edt_LinkYOld(a4),d1 + beq.s .Out +; Fait les changements + move.w d1,d2 + sub.w Edt_LinkYOld(a4),d1 + move.w d2,Edt_LinkYOld(a4) + move.b #1,Edt_LinkFlag(a4) + movem.l a4/a6,-(sp) + move.l d0,a4 + move.l Edt_Prg(a4),a6 + tst.b Edt_LinkFlag(a4) + bne.s .PaBoucle + move.w Edt_YPos(a4),d0 + add.w d1,d0 + bpl.s .Plus + moveq #0,d0 +.Plus move.w d0,d1 + add.w Edt_YCu(a4),d1 + cmp.w Prg_NLigne(a6),d1 + bcs.s .2Dan + move.w Prg_NLigne(a6),d0 + sub.w Edt_YCu(a4),d0 + bpl.s .2Dan + move.w Prg_NLigne(a6),Edt_YCu(a4) + moveq #0,d0 +.2Dan move.w d0,Edt_YPos(a4) + tst.w Edt_WindTy(a4) + beq.s .Skip + bsr Ed_NewBuf +.Skip bset #EtA_Y,Edt_EtatAff(a4) +; Appelle la fenetre suivante - RECURSIF : youpi youpla + bsr .Recurse +; Revient ïż½ la precedente fenetre +.PaBoucle + movem.l (sp)+,a4/a6 + clr.b Edt_LinkFlag(a4) +; Revient ïż½ le precedente +.Out rts + + +; __________________________________________________________________________ +; +; GESTION DES FENETRES SPLITTEES +; __________________________________________________________________________ +; + +; +; Split program's view +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_SplitWindow + bsr Ed_TokCur +; Ouvre la fenetre + move.l a4,-(sp) + moveq #-1,d0 Vue + moveq #-1,d1 Pas de structure programme + bsr Edt_OpWindow Va ouvrir + blt Ed_OMm + bgt Ed_2ManyWindow +; Insere la fenetre dans la liste LINK + move.l (sp),a0 + move.l a0,Edt_LinkPrev(a4) + move.l Edt_LinkNext(a0),d0 + move.l a4,Edt_LinkNext(a0) + move.l d0,Edt_LinkNext(a4) + beq.s .Skip + move.l d0,a1 + move.l a4,Edt_LinkPrev(a1) +.Skip +; Copie la zone de donnees + move.l a6,Edt_Prg(a4) Met le programme + addq.b #1,Prg_Edited(a6) Une fenetre de plus sur le prog. + lea Edt_SSplit(a0),a0 Copie positions curseur / texte + lea Edt_SSplit(a4),a1 + move.w #(Edt_ESplit-Edt_SSplit)/2-1,d0 +.Loop move.w (a0)+,(a1)+ + dbra d0,.Loop +; Affiche + bsr Ed_DrawWindows +.Out addq.l #4,sp +.Out2 rts + +; +; Gestion proprement dite +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +; D0= Flags +; A0= Fenetre origine +Ed_Splitted + move.l Edt_LinkPrev(a0),d1 + or.l Edt_LinkNext(a0),d1 + beq .SplitX + movem.l a2-a6/d2-d7,-(sp) + move.w d0,-(sp) + move.l a0,a3 +; Trouve la premiere + move.l a3,a4 + bra.s .Deuse +.Preums move.l d0,a4 +.Deuse move.l Edt_LinkPrev(a4),d0 + bne.s .Preums +; Actualise les fenetres une a une +.Autre cmp.l a3,a4 + beq .Next + tst.w Edt_WindTy(a4) + beq .Next + move.l Edt_Prg(a4),a6 +; Changer les flags comme l'autre fenetre + move.b Edt_EtatAff(a3),Edt_EtatAff(a4) +; Redessiner tout le buffer, en verifiant la position + move.w (sp),d0 + btst #1,d0 + beq.s .PaAll + move.w Edt_YPos(a4),d0 + add.w Edt_YCu(a4),d0 + cmp.w Prg_NLigne(a6),d0 + bcs.s .2dan + move.w Prg_NLigne(a6),d0 + sub.w Edt_YCu(a4),d0 + bpl.s .Sz + move.w Prg_NLigne(a6),Edt_YCu(a4) + moveq #0,d0 +.Sz move.w d0,Edt_YPos(a4) +.2dan bsr Ed_NewBuf +.PaAll +; Update simple de la ligne courante + move.w (sp),d0 + btst #0,d0 + beq.s .PaLicu + move.w Edt_YPos(a3),d1 + add.w Edt_YCu(a3),d1 + sub.w Edt_YPos(a4),d1 + bmi.s .Next + cmp.w Edt_WindTy(a4),d1 + bcc.s .Next + move.w d1,-(sp) + move.w Edt_YCu(a3),d0 + lsl.w #8,d0 + lsl.w #8,d1 + move.l Edt_BufE(a3),a0 + move.l Edt_BufE(a4),a1 + add.w d0,a0 + add.w d1,a1 + moveq #256/4-1,d0 +.Copy move.l (a0)+,(a1)+ + dbra d0,.Copy + move.w Edt_Window(a4),d1 + WiCall QWindow + move.w (sp)+,d1 + bsr Ed_EALigne +.PaLicu +; Encore une fenetre? +.Next move.l Edt_LinkNext(a4),d0 + move.l d0,a4 + bne .Autre +; Reactive la fenetre originelle + move.w Edt_Window(a3),d1 + WiCall QWindow + addq.l #2,sp + movem.l (sp)+,a2-a6/d2-d7 +; Fini +.SplitX rts + + + +; ___________________________________________________________________ +; +; APPEL D'UNE FONCTION DE L'EDITEUR +; +; D2 Numero de la fonction +; ___________________________________________________________________ +; +Ed_FCall +; Nettoyage +; ~~~~~~~~~ + bsr Ed_ClEProc + bsr EdM_Program + bsr Ed_CuOff +; Stocke les flags pour le splitter +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + lea FlagFonc(pc),a0 + move.b 0(a0,d2.w),d0 + tst.w EdMa_Tape(a5) + beq.s .PaM + btst #5,d0 + beq.s .NoMacro +.PaM move.b d0,Ed_SCallFlags(a5) + btst #2,d0 + beq.s .Notst + bsr Ed_LCourant + bne Ed_NotEdit +.Notst move.w Edt_YCu(a4),d0 + add.w Edt_YPos(a4),d0 + move.w d0,Edt_YOldBloc(a4) +; Fonction ou programme? +; ~~~~~~~~~~~~~~~~~~~~~~ + move.w d2,d1 + ext.l d1 + cmp.w #HiddenCommands-1,d2 + bcs.s .Fonc +; Hidden programs + sub.w #HiddenCommands-1,d1 + divu #3,d1 + swap d1 + moveq #HiddenCall-1,d2 RUN / EDIT ou NEW? + add.w d1,d2 + clr.w d1 + swap d1 + add.w EdM_PosHidden(a5),d1 Plus position courante! + bra.s .Call +; Autoload? +.Fonc move.w d2,d0 + mulu #3,d0 + lea Ed_AutoLoad(a5),a0 + tst.b 0(a0,d0.w) + bne.s .Prg +; Appelle la fonction! +.Call lsl.w #2,d2 + clr.w T_Actualise(a5) + lea JFonc(pc),a0 + moveq #0,d0 + jmp 0(a0,d2.w) +; Appel d'un programme externe, si pas zappeuse! +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.Prg tst.b Ed_Zappeuse(a5) + bne.s .Call + lea 0(a0,d0.w),a0 + tst.w EdMa_Tape(a5) Pas si macro record + beq Ed_PrgCommand +; On ne peut utiliser cette commande dans une macro! +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.NoMacro + subq.w #3,EdMa_Tape(a5) Recule le pointeur + moveq #EdD_Macro3,d0 + bsr Ed_Dialogue + bra Ed_Loop + +; Branchement ïż½ HELP par F5 +; ~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_GoHelp + moveq #26,d2 + bra Ed_FCall + +; ___________________________________________________________________ +; +; ENTREE DE LA TELECOMMANDE +; +; D0 Fonction +; D1 Parametre +; Name1 Chaine de commande +; ___________________________________________________________________ +; +Ed_ZapIn +; Pas le meme programme! +; ~~~~~~~~~~~~~~~~~~~~~~ + move.l Edt_Runned(a5),a2 + cmp.l Edt_Current(a5),a2 + beq .NoAcc + tst.b Prg_Accessory(a5) + beq .NoAcc +; Sauve les donnees du programme appelant +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + move.l d0,d2 + move.l d1,Ed_ZapParam(a5) + move.l Edt_Prg(a2),a0 + lea Prg_ZapData(a0),a0 + JJsrR L_Prg_DataSave,a1 + JJsrR L_Prg_DataNew,a1 +; Prepare le terrain +; ~~~~~~~~~~~~~~~~~~ + clr.w Ed_ZapError(a5) + subq.w #1,d2 + cmp.w #HiddenCommands,d2 + bcc.s .PaCom + lea FlagFonc(pc),a0 + move.b 0(a0,d2.w),d1 Commande Zappable? + bpl.s .PaCom + btst #6,d1 Une ligne de commande? + beq.s .Branch + move.l Name2(a5),a0 Oui, est-elle fournie? + tst.w (a0) Longueur en NAME2, + beq.s .BadCh String en NAME1... +; Branche ïż½ la fonction! +; ~~~~~~~~~~~~~~~~~~~~~~ +.Branch and.b #$F0,d1 Mode zappeuse! + move.b d1,Ed_Zappeuse(a5) + EcCalD Active,EcEdit Active l'ecran editeur + move.l BasSp(a5),sp + move.l Edt_Current(a5),a4 Programme courant branche! + move.l Edt_Prg(a4),a6 + JJsr L_Prg_SetBanks + clr.b Ed_YaUTest(a4) Flags utiles + move.b Prg_MathFlags(a6),MathFlags(a5) + clr.w Ed_ZapCounter(a5) + bsr Ed_FCall Appel de la fonction + bra Ed_Loop +; Erreur, commande non Zappable +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.PaCom move.w #-4,Ed_ZapError(a5) + moveq #13,d0 + bra.s .Err +; Erreur, pas de chaine de commande +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.BadCh move.w #-5,Ed_ZapError(a5) + moveq #14,d0 +.Err bsr Ed_GetMessage + move.l a0,Ed_ZapMessage(a5) + bra.s Ed_ZapOut +; Erreur immediate, pas un accessoire / Deja runne +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.NoAcc move.w #-6,Ed_ZapError(a5) + moveq #15,d0 + bsr Ed_GetMessage + move.l a0,Ed_ZapMessage(a5) + bra.s Ed_ZapX +; _________________________________________________ +; +; SORTIE DE LA TELECOMMANDE +; _________________________________________________ +; +Ed_ZapOut +; Rebranche le programme +; ~~~~~~~~~~~~~~~~~~~~~~ + bsr EdM_Program + tst.b Ed_YaUTest(a5) Nettoyer les variables + beq.s .NoNew + illegal Ne doit JAMAIS se produire! +; bsr Edt_ClearVar +.NoNew move.l Edt_Runned(a5),a4 Remet les variables du programme + move.l Edt_Prg(a4),a6 + lea Prg_ZapData(a6),a0 + JJsrR L_Prg_DataLoad,a1 +; Reactive l'ïż½cran courant, si ouvert +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + EcCalD Last,EcEdit En dernier! + bsr EdReCop + move.w ScOn(a5),d1 + beq.s Ed_ZapX + subq.w #1,d1 + EcCall Active +Ed_ZapX move.w Ed_ZapError(a5),d0 + ext.l d0 + move.l Ed_ZapMessage(a5),a0 + clr.w Ed_ZapError(a5) +; Retour au programme appelant! +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + move.l BasSp(a5),sp + rts + +; ZAP: remplacement d'une chaine dans la config +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +EdZ_NewConfig + lea Sys_Messages(a5),a2 Trouve la bonne config + move.l Ed_ZapParam(a5),d0 + beq.s .Skp + cmp.l #5,d0 Met le flag seulement + bhi.s .Skip + lea Ed_Systeme-4(a5),a2 + lsl.w #2,d0 + add.l d0,a2 +.Skp move.l (a2),a0 Trouve le nombre de messages + bsr Ed_GetNbMessage + move.l d0,d1 + move.l Name1(a5),a1 Pas trop loin? + move.l (a1)+,d0 Numero + cmp.l d1,d0 + bhi.s .Skip + move.l a2,a0 + bsr EdC_ChangeTexte Va changer! + bne Ed_OMm +.Skip move.b #1,EdC_Modified(a5) On a change le menu + move.b #1,EdC_Changed(a5) On a change la config! + rts +; ZAP: remplacement d'une ligne dans le programme +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +EdZ_NewLineTok + bsr.s EdZ_NewLine + bsr Ed_TokCur + rts +EdZ_NewLine +; Remplace la ligne par la nouvelle +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + bsr Ed_LCourant + move.l a0,a1 + move.l Name1(a5),a2 +.Loop move.b (a2)+,(a1)+ + bne.s .Loop + subq.l #1,a1 + sub.l a0,a1 + move.w a1,-2(a0) +; Reaffiche la ligne courante +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~ + addq.w #1,Edt_LEdited(a4) + bsr Ed_EALiCu + rts +; _________________________________________________ +; +; FONCTIONS TELECOMMANDE +; _________________________________________________ +; +Ed_ZapFonction + tst.b Prg_Accessory(a5) + beq.s .PaAcc + subq.l #1,d0 + cmp.l #EdZ_NFonc,d0 + bcc .IlFonc + move.l Edt_Current(a5),a2 + lsl.w #2,d0 + lea EdZ_Jump(pc),a0 + moveq #0,d2 + jsr 0(a0,d0.w) + rts +; Pas un accessoire +; ~~~~~~~~~~~~~~~~~ +.PaAcc moveq #15,d0 + moveq #-6,d1 + bra.s .Err +; Illegal function call +; ~~~~~~~~~~~~~~~~~~~~~ +.IlFonc moveq #16,d0 + moveq #-7,d1 +; Retour avec le message +; ~~~~~~~~~~~~~~~~~~~~~~ +.Err bsr Ed_GetMessage + move.l d1,d0 + moveq #2,d2 + rts + +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +EdZ_Jump + bra EdZ_GetLine 1 La ligne courante + bra EdZ_GetName 2 Nom du programme courant + bra EdZ_GetX 3 Position en X + bra EdZ_GetY 4 Position en Y + bra EdZ_GetNLigne 5 Nombre de lignes + bra EdZ_X1Bloc 6 Debut X du bloc ombre + bra EdZ_Y1Bloc 7 Debut Y du bloc ombre + bra EdZ_X2Bloc 8 Fin X du bloc ombre + bra EdZ_Y2Bloc 9 Fin Y du bloc ombre + bra EdZ_GetFree 10 Espace libre + bra EdZ_GetStruc 11 Adresse de la structure + bra EdZ_Token 12 Tokenise la ligne + bra EdZ_GetConfig 13 Adresse de la config +EdZ_NFonc equ 11 +; +;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +EdZ_GetConfig + lea Ed_Config(a5),a0 + move.l a0,d0 + bra.s EdZ_Coo +EdZ_X1Bloc + bsr EdZ_Bloc + move.w d4,d0 + bra.s EdZ_Coo +EdZ_Y1Bloc + bsr EdZ_Bloc + bra.s EdZ_Coo +EdZ_X2Bloc + bsr EdZ_Bloc + move.w d5,d0 + bra.s EdZ_Coo +EdZ_Y2Bloc + bsr EdZ_Bloc + move.w d1,d0 + bra.s EdZ_Coo +EdZ_GetX + move.w Edt_XCu(a2),d0 + bra.s EdZ_Coo +EdZ_GetY + move.w Edt_YPos(a2),d0 + add.w Edt_YCu(a2),d0 +EdZ_Coo addq.w #1,d0 + ext.l d0 + rts +EdZ_GetNLigne + move.l Edt_Prg(a2),a0 + move.w Prg_NLigne(a0),d0 + ext.l d0 + rts +EdZ_GetFree + move.l Edt_Prg(a2),a0 + move.l Prg_StBas(a0),d0 + sub.l Prg_StMini(a0),d0 + rts +EdZ_GetStruc + move.l a2,d0 + rts +EdZ_GetName + move.l Edt_Prg(a2),a0 + lea Prg_NamePrg(a0),a0 + moveq #0,d0 + moveq #2,d2 + rts +EdZ_GetLine + movem.l a4/a6,-(sp) + move.l a2,a4 + move.l Edt_Prg(a4),a6 + move.l Ed_BufT(a5),a1 + clr.w (a1) + move.l d1,d0 + ble.s .LiCu +; Ligne quelconque + subq.w #1,d0 + cmp.w Prg_NLigne(a6),d1 + bhi.s .Out + bra.s .Li +; Ligne sous le curseur +.LiCu move.w Edt_YCu(a4),d0 + add.w Edt_YPos(a4),d0 +.Li bsr Ed_FindL + beq.s .Out + moveq #0,d0 + bsr Detok +.Out move.l Ed_BufT(a5),a0 + move.w (a0)+,d0 + clr.b 0(a0,d0.w) + moveq #0,d0 + moveq #2,d2 + movem.l (sp)+,a4/a6 + rts +EdZ_Bloc + move.w Edt_YBloc(a2),d0 + bmi.s .No + move.w Edt_YCu(a2),d1 + add.w Edt_YPos(a2),d1 + move.w Edt_XBloc(a2),d4 + move.w Edt_XCu(a2),d5 + cmp.w d0,d1 + bhi.s .Ok + bne.s .Sw + cmp.w d4,d5 + bcc.s .Ok +.Sw exg d0,d1 + exg d4,d5 +.Ok rts +.No addq.l #4,sp + moveq #-1,d0 + rts +; Tokenise la ligne du buffer +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~ +EdZ_Token + move.l a2,-(sp) + move.l Buffer(a5),a0 + move.l Ed_BufT(a5),a1 + bsr Tokenise + move.l Ed_BufT(a5),d0 + moveq #0,d2 + move.l (sp)+,a2 + rts + + +; ______________________________________________________________________ +; +; LISTES / MEMOIRE +; ______________________________________________________________________ + +; Reserve un espace mïż½moire sur (a5) +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +; A0= Adresse dans (a5) +; D0= Longueur +Ed_MemReserve + movem.l d1/a1,-(sp) + move.l a0,a1 + move.l d0,d1 + addq.l #4,d0 + SyCall MemFastClear + beq.s .Out + move.l d1,(a0)+ + move.l a0,(a1) +.Out movem.l (sp)+,d1/a1 + rts +; Efface un espace mïż½moire sur (a5) +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +; A0= Adresse dans (a5) +Ed_MemFree + movem.l a0/a1,-(sp) + move.l (a0),d0 + beq.s .Skip + clr.l (a0) + move.l d0,a1 + move.l -(a1),d0 + addq.l #4,d0 + SyCall SyFree +.Skip movem.l (sp)+,a0/a1 + rts + +; +; Cree un ïż½lïż½ment en tete de liste A0 / longueur D0 +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_ListeNew + movem.l a0/d0/d1,-(sp) + addq.l #8,d0 + exg a0,a1 + SyCall MemFastClear + exg a0,a1 + beq.s .Err + move.l (a0),(a1) + move.l a1,(a0) + subq.l #8,d0 + move.l d0,4(a1) +.Err movem.l (sp)+,a0/d0/d1 + rts + +; Efface une liste entiere A0 +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_ListeDelAll + bra.s .In +.Loop move.l d0,a1 + bsr Ed_ListeDel +.In move.l (a0),d0 + bne.s .Loop + rts +; Efface un ïż½lïż½ment de liste A1 / Debut liste A0 +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_ListeDel + movem.l a0/d0-d2,-(sp) + move.l a1,d0 + move.l a0,a1 + move.l (a1),d2 + beq.s .NFound +.Loop move.l a1,d1 + move.l d2,a1 + cmp.l d0,a1 + beq.s .Found + move.l (a1),d2 + bne.s .Loop + bra.s .NFound +; Enleve de la liste +.Found move.l d1,a0 + move.l (a1),(a0) + move.l 4(a1),d0 + addq.l #8,d0 + SyCall MemFree +.NFound movem.l (sp)+,a0/d0-d2 + rts + +; Clearvar du programme courant +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Edt_ClearVar + bsr EdM_Program + JJsr L_Prg_SetBanks + JJsr L_ClearVar + rts +; +; Actualisation des ecrans +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +EdReCop SyCall WaitVbl + EcCall CopForce + rts + +; ______________________________________________________________________ +; +; BOITES DE DIALOGUE +; ______________________________________________________________________ + +; Initialisation +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_InitDialogues + bsr Ed_SetBanks + moveq #1,d0 Canal #1 + move.l #1024,d1 1024 octets + moveq #16,d2 16 variables + moveq #0,d3 Ne pas recopier la chaine + move.l Ed_Resource(a5),a0 + move.l a0,a1 + add.l 2+8(a0),a0 Base des programmes + add.l 2+0(a0),a0 Programme numero 1 + add.l 2(a1),a1 Base des graphiques + move.l Ed_Messages(a5),a2 Base des messages + JJsrP L_Dia_OpenChannel,a3 + bne.s .Err + move.l a0,Ed_ADialogues(a5) + move.l a1,Ed_VDialogues(a5) + move.l #Ed_DiaImages,Dia_PuzzleI(a0) + bsr Ed_IChaine + moveq #0,d0 +.Err rts + +; Fin des dialogues +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_EndDialogues + bsr Ed_SetBanks + moveq #1,d0 + JJsr L_Dia_CloseChannel + rts + +; Copie une chaine dans le buffer de dialogue +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_IChaine + move.l Ed_BufT(a5),Ed_DiaCopyC(a5) + rts +Ed_DChaine + move.l Ed_DiaCopyC(a5),Ed_DiaCopyD(a5) + addq.l #2,Ed_DiaCopyC(a5) +Ed_AChaine + move.l Ed_DiaCopyC(a5),a1 +.Loop move.b (a0)+,(a1)+ + bne.s .Loop + subq.l #1,a1 + move.l a1,Ed_DiaCopyC(a5) + move.l a1,d0 + move.l Ed_DiaCopyD(a5),a1 + sub.l a1,d0 + subq.b #2,d0 + clr.b (a1) + move.b d0,1(a1) + rts + +; Appel general des dialogues, avec protection memoire +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_Dialogue: + tst.b Ed_Zappeuse(a5) + beq.s .NoZap + move.l Ed_ZapParam(a5),d0 Zappeuse: retourne parametre + rts +; Au moins 48k de CHIP pour un effacement... +.NoZap clr.l Dia_Magic(a5) + movem.l d0/a6,-(sp) + move.l $4.w,a6 + move.l #Public|Chip,d1 + jsr _LVOAvailMem(a6) + move.l d0,d1 + movem.l (sp)+,d0/a6 + cmp.l #48*1024,d1 + bcc.s Ed_DoDialog +; Sans effacement! + move.l #"NobL",Dia_Magic(a5) + bsr Ed_DoDialog + movem.l d0-d1/a0-a1,-(sp) + bsr Ed_DrawWindows + movem.l (sp)+,d0-d1/a0-a1 + rts +; Appel des dialogues +; ~~~~~~~~~~~~~~~~~~~ +Ed_DoDialog + bsr Ed_SetBanks + movem.l d2-d3,-(sp) + move.l d0,d1 + moveq #1,d0 + move.l #EntNul,d2 + move.l d2,d3 + JJsr L_Dia_RunProgram + movem.l (sp)+,d2-d3 + clr.l Dia_Magic(a5) + move.l d1,d0 + bsr Ed_IChaine + rts + + +; _________________________________________________________________________ +; +; Jumps aux touches de fonction +; _________________________________________________________________________ +; +JFonc: bra Ed_CHaut * 1 Cur Haut + bra Ed_CBas * 2 Cur Bas + bra Ed_CGauche * 3 Cur Gauche + bra Ed_CDroite * 4 Cur Droite + bra Ed_HPage * 5 Haut Page + bra Ed_BPage * 6 Bas Page + bra Ed_MGauche * 7 Mot gauche + bra Ed_MDroite * 8 Mot Droite + bra Ed_PHaut * 9 Page Haut + bra Ed_PBas * 10 Page Bas + bra Ed_DLigne * 11 Debut Ligne + bra Ed_FLigne * 12 Fin Ligne + bra Ed_EtatUp * 13 Bar Haut Haut + bra Ed_EtatDown * 14 Bar haut Bas + bra Ed_BasUp * 15 Bar Bas Haut + bra Ed_BasDown * 16 Bar Bas Bas + bra Ed_HTexte * 17 Haut Texte + bra Ed_BTexte * 18 Bas Texte + bra Ed_Return * 19 Return + bra Ed_Back * 20 Backspace + bra Ed_Delete * 21 Delete + bra Ed_EffLigne * 22 Effacement Ligne + bra Ed_DelLiCu * 23 Delete Ligne + bra Ed_Tab * 24 Plus Tab + bra Ed_ShTab * 25 Moins Tab + bra Ed_STab * 26 Set Tab + bra Ed_UserMenu * 27 Help + bra Ed_Escape * 28 Escape + bra Ed_InsLine * 29 Insert Ligne + bra Ed_DelFin * 30 Delete Fin Ligne + bra Ed_PLabel * 31 Previous Label + bra Ed_NLabel * 32 Next Label + bra Ed_Load * 33 Load + bra Ed_SaveAs * 34 SaveAs + bra Ed_Save * 35 Save + bra Ed_DelMot * 36 Del Mot + bra Ed_BackMot * 37 Back Mot + bra Ed_WindowHide * 38 Hide Project + bra Ed_SMark0 * 39 Set Marks + bra Ed_SMark1 + bra Ed_SMark2 + bra Ed_SMark3 + bra Ed_SMark4 + bra Ed_SMark5 + bra Ed_SMark6 + bra Ed_SMark7 + bra Ed_SMark8 + bra Ed_SMark9 + bra Ed_GMark0 * 49 Goto Mark + bra Ed_GMark1 + bra Ed_GMark2 + bra Ed_GMark3 + bra Ed_GMark4 + bra Ed_GMark5 + bra Ed_GMark6 + bra Ed_GMark7 + bra Ed_GMark8 + bra Ed_GMark9 + bra Ed_BlocOn * 59 Marche / Arret Bloc + bra Ed_BlocForget * 60 Forget Bloc + bra Ed_OpenLoad * 61 Open + Load + bra Ed_BlocCut * 62 Cut Bloc + bra Ed_BlocPaste * 63 Paste Bloc + bra Ed_DelDebut * 64 Delete to S.O.L + bra Ed_Undo * 65 Undo + bra Ed_Search * 66 Search + bra Ed_SearchNext * 67 Search Next + bra Ed_SearchPrev * 68 Search Previous + bra EdZ_NewLine * 69 ZAPPEUSE: replace line + bra Ed_RAlert * 70 Recall last alert + bra EdZ_NewLineTok * 71 ZAPPEUSE: replace+tokenise + bra Ed_BlocStore * 72 Store bloc + + bra Ed_Key2Menu * 73 Set Key Shortcut + bra Ed_Prg2Menu * 74 Affect Program to menu + bra Ed_Ins * 75 Flip Insert Mode + bra Ed_GotoL * 76 Goto Line Number + bra Ed_Run * 77 Run + bra Ed_Test * 78 Test + bra Ed_Indent * 79 Indent + bra Ed_New * 80 Clear + bra Ed_CloseWindowQuit * 81 Close + bra Ed_Quit * 82 Quit + bra Ed_Infos * 83 Editor Informations + bra Ed_Merge * 84 Merge + bra Ed_LoadA * 85 Merge Ascii + bra Ed_BlocPrint * 86 Print Bloc + bra Ed_ProcOpen * 87 Open / Close + bra Ed_LoadHidden * 88 Load Hidden program + bra Ed_ProcsOpen * 89 Open All + bra Ed_ProcsClose * 90 Close All + bra Ed_PrevWindow * 91 Previous Window + bra Ed_NextWindow * 92 Next Window + bra Ed_FlipSizeWindow * 93 Enlarge Window + bra Ed_Redo * 94 Redo + bra Ed_SplitWindow * 95 Split View + bra Ed_LinkCursor * 96 Link Cursor + bra Ed_BlocSaveAscii * 97 Save Block as Ascii + bra Ed_BlocSave * 98 Save Block + bra Ed_Replace * 99 Replace New + bra Ed_ReplaceNext * 100 Replace Next + bra Ed_ReplacePrev * 101 Replace Previous + bra Ed_NewAllHidden * 102 New All Hidden Programs + bra Ed_OpenWindow * 103 Open New + bra Ed_ShowKey * 104 Show Key shortcuts + bra Ed_Wb * 105 Workbench + bra EdMa_New * 106 Set new Macro + bra EdMa_Del * 107 Clear One Macro + bra EdMa_DelAll * 108 Clear All Macros + bra EdMa_LoadAs * 109 Load Macros + bra EdMa_SaveAs * 110 Save Macros +HiddenCommands equ 184 +HiddenCall equ 111 + bra Ed_RunHidden * 111 Run + bra Ed_EditHidden * 112 Edit + bra Ed_NewHidden * 113 New + bra Ed_SetBuffer * 114 Set Buffer +EdM_UserCommands equ 115 +EdM_UserLong equ 16 +EdM_UserMax equ 20 + bra Ed_UserMenu * 0 + bra Ed_UserMenu + bra Ed_UserMenu + bra Ed_UserMenu + bra Ed_UserMenu + bra Ed_UserMenu * 5 + bra Ed_UserMenu + bra Ed_UserMenu + bra Ed_UserMenu + bra Ed_UserMenu + bra Ed_UserMenu * 10 + bra Ed_UserMenu + bra Ed_UserMenu + bra Ed_UserMenu + bra Ed_UserMenu + bra Ed_UserMenu * 15 + bra Ed_UserMenu + bra Ed_UserMenu + bra Ed_UserMenu + bra Ed_UserMenu + + bra Ed_AddUser * 135 Add user option + bra Ed_DelUser * 136 Del user option + bra EdC_SaveDefault * 137 Save default config + bra EdC_SaveAs * 138 Save As + bra EdC_LoadDefault * 139 Load default config + bra EdC_LoadAs * 140 Load As + bra Ed_QuitOptions * 141 Quit Options + bra Ed_SetAutoSave * 142 Autosave + bra EdMa_LoadDefault * 143 Load Default Macros + bra EdMa_SaveDefault * 144 Save Default Macros + bra Ed_GoMonitor * 145 Monitor + bra Ed_PrgPrint * 146 Program Print + bra Ed_Check1.3 * 147 Check 1.3 + bra Ed_SamOn * 148 Sound On / Off + bra Ed_AboutExt * 149 About extensions + bra Ed_About * 150 About AMOS + bra Ed_ProcML * 151 Insert machine langage + +; HELP: Insersion des commandes ZAP additionnelles + bra Ed_SaveAsName * 152 Sauve sans changer nom + bra Ed_CloseName * 153 Ferme une fenetre nom + bra Ed_Rename * 154 Rename le programme courant + bra Ed_UserMenu + bra Ed_UserMenu + bra Ed_UserMenu * 157 + bra Ed_UserMenu + bra Ed_UserMenu + bra Ed_UserMenu + bra Ed_UserMenu + bra Ed_UserMenu * 162 + bra Ed_UserMenu + bra Ed_UserMenu + bra Ed_UserMenu + bra Ed_UserMenu + bra Ed_UserMenu * 167 + bra Ed_UserMenu + bra Ed_UserMenu + bra Ed_UserMenu + bra Ed_UserMenu + bra Ed_UserMenu * 172 Interpretor Setup + bra Ed_UserMenu * 173 Editor Setup + bra Ed_UserMenu * 174 Editor Menus + bra Ed_UserMenu * 175 Editor Dialogs + bra Ed_UserMenu * 176 Test-Time + bra Ed_UserMenu * 177 Run-Time + bra Ed_UserMenu * 178 Colour Palette + bra EdM_PrevHidden * 179 Previous programs + bra EdM_NextHidden * 180 Next programs + bra Ed_BlocAll * 181 All text as block + bra EdZ_NewConfig * 182 ZAP: remplace chaine dans config + bra Ed_GoHelp * 183 Branche au HELP + bra Ed_UserMenu * 184 + +; Flags pour chaque fonction +; ~~~~~~~~~~~~~~~~~~~~~~~~~~ +FlagFonc +; Bit 0: redessiner le buffer +; Bit 1: redessiner la ligne +; Bit 2: Interdit si procedure fermee +; Bit 5: autorise en macro! +; Bit 6: transmettre une ligne de commande +; Bit 7: commande tïż½lïż½commandable + dc.b %10100000 * 1 Cur Haut + dc.b %10100000 * 2 Cur Bas + dc.b %10100000 * 3 Cur Gauche + dc.b %10100000 * 4 Cur Droite + dc.b %10100000 * 5 Haut Page + dc.b %10100000 * 6 Bas Page + dc.b %10100000 * 7 Mot gauche + dc.b %10100000 * 8 Mot Droite + dc.b %10100000 * 9 Page Haut + dc.b %10100000 * 10 Page Bas + dc.b %10100000 * 11 Debut Ligne + dc.b %10100000 * 12 Fin Ligne + dc.b %10100000 * 13 Bar Haut Haut + dc.b %10100000 * 14 Bar haut Bas + dc.b %10100000 * 15 Bar Bas Haut + dc.b %10100000 * 16 Bar Bas Bas + dc.b %10100000 * 17 Haut Texte + dc.b %10100000 * 18 Bas Texte + dc.b %10100011 * 19 Return + dc.b %10100101 * 20 Backspace + dc.b %10100101 * 21 Delete + dc.b %10100110 * 22 Effacement Ligne + dc.b %10100110 * 23 Delete Ligne + dc.b %10100101 * 24 Plus Tab + dc.b %10100101 * 25 Moins Tab + dc.b %00000000 * 26 Set Tab + dc.b %00000000 * 27 Help + dc.b %00000000 * 28 Escape + dc.b %10100010 * 29 Insert Ligne + dc.b %10100101 * 30 Delete Fin Ligne + dc.b %10100000 * 31 Previous Label + dc.b %10100000 * 32 Next Label + dc.b %10000010 * 33 Load + dc.b %10000010 * 34 SaveAs + dc.b %10000000 * 35 Save + dc.b %10100100 * 36 Del Mot + dc.b %10100100 * 37 Back Mot + dc.b %00000000 * 38 Hide Project + dc.b %10100000 * 39 Set Marks + dc.b %10100000 + dc.b %10100000 + dc.b %10100000 + dc.b %10100000 + dc.b %10100000 + dc.b %10100000 + dc.b %10100000 + dc.b %10100000 + dc.b %10100000 + dc.b %10100000 * 49 Goto Mark + dc.b %10100000 + dc.b %10100000 + dc.b %10100000 + dc.b %10100000 + dc.b %10100000 + dc.b %10100000 + dc.b %10100000 + dc.b %10100000 + dc.b %10100000 + dc.b %10100000 * 59 Marche / Arret Bloc + dc.b %10100010 * 60 Forget Bloc + dc.b %10000010 * 61 Open + Load + dc.b %10100010 * 62 Cut Bloc + dc.b %10100010 * 63 Paste Bloc + dc.b %10100110 * 64 Delete to S.O.L + dc.b %10000001 * 65 Undo + dc.b %10000000 * 66 Search + dc.b %10100000 * 67 Search Next + dc.b %10100001 * 68 Search Previous + dc.b %10000100 * 69 ZAPPEUSE: Newline + dc.b %00000000 * 70 Recall last alert + dc.b %10000110 * 71 ZAPPEUSE: Newline+Tokenise + dc.b %10100000 * 72 Store bloc + + dc.b %00000010 * 73 Set Key Shortcut + dc.b %00000010 * 74 Affect Program to menu + dc.b %00100000 * 75 Flip Insert Mode + dc.b %10000000 * 76 Goto Line Number + dc.b %00000000 * 77 Run + dc.b %00000000 * 78 Test + dc.b %00000010 * 79 Indent + dc.b %10000010 * 80 Clear + dc.b %10000000 * 81 Close + dc.b %00000000 * 82 Quit + dc.b %00000000 * 83 Informations + dc.b %10100110 * 84 Merge + dc.b %10100110 * 85 Merge Ascii + dc.b %10000000 * 86 Print Bloc + dc.b %00000010 * 87 Open / Close + dc.b %00000010 * 88 Load Hidden program + dc.b %10000010 * 89 Open All + dc.b %00000010 * 90 Close All + dc.b %10000000 * 91 Previous Window + dc.b %10000000 * 92 Next Window + dc.b %10000000 * 93 Enlarge Window + dc.b %10000000 * 94 Redo + dc.b %00000000 * 95 Split View + dc.b %00000000 * 96 Link Cursor + dc.b %10100000 * 97 Save Block as Ascii + dc.b %10100000 * 98 Save Block + dc.b %10100010 * 99 Replace + dc.b %10000010 * 100 Replace Next + dc.b %10000000 * 101 Replace Previous + dc.b %00000000 * 102 New All Hidden Programs + dc.b %10000000 * 103 Open New + dc.b %00000000 * 104 Show Key shortcuts + dc.b %00000000 * 105 Workbench + dc.b %00000000 * 106 Set New Macro + dc.b %00000000 * 107 Clear Macro + dc.b %00000000 * 108 Clear All Macros + dc.b %00000000 * 109 Load Macros + dc.b %00000000 * 110 Save Macros + dc.b %00000000 * 111 Run + dc.b %00000000 * 112 Edit + dc.b %00000000 * 113 New + dc.b %00000000 * 114 Set TextBuffer + + dc.b %00000000 * 0 User Menu + dc.b %00000000 * User Menu + dc.b %00000000 * User Menu + dc.b %00000000 * User Menu + dc.b %00000000 * User Menu + dc.b %00000000 * 5 User Menu + dc.b %00000000 * User Menu + dc.b %00000000 * User Menu + dc.b %00000000 * User Menu + dc.b %00000000 * User Menu + dc.b %00000000 * 10 User Menu + dc.b %00000000 * User Menu + dc.b %00000000 * User Menu + dc.b %00000000 * User Menu + dc.b %00000000 * User Menu + dc.b %00000000 * 15 User Menu + dc.b %00000000 * User Menu + dc.b %00000000 * User Menu + dc.b %00000000 * User Menu + dc.b %00000000 * User Menu + + dc.b %00000000 * 135 Add user option + dc.b %00000000 * 136 Del user option + dc.b %00000000 * 137 Save default config + dc.b %00000000 * 138 Save As + dc.b %00000000 * 139 Load default config + dc.b %00000000 * 140 Load As + dc.b %00000000 * 141 Quit Options + dc.b %00000000 * 142 Autosave + dc.b %00000000 * 143 Load Default Macros + dc.b %00000000 * 144 Save Default Macros + dc.b %00000000 * 145 Monitor + dc.b %10000000 * 146 Program Print + dc.b %00000000 * 147 Check 1.3 + dc.b %00000000 * 148 Sound On / Off + dc.b %00000000 * 149 About extensions + dc.b %00000000 * 150 About AMOS + dc.b %00000000 * 151 Insert machine langage +; HELP: Insersion des commandes ZAP additionnelles + dc.b %11000000 * 152 Save As Name + dc.b %11000000 + dc.b %11000000 + dc.b %00000000 + dc.b %00000000 + dc.b %00000000 * 157 + dc.b %00000000 + dc.b %00000000 + dc.b %00000000 + dc.b %00000000 + dc.b %00000000 * 162 + dc.b %00000000 + dc.b %00000000 + dc.b %00000000 + dc.b %00000000 + dc.b %00000000 * 167 + dc.b %00000000 + dc.b %00000000 + dc.b %00000000 + dc.b %00000000 + dc.b %00000000 * 172 Interpretor Setup + dc.b %00000000 * 173 Editor Setup + dc.b %00000000 * 174 Editor Menus + dc.b %00000000 * 175 Editor Dialogs + dc.b %00000000 * 176 Test-Time + dc.b %00000000 * 177 Run-Time + dc.b %00000000 * 178 Colour Palette + dc.b %00000000 * 179 Previous programs + dc.b %00000000 * 180 Next programs + dc.b %10000000 * 181 All text as block + dc.b %11000000 * 182 Change config string + dc.b %00000000 * 183 + dc.b %00000000 * 184 + even + +; +; BACKSPACE +; ~~~~~~~~~ +Ed_Back + tst.w Edt_XCu(a4) + beq Ed_Join + bsr Ed_CGauche + bsr Ed_Delete +.Skip rts + +; +; DELETE +; ~~~~~~ +Ed_Delete + moveq #"F",d0 Va faire du bruit! + bsr Ed_SamPlay + bsr Ed_LCourant + sub.w Edt_XCu(a4),d0 + subq.w #1,d0 + bmi CFin +; Gestion de l'UNDO + bsr Un_Debut + bne.s .Skip + move.b #$02,(a2) + move.b (a1),5(a2) +.Skip +; Enleve la lettre + moveq #1,d0 + bsr R_DelChar + bra Ed_EALiCu + +; +; EFFACEMENT LIGNE +; ~~~~~~~~~~~~~~~~ +Ed_EffLigne + addq.w #1,Edt_LEdited(a4) + clr.w Edt_XCu(a4) + bsr Ed_LCourant + moveq #0,d0 + move.w -2(a0),d0 + clr.w -2(a0) + bsr Un_CLine + bsr Ed_EALiCu + bra Ed_Cent + +; +; DELETE JUSQUA LA FIN DE LA LIGNE +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_DelFin + addq.w #1,Edt_LEdited(a4) + bsr Ed_LCourant + cmp.w d0,d1 + bcc.s .EdFin + move.w -2(a0),d0 + move.w d1,-2(a0) + sub.w d1,d0 + ext.l d0 + move.l a1,a0 + bsr Un_CLine + bra Ed_EALiCu +.EdFin rts +; +; DELETE JUSQU'AU DEBUT DE LA LIGNE +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_DelDebut + bsr Ed_LCourant + tst.w d1 + beq.s .Out + cmp.w d0,d1 + bcc.s .Skip + move.w d1,d0 +.Skip clr.w Edt_XCu(a4) + ext.l d0 + bsr Un_CLine + bsr R_DelChar + bsr Ed_EALiCu +.Out rts +; +; SHIFT-DELETE MOT A DROITE +; ~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_DelMot + bsr R_MotDroi + move.w Edt_XCu(a4),d0 + cmp.w d0,d1 + bls.s .Skip + sub.w d0,d1 + move.w d1,d2 + bsr Ed_LCourant + cmp.w d0,d1 + bcc.s .Skip + move.w d2,d0 + move.l a1,a0 + ext.l d0 + bsr Un_CLine + move.w d2,d0 + bsr R_DelChar + bsr Ed_EALiCu +.Skip rts + +; +; SHIFT-BACKSPACE MOT A GAUCHE +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_BackMot + bsr R_MotGoch + move.w Edt_XCu(a4),d0 + cmp.w d0,d1 + bcc.s .Skip + move.w d1,Edt_XCu(a4) + bsr Ed_Cent + bra.s Ed_DelMot +.Skip rts + +; +; TAB +; ~~~ +Ed_Tab + bsr Ed_LCourant + lea 0(a0,d0.w),a1 * Fin actuelle + move.w Ed_Tabs(a5),d2 + add.w d2,d0 + cmp.w #250,d0 + bcc Ed_LToLong + add.w d2,-2(a0) + lea 0(a0,d0.w),a2 * Nouvelle fin + bra.s .ETab2 +.ETab1 move.b -(a1),-(a2) +.ETab2 cmp.l a0,a1 + bhi.s .ETab1 + add.w d2,Edt_XCu(a4) + subq.w #1,d2 + bmi.s ETab4 +.ETab3 move.b #" ",(a1)+ + dbra d2,.ETab3 +ETab4 addq.w #1,Edt_LEdited(a4) + move.w Edt_YCu(a4),d1 + bsr Ed_EALigne + bsr Ed_Cent +ETabX rts + +; +; SHIFT TAB (enleve les tabs) +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_ShTab + bsr Ed_LCourant + lea 0(a0,d0.w),a2 + move.l a0,a1 + moveq #0,d0 + move.w Ed_Tabs(a5),d1 + subq.w #1,d1 + bmi.s ETabX +.ShT1 cmp.b #" ",(a0) + bne.s .ShT2 + addq.l #1,a0 + cmp.l a2,a0 + bcc.s .ShT2 + addq.w #1,d0 + dbra d1,.ShT1 +.ShT2 tst.w d0 + beq.s ETabX + sub.w d0,-2(a1) + sub.w d0,Edt_XCu(a4) + bpl.s .ShT4 + clr.w Edt_XCu(a4) + bra.s .ShT4 +.ShT3 move.b (a0)+,(a1)+ +.ShT4 cmp.l a2,a0 + bls.s .ShT3 + bra.s ETab4 + +; +; SET TAB VALUE +; ~~~~~~~~~~~~~ +Ed_STab bsr Ed_TokCur + move.l Ed_VDialogues(a5),a2 + moveq #0,d0 + move.w Ed_Tabs(a5),d0 + move.l d0,2*4(a2) + moveq #EdD_SetTab,d0 + bsr Ed_Dialogue + moveq #1,d0 + moveq #3,d1 + moveq #-1,d2 + JJsr L_Dia_GetValue + move.w d1,Ed_Tabs(a5) +; Flag pour QUIT + move.b #1,EdC_Changed(a5) + bra Ed_Loca + +; +; Curseur vers le haut +; ~~~~~~~~~~~~~~~~~~~~ +Ed_CHaut + bsr Ed_TokCur + moveq #"F",d0 Va faire du bruit! + bsr Ed_SamPlay +Ed_ChtT + bset #EtA_Y,Edt_EtatAff(a4) + tst.w Edt_YCu(a4) + beq.s CHt1 + subq.w #1,Edt_YCu(a4) + bra Ed_Loca +CHt1 tst.w Edt_YPos(a4) + beq Ed_CHtE + subq.w #1,Edt_YPos(a4) +; Scrolle l'ecran graphique +; ~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_CHt + move.b #SlDelai,Edt_ASlY(a4) + cmp.w #1,Edt_WindTy(a4) + beq.s .Skip + WiCalD ChrOut,20 +; Scrolle l'ecran texte +; ~~~~~~~~~~~~~~~~~~~~~ + move.l Edt_BufE(a4),a1 + move.w Edt_WindTy(a4),d0 + lsl.w #8,d0 + add.w d0,a1 + lea -256(a1),a0 + move.w Edt_WindTy(a4),d0 + subq.w #1,d0 + lsl.w #4,d0 + subq.w #1,d0 +.CBs2 move.l -(a0),-(a1) + move.l -(a0),-(a1) + move.l -(a0),-(a1) + move.l -(a0),-(a1) + dbra d0,.CBs2 +; Affiche la derniere ligne +; ~~~~~~~~~~~~~~~~~~~~~~~~~ +.Skip move.w Edt_YPos(a4),d0 + moveq #0,d1 + bsr Ed_Untok + bsr Ed_EALigne + bra Ed_Loca +; +; Pitit retour. +; ~~~~~~~~~~~~~ +CFin: rts + +; +; Curseur vers le bas +; ~~~~~~~~~~~~~~~~~~~ +Ed_CBas + bsr Ed_TokCur + moveq #"F",d0 Va faire du bruit! + bsr Ed_SamPlay + +; Entree pour la tokenisation +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_CBasT + bset #EtA_Y,Edt_EtatAff(a4) + move.w Edt_YPos(a4),d0 * Deja la derniere ligne + add.w Edt_YCu(a4),d0 + cmp.w Prg_NLigne(a6),d0 + bcc Ed_CBasE + + move.w Edt_YCu(a4),d0 + move.w Edt_WindTy(a4),d1 + subq.w #1,d1 + cmp.w d1,d0 + bcc.s .CBs1 + addq.w #1,Edt_YCu(a4) + bra Ed_Loca + +.CBs1: addq.w #1,Edt_YPos(a4) +; Scrolle l'ecran graphique +; ~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_CBs + move.b #SlDelai,Edt_ASlY(a4) + cmp.w #1,Edt_WindTy(a4) + beq.s .Skip + WiCalD ChrOut,22 +; Scrolle l'ecran texte +; ~~~~~~~~~~~~~~~~~~~~~ + move.l Edt_BufE(a4),a1 + lea 256(a1),a0 + move.w Edt_WindTy(a4),d0 + subq.w #1,d0 + lsl.w #4,d0 + subq.w #1,d0 +.CHt2 move.l (a0)+,(a1)+ + move.l (a0)+,(a1)+ + move.l (a0)+,(a1)+ + move.l (a0)+,(a1)+ + dbra d0,.CHt2 +; Affiche la derniere ligne +; ~~~~~~~~~~~~~~~~~~~~~~~~~ +.Skip move.w Edt_YPos(a4),d0 + move.w Edt_WindTy(a4),d1 + subq.w #1,d1 + add.w d1,d0 + bsr Ed_Untok + bsr Ed_EALigne + bra Ed_Loca + +; +; Curseur vers la gauche +; ~~~~~~~~~~~~~~~~~~~~~~ +Ed_CGauche + moveq #"F",d0 Va faire du bruit! + bsr Ed_SamPlay + + bset #EtA_X,Edt_EtatAff(a4) + move.w Edt_XCu(a4),d0 + beq CFin + subq.w #1,d0 + move.w d0,Edt_XCu(a4) + sub.w Edt_XPos(a4),d0 + cmp.w #15,d0 + bcc.s CGo1 + tst.w Edt_XPos(a4) + beq.s CGo1 +Ed_CGo + subq.w #1,Edt_XPos(a4) + WiCalD ChrOut,19 + moveq #0,d1 + bsr Ed_AffBufCar +CGo1 bra Ed_Loca + +; +; Curseur vers la droite +; ~~~~~~~~~~~~~~~~~~~~~~ +Ed_CDroite + moveq #"F",d0 Va faire du bruit! + bsr Ed_SamPlay + + bset #EtA_X,Edt_EtatAff(a4) + move.w Edt_XCu(a4),d0 + cmp.w #250,d0 + bcc CFin + addq.w #1,d0 + move.w d0,Edt_XCu(a4) + sub.w Edt_XPos(a4),d0 + cmp.w #WiTx-10,d0 + bcs.s CDr0 +Ed_CDr + addq.w #1,Edt_XPos(a4) + WiCalD ChrOut,17 + move.w Edt_WindTx(a4),d1 + subq.w #1,d1 + bsr Ed_AffBufCar +CDr0 bra Ed_Loca + +; +; Haut page +; ~~~~~~~~~ +Ed_HPage + bsr Ed_TokCur + clr.w Edt_YCu(a4) +Ed_LXY + or.b #EtA_BXY,Edt_EtatAff(a4) + bra Ed_Loca + +; +; Bas page +; ~~~~~~~~ +Ed_BPage + bsr Ed_TokCur + move.w Edt_WindTy(a4),d0 + subq.w #1,d0 + move.w Edt_YPos(a4),d1 + add.w d0,d1 + cmp.w Prg_NLigne(a6),d1 + bcs.s .BPag + sub.w Prg_NLigne(a6),d1 + sub.w d1,d0 +.BPag move.w d0,Edt_YCu(a4) + bra Ed_LXY + +; +; Mot gauche +; ~~~~~~~~~~ +Ed_MGauche + bsr R_MotGoch + move.w d1,Edt_XCu(a4) + bra Ed_Cent +; +; Mot droit +; ~~~~~~~~~ +Ed_MDroite + bsr R_MotDroi + move.w d1,Edt_XCu(a4) + bra Ed_Cent +; +; Pointe le mot PRECEDENT +; ~~~~~~~~~~~~~~~~~~~~~~~ +R_MotGoch + bsr Ed_LCourant + cmp.w d0,d1 + bls.s .MGo0 + move.w d0,d1 + bra.s .MGo4 +.MGo0 subq.w #1,d1 + bmi.s .MGo3 + cmp.b #32,-(a1) + bne.s .MGo2 +.MGo1 subq.w #1,d1 + bmi.s .MGo3 + cmp.b #32,-(a1) + beq.s .MGo1 +.MGo2 subq.w #1,d1 + bmi.s .MGo3 + move.b -(a1),d2 + bsr Une_Lettre + bne.s .MGo2 +.MGo3 addq.w #1,d1 +.MGo4 rts + +; Pointe le mot DROIT +; ~~~~~~~~~~~~~~~~~~~ +R_MotDroi + bsr Ed_LCourant +.MDr1 addq.w #1,d1 + cmp.w d0,d1 + bcc.s .MDr2 + move.b (a1)+,d2 + bsr Une_Lettre + bne.s .MDr1 + cmp.b #32,(a1) + beq.s .MDr1 +.MDr2 rts + + +; +; Debut ligne +; ~~~~~~~~~~~ +Ed_DLigne +Ed_DLigneT + clr.w Edt_XCu(a4) + bra Ed_Cent + +; +; Fin ligne +; ~~~~~~~~~ +Ed_FLigne + bsr Ed_LCourant + move.w d0,Edt_XCu(a4) + bra Ed_Cent + +; +; Page up +; ~~~~~~~ +Ed_PHaut + bsr Ed_TokCur + bset #EtA_Y,Edt_EtatAff(a4) + move.b #SlDelai,Edt_ASlY(a4) + tst.w Edt_YPos(a4) + beq Ed_HTex + move.w Edt_WindTy(a4),d0 + subq.w #2,d0 + bpl.s .Skip + moveq #1,d0 +.Skip sub.w d0,Edt_YPos(a4) + bcc Ed_NewBuf + clr.w Edt_YPos(a4) + bra Ed_NewBuf +; +; Page down +; ~~~~~~~~~ +Ed_PBas + bsr Ed_TokCur + move.w Edt_YPos(a4),d0 + add.w Edt_YCu(a4),d0 + move.w Edt_WindTy(a4),d1 + subq.w #2,d1 + bpl.s .Skip + moveq #1,d1 +.Skip add.w d1,d0 + cmp.w Prg_NLigne(a6),d0 + bcc Ed_BTex + add.w d1,Edt_YPos(a4) + bset #EtA_Y,Edt_EtatAff(a4) + move.b #SlDelai,Edt_ASlY(a4) + bra Ed_NewBuf + +; +; Scrolling sous le curseur HAUT +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_SHaut + bsr Ed_TokCur + tst.w Edt_YPos(a4) + beq CFin +Ed_SHaut2 + subq.w #1,Edt_YPos(a4) + moveq #0,d1 + moveq #0,d2 + WiCall Locate + bra Ed_CHt + +; +; Scrolling sous le curseur BAS +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_SBas + bsr Ed_TokCur + move.w Edt_YPos(a4),d0 + add.w Edt_YCu(a4),d0 + cmp.w Prg_NLigne(a6),d0 + bcc CFin +Ed_SBas2 + addq.w #1,Edt_YPos(a4) + moveq #0,d1 + move.w Edt_WindTy(a4),d2 + subq.w #1,d2 + WiCall Locate + bra Ed_CBs + +; +; Scrolling sous le curseur GAUCHE +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_SGauche + bsr Ed_TokCur + tst.w Edt_XPos(a4) + beq CFin + subq.w #1,Edt_XCu(a4) + bra Ed_CGo + +; +; Scrolling sous le curseur DROITE +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_SDroite + bsr Ed_TokCur + move.w Edt_XCu(a4),d0 + cmp.w #250,d0 + bcc CFin + addq.w #1,Edt_XCu(a4) + bra Ed_CDr + +; +; Haut du texte +; ~~~~~~~~~~~~~ +Ed_HTexte + bsr Ed_TokCur + bsr Ed_AutoMarks +Ed_HTex + clr.w Edt_YPos(a4) + clr.w Edt_XPos(a4) + clr.w Edt_YCu(a4) + clr.w Edt_XCu(a4) + move.b #SlDelai,Edt_ASlY(a4) + bsr Ed_NewBuf + bra Ed_CHtE + +; +; Bas du texte +; ~~~~~~~~~~~~ +Ed_BTexte + bsr Ed_TokCur + bsr Ed_AutoMarks +Ed_BTex + move.w Prg_NLigne(a6),d0 + move.w Edt_WindTy(a4),d1 + lsr.w #1,d1 *XXX EdTy-EdTY/3 + sub.w d1,d0 + bcc.s .BTx1 + moveq #0,d0 +.BTx1 move.w d0,Edt_YPos(a4) + neg.w d0 + add.w Prg_NLigne(a6),d0 + move.w d0,Edt_YCu(a4) + clr.w Edt_XPos(a4) + clr.w Edt_XCu(a4) + move.b #SlDelai,Edt_ASlY(a4) + bsr Ed_NewBuf + bra Ed_CBasE + +; +; NEXT / PREVIOUS label +; ~~~~~~~~~~~~~~~~~~~~~ +Ed_PLabel + bsr Ed_TokCur + bsr Ed_NLab + move.w d1,d0 + beq Ed_HTexte + bra.s NLb1 +Ed_NLabel + bsr Ed_TokCur + bsr Ed_NLab + move.w d2,d0 + beq Ed_HTexte +NLb1 cmp.w Prg_NLigne(a6),d0 + bcc Ed_BTexte + bsr Ed_AutoMarks + or.b #EtA_BXY,Edt_EtatAff(a4) + move.b #SlDelai,Edt_ASlY(a4) + move.w d0,d1 + sub.w Edt_YCu(a4),d0 + bpl.s NLb2 + clr.w d0 + move.w d1,Edt_YCu(a4) +NLb2: move.w d0,Edt_YPos(a4) + clr.w Edt_XCu(a4) + bra Ed_NewBuf + +; +; Copie chaine +; ~~~~~~~~~~~~ +EdCocop move.b (a0)+,(a1)+ + bne.s EdCocop + rts +; +; D0 > majuscule +; ~~~~~~~~~~~~~~ +MajD0ed cmp.b #"a",d0 + bcs.s .skip + cmp.b #"z",d0 + bhi.s .skip + sub.b #$20,d0 +.skip rts +; +; Ramene VRAI si D2 est une lettre ou un chiffre +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Une_Lettre + cmp.b #"0",d2 + bcs.s LFaux + cmp.b #"9",d2 + bls.s LVrai + cmp.b #"A",d2 + bcs.s LFaux + cmp.b #"Z",d2 + bls.s LVrai + cmp.b #"a",d2 + bcs.s LFaux + cmp.b #"z",d2 + bls.s LVrai + cmp.b #128,d2 + bcc.s LVrai +LFaux: moveq #0,d2 + rts +LVrai: moveq #-1,d2 + rts + + +; ___________________________________________________________________ +; +; MARKS +; ___________________________________________________________________ + +; Effacement des marques programme +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Prg_MarkRaz + lea Prg_Marks(a6),a0 + moveq #10-1,d0 +.Cl clr.l (a0)+ + dbra d0,.Cl + rts + +; Positionne la premiere system-mark +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_AutoMarks + movem.l a0-a1/d0-d1,-(sp) + move.w Edt_YPos(a4),d0 + add.w Edt_YCu(a4),d0 + swap d0 + move.b #$FF,d0 + lsl.w #8,d0 + move.b Edt_XCu+1(a4),d0 + lea Prg_Marks(a6),a0 + cmp.l (a0),d0 + beq.s .Rien +; Remonte toutes les marques + lea Ed_AutoMarksNb*4-4(a0),a1 + moveq #Ed_AutoMarksNb-2,d1 +.Loop move.l -(a1),4(a1) + dbra d1,.Loop +; Met la nouvelle + move.l d0,(a0) +.Rien movem.l (sp)+,a0-a1/d0-d1 + rts + +; Set MARK +; ~~~~~~~~ +Ed_SMark9 + addq.w #1,d0 +Ed_SMark8 + addq.w #1,d0 +Ed_SMark7 + addq.w #1,d0 +Ed_SMark6 + addq.w #1,d0 +Ed_SMark5 + addq.w #1,d0 +Ed_SMark4 + addq.w #1,d0 +Ed_SMark3 + addq.w #1,d0 +Ed_SMark2 + addq.w #1,d0 +Ed_SMark1 + addq.w #1,d0 +Ed_SMark0 + bsr Ed_TokCur + lea Prg_Marks(a6),a2 + lsl.w #2,d0 + add.w d0,a2 + move.w Edt_YPos(a4),d0 + add.w Edt_YCu(a4),d0 + move.w d0,(a2)+ + move.b #$FF,(a2)+ + move.b Edt_XCu+1(a4),(a2) + moveq #64,d0 + bra Ed_Al100 +; +; Va a une marque +; ~~~~~~~~~~~~~~~ +Ed_GMark9 + addq.w #1,d0 +Ed_GMark8 + addq.w #1,d0 +Ed_GMark7 + addq.w #1,d0 +Ed_GMark6 + addq.w #1,d0 +Ed_GMark5 + addq.w #1,d0 +Ed_GMark4 + addq.w #1,d0 +Ed_GMark3 + addq.w #1,d0 +Ed_GMark2 + addq.w #1,d0 +Ed_GMark1 + addq.w #1,d0 +Ed_GMark0 + bsr Ed_TokCur + lea Prg_Marks(a6),a2 + lsl.w #2,d0 + add.w d0,a2 + tst.l (a2) + beq Ed_NoMark + bsr Ed_AutoMarks + move.w (a2),d0 + move.l a2,-(sp) + bsr Ed_GotoY + move.l (sp)+,a2 + moveq #0,d0 + move.b 3(a2),d0 + bra Ed_GotoX + +; Passe les marks en adresses dans le programme +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_Marks2Adress + movem.l a0-a2/d0-d2,-(sp) + moveq #9,d2 + lea Prg_Marks(a6),a2 +.Loop tst.l (a2) + beq.s .Nx + move.w (a2),d0 + bsr Ed_FindL + beq.s .Clr + sub.l Prg_StBas(a6),a0 + move.l a0,d0 + lsl.l #8,d0 + move.b 3(a2),d0 + move.l d0,(a2) + bra.s .Nx +.Clr clr.l (a2) +.Nx addq.l #4,a2 + dbra d2,.Loop + movem.l (sp)+,a0-a2/d0-d2 + rts +; Repasse en numero de lignes +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_Marks2Number + movem.l a0-a2/d0-d2,-(sp) + moveq #9,d2 + lea Prg_Marks(a6),a2 +.Loop move.l (a2),d0 + beq.s .Nx + lsr.l #8,d0 + add.l Prg_StBas(a6),d0 + move.l d0,a0 + bsr Ed_FindA + move.w d0,(a2) + move.b #$FF,2(a2) + bra.s .Nx +.Clr clr.l (a2) +.Nx addq.l #4,a2 + dbra d2,.Loop + movem.l (sp)+,a0-a2/d0-d2 + rts +; +; Change les marks +; ~~~~~~~~~~~~~~~~ +; D0= Numero ligne +; D1= Nombre de lignes +Ed_MarksChange + movem.l d1/d2/d3/d4/a0,-(sp) + moveq #9,d2 + move.w d0,d3 + lea Prg_Marks(a6),a0 + tst.w d1 + bmi.s .DLi +; Insertion d'une ligne +.ILi1 tst.l (a0) + beq.s .ILi2 + cmp.w (a0),d0 + bgt.s .ILi2 + add.w d1,(a0) +.ILi2 addq.l #4,a0 + dbra d2,.ILi1 + bra.s .Out +; Suppression d'une ligne +.DLi sub.w d1,d3 +.DLi1 tst.l (a0) + beq.s .DLi2 + cmp.w (a0),d3 + ble.s .DLiA + cmp.w (a0),d0 + bgt.s .DLi2 + clr.l (a0) + bra.s .DLi2 +.DLiA add.w d1,(a0) +.DLi2 addq.l #4,a0 + dbra d2,.DLi1 +; Sortie! +.Out movem.l (sp)+,d1/d2/d3/d4/a0 + rts + +; ____________________________________________________________________________ +; +; QUIT +; ____________________________________________________________________________ +; + + +; QUIT ALL! +; ~~~~~~~~~ +Ed_Quit bsr Ed_TokCur + +; Demander confirmation? +; ~~~~~~~~~~~~~~~~~~~~~~ + btst #0,Ed_QuitFlags(a5) + beq.s .NoDia + moveq #EdD_Quit,d0 + bsr Ed_Dialogue + cmp.w #1,d0 + bne Ed_Loop +.NoDia + +Ed_DoQuit + bsr Ed_TokCur + bsr Edt_ClearVar +; Au revoir! +; ~~~~~~~~~~ + moveq #"B",d0 + bsr Ed_SamPlay +; Sauver la config? +; ~~~~~~~~~~~~~~~~~ + btst #1,Ed_QuitFlags(a5) Sauver? + beq.s .NoConf + tst.b EdC_Changed(a5) Modification? + beq.s .NoConf + bsr EdC_SaveDef Va sauver +.NoConf +; Sauver les macros? +; ~~~~~~~~~~~~~~~~~~ + btst #2,Ed_QuitFlags(a5) + beq.s .NoMac + tst.b EdMa_Changed(a5) + beq.s .NoMac + bsr EdMa_SaveDef Va sauver +.NoMac +; Sauver les dïż½finitions des programmes? +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + btst #3,Ed_QuitFlags(a5) + bne.s .SavAll +; +; Sauvegarde des programmes non sauves, et QUIT +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + move.l Edt_List(a5),a4 +.SLoop move.l Edt_Prg(a4),a6 + bsr Ed_Saved + move.l Edt_Next(a4),d0 + move.l d0,a4 + bne.s .SLoop + bra Ed_System +; +; Sauvegarde de la configuration de l'editeur +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.SavAll + move.w #149,d0 + bsr Ed_AverMess +; Sauve toutes structures programmes +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + moveq #1,d7 + move.l Edt_List(a5),a4 +.QLp move.l Edt_Prg(a4),a6 Structure programme... + tst.l Edt_LinkPrev(a4) Sauve une seule fois! + bne.s .PNext + tst.b Prg_NamePrg(a6) Un nom? + beq.s .NoName + tst.b Prg_Change(a6) Deja sauve! + beq.s .PNext +; Programme avec un nom. + clr.b Prg_NoNamed(a6) + lea Prg_NamePrg(a6),a0 + move.l Name1(a5),a1 + bsr EdCocop + bra.s .Save +; Programme sans nom: NEW_PROJECT_XX.AMOS +.NoName addq.b #1,Prg_NoNamed(a6) Flag pour reload! + moveq #49,d0 + bsr Ed_GetSysteme New_Project_ + move.l Name1(a5),a1 + bsr EdCocop + lea -1(a1),a0 + move.l d7,d0 ## + JJsrR L_LongToDec,a2 + move.l a0,a1 + moveq #22,d0 .AMOS + bsr Ed_GetSysteme + bsr EdCocop +.Save JJsr L_Dsk.PathIt + JJsr L_Prg_Save + bne .Err +.PNext addq.w #1,d7 + move.l Prg_Next(a4),d0 + move.l d0,a4 + bne.s .QLp +; Ouvre le fichier last cession +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + moveq #47,d0 + bsr Ed_GetSysteme + JJsrR L_Sys_AddPath,a1 + move.l #1006,d2 + bsr Ed_Open + beq .Err +; Place pour l'entete + longueur + move.l Buffer(a5),a3 + clr.l (a3) + clr.l 4(a3) + move.l a3,d2 + moveq #8,d3 + bsr Ed_Write + bne .Err +; Sauve toutes les structures PRG + move.l Prg_List(a5),a6 +.PLoop move.l a6,a0 + move.l #Prg_Long,d0 + bsr .StructureSave + bne .Err + move.l Prg_Next(a6),d0 + move.l d0,a6 + bne.s .PLoop + sub.l a0,a0 + bsr .StructureSave + bne .Err +; Sauve toutes les structures EDT + move.l Edt_List(a5),a4 +.ELoop clr.w Edt_Order(a4) Programme courant + cmp.l Edt_Current(a5),a4 + bne.s .ESkip + move.w #1,Edt_Order(a4) Edt_Order<>0 +.ESkip move.l a4,a0 + move.l #Edt_Long,d0 + bsr .StructureSave + bne .Err + move.l Edt_Next(a4),d0 + move.l d0,a4 + bne.s .ELoop + sub.l a0,a0 + bsr .StructureSave + bne .Err +; Met la reconnaissance en tete de fichier + moveq #0,d2 + moveq #-1,d3 + bsr Ed_Seek + move.l #Ed_QuitHead,(a3) + subq.l #8,d0 + move.l d0,4(a3) + move.l a3,d2 + moveq #8,d3 + bsr Ed_Write + bne.s .Err +; On s'en va! + bsr Ed_Close + bsr Ed_AllAverFin + bra Ed_System +; Erreur: message et retour! +.Err bsr Ed_Close + bsr Ed_AllAverFin + moveq #EdD_NoWarm,d0 + bsr Ed_Dialogue + bsr Ed_DrawWindows + rts +; Sauve une structure avec son adresse en premier +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.StructureSave + movem.l a0/d0,-(sp) + move.l a0,(a3) + beq.s .Vide + move.l d0,4(a3) + clr.l 8(a3) + move.l a3,d2 + moveq #12,d3 + bsr Ed_Write + bne.s .SErr + movem.l (sp)+,a0/d0 + move.l a0,d2 + move.l d0,d3 + bsr Ed_Write + rts +.Vide move.l a3,d2 + moveq #4,d3 + bsr Ed_Write +.SErr addq.l #8,sp + rts + +; +; Set QUIT OPTIONS +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_QuitOptions + bsr Ed_TokCur + move.l Ed_VDialogues(a5),a0 + move.b Ed_QuitFlags(a5),d0 + moveq #4,d1 + JJsrR L_Dia_SetVFlags,a1 + moveq #EdD_OQuit,d0 + bsr Ed_Dialogue + cmp.w #1,d0 + bne Ed_Loca + move.l Ed_VDialogues(a5),a0 + moveq #4,d1 + JJsrR L_Dia_GetVFlags,a1 + move.b d0,Ed_QuitFlags(a5) + move.b #1,EdC_Changed(a5) + rts + +; ______________________________________________________________________________ +; +; EDITOR INFORMATIONS +; ______________________________________________________________________________ +; + +; About +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_About + JLea L_VersionN,a0 + bsr Ed_DChaine + move.l Ed_VDialogues(a5),a2 + move.l a1,0*4(a2) + lea AdTokens+4(a5),a0 Compte les extensions + moveq #26-1,d0 + moveq #0,d2 +.Cpt tst.l (a0)+ + beq.s .PaE + addq.w #1,d2 +.PaE dbra d0,.Cpt + move.l d2,1*4(a2) + JLea L_UserReg,a0 Registration # + move.l Name2(a5),a1 + moveq #$73,d0 + JJsrP L_Sys_UnCode,a2 + move.l a1,3*4(a2) + lea 16(a0),a0 Registred user + lea 16(a1),a1 + move.b #$A5,d0 + JJsrP L_Sys_UnCode,a2 + move.l a1,2*4(a2) + moveq #EdD_Title,d0 + bsr Ed_Dialogue + rts + +; About extensions +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_AboutExt + move.l Ed_VDialogues(a5),a2 +; Trouve la premiere extension + lea AdTokens(a5),a3 + moveq #0,d3 + bsr .Next + tst.w d3 + beq.s .Out +; Appelle le dialogue +.Loop move.l d3,0*4(a2) + lea .Empty(pc),a1 + move.l (a3),a0 + move.l LB_Title(a0),d0 + beq.s .Sk + move.l d0,a1 +.Sk move.l a1,1*4(a2) + moveq #EdD_AboutE,d0 + bsr Ed_Dialogue + cmp.w #1,d0 + beq.s .Prv + cmp.w #2,d0 + beq.s .Nxt +.Out rts +; Suivant +.Nxt bsr .Next + bra.s .Loop +; Precedent +.Prv bsr .Prev + bra.s .Loop +; Previous extension +.Prev move.l d3,d0 + move.l a3,a0 +.Pr1 cmp.w #1,d0 + bls.s .POut + subq.w #1,d0 + tst.l -(a0) + beq.s .Pr1 + move.l d0,d3 + move.l a0,a3 +.POut rts +; Next extension +.Next move.l d3,d0 + move.l a3,a0 +.Ne1 cmp.w #26,d0 + bcc.s .NOut + addq.w #1,d0 + addq.l #4,a0 + tst.l (a0) + beq.s .Ne1 + move.l d0,d3 + move.l a0,a3 +.NOut rts +.Empty dc.w 0 + +; Informations +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_Infos + bsr Ed_TokCur + bsr Ed_VaTester + move.l Ed_VDialogues(a5),a2 + move.l a6,-(sp) + move.l $4.w,a6 +; Chip Free + move.l #Chip,d1 + jsr _LVOAvailMem(a6) + move.l d0,0*4(a2) +; Fast Free + move.l #Fast,d1 + jsr _LVOAvailMem(a6) + move.l d0,1*4(a2) + move.l (sp)+,a6 +; Text length + move.l Prg_StHaut(a6),d0 + sub.l Prg_StBas(a6),d0 + move.l d0,2*4(a2) +; Bank length + JJsr L_Bnk.GetLength + add.l d2,d0 + add.l d1,d0 + move.l d0,3*4(a2) Banques totales + move.l d1,5*4(a2) Bobs + move.l d2,6*4(a2) Icones +; Number of lines + moveq #0,d0 + move.w Prg_NLigne(a6),d0 + move.l d0,4*4(a2) +; Number of instructions + move.l BMenage(a5),5*4(a2) + move.l VerNInst(a5),5*4(a2) +; Appelle les dialogues + moveq #EdD_Infos,d0 + bsr Ed_Dialogue + rts + +; __________________________________________________________________________ +; +; BANQUES / CONFIG EDITEUR +; __________________________________________________________________________ +; +; +; Chargement/Effacement de la banque de resource (pas de gestion d'erreurs) +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_ResourceLoad +; Charge la banque + bsr Ed_SetBanks + move.l #1005,d2 + bsr Ed_Open + beq.s .DErr + moveq #6,d0 + JJsr L_Bnk.Load + bne.s .MErr + bsr Ed_Close +; Change les adresses + moveq #6,d0 + JJsr L_Bnk.GetAdr + beq.s .2Err + cmp.l #"Reso",-8(a0) + bne.s .2Err + move.l a0,Ed_Resource(a5) + bsr EdC_SetPalette + moveq #0,d0 + rts +.DErr moveq #2,d0 + rts +.MErr moveq #1,d0 + rts +.2Err moveq #3,d0 + rts +; Effacement de la banque de configuration +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_ResourceFree + bsr Ed_SetBanks + moveq #6,d0 + JJsr L_Bnk.Eff + rts +; Change la palette de couleur en fonction des prefs de l'ïż½diteur +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +EdC_SetPalette + move.l Ed_Resource(a5),d0 + beq.s .Skip + move.l d0,a0 + add.l 2(a0),a0 + move.w (a0),d0 + lsl.w #2,d0 + lea 2+2+2(a0,d0.w),a0 + lea Ed_Palette(a5),a1 + moveq #7,d0 +.Copy move.w (a1)+,(a0)+ + dbra d0,.Copy +.Skip rts + +; Chargement/Effacement de la banque de samples (pas de gestion d'erreurs) +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_SamChanged + bsr Ed_SetBanks + tst.b Ed_Sounds(a5) + bne.s .Sons +; Pas de sons, effacer la banque? + moveq #5,d0 + JJsr L_Bnk.GetAdr + bne.s Ed_SamEnd + bra.s .Out +; Il faut faire des sons, charger la banque? +.Sons moveq #5,d0 + JJsr L_Bnk.GetAdr + bne.s .Out + moveq #48,d0 + bsr Ed_GetSysteme + JJsrR L_Sys_AddPath,a1 +; Charge la banque + move.l #1005,d2 + bsr Ed_Open + beq.s .Out + bsr Ed_SetBanks + moveq #5,d0 + JJsr L_Bnk.Load + bsr Ed_Close +; Ok +.Out rts + +; Effacement de la banque de samples +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_SamEnd + bsr Ed_SetBanks + moveq #5,d0 + JJsr L_Bnk.Eff + rts +; +; Joue le sample D0 (lettre de A ïż½ Z) +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_SamPlay + movem.l d0-d3/a0-a2,-(sp) + tst.b Ed_Sounds(a5) + beq.s .Out + tst.b Ed_Zappeuse(a5) + bne.s .Out + move.w d0,d2 + bsr Ed_SetBanks + moveq #5,d0 + JJsr L_Bnk.GetAdr + beq.s .Out + cmp.l #"Samp",-8(a0) + bne.s .Out +; Trouve le sample + move.w (a0),d1 + subq.w #1,d1 + bmi.s .Out + lea 2(a0),a1 +.Loop move.l (a1)+,d0 + lea 0(a0,d0.l),a2 + cmp.b (a2),d2 + beq.s .Found + dbra d1,.Loop + bra.s .Out +; Appelle la trappe +.Found moveq #0,d3 + move.w 8(a2),d3 + move.l 10(a2),d2 + lea 14(a2),a1 + moveq #%1111,d1 + move.l ExtAdr(a5),d0 + beq.s .Out + move.l d0,a0 + jsr -4(a0) +; Fini! +.Out movem.l (sp)+,d0-d3/a0-a2 + rts + + +; ___________________________________________________________________ +; +; CONFIG! +; ___________________________________________________________________ +; + +; Met les banques de mïż½moire/dialogue de l'ïż½diteur +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_SetBanks + move.l a0,-(sp) + lea Ed_Banks(a5),a0 + move.l a0,Cur_Banks(a5) + lea Ed_Dialogs(a5),a0 + move.l a0,Cur_Dialogs(a5) + move.l (sp)+,a0 + rts + +; Sauvegarde configuration par defaut +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +EdC_SaveDefault + bsr Ed_TokCur + moveq #EdD_SvConf,d0 + bsr Ed_Dialogue + cmp.w #1,d0 + bne Ed_NotDone +EdC_SaveDef + moveq #7,d0 + JJsr L_Sys_GetMessage + JJsrR L_Sys_AddPath,a1 + bsr EdC_SaveIt + rts +; Sauvegarde de la configuration +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +EdC_SaveAs + bsr Ed_TokCur + move.w #130,d0 + bsr Ed_File_Selector + beq Ed_NotDone + JJsr L_Dsk.PathIt + bsr Ed_SaveOver +EdC_SaveIt + move.w #152,d0 + bsr Ed_GetMessage + bsr Ed_Avertir + bsr EdC_Save + bne.s .Err + bsr Ed_AverFin + clr.b EdC_Changed(a5) + rts +; Erreur disque +.Err move.w #139,d0 + bra Ed_Al100 + +; Chargement de la configuration par defaut +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +EdC_LoadDefault + bsr Ed_TokCur + bsr EdC_Saved +EdC_LoadDef + moveq #7,d0 + JJsr L_Sys_GetMessage + JJsrR L_Sys_AddPath,a1 + bsr EdC_LoadIt + move.b #2,EdC_Changed(a5) + rts +; Chargement de la configuration +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +EdC_LoadAs + bsr Ed_TokCur + bsr EdC_Saved + move.w #134,d0 + bsr Ed_File_Selector + beq Ed_NotDone + JJsr L_Dsk.PathIt + bsr EdC_LoadIt + move.b #2,EdC_Changed(a5) + rts +EdC_LoadIt + move.w #153,d0 + bsr Ed_AverMess + bsr EdC_Load + bne .Err + bsr Ed_AverFin + move.w #218,d0 Message + bsr Ed_AverMess + moveq #75,d0 Attente + bsr Ed_TiWait + bsr EdC_Redraw + rts +; Erreur +.Err move.w #139,d0 + bra Ed_Al100 + +; Redessin de TOUT l'editeur en cas de changement de config +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +EdC_Redraw + bsr Ed_SamChanged + bsr Ed_Hide + bsr Ed_CloseEditor + move.b #1,EdC_Modified(a5) + bsr Ed_OpenEditor + bsr Ed_Appear + rts +; +; Sauvegarde de la configuration si modifiee +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +EdC_Saved + cmp.b #1,EdC_Changed(a5) + bne.s .Skip + moveq #EdD_CSaved,d0 + bsr Ed_Dialogue + cmp.w #2,d0 + beq.s .Skip + cmp.w #1,d0 + bne Ed_NotDone + bsr EdC_SaveAs +.Skip rts + +; +; Chargement de la configuration A0 +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +EdC_Load + move.l #1005,d2 + bsr Ed_Open + beq .DErr +; Charge la config elle meme +; ~~~~~~~~~~~~~~~~~~~~~~~~~~ + move.l Buffer(a5),a0 + move.l a0,d2 + moveq #4,d3 + bsr Ed_Read + bne .DErr + move.l d2,a0 + move.l #Ed_FConfig-Ed_DConfig,d3 + cmp.l (a0),d3 + bne .Err2 + lea Ed_DConfig(a5),a0 + move.l a0,d2 + bsr Ed_Read + bne .DErr + move.l d2,Ed_Config(a5) +; Charge les chaines systeme +; ~~~~~~~~~~~~~~~~~~~~~~~~~~ + lea Ed_Systeme(a5),a0 + bsr EdC_LoadTextes + bne EdC_Out +; Charge les chaines menus +; ~~~~~~~~~~~~~~~~~~~~~~~~ + lea EdM_Messages(a5),a0 + bsr EdC_LoadTextes + bne EdC_Out +; Charge les messages dialog +; ~~~~~~~~~~~~~~~~~~~~~~~~~~ + lea Ed_Messages(a5),a0 + bsr EdC_LoadTextes + bne EdC_Out +; Charge les messages erreur TEST TIME +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + lea Ed_TstMessages(a5),a0 + bsr EdC_LoadTextes + bne EdC_Out +; Charge les messages erreur RUN TIME +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + lea Ed_RunMessages(a5),a0 + bsr EdC_LoadTextes + bne EdC_Out +; Charge les programmes ïż½ lancer +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + lea Ed_MnPrograms(a5),a0 + bsr EdC_LoadTextes + bne EdC_Out +; Charge les user menus +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + lea EdM_User(a5),a0 + bsr EdC_LoadTextes + bne EdC_Out +; Charge les definitions menus +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + lea EdM_Definition(a5),a0 + bsr EdC_LoadTextes + bne EdC_Out +; Calcule les positions dans la ligne de config +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + moveq #1,d0 + bsr Ed_GetSysteme + moveq #-1,d1 + lea Ed_EtXX(a5),a1 +.Loop1 addq.l #1,d1 + move.b (a0)+,d0 + beq.s .Out1 + cmp.b #" ",d0 + beq.s .Loop1 + sub.b #"0",d0 + cmp.b #8,d0 + bcc.s .Loop1 + ext.w d0 + move.b d1,0(a1,d0.w) + bra.s .Loop1 +.Out1 +; Ok! + moveq #0,d0 + bra EdC_Out +; File not found +.DErr moveq #1,d0 + bra EdC_Out +; Bad config +.Err2 moveq #2,d0 + bra EdC_Out + +; Effacement de la configuration courante +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +EdC_Free + lea Ed_Systeme(a5),a0 1 + bsr Ed_MemFree + lea EdM_Messages(a5),a0 2 + bsr Ed_MemFree + lea Ed_Messages(a5),a0 3 + bsr Ed_MemFree + lea Ed_TstMessages(a5),a0 4 + bsr Ed_MemFree + lea Ed_RunMessages(a5),a0 5 + bsr Ed_MemFree + lea Ed_MnPrograms(a5),a0 6 + bsr Ed_MemFree + lea EdM_User(a5),a0 7 + bsr Ed_MemFree + lea EdM_Definition(a5),a0 8 + bsr Ed_MemFree + rts + +; +; Sauvegarde de la configuration courante +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +; A0= Nom +EdC_Save + move.l #1006,d2 + bsr Ed_Open + beq .DErr +; Sauve la config elle meme +; ~~~~~~~~~~~~~~~~~~~~~~~~~ + move.l Buffer(a5),a0 + move.l #Ed_FConfig-Ed_DConfig,(a0) + move.l a0,d2 + moveq #4,d3 + bsr Ed_Write + bne.s .DErr + lea Ed_DConfig(a5),a0 + move.l a0,d2 + move.l #Ed_FConfig-Ed_DConfig,d3 + bsr Ed_Write + bne.s .DErr +; Sauve les chaines systeme +; ~~~~~~~~~~~~~~~~~~~~~~~~~ + lea Ed_Systeme(a5),a0 + bsr EdC_SaveTextes + bne.s EdC_Out +; Sauve les chaines menu +; ~~~~~~~~~~~~~~~~~~~~~~~~~ + lea EdM_Messages(a5),a0 + bsr EdC_SaveTextes + bne.s EdC_Out +; Sauve les messages dialogues +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + lea Ed_Messages(a5),a0 + bsr EdC_SaveTextes + bne.s EdC_Out +; Sauve les messages d'erreur TEST TIME +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + lea Ed_TstMessages(a5),a0 + bsr EdC_SaveTextes + bne.s EdC_Out +; Sauve les messages d'erreur RUN TIME +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + lea Ed_RunMessages(a5),a0 + bsr EdC_SaveTextes + bne.s EdC_Out +; Sauve les programmes ïż½ lancer +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + lea Ed_MnPrograms(a5),a0 + bsr EdC_SaveTextes + bne.s EdC_Out +; Sauve les user menus +; ~~~~~~~~~~~~~~~~~~~~ + lea EdM_User(a5),a0 + bsr EdC_SaveTextes + bne.s EdC_Out +; Sauve les definitions menus +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~ + lea EdM_Definition(a5),a0 + bsr EdC_SaveTextes + bne.s EdC_Out +; Ok! +; ~~~ + moveq #0,d0 + bra EdC_Out +.DErr moveq #1,d0 +; Sortie chargement/sauvegarde fichier +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +EdC_Out move.l d0,-(sp) + bsr Ed_Close + move.l (sp)+,d0 +EdC_Out2 + tst.l d0 + rts + +; +; Charge un fichier de textes +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~ +; A0= Adresse du pointeur dans (a5) +; D7= Lock +EdC_LoadTextes + movem.l a0-a2/d2-d3,-(sp) + move.l a0,a2 + bsr Ed_MemFree + move.l Buffer(a5),d2 + moveq #4,d3 + bsr Ed_Read + bne.s .Err + move.l d2,a0 + move.l (a0),d3 + beq.s .Skip + move.l d3,d0 + move.l a2,a0 + bsr Ed_MemReserve + beq.s .Err + move.l a0,d2 + bsr Ed_Read + bne.s .Err +.Skip moveq #0,d0 + bra.s .Out +.Err move.l a2,a0 + bsr Ed_MemFree + moveq #-1,d0 +.Out movem.l (sp)+,a0-a2/d2-d3 + rts +; +; Sauve un fichier de textes +; ~~~~~~~~~~~~~~~~~~~~~~~~~~ +; A0= Adresse du pointeur dans (a5) +; D7= Lock +EdC_SaveTextes + movem.l a0-a2/d2-d3,-(sp) + move.l a0,a2 + move.l (a2),d0 + bne.s .Plin + move.l a2,d2 + moveq #0,d3 + bra.s .Wri +.Plin move.l d0,a0 + move.l -(a0),d3 + move.l a0,d2 +.Wri addq.l #4,d3 + bsr Ed_Write + bne.s .Err + moveq #0,d0 + bra.s .Out +.Err moveq #-1,d0 +.Out movem.l (sp)+,a0-a2/d2-d3 + rts + +; Change / Ajoute un message dans un fichier de textes +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +; A0= Base des textes +; A1= Nouveau message +; D0= Numero du message +EdC_ChangeTexte + movem.l a2-a4/d2-d5,-(sp) + move.l a0,a2 + move.l a1,a3 + move.w d0,d2 +; Taille du nouveau message +.Lg tst.b (a1)+ + bne.s .Lg + sub.l a3,a1 + subq.l #1,a1 + move.l a1,d3 +; Nombre de messages + move.l (a2),a0 + bsr Ed_GetNbMessage + cmp.w d0,d2 + bhi.s .New +; Un ancien message, calcul de la taille + move.w d2,d0 + move.l (a2),a0 + bsr Ed_GetMessageA0 + neg.w d0 + add.w d3,d0 + ext.l d0 + bra.s .Res +; Un nouveau message +.New moveq #2,d0 + add.l d3,d0 +; Reserve la nouvelle memoire +.Res move.l (a2),a0 + add.l -(a0),d0 + move.l d0,d1 + addq.l #4,d0 + SyCall MemFastClear + beq.s .Err + move.l d1,(a0)+ + move.l a0,d5 +; Recopie les anciens messages + move.l (a2),a1 + addq.l #1,a1 + clr.b (a0)+ + moveq #0,d1 + moveq #0,d4 +.Cp0 addq.w #1,d1 + moveq #0,d4 + move.b (a1),d4 + bmi.s .CpX + lea 1(a1),a4 + lea 2(a1,d4.w),a1 + cmp.b d1,d2 + bne.s .Cp1 + move.l a3,a4 + move.b d3,d4 + moveq #-1,d2 +.Cp1 move.b d4,(a0)+ + beq.s .Cp3 + subq.w #1,d4 +.Cp2 move.b (a4)+,(a0)+ + dbra d4,.Cp2 +.Cp3 clr.b (a0)+ + bra.s .Cp0 +; Le dernier message? +.CpX tst.w d2 + bmi.s .CpY + move.b d3,(a0)+ + beq.s .Cp5 +.Cp4 move.b (a3)+,(a0)+ + subq.b #1,d3 + bne.s .Cp4 +.Cp5 clr.b (a0)+ +.CpY +; Marque la fin + move.b #-1,(a0)+ +; Efface l'ancien texte + move.l a2,a0 + bsr Ed_MemFree +; Branche le nouveau, et fini! + move.l d5,(a2) + moveq #0,d0 + bra.s .Out +; Erreur, out of mem! +.Err moveq #-1,d0 +.Out movem.l (sp)+,a2-a4/d2-d5 + rts +; +; Get FIRST message free +; ~~~~~~~~~~~~~~~~~~~~~~ +; A0= Base des messages +Ed_GetFsMessage + moveq #0,d0 + moveq #0,d1 + move.l a0,a1 +.Loop addq.l #1,d0 + move.b 1(a0),d1 + beq.s .Out + lea 2(a0,d1.w),a0 + bpl.s .Loop +.New move.l a1,a0 + bsr Ed_GetNbMessage + addq.w #1,d0 +.Out rts + +; +; Get number of messages +; ~~~~~~~~~~~~~~~~~~~~~~ +; A0= Base des messages +Ed_GetNbMessage + moveq #0,d0 + moveq #0,d1 + bra.s .In +.Loop addq.w #1,d0 + lea 2(a0,d1.w),a0 +.In move.b 1(a0),d1 + bpl.s .Loop + rts +; +; Get new editor message +; ~~~~~~~~~~~~~~~~~~~~~~ +Ed_GetSysteme + move.l Ed_Systeme(a5),a0 + bra.s Ed_GetMessageA0 +Ed_GetMessage + move.l Ed_Messages(a5),a0 +Ed_GetMessageA0 + move.w d1,-(sp) + clr.w d1 + addq.l #1,a0 + bra.s .In +.Loop move.b (a0),d1 + lea 2(a0,d1.w),a0 +.In subq.w #1,d0 + bgt.s .Loop + move.w (sp)+,d1 + move.b (a0)+,d0 + rts +; Get NEXT message +; ~~~~~~~~~~~~~~~~ +Ed_GetNMessage + moveq #0,d0 + move.b -(a0),d0 + lea 2(a0,d0.w),a0 + move.b (a0)+,d0 + rts + + +; ___________________________________________________________________ +; +; AUTOSAVE +; ___________________________________________________________________ + +; +; Set AUTOSAVE +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_SetAutoSave + bsr Ed_TokCur + move.l Ed_VDialogues(a5),a2 + move.l Ed_AutoSaveMn(a5),2*4(a2) + moveq #EdD_ASave,d0 + bsr Ed_Dialogue + cmp.w #1,d0 + bne Ed_NotDone + moveq #1,d0 + moveq #3,d1 + moveq #-1,d2 + JJsr L_Dia_GetValue + move.l d1,d2 + cmp.l Ed_AutoSaveMn(a5),d2 + beq Ed_Loca + move.l d2,Ed_AutoSaveMn(a5) +; PAL ou NTSC + moveq #50,d3 + EcCall NTSC + tst.w d1 + beq.s .PAL + moveq #60,d3 +; Calcule le temps en 1/50 +.PAL mulu d3,d2 + mulu #60,d2 + move.l d2,Ed_AutoSave(a5) + move.l #-1,Ed_AutoSaveRef(a5) + move.b #1,EdC_Changed(a5) + bra Ed_Loca +; +; AUTOSAVE de tous les programmes modifies +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_SaveAuto + move.w #-1,-(sp) + move.l Edt_List(a5),a4 +.Loop tst.b Edt_Hidden(a4) + bne.s .Skip + tst.l Edt_LinkPrev(a4) + bne.s .Skip + addq.w #1,(sp) + bne.s .Snd + moveq #"I",d0 Va faire du bruit! + bsr Ed_SamPlay +.Snd move.l Edt_Prg(a4),a6 + bsr Ed_Saved +.Skip move.l Edt_Next(a4),d0 + move.l d0,a4 + bne.s .Loop + addq.l #2,sp + rts + +; ___________________________________________________________________ +; +; USER MENU / FONCTION TO MENU +; ___________________________________________________________________ + +; +; Appel d'une fonction USER MENU>>> il faut affecter un programme! +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_UserMenu + bsr Ed_TokCur + moveq #EdD_MnUs,d0 + bsr Ed_Dialogue + bra Ed_Loca +; +; Add user option to menu +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_AddUser + bsr Ed_TokCur +; Nombre d'options +; ~~~~~~~~~~~~~~~~ + move.l EdM_User(a5),a0 + bsr Ed_GetFsMessage + cmp.w #EdM_UserMax,d0 + bcc.s .2Many +; Flag pour QUIT + move.b #1,EdC_Changed(a5) + move.w d0,d3 +; Boite de dialogue +; ~~~~~~~~~~~~~~~~~ + move.l Ed_VDialogues(a5),a0 + clr.l 2*4(a0) + move.l #EdM_UserLong,3*4(a0) + moveq #EdD_MnUsA,d0 + bsr Ed_Dialogue + cmp.w #1,d0 + bne Ed_NotDone + moveq #1,d0 + moveq #3,d1 + moveq #-1,d2 + JJsr L_Dia_GetValue + move.l d1,a1 + tst.b (a1) + beq Ed_NotDone +; Ajoute la fonction +; ~~~~~~~~~~~~~~~~~~ + lea EdM_User(a5),a0 + move.w d3,d0 + bsr EdC_ChangeTexte + bne Ed_OMm +; Recalcule le menu et branche ïż½ PRG TO MENU +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + bsr EdM_Init + bsr Ed_Prg2Menu + bsr Ed_Key2Menu + bra Ed_Loca +; Too many options +; ~~~~~~~~~~~~~~~~ +.2Many moveq #EdD_MnUs2,d0 + bsr Ed_Dialogue + bra Ed_Loca + +; Delete User Option +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_DelUser + bsr Ed_TokCur +; Boite de dialogue +; ~~~~~~~~~~~~~~~~~ + moveq #EdD_MnUsD,d0 + bsr Mn_GetOption + beq Ed_NotDone + cmp.w #EdM_UserCommands-1,d2 + bcs.s .PaOpt + cmp.w #EdM_UserCommands-1+EdM_UserMax,d2 + bcc.s .PaOpt +; Flag pour QUIT + move.b #1,EdC_Changed(a5) +; Change dans le texte +; ~~~~~~~~~~~~~~~~~~~~ + move.w d2,d0 + sub.w #EdM_UserCommands-1-1,d0 + lea EdM_User(a5),a0 + move.l Buffer(a5),a1 + clr.w (a1) + bsr EdC_ChangeTexte + bne Ed_OMm +; Enleve les programmes affectes dans la liste +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + move.w d2,d0 + mulu #3,d0 + lea Ed_AutoLoad(a5),a2 + add.w d0,a2 + tst.b (a2) + beq.s .np2 + clr.b (a2)+ + moveq #0,d0 + move.b (a2)+,d0 + beq.s .np1 + lea Ed_MnPrograms(a5),a0 + move.l Buffer(a5),a1 + bsr EdC_ChangeTexte + bne Ed_OMm +.np1 moveq #0,d0 + move.b (a2)+,d0 + beq.s .np2 + lea Ed_MnPrograms(a5),a0 + move.l Buffer(a5),a1 + bsr EdC_ChangeTexte + bne Ed_OMm +; Change dans les touches +; ~~~~~~~~~~~~~~~~~~~~~~~ +.np2 move.w d2,d0 + bsr Ed_Fonc2Ky + beq.s .Skip + move.b #1,(a0)+ + move.b #0,(a0) +; Recalcule le menu +; ~~~~~~~~~~~~~~~~~ +.Skip bsr EdM_Init + bra Ed_Loca +; Pas une option USER +; ~~~~~~~~~~~~~~~~~~~ +.PaOpt moveq #EdD_MnUsE,d0 + bsr Ed_Dialogue + bra Ed_Loop +; +; Set Program to Menus +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_Prg2Menu + bsr Ed_TokCur +; Va chercher l'option de menu + moveq #EdD_PrgMn1,d0 + bsr Mn_GetOption + beq Ed_NotDone + cmp.w #HiddenCommands-1,d2 + bcc .PaAff + cmp.w #152,d2 Pas un menu HELP + bcs.s .Ok + cmp.w #181,d2 Ou CONFIG + bcs .PaAff +; Flag pour QUIT +.Ok move.b #1,EdC_Changed(a5) + move.w d2,d3 + move.l a1,a3 Libelle de l'option + moveq #0,d3 Pour EXIT plus loin +; Un programme dïż½ja affecte? + mulu #3,d2 + lea Ed_AutoLoad(a5),a2 + add.w d2,a2 + tst.b (a2) + beq.s .NoP +; Boite de dialogue + moveq #0,d0 + move.b 1(a2),d0 + beq.s .NoP + move.l Ed_MnPrograms(a5),a0 + bsr Ed_GetMessageA0 + move.l Ed_VDialogues(a5),a1 + move.l a3,0*4(a1) + move.l a0,1*4(a1) + moveq #EdD_PrgMn2,d0 + bsr Ed_Dialogue + move.w d0,d3 + cmp.w #3,d3 + beq Ed_NotDone +; Effacement + move.b 1(a2),d0 Efface le programme + move.l Buffer(a5),a1 + clr.b (a1) + lea Ed_MnPrograms(a5),a0 + bsr EdC_ChangeTexte + bne Ed_OMm + move.b 2(a2),d0 Efface la command line + beq.s .NoP + move.l Buffer(a5),a1 + lea Ed_MnPrograms(a5),a0 + bsr EdC_ChangeTexte + bne Ed_OMm +.NoP clr.b (a2) + clr.b 1(a2) + clr.b 2(a2) + cmp.w #2,d3 + beq .Exit +; Selecteur de fichiers + moveq #100,d0 + bsr Ed_File_Selector + beq Ed_NotDone + JJsr L_Dsk.PathIt + move.l Ed_VDialogues(a5),a0 + move.l a3,(a0)+ 0= Option + move.l Name1(a5),(a0)+ 1= Program + clr.l (a0)+ 2= Pas de chaine en entree + move.l #48,(a0)+ 3= Longueur + moveq #%001,d0 + moveq #3,d1 + JJsrP L_Dia_SetVFlags,a2 + moveq #EdD_PrgMn3,d0 + bsr Ed_Dialogue + cmp.w #1,d0 + bne Ed_NotDone + move.l Ed_VDialogues(a5),a0 + lea 4*4(a0),a0 + moveq #3,d1 + JJsrP L_Dia_GetVFlags,a2 + or.b #$80,d0 Met les flags + move.b d0,(a2) + move.l Ed_MnPrograms(a5),a0 + bsr Ed_GetFsMessage + move.b d0,1(a2) Pointe le message + lea Ed_MnPrograms(a5),a0 + move.l Name1(a5),a1 Change le message + bsr EdC_ChangeTexte + bne Ed_OMm +; Une command line? + moveq #1,d0 + moveq #7,d1 + moveq #-1,d2 + JJsr L_Dia_GetValue + move.l d1,a1 + tst.b (a1) + beq.s .Exit + move.l a1,-(sp) + move.l Ed_MnPrograms(a5),a0 + bsr Ed_GetFsMessage + move.b d0,2(a2) Met la command line + lea Ed_MnPrograms(a5),a0 + move.l (sp)+,a1 + bsr EdC_ChangeTexte + bne Ed_OMm +; Fini +.Exit bra Ed_Loca +; This menu option cannot be affected! +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.PaAff moveq #EdD_PrgMnE,d0 + bsr Ed_Dialogue + bra Ed_Loca + +; +; Set Key to menu +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_Key2Menu + bsr Ed_TokCur +; Va chercher l'option de menu + moveq #EdD_KyMn1,d0 + bsr Mn_GetOption + beq Ed_NotDone + cmp.w #HiddenCommands-1,d2 + bcc .PaAff + move.w d2,d3 +; Trouve la position dans les definitions + move.w d3,d0 + lea Ed_KFonc(a5),a0 + bra.s .Skip4 +.Loop4 addq.l #2,a0 + tst.b (a0) + bne.s .Loop4 + addq.l #1,a0 + cmp.b #$FF,(a0) + beq .PaAff +.Skip4 dbra d0,.Loop4 + move.b #1,(a0) Efface l'ancienne definition + move.b #0,1(a0) + move.l a0,-(sp) + bsr EdM_Init +; Va chercher la touche + moveq #EdD_KyMn2,d0 + bsr Ed_Dialogue + tst.w d0 + bne Ed_NotDone + move.l Ed_ADialogues(a5),a0 + move.l Dia_LastKey(a0),d1 + move.l d1,d4 + beq Ed_NotDone + bsr Ed_Ky2Fonc + beq.s .NoAff +; Flag pour QUIT + move.b #1,EdC_Changed(a5) +; Key already affected + moveq #EdD_KyMn3,d0 + bsr Ed_Dialogue + cmp.w #1,d0 + bne Ed_NotDone +.NoAff +; Change dans la table + move.b d4,d0 + swap d4 + bsr MajD0ed +; Met le code ASCII quand on peut! + move.l (sp)+,a0 + cmp.b #"A",d0 + bcs.s .Scan + cmp.b #"Z",d0 + bhi.s .Scan + move.b d0,(a0) + bra.s .Shift +; Met le scan code +.Scan or.b #$80,d4 + move.b d4,(a0) +; Met les shifts +.Shift lsr.w #8,d4 + moveq #0,d0 + lea .Table(pc),a1 +.Lp move.b (a1)+,d1 + beq.s .Ot + move.b d4,d2 + and.b d1,d2 + beq.s .Lp + or.b d1,d0 + bra.s .Lp +.Ot move.b d0,1(a0) +; Reactualiser le menu? +.Out tst.b EdM_Keys(a5) + beq.s .NoMn + bsr EdM_Init +; Retour ïż½ l'ïż½diteur +.NoMn bra Ed_Loca +; This menu option cannot be affected! +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.PaAff moveq #EdD_KyMnE,d0 + bsr Ed_Dialogue + bra Ed_Loca +.Table dc.b Shf,Ami,Ctr,Alt,0 + even + +; Routine: attend le choix d'une option de menu +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +; D0= Boite de dialogue +; +Mn_GetOption + movem.l d3-d7/a2-a3,-(sp) +; Boite de dialog + bsr Ed_Dialogue Affiche le dialogue + moveq #1,d0 Efface le canal! + JJsr L_Dia_EffChannel +; Boucle d'attente +.Loop JJsr L_Sys_WaitMul + SyCall Inkey + moveq #0,d0 + tst.l d1 + bne .Out + SyCall MouseKey + btst #1,d1 + beq.s .Loop + bsr Ed_MnGere + beq.s .Loop +; Trouve le libelle de l'option +.Out movem.l a0/d0/d2,-(sp) + bsr Ed_DrawWindows + movem.l (sp)+,a0/d0/d2 + tst.w d0 + beq.s .Exit + bpl.s .Tab + bsr EdM_Error + moveq #0,d0 + bra.s .Exit +.Tab move.l EdM_Messages(a5),a1 + move.w 4(a0),d1 + bpl.s .Mn + move.l EdM_User(a5),a1 + neg.w d1 +.Mn add.w d1,a1 +.Exit movem.l (sp)+,d3-d7/a2-a3 + tst.w d0 + rts + + +;_____________________________________________________________________________ +; +; MARQUEURS MENU CONFIG +;_____________________________________________________________________________ +; +; +; Insert / Overwrite +; ~~~~~~~~~~~~~~~~~~ +Ed_Ins not.b Ed_Insert(a5) + bset #EtA_Ins,Ed_EtatAff(a5) + bsr EdM_MarkAll + bsr EdK_MarkAll + rts +; Sound On / Off +; ~~~~~~~~~~~~~~ +Ed_SamOn + not.b Ed_Sounds(a5) + bsr EdM_MarkAll + move.b #1,EdC_Changed(a5) + bsr Ed_SamChanged + rts + +;_____________________________________________________________________________ +; +; BLOCS +;_____________________________________________________________________________ +; + +; +; Bloc en route, reaffiche les lignes concernees par le mouvement du curseur +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_BlocAff + tst.w Edt_YBloc(a4) + bmi.s .Out + move.w Edt_YOldBloc(a4),d2 + bmi.s .Out + move.w #-1,Edt_YOldBloc(a4) + move.w Edt_YPos(a4),d3 + add.w Edt_YCu(a4),d3 + cmp.w d2,d3 + bcc.s .Skip + exg d2,d3 +.Skip move.w d2,d1 + sub.w Edt_YPos(a4),d1 + bmi.s .Hors + cmp.w Edt_WindTy(a4),d1 + bcc.s .Hors + movem.w d2/d3,-(sp) + bsr Ed_ALigne + bsr Ed_Loca + movem.w (sp)+,d2/d3 +.Hors addq.w #1,d2 + cmp.w d3,d2 + bls.s .Skip +.Out rts + +; +; Start / Stop block +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_BlocOn + tst.w Edt_YBloc(a4) + bpl.s Ed_BlocHide + move.w Edt_YPos(a4),d0 + add.w Edt_YCu(a4),d0 + move.w d0,Edt_YBloc(a4) + move.w Edt_XCu(a4),Edt_XBloc(a4) + clr.w Edt_YOldBloc(a4) +Ed_BlocCu + lea CurBloc(pc),a1 + WiCall SCurWi + rts +Ed_BlocHide + move.w #-1,Edt_YBloc(a4) + bsr Ed_AffBuf +; Remet le curseur normal +; ~~~~~~~~~~~~~~~~~~~~~~~ +Ed_CuNor + lea CurNor(pc),a1 + WiCall SCurWi + rts +; +; All text as block +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_BlocAll + bsr Ed_BlocCu + clr.w Edt_XCu(a4) + clr.w Edt_YCu(a4) + clr.w Edt_XPos(a4) + clr.w Edt_YPos(a4) + clr.w Edt_XBloc(a4) + move.w Prg_NLigne(a6),Edt_YBloc(a4) + bsr Ed_NewBufAff + rts +; +; Block STORE +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_BlocStore + bsr Ed_BlockLimits + lea Ed_Block(a5),a0 + bsr Ed_BlockCopyA0 + bmi Ed_OMm + bne Ed_BlocWhat + bsr Ed_BlocHide + moveq #7,d0 + bra Ed_ProAlert +; +; Block Forget +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_BlocForget + tst.l Ed_Block(a5) + beq Ed_BlocWhat + bsr Ed_BlocFree + moveq #8,d0 + bra Ed_ProAlert +; +; Block CUT +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_BlocCut + bsr Ed_BlockLimits + lea Ed_Block(a5),a0 + bsr Ed_BlockCopyA0 + bmi Ed_OMm + bne Ed_BlocWhat + bsr Ed_BlocHide + lea Ed_Block(a5),a0 + bsr Ed_BlockDeleteA0 + bsr Prg_UndoRaz Illegal: remettre plus tard! + moveq #7,d0 + bra Ed_ProAlert +; +; Block PASTE +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_BlocPaste + tst.l Ed_Block(a5) + beq Ed_BlocWhat + lea Ed_Block(a5),a0 + bsr Ed_BlockInsertA0 + bsr Prg_UndoRaz Illegal: remettre plus tard! + rts +; +; Libere le bloc +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_BlocFree + lea Ed_Block(a5),a0 +Ed_BlockFreeA0 + bra Ed_MemFree +; +; Trouve les limites du bloc dans d4-d7 +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_BlockLimits + tst.w Edt_YBloc(a4) + bmi Ed_BlocWhat + moveq #0,d4 + move.w Edt_YBloc(a4),d4 + move.w Edt_YPos(a4),d5 + add.w Edt_YCu(a4),d5 + move.w Edt_XBloc(a4),d6 + move.w Edt_XCu(a4),d7 + cmp.w d4,d5 + bhi.s .L0 + bne.s .Sw + cmp.w d6,d7 + bcc.s .L0 +.Sw exg d4,d5 + exg d6,d7 +.L0 cmp.w Prg_NLigne(a6),d5 + bcs.s .Blu + move.w Prg_NLigne(a6),d5 + moveq #0,d7 +.Blu rts + +; +; Insert le bloc du texte en position courante +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_BlockInsertA0 + movem.l d2-d7/a2,-(sp) + addq.b #1,Ed_FUndo(a5) + move.l (a0),d0 + beq .Vide + move.l d0,a2 +; Met le curseur ïż½ la bonne position + movem.w (a2)+,d4-d6 + move.l (a2)+,d7 + bsr Ed_LCourant + beq.s .Edit + tst.w (a2) Si ligne non editable, + bne Ed_NotEdit il faut un bloc sans 1ere ligne! +.Edit cmp.w d0,d1 + bls.s .Pl + move.w d0,Edt_XCu(a4) +.Pl move.w Edt_YPos(a4),d3 Position courante + add.w Edt_YCu(a4),d3 +; Premiere ligne + move.w (a2),d0 + beq.s .Pa1 + lea 2(a2),a0 Insere la ligne + bsr R_InsChar + bsr Ed_EALiCu + move.w (a2),d0 + add.w Edt_XCu(a4),d0 Positionne le curseur + bsr Ed_GotoX +.Pa1 btst #30,d7 Une seule ligne? + bne.s .Ok + btst #31,d7 Un procedure sur la ligne? + bne.s .Proc +; Si pas une seule ligne, on fait un RETURN + movem.l a2/d2-d7,-(sp) + bsr Ed_ReturnQuiet Return + bsr Ed_TokCur Ligne suivante + movem.l (sp)+,a2/d2-d7 + addq.w #1,d3 +.Proc add.w (a2)+,a2 Saute la 1ere ligne + move.l a2,d0 Rend pair + Pair d0 + move.l d0,a2 +; Corps du bloc + tst.w (a2) + beq.s .NoCor + lea 6(a2),a0 Insere le bloc en 1 coup + move.l 2(a2),d0 + move.w d3,d1 + bsr Ed_StoBlock + bne Ed_OofBuf + move.w d3,d0 Change les marques + move.w (a2),d1 + bsr Ed_MarksChange + add.w (a2),d3 Plus nombre de lignes +.NoCor move.l 2(a2),d0 + lea 6(a2,d0.l),a2 +; Derniere ligne + JJsr L_Prg_CptLines + move.w d3,d0 + bsr Ed_GotoY + bsr Ed_NewBufAff + move.w (a2),d0 + beq.s .PaD + lea 2(a2),a0 + bsr R_InsChar + bsr Ed_EALiCu + bsr Ed_TokCur +.PaD move.w d7,d0 + bsr Ed_GotoX +; Termine! +.Ok moveq #-1,d0 +.Vide subq.b #1,Ed_FUndo(a5) + movem.l (sp)+,d2-d7/a2 + tst.l d0 + rts + +; +; Delete le bloc du texte +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_BlockDeleteA0 + movem.l d2-d7/a2-a3,-(sp) + addq.b #1,Ed_FUndo(a5) + move.l (a0),d0 + beq .Vide + move.l d0,a2 + movem.w (a2)+,d4-d6 Positions + move.l (a2)+,d7 Flags + move.w d6,d0 Locate en ligne 1 + bsr Ed_GotoX + move.w d4,d0 + bsr Ed_GotoY + move.l a2,a3 Milieu>>> A3 + add.w (a3)+,a3 + move.l a3,d0 + Pair d0 + move.l d0,a3 + btst #31,d7 Une procedure en premier? + bne .Proc1 + btst #30,d7 Juste le milieu? + bne.s .NoMi +; Enleve le milieu s'il faut + tst.w (a3) + beq.s .NoMi + move.l 2(a3),d0 Enleve le programme + move.w d4,d1 + addq.w #1,d1 + bsr Ed_DelChunk + move.w d4,d1 Change les marques + addq.w #1,d1 + move.w (a3),d1 + neg.w d1 + bsr Ed_MarksChange + JJsr L_Prg_CptLines Compte + bsr Ed_NewBufAff Afiche +; Enleve la premiere ligne +.NoMi move.w (a2),d0 + beq.s .Pa1 + bsr R_DelChar + bsr Ed_EALiCu +.Pa1 btst #30,d7 Pas de tokenisation si juste milieu + bne.s .Ok + bsr Ed_TokCur +; Derniere ligne +.Der move.l 2(a3),d0 Pointe la derniere ligne + lea 6(a3,d0.l),a3 + moveq #0,d0 Locate debut ligne suivante + bsr Ed_GotoX + move.w d4,d0 + addq.w #1,d0 + bsr Ed_GotoY + move.w (a3),d0 + beq.s .Join + bsr R_DelChar Enleve les caracteres + bsr Ed_TokCur +.Join bsr Ed_Join Join la ligne du dessus + bsr Ed_TokCur + bra.s .Ok +; Une procedure sur la premiere ligne +.Proc1 move.l 2(a3),d0 Enleve le programme + move.w d4,d1 + bsr Ed_DelChunk + move.w d4,d0 Change les marques + move.w (a3),d1 + neg.w d1 + bsr Ed_MarksChange + JJsr L_Prg_CptLines + bsr Ed_NewBufAff + move.l 2(a3),d0 + lea 6(a3,d0.l),a3 + moveq #0,d0 Locate debut ligne + bsr Ed_GotoX + move.w (a3),d0 + beq.s .Ok + bsr R_DelChar Enleve les caracteres + bsr Ed_TokCur +; Termine! +.Ok moveq #-1,d0 +.Vide subq.b #1,Ed_FUndo(a5) + movem.l (sp)+,d2-d7/a2-a3 + tst.l d0 + rts + + +; +; Fabrique le bloc. (a0) adresse ou poker la structure +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +; A0 adresse du pointeur +; D4-D7 limites du bloc +Ed_BlockCopyA0 + movem.l a2-a3/d2-d7,-(sp) + move.l a0,-(sp) +; Calcule la taille +; ~~~~~~~~~~~~~~~~~ + move.l Ed_BufT(a5),a3 + lea 256(a3),a3 + move.l a3,d3 + neg.l d3 + and.l #$0000FFFF,d7 Libere les flags +; Copie la premiere ligne + move.w Edt_YPos(a4),d0 La ligne courante? + add.w Edt_YCu(a4),d0 + cmp.w d0,d4 + bne.s .NoCur + bsr Ed_LCourant Ligne sous le curseur + bne .NoCur + tst.w d0 + beq .NoBloc + lea -2(a0),a1 + bra.s .Copy1 +.NoCur move.w d4,d0 Trouve la ligne + bsr Ed_FindL + beq .NoBloc + JJsrR L_Tk_EditL,a1 Peut on couper la ligne? + beq.s .Proc1 + move.l Ed_BufT(a5),a1 Detokenise la ligne... + moveq #0,d0 + bsr Detok + move.l Ed_BufT(a5),a1 +.Copy1 move.w (a1)+,d0 + cmp.w d0,d6 + bcs.s .Sk1 + move.w d0,d6 +.Sk1 cmp.w d4,d5 + beq .Seul + sub.w d6,d0 + move.b d0,(a3)+ + beq.s .Der + subq.w #1,d0 + add.w d6,a1 +.Cp1 move.b (a1)+,(a3)+ + dbra d0,.Cp1 + bra.s .Der +; Une procedure sur la premiere ligne +.Proc1 tst.w d6 X=0? + bne Ed_NotEdit + cmp.w d4,d5 Au moins une ligne? + ble Ed_NotEdit + bset #31,d7 X1= Flag + clr.b (a3)+ 1ere ligne vide +; Copie la derniere ligne +.Der clr.b (a3)+ + move.w Edt_YPos(a4),d0 La ligne courante? + add.w Edt_YCu(a4),d0 + cmp.w d0,d5 + bne.s .NoCur2 + bsr Ed_LCourant Ligne sous le curseur + bne.s .NoCur2 + tst.w d0 + beq.s .Nc2 + lea -2(a0),a1 + bra.s .Copy2 +.NoCur2 move.w d5,d0 + bsr Ed_FindL + beq .Nc2 + bsr Ed_EditL + beq.s .Proc2 + move.l Ed_BufT(a5),a1 + moveq #0,d0 + bsr Detok + move.l Ed_BufT(a5),a1 +.Copy2 move.w (a1)+,d0 + cmp.w d0,d7 + bcs.s .Sk2 + move.w d0,d7 +.Sk2 move.w d7,d0 + move.b d0,-1(a3) + beq.s .Nc2 + subq.w #1,d0 +.Cp2 move.b (a1)+,(a3)+ + dbra d0,.Cp2 +.Nc2 bra.s .Mil +; Une procedure sur la derniere ligne: le curseur doit etre ïż½ gauche +.Proc2 tst.w d7 Curseur ïż½ gauche donc + bne Ed_NotEdit rien ïż½ copier! +; Evalue la taille du milieu +.Mil move.w d4,d2 + btst #31,d7 Si closed procedure + bne.s .Ccp + addq.w #1,d2 +.Ccp cmp.w d2,d5 + beq.s .NoM + move.w d2,d0 + bsr Ed_FindL + beq.s .NoM +.Ct3 bsr Ed_SizeL + add.l d0,d3 + bsr Ed_NextL + beq.s .NoM + addq.w #1,d2 + cmp.w d5,d2 + bcs.s .Ct3 +.NoM addq.l #4+2,d3 + bra.s .Reserve +; Une seule ligne: copie le bout +.Seul cmp.w d0,d7 + bcs.s .SkS + move.w d0,d7 +.SkS move.w d7,d0 + sub.w d6,d0 + beq .NoBloc + move.b d0,(a3)+ + beq.s .Sl2 + subq.w #1,d0 + add.w d6,a1 +.Sl1 move.b (a1)+,(a3)+ + dbra d0,.Sl1 +.Sl2 bset #30,d7 +; Reserve la mïż½moire +; ~~~~~~~~~~~~~~~~~~ +.Reserve + add.l a3,d3 + tst.l d3 + beq .NoBloc + move.l (sp),a0 + bsr Ed_BlockFreeA0 + add.l #24,d3 + move.l d3,d0 + move.l (sp),a0 + bsr Ed_MemReserve + beq .OOm + move.l a0,a1 + movem.w d4-d6,(a1) Stocke les positions + lea 6(a1),a1 + move.l d7,(a1)+ Flags +; Copie la premiere ligne +; ~~~~~~~~~~~~~~~~~~~~~~~ + move.l Ed_BufT(a5),a2 + lea 256(a2),a2 + moveq #0,d0 + move.b (a2)+,d0 + move.w d0,(a1)+ + beq.s .Pc1 + subq.w #1,d0 +.Co1 move.b (a2)+,(a1)+ + dbra d0,.Co1 + move.l a1,d0 + Pair d0 + move.l d0,a1 +.Pc1 btst #30,d7 Seul? + bne.s .Ok +; Copie le milieu +; ~~~~~~~~~~~~~~~ +.CMil move.l a1,a3 + clr.w (a1)+ Nombre de lignes + clr.l (a1)+ Taille + clr.w (a1) + move.w d4,d3 + btst #31,d7 Si closed + bne.s .Cpr + addq.w #1,d3 +.Cpr cmp.w d5,d3 + bcc.s .Sc2 + move.w d3,d0 + bsr Ed_FindL + beq.s .Sc2 +.Lo2 addq.w #1,(a3) Une ligne de plus + bsr Ed_SizeL + add.l d0,2(a3) Taille en plus + lsr.l #1,d0 +.Mc2 move.w (a0)+,(a1)+ + subq.l #1,d0 + bne.s .Mc2 + bsr Ed_NextL + beq.s .Sc2 + addq.w #1,d3 + cmp.w d5,d3 + bcs.s .Lo2 +.Sc2 +; Copie la derniere ligne +; ~~~~~~~~~~~~~~~~~~~~~~~ + moveq #0,d0 + move.b (a2)+,d0 + move.w d0,(a1)+ + beq.s .Ok + subq.w #1,d0 +.Co2 move.b (a2)+,(a1)+ + dbra d0,.Co2 + bra.s .Ok +; Finito! +; ~~~~~~~ +.OOm moveq #-1,d0 + bra.s .End +.NoBloc moveq #1,d0 + bra.s .End +.Ok moveq #0,d0 +.End move.l (sp)+,a0 + movem.l (sp)+,d2-d7/a2-a3 + rts + +; ________________________________________ +; +; SAVE BLOCK +; ________________________________________ +; +Ed_BlocSave + bsr Ed_TokCur + tst.l Ed_Block(a5) + beq Ed_BlocWhat +; Selecteur de fichier +; ~~~~~~~~~~~~~~~~~~~~ + moveq #90,d0 + bsr Ed_File_Selector + beq Ed_NotDone + JJsr L_Dsk.PathIt + bsr Ed_SaveOver +; Message saving block +; ~~~~~~~~~~~~~~~~~~~~ + move.w #154,d0 + move.l Name1(a5),a0 + bsr Ed_AvName +; Ouvre le fichier +; ~~~~~~~~~~~~~~~~ + move.l #1006,d2 + bsr Ed_Open + beq Ed_DError +; Sauve l'entete AMOS BASIC V1.00 illegal +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + lea EnHead(pc),a0 + move.b #"v",11(a0) + move.l a0,d2 + moveq #16,d3 + bsr Ed_Write + bne Ed_DError +; Place pour la taille +; ~~~~~~~~~~~~~~~~~~~~ + move.l Ed_BufT(a5),d2 + moveq #4,d3 + bsr Ed_Write + bne Ed_DError +; Premiere ligne du bloc +; ~~~~~~~~~~~~~~~~~~~~~~ + moveq #0,d4 + move.l Ed_Block(a5),a2 + movem.w (a2)+,d4-d6 + move.l (a2)+,d7 + moveq #0,d4 + move.w (a2),d3 + beq.s .Pa1 + lea 2(a2),a0 Tokenise la premiere ligne + move.l Ed_BufT(a5),a1 + bsr Tokenise + move.l d1,d3 + beq.s .Pa1 + add.l d3,d4 Plus taille + move.l Ed_BufT(a5),d2 Sauve + bsr Ed_Write + bne Ed_DError +.Pa1 add.w (a2)+,a2 + move.l a2,d0 + Pair d0 + move.l d0,a2 +; Milieu du bloc! +; ~~~~~~~~~~~~~~~ + move.l 2(a2),d3 Taille du milieu + beq.s .NoMi + add.l d3,d4 Plus Taille + lea 6(a2),a0 Va ecrire le chunk + move.l a0,d2 + bsr Ed_Write + bne Ed_DError +.NoMi move.l 2(a2),d0 + lea 6(a2,d0.l),a2 +; Fin du bloc +; ~~~~~~~~~~~ + move.w (a2)+,d3 + beq.s .PaF + move.l a2,a0 Tokenise la fin + move.l Ed_BufT(a5),a1 + bsr Tokenise + move.l d1,d3 Quelquechose ïż½ sauver? + beq.s .PaF + add.l d3,d4 Plus taille + move.l Ed_BufT(a5),d2 + bsr Ed_Write Sauve + bne Ed_DError +.PaF +; Banques vides +; ~~~~~~~~~~~~~ +.Seul JJsr L_Bnk.SaveVide +; Va changer la taille du fichier +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + moveq #16,d2 Locate au debut + moveq #-1,d3 + bsr Ed_Seek + move.l Ed_BufT(a5),a0 Poke et sauve la taille + move.l d4,(a0) + move.l a0,d2 + moveq #4,d3 + bsr Ed_Write + bne Ed_DError +; Finito! +; ~~~~~~~ + bsr Ed_Close + bsr Ed_AverFin + rts + +; ___________________________________________________ +; +; SAUVEGARDE BLOC EN ASCII +; ___________________________________________________ +; +Ed_BlocSaveAscii + bsr Ed_TokCur + tst.l Ed_Block(a5) + beq Ed_BlocWhat +; Selecteur de fichier +; ~~~~~~~~~~~~~~~~~~~~ + moveq #82,d0 + bsr Ed_File_Selector + beq Ed_NotDone + JJsr L_Dsk.PathIt + bsr Ed_SaveOver +; Ouvre le fichier MODE_NEW +; ~~~~~~~~~~~~~~~~~~~~~~~~~ + move.l #1006,d2 + bsr Ed_Open + beq Ed_DError + move.w #156,d0 + move.l Name1(a5),a0 + bsr Ed_AvName +; Detokenise tout le bloc +; ~~~~~~~~~~~~~~~~~~~~~~~ + bsr BlToA0 + beq.s .Vide +.Loop move.b #10,(a0) + addq.l #1,d3 + bsr Ed_Write + bne Ed_DError + bsr BlToA1 + bne.s .Loop +; Ca y est! +; ~~~~~~~~~ +.Vide bsr Ed_Close + bsr Ed_AverFin + rts + +; +; PRINT PROGRAM +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_PrgPrint + bsr Ed_TokCur +; Boite de dialogue +; ~~~~~~~~~~~~~~~~~ + moveq #EdD_PProg,d0 + bsr Ed_Dialogue + cmp.w #1,d0 + bne Ed_NotDone +; Avertissement +; ~~~~~~~~~~~~~ + move.w #217,d0 + bsr Ed_AverMess + bsr Ed_PRTOpen +; Boucle d'impression +; ~~~~~~~~~~~~~~~~~~~ + moveq #0,d0 + bsr Ed_FindL + beq.s .Exit +.Loop bclr #BitControl-8,T_Actualise(a5) + bne.s .Exit + move.l Ed_BufT(a5),a1 + moveq #0,d0 + bsr Detok + move.l Ed_BufT(a5),a0 + move.w (a0)+,d0 + lea 0(a0,d0.w),a1 + move.b #13,(a1)+ + move.b #10,(a1)+ + clr.b (a1) + bsr Ed_PRTPrint +.In bsr Ed_NextL + bne.s .Loop +; Ca y est! +; ~~~~~~~~~ +.Exit bsr Ed_Close + bsr Ed_AverFin + SyCall ClearKey + rts +; +; PRINT BLOC +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_BlocPrint + bsr Ed_TokCur + tst.l Ed_Block(a5) + beq Ed_BlocWhat +; Boite de dialogue +; ~~~~~~~~~~~~~~~~~ + moveq #EdD_PBloc,d0 + bsr Ed_Dialogue + cmp.w #1,d0 + bne Ed_NotDone +; Avertissement +; ~~~~~~~~~~~~~ + move.w #157,d0 + bsr Ed_AverMess + bsr Ed_PRTOpen +; Boucle d'impression +; ~~~~~~~~~~~~~~~~~~~ + bsr BlToA0 + beq.s .Exit +.Loop bclr #BitControl-8,T_Actualise(a5) + bne.s .Exit + move.b #13,(a0)+ + move.b #10,(a0)+ + clr.b (a0) + move.l d2,a0 + bsr Ed_PRTPrint +.In bsr BlToA1 + bne.s .Loop +; Ca y est! +; ~~~~~~~~~ +.Exit bsr Ed_Close + bsr Ed_AverFin + SyCall ClearKey + rts + +; Routines de transformation du bloc en ASCII +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +BlToA0 move.l Ed_Block(a5),a2 + movem.w (a2)+,d4-d6 + move.l (a2)+,d7 + moveq #1,d4 +; Ramene la ligne en D2/D3 +; ~~~~~~~~~~~~~~~~~~~~~~~~ +BlToA1 moveq #0,d3 + tst.w d4 + beq.s .Rien + cmp.w #2,d4 + bge.s .Deuse +; Premiere / Derniere ligne + move.w (a2),d0 + beq.s .1Vide + lea 2(a2),a1 + move.l Ed_BufT(a5),a0 + move.l a0,d2 + subq.w #1,d0 + bmi.s .Cp +.Co move.b (a1)+,(a0)+ + dbra d0,.Co +.Cp move.l a0,d3 + sub.l d2,d3 + add.w (a2)+,a2 + move.l a2,d0 + Pair d0 + move.l d0,a2 +.Rien move.w d4,d0 + addq.w #1,d4 + tst.w d0 + rts +.1Vide addq.w #1,d4 + addq.l #2,a2 Saute la longueur + bra.s BlToA1 +; Milieu du bloc +.Deuse cmp.w #2,d4 Le premier? + bne.s .Corps + move.w (a2),d5 Oui, prend la taille + addq.l #6,a2 Pointe la 1ere ligne +.Corps subq.w #1,d5 Encore a faire? + bmi.s .2Vide + move.l a2,a0 Detokenise + move.l Ed_BufT(a5),a1 + moveq #0,d0 + bsr Detok + move.l a2,a0 Pointe la ligne suivante + JJsrP L_Tk_FindN,a2 + move.l a0,a2 + move.l Ed_BufT(a5),a0 Retourne la ligne + moveq #0,d3 + move.w (a0)+,d3 + move.l a0,d2 + add.w d3,a0 + bra.s .Rien +.2Vide moveq #-1,d4 Derniere ligne + bra BlToA1 Recommence + +; Retourne les limites du bloc en d0/d1/d2/d3 +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_BlocLimits + move.w Edt_YBloc(a4),d1 + bmi Ed_BlocWhat + move.w Edt_YPos(a4),d3 + add.w Edt_YCu(a4),d3 + move.w Edt_XBloc(a4),d0 + move.w Edt_XCu(a4),d2 + cmp.w d1,d3 + bhi.s .PaSw + bne.s .Sw + cmp.w d0,d2 + bcc.s .PaSw +.Sw exg d0,d2 + exg d1,d3 +.PaSw rts + +;____________________________________________________________________ +; +; MACROS +;____________________________________________________________________ +; +; Chargement des macros par defaut +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +EdMa_LoadDefault + moveq #46,d0 + bsr Ed_GetSysteme + JJsrR L_Sys_AddPath,a1 + bsr EdMa_LoadIt + clr.b EdMa_Changed(a5) + rts +; Chargement des macros +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +EdMa_LoadAs + moveq #55,d0 + bsr Ed_File_Selector + beq Ed_NotDone + JJsr L_Dsk.PathIt + bsr EdMa_LoadIt + move.b #1,EdMa_Changed(a5) + rts + +; Charge le fichier macros +; ~~~~~~~~~~~~~~~~~~~~~~~~ +EdMa_LoadIt + tst.l EdMa_List(a5) Erase old macros? + beq.s .Skip + moveq #EdD_MacroEra,d0 + bsr Ed_Dialogue + cmp.w #1,d0 + bne Ed_NotDone +; Averti et charge +.Skip moveq #62,d0 + bsr Ed_AverMess + bsr EdMa_Load + bsr Ed_AverFin + beq .Ok + bmi Ed_OMm + subq.w #1,d0 + beq Ed_DError +; Pas un fichier MACRO + moveq #EdD_MacroPas,d0 + bsr Ed_Dialogue + bsr Ed_Loca +; Fini +.Ok rts + +; Sauvegarde des macros par default +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +EdMa_SaveDefault +EdMa_SaveDef + moveq #46,d0 + bsr Ed_GetSysteme + JJsrR L_Sys_AddPath,a1 + bsr EdMa_SaveIt + rts +; Sauvegarde des macros +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +EdMa_SaveAs + moveq #51,d0 + bsr Ed_File_Selector + beq Ed_NotDone + JJsr L_Dsk.PathIt + bsr Ed_SaveOver + bsr EdMa_SaveIt + rts +; Averti et sauve +EdMa_SaveIt + moveq #61,d0 + bsr Ed_AverMess + bsr EdMa_Save + bsr Ed_AverFin + bne Ed_DError + clr.b EdMa_Changed(a5) + rts + +; Chargement du fichier de macros +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +; Out D0=0 Pas d'erreur +; D0=-1 Erreur disque +; D0=1 Pas macros +EdMa_Load +; Effacer les precedentes + bsr EdMa_End + clr.b EdMa_Change(a5) +; Ouvre le fichier + move.l #1005,d2 + bsr Ed_Open + beq .Err +; Charge l'entete AMOSPro MACROS + move.l Buffer(a5),a2 + move.l a2,d2 + moveq #4,d3 + bsr Ed_Read + bne .Err + cmp.l #EdMa_Head,(a2) + bne.s .Noma +; Charge les macros une par une +.Loop move.l a2,d2 + moveq #8,d3 + bsr Ed_Read + bne.s .Err + move.l 4(a2),d3 + beq.s .End + move.l d3,d0 + lea EdMa_List(a5),a0 + bsr Ed_ListeNew + beq.s .Out + addq.l #8,a1 + move.l a1,d2 + bsr Ed_Read + bne.s .Err + bra.s .Loop +; Ferme le fichier +.End bsr Ed_Close + moveq #0,d0 + rts +; Erreur de chargement +.Err bsr Ed_Close + moveq #1,d0 + rts +; Pas un fichier macro +.Noma bsr Ed_Close + moveq #2,d0 + rts +; Out of memory +.Out bsr Ed_Close + moveq #-1,d0 + rts + +; Sauvegarde du fichier de macros +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +; OUT D0=0 Pas d'erreur +; D0=-1 Erreur disque +EdMa_Save + move.l #1006,d2 + bsr Ed_Open + beq Ed_DError +; Sauve l'entete AMOSPro MACROS + move.l Buffer(a5),a0 + move.l #EdMa_Head,(a0) + move.l a0,d2 + moveq #4,d3 + bsr Ed_Write + bne.s .Err +; Sauve les macros une par une + move.l EdMa_List(a5),d2 + beq.s .Fin +.Loop move.l d2,a2 + move.l 4(a2),d3 + addq.l #8,d3 + bsr Ed_Write + bne.s .Err + move.l (a2),d2 + bne.s .Loop +; Fin : 0/0 +.Fin move.l Buffer(a5),d2 + move.l d2,a0 + clr.l (a0)+ + clr.l (a0)+ + moveq #8,d3 + bsr Ed_Write + bne.s .Err +; Ferme le fichier + bsr Ed_Close + moveq #0,d0 + rts +; Erreur disque +.Err bsr Ed_Close + moveq #1,d0 + rts + +; Effacement d'une macro +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +EdMa_Del + bsr Ed_TokCur + tst.l EdMa_List(a5) + beq EdMa_No + moveq #EdD_MacroD,d0 + bsr Ed_Dialogue + tst.w d0 + bne Ed_NotDone + move.l Ed_ADialogues(a5),a0 + move.l Dia_LastKey(a0),d2 + beq Ed_NotDone + move.l d2,d1 + bsr EdMa_Adr + beq.s .NotA + bsr Ed_ListeDel +; Marque pour QUIT + move.b #1,EdMa_Change(a5) + bra Ed_Loca +; Key not assigned to a macro +.NotA moveq #EdD_MacroNA,d0 + bsr Ed_Dialogue + bra Ed_Loca +; Effacement de toutes les macros +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +EdMa_DelAll + bsr Ed_TokCur + tst.l EdMa_List(a5) + beq EdMa_No + moveq #EdD_MacroAll,d0 + bsr Ed_Dialogue + cmp.w #1,d0 + bne Ed_NotDone + bsr EdMa_End +; Marque pour QUIT + move.b #1,EdMa_Change(a5) + bra Ed_Loca +; Dïż½marre l'enregistrement d'une nouvelle macro +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +EdMa_New + bsr Ed_TokCur +; Boite de dialogue 1 + moveq #EdD_Macro1,d0 + bsr Ed_Dialogue + tst.w d0 + bne Ed_NotDone + move.l Ed_ADialogues(a5),a0 + move.l Dia_LastKey(a0),d2 + beq Ed_NotDone + move.l d2,d1 + bsr EdMa_Adr + beq.s .Skip +; Key already assigned to a macro + move.l a1,-(sp) + moveq #EdD_Macro2,d0 + bsr Ed_Dialogue + cmp.w #1,d0 + bne Ed_NotDone + move.l (sp)+,a1 + lea EdMa_List(a5),a0 + bsr Ed_ListeDel +; Rïż½serve le buffer temporaire +.Skip move.l #1024,d0 + move.l d0,d1 + lea EdMa_List(a5),a0 + bsr Ed_ListeNew + move.w #1,EdMa_Tape(a5) + move.l d2,8(a1) + move.l #-1,8-4(a1,d1.w) +; Provoque l'affichage de la ligne infos + bsr Ed_AverFin + bsr Ed_Loca + rts + +; Termine l'enregistrement de la macro +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +EdMa_Stop +; Plus de souris + JJsr L_Dia_NoMKey + move.b #1,EdMa_Change(a5) +; Reserve le buffer dïż½finitif + lea EdMa_List(a5),a0 + move.l (a0),a2 + move.l a2,d3 + lea 8(a2),a2 + move.w EdMa_Tape(a5),d2 + clr.w EdMa_Tape(a5) + subq.w #1,d2 + beq .Vide + moveq #8,d0 + add.w d2,d0 + bsr Ed_ListeNew +; Copie le buffer + lea 8(a1),a1 + move.l (a2)+,(a1)+ + subq.w #1,d2 +.Loop move.b (a2)+,(a1)+ + dbra d2,.Loop + move.b #-1,(a1)+ +; Enleve le buffer temporaire + move.l d3,a1 + bsr Ed_ListeDel +; Avertissement + moveq #45,d0 + bra Ed_Al100 +; Pas de touches! +.Vide move.l d3,a1 + bsr Ed_ListeDel + bra Ed_NotDone + +; Trouve une macro de code D1 +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~ +EdMa_Adr + lea EdMa_List(a5),a0 + move.l (a0),d0 + beq.s .NFound +.Loop move.l d0,a1 + cmp.l 8(a1),d1 + beq.s .Found +.In move.l (a1),d0 + bne.s .Loop +.NFound rts +; Trouve +.Found move.l a1,d0 + rts +; Efface l'arbre des macros +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +EdMa_End + lea EdMa_List(a5),a0 + bra Ed_ListeDelAll +; Pas une macro +; ~~~~~~~~~~~~~ +EdMa_No + moveq #EdD_MacroNo,d0 + bsr Ed_Dialogue + bra Ed_Loca + +;_____________________________________________________________________________ +; +; Search / Replace / Goto +;_____________________________________________________________________________ +; + +; Goto line number +; ~~~~~~~~~~~~~~~~ +Ed_GotoL + bsr Ed_TokCur + tst.b Ed_Zappeuse(a5) + beq.s .PaZap + move.l Ed_ZapParam(a5),d0 + bra.s .Zap +.PaZap moveq #EdD_GotoL,d0 + bsr Ed_Dialogue + cmp.w #1,d0 + bne Ed_NotDone + moveq #1,d0 + moveq #3,d1 + moveq #-1,d2 + JJsr L_Dia_GetValue + move.l d1,d0 +.Zap subq.l #1,d0 + bmi Ed_NotDone + cmp.w Prg_NLigne(a6),d0 + bcs.s .Skip + move.w Prg_NLigne(a6),d0 +.Skip bsr Ed_AutoMarks + bsr Ed_GotoY + rts + + +; Appel le dialogue pour SEARCH, d0DIALOG A APPELER +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_DiaS move.w d0,d2 + lea Ed_SchBuf(a5),a0 Chaine d'origine + bsr Ed_DChaine + move.l Ed_VDialogues(a5),a2 + move.l a1,(a2)+ + move.l #32,(a2)+ Taille de la ligne + move.w Ed_SchMode(a5),d0 Met les flags + and.w #%0001,d0 Garde LOWUP / Bloc limits + moveq #4,d1 + move.l a2,a0 + JJsrP L_Dia_SetVFlags,a2 +; Appelle les dialogues + move.w d2,d0 + bsr Ed_Dialogue + move.w d0,-(sp) +; Reprend les variables + move.l Ed_VDialogues(a5),a0 + lea 2*4(a0),a0 + moveq #4,d1 + JJsrP L_Dia_GetVFlags,a2 + move.w d0,Ed_SchMode(a5) +; Reprend la chaine + moveq #1,d0 + moveq #3,d1 + moveq #-1,d2 + JJsr L_Dia_GetValue + move.l d1,a0 + lea Ed_SchBuf(a5),a1 +.Loop move.b (a0)+,(a1)+ + bne.s .Loop +; Ramene le retour + move.w (sp)+,d0 + rts + +; SEARCH +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_Search + bsr Ed_TokCur + moveq #EdD_Search,d0 + bsr Ed_DiaS + cmp.w #1,d0 + bne Ed_NotDone + move.w Ed_SchMode(a5),d5 Garde Low/UP, et direction! + and.w #%0011,d5 + bra Ed_SR +; SEARCH PREVIOUS +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_SearchPrev + bsr Ed_TokCur + tst.b Ed_SchBuf(a5) Quelque chose ïż½ trouver? + beq.s Ed_Search + move.w Ed_SchMode(a5),d5 + and.w #%0001,d5 Garde LowUp + bset #1,d5 En arriere! + bra.s Ed_SR +; SEARCH NEXT +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_SearchNext + bsr Ed_TokCur + tst.b Ed_SchBuf(a5) Quelque chose ïż½ trouver? + beq.s Ed_Search + move.w Ed_SchMode(a5),d5 + and.w #%0001,d5 Garde LowUp, en avant! +; Fait la recherche / Remplacement, D5flags +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_SR + bsr Ed_SRCompte +; Fait le remplacement + move.w Edt_YPos(a4),d7 + add.w Edt_YCu(a4),d7 + move.w Edt_XCu(a4),d6 + move.w #32000,d4 Limites en bas + move.w #32000,d3 +; Va chercher + moveq #36,d0 + bsr Ed_AverMess + bsr Ed_SchBoth + beq Ed_NoFound +; Positionne le curseur + bsr Ed_AutoMarks + movem.w d2-d7,-(sp) + move.w d7,d0 + bsr Ed_GotoY + movem.w (sp),d2-d7 + move.w d6,d0 + bsr Ed_GotoX + movem.w (sp)+,d2-d7 +; Trouve, faire une remplacement? + btst #15,d5 + beq.s .NoRep + bsr Ed_LCourant + move.w d6,d0 + bsr RepBuffer + bne Ed_LToLong + addq.w #1,Edt_LEdited(a4) + bsr Ed_TokCur + move.w d6,d0 + bsr Ed_GotoX +.NoRep +; Fini! + bsr Ed_AverFin + bsr Ed_Loca + rts + + +; Compte les buffers SEARCH/REPLACE +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_SRCompte + lea Ed_SchBuf(a5),a0 + moveq #-1,d0 +.LoopS addq.w #1,d0 + tst.b (a0)+ + bne.s .LoopS + move.b d0,Ed_SchLong(a5) + lea Ed_RepBuf(a5),a0 + moveq #-1,d0 +.LoopR addq.w #1,d0 + tst.b (a0)+ + bne.s .LoopR + move.b d0,Ed_RepLong(a5) + rts + +; Routines de recherche en AVANT / ARRIERE +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_SchBoth + btst #1,d5 + bne Ed_SchBack +; +; Recherche en avant +; ~~~~~~~~~~~~~~~~~~ +; D7= Y +; D6= X +; D5= Flags +; D4= YMax +; D3= XMax +Ed_SchFront + addq.w #1,d6 +.Fst move.w d7,d0 + bsr Ed_FindL + beq .SrchN +; Sort des limites? +.SrchL cmp.w d4,d7 + bgt.s .SrchN + bne.s .Srch1 + cmp.w d3,d6 + bgt.s .SrchN +; Detokenise, et recherche +.Srch1 moveq #0,d0 + move.l Ed_BufT(a5),a1 + bsr Detok + move.l Ed_BufT(a5),a0 + move.w (a0),d0 + clr.b 2(a0,d0.w) + cmp.w d0,d6 + bcc.s .Srch2 + lea 2(a0,d6.w),a0 + lea Ed_SchBuf(a5),a1 + bsr SchBuffer + bpl.s .Srch3 +; Ligne suivante +.Srch2 moveq #0,d6 + bclr #BitControl-8,T_Actualise(a5) + bne.s .SrchN + bsr Ed_NextL + beq.s .SrchN + addq.w #1,d7 + bra.s .SrchL +; Vraiment trouve? +.Srch3 add.w d0,d6 + cmp.w d4,d7 + bne.s .SrchT + cmp.w d3,d6 + bls.s .SrchT +; Pas trouve, FAUX +.SrchN moveq #0,d0 + rts +; Trouve, VRAI +.SrchT moveq #-1,d0 + rts +; Recherche en arriere +; ~~~~~~~~~~~~~~~~~~~~ +; D7= Y +; D6= X +; D5= Flags +; D4= YMax +; D3= XMax +Ed_SchBack + movem.w d6-d7,-(sp) + move.w d7,d4 Jusqu'ïż½ la position actuelle -1 + move.w d6,d3 + subq.w #1,d3 + bpl.s .Mm + move.w #255,d3 + subq.w #1,d4 + bmi.s .NFound +.Mm clr.w d6 A partir du dïż½but + clr.w d7 + move.l #-1,-(sp) +.Loop bsr Ed_SchFront Tant que l'on trouve + beq.s .PaT + move.w d6,2(sp) + move.w d7,(sp) + addq.w #1,d6 + bra.s .Loop +.PaT move.w (sp)+,d7 + move.w (sp)+,d6 + bmi.s .NFound +; Trouve! Retourne VRAI + addq.l #4,sp + moveq #-1,d0 + rts +; Pas trouve: FAUX +.NFound movem.w (sp)+,d6-d7 + moveq #0,d0 + rts +; +; Routine SEARCH +; ~~~~~~~~~~~~~~ +; A1= Chaine ïż½ chercher +; A0= Chaine dans laquelle cherche +; D5-> Flags +; D6-> X Debut +SchBuffer + movem.l a1/d1-d4,-(sp) + move.l a0,d4 + move.b (a1)+,d0 + bsr.s .MajS + move.b d0,d1 + move.l a1,d3 +.RSe1 move.b (a0)+,d0 * Cherche la 1ere lettre + beq.s .RSeN + bsr.s .MajS + cmp.b d0,d1 + bne.s .RSe1 + move.l a0,d2 + swap d1 +.RSe2 move.b (a1)+,d0 + beq.s .RSeT + bsr.s .MajS + move.b d0,d1 + move.b (a0)+,d0 + bsr.s .MajS + cmp.b d0,d1 + beq.s .RSe2 + move.l d2,a0 + move.l d3,a1 + swap d1 + bra.s .RSe1 +.RSeN movem.l (sp)+,a1/d1-d4 + moveq #-1,d0 + rts +.RSeT move.l d2,d0 + sub.l d4,d0 + subq.l #1,d0 + movem.l (sp)+,a1/d1-d4 + rts +.MajS btst #0,d5 + beq.s .Skip + cmp.b #"a",d0 + bcs.s .Skip + cmp.b #"z",d0 + bhi.s .Skip + sub.b #$20,d0 +.Skip rts + + +; REPLACE +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_Replace + bsr Ed_TokCur + lea Ed_RepBuf(a5),a0 Buffer d'edition + bsr Ed_DChaine + move.l Ed_VDialogues(a5),a2 + move.l a1,8*4(a2) + moveq #EdD_Replace,d0 + bsr Ed_DiaS + move.w d0,-(sp) +; Reprend la chaine Replace + moveq #1,d0 + moveq #4,d1 + moveq #1,d2 + JJsr L_Dia_GetValue + move.l d1,a0 + lea Ed_RepBuf(a5),a1 +.Bli move.b (a0)+,(a1)+ + bne.s .Bli +; Ou se brancher? + cmp.w #1,(sp)+ + bne Ed_Loop + move.w Ed_SchMode(a5),d5 Mode TURBO? + move.w d5,d0 + and.w #%1100,d0 + bne.s .Turbo +; Mode normal, quelle dir? +; ~~~~~~~~~~~~~~~~~~~~~~~~ + btst #1,d5 + beq Ed_ReplaceNext + bne Ed_ReplacePrev +; En mode turbo +; ~~~~~~~~~~~~~ +.Turbo +; Boite de dialogue, pour confirmer... + move.l Ed_VDialogues(a5),a0 + moveq #EdD_WBlock,d0 + btst #2,d5 + bne.s .Skip + moveq #EdD_WText,d0 +.Skip bsr Ed_Dialogue + cmp.w #1,d0 + bne Ed_NotDone +; Quelque chose ïż½ chercher? + tst.b Ed_SchBuf(a5) + beq.s Ed_Replace + tst.b Ed_RepBuf(a5) + beq.s Ed_Replace + bsr Ed_SRCompte +; Fait le remplacement + moveq #0,d7 Limites en haut + moveq #0,d6 + move.w #32000,d4 Limites en bas + move.w #32000,d3 +; Dans le bloc? + btst #2,d5 Si bloc + beq.s .Pab + bsr Ed_BlocLimits + move.w d1,d7 + move.w d0,d6 + move.w d3,d4 + move.w d2,d3 + beq.s .Pab + subq.b #1,d3 +.Pab +; Averti + moveq #37,d0 + bsr Ed_AverMess +; Boucle de recherche / remplacement + clr.w -(sp) +.Loop subq.w #1,d6 Reste sur la derniere lettre + bpl.s .Pos + moveq #0,d6 +.Pos bsr Ed_SchFront + beq .Finish + move.l Ed_BufT(a5),a0 + addq.l #2,a0 + move.w d6,d0 + bsr RepBuffer + bne Ed_LToLong + move.l Ed_BufT(a5),a0 + addq.l #2,a0 + move.l Buffer(a5),a1 + bsr Tokenise + beq.s .Llong + move.l Buffer(a5),a1 + move.w d7,d1 + moveq #0,d0 + bsr Ed_Stocke + bne .Outb + addq.w #1,(sp) + bra.s .Loop +; Fini, et une boite de dialogue! +.Finish bsr Ed_NewBuf + bsr Ed_AverFin + move.b #EtA_BAll,Edt_EtatAff(a4) + move.b #SlDelai,Edt_ASlY(a4) + move.w (sp)+,d0 + beq Ed_NoFound + ext.l d0 + move.l Ed_VDialogues(a5),a0 + move.l d0,(a0) + moveq #EdD_Changes,d0 + bsr Ed_Dialogue + rts +; Line too long +.Llong bsr Ed_NewBufAff + bra Ed_LToLong +; Out of buffer space +.Outb bsr Ed_NewBufAff + bra Ed_OofBuf +; REPLACE NEXT +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_ReplaceNext + move.w Ed_SchMode(a5),d5 + and.w #$0001,d5 Vers le bas, + or.w #$8000,d5 Flag remplacer +Ed_RSR bsr Ed_TokCur + tst.b Ed_SchBuf(a5) + beq Ed_Replace + tst.b Ed_RepBuf(a5) + beq Ed_Replace + bra Ed_SR +; REPLACE PREVIOUS +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_ReplacePrev + move.w Ed_SchMode(a5),d5 + and.w #$0001,d5 Vers le haut + or.w #$8002,d5 Flag remplacer + bra.s Ed_RSR + +; +; Routine REPLACE +; ~~~~~~~~~~~~~~~ +; A0= Ligne ïż½ changer +; D0= Position du changement +RepBuffer + movem.l a0-a2/d2-d3,-(sp) + lea 0(a0,d0.w),a1 Position du changement + move.w -2(a0),d0 Marque la fin de la ligne + move.l a0,d1 + clr.b 0(a0,d0.w) + moveq #0,d2 Longueur des buffers + moveq #0,d3 + move.b Ed_SchLong(a5),d2 + move.b Ed_RepLong(a5),d3 + move.l a1,a2 + move.l a1,a0 + add.w d2,a0 +.RChg1 move.b (a0)+,(a1)+ + bne.s .RChg1 +; Place pour le nouveau + move.l a1,a0 + add.w d3,a1 + sub.l a1,d1 + neg.l d1 + cmp.w #252,d1 + bcc .Tool +.RChg2 move.b -(a0),-(a1) + cmp.l a2,a0 + bcc.s .RChg2 +; Poke le nouveau + lea Ed_RepBuf(a5),a0 + move.w d3,d0 + subq.w #1,d0 +.RChg3 move.b (a0)+,(a2)+ + dbra d0,.RChg3 +* Change la longueur de la ligne / pointe la fin du mot + add.w d3,d6 + subq.w #1,d1 + movem.l (sp)+,a0-a2/d2-d3 + move.w d1,-2(a0) + moveq #0,d0 + rts +* Line too long +.Tool movem.l (sp)+,a0-a2/d2-d3 + moveq #-1,d0 + rts + +;_____________________________________________________________________________ +; +; Procedures actualisations sliders +;_____________________________________________________________________________ +; +Edt_SliderY + bra Edt_SlUpdateY + bra Edt_SlMinusY + bra Edt_SlPlusY + bra Edt_SlDrawY +Edt_SlUpdateY + move.w Edt_WindTy(a4),Edt_SlV+Sl_Window(a4) + move.w Edt_YPos(a4),Edt_SlV+Sl_Position(a4) + move.w Prg_NLigne(a6),Edt_SlV+Sl_Global(a4) + rts +Edt_SlMinusY +Edt_SlPlusY +Edt_SlDrawY + movem.l a2-a6/d2-d7,-(sp) + move.w Edt_SlV+Sl_Position(a4),Edt_YPos(a4) + bsr Ed_NewBuf + movem.l (sp)+,a2-a6/d2-d7 + rts + +;_____________________________________________________________________________ +; +; Ligne d'ïż½tat +;_____________________________________________________________________________ +; + +; +; Imprime la ligne +; ~~~~~~~~~~~~~~~~ +Ed_EtLine + move.w Edt_YPos(a4),d0 Ligne # + add.w Edt_YCu(a4),d0 + addq.w #1,d0 + ext.l d0 + move.b Ed_EtXX+3(a5),d1 Position ligne etat + moveq #5,d2 Longueur ligne + bra Et_Chiffre +; +; Imprime la colonne +; ~~~~~~~~~~~~~~~~~~ +Ed_EtCol + move.w Edt_XCu(a4),d0 + addq.w #1,d0 + move.b Ed_EtXX+4(a5),d1 + moveq #3,d2 + bra Et_Chiffre +; +; Imprime la ligne +; ~~~~~~~~~~~~~~~~ +Ed_EtFree + move.l Prg_StBas(a6),d0 Place libre + sub.l Prg_StMini(a6),d0 + move.b Ed_EtXX+5(a5),d1 Position ligne etat + moveq #7,d2 Longueur + bra Et_Chiffre +; +; Imprime le numero d'ordre +; ~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_EtOrder + move.w Edt_Order(a4),d0 + ext.l d0 + move.b Ed_EtXX+1(a5),d1 + moveq #2,d2 + bra Et_Chiffre + + +; Impression d'un chiffre dans la ligne d'etat +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +; D1.b= X +; D0= Chiffre +; D3= Nombre de decimales +Et_Chiffre + movem.l d0/d2,-(sp) + ext.w d1 + moveq #0,d2 + WiCall Locate + move.l Buffer(a5),a0 + move.l a0,a1 + move.l #" ",(a1) + move.l (a1)+,(a1) + move.l (a1)+,(a1) + movem.l (sp)+,d0/d7 + JJsrP L_LongToDec,a2 + move.l Buffer(a5),a1 + clr.b 0(a1,d7.w) + WiCall Print + rts +; +; Insert / Overwrite +; ~~~~~~~~~~~~~~~~~~ +Ed_EtIns + move.b Ed_EtXX+2(a5),d1 + ext.w d1 + moveq #0,d2 + WiCall Locate + moveq #5,d0 + tst.b Ed_Insert(a5) + beq.s .Skip + moveq #6,d0 +.Skip bsr Ed_GetSysteme + move.l a0,a1 + WiCall Print + rts +; +; Imprime le NOM DU PROGRAMME +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_EtNom + move.b Ed_EtXX+6(a5),d1 + ext.w d1 + moveq #0,d2 + WiCall Locate + moveq #3,d0 + move.l Edt_LinkPrev(a4),d1 + or.l Edt_LinkNext(a4),d1 + beq.s .Skip + moveq #4,d0 +.Skip bsr Ed_GetSysteme + move.l a0,a1 + WiCall Print + move.b Ed_EtXX+7(a5),d1 + ext.w d1 + move.w d1,d7 + moveq #0,d2 + WiCall Locate + move.w Edt_WindESx(a4),d0 + lsr.w #3,d0 + sub.w d7,d0 + subq.w #2,d0 + move.l Buffer(a5),a0 +.Clr move.b #" ",(a0)+ + dbra d0,.Clr + clr.b (a0) + move.l Buffer(a5),a0 + bsr Ed_NPrgToBuf + move.l Buffer(a5),a1 + WiCall Print + rts + +; Copie le nom du programme dans le buffer A0 +; Termine par <32 +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_NPrgToBuf + move.l a0,a1 + lea Prg_NamePrg(a6),a0 + tst.b (a0) + beq.s .Vide + move.l a1,-(sp) + bsr Ed_DNom + move.l (sp)+,a1 + bra.s .Suit +.Vide moveq #7,d0 VIDE: "New Project" + bsr Ed_GetSysteme +.Suit tst.b (a0) + beq.s .Glo + move.b (a0)+,(a1)+ + cmp.b #32,(a1) + bcc.s .Suit +.Glo move.l a1,a0 +.Fin cmp.b #32,(a1) + bcs.s .Out + move.b #" ",(a1)+ + bra.s .Fin +.Out rts +; +; Recall MESSAGE D'ALERTE +; ~~~~~~~~~~~~~~~~~~~~~~~ +Ed_RAlert + moveq #127,d0 + move.l Ed_BufT(a5),a0 + lea 256(a0),a0 + cmp.l #$FFFE0102,(a0)+ + bne.s .Skip + move.l a0,Edt_EtAlert(a4) + move.w #150,Edt_EtMess(a4) + bset #EtA_Alert,Edt_EtatAff(a4) + bsr Ed_EtPrintD0 +.Skip rts + +; +; MESSAGE D'ALERTE +; ~~~~~~~~~~~~~~~~ +Ed_Alert + tst.b Ed_Zappeuse(a5) + bne.s Ed_ZapAlert + moveq #"G",d0 Va faire du bruit! + bsr Ed_SamPlay +; Pas de programme en tïż½lïż½commande! +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + move.w d0,Edt_EtMess(a4) + move.l a0,Edt_EtAlert(a4) + bset #EtA_Alert,Edt_EtatAff(a4) + move.l Ed_BufT(a5),a1 + lea 256(a1),a1 + move.l #$FFFE0102,(a1)+ +.Alrt move.b (a0)+,(a1)+ + bne.s .Alrt + bsr Ed_RazAlert + bra Ed_Loop +; Un programme en tïż½lïż½commande! +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_ZapAlert + move.w d0,Edt_EtMess(a4) + move.l a0,Edt_EtAlert(a4) + bset #EtA_Alert,Edt_EtatAff(a4) + move.l a0,Ed_ZapMessage(a5) + move.w #-1,Ed_ZapError(a5) + moveq #0,d0 + JJsr L_ResTempBuffer + bsr Ed_Close + bra Ed_Loop +; En Cas d'alerte, un peu de menage... +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_RazAlert + moveq #0,d0 + JJsr L_ResTempBuffer + bsr Ed_Close + rts + +; MESSAGE D'ALERTE en routine +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_AlertRts + tst.b Ed_Zappeuse(a5) + bne.s Ed_ZapAlert + movem.l a2-a3/d2-d4,-(sp) + move.l Edt_Current(a5),a4 + move.l Edt_Prg(a4),a6 + move.w d0,Edt_EtMess(a4) + move.l a0,Edt_EtAlert(a4) + bset #EtA_Alert,Edt_EtatAff(a4) + bsr Ed_EtPrintD0 + movem.l (sp)+,a2-a3/d2-d4 + rts + +; Affiche un avertissement avec nom A0=nom / D0=Mess +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_AvName + movem.l a0-a1/d0-d1,-(sp) + move.l a0,-(sp) + bsr Ed_GetMessage + move.l Ed_BufT(a5),a1 + bsr EdCocop + subq.l #1,a1 + move.l (sp)+,a0 + bsr EdCocop + move.l Ed_BufT(a5),a0 + clr.b 72(a0) + bsr Ed_Avertir + movem.l (sp)+,a0-a1/d0-d1 + rts +; Avertissement message editeur D0 +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_AverMess + move.l a0,-(sp) + bsr Ed_GetMessage + bsr Ed_Avertir + move.l (sp)+,a0 + rts +; +; Affiche un AVERTISSEMENT, boite de dialogue DEVANT le texte +; ~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_Avertir + movem.l d0-d6/a0-a2,-(sp) + bsr Ed_SetBanks + move.l #EntNul,d0 + move.l d0,d1 + move.l a0,d2 + addq.w #1,Ed_Avert(a5) + move.w Ed_Avert(a5),d3 + add.w #10,d3 + ext.l d3 + moveq #0,d4 + moveq #0,d5 Ne pas copier le programme + move.l #1024,d6 + move.l Ed_Resource(a5),a0 + move.l a0,a1 + add.l 2+8(a0),a0 Base des programmes + add.l 6(a0),a0 Programme numero deux + add.l 2(a1),a1 = Graphiques + move.l Ed_Messages(a5),a2 Base des messages + JJsrP L_Dia_RunQuick,a3 + movem.l (sp)+,d0-d6/a0-a2 + rts +; +; Efface le dernier avertissement +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_AverFin + movem.l d0-d7/a0-a4,-(sp) + move.w Ed_Avert(a5),d1 + beq.s .Out + subq.w #1,Ed_Avert(a5) + add.w #10,d1 + ext.l d1 + move.l d1,-(sp) + move.l #EntNul,d2 + move.l d2,d3 + move.l d3,d4 + move.l d4,d5 + move.l Buffer(a5),a1 + EcCall BlPut + move.l (sp)+,d1 + EcCall BlDel +.Out movem.l (sp)+,d0-d7/a0-a4 + tst.w d0 + rts +; +; Effacement de tous les avertissements +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_AllAverFin + tst.w Ed_Avert(a5) + bne.s .Skip + rts +.Skip bsr Ed_AverFin + bra.s Ed_AllAverFin +; +; Reaffichage de la ligne d'etat complete +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_EtPrint + move.b #EtA_BAll,Edt_EtatAff(a4) +Ed_EtPrintD0 + tst.b Edt_EtatAff(a4) + beq .EndX + tst.b Edt_Hidden(a4) + bne .EndX + movem.l d2-d7/a2,-(sp) +; Message d'alerte +; ~~~~~~~~~~~~~~~~ + bclr #EtA_Alert,Edt_EtatAff(a4) + beq.s .Skip0 + clr.b Edt_EtatAff(a4) + tst.l Edt_EtAlert(a4) + beq .End2 + move.w Edt_WindEtat(a4),d1 + WiCall QWindow + moveq #8,d0 + bsr Et_Print + move.l Edt_EtAlert(a4),a1 + WiCall Centre + clr.l Edt_EtAlert(a4) + move.w Edt_Window(a4),d1 + WiCall QWindow + bra .End +.Skip0 tst.w Edt_EtMess(a4) + bne .End2 + move.w Edt_WindEtat(a4),d1 + WiCall QWindow +; Une macro en route: message dans la fenetre courante +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + tst.w EdMa_Tape(a5) + beq.s .PaMacro + cmp.l Edt_Current(a5),a4 + bne.s .PaMacro + moveq #8,d0 + bsr Et_Print + moveq #30,d0 + bsr Ed_GetMessage + move.l a0,a1 + WiCall Centre + clr.b Edt_EtatAff(a4) + bra.s .End +.PaMacro +; Effacement Active/Inactive +; ~~~~~~~~~~~~~~~~~~~~~~~~~~ + bclr #EtA_Clw,Edt_EtatAff(a4) + beq.s .Skip1 + moveq #10,d0 + cmp.l Edt_Current(a5),a4 + beq.s .Okd + moveq #11,d0 +.Okd bsr Et_Print Efface, + moveq #2,d0 + bsr Et_Print Imprime le fond + moveq #12,d0 + bsr Et_Print Met les couleurs des informations +; Numïż½ro d'ordre de la fenetre + bsr Ed_EtOrder +.Skip1 +; Ins + bclr #EtA_Ins,Edt_EtatAff(a4) + beq.s .Skip3 + bsr Ed_EtIns +.Skip3 +; Line, bit 2 + bclr #EtA_Y,Edt_EtatAff(a4) + beq.s .Skip4 + bsr Ed_EtLine +.Skip4 +; Col, bit 3 + bclr #EtA_X,Edt_EtatAff(a4) + beq.s .Skip5 + bsr Ed_EtCol +.Skip5 +; Free, + bclr #EtA_Free,Edt_EtatAff(a4) + beq.s .Skip6 + bsr Ed_EtFree +.Skip6 +; Nom du programme + bclr #EtA_Nom,Edt_EtatAff(a4) + beq.s .Skip7 + bsr Ed_EtNom +.Skip7 +; Fini! Que de labels.... +.End +.End2 movem.l (sp)+,a2/d2-d7 +.EndX rts + +; Routine, imprime le message systeme D0 +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Et_Print + bsr Ed_GetSysteme + move.l a0,a1 + WiCall Print + rts + + +;____________________________________________________________________ +; +; RUN / MULTIRUN / TEST / INDENT +;____________________________________________________________________ +; +; +; APPEL DU MONITEUR PAR LE MENU +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_GoMonitor + bsr Ed_TokCur + bsr Edt_ClearVar Plus aucune variable, si HELP! + bsr Ed_Hide Plein de memoire + bsr Ed_CloseEditor + JJsr L_Prg_SetBanks + JJsr L_Mon_Load Va charger le moniteur + bne.s .Load + move.l a4,Edt_Runned(a5) Programme >> runnïż½ + lea Ed_ErrRun(pc),a0 Retour du moniteur + move.l a0,Prg_JError(a5) + JJsr L_Mon_In_Editor + clr.l Edt_Runned(a5) Revient >>> Out of memory! +.Mem move.w #204,d0 +.Err move.l d0,-(sp) + bsr Ed_OpenEditor Rouvre l'editeur + bsr Ed_Appear + move.l (sp)+,d0 + bra Ed_Al100 +.Load cmp.w #-1,d0 + beq.s .Mem + move.w #222,d0 + bra.s .Err + +; ___________________________________________________________________ +; +; LANCE/CHARGE UN PROGRAMME COMME OPTION EDITEUR +; ___________________________________________________________________ +; +; A0= Definition du programme +; +Ed_PrgCommand + move.l a0,a2 +; Gestion ligne de commande +; ~~~~~~~~~~~~~~~~~~~~~~~~~ + moveq #0,d0 + move.b 2(a2),d0 + beq.s .NoCom +; Copie la ligne de commande + move.l Ed_MnPrograms(a5),a0 + bsr Ed_GetMessageA0 + moveq #0,d0 + move.b -1(a0),d0 + bra.s .Cop +; Copie la ligne courante ïż½ partir du curseur +.NoCom bsr Ed_LCourant + move.l a0,d0 + sub.l a1,d0 + add.w -2(a0),d0 + move.l a1,a0 +; Copie +.Cop move.l Buffer(a5),a1 + lea TBuffer-256-6(a1),a1 + move.l #"CmdL",(a1)+ + move.w d0,(a1)+ + subq.w #1,d0 + bmi.s .Sko +.Loop move.b (a0)+,(a1)+ + dbra d0,.Loop +.Sko +; On peut tokeniser maintenant +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + bsr Ed_TokCur + btst #0,(a2) + bne .Hidden +; Charger le programme dans la fenetre courante +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + move.l a2,-(sp) + bsr Ed_Saved Va sauver le programme + move.l (sp)+,a2 +; Recharger le programme? + btst #2,(a2) + beq.s .Sauv + lea Ed_ErrRun(pc),a0 Un message de fin... + bra.s .NLRun +; Sauve le programme +.Sauv move.l #Edt_EReload-Edt_SReload+4+4*10+128,d0 + lea Ed_Prg2ReLoad(a5),a0 + bsr Ed_MemReserve + beq Ed_OMm + move.l Prg_StTTexte(a6),(a0)+ + lea Prg_Marks(a6),a1 + moveq #9,d0 +.Cm move.l (a1)+,(a0)+ + dbra d0,.Cm + lea Edt_SReload(a4),a1 + move.w #Edt_EReload-Edt_SReload-1,d0 +.Cc move.b (a1)+,(a0)+ + dbra d0,.Cc + lea Prg_NamePrg(a6),a1 +.Cn move.b (a1)+,(a0)+ + bne.s .Cn + lea Ed_ErrRunHidden(pc),a0 Pas de message + move.b #1,Ed_RunnedHidden(a5) Flag, si Kill Editor +; NEW + LOAD + RUN! +; ~~~~~~~~~~~~~~~~~ +.NLRun move.l a0,-(sp) +; Copie le nom + moveq #0,d0 + move.b 1(a2),d0 + move.l Ed_MnPrograms(a5),a0 Prend le nom + bsr Ed_GetMessageA0 + move.l Name1(a5),a1 +.Bli move.b (a0)+,(a1)+ + bne.s .Bli + bsr Ed_New2 New! +; Charge le programme + move.w #155,d0 Message, je charge! + move.l Name1(a5),a0 + bsr Ed_AvName + moveq #-1,d0 Adapter la taille + JJsr L_Prg_Load + bne Ed_PrgLoadErr + bsr Ed_AverFin +; Run special + move.l Ed_BufT(a5),a0 Plus de Ed_RAlert + clr.l 256(a0) + bsr Ed_BlocFree Un peu de place + bsr Prg_RazUndos + bsr EdM_End + bsr EdM_Program + move.l a4,Edt_Runned(a5) Programme runnïż½ + move.l (sp)+,a1 Retour de fin variable! + lea Ed_TestMessage(pc),a2 Affichage tests + moveq #0,d0 Programme normal + JJsr L_Prg_RunIt + clr.l Edt_Runned(a5) Si revient! + bra Ed_OMm Out of mem si revient + +; Charger le programme en HIDDEN +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.Hidden moveq #0,d0 + move.b 1(a2),d0 + move.l Ed_MnPrograms(a5),a0 + bsr Ed_GetMessageA0 + move.l Name1(a5),a1 +.Copy move.b (a0)+,(a1)+ + bne.s .Copy +; Recherche un accessoire deja charge +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + bsr Edt_AccAdr + bne.s .Deja +; Charge dans une fenetre cachee +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + JJsr L_Dsk.PathIt + bsr Ed_RLoadHidden + clr.l Ed_WindowToDel(a5) + btst #2,(a2) + bne.s .Garde + move.b #-1,Edt_PrgDelete(a4) + bra.s .Skip +.Garde bsr EdM_BranchAMOS + bsr EdM_Program +.Skip move.l a4,a0 +; Branche au RUN HIDDEN normal! +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.Deja bra Ed_RunHide +; +; Recharge le programme prïż½cïż½dent +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_PrgReLoad +; New du programme prïż½cïż½dent +; ~~~~~~~~~~~~~~~~~~~~~~~~~~ + bsr Ed_New2 +; Taille du buffer +; ~~~~~~~~~~~~~~~~ + move.l Ed_Prg2ReLoad(a5),a2 + move.l (a2)+,d0 + JJsr L_Prg_ChgTTexte + beq.s .Out +; Marks +; ~~~~~ + lea Prg_Marks(a6),a0 + moveq #9,d0 +.Cm move.l (a2)+,(a0)+ + dbra d0,.Cm +; Donnee d'edition +; ~~~~~~~~~~~~~~~~ + lea Edt_SReload(a4),a0 + move.w #Edt_EReload-Edt_SReload-1,d0 +.Cc move.b (a2)+,(a0)+ + dbra d0,.Cc +; Recharge le programme +; ~~~~~~~~~~~~~~~~~~~~~~ + tst.b (a2) + beq.s .Nol + move.l Name1(a5),a0 +.Cn move.b (a2)+,(a0)+ + bne.s .Cn +; Chargement! +; ~~~~~~~~~~~ + move.w #155,d0 + move.l Name1(a5),a0 + bsr Ed_AvName + moveq #1,d0 Revenir si pas assez grand + JJsr L_Prg_Load + bne.s .Nol + move.b #1,Prg_StModif(a6) Force le test + bsr Ed_AverFin + bsr Ed_NewBufAff +.Nol bsr Ed_AverFin + bsr.s .Free Liberation de la structure + bsr Ed_RAlert Si erreur dans le programme precedent + bra Ed_Loop +; Out of mem +; ~~~~~~~~~~ +.Out move.l #1024,d0 + JJsr L_Prg_ChgTTexte + bsr Edt_New + bsr .Free + bra Ed_OMm +; Libere la structure + reaffiche le buffer +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.Free lea Ed_Prg2ReLoad(a5),a0 + bsr Ed_MemFree + move.l a4,a0 + moveq #%10,d0 + bsr Ed_Splitted + rts + +; +; TROUVE L'ADRESSE DU PROGRAMME NAME1 +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +; In Name1 Nom ïż½ cherche +; Out Trouve BNE, A0=adresse +; Non BEQ +; +Edt_AccAdr + movem.l a2/d2,-(sp) + move.l Name1(a5),a0 + bsr Ed_DNom + move.l a0,d2 + move.l Edt_List(a5),d0 + beq.s .Out +.Loop0 move.l d0,a2 + move.l Edt_Prg(a2),a0 + lea Prg_NamePrg(a0),a0 + bsr Ed_DNom + move.l d2,a1 +.Loop1 move.b (a0)+,d0 + bsr MajD0ed + move.b d0,d1 + move.b (a1)+,d0 + bsr MajD0ed + cmp.b d0,d1 + bne.s .Next + or.b d1,d0 + bne.s .Loop1 + move.l a2,d0 + bra.s .Ok +.Next move.l Edt_Next(a2),d0 + bne.s .Loop0 +.Out moveq #0,d0 +.Ok move.l d0,a0 + movem.l (sp)+,a2/d2 + rts + + +; ___________________________________________________________________ +; +; RUN / TEST / INDENT +; ___________________________________________________________________ +; + +; +; RUN HIDDEN PROGRAM +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +; +Ed_RunHidden + bsr Ed_TokCur Ligne courante + bsr Ed_GetHidden Cherche le programme + beq Ed_NotDone + move.l Buffer(a5),a1 Pas de command line! + lea TBuffer-256-6(a1),a1 + clr.l (a1) +; Entree 2: run le programme A0 +Ed_RunHide + move.l a0,Edt_Runned(a5) Programme editeur runne + move.l Edt_Prg(a0),a6 Structure programme + bsr Ed_BlocFree Un peu de place + bsr Prg_RazUndos + bsr EdM_End + bsr EdM_Program + move.b #1,Ed_RunnedHidden(a5) Flag en cas de KILL EDITOR + lea Ed_ErrRunHidden(pc),a1 Retour de fin, sans ligne + lea Ed_TestMessage(pc),a2 Affichage tests + moveq #1,d0 Accessoire! + JJsr L_Prg_RunIt + clr.l Edt_Runned(a5) Si revient + beq Ed_OMm Out of memory + bra Ed_AlRunned Already runned + +; +; RUN EN MODE DIRECT +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_RunDirect + move.l Edt_Current(a5),a4 Prend le programme courant + move.l Edt_Prg(a4),a6 + bsr Ed_BlocFree Un peu de place + bsr Prg_RazUndos + bsr EdM_End + bsr EdM_Program + move.l Buffer(a5),a1 Pas de command line! + lea TBuffer-256-6(a1),a1 + clr.l (a1) + move.l a4,Edt_Runned(a5) Programme runnïż½ + lea Ed_DErrRun(pc),a1 Retour de fin normal + lea Ed_DTestMessage(pc),a2 Affichage tests + moveq #0,d0 Programme normal + JJsr L_Prg_RunIt + clr.l Edt_Runned(a5) Si revient! + bsr Esc_Hide + bsr Ed_Appear + bra Ed_OMm Out of mem si revient +Ed_DErrRun + tst.w Direct(a5) Si ESC plus la >>> Erreurs normales + beq Ed_ErrRun + bne Ed_ErrDirect +Ed_DTestMessage + rts 0 -> Rien + nop + rts 1 -> Rien + nop + bra Esc_Hide 2 -> Fermeture de l'ecran + +; +; RUN PROGRAMME COURANT +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_Run bsr Ed_TokCur Ligne courante + bsr Ed_BlocFree Un peu de place + bsr Prg_RazUndos + bsr EdM_End + bsr EdM_Program + move.l Buffer(a5),a1 Pas de command line! + lea TBuffer-256-6(a1),a1 + clr.l (a1) + move.l a4,Edt_Runned(a5) Programme runnïż½ + lea Ed_ErrRun(pc),a1 Retour de fin normal + lea Ed_TestMessage(pc),a2 Affichage tests + moveq #0,d0 Programme normal + JJsr L_Prg_RunIt + clr.l Edt_Runned(a5) Si revient! + bra Ed_OMm Out of mem si revient + +; RETOUR DE PROGRAMME HIDDEN SOUS EDITEUR +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_ErrRunHidden + move.l Edt_Runned(a5),a4 Prend le programme courant + move.l Edt_Prg(a4),a6 + clr.l Edt_Runned(a5) + clr.b Ed_RunnedHidden(a5) Enleve le flag +; Prend le message + bsr Ed_GetError + move.l a0,-(sp) + move.l d0,-(sp) +; Configuration modifiee? + tst.b EdC_Modified(a5) Tout modifie? + beq.s .Normal + bsr EdC_Redraw Ferme et ouvre! + bra.s .Suite +; Configuration non modifiee +.Normal tst.b Prg_Accessory(a5) Si accessoire + beq.s .Paac + bsr Ed_Redraw Redessin de l'editeur + bra.s .Suite +.Paac bsr Ed_OpenEditor ROuvre l'editeur + bsr Esc_Hide Inutile, mais bon + bsr Ed_Appear +; Efface le programme si necessaire +.Suite bsr Edt_ClearVar + tst.b Edt_PrgDelete(a4) + beq.s .No + bsr Edt_DelWindow + bsr EdM_BranchAMOS +; Affiche le message dans le programme courant +.No move.l Edt_Current(a5),a4 + move.l Edt_Prg(a4),a6 + JJsr L_Prg_SetBanks Change les banques + JJsr L_Bnk.Change Envoie aux trappes / Musiques + bsr Ed_SetBanks Retour aux banques editeur + move.l (sp)+,d0 + bmi.s .Aue + cmp.w #10,d0 END / EDIT + beq Ed_Loop + cmp.w #1000,d0 Retour simple ïż½ l'editeur + beq Ed_Loop + cmp.w #1002,d0 Retour au workbench + beq Ed_System +.Aue move.l (sp)+,a0 +; Fabrique le message Error in hidden + move.l a0,-(sp) + moveq #9,d0 + bsr Ed_GetMessage + move.l Ed_BufT(a5),a1 +.CopM1 move.b (a0)+,(a1)+ + bne.s .CopM1 + subq.l #1,a1 + move.l (sp)+,a0 +.CopM2 move.b (a0)+,(a1)+ + bne.s .CopM2 + move.b #".",-1(a1) + clr.b (a1) +; Imprime + move.l Ed_BufT(a5),a0 + move.w #200,d0 + bra Ed_Alert + +; RETOUR DE TEST SOUS EDITEUR +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_ErrTest + move.l Edt_Current(a5),a4 Pas d'effacement Edt_Runned! + move.l Edt_Prg(a4),a6 + bra.s Ed_Errr +; RETOUR DE PROGRAMME NORMAL SOUS EDITEUR +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_ErrRun + tst.b Ed_RunnedHidden(a5) + bne Ed_ErrRunHidden + move.l Edt_Runned(a5),a4 Prend le programme courant + move.l Edt_Prg(a4),a6 + clr.l Edt_Runned(a5) + tst.b Prg_Reloaded(a6) On a change le programme??? + beq.s Ed_Errr + clr.b Prg_Reloaded(a6) + move.w #-1,Edt_YBloc(a4) +Ed_Errr tst.l d0 Error TESTING + bmi Ed_ErrEdit + cmp.w #1000,d0 Edit + beq Ed_ErrEdit + cmp.w #1001,d0 Direct + beq Ed_ErrDirect + cmp.w #1002,d0 System + beq Ed_System + bsr Ed_Ligne Ligne de choix direct / edit + cmp.w #1,d1 + beq Ed_ErrDirect +; Retour ïż½ l'ïż½diteur +; ~~~~~~~~~~~~~~~~~~ +Ed_ErrEdit + bsr Ed_GetError + move.l a0,-(sp) + move.l d0,-(sp) +; Apparition de l'ïż½diteur + bsr Ed_OpenEditor ROuvre l'editeur + bsr Esc_Hide + bsr Ed_Appear +; Retour ïż½ l'editeur si END ou EDIT + move.l (sp)+,d0 Message de test? + bmi.s .Skip + cmp.w #10,d0 + beq Ed_Loop + cmp.w #1000,d0 + beq Ed_Loop +; Positionne le curseur sur l'erreur +.Skip move.l VerPos(a5),a0 + bsr Ed_FindA Cherche le numero / adresse + clr.l Prg_AdEProc(a6) + tst.l d1 + beq.s .Ski + move.l a0,Prg_AdEProc(a6) Si procedure fermee--> Stocke! + move.w d0,-(sp) + move.l d1,-(sp) + move.l Buffer(a5),a1 + move.l VerPos(a5),d0 + bsr Detok + move.w d0,Prg_XEProc(a6) + clr.l VerPos(a5) + move.l (sp)+,a0 + move.w (sp)+,d0 +.Ski bsr Ed_SetY Localise en Y + move.l Buffer(a5),a1 Offset de l'erreur + move.l VerPos(a5),d0 + bsr Detok + bsr Ed_SetX + bsr Ed_NewBufAff + move.l (sp)+,a0 Affiche le message + move.l Ed_BufT(a5),a1 Avec un "." a la fin + bsr EdCocop + move.b #".",-1(a1) + clr.b (a1) + move.l Ed_BufT(a5),a0 + move.w #200,d0 + bra Ed_Alert + +; Trouve le libelle de l'erreur en retour de programme +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_GetError + ext.l d0 + move.l d0,d2 + move.l a0,d1 + bne.s .Clair + cmp.w #256,d0 Un message? + bge.s .Clair + move.l Ed_TstMessages(a5),a0 Message testing + neg.w d0 + move.w d0,d2 + bpl.s .MTest + neg.w d0 + move.w d0,d2 + move.l Ed_RunMessages(a5),a0 + addq.w #1,d0 +.MTest bsr Ed_GetMessageA0 + move.l d2,d0 +.Clair rts + +; Ligne EDITOR <-> DIRECT +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_Ligne + movem.l a0/d0,-(sp) + bsr Ed_GetError + movem.l a0/d0,-(sp) +; Ouvre l'editeur + bsr Ed_OpenEditor +; Fabrique les chaines de caractere + move.l Ed_VDialogues(a5),a2 + move.l 4(sp),a0 Message d'erreur + bsr Ed_DChaine + move.l a1,(a2) + + move.l VerPos(a5),a0 + bsr Ed_FindA + addq.l #1,d0 + move.l d0,1*4(a2) Numero de la ligne + + move.l Buffer(a5),a1 + move.l VerPos(a5),d0 + bsr Detok + move.w d0,d3 + + move.l Buffer(a5),a3 + move.w (a3)+,d2 + clr.b 0(a3,d2.w) + moveq #60,d4 + add.w d3,d4 + clr.b 0(a3,d4.w) + sub.w #73,d4 + bpl.s .S1 + moveq #0,d4 +.S1 lea 0(a3,d3.w),a0 + bsr Ed_DChaine + move.l a1,3*4(a2) + clr.b 0(a3,d3.w) + lea 0(a3,d4.w),a0 + bsr Ed_DChaine + move.l a1,2*4(a2) + lea EdReCop(pc),a0 + move.l a0,4*4(a2) + +; Fait apparaitre l'ecran + moveq #0,d2 + EcCalD EHide,EcEdit + EcCalD First,EcEdit + move.w Ed_Wx(a5),d2 + move.w Es_Y1(a5),d3 + move.l #EntNul,d4 + moveq #56,d5 + EcCalD AView,EcEdit + moveq #0,d2 + moveq #0,d3 + EcCalD OffSet,EcEdit +; Fait apparaitre la souris + SyCalD Show,-1 + bsr Esc_MaxMouse +; Positionne la souris sur l'ecran + move.w Ed_Wx(a5),d1 + move.w Es_Y1(a5),d2 + addq.w #1,d1 + addq.w #1,d2 + SyCall SetM +; Va demarrer le dialogue + moveq #EdD_Ligne,d0 + bsr Ed_DoDialog + move.w d0,-(sp) +; Efface l'ecran + moveq #-1,d2 + EcCalD EHide,EcEdit + bsr EdReCop + move.w (sp)+,d1 +; Retourne a l'appelant + addq.l #8,sp + movem.l (sp)+,a0/d0 + rts + +; +; TEST +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +; +Ed_Test bsr Ed_TokCur + moveq #-1,d0 + bsr Ed_VaTester +; Message de warning si mix de constantes float + move.w #197,d0 ***-No Errors + move.b Ver_SPConst(a5),d1 + tst.b MathFlags(a5) + bmi.s .Test + move.b Ver_DPConst(a5),d1 +.Test tst.b d1 + beq Ed_Al100 + move.w #221,d0 ***-Precision mismatch + bra Ed_Al100 + +; +; CHECK 1.3 +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_Check1.3 + bsr Ed_TokCur + move.b #1,VerCheck1.3(a5) Force l'arret + move.b #1,Prg_StModif(a6) Force le test + bsr Ed_VaTester + moveq #49,d0 Compatible + tst.b VerNot1.3(a5) + beq.s .Go + moveq #48,d0 Too many banks +.Go move.l Ed_TstMessages(a5),a0 + bsr Ed_GetMessageA0 + moveq #127,d0 + bra Ed_Alert + +; +; INDENTATION AUTOMATIQUE +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_Indent + bsr Ed_TokCur + bsr Ed_VaTester + move.w Ed_Tabs(a5),d0 + move.l Prg_StBas(a6),a0 + bsr Indent + bsr Ed_NewBuf + rts + +; Indentation du programme +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +; A0: Debut programme +; D0: Valeur du Tab +Indent movem.l d2-d7,-(sp) + move.w d0,d3 + moveq #0,d6 +IndLine move.l a0,a1 * Adresse de debut de ligne + moveq #0,d4 + moveq #0,d7 + move.w d6,d5 + tst.w (a0)+ + beq IndX +IndLoop move.w (a0)+,d0 + beq IndFL + bsr TInst + cmp.w #_TkProc,d0 + beq.s IndPro + cmp.w #_TkEndP,d0 + beq.s IndProF + cmp.w #_TkFor,d0 + beq.s IndPls + cmp.w #_TkRpt,d0 + beq.s IndPls + cmp.w #_TkWhl,d0 + beq.s IndPls + cmp.w #_TkDo,d0 + beq.s IndPls + cmp.w #_TkIf,d0 + beq.s IndPls + cmp.w #_TkThen,d0 + beq.s IndThen + cmp.w #_TkElse,d0 + beq.s IndElse + cmp.w #_TkElsI,d0 + beq.s IndElse + cmp.w #_TkEndI,d0 + beq.s IndMns + cmp.w #_TkNxt,d0 + beq.s IndMns + cmp.w #_TkUnt,d0 + beq.s IndMns + cmp.w #_TkWnd,d0 + beq.s IndMns + cmp.w #_TkLoo,d0 + beq.s IndMns + bra.s IndLoop +* Debut d'une procedure: RAZ +IndPro: moveq #0,d5 + move.w d3,d6 + tst.b 10(a1) + bpl.s IndLoop + moveq #0,d6 + move.l 4(a1),d0 + lea 12+2(a1,d0.l),a0 + bra IndFL +* Fin d'une procedure +IndProF moveq #0,d5 + moveq #0,d6 + bra IndLoop +* Debut d'une boucle: + pour la ligne suivante +IndPls: addq.w #1,d7 + add.w d3,d6 + bra IndLoop +* Fin d'une boucle: - pour cette ligne et la suivante +IndMns: subq.w #1,d7 + bpl.s IndM + clr.w d7 + sub.w d3,d5 + sub.w d3,d6 + bra IndLoop +IndM: sub.w d3,d6 + bra IndLoop +* THEN: met le flag pour ELSE +IndThen:moveq #1,d4 + bra.s IndMns +* ELSE: si FLAG, ne fait RIEN +IndElse tst.w d4 + bne IndLoop + sub.w d3,d5 + bra IndLoop +* Fin d'une ligne: poke D5! +IndFL: tst.w d5 + bpl.s IndFl1 + clr.w d5 +IndFl1: cmp.w #127,d5 + bcs.s IndFl2 + moveq #127,d5 +IndFl2: addq.w #1,d5 + move.b d5,1(a1) + bra IndLine +* Fin de l'indentation automatique +IndX: movem.l (sp)+,d2-d7 + rts + +; +; Teste le programme s'il faut +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +; D0 Flag affichage ou non +; +Ed_VaTester + tst.b Prg_StModif(a6) Vraiment tester? + beq.s .Ok + move.b #1,Ed_YaUTest(a5) Un test! + lea Ed_ErrTest(pc),a1 En cas d'erreur + lea Ed_TestMessage(pc),a2 Affichage + JJsr L_Prg_TestIt Va tester + bne Ed_AlRunned Seule erreur possible +.Ok rts + + +Ed_TestMessage + bra Ed_Test1 + bra Ed_Test2 + bra Ed_Test3 +; Affiche le test si programme > 8K +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_Test1 + movem.l a0-a6/d0-d7,-(sp) + clr.b Ed_TstMesOn(a5) Plus de flag + move.l Prg_StHaut(a6),d0 + sub.l Prg_StBas(a6),d0 + cmp.l #1024*4,d0 + bcs.s .Non + addq.b #1,Ed_TstMesOn(a5) + move.w #198,d0 + bsr Ed_GetMessage + bsr Ed_Avertir + JJsr L_Prg_SetBanks +.Non movem.l (sp)+,a0-a6/d0-d7 +Ed_Rts rts +; Effacement du message +; ~~~~~~~~~~~~~~~~~~~~~ +Ed_Test2 + movem.l a0-a6/d0-d7,-(sp) + tst.b Ed_TstMesOn(a5) + beq.s .Non + clr.b Ed_TstMesOn(a5) + bsr Ed_AverFin + JJsr L_Prg_SetBanks +.Non movem.l (sp)+,a0-a6/d0-d7 + rts +; Effacement de l'editeur +; ~~~~~~~~~~~~~~~~~~~~~~~ +Ed_Test3 + bsr EdM_End + bra Ed_Hide + + +; ___________________________________________________________________ +; +; PROCEDURES +; ___________________________________________________________________ + +; +; OPEN / CLOSE ALL PROCEDURES +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_ProcsOpen + moveq #0,d2 + bra.s Ed_Procs +Ed_ProcsClose + moveq #-1,d2 +Ed_Procs + bsr Ed_TokCur + tst.w d2 + beq.s .Skip + moveq #-1,d0 + bsr Ed_VaTester +.Skip +; Sauve les marques +; ~~~~~~~~~~~~~~~~~ + bsr Ed_Marks2Adress +; Trouve la position actuelle du curseur +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + move.w Edt_YPos(a4),d0 + add.w Edt_YCu(a4),d0 + bsr Ed_FindL + move.l a0,d3 +; Boucle d'exploration du programme +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + clr.w d0 + bsr Ed_FindL + beq.s .EdFa3 +.EdFa1 cmp.w #_TkProc,2(a0) + bne.s .EdFa2 + btst #6,10(a0) + bne.s .EdFa2 + bclr #7,10(a0) + tst.w d2 + beq.s .EdFa2 + bset #7,10(a0) +.EdFa2 bsr Ed_NextL + bne.s .EdFa1 +; Reaffiche le programme +; ~~~~~~~~~~~~~~~~~~~~~~ +.EdFa3 JJsr L_Prg_CptLines +; Recalcule les marques +; ~~~~~~~~~~~~~~~~~~~~~ + bsr Ed_Marks2Number +; Recentre le curseur +; ~~~~~~~~~~~~~~~~~~~ + move.w Edt_YPos(a4),d0 + add.w Edt_YCu(a4),d0 + tst.l d3 + beq.s .EdFa4 + move.l d3,a0 + bsr Ed_FindA +.EdFa4 bsr Ed_SetY + bsr Ed_NewBuf + rts + +; +; INSERT MACHINE LANGAGE +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_ProcML + bsr Ed_TokCur +; Selecteur de fichier +; ~~~~~~~~~~~~~~~~~~~~ + move.w #178,d0 + bsr Ed_File_Selector + beq Ed_NotDone + JJsr L_Dsk.PathIt +; Trouve la ligne +; ~~~~~~~~~~~~~~~ +.Reloop move.w Edt_YPos(a4),d0 + add.w Edt_YCu(a4),d0 + bsr Ed_FindL + move.l Edt_DebProc(a4),d0 + beq Ed_FoE + move.l d0,a2 +; Va fermer la procedure, s'il faut +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + btst #7,10(a2) + bne.s .PaOu + bsr Ed_ProcOpen + bra.s .Reloop +.PaOu +; Trouve la longueur du fichier +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + move.l #1005,d2 + bsr Ed_Open + beq Ed_DError +; Saute les premiers HUNKS! + bsr .GetH + cmp.l #$3F3,d0 + bne .NoGood +.Plo0 bsr .GetH + cmp.l #$3E9,d0 + bne.s .Plo0 + bsr .GetH + lsl.l #2,d0 + move.l d0,d3 + add.l #512,d0 + JJsr L_ResTempBuffer + move.l a0,a3 + move.l a0,a1 +; Cree le faux programme +; ~~~~~~~~~~~~~~~~~~~~~~ + move.l a2,a0 + moveq #0,d0 Copie PROCEDURE + move.b (a0),d0 + lsl.w #1,d0 + subq.w #1,d0 +.Cp1 move.b (a0)+,(a1)+ + dbra d0,.Cp1 + or.w #%0101000000000000,10(a3) Procedure machine langage + move.w #$0301,(a1)+ + move.w #_TkML,(a1)+ + lea 10+6(a3),a0 Pointe les parametres + moveq #0,d0 + move.b (a0),d0 + lea 2+2(a0,d0.w),a0 + move.l a0,d0 + sub.l a1,d0 + cmp.w #_TkBra1,-2(a0) + beq.s .Par + moveq #0,d0 +.Par move.w d0,(a1)+ +; Charge le langage machine dans le buffer +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + move.l a1,d2 + bsr Ed_Read + bne Ed_DError + bsr Ed_Close +; Met le ENDPROC +; ~~~~~~~~~~~~~~ + move.l d2,a1 + add.l d3,a1 + move.w #$0301,(a1)+ + move.w #_TkEndP,(a1)+ + clr.w (a1)+ + move.l a1,d0 + sub.l a3,d0 + sub.l #14,d0 + move.l d0,4(a3) + move.l a1,d3 + sub.l a3,d3 D3= Longueur totale +; Efface l'ancienne procïż½dure +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~ + move.w Edt_YCu(a4),d0 + add.w Edt_YPos(a4),d0 + bsr Ed_FindL + move.l a0,-(sp) + bsr Ed_NextL + move.l a0,a1 + move.l (sp)+,a0 + bsr Ed_StDelChunk +; Insere la nouvelle procedure +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + move.l a3,a0 + move.l d3,d0 + move.w Edt_YCu(a4),d1 + add.w Edt_YPos(a4),d1 + bsr Ed_StoBlock +; Voili Voila +; ~~~~~~~~~~~ + moveq #0,d0 + JJsr L_ResTempBuffer + JJsr L_Prg_CptLines + bsr Ed_AverFin + rts +; Routinette +; ~~~~~~~~~~ +.GetH move.l Buffer(a5),d2 + moveq #4,d3 + bsr Ed_Read + bne Ed_DError + move.l Buffer(a5),a0 + move.l (a0),d0 + rts +; Pas un bon programme! +; ~~~~~~~~~~~~~~~~~~~~~ +.NoGood move.w #182,d0 + bsr Ed_GetMessage + move.w #250,d0 + bra Ed_Alert + +; +; OPEN / CLOSE PROCEDURE +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_ProcOpen + bsr Ed_TokCur +; Trouve la ligne +; ~~~~~~~~~~~~~~~ + move.w Edt_YPos(a4),d0 + add.w Edt_YCu(a4),d0 + bsr Ed_FindL + move.l Edt_DebProc(a4),d0 + beq Ed_FoE +; Peut-on ouvrir? +; ~~~~~~~~~~~~~~~ + move.l d0,a2 + btst #6,10(a2) + bne.s .Out +; Ouverture ou fermeture? +; ~~~~~~~~~~~~~~~~~~~~~~~ + btst #7,10(a2) + bne.s .PaOu + move.l a2,-(sp) Si fermeture, on teste + moveq #-1,d0 + bsr Ed_VaTester + move.l (sp)+,a2 +.PaOu +; Sauve les marques +; ~~~~~~~~~~~~~~~~~ + bsr Ed_Marks2Adress +; Change la procedure +; ~~~~~~~~~~~~~~~~~~~ + bchg #7,10(a2) +; Recalcule les marques +; ~~~~~~~~~~~~~~~~~~~~~ + bsr Ed_Marks2Number +; Recentre (autour de l'erreur s'il faut)! +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + JJsr L_Prg_CptLines + move.l a2,a0 + tst.w 10(a0) + bmi.s .Skip + tst.l Prg_AdEProc(a6) + beq.s .Out + bsr Ed_RAlert + move.w Prg_XEProc(a6),d0 + bsr Ed_SetX + move.l Prg_AdEProc(a6),d0 + bclr #31,d0 + move.l d0,a0 +.Skip bsr Ed_FindA + bsr Ed_SetY +.Out bsr Ed_NewBuf + rts + +; +; Arret de l'auto-centrage en cas d'erreur +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_ClEProc + tst.l Prg_AdEProc(a6) + beq.s .Out + bmi.s .Skip + bset #7,Prg_AdEProc(a6) + rts +.Skip clr.l Prg_AdEProc(a6) +.Out rts + +;_____________________________________________________________________________ +; +; Mode Escape +;_____________________________________________________________________________ +; + +Ed_Escape + moveq #"E",d0 Va faire du bruit! + bsr Ed_SamPlay + bsr Ed_TokCur + bsr Ed_Hide + bsr Esc_Appear + +; _________________________________________ +; +; Boucle du mode escape +; _________________________________________ +; +Esc_Loop + move.l BasSp(a5),sp + move.w #1,T_AMOState(a5) Editor present! + lea Ed_ErrDirect(pc),a0 Jump si error + move.l a0,Prg_JError(a5) +; move.l Edt_Current(a5),a4 Change les banques >>> programme! +; move.l Edt_Prg(a4),a6 +; JJsr L_Prg_SetBanks + +; Affiche les sliders de mïż½moire +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + EcCalD Active,EcFonc + bsr Ed_MemoryAff + + EcCalD Active,EcEdit + +; Met le curseur + moveq #14,d0 + bsr Ed_GetSysteme + move.l a0,a1 + WiCall Print +; Initialise l'editeur ligne + lea Es_LEd(a5),a0 + move.l Buffer(a5),a1 + move.l a1,a2 + clr.b (a1) + move.w #(1< retour editeur + beq Esc_Esc + subq.w #1,d1 1 > Workbench + bne.s .Pa2 + bsr Ed_Wb + bra Esc_F +.Pa2 subq.w #1,d1 2 > Out + bne.s .Pa3 + move.b Bt_Pos+1(a0),Esc_Output(a5) + bra Esc_F +.Pa3 subq.w #1,d1 3 > Fonctions + btst #1,d0 > Bouton droit, fonction 10-20 + beq Esc_BtFonc + add.w #10,d1 + bra Esc_BtFonc +; +; Click souris +; ~~~~~~~~~~~~ +Esc_MKey + SyCall GetZone + cmp.w #EcFonc,d1 + beq.s Esc_MBoutons + cmp.w #EcEdit,d1 + beq.s Esc_MEcran + bra Esc_F +; Dans l'ïż½cran du haut +; ~~~~~~~~~~~~~~~~~~~~ +Esc_MBoutons + lea Ed_Boutons(a5),a0 + JJsrR L_Bt_Gere,a1 + bne Esc_Bouton + bra.s Esc_MMove +; Dans l'ïż½cran +; ~~~~~~~~~~~~ +Esc_MEcran + swap d1 + cmp.w #1,d1 + beq.s Esc_MMove +; Change la taille + SyCall XyMou + sub.w Es_Y2(a5),d2 + move.w d2,-(sp) +.SLoop SyCall XyMou + sub.w (sp),d2 + move.w Es_Y1(a5),d0 + move.w d0,d1 + add.w #Es_MiniSy,d0 + add.w Ed_Sy(a5),d1 + cmp.w d0,d2 + bge.s .SOk1 + move.w d0,d2 +.SOk1 cmp.w d1,d2 + ble.s .SOk2 + move.w d1,d2 +.SOk2 cmp.w Es_Y2(a5),d2 + beq.s .SSkip + move.w d2,Es_Y2(a5) + bsr Es_Display + bsr EdReCop +.SSkip SyCall MouseKey + btst #0,d1 + bne.s .SLoop + tst.w (sp)+ + bra Esc_F +; Change la position +Esc_MMove + SyCall XyMou + sub.w Es_Y1(a5),d2 + move.w d2,-(sp) +.MLoop SyCall XyMou + sub.w (sp),d2 + cmp.w Es_Y1(a5),d2 + beq.s .MSkip + move.w Es_Y2(a5),d0 + sub.w Es_Y1(a5),d0 + move.w d2,Es_Y1(a5) + add.w d0,d2 + move.w d2,Es_Y2(a5) + bsr Es_Display + bsr EdReCop +.MSkip SyCall MouseKey + btst #0,d1 + bne.s .MLoop + tst.w (sp)+ + bra Esc_F +; +; Fleche vers le HAUT +; ~~~~~~~~~~~~~~~~~~~ +Esc_H move.b d0,d1 + and.b #Ctr,d1 + bne.s Esc_HH + and.b #Shf,d0 + bne.s Esc_BH +; Recupere une touche AVANT +; ~~~~~~~~~~~~~~~~~~~~~~~~~ + lea Esc_KMem(a5),a0 + move.l Esc_KMemPos(a5),d0 + beq.s .Sk1 + move.l d0,a0 +.Sk1 move.l (a0),d0 + beq Esc_F + move.l d0,a0 + bra Esc_Recall +; Monte toute la fenetre +; ~~~~~~~~~~~~~~~~~~~~~~ +Esc_HH tst.w Es_Y2(a5) + bmi Esc_F + subq.w #8,Es_Y1(a5) + subq.w #8,Es_Y2(a5) + bra Esc_Aff +; Monte la ligne du bas +; ~~~~~~~~~~~~~~~~~~~~~ +Esc_BH move.w Es_Y1(a5),d0 + add.w #Es_MiniSy,d0 + subq.w #8,Es_Y2(a5) + cmp.w Es_Y2(a5),d0 + ble Esc_Aff + move.w d0,Es_Y2(a5) + bra Esc_Aff +; +; Fleche vers le BAS +; ~~~~~~~~~~~~~~~~~~ +Esc_B move.b d0,d1 + and.b #Ctr,d1 + bne.s Esc_HB + and.b #Shf,d0 + bne.s Esc_BB +; Recupere une touche APRES +; ~~~~~~~~~~~~~~~~~~~~~~~~~ + move.l Esc_KMemPos(a5),d0 + beq Esc_F + move.l Esc_KMem(a5),d1 + beq Esc_F + cmp.l d0,d1 + beq.s .Spec +.Loop move.l d1,a0 + move.l (a0),d1 + beq Esc_F + cmp.l d1,d0 + bne.s .Loop + bra Esc_Recall +.Spec clr.l Esc_KMemPos(a5) + move.l Buffer(a5),a1 + clr.w (a1) + bra Esc_Recall2 + +; Descend toute la fenetre +; ~~~~~~~~~~~~~~~~~~~~~~~~ +Esc_HB move.w Es_Y1(a5),d0 + cmp.w #312,d0 + bge Esc_F + addq.w #8,Es_Y1(a5) + addq.w #8,Es_Y2(a5) + bra Esc_Aff +; Descend la ligne du bas +; ~~~~~~~~~~~~~~~~~~~~~~~ +Esc_BB move.w Es_Y1(a5),d0 + add.w Ed_Sy(a5),d0 + addq.w #8,Es_Y2(a5) + cmp.w Es_Y2(a5),d0 + bge Esc_Aff + move.w d0,Es_Y2(a5) + bra Esc_Aff +; +; ESCAPE ---> Retour a l'editeur +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Esc_Esc + moveq #"E",d0 Va faire du bruit! + bsr Ed_SamPlay + bsr Esc_Hide + clr.w Edt_EtMess(a4) + bsr Ed_Appear + bra Ed_Loop +; +; HELP ---> recentre la souris dans l'ecran +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Esc_Help + SyCalD Show,-1 + bsr Esc_MaxMouse + move.w Ed_Wx(a5),d1 + move.w Es_Y1(a5),d2 + add.w #16,d2 + SyCall SetM + bra Esc_Aff +; +; Touches de fonction 1-10 +; ~~~~~~~~~~~~~~~~~~~~~~~~ +Esc_Fonc + and.b #Shf,d0 + beq.s .NoShf + add.w #10,d1 +.NoShf and.w #$00FF,d1 + sub.w #$0050,d1 +Esc_BtFonc + moveq #24,d0 + add.w d1,d0 + bsr Ed_GetSysteme + move.l Buffer(a5),a1 +.Test move.b (a0)+,d2 + move.b d2,(a1)+ + beq.s .NoRet + cmp.b #"`",d2 + bne.s .Test + clr.b -(a1) +.NoRet lea Es_LEd(a5),a0 + move.l Buffer(a5),a1 + moveq #-1,d0 + JJsrP L_LEd_New,a2 + tst.b d2 + beq Esc_F + bra Esc_R +; +; Rappel d'une sequence memorisee +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Esc_Recall + move.l a0,Esc_KMemPos(a5) + lea 6(a0),a1 +Esc_Recall2 + lea Es_LEd(a5),a0 + moveq #-1,d0 + JJsrP L_LEd_New,a2 + bra Esc_F +; +; Return en mode ESCAPE +; ~~~~~~~~~~~~~~~~~~~~~ +Esc_R move.l Buffer(a5),a2 + tst.b (a2) + beq Esc_Loop + move.w Esc_KMemMax(a5),d0 + bsr Esc_KMemEffD0 + move.l a2,a0 +.Count tst.b (a0)+ + bne.s .Count + sub.l a2,a0 + move.l a0,d2 + addq.l #6,d2 +; Met dans la liste + lea Esc_KMem(a5),a0 + move.l d2,d0 + SyCall MemFastClear + beq .Egal + move.l Esc_KMem(a5),(a0) + move.l a0,Esc_KMem(a5) + clr.l Esc_KMemPos(a5) + addq.l #4,a0 + move.w d2,(a0)+ +.Copy move.b (a2)+,(a0)+ + bne.s .Copy +; Retour chariot +.Egal lea CRet(pc),a1 + WiCall Print + move.w Ed_Sx(a5),d0 + lsr.w #3,d0 + sub.w #9,d0 + cmp.w d0,d2 + bls.s .SkipR + lea CRet(pc),a1 + WiCall Print +.SkipR +; Tokenise la ligne +; ~~~~~~~~~~~~~~~~~ + move.l Buffer(a5),a0 + move.l Ed_BufT(a5),a1 + bsr Tokenise + beq Esc_Loop +; Appelle l'interpreteur +; ~~~~~~~~~~~~~~~~~~~~~~ + move.l Edt_Current(a5),a4 Change les banques + move.l Edt_Prg(a4),a6 + JJsr L_Prg_SetBanks + clr.l Edt_Runned(a5) Securites! + clr.l Prg_Runned(a5) + lea Ed_ErrDirect(pc),a0 Jump si error + move.l a0,Prg_JError(a5) + JJsr L_VerDirect +; move.w VarLong(a5),d0 Verification longueur vars. +; cmp.w TVMax(a5),d0 +; bcc VerVTo + move.w ScOn(a5),d1 Branche l'ecran + beq.s .Pa + subq.w #1,d1 + EcCall Active +.Pa JJmp L_New_ChrGet Branche au chrget + +; +; Efface le dernier si >D0 +; ~~~~~~~~~~~~~~~~~~~~~~~~ +Esc_KMemEffD0 + movem.l d2/d3,-(sp) + moveq #0,d2 + sub.l a1,a1 + move.l Esc_KMem(a5),d1 + beq.s .Out +.Loop move.l a1,d3 + move.l d1,a1 + addq.w #1,d2 + move.l (a1),d1 + bne.s .Loop +.Exit cmp.w d0,d2 + bcs.s .Out + tst.l d3 + beq.s .Skip + move.l d3,a0 + clr.l (a0) + bra.s .Eff +.Skip clr.l Esc_KMem(a5) +.Eff move.l a0,-(sp) + moveq #0,d0 + move.w 4(a1),d0 + SyCall MemFree + move.l (sp)+,a0 +.Out movem.l (sp)+,d2/d3 + rts +; +; Efface tous les KMEM +; ~~~~~~~~~~~~~~~~~~~~ +Esc_KMemEnd + bra.s .In +.Loop moveq #0,d0 + bsr Esc_KMemEffD0 +.In tst.l Esc_KMem(a5) + bne.s .Loop + rts +; +; Retourne la position du bouton OUTPUT +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Esc_BtGetOutput + move.b Esc_Output(a5),Bt_Pos+1(a2) + rts + +; +; +; Entree des erreurs en mode direct +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_ErrDirect + move.l Edt_Current(a5),a4 + move.l Edt_Prg(a4),a6 + bsr Ed_GetError Va chercher le message + movem.l a0/d0,-(sp) + bsr Ed_OpenEditor + clr.l Edt_Runned(a5) Plus de programme! + or.b #%00010001,ActuMask(a5) + EcCalD CopOnOff,-1 + EcCalD First,EcEdit + EcCalD First,EcFonc + EcCalD Active,EcEdit + bsr EdReCop + bsr Ed_Hide + bsr Esc_Appear + movem.l (sp)+,a1/d1 + cmp.w #1002,d1 + beq Ed_System + cmp.w #1000,d1 + beq Esc_Esc + cmp.w #1000,d1 + bcc Esc_Loop + cmp.w #10,d1 + beq Esc_Loop + WiCall Print + bra Esc_Loop + + +; ___________________________________________________________________ +; +; ECRAN ESCAPE +; ___________________________________________________________________ +; + +; Apparition de l'ecran +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Esc_Appear + movem.l a2-a4/a6/d2-d7,-(sp) +; Flag! +; ~~~~~ + tst.w Direct(a5) + bne .Out + move.w #1,Direct(a5) + move.w Ed_Sx(a5),d7 + +; Active l'ïż½cran de titre +; ~~~~~~~~~~~~~~~~~~~~~~~ + EcCalD Active,EcFonc + EcCalD First,EcEdit +; Unpack le logo AMOS +; ~~~~~~~~~~~~~~~~~~~ + moveq #Es_Pics,d0 + moveq #Es_BoutonsSx,d1 + moveq #Es_BoutonsY,d2 + bsr Es_Unpack + sub.w #Es_TitleSx,d7 +; +; Cree les 13 boutons +; ~~~~~~~~~~~~~~~~~~~ + lea Ed_Boutons(a5),a2 + move.w #Es_BoutonsX,d2 + moveq #Es_BoutonsY,d3 + moveq #Es_BoutonsPics,d4 + move.w #Es_BoutonsZones,d5 + moveq #1,d6 +.Loop move.w d6,Bt_Number(a2) + cmp.w #1,d6 + bne.s .Pa1 + clr.w Bt_X(a2) Bouton DIRECT + bra.s .PaB +.Pa1 cmp.w #2,d6 + bne.s .Pa2 + move.w Ed_Sx(a5),Bt_X(a2) Bouton WB + sub.w #Ed_BoutonsSx,Bt_X(a2) + bra.s .PaB +.Pa2 move.w d2,Bt_X(a2) + add.w #Ed_BoutonsSx,d2 +.PaB move.w d3,Bt_Y(a2) + move.w d4,Bt_Image(a2) + move.w d5,Bt_Zone(a2) + lea Bt_RoutIn(pc),a0 + move.l a0,Bt_Routines(a2) + move.b #4,Bt_RDraw(a2) + clr.b Bt_RPos(a2) + clr.b Bt_RChange(a2) + clr.b Bt_Flags(a2) + clr.w Bt_Pos(a2) + move.b #Es_BoutonsSx,Bt_Sx(a2) + move.b #Es_BoutonsSy,Bt_Sy(a2) + addq.w #2,d4 + addq.w #1,d5 + sub.w #Es_BoutonsSx,d7 + lea Bt_Long(a2),a2 + addq.w #1,d6 + cmp.w #13,d6 + bls.s .Loop + clr.w (a2) + +; Dessine les sliders de memoire +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + move.w d2,d1 + moveq #Es_BoutonsY,d2 + move.w d7,d3 + lea Es_Unpack(pc),a2 + bsr Ed_MemoryDraw + bsr Ed_MemoryAff + +; Position du bouton "OUT" +; ~~~~~~~~~~~~~~~~~~~~~~~~ + move.b #5,Ed_Boutons+Bt_Long*2+Bt_RPos(a5) + bset #Bt_FlagOnOf,Ed_Boutons+Bt_Long*2+Bt_Flags(a5) +; Init des boutons +; ~~~~~~~~~~~~~~~~ + lea Ed_Boutons(a5),a0 + moveq #1,d0 + JJsrR L_Bt_InitList,a1 +; Reserve la zone de fond +; ~~~~~~~~~~~~~~~~~~~~~~~ + moveq #0,d2 + moveq #0,d3 + move.w Ed_Sx(a5),d4 + moveq #Es_TitleSy,d5 + SyCalD SetZone,14 + +; Active l'ïż½cran de texte +; ~~~~~~~~~~~~~~~~~~~~~~~ + EcCalD Active,EcEdit +; Dessine le bord droit +; ~~~~~~~~~~~~~~~~~~~~~ + move.w Ed_Ty(a5),d6 + addq.w #1,d6 + moveq #0,d7 +.Loopa moveq #Es_Pics+1,d0 + move.w Ed_Sx(a5),d1 + sub.w #16,d1 + ext.l d1 + move.w d7,d2 + moveq #-1,d3 + bsr Ed_Unpack + addq.w #8,d7 + subq.w #1,d6 + bne.s .Loopa +; Dessine le bas +; ~~~~~~~~~~~~~~ + moveq #Es_Pics+2,d0 + moveq #0,d1 + move.w d7,d2 + moveq #-1,d3 + bsr Ed_Unpack + move.w d7,d0 + addq.w #8,d7 + move.w d7,d1 + bsr Ed_Enlarge +; Ouvre la fenetre +; ~~~~~~~~~~~~~~~~ + moveq #1,d1 + moveq #0,d2 + moveq #0,d3 + move.w Ed_Sx(a5),d4 + lsr.w #3,d4 + subq.w #2,d4 + move.w Ed_Ty(a5),d5 + addq.w #1,d5 + moveq #0,d6 + moveq #0,d7 + sub.l a1,a1 + WiCall WindOp + moveq #16,d0 + bsr Ed_GetSysteme + move.l a0,a1 + WiCall Print +; Defini les zones +; ~~~~~~~~~~~~~~~~ + SyCalD RazZone,0 + moveq #0,d2 + moveq #0,d3 + move.w Ed_Sx(a5),d4 + move.w Ed_Sy(a5),d5 + SyCalD SetZone,2 + sub.w #16,d4 + subq.w #8,d5 + SyCalD SetZone,1 +; Descend l'ïż½cran du bas +; ~~~~~~~~~~~~~~~~~~~~~~ + move.w Es_Y1(a5),d0 + move.w d0,d1 + add.w #Es_MiniSy,d1 +.Loop1 move.w d1,d2 + add.w Ed_VScrol(a5),d1 + cmp.w Es_Y2(a5),d1 + ble.s .Skip1 + move.w Es_Y2(a5),d1 +.Skip1 movem.w d0-d2,-(sp) + bsr Es_DisplayD0 + bsr EdReCop + movem.w (sp)+,d0-d2 + cmp.w d1,d2 + bne.s .Loop1 + bsr Esc_MaxMouse +.Out movem.l (sp)+,a2-a4/a6/d2-d7 + rts +; Elargi les limites de la souris +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Esc_MaxMouse + moveq #128-16,d1 + moveq #35,d2 + move.l #500,d3 + move.l #312,d4 + SyCall LimitM + rts + +; +; Disparition de l'ïż½cran de mode direct +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Esc_Hide + movem.l a0-a4/a6/d0-d7,-(sp) + tst.w Direct(a5) + beq .Out + clr.w Direct(a5) +; Remonte l'ïż½cran du bas +; ~~~~~~~~~~~~~~~~~~~~~~ + move.w Es_Y1(a5),d0 + move.w Es_Y2(a5),d1 +.Loop1 move.w d1,d2 + sub.w Ed_VScrol(a5),d1 + move.w d0,d3 + add.w #Es_MiniSy,d3 + cmp.w d3,d1 + bge.s .Skip1 + move.w d3,d1 +.Skip1 movem.w d0-d2,-(sp) + bsr Es_DisplayD0 + bsr EdReCop + movem.w (sp)+,d0-d2 + cmp.w d1,d2 + bne.s .Loop1 + move.l T_EcAdr+EcEdit*4(a5),a0 + bset #BitHide,EcFlags(a0) +; Efface l'ïż½cran du haut +; ~~~~~~~~~~~~~~~~~~~~~~ + move.l T_EcAdr+EcFonc*4(a5),a0 + bset #BitHide,EcFlags(a0) + bsr EdReCop +; Efface la fenetre de fond +; ~~~~~~~~~~~~~~~~~~~~~~~~~ + EcCalD Active,EcEdit + WiCall WinDel +; Efface les zones +; ~~~~~~~~~~~~~~~~ + SyCalD RazZone,0 +.Out movem.l (sp)+,a0-a4/a6/d0-d7 + rts + +; +; Positionne les ecrans du mode escape +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Es_Display + move.w Es_Y1(a5),d0 + move.w Es_Y2(a5),d1 +Es_DisplayD0 + move.l T_EcAdr+EcFonc*4(a5),a0 + move.l T_EcAdr+EcEdit*4(a5),a1 +; Ecran du haut + move.w d0,EcAWY(a0) + bset #2,EcAW(a0) + add.w #Es_TitleSy,d0 +; Ecran du bas + move.w d0,EcAWY(a1) Position + bset #2,EcAW(a1) + sub.w d0,d1 Hauteur + move.w d1,EcAWTY(a1) + bset #2,EcAWT(a1) + move.w Ed_Sy(a5),d0 Dïż½but de la fenetre + sub.w d1,d0 + move.w d0,EcAVY(a1) + bset #2,EcAV(a1) +; Fait apparaitre les ïż½crans + bclr #BitHide,EcFlags(a0) + bclr #BitHide,EcFlags(a1) +; Ecran de l'ïż½diteur en premier + EcCalD First,EcFonc + EcCalD First,EcEdit + rts +; +; Cache l'ïż½cran de l'ïż½diteur +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_Hide + movem.l a0-a4/a6/d0-d7,-(sp) + tst.w EsFlag(a5) + bne .Out + move.w #-1,EsFlag(a5) +; Plus d'avertissements +; ~~~~~~~~~~~~~~~~~~~~~ + bsr Ed_AllAverFin +; Fait disparaitre lentement +; ~~~~~~~~~~~~~~~~~~~~~~~~~~ + move.l T_EcAdr+EcEdit*4(a5),a2 + move.w Ed_VScrol(a5),d7 + neg.w d7 + move.w EcTy(a2),d6 + lsr.w #1,d6 + move.w Ed_Wy(a5),d5 + add.w d6,d5 + JJsr L_AppCentre + bset #BitHide,EcFlags(a2) + bsr EdReCop +; Efface les dïż½finitions de l'ïż½diteur +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + EcCalD Active,EcEdit + bsr Edt_EffWindows +; Met la couleur du fond +; ~~~~~~~~~~~~~~~~~~~~~~ + move.w ColBack(a5),d1 + EcCall SColB +; Remet les rainbows +; ~~~~~~~~~~~~~~~~~~ + EcCalD RainHide,0 +; Remet les limites souris +; ~~~~~~~~~~~~~~~~~~~~~~~~ + lea LimSave(a5),a0 + lea T_MouXMin(a5),a1 + move.l (a0)+,(a1)+ + move.l (a0)+,(a1)+ +; Remet tous les sprites +; ~~~~~~~~~~~~~~~~~~~~~~ + SyCall RecallM + SyCall ReActHs + SyCall AMALUFrz + SyCall WaitVbl + SyCall ActHs + SyCall AffHs +; Initialise les touches de fonction AMIGA illegal--> en verif! +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +; moveq #0,d1 +; Alea AmiDef,a1 +;.Ami SyCall SetFunk +; move.l a0,a1 +; addq.w #1,d1 +; cmp.w #20,d1 +; bcs.s .Ami +; Nettoie les touches / Demarre AMAL +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.Out SyCall ClearKey + SyCall AMALUFrz +; Menus >>> Program +; ~~~~~~~~~~~~~~~~~ + bsr EdM_Program + movem.l (sp)+,a0-a4/a6/d0-d7 + rts + +; +; Apparition de l'ïż½cran l'ïż½diteur +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_Appear + movem.l a2-a4/a6/d2-d7,-(sp) + tst.w EsFlag(a5) + beq .Out + clr.w EsFlag(a5) +; Enleve les touches de fonction AMIGA +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + moveq #0,d1 +.Ami move.l Buffer(a5),a1 + clr.b (a1) + SyCall SetFunk + addq.w #1,d1 + cmp.w #20,d1 + bcs.s .Ami +; Enleve tous les sprites +; ~~~~~~~~~~~~~~~~~~~~~~~ + SyCall AMALFrz + SyCall StActHs + SyCall StoreM +; Enleve les rainbows +; ~~~~~~~~~~~~~~~~~~~ + EcCalD RainHide,-1 +; Remet le fond! +; ~~~~~~~~~~~~~~ + move.w Ed_ColB(a5),d1 + EcCall SColB +; Dessine le fond +; ~~~~~~~~~~~~~~~ + EcCalD Active,EcEdit + bsr Ed_DrawTop + move.l Edt_Current(a5),a4 + move.l Edt_Prg(a4),a6 + bsr Ed_DrawWindows +; Apparition de l'ïż½cran +; ~~~~~~~~~~~~~~~~~~~~~ + moveq #0,d2 + EcCalD EHide,EcEdit + EcCalD First,EcEdit + move.l T_EcAdr+EcEdit*4(a5),a0 + move.w Ed_Wy(a5),EcAWY(a0) + bset #2,EcAW(a0) +; Fait apparaitre lentement +; ~~~~~~~~~~~~~~~~~~~~~~~~~ + move.l T_EcAdr+EcEdit*4(a5),a2 + move.w Ed_VScrol(a5),d7 + move.w #1,d6 + move.w Ed_Wy(a5),d5 + move.w Ed_Sy(a5),d0 + lsr.w #1,d0 + add.w d0,d5 + JJsr L_AppCentre +; Limite de la souris +; ~~~~~~~~~~~~~~~~~~~ + lea T_MouXMin(a5),a0 + lea LimSave(a5),a1 + move.l (a0)+,(a1)+ + move.l (a0)+,(a1)+ + bsr Ed_LimM +; Affiche le tout! +; ~~~~~~~~~~~~~~~~ + bclr #BitControl-8,T_Actualise(a5) + bsr EdM_Editor +; Flag si peu de memoire... +; ~~~~~~~~~~~~~~~~~~~~~~~~~ + move.b #2,Ed_NewAppear(a5) +; Plus de touches +; ~~~~~~~~~~~~~~~ +.Out SyCall ClearKey + movem.l (sp)+,a2-a4/a6/d2-d7 + rts +; Redessine le fond, lors de retour d'accessoire +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_Redraw + movem.l a2-a6/d2-d7,-(sp) + EcCalD Active,EcEdit +; bsr Ed_DrawTop Voir si redessin! +; move.l Edt_Current(a5),a4 +; move.l Edt_Prg(a4),a6 +; bsr Ed_DrawWindows + EcCalD First,EcEdit + bsr EdReCop + bsr Ed_LimM + movem.l (sp)+,a2-a6/d2-d7 + rts +; Routine, limite la souris +Ed_LimM moveq #EcEdit+1,d3 + move.w Ed_Sx(a5),d1 + subq.w #4,d1 + move.w Ed_Sy(a5),d2 + subq.w #1,d2 + SyCall XyHard + movem.w d1/d2,-(sp) + moveq #EcEdit+1,d3 + moveq #2,d1 + moveq #2,d2 + SyCall XyHard + movem.w (sp)+,d3/d4 + SyCall LimitM + SyCalD Show,-1 + rts + +;_____________________________________________________________________________ +; +; Messages editeur +;_____________________________________________________________________________ +; +; Line not editable +; ~~~~~~~~~~~~~~~~~ +Ed_NotEdit + move.w #183,d0 + bsr Ed_GetMessage + moveq #100,d0 + bra Ed_Alert +; +; Line too long +; ~~~~~~~~~~~~~ +Ed_LToLong + move.w #199,d0 ***- Line too long + bsr Ed_GetMessage + moveq #50,d0 + bra Ed_Alert +; +; Top of text +; ~~~~~~~~~~~ +Ed_CHtE + move.w #200,d0 ***- Top of text + bsr Ed_GetMessage + moveq #25,d0 + bra Ed_Alert +; +; Bottom of text +; ~~~~~~~~~~~~~~ +Ed_CBasE + move.w #201,d0 ***- Bottom of text + bsr Ed_GetMessage + moveq #25,d0 + bra Ed_Alert +; +; Mark not set +; ~~~~~~~~~~~~ +Ed_NoMark + moveq #65,d0 + bra Ed_Al100 +; +; Out of mem tokenisation +; ~~~~~~~~~~~~~~~~~~~~~~~ +Ed_OofBuf + bsr Ed_NewBuf Reaffiche la ligne! + move.w #202,d0 ***- Out of buffer space + bsr Ed_GetMessage + move.w #200,d0 + bra Ed_Alert +; +; Can't fold procedure +; ~~~~~~~~~~~~~~~~~~~~ +Ed_FoE move.w #203,d0 ***- Not a procedure +Ed_Al100 + bsr Ed_GetMessage + moveq #100,d0 + bra Ed_Alert + +; Out of memory / alert +; ~~~~~~~~~~~~~~~~~~~~~ +Ed_OMm move.w #204,d0 ***- Out of memory + bsr Ed_GetMessage + moveq #120,d0 + bra Ed_Alert +; +; Not found +; ~~~~~~~~~ +Ed_NoFound + bsr Ed_NewBuf + move.w #205,d0 ***- Not found + bsr Ed_GetMessage + moveq #100,d0 + bra Ed_Alert +; +; NOT DONE +; ~~~~~~~~ +Ed_NotDone + bsr Ed_NewBuf +Ed_NotDone2 + move.w #206,d0 ***- Not done + bsr Ed_GetMessage + moveq #100,d0 + bra Ed_Alert + +; +; Not an AMOS Program +; ~~~~~~~~~~~~~~~~~~~ +Ed_PaAMOS + bsr Ed_Close + move.w #207,d0 ***- Not an amos program + bsr Ed_GetMessage + moveq #100,d0 + bra Ed_Alert +; +; Pas de place pour le programme +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_PaPlace + bsr Ed_Close + move.w #208,d0 ***- Buffer too small + bsr Ed_GetMessage + moveq #100,d0 + bra Ed_Alert + +; What bloc? +; ~~~~~~~~~~ +Ed_BlocWhat + moveq #6,d0 + bra.s Ed_ProAlert +; Too many windows +; ~~~~~~~~~~~~~~~~ +Ed_2ManyWindow + moveq #3,d0 + bsr Ed_GetMessage + bra.s Ed_AlertDialog + +; Hide window, last window +;~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_NoHide + moveq #2,d0 + bra Ed_Al100 + +; Program already runned +;~~~~~~~~~~~~~~~~~~~~~~~ +Ed_AlRunned + moveq #12,d0 + bra Ed_Al100 + +; No more UNDO +; ~~~~~~~~~~~~ +Ed_NoUndo + moveq #4,d0 + bra Ed_Al100 +; No more REDO +; ~~~~~~~~~~~~ +Ed_NoRedo + moveq #5,d0 + bra Ed_Al100 +; +; Appel alerte message indexe +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_ProAlert + bsr Ed_GetMessage + moveq #127,d0 + bra Ed_Alert +; Branche un message en dialog box +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_AlertDialog + moveq #127,d0 + bra Ed_Alert + +;_____________________________________________________________________________ +; +; Routines diverses +;_____________________________________________________________________________ +; + + +;____________________________________________________________________ +; +; LOAD / SAVE PROGRAMME +; ___________________________________________________________________ +; + +; +; LOADING: Demande plus de place / D0= Taille voulue +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_GetPlace + move.l d0,d2 +; Dialogues + moveq #EdD_TooSmall,d0 + bsr Ed_Dialogue + cmp.w #1,d0 + bne.s .GtPl2 +; Change la taille + move.l Prg_StTTexte(a6),d3 + move.l d2,d0 + JJsr L_Prg_ChgTTexte + beq.s .GtPl1 + rts +; Out of mem, remet l'ancien buffer +.GtPl1 move.l d3,d0 + JJsr L_Prg_ChgTTexte + bne .GtPl0 +; Vraiment out of mem: TOUT petit buffer! + move.l #1024,d0 + JJsr L_Prg_ChgTTexte +; Totalement Out of Mem! +.GtPl0 bsr Ed_NewBufAff + bra Ed_OMm +; Appelle SETBUFFER, et revient! +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.GtPl2 clr.b Prg_Change(a6) + move.l d2,d0 + bra.s Ed_SB +; +; Option SET BUFFER SIZE +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_SetBuffer + bsr Ed_TokCur + bsr Edt_ClearVar + move.l Prg_StTTexte(a6),d0 +Ed_SB +; Boite de dialogue + move.l Ed_VDialogues(a5),a2 + move.l d0,2*4(a2) + moveq #EdD_SetBuf,d0 + bsr Ed_Dialogue + cmp.w #1,d0 + bne Ed_NotDone + moveq #1,d0 + moveq #3,d1 + moveq #-1,d2 + JJsr L_Dia_GetValue + move.l d1,d0 + and.l #$FFFFFFFE,d0 + cmp.l #1024,d0 + bcs Ed_NotDone + move.l d0,d2 + move.l Prg_StTTexte(a6),d3 + cmp.l d3,d2 + beq Ed_NotDone +; Peut-on recopier le buffer? + bcs.s .PaCop +; Essaie de changer sans effacer le programme courant +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + move.l Prg_StTTexte(a6),-(sp) + move.l Prg_StMini(a6),-(sp) + move.l Prg_StHaut(a6),-(sp) + move.l Prg_StBas(a6),-(sp) + clr.l Prg_StTTexte(a6) Plus rien + move.l d2,d0 Reserve la nouvelle + JJsr L_Prg_ChgTTexte + beq.s .PaCop + move.l (sp)+,a0 Recopie le programme dans le buffer + move.l (sp)+,d0 + sub.l a0,d0 + moveq #0,d1 + bsr Ed_StoBlock + move.l (sp)+,a1 Libere le precedent + move.l (sp)+,d0 + SyCall SyFree + bra.s .Out +; Change le buffer en effacant le programme +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.PaCop movem.l d2/d3,-(sp) + bsr Ed_Saved + bsr Ed_New2 + movem.l (sp)+,d2/d3 + move.l d2,d0 + JJsr L_Prg_ChgTTexte + beq.s .OMm +; Fini! +.Out JJsr L_Prg_SetBanks + bsr Ed_NewBufAff + rts +; Out of mem! +; ~~~~~~~~~~~ +.OMm move.l d3,d0 + JJsr L_Prg_ChgTTexte + bne.s .OMmX + move.l #1024,d0 + JJsr L_Prg_ChgTTexte +.OMmX bsr Ed_NewBufAff + bra Ed_OMm + + +; ___________________________________________________________________ +; +; ROUTINES AFFICHAGE / POSITIONNEMENT FENETRES +; ___________________________________________________________________ +; +; Affiche les sliders +; ~~~~~~~~~~~~~~~~~~~ +Ed_AffSlV + tst.w Edt_WindTy(a4) + beq.s .Skip + bsr Edt_SlUpdateY + lea Edt_SlV(a4),a0 + moveq #0,d0 + JJsrR L_Sl_Draw,a1 +.Skip rts + +; +; Curseur ON/OFF +; ~~~~~~~~~~~~~~ +Ed_CuOn + movem.l d0/a0/a1,-(sp) + lea ChCuOn(pc),a1 + WiCall Print + movem.l (sp)+,d0/a0/a1 + rts +Ed_CuOff + movem.l d0/a0/a1,-(sp) + lea ChCuOff(pc),a1 + WiCall Print + clr.b Ed_CuFlag(a5) + movem.l (sp)+,d0/a0/a1 + rts + +; +; Reaffichage de la ligne courante +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_EALiCu + move.w Edt_YCu(a4),d1 + bsr Ed_EALigne + bra Ed_Loca + +; +; Routine: centre la fenetre editeur sur la position du curseur +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_Cent + bset #EtA_X,Edt_EtatAff(a4) + moveq #15,d1 + move.w Edt_XCu(a4),d0 + sub.w Edt_XPos(a4),d0 + bcs.s .AGoch + cmp.w Edt_WindTx(a4),d0 + bcc.s .ADroi + bra Ed_Loca +; Curseur trop ïż½ droite +.ADroi sub.w Edt_WindTx(a4),d0 + addq.w #1,d0 + add.w d0,Edt_XPos(a4) + bra Ed_AffBuf +; Curseur trop ïż½ gauche +.AGoch add.w d0,Edt_XPos(a4) + bra Ed_AffBuf + +; +; Positionne l'ïż½cran en X +; ~~~~~~~~~~~~~~~~~~~~~~~ +Ed_GotoX + cmp.w Edt_XCu(a4),d0 + beq.s .Skip + move.w Edt_XPos(a4),d1 + bsr Ed_SetX + cmp.w Edt_XPos(a4),d1 + beq Ed_EALiCu + bne Ed_AffBuf +.Skip rts +; +; Positionne l'ecran en Y +; ~~~~~~~~~~~~~~~~~~~~~~~ +Ed_GotoY + move.w Edt_YPos(a4),d1 + add.w Edt_YCu(a4),d1 + cmp.w d0,d1 + beq.s .Skip + bsr Ed_TokCur + move.w Edt_YPos(a4),d1 + bsr Ed_SetY + cmp.w Edt_YPos(a4),d1 + beq Ed_Loca + bne Ed_NewBuf +.Skip rts +; +; Centre l'ecran en X, sans affichage +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_SetX + movem.w d0-d1,-(sp) + bset #EtA_X,Edt_EtatAff(a4) + move.w d0,Edt_XCu(a4) + clr.w d1 + cmp.w #70,d0 + bcs.s EdSx2 +EdSx1 add.w #20,d1 + sub.w #20,d0 + cmp.w #60,d0 + bcc.s EdSx1 +EdSx2 move.w d1,Edt_XPos(a4) + movem.w (sp)+,d0-d1 + rts +; +; Centre l'ecran en Y, sans affichage +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_SetY + movem.w d0/d1,-(sp) + bset #EtA_Y,Edt_EtatAff(a4) + move.b #SlDelai,Edt_ASlY(a4) +; Limite en bas + cmp.w Prg_NLigne(a6),d0 + bls.s .Sk1 + move.w Prg_NLigne(a6),d0 +.Sk1 move.w d0,d1 + sub.w Edt_YPos(a4),d1 + bcs.s .Remonte + cmp.w Edt_WindTy(a4),d1 + bcc.s .Descend + bra.s .Out +; Remonte la fenetre +.Remonte + add.w d1,Edt_YPos(a4) + bra.s .Out +; Descend la fenetre +.Descend + sub.w Edt_WindTy(a4),d1 + addq.w #1,d1 + add.w d1,Edt_YPos(a4) +; Position du curseur +.Out sub.w Edt_YPos(a4),d0 + move.w d0,Edt_YCu(a4) + movem.w (sp)+,d0/d1 + rts + +; +; Centre l'ecran en X et Y, gere les procedures.... +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +; A0= adresse dans programme +; D0= X curseur +; +Ed_SetXY + clr.l Prg_AdEProc(a6) + move.w d0,Prg_XEProc(a6) + move.w d0,-(sp) + bsr Ed_FindA + tst.l d1 + beq.s EdSxy1 + move.l a0,Prg_AdEProc(a6) + clr.w (sp) +EdSxy1 bsr Ed_SetY + move.w (sp)+,d0 + bsr Ed_SetX + bsr Ed_AverFin + bra Ed_NewBuf + +; +; Routine situe le label AVANT et APRES LCour: D1= avant / D2= apres +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_NLab + move.w Edt_YPos(a4),d3 + add.w Edt_YCu(a4),d3 + moveq #0,d1 + moveq #-1,d2 + bsr Ed_FindL + bra.s .NLab1 +.NLab0 bsr Ed_NextL +.NLab1 beq.s .NLab3 + addq.l #1,d2 + move.w 2(a0),d0 + cmp.w #_TkProc,d0 + beq.s .NLab2 + cmp.w #_TkLab,d0 + bne.s .NLab0 +.NLab2 cmp.w d3,d2 + beq.s .NLab0 + bhi.s .NLab3 + move.w d2,d1 + bra.s .NLab0 +.NLab3 rts + +; +; Locate le curseur dans l'ecran +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_Loca + move.l d2,-(sp) + move.w Edt_YCu(a4),d2 + move.w Edt_XCu(a4),d1 + sub.w Edt_XPos(a4),d1 + ext.l d1 + ext.l d2 + WiCall Locate + move.l (sp)+,d2 + rts + +; +; Affiche le caractere ECRAN D1 de tout le buffer d'edition +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_AffBufCar + moveq #0,d2 +.ABufC bsr Ed_ACar + addq.w #1,d2 + cmp.w Edt_WindTy(a4),d2 + bcs.s .ABufC + bra Ed_Loca + +; +; Imprime le caractere ECRAN D1 de la ligne D2 +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_ACar + movem.l d0-d7/a0-a1,-(sp) +; Locate en debut de ligne + move.w d1,d4 + move.w d2,d5 + WiCall Locate +; Pointe la ligne dans le buffer + move.w d5,d0 + lsl.w #8,d0 + move.l Edt_BufE(a4),a0 + lea 0(a0,d0.w),a0 + add.w Edt_XPos(a4),d4 + moveq #" ",d6 + cmp.w (a0)+,d4 + bcc.s .NoBloc + move.b 0(a0,d4.w),d6 +; Machine le bloc + move.w Edt_YBloc(a4),d0 + bmi .NoBloc + move.w Edt_YPos(a4),d1 + add.w Edt_YCu(a4),d1 + move.w Edt_XBloc(a4),d2 + move.w Edt_XCu(a4),d3 + cmp.w d0,d1 + bcs.s .Sw + bhi.s .Sk2 + cmp.w d2,d3 + beq.s .NoBloc + bcc.s .Sk2 +.Sw exg d0,d1 + exg d2,d3 +.Sk2 cmp.w d0,d5 + bcs.s .NoBloc + beq.s .DBloc + cmp.w d1,d5 + bcs.s .InBloc + bhi.s .NoBloc + cmp.w d3,d4 + bcc.s .NoBloc + bra.s .InBloc +.DBloc cmp.w d1,d5 + beq.s .LBloc + cmp.w d2,d4 + bcs.s .InBloc + bra.s .NoBloc +.LBloc cmp.w d2,d4 + bcs.s .NoBloc + cmp.w d3,d4 + bcc.s .NoBloc +; Dessin en inverse +.InBloc moveq #17,d0 + bsr Ed_GetSysteme + move.l a0,a1 + WiCall Print + move.w d6,d1 + WiCall ChrOut + moveq #18,d0 + bsr Ed_GetSysteme + move.l a0,a1 + WiCall Print + bra.s .Out +; Dessin normal +.NoBloc move.w d6,d1 + WiCall ChrOut +; Ouf! +.Out movem.l (sp)+,d0-d7/a0-a1 + rts + +; Detokenise le buffer et raffiche les infos. +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_NewBufAff + move.b #EtA_BAll,Edt_EtatAff(a4) + move.b #SlDelai,Edt_ASlY(a4) +; Detokenise et affiche le buffer +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_NewBuf + move.w Edt_Window(a4),d1 + WiCall QWindow + bsr Ed_BufUntok +; Affiche tout le buffer d'edition +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_AffBuf +; Enleve tous les avertissements +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + bsr Ed_AllAverFin +; Reaffiche les lignes +; ~~~~~~~~~~~~~~~~~~~~ + moveq #0,d1 +.Loop bsr Ed_EALigne + addq.w #1,d1 + cmp.w Edt_WindTy(a4),d1 + bcs.s .Loop +; move.b #2,Edt_ASlY(a4) Affichage du slider +; move.b #EtA_BAll,Edt_EtatAff(a4) Affichage de l'etat + bra Ed_Loca +; +; Imprime la ligne du buffer D1 +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_EALigne + movem.l d0-d6/a0-a2,-(sp) * Efface + moveq #-1,d6 + bra.s EALi +Ed_ALigne + movem.l d0-d6/a0-a2,-(sp) * Affiche seulement + moveq #0,d6 +EALi +; Locate en debut de ligne +; ~~~~~~~~~~~~~~~~~~~~~~~~ + move.w d1,d6 + move.w d1,d2 + moveq #0,d1 + ext.l d2 + WiCall Locate +; Pointe la ligne dans le buffer +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + move.w d6,d0 + lsl.w #8,d0 + move.l Edt_BufE(a4),a2 + lea 0(a2,d0.w),a2 + move.w Edt_XPos(a4),d4 + move.w (a2)+,d0 * Longueur de la ligne + cmp.w d0,d4 + bcc .End + lea 0(a2,d4.w),a2 * Pointe le debut + move.w d4,d5 + add.w Edt_WindTx(a4),d5 * Pointe la fin + cmp.w d0,d5 + bls.s .Sk1 + move.w d0,d5 +.Sk1 move.w d5,d0 + sub.w d4,d0 + cmp.w Edt_WindTx(a4),d0 + bcs.s .Sz + bclr #31,d6 +.Sz +; Un bloc en route? +; ~~~~~~~~~~~~~~~~~ + add.w Edt_YPos(a4),d6 + move.w Edt_YBloc(a4),d0 + bmi .NoBloc + move.w Edt_YPos(a4),d1 + add.w Edt_YCu(a4),d1 + move.w Edt_XBloc(a4),d2 + move.w Edt_XCu(a4),d3 + cmp.w d0,d1 + bcs.s .Sw + bhi.s .Sk2 + cmp.w d2,d3 + beq .NoBloc + bcc.s .Sk2 +.Sw exg d0,d1 + exg d2,d3 +.Sk2 cmp.w d5,d3 + bls.s .SkQ + move.w d5,d3 +.SkQ cmp.w d0,d6 + bcs .NoBloc + beq.s .DBloc + cmp.w d1,d6 + bhi .NoBloc + beq.s .EBloc +; Au milieu du bloc, TOUT en inverse +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + bsr .Inverse + move.l a2,a1 + move.w d5,d1 + sub.w d4,d1 + bsr .Print + bsr .Normal + bra .End +; Bloc sur une seule ligne +; ~~~~~~~~~~~~~~~~~~~~~~~~ +.DEBloc cmp.w d5,d2 + bcc .NoBloc + move.w d2,d1 + sub.w d4,d1 + bls.s .S1 + move.l a2,a1 + add.w d1,a2 + add.w d1,d4 + bsr .Print +.S1 bsr .Inverse + move.w d3,d1 + sub.w d4,d1 + bls.s .S2 + move.l a2,a1 + add.w d1,d4 + add.w d1,a2 + bsr .Print +.S2 bsr .Normal + bra.s .NoBloc +; Au debut du bloc, passe en inverse +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.DBloc cmp.w d1,d6 + beq.s .DEBloc + cmp.w d5,d2 + bcc.s .NoBloc + move.w d2,d1 + sub.w d4,d1 + bls.s .Sk3 + move.l a2,a1 + add.w d1,a2 + add.w d1,d4 + bsr .Print +.Sk3 bsr .Inverse + move.w d5,d1 + sub.w d4,d1 + bls.s .Sk4 + move.l a2,a1 + bsr .Print +.Sk4 bsr .Normal + bra .End +; A la fin du bloc, passe en normal +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.EBloc cmp.w d0,d6 + beq.s .DEBloc + bsr .Inverse + move.w d3,d1 + sub.w d4,d1 + bls.s .Sk5 + move.l a2,a1 + add.w d1,a2 + add.w d1,d4 + bsr .Print +.Sk5 bsr .Normal +; Pas de bloc, NORMAL! +; ~~~~~~~~~~~~~~~~~~~~ +.NoBloc move.w d5,d1 + sub.w d4,d1 + bls.s .End + move.l a2,a1 + bsr .Print +; Efface jusqu'ïż½ la fin de la ligne? +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.End tst.l d6 + bpl.s .Sk7 + WiCalD ChrOut,7 +.Sk7 +; Fini! +; ~~~~~ + movem.l (sp)+,d0-d6/a0-a2 + rts +.Inverse + moveq #17,d0 + bsr Ed_GetSysteme + move.l a0,a1 + WiCall Print + rts +.Normal + moveq #18,d0 + bsr Ed_GetSysteme + move.l a0,a1 + WiCall Print + rts +.Print + move.b 0(a1,d1.w),d0 + clr.b 0(a1,d1.w) + move.w d0,-(sp) + WiCall Print + move.w (sp)+,d0 + move.b d0,0(a1,d1.w) + rts + + + + +;_____________________________________________________________________________ +; +; STOCKAGE DU PROGRAMME +;_____________________________________________________________________________ +; + +; +; DELETION LIGNE DANS PROGRAMME +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +; Retourne 0: si ligne deletee +; 1: si ligne non deletee +Ed_DelLiCu + move.w Edt_YPos(a4),d1 + add.w Edt_YCu(a4),d1 + move.w d1,-(sp) +; Stocke dans UNDO + bsr Ed_LCourant + bne Ed_NotEdit + move.w Edt_XCu(a4),-(sp) + clr.w Edt_XCu(a4) + move.l Prg_PUndo(a6),a2 + ext.l d0 + bsr Un_CLine + bne.s .SkipU + move.b #$84,(a2) +.SkipU move.w (sp)+,Edt_XCu(a4) + move.w (sp)+,d1 +; Enleve dans le programme + bsr Ed_DeLigne + move.w d0,-(sp) + bne.s .RetV3 +; Enleve dans l'affichage + WiCalD ChrOut,23 + bsr Ed_LCourant + lea -2(a0),a0 + lea 256(a0),a1 + move.w Edt_WindTy(a4),d0 + mulu #256,d0 + add.l Edt_BufE(a4),d0 + move.l d0,a2 + sub.l a1,d0 + bls.s .RetV2 + lsr.w #2,d0 + subq.w #1,d0 +.RetV1: move.l (a1)+,(a0)+ + dbra d0,.RetV1 +.RetV2: clr.w -256(a2) +.RetV3 move.w Edt_YPos(a4),d0 + move.w Edt_WindTy(a4),d1 + subq.w #1,d1 + add.w d1,d0 + bsr Ed_Untok + bsr Ed_EALigne + move.b #SlDelai,Edt_ASlY(a4) + bsr Ed_Loca + move.w (sp)+,d0 + rts + +; +; Joint la ligne et celle du dessus! +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +; +Ed_Join tst.w Edt_YCu(a4) + beq .Out + tst.w Edt_XCu(a4) + bne .Out + addq.b #1,Ed_FUndo(a5) + + bsr Ed_LCourant + lea -256(a0),a1 +; Peut-on joindre les lignes? + tst.w -2(a0) + beq.s .Vide + tst.b 255-2(a1) Previous ligne editable? + bne Ed_NotEdit +; Ok! +.Vide move.w -2(a1),d1 + move.w d0,d2 + add.w d1,d2 + cmp.w #250,d2 Line too long! + bcc Ed_LToLong + clr.w -2(a0) + move.w d2,-2(a1) + lea 0(a1,d1.w),a1 + subq.w #1,d0 + bmi.s .Bac1 +.Bac0: move.b (a0)+,(a1)+ + dbra d0,.Bac0 +.Bac1: move.w d1,-(sp) +; Efface la ligne actuelle + bsr Ed_DelLiCu +; Ligne non effacee: c'est la derniere + tst.w d0 + beq.s .Skk + move.w Prg_NLigne(a6),d1 + beq.s .Skk + subq.w #1,d1 + move.w d1,d0 + bsr Ed_FindL Est-ce une derniere ligne + beq.s .Skk + cmp.l #$02000000,(a0) Instruction vide? + bne.s .Skk + bsr Ed_DeLigne On l'enleve! +; Affiche la prïż½cïż½dente +.Skk bsr Ed_ChtT + addq.w #1,Edt_LEdited(a4) + move.b #SlDelai,Edt_ASlY(a4) + move.w (sp)+,Edt_XCu(a4) + bsr Ed_EALiCu + bsr Ed_Cent +; UNDO + or.b #%11,Ed_SCallFlags(a5) + subq.b #1,Ed_FUndo(a5) + bsr Ed_LCourant + move.l Prg_PUndo(a6),a2 + ext.l d0 + bsr Un_CLine + bne.s .Out + move.b #$88,(a2) +.Out rts + +; +; RETURN >>> recupere la droite de la ligne +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_Return +; Fait du bruit + moveq #"D",d0 + bsr Ed_SamPlay +Ed_ReturnQuiet +; A gauche de la ligne + tst.w Edt_XCu(a4) + beq .Goch +; Bas du buffer= stockage temporaire + move.l Prg_StMini(a6),a2 * Adresse dans STMINI + clr.w (a2)+ * CHAINE VIDE! + clr.w (a2) + move.l Prg_StBas(a6),a0 + lea -256(a0),a0 + cmp.l a0,a2 + bcc Ed_OofBuf +; Gestion UNDO + bsr Ed_LCourant + bne .PaEd + move.l Prg_PUndo(a6),a1 + ext.l d0 + bsr Un_CLine + bne.s .Skip + move.b #$87,(a1) +.Skip addq.b #1,Ed_FUndo(a5) +; Copie la droite de la ligne + bsr Ed_LCourant + move.w d1,d2 + cmp.w d0,d2 + bcs.s .RtI1 + move.w d0,d2 +.RtI1: move.w d2,-2(a0) * Change la taille ligne origine +.RtI2: cmp.w d0,d1 + bcc.s .RtI3 + move.b (a1)+,(a2)+ + addq.w #1,d1 + bra.s .RtI2 +.RtI3: clr.b (a2) +; Tokenise + move.w Prg_NLigne(a6),-(sp) + moveq #1,d0 Une ligne de plus si a la fin! + bsr Ed_TokStok2 +; Dïż½but de la ligne suivante + bsr Ed_CBasT + bsr Ed_DLigneT +; Insere la ligne, si pas ïż½ la fin du texte + move.w (sp)+,d2 + cmp.w Prg_NLigne(a6),d2 + bne.s .Sk + bsr Ed_InsLine +; Recopie la nouvelle +.Sk bsr Ed_LCourant + move.l a0,a2 + clr.b 255-2(a2) La ligne est editable! + clr.w d0 + move.l Prg_StMini(a6),a1 + lea 2(a1),a1 +.RtI4: move.b (a1)+,d1 + beq.s .RtI5 + move.b d1,(a2)+ + addq.w #1,d0 + bra.s .RtI4 +.RtI5: move.w d0,-2(a0) +; Affiche la nouvelle ligne/revient a l'editeur + addq.w #1,Edt_LEdited(a4) + bsr Ed_EALiCu + subq.b #1,Ed_FUndo(a5) + rts +; A gauche de la ligne: INS puis bas +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.Goch bsr Ed_InsLine + bsr Ed_CBasT + bra Ed_DLigneT +; Ligne non editable +; ~~~~~~~~~~~~~~~~~~ +.PaEd bsr Ed_CBasT + bsr Ed_DLigneT + bra Ed_InsLine + +; +; Insere une ligne ïż½ la position du curseur +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +; +Ed_InsLine +; Ligne courante + bsr Ed_TokCur +; Tokenise une ligne vide + move.l Ed_BufT(a5),a1 + lea 128(a1),a0 + clr.b (a0) + bsr Tokenise +; Va l'inserer dans le texte + move.l Ed_BufT(a5),a1 + move.w Edt_YPos(a4),d1 + add.w Edt_YCu(a4),d1 + moveq #-1,d0 + bsr Ed_Stocke + bne Ed_OofBuf +; Gestion UNDO + bsr Un_Debut + bne.s .Skip + move.b #$06,(a2) +; Une ligne de plus +.Skip addq.w #1,Prg_NLigne(a6) + move.b #SlDelai,Edt_ASlY(a4) + bsr Ed_NewBuf + rts + +; +; TOKENISE / STOCKE la ligne courante +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +; +Ed_TokCur + tst.w Edt_LEdited(a4) + beq.s .Skip + movem.l a0-a1/d0-d1,-(sp) + moveq #0,d0 + bsr.s Ed_TokStok2 + bsr Ed_Loca + move.l a4,a0 + moveq #%01,d0 + bsr Ed_Splitted + movem.l (sp)+,a0-a1/d0-d1 +.Skip rts + +Ed_TokStok + tst.w Edt_LEdited(a4) + beq TokX +Ed_TokStok2 + movem.l d2-d7/a2,-(sp) + move.w d0,d2 +; Va tokeniser la ligne +; ~~~~~~~~~~~~~~~~~~~~~ + clr.w Edt_LEdited(a4) + bsr Ed_LCourant * Adresse de la ligne courante + clr.b 0(a0,d0.w) * Marque la fin + moveq #0,d0 + move.l Ed_BufT(a5),a1 * Buffer de tokenisation + bsr Tokenise + bmi Ed_LToLong + add.w d0,d2 +; Stocke la ligne +; ~~~~~~~~~~~~~~~ + move.l Ed_BufT(a5),a1 + move.w Edt_YPos(a4),d1 + add.w Edt_YCu(a4),d1 + moveq #0,d0 + bsr Ed_Stocke + bne Ed_OofBuf + move.l a0,a2 Adresse ligne dans le programme + add.w d1,d2 Une ligne de plus??? +; Copie l'ancienne ligne dans le buffer de tokenisation +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + bsr Ed_LCourant + move.l Ed_BufT(a5),a1 + move.w d0,d5 + subq.w #1,d0 + bmi.s .NC +.C1 move.b (a0)+,(a1)+ + dbra d0,.C1 +.NC +; Une ligne de plus, si ïż½ la fin, et non vide +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + moveq #0,d6 + move.w Edt_YPos(a4),d1 + add.w Edt_YCu(a4),d1 + cmp.w Prg_NLigne(a6),d1 + bne.s .Rien + tst.w d2 + beq.s .Rien + moveq #1,d6 + addq.w #1,Prg_NLigne(a6) +.Rien +; Reaffiche la ligne tokenisee +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + bsr Ed_LCourant + lea -2(a0),a1 + move.l a2,a0 + moveq #0,d0 + bsr Detok + move.w Edt_YCu(a4),d1 + bsr Ed_EALigne +; Gestion du UNDO +; ~~~~~~~~~~~~~~~ + bsr Un_Debut + bne.s .NoUndo + move.b #$85,(a2) + bsr Ed_LCourant + move.l a0,a1 + move.w d0,d7 + add.w d5,d0 + moveq #8,d1 + add.w d0,d1 + move.l d1,d0 + SyCall MemFastClear + move.w d1,(a0) + add.l d1,Prg_TUndo(a6) + move.w 2(a2),2(a0) + move.l a0,2(a2) + move.w d6,4(a0) +; Copie l'ancienne ligne + move.l Ed_BufT(a5),a2 + lea 6(a0),a0 + move.b d5,(a0)+ + subq.w #1,d5 + bmi.s .Sk1 +.Co1 move.b (a2)+,(a0)+ + dbra d5,.Co1 +.Sk1 +; Copie la nouvelle + move.b d7,(a0)+ + subq.w #1,d7 + bmi.s .Sk2 +.Co2 move.b (a1)+,(a0)+ + dbra d7,.Co2 +.Sk2 +.NoUndo +; Copie du flag double precision +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + move.b MathFlags(a5),Prg_MathFlags(a6) +; Ok! +; ~~~ + movem.l (sp)+,d2-d7/a2 +TokX rts + + +; DETOKENISE TOUT LE BUFFER +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_BufUntok + clr.w -(sp) + move.w Edt_YPos(a4),d0 + bsr Ed_FindL + bra.s .BUnt1 +.BUnt0 bsr Ed_NextL +.BUnt1 move.w (sp),d1 + move.l Edt_BufE(a4),a1 + lsl.w #8,d1 + lea 0(a1,d1.w),a1 + clr.w (a1) + clr.b 255(a1) Ligne editable + tst.w d0 + beq.s .BUnt2 + JJsrP L_Tk_EditL,a2 + bne.s .Edit + move.b #-1,255(a1) Ligne NON editable! +.Edit moveq #0,d0 + bsr Detok +.BUnt2 addq.w #1,(sp) + move.w (sp),d0 + cmp.w Edt_WindTy(a4),d0 + bcs.s .BUnt0 + addq.l #2,sp + rts + +; +; DETOKENISE la LIGNE D0 dans le BUFFER ligne D1 +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_Untok + movem.l d0-d1/a0-a2,-(sp) + move.l Edt_BufE(a4),a1 + lsl.w #8,d1 + lea 0(a1,d1.w),a1 + clr.w (a1) + clr.b 255(a1) + move.l a1,-(sp) + bsr Ed_FindL + move.l (sp)+,a1 + beq.s .Fin + JJsrR L_Tk_EditL,a2 + bne.s .Edit + move.b #-1,255(a1) +.Edit moveq #0,d0 + bsr Detok +.Fin movem.l (sp)+,d0-d1/a0-a2 + rts + +; +; NEW +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_New + bsr Ed_TokCur + bsr Ed_Saved +Ed_New2 + bsr EdM_Program + moveq #1,d0 + tst.b Ed_Zappeuse(a5) + beq.s .No + moveq #0,d0 +.No JJsr L_Prg_New + bsr Edt_New + bsr Ed_NewBufAff + rts +; +; New du contenu d'une fenetre +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Edt_New +; Editeur par devant + tst.b Ed_Zappeuse(a5) + bne.s .Skp + EcCalD Last,0 + bsr EdReCop +.Skp EcCalD Active,EcEdit +; Init des donnïż½es editeur + lea Edt_SInit(a4),a0 + moveq #(Edt_EInit-Edt_SInit)/2-1,d0 +.Loop clr.w (a0)+ + dbra d0,.Loop + move.w #-1,Edt_YBloc(a4) + move.w #-1,Edt_YOldBloc(a4) +; Init des donnees programme + bsr Prg_UndoCreate Effacement / Creation du buffer undo + bsr Prg_MarkRaz + clr.b MathFlags(a5) Simple precision par defaut + rts + +; +; INSERE LE BLOC A0 LONGUEUR D0 EN POSITION D1 +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +; +Ed_StoBlock + movem.l a2-a3/d2-d7,-(sp) + move.l a0,a1 + move.l d0,d2 + move.w d1,d0 + moveq #0,d7 Ne pas changer les marques + bsr Ed_FindL + bra StoI +; +; STOCKE LA LIGNE (A1) EN POSITION D1, INSERT D0 +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +; Retour: A0= Ligne tokenisee +; A1= +; D0= Erreur? +; D1= Flag un ligne de plus! +Ed_Stocke + movem.l a2-a3/d2-d7,-(sp) + + move.w d0,d7 + move.w d1,d6 + moveq #0,d5 + +; Longueur de la nouvelle ligne + moveq #0,d2 + move.b (a1),d2 + lsl.w #1,d2 +; Pointe la ligne courante + move.w d1,d0 + bsr Ed_FindL Cherche l'adresse ---> A0 + moveq #0,d1 + move.b (a0),d1 + lsl.l #1,d1 Derniere ligne? + beq.s StoD + tst.w d7 Insertion + bne.s StoI + +; Remplacement d'une ligne +; ~~~~~~~~~~~~~~~~~~~~~~~~ + cmp.w #_TkProc,2(a0) On est sur une procedure fermee??? + bne.s .Stck1 + tst.w 10(a0) + bmi StoClo +.Stck1 cmp.l d1,d2 + beq StoCop + bhi.s StoR5 +* Nouvelle plus petite + move.l a0,a2 + sub.l d2,d1 + add.l d1,a0 + move.l a0,a3 + move.l Prg_StBas(a6),d0 + bra.s StoR2 +StoR1 move.w -(a2),-(a3) +StoR2 cmp.l d0,a2 + bhi.s StoR1 + move.l a3,Prg_StBas(a6) + move.l d1,d0 + bra.s StoCop +* Nouvelle plus grande +StoR5 move.l d2,d0 + sub.l d1,d0 + bra.s StoI0 + +; Derniere ligne: pas une ligne vide, si non insert! +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +StoD cmp.w #4,d2 Ligne vide= 4 octets + bne.s StoI + move.l a0,d4 + tst.w d7 + beq.s StoV +; Insersion ligne / Block +; ~~~~~~~~~~~~~~~~~~~~~~~ +StoI move.l d2,d0 + moveq #1,d5 +StoI0 move.l Prg_StBas(a6),a2 + move.l a2,a3 + sub.l d0,a3 + cmp.l Prg_StMini(a6),a3 + bls.s StoMem + move.l a3,Prg_StBas(a6) + bra.s StoI2 +StoI1 move.w (a2)+,(a3)+ * Fait de la place +StoI2 cmp.l a0,a2 + bcs.s StoI1 + sub.l d0,a0 +; Copie de la ligne +; ~~~~~~~~~~~~~~~~~ +StoCop move.l a0,a2 + move.l a0,d4 + lsr.l #1,d2 +StoC move.w (a1)+,(a2)+ * Copie la ligne + subq.l #1,d2 + bne.s StoC +; Change les marks +; ~~~~~~~~~~~~~~~~ + tst.w d7 + beq.s .Skip + move.w d6,d0 + moveq #1,d1 + bsr Ed_MarksChange +.Skip +; Nettoie les variables (si pas MERGE!) +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + bset #EtA_Free,Edt_EtatAff(a4) + move.b #1,Prg_Change(a6) + move.b #1,Prg_StModif(a6) +StoV move.l d5,d1 + move.l d4,a0 + moveq #0,d0 + bra.s StX +; Procedure fermee +StoClo moveq #-1,d0 + bra.s StX +; Out of mem +StoMem: moveq #1,d0 +StX movem.l (sp)+,a2-a3/d2-d7 + rts +; +; ENLEVE UN CHUNK DE PROGRAMME +; D1= Ligne debut +; D0= Longueur chunk +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_DelChunk + move.l d0,-(sp) + move.w d1,d0 + bsr Ed_FindL + beq.s .Out + move.l a0,a1 + add.l (sp),a1 + bsr Ed_StDelChunk +.Out addq.l #4,sp + rts + +; ENLEVE LA LIGNE D1 +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +; Retourne 0: si ligne deletee (NLIGNE=NLIGNE-1) +; 1: si ligne non deletee +; -1 si ligne non editable +Ed_DeLigne + move.w d1,-(sp) + move.w d1,d0 + bsr Ed_FindL + beq.s .DelLL +; Dans procedure. Fermïż½e? + cmp.w #_TkProc,2(a0) * Pas si procedure fermee! + bne.s .DelL0 + tst.w 10(a0) + bmi.s .DelLN +; Enleve la ligne +.DelL0 moveq #0,d0 + move.b (a0),d0 + lsl.w #1,d0 + lea 0(a0,d0.w),a1 + bsr Ed_StDelChunk +; Marks + move.w (sp),d0 + moveq #-1,d1 + bsr Ed_MarksChange +; Nombre de lignes + subq.w #1,Prg_NLigne(a6) +.DelLX moveq #0,d0 + bra.s .Out +.DelLN moveq #-1,d0 + bra.s .Out +.DelLL moveq #1,d0 +.Out addq.l #2,sp + rts +; Enleve le chunk de programme A0-A1 +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_StDelChunk + move.l a2,-(sp) + move.l Prg_StBas(a6),a2 + move.l a0,d1 + bra.s DelL2 +DelL1: move.w -(a0),-(a1) +DelL2: cmp.l a2,a0 + bhi.s DelL1 + move.l a1,Prg_StBas(a6) +; Flags + move.b #1,Prg_Change(a6) + move.b #1,Prg_StModif(a6) + bset #EtA_Free,Edt_EtatAff(a4) + move.l (sp)+,a2 + rts + +; +; TROUVE L'ADRESSE DE LA LIGNE D0 (coord editeur) +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +; Si au milieu d'une procedure, AD ---> ADPROC +; +Ed_FindL + move.l a1,-(sp) + move.l Prg_StBas(a6),a0 + JJsrR L_Tk_FindL,a1 + move.l a0,Edt_CurLigne(a4) + move.l a1,Edt_DebProc(a4) + move.l (sp)+,a1 + tst.w d0 + rts +; Trouve la ligne suivante +; ~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_NextL + move.l a1,-(sp) + move.l Edt_CurLigne(a4),a0 + JJsrR L_Tk_FindN,a1 + move.l a0,Edt_CurLigne(a4) + move.l a1,Edt_DebProc(a4) + move.l (sp)+,a1 + tst.w d0 + rts + +; Trouve la taille de la CURLIGNE +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_SizeL + move.l Edt_CurLigne(a4),a0 + JJsrP L_Tk_SizeL,a1 + rts + +; La ligne courante est-elle editable? +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_EditL + move.l Edt_CurLigne(a4),a0 + JJsrP L_Tk_EditL,a1 + rts + +; +; TROUVE LE NUMERO ET LE DEBUT DE LA LIGNE A0 +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +; D0-> Numero +; D1-> Adresse debut proc +; +Ed_FindA + movem.l a1/a2,-(sp) + move.l Prg_StBas(a6),a1 + JJsrR L_Tk_FindA,a2 + movem.l (sp)+,a1/a2 + rts +; +; Ramene l'adresse de la ligne sous le curseur +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +; A0= adresse +; A1= lettre sous le curseur +; D0= longueur +; D1= position curseur +; +Ed_LCourant: + move.w Edt_YCu(a4),d0 + lsl.w #8,d0 + move.l Edt_BufE(a4),a0 + lea 0(a0,d0.w),a0 + move.w (a0)+,d0 + move.w Edt_XCu(a4),d1 + lea 0(a0,d1.w),a1 + tst.b 255-2(a0) + rts + + +;____________________________________________________________________ +; +; GESTION WINDOWS +;____________________________________________________________________ +; +; +; Back to Workbench +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_Wb EcCalD AMOS_WB,0 + rts + + +; ZAP: Ferme un fenetre contenant un programme donne +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_CloseName + bsr Edt_AccAdr Deja en memoire? + beq.s .Fini + move.l a0,a4 Active la fenetre + move.l Edt_Prg(a4),a6 + JJsr L_Prg_DejaRunned En train de tourner? + bne.s .Fini + bsr Ed_CloseWindow Ferme la fenetre + bra.s Ed_CloseName Encore une fenetre a fermer? +.Fini rts + +; Ouvre une nouvelle fenetre+Charge prg +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +; +Ed_OpenLoad + bsr Ed_OpenWindow + bra Ed_Load + +; +; Ouvre une nouvelle fenetre +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_OpenWindow + bsr Ed_TokCur + moveq #-1,d0 Visible + move.l PI_DefSize(a5),d1 Taille par defaut + bsr Edt_OpWindow + blt Ed_OMm + bgt Ed_2ManyWindow + bsr Ed_DrawWindows + rts + +; +; Routine d'ouverture de fenetre +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +; D0= Hidden(0) / Vue(-1) +; D1= Taille buffer voulue +; A4= Edt Courant +Edt_OpWindow + movem.l d2-d7/a2-a3,-(sp) + move.l d1,d3 + move.w d0,d2 + beq.s .Res +; Si fenetre visible, peut-on l'ouvrir? + sub.l a0,a0 + bsr Edt_WCount Nombre de fenetres ouvertes + cmp.w Ed_WMax(a5),d0 + bcc .Rate +; Ouvre la structure EDT +; ~~~~~~~~~~~~~~~~~~~~~~ +.Res move.l #Edt_Long,d0 + SyCall MemFastClear + beq .Omm2 +; Insere dans la liste + move.l a4,d0 + beq.s .First + move.l Edt_Next(a4),d0 Branche dans la liste + move.l d0,Edt_Next(a0) + move.l a0,Edt_Next(a4) + bra.s .Prg +.First move.l Edt_List(a5),Edt_Next(a0) + move.l a0,Edt_List(a5) +; Ouvre la structure Prg +; ~~~~~~~~~~~~~~~~~~~~~~ +.Prg move.l a0,a4 + move.l d3,d0 Taille + bmi.s .NoStru + JJsr L_Prg_NewStructure Fabrique une structure fenetre + beq.s .Omm1 + move.l d0,Edt_Prg(a4) Branche dans la structure! + move.l d0,a6 + addq.b #1,Prg_Edited(a6) Flag: edite! +; Active la fenetre si visible +.NoStru move.b #2,Edt_Hidden(a4) 2 car aucune zone crïż½ïż½e + tst.w d2 + beq.s .Skip2 + clr.b Edt_Hidden(a4) + move.l a4,Edt_Current(a5) + moveq #1,d0 + bsr Edt_WSchrinkAll Reduit toutes les fenetres + moveq #-1,d0 + bsr Edt_WMaxSize + move.w d0,Edt_WindTy(a4) +; New des donnees +.Skip2 bsr Edt_New + moveq #0,d0 Pas d'erreur +.Out movem.l (sp)+,d2-d7/a2-a3 + rts +; Trop de fenetres +.Rate moveq #1,d0 + bra.s .Out +; Out of memory +.Omm1 bsr Edt_DelWindow +.Omm2 moveq #-1,d0 + bra.s .Out + +; +; Cache la fenetre editeur courante +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +; +Ed_WindowHide + bsr Ed_TokCur +; Si fenetre linkïż½e, on ferme d'abord! + move.l Edt_LinkPrev(a4),d0 + or.l Edt_LinkNext(a4),d0 + beq.s .PaLink +; Ferme toutes les fenetres linkees +.Loop move.l Edt_LinkPrev(a4),d0 + bne.s .Skip + move.l Edt_LinkNext(a4),d0 + beq.s .PaLink +.Skip move.l a4,-(sp) + move.l d0,a4 + bsr Ed_CloseWindow + move.l (sp)+,a4 + move.l a4,Edt_Current(a5) + bra.s .Loop +.PaLink +; Une fenetre seule? + bsr Edt_WAlone + bne Ed_NoHide +; Enleve les links de scrolling, et cache + move.l a4,a0 + bsr Edt_DelLinkScroll + move.b #1,Edt_Hidden(a4) +; Active une autre fenetre, quelle que soit sa taille! + bsr Edt_WAutre D'abord une fenetre OUVERTE! + bne.s .Ok + moveq #0,d1 + move.l a4,a0 + bsr Edt_WAutre3 Sinon meme une fermee! +.Ok moveq #-1,d0 + bsr Edt_WMaxSize + move.w d0,Edt_WindTy(a4) + bsr Ed_DrawWindows + bsr EdM_BranchAMOS + rts + +; +; Bouton de fermeture d'un fenetre +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +; +Ed_BtWindowClose + move.w Bt_Number(a2),d0 + bsr Edt_GetAd + beq.s .Skip + move.l a0,a4 + move.l Edt_Prg(a4),a6 + bsr Ed_CloseWindowQuit +.Skip rts + +; +; Bouton Hide fenetre +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +; +Ed_BtWindowHide + bsr Ed_TokCur + move.w Bt_Number(a2),d0 + bsr Edt_GetAd + beq.s .Skip + move.l a0,a4 + move.l Edt_Prg(a4),a6 + bsr Ed_WindowHide +.Skip rts + +; +; Bouton Scrhink / Expand fenetre +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +; +Ed_BtWindowSize + bsr Ed_TokCur + move.w Bt_Number(a2),d0 + bsr Edt_GetAd + beq.s .Skip + move.l a0,a4 + move.l Edt_Prg(a4),a6 + bsr Ed_FlipSizeWindow +.Skip rts + +; +; Ferme la fenetre editeur courante +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_CloseWindowQuit * Avec option QUIT + tst.b Ed_Zappeuse(a5) Pas si zappeuse! + bne.s Ed_CloseWindow + move.w #-1,-(sp) + bra.s EdClo +Ed_CloseWindow * Sans option QUIT + clr.w -(sp) +EdClo bsr Ed_TokCur +; Fenetre linkee? + move.l Edt_LinkPrev(a4),d0 + or.l Edt_LinkNext(a4),d0 + bne.s .Linked +; Pas linkee, fait un new + bsr Ed_New +; Derniere fenetre +.Linked tst.b Edt_First(a4) Derniere fenetre? + beq.s .Closit + tst.b Edt_Last(a4) + beq.s .Closit + tst.w (sp) Quitter? + beq.s .Fini + tst.b Ed_Zappeuse(a5) Pas si zappeuse + bne.s .Fini +; Derniere fenetre: Quit AMOSPRO? +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + btst #0,Ed_QuitFlags(a5) + beq Ed_DoQuit + moveq #EdD_WQuit,d0 + bsr Ed_Dialogue + cmp.w #1,d0 + beq Ed_DoQuit + bra.s .Fini +; Ferme la fenetre +; ~~~~~~~~~~~~~~~~ +.Closit bsr Edt_EffWindows + bsr Edt_DelWindow + moveq #-1,d0 + bsr Edt_WMaxSize + move.w d0,Edt_WindTy(a4) + bsr Ed_DrawWindows +.Fini addq.l #2,sp + rts + +; +; Ferme un programme cachïż½ +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_NewHidden + bsr Ed_TokCur + bsr Ed_GetHidden + beq Ed_NotDone + move.l a0,a4 + move.l Edt_Prg(a4),a6 + bsr Ed_Saved + bsr Edt_DelWindow + bsr EdM_BranchAMOS + rts + +; +; Ferme TOUS les programmes cachïż½s +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_NewAllHidden + bsr Ed_TokCur + moveq #EdD_NAll,d0 + bsr Ed_Dialogue + cmp.w #1,d0 + bne Ed_Loop + bra.s .In +.Loop move.l a0,a4 + move.l Edt_Prg(a4),a6 + bsr Ed_Saved + bsr Edt_DelWindow +.In moveq #0,d1 + bsr Ed_GetHidden + bne.s .Loop + bsr EdM_BranchAMOS + rts + +; +; Montre un programme cachïż½ +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_EditHidden + bsr Ed_TokCur + bsr Ed_GetHidden + beq Ed_NotDone + move.l a0,-(sp) + sub.l a0,a0 + bsr Edt_WCount Nombre de fenetres ouvertes + cmp.w Ed_WMax(a5),d0 + bcc Ed_2ManyWindow + move.l (sp)+,a4 + move.l a4,Edt_Current(a5) + move.l Edt_Prg(a4),a6 + clr.b Edt_Hidden(a4) + moveq #1,d0 + bsr Edt_WSchrinkAll Reduit toutes les fenetres + moveq #-1,d0 + bsr Edt_WMaxSize + move.w d0,Edt_WindTy(a4) + bsr Prg_UndoCreate Cree le buffer UNDO + bsr Ed_DrawWindows + bsr EdM_BranchAMOS + rts + +; +; Trouve le programme cachïż½ en venant de l'appel des fonctions +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +; D1= Numero du programme +Ed_GetHidden + move.l Edt_List(a5),d0 +.Loop move.l d0,a0 + tst.b Edt_Hidden(a0) + beq.s .Next + subq.w #1,d1 + bmi.s .Ok +.Next move.l Edt_Next(a0),d0 + bne.s .Loop + rts +.Ok move.l a0,d0 + rts + +; +; Efface une structure fenetre quelconque (A4) +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Edt_DelWindow + +; Ferme la structure programme +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + move.l Edt_Prg(a4),d0 + beq.s .NoProg + move.l d0,a6 +; Si derniere fenetre sur le programme, enleve la structure + subq.b #1,Prg_Edited(a6) + bne.s .NoProg + bsr EdM_Program + JJsr L_Prg_DelStructure + bsr Prg_UndoFree +.NoProg + +; Ferme la fenetre Editeur +; ~~~~~~~~~~~~~~~~~~~~~~~~ + cmp.l Edt_Current(a5),a4 + bne.s .Split + move.l a4,a0 Qui suit + bsr Edt_WNext + bne.s .Link + move.l a4,a0 Qui precede + bsr Edt_WPrev +.Link move.l Edt_LinkPrev(a4),d1 Linke? + bne.s .Skp + move.l Edt_LinkNext(a4),d1 + beq.s .Act +.Skp move.l d1,d0 +.Act move.l d0,Edt_Current(a5) +; Enleve les SPLITS +.Split move.l Edt_LinkNext(a4),d0 + move.l d0,a0 + beq.s .Skip1 + move.l Edt_LinkPrev(a4),Edt_LinkPrev(a0) +.Skip1 move.l Edt_LinkPrev(a4),d0 + beq.s .Scrol + move.l d0,a0 + move.l Edt_LinkNext(a4),Edt_LinkNext(a0) +; Enleve les links de scroll sur cette fenetre +.Scrol move.l a4,a0 + bsr Edt_DelLinkScroll +; Enleve les zones de cette fenetre + bsr Edt_DelZones +; Enleve de la liste + move.l Edt_List(a5),d0 + cmp.l d0,a4 + beq.s .First +.Loop move.l d0,a0 + move.l Edt_Next(a0),d0 + cmp.l d0,a4 + bne.s .Loop + move.l Edt_Next(a4),Edt_Next(a0) + bra.s .End +.First move.l Edt_Next(a4),Edt_List(a5) +.End move.l #Edt_Long,d0 Efface la structure + move.l a4,a1 + SyCall SyFree +; Prend la fenetre active maintenant +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + sub.l a4,a4 + sub.l a6,a6 + move.l Edt_Current(a5),d0 + beq.s .Ss + move.l d0,a4 + move.l Edt_Prg(a4),a6 +.Ss rts + +; Efface toutes les fenetres editeur +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Edt_DelWindows + movem.l a4/a6,-(sp) +.Loop move.l Edt_List(a5),d0 + beq.s .End + move.l d0,a4 + bsr Edt_DelWindow + bra.s .Loop +.End movem.l (sp)+,a4/a6 + rts + +; +; Dessine les fenetres editeur +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_DrawWindows + + movem.l a2-a4/d2-d7,-(sp) + + bsr Ed_CuOff + bsr Ed_AllAverFin + bsr Edt_EffWindows + bsr Edt_OrderWindows + bsr Edt_WFirstLast + +; +; Boucle de dessin des programmes +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + move.l Ed_BufE(a5),-(sp) + move.w #16+Ed_YTop,-(sp) + move.l Edt_List(a5),a4 + +.PLoop + move.l Edt_Prg(a4),a6 +; Programme visible? +; ~~~~~~~~~~~~~~~~~~ + tst.b Edt_Hidden(a4) + bne .NextP +; Pas plus loin que la longueur du programme + move.w Edt_YCu(a4),d0 + add.w Edt_YPos(a4),d0 + cmp.w Prg_NLigne(a6),d0 + ble.s .Sl + clr.w Edt_YCu(a4) + clr.w Edt_YPos(a4) +; Centre le curseur dans la fenetre +.Sl move.w Edt_YCu(a4),d0 + move.w Edt_WindTy(a4),d1 + subq.w #1,d1 + bmi.s .Dedans + cmp.w d1,d0 + bls.s .Dedans + move.w d1,Edt_YCu(a4) + sub.w d1,d0 + add.w d0,Edt_YPos(a4) +.Dedans +; +; Numero fenetre >>> numero zones + move.w Edt_Order(a4),d0 + lsl.w #3,d0 + move.w d0,Edt_Zones(a4) + move.w d0,Edt_Window(a4) + addq.w #1,d0 + move.w d0,Edt_WindEtat(a4) +; +; Tailles / Positions de la fenetre + move.w (sp),d7 + move.w d7,Edt_Y(a4) + move.w #0,Edt_WindX(a4) + move.w d7,Edt_WindY(a4) + add.w #Edt_EtatSy,Edt_WindY(a4) + moveq #32,d1 + move.w d1,Edt_WindEX(a4) + move.w Ed_Sx(a5),d0 + sub.w d1,d0 + sub.w #64,d0 + move.w d0,Edt_WindESx(a4) + move.w d7,Edt_WindEY(a4) + addq.w #1,Edt_WindEY(a4) + move.w Ed_Sx(a5),d0 + sub.w #16,d0 + move.w d0,Edt_WindSx(a4) + lsr.w #3,d0 + move.w d0,Edt_WindTx(a4) + move.w Edt_WindTy(a4),d0 + lsl.w #3,d0 + move.w d0,Edt_WindSy(a4) + add.w #Edt_EtatSy+Edt_BasSy,d0 + move.w d0,Edt_Sy(a4) + move.w Edt_WindTy(a4),d6 + + move.w Edt_WindY(a4),d0 + add.w Edt_WindSy(a4),d0 + move.w d0,Edt_BasY(a4) + + move.w Edt_Zones(a4),Edt_ZEtat(a4) + addq.w #1,Edt_ZEtat(a4) + move.w Edt_Zones(a4),Edt_ZBas(a4) + addq.w #2,Edt_ZBas(a4) + +; Initialisation du slider vertical +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +; Position / Taille + move.w Edt_WindX(a4),d0 + add.w Edt_WindSx(a4),d0 + add.w #Ed_SlVDeltaG,d0 + move.w d0,Edt_SlV+Sl_X(a4) + move.w d7,Edt_SlV+Sl_Y(a4) + add.w #Ed_SlVDeltaH,Edt_SlV+Sl_Y(a4) + move.w #Ed_SlVSx,Edt_SlV+Sl_Sx(a4) + move.w Edt_WindSy(a4),d0 + add.w #Ed_SlVDeltaB,d0 + move.w d0,Edt_SlV+Sl_Sy(a4) + move.w Edt_WindTy(a4),Edt_SlV+Sl_Scroll(a4) + sub.w #2,Edt_SlV+Sl_Scroll(a4) + move.w #Ed_SlVDx,Edt_SlV+Sl_ZDx(a4) +; Zone + move.w Edt_Zones(a4),Edt_SlV+Sl_Zone(a4) + addq.w #3,Edt_SlV+Sl_Zone(a4) +; Adresses des routines + lea Edt_SliderY(pc),a1 + move.l a1,Edt_SlV+Sl_Routines(a4) + bset #Sl_FlagVertical,Edt_SlV+Sl_Flags(a4) +; Couleurs active / inactive + moveq #19,d0 + bsr Ed_GetSysteme + move.l a0,a1 + lea Edt_SlV+Sl_Inactive(a4),a0 + moveq #16-1,d0 +.Co moveq #0,d1 + move.b (a1)+,d1 + move.w d1,(a0)+ + dbra d0,.Co + +; Initialisation des boutons +; ~~~~~~~~~~~~~~~~~~~~~~~~~~ + move.w Ed_Sx(a5),d0 + sub.w #Edt_BtSx,d0 + move.w d0,Edt_Bt3+Bt_X(a4) + sub.w #Edt_BtSx,d0 + move.w d0,Edt_Bt2+Bt_X(a4) + clr.w Edt_Bt1+Bt_X(a4) + move.w Edt_Y(a4),d1 + move.w d1,Edt_Bt1+Bt_Y(a4) + move.w d1,Edt_Bt2+Bt_Y(a4) + move.w d1,Edt_Bt3+Bt_Y(a4) +; Prepare les boutons + moveq #Ed_BtPics,d0 + move.w Edt_Zones(a4),d1 + addq.w #4,d1 + moveq #2,d2 + lea Edt_Bt1(a4),a1 +.BLoop move.w Edt_Window(a4),Bt_Number(a1) + addq.w #1,d1 + move.w d1,Bt_Zone(a1) + move.w d0,Bt_Image(a1) + move.b #24,Bt_Sx(a1) + move.b #Edt_EtatSy,Bt_Sy(a1) + lea Bt_RoutIn(pc),a0 + move.l a0,Bt_Routines(a1) + move.b #6,Bt_RDraw(a1) + addq.w #2,d0 + lea Bt_Long(a1),a1 + dbra d2,.BLoop +; Routines de branchement boutons + move.b #1,Edt_Bt1+Bt_RChange(a4) + move.b #2,Edt_Bt2+Bt_RChange(a4) + move.b #3,Edt_Bt3+Bt_RChange(a4) +; +; Fond de l'image +; ~~~~~~~~~~~~~~~ +; Unpack le haut + moveq #Ed_Pics+1,d0 + moveq #0,d1 + move.w d7,d2 + moveq #-1,d3 + bsr Ed_Unpack + move.w d7,d0 + add.w #11,d7 + move.w d7,d1 + bsr Ed_Enlarge + tst.w d6 + beq.s .Skip0 +.Loop1 moveq #Ed_Pics+2,d0 + move.w Ed_Sx(a5),d1 + sub.w #16,d1 + ext.l d1 + move.w d7,d2 + moveq #-1,d3 + bsr Ed_Unpack + addq.w #8,d7 + subq.w #1,d6 + bne.s .Loop1 +; Met le bas +.Skip0 moveq #Ed_Pics+3,d0 + moveq #0,d1 + move.w d7,d2 + moveq #-1,d3 + bsr Ed_Unpack + move.w d7,d0 + addq.w #5,d7 + move.w d7,d1 + bsr Ed_Enlarge + move.w d7,(sp) +; Initialise la fenetre d'etat + move.w Edt_WindEtat(a4),d1 + move.w Edt_WindEX(a4),d2 + move.w Edt_WindEY(a4),d3 + move.w Edt_WindESx(a4),d4 + lsr.w #3,d4 + moveq #1,d5 + moveq #0,d6 + moveq #0,d7 + sub.l a1,a1 + WiCall WindOp + bsr Ed_EtPrint + move.w Edt_ZEtat(a4),d1 + move.w Edt_WindEX(a4),d2 + move.w Edt_WindEY(a4),d3 + move.w d2,d4 + move.w d3,d5 + add.w Edt_WindESx(a4),d4 + add.w #Edt_EtatSy,d5 + SyCall SetZone +; Initialise la zone du bas + move.w Edt_ZBas(a4),d1 + moveq #0,d2 + move.w Edt_BasY(a4),d3 + move.w d2,d4 + move.w d3,d5 + add.w Ed_Sx(a5),d4 + add.w #Edt_BasSy,d5 + SyCall SetZone +; Initialise la fenetre de fond, si pas vide + tst.w Edt_WindTy(a4) + beq .Vide + move.w Edt_Window(a4),d1 + move.w Edt_WindX(a4),d2 + move.w Edt_WindY(a4),d3 + move.w Edt_WindTx(a4),d4 + move.w Edt_WindTy(a4),d5 + moveq #0,d6 + moveq #0,d7 + sub.l a1,a1 + WiCall WindOp + moveq #20,d0 + bsr Ed_GetSysteme + move.l a0,a1 + WiCall Print + bsr Ed_CuNor + move.w Edt_Zones(a4),d1 + move.w Edt_WindX(a4),d2 + move.w Edt_WindY(a4),d3 + move.w d2,d4 + move.w d3,d5 + add.w Edt_WindSx(a4),d4 + add.w Edt_WindSy(a4),d5 + SyCall SetZone + bsr Edt_SlUpdateY + lea Edt_SlV(a4),a0 + JJsrR L_Sl_Init,a1 + clr.b Edt_ASlY(a4) +; +; Affiche le texte +; ~~~~~~~~~~~~~~~~ + move.l 2(sp),d0 + move.l d0,Edt_BufE(a4) + move.w Edt_WindTy(a4),d0 + mulu #256,d0 + add.l d0,2(sp) + bsr Ed_NewBuf +.Vide +; +; Active les boutons +; ~~~~~~~~~~~~~~~~~~ + lea Edt_Bt1(a4),a0 + moveq #0,d0 + JJsrR L_Bt_InitList,a1 +; +; Programme suivant? +; ~~~~~~~~~~~~~~~~~~ +.NextP move.l Edt_Next(a4),d0 + move.l d0,a4 + bne .PLoop +; +; Active le premier programme +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~ + move.l Edt_Current(a5),a4 + move.l Edt_Prg(a4),a6 + move.w Edt_Window(a4),d1 + WiCall QWindow + bsr Ed_Loca +; Fini! +; ~~~~~ + addq.l #6,sp + movem.l (sp)+,a2-a4/d2-d7 + rts + +; +; Boucle d'effacement des fenetres +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Edt_EffWindows + move.l a4,-(sp) + move.l Edt_List(a5),d0 + beq.s .Out +.ELoop move.l d0,a4 + tst.w Edt_Window(a4) Initialisee? + beq.s .ENext + cmp.b #2,Edt_Hidden(a4) Deja fermee? + beq.s .ENext + cmp.b #1,Edt_Hidden(a4) + bne.s .Cl + move.b #2,Edt_Hidden(a4) On ferme! +; Ferme les anciennes fenetres +.Cl move.w Edt_Window(a4),d1 + WiCall QWindow + WiCall WinDel + move.w Edt_WindEtat(a4),d1 + WiCall QWindow + WiCall WinDel +; Efface les zones + bsr Edt_DelZones +; Fenetre non initialisee + clr.w Edt_Window(a4) +; Fenetre suivante +.ENext move.l Edt_Next(a4),d0 + bne.s .ELoop +.Out move.l (sp)+,a4 + rts +; +; Numerote les fenetres affichees +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Edt_OrderWindows + moveq #1,d1 + move.l Edt_List(a5),d0 + beq.s .Out +.Loop move.l d0,a0 + tst.b Edt_Hidden(a0) + bne.s .Hid + move.w d1,Edt_Order(a0) + addq.w #1,d1 +.Hid move.l Edt_Next(a0),d0 + bne.s .Loop +.Out rts + +; +; Enleve toutes les zones de toutes les fenetres +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Edt_DelAllZones + move.l Edt_List(a5),d0 + beq.s .Skip +.Loop move.l d0,a0 + clr.w Edt_Zones(a0) + move.l Edt_Next(a0),d0 + bne.s .Loop +.Skip rts + +; +; Enleve les zones de la fenetre A4 +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Edt_DelZones + move.w Edt_Zones(a4),d2 + beq.s .NIni + moveq #7,d3 +.Zraz move.w d2,d1 + SyCall RazZone + addq.w #1,d2 + dbra d3,.Zraz + clr.w Edt_Zones(a4) +.NIni rts + +; +; Si la fenetre courante est vide, active la suivante +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Edt_WVideNext + move.l Edt_Current(a5),a0 + tst.w Edt_WindTy(a0) + beq.s Edt_WAutre2 + rts +; Active une autre fenetre que la courante +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Edt_WAutre + move.l a4,a0 +Edt_WAutre2 + moveq #1,d1 +Edt_WAutre3 +; Prend la fenetre suivante +.Loop1 bsr Edt_WNext + beq.s .Loop2 + move.l d0,a0 + cmp.w Edt_WindTy(a0),d1 + bgt.s .Loop1 + bra.s .Exit +; Prend la fenetre prïż½cedente +.Loop2 bsr Edt_WPrev + beq.s .Skip + move.l d0,a0 + cmp.w Edt_WindTy(a0),d1 + bgt.s .Loop2 +.Exit move.l a0,Edt_Current(a5) + move.l a0,a4 + move.l Edt_Prg(a4),a6 +.Skip rts + +; +; Routine de bougeation de la sïż½paration +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_MSep + move.w d0,-(sp) + move.w d1,-(sp) + move.w d2,-(sp) + move.w d3,-(sp) + bsr XYMouEced + move.w (sp)+,d0 + sub.w d0,d2 + move.w d2,-(sp) Decalage souris/bloc + move.w d0,-(sp) Ancien bloc + move.w d0,-(sp) Nouveau bloc +; Fabrique le bloc de dessin + moveq #0,d2 + move.w (sp),d3 + ext.l d3 + move.w Ed_Sx(a5),d4 + move.w 10(sp),d5 + ext.l d5 + moveq #0,d6 + move.l Ed_BufT(a5),a1 + move.w #128,d1 + EcCall BlGet +.Loop0 +; Fabrique le bloc de sauvegarde + moveq #0,d2 + move.w (sp),d3 + ext.l d3 + move.w Ed_Sx(a5),d4 + move.w 10(sp),d5 + ext.l d5 + moveq #0,d6 + move.l Ed_BufT(a5),a1 + move.l #129,d1 + EcCall BlGet + move.w (sp),2(sp) +; Dessine l'image + moveq #0,d2 + move.w (sp),d3 + ext.l d3 + move.l #EntNul,d4 + move.l d4,d5 + move.l Ed_BufT(a5),a1 + move.w #128,d1 + EcCall BlPut +; Prend la souris +.Loop1 SyCall MouseKey + btst #0,d1 + beq.s .Skip + bsr XYMouEced + sub.w 4(sp),d2 + cmp.w 8(sp),d2 + bge.s .In1 + move.w 8(sp),d2 +.In1 cmp.w 6(sp),d2 + ble.s .In2 + move.w 6(sp),d2 +.In2 cmp.w (sp),d2 + beq.s .Loop1 + move.w d2,(sp) +; Efface l'ancien +.Skip moveq #0,d2 + move.w 2(sp),d3 + ext.l d3 + move.l #EntNul,d4 + move.l d4,d5 + move.l Buffer(a5),a1 + move.w #129,d1 + EcCall BlPut +; Lache la souris? + SyCall MouseKey + btst #0,d1 + bne .Loop0 +; Efface les bloc + move.w #128,d1 + EcCall BlDel + move.w #129,d1 + EcCall BlDel +; Fini + move.w (sp)+,d0 + lea 10(sp),sp + rts + +; +; XY Mouse dans l'ecran courant +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +XYMouEced + SyCall XyMou + moveq #0,d3 + SyCall XyScr + rts +; +; Active la fenetre A0, si on peut +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Edt_Active + bsr Ed_TokCur + tst.w Edt_WindTy(a0) + beq.s .Out +; Inactive la fenetre courante + move.l a0,Edt_Current(a5) + clr.b Edt_ASlY(a4) + bsr Ed_AffSlV + bsr Ed_EtPrint +; Active la nouvelle + move.l Edt_Current(a5),a4 + move.l Edt_Prg(a4),a6 + bsr Ed_NewBufAff + moveq #-1,d0 +.Out rts + +; +; Passage ïż½ la fenetre suivante (ouverte) +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_NextWindow + bsr Ed_TokCur + move.l a4,a0 +.Loop bsr Edt_WNext + bne.s .Skip + move.l Edt_List(a5),a0 +.Skip cmp.l a4,a0 + beq.s .Out + move.l a0,-(sp) + bsr Edt_Active + move.l (sp)+,a0 + beq.s .Loop +.Out rts +; +; Passage ïż½ la fenetre precedente (ouverte) +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_PrevWindow + bsr Ed_TokCur + move.l a4,a0 +.Loop bsr Edt_WPrev + bne.s .Skip + tst.b Edt_Last(a4) + bne.s .Out + move.l a4,d0 +.Loop2 move.l d0,a0 + bsr Edt_WNext + bne.s .Loop2 + move.l a0,d0 +.Skip cmp.l a4,d0 + beq.s .Out + move.l d0,a0 + move.l d0,-(sp) + bsr Edt_Active + move.l (sp)+,a0 + beq.s .Loop +.Out rts + +; +; Ferme/Ouvre la fenetre courante +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_FlipSizeWindow + bsr Ed_TokCur + move.w Edt_WindTy(a4),d1 + beq.s .Big + move.w d1,Edt_WindOldTy(a4) + moveq #0,d0 + bsr Ed_SchrinkWindow + rts +; Agrandi? +.Big move.w Edt_WindOldTy(a4),d0 + bne.s .Skip + moveq #1,d0 + bsr Edt_WMaxSize +.Skip move.w d0,Edt_WindTy(a4) + moveq #1,d1 + bsr Edt_WPlaceBas + beq.s .Out + moveq #1,d1 + bsr Edt_WPlaceHaut + beq.s .Out + sub.w d0,Edt_WindTy(a4) +.Out bsr Ed_DrawWindows + rts + +; Fenetre courante aussi grande que possible +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_BiggerWindow + bsr Ed_TokCur + bsr Edt_WAlone + bne.s .Out + moveq #0,d0 + bsr Edt_WSchrinkAll + add.w d0,Edt_WindTy(a4) + bsr Ed_DrawWindows +.Out rts +; +; Agrandi la fenetre courante +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_ExpandWindow + bsr Ed_TokCur + bsr Edt_WAlone + bne.s .Out + moveq #1,d0 + bsr Edt_WSchrinkAll + add.w d0,Edt_WindTy(a4) + bsr Ed_DrawWindows +.Out rts +; +; Reduit la fenetre courante, D0=valeur mini +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_SchrinkWindow + bsr Ed_TokCur + bsr Edt_WAlone + bne.s .Out + move.w Edt_WindTy(a4),d2 + cmp.w d2,d0 + bcc.s .Out + move.w d0,Edt_WindTy(a4) + sub.w d0,d2 +; Retreci en haut + move.l a4,a0 + bsr Edt_WNext + beq.s .Bas + move.l d0,a0 + add.w d2,Edt_WindTy(a0) + bra.s .Aff +; Retreci en bas +.Bas move.l a4,a0 + bsr Edt_WPrev + move.l d0,a0 + add.w d2,Edt_WindTy(a0) +; Affiche +.Aff bsr Edt_WVideNext + bsr Ed_DrawWindows +.Out rts + +; +; Ramene VRAI si la fenetre est la seule sur l'ecran +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Edt_WAlone + tst.b Edt_First(a4) + beq.s .Out + tst.b Edt_Last(a4) +.Out rts + +; +; Changement en haut de la fenetre +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Edt_WChangeHaut + and.w #$FFF8,d0 + move.w d0,d2 + cmp.w Edt_Y(a4),d0 + beq.s .Rien + tst.b Edt_Last(a4) + bne.s .Last +; Une fenetre au milieu, bouge tout + sub.w Edt_Y(a4),d0 + beq.s .Rien + move.w Edt_BasY(a4),d3 + add.w d0,d3 + bra Edt_WChange +; La derniere, juste le haut +.Last move.w Edt_BasY(a4),d3 + add.w #Edt_EtatSy,d0 + cmp.w d0,d3 + bcc Edt_WChange + move.w d0,d3 + bra Edt_WChange +.Rien rts + +; Changement en bas de la fenetre +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Edt_WChangeBas + addq.w #Edt_BasSy,d0 + and.w #$FFF8,d0 + subq.w #Edt_BasSy,d0 + cmp.w Edt_BasY(a4),d0 + beq.s .Rien + move.w d0,d3 + move.w Edt_Y(a4),d2 + sub.w #Edt_EtatSy,d0 +.Skip cmp.w d2,d0 + bcc.s Edt_WChange + move.w d0,d2 + bra.s Edt_WChange +.Rien rts +; Calcule la nouvelle taille de la fenetre +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Edt_WChange + move.w d3,d0 + sub.w d2,d0 + sub.w #Edt_EtatSy,d0 + lsr.w #3,d0 + move.w d0,Edt_WindTy(a4) +; Modifications en haut +; ~~~~~~~~~~~~~~~~~~~~~ + move.w Edt_Y(a4),d0 + move.w d2,Edt_Y(a4) + cmp.w d0,d2 + beq.s .Bas + bcc.s .HBas +; On remonte le haut + sub.w d2,d0 + lsr.w #3,d0 + moveq #1,d1 + bsr Edt_WPlaceHaut + beq.s .Bas + moveq #0,d1 + bsr Edt_WPlaceHaut + bra.s .Bas +; On descend le haut +.HBas sub.w d0,d2 + lsr.w #3,d2 + move.l a4,a0 + bsr Edt_WPrev + move.l d0,a0 + add.w d2,Edt_WindTy(a0) +; Modifications en bas? +; ~~~~~~~~~~~~~~~~~~~~~ +.Bas move.w Edt_BasY(a4),d0 + move.w d3,Edt_BasY(a4) + cmp.w d0,d3 + beq.s .Fini + bcc.s .BBas +; On remonte le bas + sub.w d3,d0 + lsr.w #3,d0 + move.w d0,d3 + move.l a4,a0 + bsr Edt_WNext + move.l d0,a0 + add.w d3,Edt_WindTy(a0) + bra.s .Fini +; On descend le bas +.BBas sub.w d0,d3 + lsr.w #3,d3 + move.w d3,d0 + moveq #1,d1 + bsr Edt_WPlaceBas + beq.s .Fini + moveq #0,d1 + bsr Edt_WPlaceBas +; Ouf +; ~~~ +.Fini moveq #-1,d0 + rts + +; +; Fait D0 lignes de place en haut de A4, minimum D1 +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Edt_WPlaceHaut + move.w d2,-(sp) + move.w d1,d2 + move.w d0,d1 + move.l a4,a0 +.Loop bsr Edt_WPrev + beq.s .Out + move.l d0,a0 + cmp.w Edt_WindTy(a0),d2 + bge.s .Loop + sub.w Edt_WindTy(a0),d1 + bcs.s .Ok + add.w d2,d1 + move.w d2,Edt_WindTy(a0) + bra.s .Loop +.Ok neg.w d1 + move.w d1,Edt_WindTy(a0) + moveq #0,d1 +.Out move.w (sp)+,d2 + move.w d1,d0 + rts +; +; Fait D0 lignes de place en bas de A4 +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Edt_WPlaceBas + move.w d2,-(sp) + move.w d1,d2 + move.l d0,d1 + move.l a4,a0 +.Loop bsr Edt_WNext + beq.s .Out + move.l d0,a0 + cmp.w Edt_WindTy(a0),d2 + bge.s .Loop + sub.w Edt_WindTy(a0),d1 + bcs.s .Ok + add.w d2,d1 + move.w d2,Edt_WindTy(a0) + bra.s .Loop +.Ok neg.w d1 + move.w d1,Edt_WindTy(a0) + moveq #0,d1 +.Out move.w (sp)+,d2 + move.w d1,d0 + rts + +; +; Verifie la validite des WindTy +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +;Edt_WOk +; move.l Prg_List(a5),a0 +; moveq #Ed_TitreSy,d0 +;.Loop tst.b Edt_Hidden(a0) +; bne.s .Skip +; add.w #Edt_EtatSy+Edt_BasSy,d0 +; move.w Edt_WindTy(a0),d1 +; lsl.w #3,d1 +; add.w d1,d0 +;.Skip move.l Edt_Next(a0),d1 +; move.l d1,a0 +; bne.s .Loop +;; Verification +; cmp.w Ed_Sy(a5),d0 +; rts + +; +; Trouve l'adresse d'une fenetre +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Edt_GetAd + move.l Edt_List(a5),d1 + beq.s .Out +.Loop move.l d1,a0 + cmp.w Edt_Window(a0),d0 + beq.s .Out + move.l Edt_Next(a0),d1 + move.l d1,a0 + bne.s .Loop + moveq #0,d0 + rts +.Out moveq #-1,d1 + rts +; +; Calcule les flags first et last +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Edt_WFirstLast + move.l Edt_List(a5),d0 + beq.s .Out + moveq #0,d1 +.Loop move.l d0,a0 + clr.b Edt_First(a0) + clr.b Edt_Last(a0) + tst.b Edt_Hidden(a0) + bne.s .Next + tst.l d1 + bne.s .Skip + addq.b #1,Edt_First(a0) +.Skip move.l a0,d1 +.Next move.l Edt_Next(a0),d0 + bne.s .Loop + move.l d1,a0 + addq.b #1,Edt_Last(a0) +.Out rts +; +; Compte le nombre de fenetres affichees >>> A0 +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Edt_WCount + moveq #0,d0 + move.l Edt_List(a5),d1 + beq.s .Out +.Loop move.l d1,a1 + tst.b Edt_Hidden(a1) + bne.s .Skip + addq.w #1,d0 +.Skip cmp.l d1,a0 + beq.s .Out + move.l Edt_Next(a1),d1 + bne.s .Loop +.Out rts +; +; +; Reduit toutes les fenetres ïż½ la taille D0 +; Retourne le gain en taille +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Edt_WSchrinkAll + move.l d2,-(sp) + move.w d0,d1 + moveq #0,d0 + move.l Edt_List(a5),d2 + beq.s .Out +.Loop move.l d2,a0 + tst.b Edt_Hidden(a0) + bne.s .Skip + cmp.w Edt_WindTy(a0),d1 + bcc.s .Skip + add.w Edt_WindTy(a0),d0 + sub.w d1,d0 + move.w d1,Edt_WindTy(a0) +.Skip move.l Edt_Next(a0),d2 + bne.s .Loop +.Out move.l (sp)+,d2 + rts +; +; Ramene la fenetre affichïż½e precedent A0 +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Edt_WPrev + movem.l d1/a1,-(sp) + moveq #0,d0 + move.l Edt_List(a5),d1 + beq.s .Out +.Loop cmp.l a0,d1 + beq.s .Out + move.l d1,a1 + tst.b Edt_Hidden(a1) + bne.s .Next + move.l a1,d0 +.Next move.l Edt_Next(a1),d1 + bne.s .Loop +.Out movem.l (sp)+,d1/a1 + tst.l d0 + rts +; +; Ramene la fenetre affiche suivant A0 +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Edt_WNext + movem.l d1/a1,-(sp) + moveq #0,d0 +.Next move.l Edt_Next(a0),d1 + beq.s .Out + move.l d1,a0 + tst.b Edt_Hidden(a0) + bne.s .Next + move.l a0,d0 +.Out movem.l (sp)+,d1/a1 + tst.l d0 + rts +; +; Ramene la taille maximum admissible pour la fenetre courante +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +; Entree, D0>=0 si taille reduite ïż½ D0 +; D0<1 si taille sans reduire les autres +; D0= WindTy +; D1= WindY +; D2= WindSy +Edt_WMaxSize + move.w d0,-(sp) + moveq #0,d1 + moveq #Ed_TitreSy,d2 +; Exploration de la liste + move.l Edt_List(a5),d0 + beq.s .Exit +.Loop move.l d0,a0 + cmp.l a0,a4 Stocke position fenetre courante + bne.s .Skip0 + move.w d2,d1 + add.w #Edt_EtatSy+Edt_BasSy,d2 + bra.s .Skip2 +.Skip0 tst.b Edt_Hidden(a0) + bne.s .Skip2 + add.w #Edt_EtatSy+Edt_BasSy,d2 + move.w Edt_WindTy(a0),d0 + tst.w (sp) + bmi.s .Skip1 + cmp.w (sp),d0 + bls.s .Skip1 + move.w (sp),d0 +.Skip1 lsl.w #3,d0 + add.w d0,d2 +.Skip2 move.l Edt_Next(a0),d0 + bne.s .Loop +; Calcule la taille +.Exit addq.l #2,sp + move.w Ed_Sy(a5),d0 + sub.w d2,d0 + move.w d1,d2 + add.w d0,d2 + add.w #Edt_EtatSy+Edt_BasSy,d2 + asr.w #3,d0 + rts + +; __________________________________________________________________________ +; +; Creation du menu +; __________________________________________________________________________ +; + +; Effacement de tous les menus +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +EdM_End + bsr EdM_Editor + JJsr L_MnRaz + move.l EdM_Table(a5),d0 + beq.s .Skip + clr.l EdM_Table(a5) + move.l d0,a1 + move.l EdM_TableSize(a5),d0 + SyCall MemFree +.Skip rts + +; +; Erreur, on ne peut pas ouvrir les menus +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +EdM_Error + move.w #185,d0 Out of memory: cannot open menu + bsr Ed_GetMessage + move.w #1,d0 Relache tout de suite! + bsr Ed_AlertRts + JJsr L_Dia_NoMKey Plus de touche souris + rts + +; Initialisation generale des menus +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +EdM_Init + movem.l d2-d7/a2-a6,-(sp) + +; Enleve les anciens menus +; ~~~~~~~~~~~~~~~~~~~~~~~~ + bsr EdM_End + +; Assez de memoire? +; ~~~~~~~~~~~~~~~~~ + bsr Ed_Available 40k minimum! + cmp.l #40*1024,d0 + bcs .Error + +; Reserve la table +; ~~~~~~~~~~~~~~~~ + move.l #EdM_HiddenMax*8*5+16,d0 Menus hiddens + add.l #EdM_UserMax*8+8,d0 + move.l EdM_Definition(a5),a0 Definitions normals + add.l -4(a0),d0 + add.l #16,d0 Un chouuya de securite + move.l d0,EdM_TableSize(a5) + SyCall MemFastClear + move.l a0,EdM_Table(a5) + beq .Error + +; Reset des definitions +; ~~~~~~~~~~~~~~~~~~~~~ + clr.w MnMouse(a5) + lea MnDFlags(a5),a0 + moveq #0,d0 * Barre de menu +* bset #MnBar,d0 + bset #MnTotal,d0 +* bset #MnBouge,d0 +* bset #MnTBouge,d0 + move.b d0,(a0)+ + moveq #0,d0 + bset #MnBar,d0 +* bset #MnBouge,d0 +* bset #MnTBouge,d0 + moveq #MnNDim-1-1,d1 * Autres dimensions +.DRex3 move.b d0,(a0)+ + dbra d1,.DRex3 + moveq #MnNDim-1,d0 + lea MnChoix(a5),a0 +.DRex4 clr.w (a0)+ + dbra d0,.DRex4 + move.l T_EcAdr+EcEdit*4(a5),MnAdEc(a5) +* move.w #1,MnMouse(a5) + +; Creation de l'arbre de menu +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~ + move.l EdM_Definition(a5),a2 + move.l EdM_Table(a5),a3 + move.l EdM_Messages(a5),a4 + addq.l #2,a4 +.MnCr bsr EdM_CreObjet + addq.l #8,a2 + add.w d4,a4 + cmp.b #"*",(a2) + bne.s .MnCr + addq.l #8,a2 + move.l a2,EdM_MenuAMOS(a5) + move.l a4,EdM_MessAMOS(a5) + +; Cree la branche de menu USER +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + move.l EdM_User(a5),d0 + beq .PaUser + move.l d0,a4 + addq.l #2,a4 +; Cree les objets user +; ~~~~~~~~~~~~~~~~~~~~ + moveq #1,d7 Premier programme +.Loop move.l Ed_BufT(a5),a2 + move.l a2,a1 + move.b d7,(a1) Met les donnees + add.b #"0"+EdM_UserCommands-1,(a1)+ + move.b #"3",(a1)+ + move.b #"0",(a1)+ + move.b #"1",(a1)+ + move.b #"7",(a1)+ + move.b d7,(a1) + add.b #"0",(a1)+ + move.b #"0",(a1)+ + move.b #"0",(a1)+ + clr.b (a1) + move.l a4,-(sp) +; Met la chaine au propre +; ~~~~~~~~~~~~~~~~~~~~~~~ + tst.b (a4) + beq.s .Cree + lea 8(a2),a0 + moveq #EdM_UserLong-1,d0 +.Lp1 move.b #" ",(a0)+ + dbra d0,.Lp1 + clr.b (a0) + lea 9(a2),a0 + moveq #EdM_UserLong-2-1,d0 +.Lp2 move.b (a4)+,d1 + beq.s .Cree + move.b d1,(a0)+ + dbeq d0,.Lp2 +; Va fabriquer l'objet +; ~~~~~~~~~~~~~~~~~~~~ +.Cree lea 8(a2),a4 + bsr EdM_CreObjet + move.l (sp)+,a4 + moveq #2,d4 + add.b -1(a4),d4 + tst.b (a4) + beq.s .PaOb + move.l a4,d0 + sub.l EdM_User(a5),d0 + neg.w d0 + move.w d0,-4(a3) +; Encore un objet? +; ~~~~~~~~~~~~~~~~ +.PaOb add.w d4,a4 + addq.w #1,d7 + cmp.w #EdM_UserMax,d7 + ble.s .Loop +.PaUser + +; Va creer la branche AMOS +; ~~~~~~~~~~~~~~~~~~~~~~~~ + move.l a3,EdM_TableAMOS(a5) + bsr EdM_BranchAMOS + +; Yo, marque les marques +; ~~~~~~~~~~~~~~~~~~~~~~ + bsr EdM_MarkAll + +; Demarrage du menu +; ~~~~~~~~~~~~~~~~~ +.Bug clr.w MnChoice(a5) +; Pas d'erreur... + moveq #0,d0 + bra.s .Out +; Out of memory +.Error bsr EdM_End + moveq #1,d0 +.Out movem.l (sp)+,d2-d7/a2-a6 + rts + +; Compte les programmes caches +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Edt_CountHidden + moveq #0,d0 + move.l Edt_List(a5),d1 + beq.s .Out +.Loop move.l d1,a0 + tst.b Edt_Hidden(a0) + beq.s .Skip + addq.w #1,d0 +.Skip move.l Edt_Next(a0),d1 + bne.s .Loop +.Out rts + +; Previous programs in AMOS menu +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +EdM_PrevHidden + bsr Ed_TokCur + move.w EdM_PosHidden(a5),d0 + beq Ed_NotDone + sub.w #EdM_HiddenMax-1,d0 + bpl.s .Skip + clr.w d0 +.Skip move.w d0,EdM_PosHidden(a5) + bsr EdM_BranchAMOS + rts +; Next programs in AMOS Menu +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +EdM_NextHidden + bsr Ed_TokCur + add.w #EdM_HiddenMax-1,EdM_PosHidden(a5) + bsr EdM_BranchAMOS + rts + +; _____________________________________ +; +; Efface / Cree la branche de menu AMOS +; _____________________________________ +; +EdM_BranchAMOS + movem.l a2-a4/d2-d7,-(sp) + bsr EdM_Editor + tst.l MnBase(a5) Menus definis? + beq .Pamenu +; Efface la branche AMOS +; ~~~~~~~~~~~~~~~~~~~~~~ + move.l Ed_BufT(a5),a3 + addq.l #8,a3 + move.l #1,-(a3) + moveq #1,d5 + JJsr L_MnFind + beq.s .ExistPa + move.l a2,d0 + moveq #0,d5 + JJsr L_MnEff +.ExistPa +; Cree les objets normaux +; ~~~~~~~~~~~~~~~~~~~~~~~ + move.l EdM_MenuAMOS(a5),a2 + move.l EdM_TableAMOS(a5),a3 + movem.l EdM_MessAMOS(a5),a4 +.MnCr move.b #"1",4(a2) + bsr EdM_CreObjet + addq.l #8,a2 + add.l d4,a4 + cmp.b #"*",(a2) + bne.s .MnCr + addq.l #8,a2 + +; Des programmes cachïż½s? +; ~~~~~~~~~~~~~~~~~~~~~~ + moveq #0,d7 Flags ïż½ zero + move.b 4+1(a2),d7 Prend le numero du premier programme + bsr Edt_CountHidden + move.w d0,d1 Pas de programme + beq .EHidden +; Centre au mieux + sub.w #EdM_HiddenMax,d0 + bpl.s .Plus + clr.w EdM_PosHidden(a5) + bra.s .Hidden +.Plus cmp.w EdM_PosHidden(a5),d0 + bcc.s .Hidden + move.w d0,EdM_PosHidden(a5) +; Flags pour les lignes haut / bas +.Hidden move.w EdM_PosHidden(a5),d0 + beq.s .S1 + bset #31,d7 +.S1 add.w #EdM_HiddenMax,d0 + cmp.w d0,d1 + ble.s .S2 + bset #30,d7 +.S2 + +; Cree les objets de programmes +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +; Met le titre + move.b #"1",4(a2) + move.b d7,4+1(a2) + bsr EdM_CreObjet + addq.l #8,a2 + add.l d4,a4 + addq.b #1,d7 +; Met ... previous programs ... + bclr #31,d7 + beq.s .PHo + movem.l a2/a4,-(sp) + move.b #"1",4(a2) + move.b d7,4+1(a2) + bsr EdM_CreObjet + addq.b #1,d7 + movem.l (sp)+,a2/a4 +; Saute le ... previous ... +.PHo addq.l #8,a2 + move.b -(a4),d4 + lea 3(a4,d4.w),a4 +; Boucle d'exploration +; ~~~~~~~~~~~~~~~~~~~~ + movem.l a2/a4,-(sp) + move.b #"0"+HiddenCommands,d6 + moveq #EdM_HiddenMax,d3 +; Recherche le premier programme cache a afficher + move.w EdM_PosHidden(a5),d1 + bsr Ed_GetHidden Programme >>> D0 + bra .PIn +; Boucle ! +.PLoop move.b #"1",4(a2) + move.b d7,4+1(a2) Numero de la branche +; Nom du programme + move.l a6,-(sp) + move.l Edt_Prg(a6),a6 + move.l a4,a0 + move.b #" ",(a0)+ + bsr Ed_NPrgToBuf + move.l (sp)+,a6 + move.b #" ",-1(a1) +; Va fabriquer l'objet + bsr EdM_CreObjet + addq.l #8,a2 + add.l d4,a4 +; Sous menu spïż½cifique +.Loop2 move.b #"1",4(a2) + move.b d7,4+1(a2) + cmp.b #"0",(a2) + beq.s .Skip + move.b d6,(a2) + addq.b #1,d6 +.Skip bsr EdM_CreObjet + addq.l #8,a2 + add.l d4,a4 + cmp.b #"*",(a2) + bne.s .Loop2 + addq.l #8,a2 + addq.b #1,d7 Un menu de plus + movem.l (sp),a2/a4 Restaure les chaines +; Passe au programme suivant +.PNext move.l Edt_Next(a6),d0 Programme suivant +.PIn beq.s .EHid + move.l d0,a6 + tst.b Edt_Hidden(a6) + beq.s .PNext + dbra d3,.PLoop Encore un? +.EHid addq.l #8,sp +.EHidden +; Trouve la fin des menus spïż½ciaux +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + moveq #0,d4 +.FLoop addq.l #8,a2 + move.b -(a4),d4 + lea 3(a4,d4.w),a4 + cmp.b #"*",(a2) + bne.s .FLoop + addq.l #8,a2 +; Met ... next programs ... +; ~~~~~~~~~~~~~~~~~~~~~~~~~ + bclr #30,d7 + beq.s .PBa + movem.l a2/a4,-(sp) + move.b #"1",4(a2) + move.b d7,4+1(a2) + bsr EdM_CreObjet + addq.b #1,d7 + movem.l (sp)+,a2/a4 +; Saute le ... next ... +.PBa addq.l #8,a2 + move.b -(a4),d4 + lea 3(a4,d4.w),a4 + +; Termine le menu +; ~~~~~~~~~~~~~~~ +.MnC move.b #"1",4(a2) + move.b d7,4+1(a2) + bsr EdM_CreObjet + addq.l #8,a2 + add.l d4,a4 + addq.b #1,d7 + cmp.b #32,(a2) + bcc.s .MnC + +; Fini! + clr.l (a3) + move.w #1,MnChange(a5) +.Pamenu movem.l (sp)+,a2-a4/d2-d7 + rts + + +; _____________________________________ +; +; Marque tous les objets markables +; _____________________________________ +; +EdM_MarkAll + bsr EdM_Editor +; Les touches dans le menu +; ~~~~~~~~~~~~~~~~~~~~~~~~ + moveq #104,d0 + move.b EdM_Keys(a5),d1 + bsr EdM_SetMark +; Mode insert / Replace +; ~~~~~~~~~~~~~~~~~~~~~ + moveq #75,d0 + move.b Ed_Insert(a5),d1 + bsr EdM_SetMark +; Sound On / Off +; ~~~~~~~~~~~~~~ + move.w #148,d0 + move.b Ed_Sounds(a5),d1 + bsr EdM_SetMark + rts + +; _____________________________________ +; +; Marque Active ou non un objet de menu +; +; D0= numero de la fonction +; D1= Active ou non +; _____________________________________ +; +EdM_SetMark + movem.l a2/a4,-(sp) + tst.l MnBase(a5) Menus definis? + beq.s .Pamenu + move.l EdM_Definition(a5),a2 + move.l EdM_Table(a5),a0 + move.l EdM_Messages(a5),a4 +.FLoop cmp.b 6(a0),d0 + addq.l #8,a0 + bne.s .FLoop + subq.l #8,a0 + add.w 4(a0),a4 + moveq #0,d0 + move.b 7(a0),d0 + lsl.w #3,d0 + add.w d0,a2 + move.l a4,a1 + lea MenuMark0(pc),a0 + tst.b d1 + beq.s .Skip + lea MenuMark1(pc),a0 +.Skip move.b (a0)+,d0 + beq.s .Out + move.b d0,(a1)+ + bra.s .Skip +.Out moveq #1,d0 + bsr EdM_ObCree + move.w #1,MnChange(a5) +.Pamenu movem.l (sp)+,a2/a4 + rts + + +; ____________________________________________ +; +; Montre / Efface les touches dans les menus +; ____________________________________________ +; +Ed_ShowKey + bsr Ed_TokCur + not.b EdM_Keys(a5) + bsr EdM_Init + rts + +; +; Routine de crïż½ation du menu A2 / Table A3 +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +EdM_CreObjet + tst.b (a4) Un objet? + beq.s .Skip + moveq #3,d0 + lea 4(a2),a0 .B Definition de l'arbre +.MnCrL move.b (a0)+,(a3) + sub.b #"0",(a3)+ + dbra d0,.MnCrL + move.l a4,d0 .W Adresse dans les messages + sub.l EdM_Messages(a5),d0 + move.w d0,(a3)+ + move.b (a2),d0 .B Touche + sub.b #"0",d0 + move.b d0,(a3)+ + move.l a2,d1 .B Definition + sub.l EdM_Definition(a5),d1 + lsr.l #3,d1 + move.b d1,(a3)+ + ext.w d0 + bsr EdM_ObCree +.Skip moveq #2,d4 + add.b -1(a4),d4 +; ILLEGAL verification table + move.l EdM_Table(a5),a0 + add.l EdM_TableSize(a5),a0 + cmp.l a0,a3 + bcs.s .Ok + illegal +.Ok rts + + +; ____________________________________ +; +; Initialisation de l'objet de menu A2/A4 +; D0= Actif / Inactif (0/1) +; ____________________________________ +; +EdM_ObCree + movem.l a2-a6/d2-d7,-(sp) + move.l Ed_BufT(a5),a3 + lea 256(a3),a3 + move.l a2,a6 + move.w d0,-(sp) + +; Recupere la position de l'objet +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + moveq #0,d5 + lea 4(a6),a0 + moveq #0,d0 + moveq #3,d1 +.Loop0 move.b (a0)+,d0 + sub.b #"0",d0 + beq.s .Exit0 + move.l d0,-(a3) + addq.w #1,d5 + dbra d1,.Loop0 +.Exit0 move.w d5,-(sp) + +; Fabrique la structure de l'objet +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + JJsr L_MnFind + bne.s .Exist + JJsr L_MnIns +.Exist + +; Inactive? +; ~~~~~~~~~ + move.w (sp)+,d7 + bclr #MnOff,MnFlag(a2) + tst.w (sp)+ + bne.s .Act + bset #MnOff,MnFlag(a2) +.Act + +; Couleurs de l'objet +; ~~~~~~~~~~~~~~~~~~~ + move.b 1(a6),d1 + sub.b #"0",d1 + move.b 2(a6),d0 + sub.b #"0",d0 + move.b d0,MnInkA1(a2) + move.b d1,MnInkB1(a2) + move.b d0,MnInkC1(a2) + move.b d1,MnInkA2(a2) + move.b d0,MnInkB2(a2) + move.b d0,MnInkC2(a2) +; Fabrique la chaine +; ~~~~~~~~~~~~~~~~~~ + move.l a4,a0 + move.l Ed_BufT(a5),a1 + lea 2(a3),a1 +.Loop2 move.b (a0)+,d0 + move.b d0,(a1)+ + cmp.b #32,d0 + bcc.s .Loop2 + subq.l #1,a1 + move.l a1,d1 + sub.l a3,d1 + subq.l #2,d1 + move.w d1,(a3) + clr.w -2(a3) + +; Met les codes de touche si necessaire +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + tst.b EdM_Keys(a5) + beq .NoKey2 +L_KDef equ 11 + cmp.w #1,d7 + beq .NoKey2 + move.l a2,-(sp) + cmp.b #"0",(a6) Rien si SubMenu + bcs .NoKey + moveq #L_KDef+1,d0 + add.w d0,(a3) + move.b (a4),d1 + move.l a1,a0 +.Loop3 move.b d1,(a0)+ + subq.w #1,d0 + bne.s .Loop3 +; Trouve la touche + move.b (a6),d0 + sub.b #"0",d0 + beq .NoKey + bsr Ed_Fonc2Ky + beq .NoKey + move.l a0,a2 +; Fabrique le texte + move.b 1(a2),d1 + move.b (a2),d2 + cmp.b #1,d2 + bls .NoKey + lea Menus_Touches1(pc),a2 + move.l a2,a0 +.Lp1 cmp.b (a0)+,d1 + addq.l #1,a0 + bne.s .Lp1 + moveq #0,d0 + move.b -1(a0),d0 + add.w d0,a2 +.Lp2 move.b (a2)+,(a1)+ + bne.s .Lp2 + subq.l #1,a1 +; Touche ASCII + tst.b d2 + bmi.s .SkipSc + move.b #'"',(a1)+ + move.b d2,(a1)+ + move.b #'"',(a1)+ + bra.s .EndKey +; Scancode +.SkipSc lea Menus_Touches2(pc),a0 + addq.l #1,a0 + bra.s .SkipS1 +.LoopS1 tst.b (a0)+ + bpl.s .LoopS1 + tst.b (a0) + beq.s .ExitS1 +.SkipS1 cmp.b -1(a0),d2 + bne.s .LoopS1 +.LoopS2 move.b (a0)+,(a1)+ + bpl.s .LoopS2 + subq.l #1,a1 + bra.s .EndKey +.ExitS1 moveq #2,d3 + move.l a1,a0 + move.b d2,d0 + and.b #$7f,d0 + JJsrP L_LongToHex,a2 + move.l a0,a1 +; Termine la touche +.EndKey move.b (a2)+,(a1)+ + bne.s .EndKey + bra.s .FinKey +; Vers un autre niveau de menu +.NLevel lea Menus_Touches3(pc),a2 +.LoopL move.b (a2)+,(a1)+ + bne.s .LoopL +; Termine la chaine +.FinKey move.b #" ",-1(a1) +.NoKey move.l (sp)+,a2 +.NoKey2 + +; Chaine normale +; ~~~~~~~~~~~~~~ + lea MnOb1(a2),a0 + move.l a3,a1 + bsr Ed_MnOb +; Chaine activee +; ~~~~~~~~~~~~~~ + lea MnOb2(a2),a0 + lea -2(a3),a1 + bsr Ed_MnOb +; Chaine inactive? +; ~~~~~~~~~~~~~~~~ + lea MnOb3(a2),a0 + lea -2(a3),a1 + bsr Ed_MnOb +; Chaine du fond +; ~~~~~~~~~~~~~~ + lea MnObF(a2),a0 + lea -2(a3),a1 + bsr Ed_MnOb +; Finito +; ~~~~~~ + move.l a2,a0 + move.w #1,MnChange(a5) + moveq #0,d0 + movem.l (sp)+,a2-a6/d2-d7 + rts + + +; Routine de creation de la chaine +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +; A0= chaine dans l'objet +; A1= chaine ïż½ affecter ïż½ l'objet A2 +; +Ed_MnOb + tst.w (a1) + beq .MnObE +; Cree une chaine! +; ~~~~~~~~~~~~~~~~ + movem.l a0/a1,-(sp) * Efface l'ancienne + bsr.s .MnObE + movem.l (sp)+,a0/a1 + JJsrP L_MnObjet,a2 * Cree la nouvelle + beq.s .Err * Illegal: tester low mem! + bmi.s .Err + move.l d0,(a0) + rts +; Efface la chaine +; ~~~~~~~~~~~~~~~~ +.MnObE move.l (a0),d0 + beq.s .Out + clr.l (a0) + move.l d0,a1 + moveq #0,d0 + move.w (a1),d0 + SyCall MemFree +.Out rts +.Err illegal + rts + + +; _______________________________________________ +; +; Copie la zone de menus editeur +; _______________________________________________ +; +EdM_Editor + tst.b EdM_Flag(a5) + bne.s .Done + move.b #1,EdM_Flag(a5) + movem.l a0/a1/d0/d1,-(sp) + lea EdM_Copie(a5),a0 + lea Mn_SSave(a5),a1 + moveq #(Mn_ESave-Mn_SSave)/2-1,d0 +.Swap move.w (a0),d1 + move.w (a1),(a0)+ + move.w d1,(a1)+ + dbra d0,.Swap + movem.l (sp)+,a0/a1/d0/d1 +.Done rts +; _______________________________________________ +; +; Copie la zone de menus programme +; _______________________________________________ +; +EdM_Program + tst.b EdM_Flag(a5) + beq.s .Done + clr.b EdM_Flag(a5) + movem.l a0/a1/d0/d1,-(sp) + lea EdM_Copie(a5),a1 + lea Mn_SSave(a5),a0 + moveq #(Mn_ESave-Mn_SSave)/2-1,d0 +.Swap move.w (a0),d1 + move.w (a1),(a0)+ + move.w d1,(a1)+ + dbra d0,.Swap + movem.l (sp)+,a0/a1/d0/d1 +.Done rts + +;_____________________________________________________________________________ +; +; Access Disque sous editeur +;_____________________________________________________________________________ +; +; Entete AMOS Basic +; ~~~~~~~~~~~~~~~~~ +EnHead dc.b "AMOS ProEd.v " + even + +; +; NAME1 already exist. Overwrite? +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_SaveOver + JJsr L_RExist + beq.s .Skip + move.l Ed_VDialogues(a5),a0 + move.l Name1(a5),(a0) + moveq #EdD_AExist,d0 + bsr Ed_Dialogue + cmp.w #1,d0 + bne Ed_NotDone +.Skip rts +; +; Sauve le programme si on l'a change! +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_Saved + tst.b Prg_Change(a6) + beq.s .Skip +; Cree la chaine avec le nom, en 0VA + move.l Buffer(a5),a0 + move.l a0,a1 + moveq #31,d0 +.Clr move.b #" ",(a1)+ + dbra d0,.Clr + clr.b (a1) + bsr Ed_NPrgToBuf + clr.b (a0) + move.l Buffer(a5),a0 + bsr Ed_DChaine + move.l Ed_VDialogues(a5),a0 + move.l a1,0*4(a0) +; Appelle la boite de dialogue + moveq #EdD_Saved,d0 + bsr Ed_Dialogue + cmp.w #2,d0 + beq.s .Skip + cmp.w #1,d0 + bne Ed_NotDone2 + bsr Ed_SaveIt +.Skip rts + + +; +; Routine LOAD HIDDEN PROGRAM +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_RLoadHidden + move.w #155,d0 + move.l Name1(a5),a0 + bsr Ed_AvName +; Ouvre la structure fenetre cachee +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + moveq #0,d0 Hidden + moveq #0,d1 Structure vide + bsr Edt_OpWindow + bne Ed_OMm + move.l a4,Ed_WindowToDel(a5) +; Va charger le programme +; ~~~~~~~~~~~~~~~~~~~~~~~ + moveq #-1,d0 Adapter la taille du buffer + JJsr L_Prg_Load + bne Ed_PrgLoadErr + move.b #1,Prg_StModif(a6) Force le test +; C'est bon! +; ~~~~~~~~~~ + bsr Ed_AverFin + rts + +; +; LOAD HIDDEN PROGRAM +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_LoadHidden + bsr Ed_TokCur +; Selecteur de fichier +; ~~~~~~~~~~~~~~~~~~~~ + moveq #66,d0 + bsr Ed_File_Selector + beq Ed_NotDone + JJsr L_Dsk.PathIt +; Appelle la routine +; ~~~~~~~~~~~~~~~~~~ + bsr Ed_RLoadHidden + clr.l Ed_WindowToDel(a5) +; Recalcule le menu +; ~~~~~~~~~~~~~~~~~ + bsr EdM_BranchAMOS + rts + +; +; LOAD PROGRAMME +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_Load + bsr Ed_TokCur + bsr Ed_Saved +; Selecteur de fichier +; ~~~~~~~~~~~~~~~~~~~~ + moveq #70,d0 + bsr Ed_File_Selector + beq Ed_NotDone + JJsr L_Dsk.PathIt +; NEW +; ~~~ + bsr Ed_New2 +; Message LOADING +; ~~~~~~~~~~~~~~~ +Ed_ReLoad + move.w #155,d0 + move.l Name1(a5),a0 + bsr Ed_AvName +; Charge +; ~~~~~~ + moveq #1,d0 Revenir si pas assez grand + JJsr L_Prg_Load + beq.s EdLok + bmi Ed_PrgLoadErr + move.l d1,d0 + bsr Ed_GetPlace + bsr Ed_AverFin + bra.s Ed_ReLoad +; Chargement correct +; ~~~~~~~~~~~~~~~~~~ +EdLok move.b #1,Prg_StModif(a6) Force le test + bsr Ed_AverFin + bsr Ed_NewBufAff + rts + +; +; Pointe le debut du nom reel du fichier +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_DNom + move.l a0,a1 +.FaL1 tst.b (a0)+ + bne.s .FaL1 + subq.l #1,a0 +.FaL2 move.b -(a0),d0 + cmp.b #"/",d0 + beq.s .FaL3 + cmp.b #":",d0 + beq.s .FaL3 + cmp.l a1,a0 + bcc.s .FaL2 +.FaL3 addq.l #1,a0 + rts + +; +; MERGE PROGRAMME +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_Merge + bsr Ed_TokCur +; Selecteur de fichier +; ~~~~~~~~~~~~~~~~~~~~ + moveq #78,d0 + bsr Ed_File_Selector + beq Ed_NotDone + JJsr L_Dsk.PathIt +; Libere de la memoire +; ~~~~~~~~~~~~~~~~~~~~ + bsr Edt_ClearVar + bsr Ed_BlocFree + bsr Prg_UndoRaz +; Charge le programme dans une fenetre cachïż½e +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + bsr Ed_RLoadHidden +; Copie le bout dans le programme +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + move.l Prg_StBas(a6),a0 Bas du source + move.l Prg_StHaut(a6),d0 Longueur du source + sub.l a0,d0 + subq.l #2,d0 + ble.s .Skip + move.w Prg_NLigne(a6),d7 Nombre de lignes + move.l Edt_Current(a5),a4 Program courant + move.l Edt_Prg(a4),a6 + move.w Edt_YPos(a4),d1 + add.w Edt_YCu(a4),d1 + move.w d1,d6 Insere le programme + bsr Ed_StoBlock + bne Ed_OofBuf + move.w d6,d0 Change les marques + move.w d7,d1 + bsr Ed_MarksChange +; La fenetre sera libïż½rïż½e au retour +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.Skip JJsr L_Prg_CptLines + bsr Ed_NewBufAff + rts + +; +; CHARGEMENT FICHIER ASCII +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_LoadA: + bsr Ed_TokCur + bsr Prg_UndoRaz +; Selecteur de fichier +; ~~~~~~~~~~~~~~~~~~~~ + moveq #86,d0 + bsr Ed_File_Selector + beq Ed_NotDone + JJsr L_Dsk.PathIt +; Message +; ~~~~~~~ + move.w #158,d0 + move.l Name1(a5),a0 + bsr Ed_AvName +; Charge tout le fichier dans un buffer +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + move.l #1005,d2 Mode OLD + bsr Ed_Open + beq Ed_DError + moveq #0,d2 Seek --> fin + moveq #1,d3 + bsr Ed_Seek + move.l d0,d2 Seek --> debut! + moveq #-1,d3 + bsr Ed_Seek + move.l d0,d3 Reserve le buffer + addq.l #4,d0 Plus zero ïż½ la fin + JJsr L_ResTempBuffer + beq Ed_OMm + move.l a0,d2 Charge tout d'un bloc + bsr Ed_Read + bne Ed_DError Ferme le fichier + bsr Ed_Close +; Boucle de tokenisation dans le buffer +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + move.w Edt_YPos(a4),d7 + add.w Edt_YCu(a4),d7 + move.l TempBuffer(a5),a3 Cherche la fin +; Control-C? +.MergL bclr #BitControl-8,T_Actualise(a5) + bne .MergX +; Trouve la longueur de la ligne + lea -1(a3),a2 +.Fin1 addq.l #1,a2 + move.b (a2),d0 + beq.s .Fin4 + cmp.b #32,d0 + bcc.s .Fin1 + cmp.b #10,d0 + beq.s .Fin2 + cmp.b #13,d0 + beq.s .Fin2 + cmp.b #9,d0 Tabs >>> Espace + bne .Bad + move.b #" ",(a2) + bra.s .Fin1 +.Fin2 clr.b (a2) + cmp.b #32,1(a2) + bcc.s .Fin4 + addq.l #1,a2 +.Fin4 move.l a2,d0 Verifie la longueur + sub.l a3,d0 + cmp.l #250,d0 + bcc.s .Long +; Va tokeniser + move.l a3,a0 + lea 1(a2),a3 + move.l Ed_BufT(a5),a1 + bsr Tokenise + bmi.s .Long +; Stocke! + moveq #-1,d0 Insert + move.w d7,d1 Ligne courante + move.l Ed_BufT(a5),a1 + bsr Ed_Stocke + bne .OBuf + addq.w #1,d7 + addq.w #1,Prg_NLigne(a6) +; Reaffiche le slider + movem.l a2/a3/d7,-(sp) + bsr Ed_AffSlV + movem.l (sp)+,a2/a3/d7 +; Encore une ligne? + tst.b (a3) + bne .MergL +; Termine +.MergX moveq #0,d0 + JJsr L_ResTempBuffer + bsr Ed_AverFin + JJsr L_Prg_CptLines + bsr Ed_NewBufAff + SyCall ClearKey + rts +; Out of buffer space +.OBuf bsr .MergX + bra Ed_OofBuf +; Line too long / Bad file +.Bad +.Long bsr .MergX + bra Ed_LToLong + +; +; SAUVEGARDE PROGRAMME +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +; Rename le programme cournant +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_Rename + move.l Name1(a5),a0 + lea Prg_NamePrg(a6),a1 +.Copy move.b (a0)+,(a1)+ + bne.s .Copy + move.b #1,Prg_Change(a6) + bset #EtA_Nom,Edt_EtatAff(a4) + rts + +; Sauvegarde speciale COMPILER_SHELL.AMOS +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_SaveAsName +; Sauvegarde le non dans la pile + lea Prg_NamePrg(a6),a0 + lea -128(sp),sp + move.l sp,a1 +.Copy move.b (a0)+,(a1)+ + bne.s .Copy +; Sauve le programme, sans .BAK + bsr Ed_SavePrg2 +; Remet le nom + move.l sp,a0 + lea Prg_NamePrg(a6),a1 +.Copy1 move.b (a0)+,(a1)+ + bne.s .Copy1 + lea 128(sp),sp +; Erreur? + tst.w d0 + bne Ed_DError + rts + +Ed_SaveAs + bsr Ed_TokCur + bra.s Ed_SvAs +Ed_Save + bsr Ed_TokCur +Ed_SaveIt +; Demander le nom? +; ~~~~~~~~~~~~~~~~ + lea Prg_NamePrg(a6),a0 + tst.b (a0) + beq.s Ed_SvAs + move.l Name1(a5),a1 + bsr EdCocop + JJsr L_Dsk.PathIt + bra.s Ed_Sv +; Ouvre le selecteur de fichiers +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_SvAs moveq #74,d0 + bsr Ed_File_Selector + beq Ed_NotDone + JJsr L_Dsk.PathIt +; Sauve le programme! +; ~~~~~~~~~~~~~~~~~~~ +Ed_Sv move.w #154,d0 + move.l Name1(a5),a0 + bsr Ed_AvName + bsr Ed_SavePrg + bne Ed_DError + bsr Ed_AverFin + bset #EtA_Nom,Edt_EtatAff(a4) + rts +; Sauve le programme (a4), nom NAME1 +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_SavePrg +; Fabrique NOM.BAK +; ~~~~~~~~~~~~~~~~ + tst.b Ed_SvBak(a5) + beq .PaBak + bsr Ed_MakeBak + bne.s SError +.PaBak +Ed_SavePrg2 +; Fait le mïż½nage! +; ~~~~~~~~~~~~~~~ + bsr Edt_ClearVar + JJsr L_Prg_CptLines +; Va sauver +; ~~~~~~~~~ + JJsr L_Prg_Save + bne.s SError + move.b #1,Prg_StModif(a6) Force le menage +; Sauve l'icone +; ~~~~~~~~~~~~~ + bsr Ed_SaveIcon +; Pas d'erreur +; ~~~~~~~~~~~~ + moveq #0,d0 +SOut rts +; Erreur dans la sauvegarde +; ~~~~~~~~~~~~~~~~~~~~~~~~~ +SError moveq #-1,d0 + bra.s SOut + + +; +; FABRIQUE UN .BAK de NAME1 +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_MakeBak + movem.l a0-a2/a6/d0-d2,-(sp) + move.l Name1(a5),a0 + move.l Name2(a5),a1 +.Bak1 move.b (a0)+,(a1)+ + bne.s .Bak1 +; Trouve le DERNIER "." + move.l a1,a0 + subq.l #1,a1 +.Bak2 cmp.l Name2(a5),a0 + ble.s .Bak3 + cmp.b #".",-(a0) + bne.s .Bak2 + move.l a0,a1 +; Recopie le .BAK +; ~~~~~~~~~~~~~~~ +.Bak3 moveq #21,d0 + bsr Ed_GetSysteme +.Bak4 move.b (a0)+,(a1)+ + bne.s .Bak4 +; Renomme NOM.AMOS si present +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.Bak5 move.l DosBase(a5),a6 + move.l Name1(a5),d1 + move.l Name2(a5),d2 + jsr _LVORename(a6) + tst.l d0 + bne.s .Ok + jsr _LVOIoErr(a6) + cmp.w #215,d0 D'un periph ïż½ l'autre? + beq.s .Ok + cmp.w #205,d0 Existe pas + beq.s .Ok + cmp.w #203,d0 Existe DEJA + bne .Err +; Efface NOM.BAK et recommence! +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + move.l Name2(a5),d1 + jsr _LVODeleteFile(a6) + tst.l d0 + bne .Bak5 +; Une erreur! +; ~~~~~~~~~~~ +.Err moveq #-1,d0 + bra.s .Out +; Ok! +; ~~~ +.Ok moveq #0,d0 +.Out movem.l (sp)+,a0-a2/a6/d0-d2 + rts + +; +; SAUVEGARDE ICONE PROGRAMME +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_SaveIcon + movem.l d0-d1/a0-a1/a6,-(sp) + tst.b PI_Icons(a5) + beq.s .Ok + move.l IconBase(a5),d0 + beq.s .Ok + move.l d0,a6 + move.l AdrIcon(a5),d0 + beq.s .Ok + move.l d0,a1 + move.l Name1(a5),a0 + jsr -84(a6) +.Ok movem.l (sp)+,d0-d1/a0-a1/a6 + rts + +; +; ERREUR DISQUE SOUS EDITEUR +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +;Ed_DiskError +; Arret du flag +; ~~~~~~~~~~~~~ +; clr.w Ed_Disk(a5) +; Trouve l'erreur +; ~~~~~~~~~~~~~~~ +; move.l Ed_RunMessages(a5),a0 +; addq.w #1,d0 +; bsr Ed_GetMessageA0 +; movem.l a0/d0,-(sp) +; bsr Ed_BufUntok +; movem.l (sp)+,a0/d0 +; ALERTE! +; ~~~~~~~ +; moveq #125,d0 +; bra Ed_Alert + +; ___________________________________________________________________ +; +; DIVERS +; ___________________________________________________________________ +; +; Agrandi une image aux dimensions de l'ïż½diteur +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +; D0= Y1 +; D1= Y2 +; +Ed_Enlarge + movem.l a0-a2/d0-d5,-(sp) + move.l T_EcAdr+EcEdit*4(a5),a0 + move.l a0,a1 + ext.l d0 + ext.l d1 + move.l d1,d5 + move.l d0,d1 + move.l d0,d3 + move.l #160,d0 + move.l #480,d4 + move.w Ed_Sx(a5),d2 + sub.w #480-160,d2 + ext.l d2 + JJsrR L_ScCopy,a2 + movem.l (sp)+,a0-a2/d0-d5 + rts + +; +; Copie la palette de la souris dans l'ïż½cran A0 +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +; A0= Ecran Destination +; +Ed_CopyPal + lea EcPal+32(a0),a0 + lea PI_DefEPa+32(a5),a1 + moveq #16-1,d0 +.loop move.w (a1)+,(a0)+ + dbra d0,.loop + rts +; _____________________________________________________ +; +; Attente souris dans le titre +; _____________________________________________________ +; +Ed_TiWait + move.w d0,-(sp) +.loop JJsr L_Sys_WaitMul + SyCall Inkey + tst.l d1 + bne.s .end + SyCall MouseKey + and.w #%111,d1 + bne.s .end + subq.w #1,(sp) + bne.s .loop +.end addq.l #2,sp + rts + +; +; Unpack Image de l'ïż½diteur +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +; D0= Numero +; D1= X +; D2= Y +; +Es_Unpack + move.l T_EcAdr+EcFonc*4(a5),a1 + bra.s EdU +Ed_Unpack + move.l T_EcAdr+EcEdit*4(a5),a1 +EdU move.l Ed_Resource(a5),a0 + add.l 2(a0),a0 + lsl.w #2,d0 + add.l -4+2(a0,d0.w),a0 + ext.l d1 + ext.l d2 + JJsrP L_UnPack_Bitmap,a2 + rts + +; ___________________________________________________________________ +; +; ROUTINES BOUTONS +; ___________________________________________________________________ +; +Bt_RoutIn + bra Ed_BtWindowClose 1- Close window + bra Ed_BtWindowHide 2- Hide window + bra Ed_BtWindowSize 3- Shrink window + bra Bt_EsCDraw 4- Dessin bouton escape + bra Esc_BtGetOutput 5- Position actuelle OUTPUT + bra Bt_EdDraw 6- Dessin d'un bouton +; Dessin d'un bouton ESCAPE! +; ~~~~~~~~~~~~~~~~~~~~~~~~~~ +Bt_EsCDraw + move.l d2,-(sp) + move.w Bt_Image(a2),d0 + add.w Bt_Pos(a2),d0 + move.w Bt_X(a2),d1 + move.w Bt_Y(a2),d2 + bsr Es_Unpack + move.l (sp)+,d2 + rts +; Dessin d'un bouton EDITOR! +; ~~~~~~~~~~~~~~~~~~~~~~~~~~ +Bt_EdDraw + move.l d2,-(sp) + move.w Bt_Image(a2),d0 + add.w Bt_Pos(a2),d0 + move.w Bt_X(a2),d1 + move.w Bt_Y(a2),d2 + bsr Ed_Unpack + move.l (sp)+,d2 + rts + +; +; Gestion des boutons speciaux +; ____________________________________ +; +EdK_MarkAll + move.b Ed_Insert(a5),d0 + and.w #$0001,d0 + bchg #0,d0 + lea Ed_Boutons+(Bt_Insert-1)*Bt_Long(a5),a2 + move.w d0,Bt_Pos(a2) + bsr Bt_EdDraw +.Skip rts + +; ___________________________________________________________________ +; +; ACCES DISQUE EDITEUR +; ___________________________________________________________________ +; + + +; OPEN: ouvre le fichier systeme (diskname1) access mode D2 +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_Open move.l Name1(a5),d1 +Ed_OpenD1 + move.l a6,-(sp) + move.l DosBase(a5),a6 + jsr _LVOOpen(a6) + move.l (sp)+,a6 + move.l d0,Handle(a5) + rts + +; CLOSE fichier systeme +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_Close + move.l Handle(a5),d1 + beq.s .Skip + clr.l Handle(a5) + move.l a6,-(sp) + move.l DosBase(a5),a6 + jsr _LVOClose(a6) + move.l (sp)+,a6 +.Skip rts + +; READ fichier systeme D3 octets dans D2 +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_Read movem.l d1/a0/a1/a6,-(sp) + move.l Handle(a5),d1 + move.l DosBase(a5),a6 + jsr _LVORead(a6) + movem.l (sp)+,d1/a0/a1/a6 + cmp.l d0,d3 + rts + +; WRITE fichier systeme D3 octets de D2 +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_Write + movem.l d1/a0/a1/a6,-(sp) + move.l Handle(a5),d1 + move.l DosBase(a5),a6 + jsr _LVOWrite(a6) + movem.l (sp)+,d1/a0/a1/a6 + cmp.l d0,d3 + rts + +; SEEK fichier system D3 mode D2 deplacement +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_Seek move.l Handle(a5),d1 + move.l a6,-(sp) + move.l DosBase(a5),a6 + jsr _LVOSeek(a6) + move.l (sp)+,a6 + tst.l d0 + rts +; +; Ouverture de l'imprimante +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_PRTOpen + moveq #43,d0 + JJsr L_Sys_GetMessage + move.l a0,d1 + move.l #1005,d2 + bsr Ed_OpenD1 + beq.s Ed_PErr + rts +Ed_PErr move.w #216,d0 + bra.s Ed_DBis +; +; Imprime la chaine A0 +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_PRTPrint + move.l a0,d2 + move.l a0,a1 +.Ip1 move.b (a0)+,d0 + move.b d0,(a1)+ + beq.s .Ip2 + cmp.b #13,d0 + bne.s .Ip1 + tst.b PI_PrtRet(a5) + bne.s .Ip1 + cmp.b #10,(a0) + bne.s .Ip1 + move.b (a0)+,-1(a1) + bra.s .Ip1 +; Nouvelle longueur +.Ip2 sub.l d2,a0 + subq.l #1,a0 + move.l a0,d3 + bsr Ed_Write + bne Ed_PErr + rts +; +; Erreurs dans le chargement programme +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_PrgLoadErr + cmp.w #-2,d0 + beq Ed_OMm + cmp.w #-3,d0 + beq Ed_PaAMOS +; +; Gestion des erreurs disque +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_DError + move.l a6,-(sp) + move.l DosBase(a5),a6 + jsr _LVOIoErr(a6) + move.l (sp)+,a6 + lea ErDisked(pc),a0 + moveq #DEBase-1,d1 +.Explo addq.l #1,d1 + move.b (a0)+,d2 + beq.s Paerr + cmp.b d0,d2 + bne.s .Explo + move.w d1,d0 + addq.w #1,d0 +; Imprime le message +Ed_DBis move.l Ed_RunMessages(a5),a0 + bsr Ed_GetMessageA0 +; En cas de ZAPPEUSE, branche ïż½ ALERT normal + tst.b Ed_Zappeuse(a5) + bne Ed_ZapAlert +; Boite de dialogue + move.l Ed_VDialogues(a5),a1 + move.l a0,0*4(a1) + bsr Ed_RazAlert + moveq #"G",d0 Va faire du bruit! + bsr Ed_SamPlay + moveq #EdD_DiskErr,d0 + bsr Ed_Dialogue + bra Ed_Loop +Paerr moveq #DEBase+22+1,d0 + bra.s Ed_DBis +; Table des erreurs reconnues +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~ +ErDisked + dc.b 203,204,205,210,213,214,216,218 + dc.b 220,221,222,223,224,225,226,0 + even + +; Appel du selecteur de fichier +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Ed_File_Selector + tst.b Ed_Zappeuse(a5) Zappeuse>>> on revient ! + bne.s .Zap + movem.l a2-a3/d2-d7,-(sp) + bsr Ed_GetMessage + pea -2(a0) + bsr Ed_GetNMessage + pea -2(a0) + bsr Ed_GetNMessage + pea -2(a0) + bsr Ed_GetNMessage + pea -2(a0) + move.l sp,a3 + move.w #1,Ed_FSel(a5) + bsr Ed_SetBanks + JJsr L_Dsk.FileSelector + clr.w Ed_FSel(a5) + lea 16(sp),sp + movem.l (sp)+,a2-a3/d2-d7 + tst.w d0 + rts +.Zap moveq #1,d0 + rts + + +; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +; TOKENISATION / DETOKENISATION +; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +; Initialisation des tables de tokenisation +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Tok_Init + tst.l Ed_BufT(a5) + bne MTokX +; Reserve le buffer de tokenisation... +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + move.l #EdBTT,d0 + SyCall MemFastClear + beq MTError + move.l a0,Ed_BufT(a5) +; Fabrique les tables de tokenisation +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + move.l #1024*12,d0 + JJsr L_ResTempBuffer + beq MTError + lea AdTokens(a5),a3 + lea AdTTokens(a5),a4 + moveq #-4,d7 +MTok1 addq.w #4,d7 + cmp.w #26*4,d7 + bcc MTokX + move.l 0(a3,d7.w),d6 + beq.s MTok1 + move.l d6,a1 + addq.l #6,a1 +; Premiere table + move.l TempBuffer(a5),a6 + move.l a6,a0 + lea 2048(a0),a2 + moveq #0,d0 +MTok2 move.l a1,d1 + lea 4(a1),a1 +MTok0 move.b (a1)+,d0 + bpl.s MTok3 + and.w #$7f,d0 + subq.l #1,a1 +MTok3 cmp.b #"!",d0 + beq.s MTok0 + cmp.b #" ",d0 + beq.s MTok0 + bsr MnD0 + cmp.b #"a",d0 + bcs.s MTok4 + cmp.b #"z",d0 + bhi.s MTok4 + move.w d0,(a0)+ + sub.l d6,d1 + move.w d1,(a2)+ +MTok4 bsr EdlNext + bne.s MTok2 + move.w #-1,(a0)+ +; Deuxieme table + move.l a0,d0 + sub.l a6,d0 + add.l #26*4+2+4,d0 + move.l d0,d1 + SyCall MemFastClear + beq MTError + move.l a0,0(a4,d7.w) + move.l a0,a1 + move.l a0,d3 + move.l d1,(a1)+ + lea 26*2+2(a1),a2 + moveq #"a",d5 + move.w #2048,d4 +MTok5 move.l a2,d0 + sub.l d3,d0 + move.w d0,(a1)+ + move.l a6,a0 +MTok6 move.w (a0)+,d0 + bmi.s MTok7 + cmp.w d0,d5 + bne.s MTok6 + move.w -2(a0,d4.w),(a2)+ + bra.s MTok6 +MTok7 clr.w (a2)+ + addq.w #1,d5 + cmp.w #"z",d5 + bls.s MTok5 + clr.w (a1)+ + bra MTok1 +MTokX moveq #0,d0 + JJsr L_ResTempBuffer + moveq #0,d0 + rts +; Out of memory! +; ~~~~~~~~~~~~~~ +MTError moveq #0,d0 + JJsr L_ResTempBuffer + moveq #1,d0 + rts +; Routine: token suivant +; ~~~~~~~~~~~~~~~~~~~~~~ +EdlNext tst.b (a1)+ ; Saute le nom + bpl.s EdlNext +.Tkln1 tst.b (a1)+ ; Saute les params + bpl.s .Tkln1 + move.w a1,d1 + btst #0,d1 ; Rend pair + beq.s .Tkln2 + addq.l #1,a1 +.Tkln2 tst.w (a1) + rts +; Routine: D0 minuscule +MnD0 cmp.b #"A",d0 + bcs.s .Mnd0a + cmp.b #"Z",d0 + bhi.s .Mnd0a + add.b #32,d0 +.Mnd0a rts + +; Effacement de la tokenisation +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Tok_Del +; Efface le buffer de tokenisation + move.l Ed_BufT(a5),d0 + beq.s DlTkX + clr.l Ed_BufT(a5) + move.l d0,a1 + move.l #EdBTT,d0 + SyCall MemFree +; Efface les tables de tokens rapide + lea AdTTokens(a5),a2 + moveq #25,d1 +DlTk1 move.l (a2)+,d0 + beq.s DlTk2 + clr.l -4(a2) + move.l d0,a1 + move.l (a1),d0 + SyCall MemFree +DlTk2 dbra d1,DlTk1 +DlTkX rts + + +*********************************************************** +* TOKENISE LA LIGNE COURANTE +*********************************************************** +Tokenise: + movem.l a1-a6/d2-d7,-(sp) * Sauve le debut de la ligne + move.l a1,a4 + move.l a0,a3 + pea 512(a4) + clr.w d5 * RAZ de tous les flags + clr.w (a4)+ + +******* Compte les TABS + moveq #0,d1 +TokT: addq.w #1,d1 + move.b (a3)+,d0 + beq TokVide + cmp.b #32,d0 + beq.s TokT + subq.l #1,a3 + cmp.w #127,d1 + bcs.s TokT1 + moveq #127,d1 +TokT1: move.b d1,-1(a4) + +******* Un chiffre au debut de la ligne? + move.b (a3),d0 + cmp.b #"0",d0 + bcs.s TokT2 + cmp.b #"9",d0 + bhi.s TokT2 + bset #1,d5 * Flag VARIABLE + bset #4,d5 * Flag LABEL + move.l a4,TkAd(a5) + move.w #_TkVar,(a4)+ + clr.l (a4)+ + move.b (a3)+,(a4)+ + +******* Une apostrophe en debut de ligne? +TokT2: cmp.b #"'",d0 + bne.s TokLoop + addq.l #1,a3 + move.w #_TkRem2,(a4)+ + bra TkKt2 + +******* Prend une lettre +TokLoop: + cmp.l (sp),a4 + bhi TokFin + move.b (a3)+,d0 + beq TokFin + +* Rem en route? + btst #5,d5 + beq.s TkROn + move.b d0,(a4)+ + bra.s TokLoop +TkROn: + +* Variable en route? + btst #1,d5 + bne TkVD + +* Chaine en route? + btst #0,d5 + beq.s TkC2 + cmp.b TkChCar(a5),d0 + beq.s TkC1 + move.b d0,(a4)+ + bra.s TokLoop +* Fin d'une chaine alphanumerique +TkChf: subq.l #1,a3 +TkC1: bclr #0,d5 + move.l a4,d0 + btst #0,d0 + beq.s TkC0 + clr.b (a4)+ +TkC0: move.l TkAd(a5),a0 + sub.l a0,d0 + subq.w #4,d0 + move.w d0,2(a0) + bra.s TokLoop +* Debut d'une chaine alphanumerique? +TkC2: cmp.b #'"',d0 + beq TkC2a + cmp.b #"'",d0 + bne TkOtre +TkC2a: move.b d0,TkChCar(a5) + move.l a4,TkAd(a5) + cmp.b #"'",d0 + beq.s TkC2b + move.w #_TkCh1,(a4)+ + bra.s TkC2c +TkC2b: move.w #_TkCh2,(a4)+ +TkC2c: clr.w (a4)+ + bset #0,d5 + bra.s TokLoop + +* Variable en route +TkVD: bsr Minus +* Numero de ligne en route +TkFV: moveq #0,d1 + move.l TkAd(a5),a0 + btst #4,d5 + beq.s TkV2 + cmp.b #"0",d0 + bcs.s TkV0 + cmp.b #"9",d0 + bls.s TkV3 +TkV0: bset #3,d5 Fin du debut de ligne! + bclr #4,d5 Fin du numero de ligne + cmp.b #":",d0 + beq.s TkV1 + subq.l #1,a3 + bra.s TkV1 +* Variable normale / label +TkV2: cmp.b #"_",d0 + beq.s TkV3 + cmp.b #"0",d0 + bcs.s TkV4 + cmp.b #"9",d0 + bls.s TkV3 + cmp.b #"a",d0 + bcs.s TkV4 + cmp.b #"z",d0 + bls.s TkV3 + cmp.b #128,d0 + bls.s TkV4 +TkV3: move.b d0,(a4)+ + bra TokLoop +* Fin de la variable/label/label goto +TkV4: bset #3,d5 * Si pas debut de ligne + bne.s TkV5 + cmp.b #":",d0 * Si : + bne.s TkV5 +TkV1: move.w #_TkLab,(a0) + bra.s TkV7 + +TkV5: subq.l #1,a3 + moveq #2,d1 + cmp.b #"$",d0 + beq.s TkV6 + moveq #1,d1 + cmp.b #"#",d0 + beq.s TkV6 + moveq #0,d1 + bra.s TkV7 +TkV6: addq.w #1,a3 +TkV7: move.w a4,d2 * Rend pair + btst #0,d2 + beq.s TkV8 + clr.b (a4)+ +TkV8: move.l a4,d0 + sub.l a0,d0 + subq.l #6,d0 + move.b d0,4(a0) * Poke la longueur + move.b d1,5(a0) * Poke le flag + bclr #1,d5 + bra TokLoop + +* Saute les 32 +TkOtre: cmp.b #" ",d0 + beq TokLoop + +* Est-ce un chiffre? + lea -1(a3),a0 Pointe le debut du chiffre + moveq #0,d0 Ne pas tenir compte du signe (valtok) + move.l a4,-(sp) + move.l AdTokens(a5),a4 Prend la base des jumps + JJsrR L_ValRout,a1 + move.l (sp)+,a4 + bne.s TkK + move.l a0,a3 + move.w d1,(a4)+ + move.l d3,(a4)+ + cmp.w #_TkDFl,d1 + bne TokLoop + move.l d4,(a4)+ + bra TokLoop +TkK: + +******* Tokenisation RAPIDE! + moveq #-4,d7 * D7--> Numero de l'extension + lea AdTokens(a5),a6 + moveq #0,d3 + lea -10(sp),sp +* Prend le premiere caractere... + moveq #0,d0 + move.b -1(a3),d0 + bsr MinD0 + move.l d0,d2 + lea Dtk_Operateurs(pc),a1 Operateur, LENTS en 1er... + bra TkLIn +* Lent ou rapide? +TkUn cmp.b #"a",d2 + bcs.s Tkl1 + cmp.b #"z",d2 + bhi.s Tkl1 + bset #31,d2 + move.w d2,d6 + sub.w #"a",d6 + lsl.w #1,d6 +* Mode rapide: init! +Tkr1 lea AdTTokens(a5),a2 + move.l 0(a2,d7.w),d0 + beq.s Tkl1 + move.l d0,a2 + move.w 4(a2,d6.w),d0 + add.w d0,a2 * A2-> Adresse des adresses + bset #31,d6 + bra TkRNext +* Tokens lents +Tkl1 move.l 0(a6,d7.w),d0 + beq TkNext + move.l d0,a1 + addq.l #6,a1 +TkLIn bclr #31,d6 + cmp.b #"!",d2 Entree pour les operateurs... + beq TkKF + cmp.b #"?",d2 + bne.s Tkl2 + move.l a3,a0 +Tkl1a move.b (a0)+,d0 * ? PRINT / ? PRINT # + beq.s Tkl1b + cmp.b #"#",d0 + beq.s Tkl1c + cmp.s #" ",d0 + beq.s Tkl1a +Tkl1b move.w #_TkPr,d4 + bra TkKt0 +Tkl1c move.l a0,a3 + move.w #_TkHPr,d4 + bra TkKt0 +Tkl2 move.l a1,d4 * Recherche la 1ere lettre + lea 4(a1),a1 + move.w d2,d0 +Tkl0 move.b (a1)+,d1 + bmi Tkl4 + cmp.b #" ",d1 + beq.s Tkl0 + cmp.b #"!",d1 + beq.s Tkl0 + cmp.b d0,d1 + beq.s TkRe0 +Tkl3 bsr TklNext + bne.s Tkl2 +* Tableau de token suivant! +TkNext addq.l #4,d7 + beq TkUn + cmp.l #4*26,d7 + bcc.s .TrouV + tst.l d2 + bpl.s Tkl1 + bra Tkr1 +.TrouV tst.w d3 + beq TkKF + move.l (sp),d4 + move.l 4(sp),a3 + move.w 8(sp),d7 + bra TklT +* Trouve 1 lettre lent? +Tkl4 subq.l #1,a1 + and.b #$7f,d1 + cmp.b #" ",d1 + beq TklT + cmp.b d0,d1 + bne.s Tkl3 + bra TklT +* Token rapide suivant +TkRNext move.w (a2)+,d0 + beq TkNext + move.l 0(a6,d7.w),a1 + add.w d0,a1 + move.l a1,d4 + lea 5(a1),a1 + move.b -1(a1),d0 + cmp.b #"!",d0 + beq.s TkRe0a + cmp.b #" ",d0 + bne.s TkRe0 +TkRe0a addq.l #1,a1 +* Explore les autres lettres du token +TkRe0 move.l a3,a0 +TkRe1 move.b (a0)+,d0 + bsr MinD0 +TkRe2 move.b (a1)+,d1 + bmi.s TkKt + cmp.b #" ",d1 + bne.s TkRe3 + cmp.b d1,d0 + bne.s TkRe2 + beq.s TkRe1 +TkRe3 cmp.b d0,d1 + beq.s TkRe1 +* Mot cle suivant +TkRe4 tst.l d6 + bpl Tkl3 + bmi.s TkRNext +* Mot trouve? +TkKt: subq.l #1,a0 + subq.l #1,a1 + and.b #$7f,d1 + cmp.b #" ",d1 + beq.s TkKt1 + cmp.b d0,d1 + bne.s TkRe4 + addq.l #1,a0 +TkKt1: + tst.l d6 + bpl.s TklTl + move.l a1,d0 + sub.l d4,d0 + cmp.w d3,d0 + bls.s TkRe4 + move.w d0,d3 + move.l d4,(sp) + move.l a0,4(sp) + move.w d7,8(sp) + bra.s TkRe4 +TklTl move.l a0,a3 +*** Token trouve! +TklT tst.w d7 Une extension + bgt TkKtE + beq.s .Norm Un operateur? + lea Dtk_OpFin(pc),a0 + sub.l a0,d4 + bra.s TkKt0 +.Norm sub.l AdTokens(a5),d4 Un token librairie principale +TkKt0: lea 10(sp),sp + move.w d4,(a4)+ + bclr #4,d5 Plus de numero de ligne + bset #3,d5 Plus debut de ligne + cmp.w #_TkEqu,d4 Tokens de structure? + bcs.s .SkS + cmp.w #_TkStruS,d4 + bls TkKt5 +.SkS cmp.w #_TkOn,d4 + beq.s TkKt7 + cmp.w #_TkData,d4 + beq TkKt3 + cmp.w #_TkRem1,d4 + beq.s TkKt2 + cmp.w #_TkFor,d4 + beq.s TkKt3 + cmp.w #_TkRpt,d4 + beq.s TkKt3 + cmp.w #_TkWhl,d4 + beq.s TkKt3 + cmp.w #_TkDo,d4 + beq.s TkKt3 + cmp.w #_TkExit,d4 + beq.s TkKt4 + cmp.w #_TkExIf,d4 + beq.s TkKt4 + cmp.w #_TkIf,d4 + beq.s TkKt3 + cmp.w #_TkElse,d4 + beq.s TkKta + cmp.w #_TkElsI,d4 + beq.s TkKt3 + cmp.w #_TkThen,d4 + beq.s TkKtb + cmp.w #_TkProc,d4 + beq.s TkKt6 + cmp.w #_TkDPre,d4 + beq.s TkKDPre + bra TokLoop +* ON +TkKt7: clr.l (a4)+ + bra TokLoop +* Debut d'une REM +TkKt2: clr.w (a4)+ + move.l a4,TkAd(a5) + bset #5,d5 + bra TokLoop +* Poke les blancss +TkKt6 clr.w (a4)+ 8 octets +TkKt5 clr.w (a4)+ 6 octets +TkKt4 clr.w (a4)+ 4 octets +TkKt3 clr.w (a4)+ 2 octets + bra TokLoop +* Token double precision: flags ïż½ 1 +TkKDPre or.b #%10000011,MathFlags(a5) + bra TokLoop +* Token d'extension! .w EXT/.b #Ext/.b Nb Par/.w TOKEN +TkKtE: lea 10(sp),sp + move.w #_TkExt,(a4)+ + move.w d7,d0 + lsr.w #2,d0 + move.b d0,(a4)+ + clr.b (a4)+ + lea AdTokens(a5),a6 + sub.l 0(a6,d7.w),d4 + move.w d4,(a4)+ + bclr #4,d5 + bset #3,d5 + bra TokLoop +* ELSE/THEN: regarde si numero de ligne apres! +TkKta: clr.w (a4)+ +TkKtb: move.l a3,a0 +TkKtc: move.b (a0)+,d0 + beq TokLoop + cmp.b #" ",d0 + beq TkKtc + cmp.b #"0",d0 + bcs TokLoop + cmp.b #"9",d0 + bhi TokLoop + move.l a0,a3 + move.w #_TkLGo,d1 + bra.s TkKf2 + +******* Rien trouve ===> debut d'une variable +TkKF: lea 10(sp),sp + move.w #_TkVar,d1 + move.b -1(a3),d0 +TkKf0: cmp.b #"A",d0 + bcs.s TkKf1 + cmp.b #"Z",d0 + bhi.s TkKf1 + add.b #"a"-"A",d0 +TkKf1: cmp.b #"_",d0 + beq.s TkKf2 + cmp.b #128,d0 + bcc.s TkKf2 + cmp.b #"a",d0 + bcs TokLoop + cmp.b #"z",d0 + bhi TokLoop +TkKf2: move.l a4,TkAd(a5) + move.w d1,(a4)+ + clr.l (a4)+ + move.b d0,(a4)+ + bset #1,d5 + bra TokLoop +* Appel d'un label? +TkKf3: move.w #_TkLGo,d1 + cmp.b #"0",d0 + bcs.s TkKf0 + cmp.b #"9",d0 + bls.s TkKf2 + bra.s TkKf0 + +******* Fin de la tokenisation +TokFin: btst #1,d5 Fin de variable + bne TkFV + btst #0,d5 Fin de chaine alphanumerique + bne TkChf + + moveq #1,d0 * Quelquechose dans la ligne! + + btst #5,d5 REM + beq.s TokPaR + move.w a4,d1 + btst #0,d1 Rend pair la REM! + beq.s FRem + move.b #" ",(a4)+ +FRem: move.l a4,d1 Calcule et stocke la longueur + move.l TkAd(a5),a0 + sub.l a0,d1 + move.w d1,-2(a0) +* Marque la fin +TokPaR: clr.w (a4)+ + clr.w (a4) +* Poke la longueur de la ligne / 2 + move.l a4,d1 + addq.l #4,sp + movem.l (sp)+,a1-a6/d2-d7 + sub.l a1,d1 + cmp.w #510,d1 + bcc.s .Long + lsr.w #1,d1 + move.b d1,(a1) + lsl.w #1,d1 + ext.l d1 +* Fini! + tst.w d0 + rts +* Trop longue! +.Long clr.w (a1) * <0= Trop longue + moveq #0,d1 + moveq #-1,d0 + rts +* Ligne vide! +TokVide moveq #0,d0 * = 0 Vide + moveq #0,d1 + bra.s TokPaR + +* Routine: D0 minuscule +MinD0 cmp.b #"A",d0 + bcs.s Mnd0a + cmp.b #"Z",d0 + bhi.s Mnd0a + add.b #32,d0 +Mnd0a rts +* Routine: token suivant +TklNext tst.b (a1)+ * Saute le nom + bpl.s TklNext +Tkln1 tst.b (a1)+ * Saute les params + bpl.s Tkln1 + move.w a1,d1 + btst #0,d1 * Rend pair + beq.s Tkln2 + addq.l #1,a1 +Tkln2 tst.w (a1) + rts + + +; ___________________________________________________________________________ +; +; DETOKENISATION +; ___________________________________________________________________________ +; +; A0: Ligne ïż½ detokeniser +; A1: Buffer +; D0: Adresse ïż½ dïż½tecter +; ___________________________________________________________________________ +; +Mon_Detok + moveq #-1,d1 + bra.s Dtk +Detok: + moveq #0,d1 +Dtk + movem.l d2-d7/a2-a6,-(sp) + lea 2(a1),a4 * Place pour la taille + move.l a0,a6 + move.l d0,a3 + move.l a4,a2 + clr.w -(sp) * Position du curseur + +******* Met les espaces devant? + tst.w d1 Mode monitor + bne.s DtkMon + tst.b (a6) Mode normal + beq DtkFin + clr.w d0 + move.b 1(a6),d0 + subq.w #2,d0 + bmi.s Dtk2 +Dtk1: move.b #" ",(a4)+ + dbra d0,Dtk1 +Dtk2: addq.l #2,a6 +DtkMon clr.w d5 + +******* Boucle de detokenisation +DtkLoop:cmp.l a3,a6 Trouve la P en X? + bne.s Dtk0 + move.l a4,d0 + sub.l a2,d0 + move.w d0,(sp) +Dtk0: move.l a3,d0 Detournement? + bpl.s .Skip + neg.l d0 + move.l d0,a0 + jsr (a0) +.Skip move.w (a6)+,d0 + beq DtkFin + cmp.w #_TkLGo,d0 + bls DtkVar + cmp.w #_TkExt,d0 + bcs DtkCst + bclr #0,d5 + tst.w d0 + bmi DtkOpe Un operateur? + lea AdTokens(a5),a0 + cmp.w #_TkPar1,d0 + beq DtkP + cmp.w #_TkDFl,d0 + beq DtkCst + cmp.w #_TkExt,d0 + bne.s Dtk0a + +* Detokenise une extension + move.w 2(a6),d1 + move.b (a6),d2 + ext.w d2 + move.w d2,d3 + lsl.w #2,d2 + tst.l 0(a0,d2.w) + beq.s DtkEe + move.l 0(a0,d2.w),a0 + lea 4(a0,d1.w),a0 + move.l a0,a1 + bra.s Dtk3 +* Extension not present +DtkEe: lea ExtNot(pc),a0 + add.b #"A",d3 + add.b #$80,d3 + move.l a0,a1 +DtkEee tst.b (a1)+ + bpl.s DtkEee + move.b d3,-1(a1) + move.w #"I",d3 + bra.s Dtk3a + +* Un operateur +DtkOpe lea Dtk_OpFin(pc),a0 + bra.s Dtk0b +* Instruction normale +Dtk0a move.l AdTokens(a5),a0 +Dtk0b lea 4(a0,d0.w),a0 + move.l a0,a1 +Dtk3: tst.b (a1)+ + bpl.s Dtk3 + move.b (a1),d3 + cmp.b #"O",d3 + beq.s Dtk4 + cmp.b #"V",d3 + beq.s Dtk4 + cmp.b #"0",d3 0->8 des fonctions + bcs.s Dtk3a + cmp.b #"9",d3 + bcs.s Dtk4 +* Instruction : met un espace avant s'il n'y en a pas! +Dtk3a: cmp.l a4,a2 * Debut de la ligne? + beq.s Dtk4 + cmp.b #" ",-1(a4) + beq.s Dtk4 + move.b #" ",(a4)+ +* Doit prendre le token prececent? +Dtk4: move.b (a0),d1 + cmp.b #$80,d1 + bcs.s Dtk4x + cmp.b #$9f,d1 + bhi.s Dtk4x + subq.l #4,a0 + sub.b #$80,d1 + beq.s Dtk4a + ext.w d1 + sub.w d1,a0 + bra.s Dtk4x +Dtk4a: move.b -(a0),d1 + cmp.b #"!",d1 + beq.s Dtk4x + cmp.b #$80,d1 + bne.s Dtk4a + bra.s Dtk4 +* Ecrit le mot +Dtk4x: cmp.b #"!",d1 + bne.s Dtk4y + addq.l #1,a0 +Dtk4y: move.b DtkMaj1(a5),d1 + beq.s Dtk5 + cmp.b #1,d1 + beq.s Dtk6 + bne.s Dtk8 +* 0- Ecrit en MINUSCULES +Dtk5: move.b (a0)+,(a4)+ + bpl.s Dtk5 + and.b #$7f,-1(a4) + bra.s DtkE +* 1- Ecrit en MAJUSCULES +Dtk6: move.b (a0)+,d1 + move.b d1,d2 + and.b #$7f,d1 + cmp.b #"a",d1 + bcs.s Dtk7 + cmp.b #"z",d1 + bhi.s Dtk7 + sub.b #"a"-"A",d1 +Dtk7: move.b d1,(a4)+ + tst.b d2 + bpl.s Dtk6 + bra DtkE +* 2- Ecrit AVEC UNE MAJUSCULE +Dtk8: move.b (a0)+,d1 + move.b d1,d2 + and.b #$7f,d1 + cmp.b #"a",d1 + bcs.s Dtk9 + cmp.b #"z",d1 + bhi.s Dtk9 + sub.b #"a"-"A",d1 +Dtk9: move.b d1,(a4)+ + tst.b d2 + bmi.s DtkE +Dtk9a: move.b (a0)+,d1 + move.b d1,(a4)+ + bmi.s Dtk9b + cmp.b #" ",d1 + bne.s Dtk9a + bra.s Dtk8 +Dtk9b: and.b #$7f,-1(a4) +* Met une espace si c'est une INSTRUCTION +DtkE: cmp.w #_TkRem1,d0 + beq DtkRem + cmp.w #_TkRem2,d0 + beq DtkRem + cmp.b #"I",d3 + bne.s DtkE1 + move.b #" ",(a4)+ +* Saute le token... +DtkE1: move.l a6,a0 + bsr TInst + move.l a0,a6 + bra DtkLoop +* Ouverture de parenthese, jamais d'espace! +DtkP: cmp.l a4,a2 + beq.s DtkP1 + cmp.b #" ",-1(a4) + bne.s DtkP1 + subq.l #1,a4 +DtkP1: move.b #"(",(a4)+ + bra.s DtkE1 + +******* Detokenisation de VARIABLE +DtkVar: btst #0,d5 * Si variable juste avant, met 32 + beq.s DtkV0 + cmp.b #" ",-1(a4) + beq.s DtkV0 + move.b #" ",(a4)+ +DtkV0: moveq #0,d2 + move.b 2(a6),d2 * Longueur + move.w d2,d1 + subq.w #1,d1 + move.b 3(a6),d3 FLAG + lea 4(a6),a0 + moveq #0,d4 + cmp.w #_TkLab,d0 + bne.s DtkV1 + moveq #1,d4 D4: 0=> Variable + cmp.b #"0",(a0) 1=> Label + bcs.s DtkV1 -1=> Numero ligne + cmp.b #"9",(a0) + bhi.s DtkV1 + moveq #-1,d4 +DtkV1: move.b DtkMaj2(a5),d0 + beq.s DtkV2 + cmp.b #1,d0 + beq.s DtkV3 + bne.s DtkV5 +* 0- En MINUSCULES +DtkV2: move.b (a0)+,d0 + beq DtkVF + move.b d0,(a4)+ + dbra d1,DtkV2 + bra DtkVF +* 1- En MAJUSCULES +DtkV3: move.b (a0)+,d0 + beq DtkVF + cmp.b #"a",d0 + bcs.s DtkV4 + cmp.b #"z",d0 + bhi.s DtkV4 + sub.b #"a"-"A",d0 +DtkV4: move.b d0,(a4)+ + dbra d1,DtkV3 + bra DtkVF +* 2- Avec UNE MAJUSCULE +DtkV5: move.b (a6)+,d0 + cmp.b #"a",d0 + bcs.s DtkV6 + cmp.b #"z",d0 + bhi.s DtkV6 + sub.b #"a"-"A",d0 +DtkV6: move.b d0,(a4)+ + dbra d1,DtkV2 +* Saute la variable / met le flag de la variable +DtkVF: bset #0,d5 + lea 4(a6,d2.w),a6 + moveq #":",d0 + tst.w d4 + bmi DtkLoop + bne.s DtkV7 + moveq #"#",d0 + and.b #3,d3 + cmp.b #1,d3 + beq.s DtkV7 + moveq #"$",d0 + cmp.b #2,d3 + bne DtkLoop +DtkV7: move.b d0,(a4)+ + bra DtkLoop + +******* Detokenise des constantes +DtkCst: bclr #0,d5 Si variable avant, met un espace! + beq.s DtkC0 + cmp.b #" ",-1(a4) + beq.s DtkC0 + move.b #" ",(a4)+ +DtkC0: cmp.w #_TkEnt,d0 + beq.s DtkC3 + cmp.w #_TkHex,d0 + beq.s DtkC4 + cmp.w #_TkBin,d0 + beq.s DtkC5 + cmp.w #_TkFl,d0 + beq.s DtkC6 + cmp.w #_TkDFl,d0 + beq.s DtkC7 +* Detokenise une chaine alphanumerique + cmp.w #_TkCh1,d0 + bne.s DtkC0a + moveq #'"',d0 + bra.s DtkC0b +DtkC0a: moveq #"'",d0 +DtkC0b: move.b d0,(a4)+ + move.w (a6)+,d1 + subq.w #1,d1 + bmi.s DtkC2 +DtkC1: move.b (a6)+,(a4)+ + dbra d1,DtkC1 + move.w a6,d1 + btst #0,d1 + beq.s DtkC2 + addq.l #1,a6 +DtkC2: move.b d0,(a4)+ + bra DtkLoop +* Detokenise un chiffre entier +DtkC3: move.l (a6)+,d0 + move.l a4,a0 + JJsrR L_LongToDec,a1 + move.l a0,a4 + bra DtkLoop +* Detokenise un chiffre HEXA +DtkC4: move.l (a6)+,d0 + move.l a4,a0 + JJsrR L_LongToHex,a1 + move.l a0,a4 + bra DtkLoop +* Detokenise un chiffre BINAIRE +DtkC5: move.l (a6)+,d0 + move.l a4,a0 + JJsrR L_LongToBin,a1 + move.l a0,a4 + bra DtkLoop +* Detokenise un chiffre FLOAT simple precision +DtkC6: move.l (a6)+,d0 + move.l a4,a0 + moveq #-1,d4 + moveq #0,d5 + JJsrR L_FloatToAsc,a1 + exg a0,a4 + bra.s DtkC8 +* Detokenise un chiffre FLOAT double precision +DtkC7 move.l (a6)+,d0 + move.l (a6)+,d1 + pea 2.w Automatique + pea 15.w 15 maxi + move.l a4,-(sp) Buffer + move.l d1,-(sp) Le chiffre + move.l d0,-(sp) + JJsrR L_DoubleToAsc,a1 + lea 20(sp),sp + move.l a4,a0 +.Fin tst.b (a4)+ + bne.s .Fin + subq.l #1,a4 +; Si pas 0.0, le met! +DtkC8 move.b (a0)+,d0 * Si pas de .0, le met! + beq.s DtkC9 + cmp.b #".",d0 + beq DtkLoop + cmp.b #"E",d0 + beq DtkLoop + bra.s DtkC8 +DtkC9 move.b #".",(a4)+ + move.b #"0",(a4)+ + bra DtkLoop + +******* Token d'extension +DtkX: bra DtkLoop + +******* REMarque +DtkRem: addq.w #2,a6 Saute la longueur +DtkR: tst.b (a6) + beq DtkLoop + move.b (a6)+,(a4)+ + bra.s DtkR + +******* Fin de la DETOKENISATION +DtkFin: sub.l a2,a4 * Ramene PX + move.w a4,-2(a2) + move.l a4,a0 + move.w (sp)+,d0 + movem.l (sp)+,d2-d7/a2-a6 + rts + +; RAMENE LA TAILLE DE L'INSTRUCTION D0 en D1 +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +TInst: tst.w d0 + beq TFin + cmp.w #_TkLGo,d0 + bls TVar + cmp.w #_TkCh1,d0 + beq TCh + cmp.w #_TkCh2,d0 + beq TCh + cmp.w #_TkRem1,d0 + beq TCh + cmp.w #_TkRem2,d0 + beq TCh + cmp.w #_TkDFl,d0 + beq.s T8 + cmp.w #_TkFl,d0 + bls.s T4 + cmp.w #_TkExt,d0 + beq.s T4 + cmp.w #_TkFor,d0 + beq.s T2 + cmp.w #_TkRpt,d0 + beq.s T2 + cmp.w #_TkWhl,d0 + beq.s T2 + cmp.w #_TkDo,d0 + beq.s T2 + cmp.w #_TkExit,d0 + beq.s T4 + cmp.w #_TkExIf,d0 + beq.s T4 + cmp.w #_TkIf,d0 + beq.s T2 + cmp.w #_TkElse,d0 + beq.s T2 + cmp.w #_TkElsI,d0 + beq.s T2 + cmp.w #_TkData,d0 + beq.s T2 + cmp.w #_TkProc,d0 + beq.s T8 + cmp.w #_TkOn,d0 + beq.s T4 + cmp.w #_TkEqu,d0 + bcs.s T0 + cmp.w #_TkStruS,d0 + bls.s T6 +T0: moveq #1,d1 +TFin: rts +T2: addq.l #2,a0 + bra.s T0 +T4: addq.l #4,a0 + bra.s T0 +T8: addq.l #8,a0 + bra.s T0 +T6: addq.l #6,a0 + bra.s T0 +TCh: add.w (a0)+,a0 + move.w a0,d1 + btst #0,d1 + beq.s T0 + addq.l #1,a0 + bra.s T0 +TVar: moveq #0,d1 + move.b 2(a0),d1 + lea 4(a0,d1.w),a0 + bra.s T0 + +; Passe en minuscules +; ~~~~~~~~~~~~~~~~~~~~~~~~~ +Minus: cmp.b #"A",d0 + bcs.s .Skip + cmp.b #"Z",d0 + bhi.s .Skip + add.b #"a"-"A",d0 +.Skip rts + + +; Table des operateurs +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Dtk_Operateurs + dc.w 1,1 + dc.b " xor"," "+$80,"O00",-1 + dc.w 1,1 + dc.b " or"," "+$80,"O00",-1 + dc.w 1,1 + dc.b " and"," "+$80,"O00",-1 + dc.w 1,1 + dc.b "<",">"+$80,"O20",-1 + dc.w 1,1 + dc.b ">","<"+$80,"O20",-1 + dc.w 1,1 + dc.b "<","="+$80,"O20",-1 + dc.w 1,1 + dc.b "=","<"+$80,"O20",-1 + dc.w 1,1 + dc.b ">","="+$80,"O20",-1 + dc.w 1,1 + dc.b "=",">"+$80,"O20",-1 + dc.w 1,1 + dc.b "="+$80,"O20",-1 + dc.w 1,1 + dc.b "<"+$80,"O20",-1 + dc.w 1,1 + dc.b ">"+$80,"O20",-1 + dc.w 1,1 + dc.b "+"+$80,"O22",-1 + dc.w 1,1 + dc.b "-"+$80,"O22",-1 + dc.w 1,1 + dc.b " mod"," "+$80,"O00",-1 + dc.w 1,1 + dc.b "*"+$80,"O00",-1 + dc.w 1,1 + dc.b "/"+$80,"O00",-1 + dc.w 1,1 + dc.b "^"+$80,"O00",-1 + even +Dtk_OpFin + dc.l 0 +ExtNot dc.b "Extension ",$80 + + Even + + +; _____________________________________________________________________________ + +Ed_Vide dc.w 0 +CurNor dc.b %00000000 + dc.b %00000000 + dc.b %00000000 + dc.b %00000000 + dc.b %00000000 + dc.b %11111111 + dc.b %11111111 + dc.b %00000000 +CurBloc dc.b %10101010 + dc.b %01010101 + dc.b %10101010 + dc.b %01010101 + dc.b %10101010 + dc.b %01010101 + dc.b %10101010 + dc.b %01010101 + +; Controle curseur +; ~~~~~~~~~~~~~~~~ +CRet dc.b 13,10,0,0 +ChCuOn dc.b 27,"C1",0 +ChCuOff dc.b 27,"C0",0 + +; Marque des menus actives +; ~~~~~~~~~~~~~~~~~~~~~~~~ +MenuMark0 dc.b " ",0 +MenuMark1 dc.b " ->",0 +; Nom des touches de fonction +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Mt1 +Menus_Touches1 dc.b 0,K0-Mt1 0 + dc.b Shf,K1-Mt1 1 + dc.b Ctr,K2-Mt1 2 + dc.b Ami,K3-Mt1 3 + dc.b Alt,K4-Mt1 4 + dc.b Ctr+Shf,K5-Mt1 + dc.b Ctr+Ami,K6-Mt1 + dc.b Ctr+Alt,K7-Mt1 + dc.b Ami+Shf,K8-Mt1 + dc.b Ami+Alt,K9-Mt1 + dc.b Alt+Shf,K10-Mt1 0 + dc.b Shf+Alt+Ami,K11-Mt1 11 + dc.b Ctr+Alt+Ami,K12-Mt1 12 + dc.b Ctr+Shf+Ami,K13-Mt1 13 + dc.b Ctr+Shf+Alt,K14-Mt1 14 + dc.b Ctr+Shf+Alt+Ami,K15-Mt1 5 +K0 dc.b "[ ",0," ]",0 0 +K1 dc.b "[Shift+",0,"]",0 1 +K2 dc.b "[Contr+",0,"]",0 2 +K3 dc.b "[Amiga+",0,"]",0 3 +K4 dc.b "[Alter+",0,"]",0 4 +K5 dc.b "[Ct+Sh+",0,"]",0 5 +K6 dc.b "[Ct+Am+",0,"]",0 6 +K7 dc.b "[Ct+Al+",0,"]",0 7 +K8 dc.b "[Am+Sh+",0,"]",0 8 +K9 dc.b "[Am+Al+",0,"]",0 9 +K10 dc.b "[Al+Sh+",0,"]",0 10 +K11 dc.b "[SAlAm+",0,"]",0 11 +K12 dc.b "[CAlAm+",0,"]",0 12 +K13 dc.b "[CShAm+",0,"]",0 13 +K14 dc.b "[CShAl+",0,"]",0 14 +K15 dc.b "[CSAAm+",0,"]",0 15 +Menus_Touches3 dc.b "[ SubMenu ]",0 +Menus_Touches2 dc.b $80+$45,"Esc" + dc.b $80+$42,"Tab" + dc.b $80+$46,"Del" + dc.b $80+$41,"Bck" + dc.b $80+$5f,"Hlp" + dc.b $80+$44,"Ret" + dc.b $80+$4c,"Up " + dc.b $80+$4f,"Lft" + dc.b $80+$4e,"Rgt" + dc.b $80+$4d,"Dwn" + dc.b $80+$0f,"N0" + dc.b $80+$1d,"N1" + dc.b $80+$1e,"N2" + dc.b $80+$1f,"N3" + dc.b $80+$2d,"N4" + dc.b $80+$2e,"N5" + dc.b $80+$2f,"N6" + dc.b $80+$3d,"N7" + dc.b $80+$3e,"N8" + dc.b $80+$3f,"N9" + dc.b $80+$3c,"N." + dc.b $80+$43,"Ent" + dc.b $80+$50,"F1 " + dc.b $80+$51,"F2 " + dc.b $80+$52,"F3 " + dc.b $80+$53,"F4 " + dc.b $80+$54,"F5 " + dc.b $80+$55,"F6 " + dc.b $80+$56,"F7 " + dc.b $80+$57,"F8 " + dc.b $80+$58,"F9 " + dc.b $80+$59,"F10" + dc.b $80,$00 + Even + +; Numero des messages dialogue +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +EdD_Title equ 0 +EdD_Quit equ 2 +EdD_NAll equ 3 +EdD_Search equ 4 +EdD_Replace equ 6 +EdD_WBlock equ 8 +EdD_WText equ 9 +EdD_Changes equ 10 +EdD_Saved equ 11 +EdD_Macro1 equ 13 +EdD_Macro2 equ 14 +EdD_Macro3 equ 15 +EdD_MacroD equ 18 +EdD_MacroNA equ 19 +EdD_MacroAll equ 20 +EdD_MacroEra equ 21 +EdD_MacroNo equ 22 +EdD_MacroPas equ 23 +EdD_KyMn1 equ 24 +EdD_KyMn2 equ 27 +EdD_KyMn3 equ 28 +EdD_KyMnE equ 26 +EdD_PrgMn1 equ 30 +EdD_PrgMn2 equ 31 +EdD_PrgMn3 equ 32 +EdD_PrgMnE equ 33 +EdD_GotoL equ 35 +EdD_SetBuf equ 36 +EdD_TooSmall equ 37 +EdD_SetTab equ 38 +EdD_MnUsA equ 40 +EdD_MnUsD equ 41 +EdD_MnUs2 equ 42 +EdD_MnUsE equ 43 +EdD_MnUs equ 44 +EdD_SvConf equ 45 +EdD_CSaved equ 46 +EdD_AExist equ 47 +EdD_ASave equ 48 +EdD_OQuit equ 49 +EdD_Avert equ 50 +EdD_NoWarm equ 51 +EdD_WarmErr equ 52 +EdD_WarmDel equ 53 +EdD_Infos equ 54 +EdD_AboutE equ 55 +EdD_DiskErr equ 58 +EdD_Ligne equ 59 +EdD_PBloc equ 60 +EdD_PProg equ 61 +EdD_WQuit equ 62 +; ENDC diff --git a/+Editor_Config.s b/+Editor_Config.s new file mode 100644 index 0000000..39f3597 --- /dev/null +++ b/+Editor_Config.s @@ -0,0 +1,1167 @@ + + OPT D- + Include "+Equ.s" +; _____________________________________________________________________________ +; +; DEFINITION DES MESSAGES AMOS +; _____________________________________________________________________________ +; +; Published under the MIT Licence +; +; Copyright (c) 1992 Europress Software +; Copyright (c) 2020 Francois Lionet +; +; Permission is hereby granted, free of charge, to any person +; obtaining a copy of this software and associated documentation +; files (the "Software"), to deal in the Software without +; restriction, including without limitation the rights to use, +; copy, modify, merge, publish, distribute, sublicense, and/or +; sell copies of the Software, and to permit persons to whom the +; Software is furnished to do so, subject to the following +; conditions: +; +; The above copyright notice and this permission notice shall be +; included in all copies or substantial portions of the Software. +; +; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +; EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +; OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +; NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +; HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +; WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +; ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR +; THE USE OR OTHER DEALINGS IN THE SOFTWARE. +; +; ______________________________________________________________________________ + +EdT Macro + dc.b 0 + dc.b .\@E-.\@D +.\@D dc.b "\2" +.\@E + EndM +EdD Macro + dc.b 0 + dc.b .\@E-.\@D +.\@D \2 +.\@E + EndM + +Debut + + +; Config par default +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + dc.l .Ed_FConfig-.Ed_DConfig +.Ed_DConfig +; Screen definition +.Ed_Sx dc.w 640 0 +.Ed_Sy dc.w 256 2 >>> Change par install +.Ed_Wx dc.w 129 4 +.Ed_Wy dc.w 50 6 +.Ed_VScrol dc.w 300 8 +.Ed_Inter dc.b 0 10 + dc.b 0 11 +; Colour back +.Ed_ColB dc.w $000 12 +; Length UNDO +.Ed_LUndo dc.l 4096 14 >>> Change par install +.Ed_NUndo dc.l 1000 18 >>> Change par install +; Untok case +.DtkMaj1 dc.b 2 22 +.DtkMaj2 dc.b 1 23 +; Flags +.Ed_SvBak dc.b -1 24 +.EdM_Keys dc.b -1 25 +.Esc_KMemMax dc.w 20 26 +; Editor palette +.Ed_Palette dc.w $000,$06f,$077,$eee,$f00,$0dd,$0aa,$FF3 28 +; Escape mode position + dc.w 200 44 + dc.w 256 46 + ds.l 7 48 Securite +; Flags +.Ed_AutoSave dc.l 0 76 +.Ed_AutoSaveMn dc.l 0 80 +.Ed_SchMode dc.w 0 84 +.Ed_Tabs dc.w 3 86 +.Esc_Output dc.b 1 88 +.Ed_QuitFlags dc.b 1 89 Par default: confirm quit +.Ed_Insert dc.b -1 90 +.Ed_Sounds dc.b 0 91 + +; Programmes autoload +; ~~~~~~~~~~~~~~~~~~~ +.Ed_AutoLoad + dc.b 0,0,0 92 1 Curseur HAUT + dc.b 0,0,0 2 Curseur BAS + dc.b 0,0,0 3 Curseur GAUCHE + dc.b 0,0,0 4 Curseur DROITE + dc.b 0,0,0 5 Haut page + dc.b 0,0,0 6 Bas page + dc.b 0,0,0 7 Mot gauche + dc.b 0,0,0 8 Mot droite + dc.b 0,0,0 9 Page UP + dc.b 0,0,0 10 Page down + dc.b 0,0,0 11 Debut ligne + dc.b 0,0,0 12 Fin ligne + dc.b 0,0,0 13 Etat Haut + dc.b 0,0,0 14 Etat Bas + dc.b 0,0,0 15 Bas Haut + dc.b 0,0,0 16 Bas Bas + dc.b 0,0,0 17 Haut texte + dc.b 0,0,0 18 Bas texte + dc.b 0,0,0 19 Return + dc.b 0,0,0 20 Backspace + dc.b 0,0,0 21 Delete + dc.b 0,0,0 22 Efface ligne + dc.b 0,0,0 23 Delete ligne + dc.b 0,0,0 24 Tab + dc.b 0,0,0 25 Del tab + dc.b 0,0,0 26 Fix tab + dc.b 1,1,0 27 Help + dc.b 0,0,0 28 ESC + dc.b 0,0,0 29 Insert ligne + dc.b 0,0,0 30 Delete-FIN ligne + dc.b 0,0,0 31 Previous label + dc.b 0,0,0 32 Next label + dc.b 0,0,0 33 Load + dc.b 0,0,0 34 Save As + dc.b 0,0,0 35 Save + dc.b 0,0,0 36 Delete Mot + dc.b 0,0,0 37 Backspace Mot + dc.b 0,0,0 38 Hide Current Window + dc.b 0,0,0 39 Set Marks + dc.b 0,0,0 + dc.b 0,0,0 + dc.b 0,0,0 + dc.b 0,0,0 + dc.b 0,0,0 + dc.b 0,0,0 + dc.b 0,0,0 + dc.b 0,0,0 + dc.b 0,0,0 + dc.b 0,0,0 49 Goto Marks + dc.b 0,0,0 + dc.b 0,0,0 + dc.b 0,0,0 + dc.b 0,0,0 + dc.b 0,0,0 + dc.b 0,0,0 + dc.b 0,0,0 + dc.b 0,0,0 + dc.b 0,0,0 + dc.b 0,0,0 59 Switch Bloc + dc.b 0,0,0 60 Forget Bloc + dc.b 0,0,0 61 Open + Load + dc.b 0,0,0 62 Cut + dc.b 0,0,0 63 Paste + dc.b 0,0,0 64 Delete to SOL + dc.b 0,0,0 65 Undo + dc.b 0,0,0 66 Search + dc.b 0,0,0 67 Search Next + dc.b 0,0,0 68 Search Previous + dc.b 0,0,0 69 Set All block + dc.b 0,0,0 70 Recall alert + dc.b 0,0,0 71 + dc.b 0,0,0 72 Store bloc + dc.b 0,0,0 73 Set Key Shortcut + dc.b 0,0,0 74 Set Program Menu + dc.b 0,0,0 75 Flip Insert Mode + dc.b 0,0,0 76 Goto Line Number + dc.b 0,0,0 77 Run + dc.b 0,0,0 78 Test + dc.b 0,0,0 79 Indent + dc.b 0,0,0 80 New (Clear Project) + dc.b 0,0,0 81 Close + dc.b 0,0,0 82 Quit + dc.b 0,0,0 83 Informations + dc.b 0,0,0 84 Merge + dc.b 0,0,0 85 Merge Ascii + dc.b 0,0,0 86 Print Bloc + dc.b 0,0,0 87 Open/Close Proc + dc.b 0,0,0 88 Load Hidden Program + dc.b 0,0,0 89 Open All + dc.b 0,0,0 90 Close All + dc.b 0,0,0 91 Previous Window + dc.b 0,0,0 92 Next Window + dc.b 0,0,0 93 Enlarge/Schrink Window + dc.b 0,0,0 94 Redo + dc.b 0,0,0 95 Split View + dc.b 0,0,0 96 Link cursor + dc.b 0,0,0 97 Save Block as Ascii + dc.b 0,0,0 98 Save Block + dc.b 0,0,0 99 Replace + dc.b 0,0,0 100 Replace Next + dc.b 0,0,0 101 Replace Previous + dc.b 0,0,0 102 New All Hidden Programs + dc.b 0,0,0 103 Open New + dc.b 0,0,0 104 Show/Hide key shortcuts + dc.b 0,0,0 105 Goto WB + dc.b 0,0,0 106 Set New Macro + dc.b 0,0,0 107 Clear One Macro + dc.b 0,0,0 108 Clear All Macros + dc.b 0,0,0 109 Save Macros + dc.b 0,0,0 110 Load Macros + dc.b 0,0,0 111 Run Hidden + dc.b 0,0,0 112 Edit Hidden + dc.b 0,0,0 113 New Hidden + dc.b 0,0,0 114 Text Buffer + dc.b 1,32,33 0 Edit Objects + dc.b 1,34,35 Edit Icons + dc.b 1,36,37 Edit Samples + dc.b 1,38,39 Edit Resource + dc.b 0,0,0 ------------- + dc.b 1,40,0 5 Disc Manager + dc.b 1,41,0 Object Editor + dc.b 1,42,0 Sample Maker + dc.b 1,43,0 Resource Maker + dc.b 0,0,0 ------------- + dc.b 1,44,0 10 Re-tokeniser + dc.b 1,45,0 Compiler Shell + dc.b 1,46,0 Compile + dc.b 0,0,0 User Menu + dc.b 0,0,0 User Menu + dc.b 0,0,0 15 User Menu + dc.b 0,0,0 User Menu + dc.b 0,0,0 User Menu + dc.b 0,0,0 User Menu + dc.b 0,0,0 User Menu + dc.b 0,0,0 135 Add User menu + dc.b 0,0,0 136 Del User menu + dc.b 0,0,0 137 Save Default config + dc.b 0,0,0 138 Save as + dc.b 0,0,0 139 Load default config + dc.b 0,0,0 140 Load as + dc.b 0,0,0 141 + dc.b 0,0,0 142 + dc.b 0,0,0 143 + dc.b 0,0,0 144 + dc.b 0,0,0 145 + dc.b 0,0,0 146 + dc.b 0,0,0 147 + dc.b 0,0,0 148 + dc.b 0,0,0 149 + dc.b 0,0,0 150 + dc.b 0,0,0 151 + dc.b 1,1,2 152 Help Menu + dc.b 1,1,3 153 Using Help + dc.b 1,1,4 154 Editor + dc.b 1,1,5 155 Direct mode + dc.b 1,1,6 156 Syntax + dc.b 1,1,7 157 Basics + dc.b 1,1,8 158 Screen + dc.b 1,1,9 159 Object + dc.b 1,1,10 160 Audio + dc.b 1,1,11 161 Interface + dc.b 1,1,12 162 Input + dc.b 1,1,13 163 AmigaDos + dc.b 1,1,14 164 Debugging + dc.b 1,1,15 165 Machine + dc.b 1,1,16 166 Tables + dc.b 1,1,17 167 News + dc.b 1,1,2 168 Vide + dc.b 1,1,2 169 Vide + dc.b 0,0,0 170 + dc.b 0,0,0 171 + dc.b 1,25,0 172 Interpreter Setup + dc.b 1,26,27 173 Editor Setup + dc.b 1,26,28 174 Editor Menus + dc.b 1,26,29 175 Editor Dialogs + dc.b 1,26,30 176 Editor Test-Time + dc.b 1,26,31 177 Editor Run-Time + dc.b 1,26,24 178 Editor Colour Palette + dc.b 0,0,0 179 Previous programs + dc.b 0,0,0 180 Next programs + dc.b 0,0,0 181 Previous programs + dc.b 0,0,0 182 All text as block + dc.b 0,0,0 183 + dc.b 0,0,0 184 + +; Touches de fonction +; ~~~~~~~~~~~~~~~~~~~ +.Ed_KFonc: dc.b $80+$4C,$00,0 1 Curseur HAUT + dc.b $80+$4D,$00,0 2 Curseur BAS + dc.b $80+$4F,$00,0 3 Curseur GAUCHE + dc.b $80+$4E,$00,0 4 Curseur DROITE + dc.b $80+$4C,Shf,0 5 Haut page + dc.b $80+$4D,Shf,0 6 Bas page + dc.b $80+$4F,Shf,0 7 Mot gauche + dc.b $80+$4E,Shf,0 8 Mot droite + dc.b $80+$4C,Ctr,0 9 Page UP + dc.b $80+$4D,Ctr,0 10 Page down + dc.b $80+$4F,Ctr,0 11 Debut ligne + dc.b $80+$4E,Ctr,0 12 Fin ligne + dc.b $80+$3e,Ami+Shf,0 13 Etat Haut + dc.b $80+$1e,Shf+Ami,0 14 Etat Bas + dc.b $80+$3e,Ami,0 15 Bas Haut + dc.b $80+$1e,Ami,0 16 Bas Bas + dc.b $80+$4C,Ctr+Shf,0 17 Haut texte + dc.b $80+$4D,Ctr+Shf,0 18 Bas texte + dc.b 13,$00,0 19 Return + dc.b $80+$41,0,0 20 Backspace + dc.b $80+$46,0,0 21 Delete + dc.b "Q",Ctr,0 22 Efface ligne + dc.b "Y",Ctr,0 23 Delete ligne + dc.b $80+$42,0,0 24 Tab + dc.b $80+$42,Shf,0 25 Del tab + dc.b $80+$42,Ctr,0 26 Fix tab + dc.b $80+$5F,0,0 27 Help + dc.b $80+$45,0,0 28 ESC + dc.b $80+$59,0,0 29 Insert ligne + dc.b $80+$46,Ctr,0 30 Delete-FIN ligne + dc.b $80+$4C,Alt,0 31 Previous label + dc.b $80+$4D,Alt,0 32 Next label + dc.b "L",Ami,0 33 Load + dc.b "S",Ami+Shf,0 34 Save As + dc.b "S",Ami,0 35 Save + dc.b $80+$46,Shf,0 36 Delete Mot + dc.b $80+$41,Shf,0 37 Backspace Mot + dc.b "H",Ami,0 38 Hide Current Window + dc.b 1,0,0 39 Set Marks + dc.b 1,0,0 + dc.b 1,0,0 + dc.b 1,0,0 + dc.b $80+$2d,Ctr+Shf,0 + dc.b $80+$2e,Ctr+Shf,0 + dc.b $80+$2f,Ctr+Shf,0 + dc.b $80+$3d,Ctr+Shf,0 + dc.b $80+$3e,Ctr+Shf,0 + dc.b $80+$3f,Ctr+Shf,0 + dc.b $80+$0f,Ctr,0 49 Goto Marks + dc.b $80+$1d,Ctr,0 + dc.b $80+$1e,Ctr,0 + dc.b $80+$1f,Ctr,0 + dc.b $80+$2d,Ctr,0 + dc.b $80+$2e,Ctr,0 + dc.b $80+$2f,Ctr,0 + dc.b $80+$3d,Ctr,0 + dc.b $80+$3e,Ctr,0 + dc.b $80+$3f,Ctr,0 + dc.b "B",Ctr,0 59 Switch Bloc + dc.b "F",Ctr,0 60 Forget Bloc + dc.b "L",Ami+Shf,0 61 Open + Load + dc.b "C",Ctr,0 62 Cut + dc.b "P",Ctr,0 63 Paste + dc.b $80+$41,Ctr,0 64 Delete to SOL + dc.b "U",Ctr,0 65 Undo + dc.b "F",Ami,0 66 Search + dc.b "N",Ami,0 67 Search Next + dc.b "B",Ami,0 68 Search Previous + dc.b 1,0,0 69 Set All block + dc.b "K",Ctr,0 70 Recall alert + dc.b 1,0,0 71 + dc.b "S",Ctr,0 72 Store bloc + dc.b 1,0,0 73 Set Key Shortcut + dc.b 1,0,0 74 Set Program Menu + dc.b $80+$57,0,0 75 Flip Insert Mode + dc.b "G",Ami,0 76 Goto Line Number + dc.b $80+$50,0,0 77 Run + dc.b $80+$51,0,0 78 Test + dc.b $80+$52,0,0 79 Indent + dc.b "Q",Ami,0 80 New + dc.b "Q",Ami+Shf,0 81 Close + dc.b 1,0,0 82 Quit + dc.b "I",Ami,0 83 Informations + dc.b "M",Ami,0 84 Merge + dc.b "M",Ami+Shf,0 85 Merge Ascii + dc.b "P",Ctr+Shf,0 86 Print Bloc + dc.b $80+$58,0,0 87 Open/Close Proc + dc.b 1,0,0 88 Load Hidden Program + dc.b "O",Ami+Shf,0 89 Open All + dc.b "C",Ami+Shf,0 90 Close All + dc.b $80+$55,0,0 91 Previous Window + dc.b $80+$56,0,0 92 Next Window + dc.b $80+$2e,Ami,0 93 Enlarge/Schrink Window + dc.b "U",Ctr+Shf,0 94 Redo + dc.b "V",Shf+Ami,0 95 Split View + dc.b "C",Ami,0 96 Link cursor + dc.b "A",Ctr+Shf,0 97 Save Block as Ascii + dc.b "S",Ctr+Shf,0 98 Save Block + dc.b "F",Ami+Shf,0 99 Replace + dc.b "N",Ami+Shf,0 100 Replace Next + dc.b "B",Ami+Shf,0 101 Replace Previous + dc.b 1,0,0 102 New All Hidden Programs + dc.b "W",Shf+Ami,0 103 Open New + dc.b "K",Ami,0 104 Show/Hide key shortcuts + dc.b 1,0,0 105 Goto WB + dc.b "M",Ctr,0 106 Set New Macro + dc.b 1,0,0 107 Clear One Macro + dc.b 1,0,0 108 Clear All Macros + dc.b 1,0,0 109 Save Macros + dc.b 1,0,0 110 Load Macros + dc.b 1,0,0 111 Run Hidden + dc.b 1,0,0 112 Edit Hidden + dc.b 1,0,0 113 New Hidden + dc.b "T",Ami+Shf,0 114 Text Buffer + dc.b 1,0,0 0 User Menu + dc.b 1,0,0 User Menu + dc.b 1,0,0 User Menu + dc.b 1,0,0 User Menu + dc.b 1,0,0 User Menu + dc.b 1,0,0 5 User Menu + dc.b 1,0,0 User Menu + dc.b 1,0,0 User Menu + dc.b 1,0,0 User Menu + dc.b 1,0,0 User Menu + dc.b 1,0,0 10 User Menu + dc.b 1,0,0 User Menu + dc.b 1,0,0 User Menu + dc.b 1,0,0 User Menu + dc.b 1,0,0 User Menu + dc.b 1,0,0 15 User Menu + dc.b 1,0,0 User Menu + dc.b 1,0,0 User Menu + dc.b 1,0,0 User Menu + dc.b 1,0,0 User Menu + dc.b "U",Ami,0 135 Add User menu + dc.b "U",Ami+Shf,0 136 Del User menu + dc.b 1,0,0 137 Save Default config + dc.b 1,0,0 138 Save as + dc.b 1,0,0 139 Load default config + dc.b 1,0,0 140 Load as + dc.b 1,0,0 141 Quit options + dc.b 1,0,0 142 Autosave + dc.b 1,0,0 143 Load Defalt macros + dc.b 1,0,0 144 Save default macros + dc.b $80+$53,0,0 145 Monitor + dc.b "P",Ami,0 146 Print text + dc.b "I",Ami+Shf,0 147 Check 1.3 + dc.b 1,0,0 148 Sound On.Off + dc.b 1,0,0 149 About + dc.b 1,0,0 150 About + dc.b 1,0,0 151 Insert ML + dc.b 1,0,0 152 + dc.b 1,0,0 153 + dc.b 1,0,0 154 + dc.b 1,0,0 155 + dc.b 1,0,0 156 + dc.b 1,0,0 157 + dc.b 1,0,0 158 + dc.b 1,0,0 159 + dc.b 1,0,0 160 + dc.b 1,0,0 161 + dc.b 1,0,0 162 + dc.b 1,0,0 163 + dc.b 1,0,0 164 + dc.b 1,0,0 165 + dc.b 1,0,0 166 + dc.b 1,0,0 167 + dc.b 1,0,0 168 + dc.b 1,0,0 169 + dc.b 1,0,0 170 + dc.b 1,0,0 171 + dc.b 1,0,0 172Interpreter Setup + dc.b 1,0,0 173Editor Setup + dc.b 1,0,0 174Editor Menus + dc.b 1,0,0 175Editor Dialogs + dc.b 1,0,0 176Test-Time + dc.b 1,0,0 177Run-Time + dc.b 1,0,0 178Colour Palette + dc.b 1,0,0 179Previous programs + dc.b 1,0,0 180Next programs + dc.b "A",Ctr,0 181All text as block + dc.b 1,0,0 182 + dc.b $80+$54,0,0 183Go Help + dc.b 1,0,0 184 + dc.b $FF,0 + +.Ed_Code dc.l "1.10" + +.Ed_FConfig + +; Chaines systeme +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + dc.l .Sys2-.Sys1 +.Sys1 +; Dïż½finitions ligne d'etat + EdT 1,< 1 2 3 4 5 6 7> + EdT 2, + EdT 3,< Edit> + EdT 4, + EdT 5, + EdT 6, + EdT 7, +; Alert, Couleurs messages + EdD 8, +; Etat, Init ligne + EdD 9, +; Etat, CLW ligne activee + EdD 10, +; Etat, CLW ligne inactivee + EdD 11, +; Etat, definition des couleurs des zones active + EdD 12, +; Touches de fonction de la barre de menu + EdD 13, +; ESC, Attente caractere + EdD 14, +; Vide! + EdT 15,<> +; ESC, Initialisation + EdD 16, +; Inverse, debut bloc + EdD 17, +; Fin bloc, retour normale + EdD 18, +; Definition des sliders editeur + EdD 19, +; Effacement de l'ecran + EdD 20, +; Suffixes + EdT 21,<.Bak> + EdT 22,<.AMOS> +; Sliders editeur II + EdD 23, +; Boutons du mode direct + EdT 24, + EdT 25, + EdT 26, + EdT 27, + EdT 28, + EdT 29, + EdT 30, + EdT 31, + EdT 32, + EdT 33, + EdT 34, + EdT 35, + EdT 36, + EdT 37, + EdT 38, + EdT 39, + EdT 40, + EdT 41, + EdT 42, + EdT 43, + EdT 44,<> +; Fichiers systeme + EdT 45, + EdT 46, + EdT 47, + EdT 48, + EdT 49, + dc.b 0,$FF + even +.Sys2 + +; Chaines Menus +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + dc.l .Mn2-.Mn1 +.Mn1 IncBin "bin/Editor_Menus.asc" + Even +.Mn2 + +; Messages de l'ïż½diteur +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + dc.l Ed2-Ed1 +Ed1 EdT 1, + EdT 2, + EdT 3, + EdT 4, + EdT 5, + EdT 6, + EdT 7, + EdT 8, + EdT 9, + EdT 10, + EdT 11,< already exists. Overwrite?> + EdT 12, + EdT 13, + EdT 14, + EdT 15, + EdT 16, + EdT 17, + EdT 18, + EdT 19, + EdT 20, + EdT 21, + EdT 22, + EdT 23,<ïż½ 1992 Europress Software Ltd.> + EdT 24,< extensions loaded.> + EdT 25,