Przeglądaj źródła

tigcclib: optimize (-10 bytes) the internal F-Line emulator init & cleanup code (Martial, Lionel).
Make the Basecode Parameters example a testcase for F-Line ROM_CALLs, it runs on AMS 2.04+ only.
Make the Progress Bar exemple a testcase for internal F-Line emulator.

git-svn-id: file:///var/svn/tigccpp/trunk@1339 9552661e-59e3-4036-b4f2-dbe53926924f

debrouxl 15 lat temu
rodzic
commit
aef2456619

+ 18 - 5
tigcc/archive/startup/_fline_internal_emulator.s

@@ -5,18 +5,31 @@
 
 .section _st130
 __install_fline_emulator:
+| Save old vector
 	lea.l __ams_fline_vec__(%pc),%a0
-	move.l 0x2C,(%a0)
+	move.l 0x2C:w,(%a0)
+| Save %a2 since we may not destroy it when we return to the OS / launcher.
+	pea (%a2)
+| Unprotect the vector table
+	lea 0x600001,%a2
+	moveq #2,%d0
+	bclr.b %d0,(%a2)
+| Store new vector
 	lea.l __fline_handler(%pc),%a0
-	bclr.b #2,0x600001
 	move.l %a0,0x2C:w
-	bset.b #2,0x600001
+| Protect the vector table
+	bset.b %d0,(%a2)
 
 .section _st1030
 __uninstall_fline_emulator:
-	bclr.b #2,0x600001
+| Unprotect the vector table
+	moveq #2,%d0
+	bclr.b %d0,(%a2)
+| Restore old vector
 	move.l __ams_fline_vec__(%pc),0x2C:w
-	bset.b #2,0x600001
+| Protect the vector table
+	bset.b %d0,(%a2)
+	move.l (%sp)+,%a2
 
 .section _st10030
 __fline_handler:

+ 1 - 1
tigcc/examples/Basecode Parameters.tpr

@@ -40,7 +40,7 @@ Minimum AMS Version Defined=0
 Minimum AMS Version=1.00
 Unofficial OS Support=0
 Reloc Format=AMS
-ROM Call Format=Direct
+ROM Call Format=F-Line
 BSS Ref Format=Kernel
 Data Ref Format=Kernel
 Use F-Line Jumps=0

+ 45 - 5
tigcc/examples/Progress Bar.tpr

@@ -3,16 +3,56 @@ Archive=0
 Pack=0
 Packed Variable=
 Project Name=Progress
-GCC Switches=-Os -Wall -W -Wwrite-strings
-GNU Assembler Switches=
+GCC Switches=-Os -Wall -W -Wwrite-strings -ffunction-sections -fdata-sections
 Assembler Switches=-g -t
-GNU Linker Switches=
-Linker Switches=
+GNU Assembler Switches=
 Debug Info=0
 Standard Library=1
 Command Line=
 Post-Build Process=
+Use Data Variable=0
+Data Variable=
+Copy Data Variable=1
+Copy Data Variable if Archived=1
+Optimize NOPs=1
+Optimize Returns=1
+Optimize Branches=1
+Optimize Moves=1
+Optimize Tests=1
+Optimize Calculations=1
+Remove Unused Sections=1
+Binary Output=0
+Fargo=0
+Flash OS=0
+Cut Unused Ranges=1
+Reorder Sections=1
+Merge Constants=1
+Initialize BSS=1
+
+[Library Options]
+Use TI-89=0
+Use TI-92 Plus=0
+Use V200=0
+Optimize Calc Consts=0
+Use Kernel=0
+Use PreOS=0
+Minimum AMS Version Defined=0
+Minimum AMS Version=1.00
+Unofficial OS Support=0
+Reloc Format=AMS
+ROM Call Format=F-Line
+BSS Ref Format=Kernel
+Data Ref Format=Kernel
+Use F-Line Jumps=0
+Use 4-Byte F-Line Jumps=0
+Use Internal F-Line Emulator=1
+Use Return Value=0
+Enable Error Return=0
+Save Screen=0
+Optimize ROM Calls=0
+
+[File Editing]
+Open File=
 
 [Included Files]
 C File 1=Progress.c
-

+ 1 - 1
tigcc/examples/Progress.c

@@ -1,6 +1,6 @@
 // Progress bar example for TIGCC
 
-// Define this to display the progress bar in a window
+// Define this to display the progress bar in a (large) window
 //#define USE_WINDOW_PB
 
 #define USE_TI89              // Compile for TI-89