From: mdw Date: Tue, 27 Jul 1999 18:55:38 +0000 (+0000) Subject: Various changes of a plausible nature. X-Git-Url: https://git.distorted.org.uk/~mdw/ssr/commitdiff_plain/a3da4c116d4216fdec125d687dfc347e343a8b28 Various changes of a plausible nature. --- diff --git a/StraySrc/Libraries/Sapphire/sail/s/ctrl b/StraySrc/Libraries/Sapphire/sail/s/ctrl index caac640..20936a8 100644 --- a/StraySrc/Libraries/Sapphire/sail/s/ctrl +++ b/StraySrc/Libraries/Sapphire/sail/s/ctrl @@ -332,7 +332,6 @@ ctrl_for ROUT ADD R14,R4,#cFor__resume ;Point to resume buffer LDR R1,sail_tokAnchor ;Find anchor of script buff - LDR R1,[R1] ;SODDING WIMPEXTENSION!!! SUB R1,R10,R1 ;Work out current offset LDR R0,sail_line ;Get the current line number STMIA R14,{R0,R1} ;Save these in the frame @@ -399,7 +398,6 @@ ctrl_next ROUT LDMIA R14,{R0,R1} ;Load the line and offset STR R0,sail_line ;Save the line counter LDR R14,sail_tokAnchor ;Find the anchor of the file - LDR R14,[R14] ;Pointless instruction ADD R10,R14,R1 ;Get the new offset SUB R10,R10,#1 ;Backtrack to read prev token MOV R9,#0 ;Give bogus current token @@ -425,7 +423,6 @@ ctrl_repeat ROUT MOV R0,#cFrame__repeat ;Create a REPEAT frame BL ctrl__pushFrame ;Stick that on the stack LDR R2,sail_tokAnchor ;Find anchor of script buff - LDR R2,[R2] ;SODDING WIMPEXTENSION!!! SUB R2,R10,R2 ;Work out current offset LDR R1,sail_line ;Get the current line number STMIA R0,{R1,R2} ;Save these in the frame @@ -461,7 +458,6 @@ ctrl_until ROUT LDMIA R1,{R0,R1} ;Load the line and offset STR R0,sail_line ;Save the line counter LDR R14,sail_tokAnchor ;Find the anchor of the file - LDR R14,[R14] ;Pointless instruction ADD R10,R14,R1 ;Get the new offset SUB R10,R10,#1 ;Backtrack to read prev token MOV R9,#-1 ;Give bogus current token @@ -480,7 +476,6 @@ ctrl_while ROUT MOV R0,#cFrame__while ;Create a REPEAT frame BL ctrl__pushFrame ;Stick that on the stack LDR R2,sail_tokAnchor ;Find anchor of script buff - LDR R2,[R2] ;SODDING WIMPEXTENSION!!! SUB R2,R10,R2 ;Work out current offset LDR R1,sail_line ;Get the current line number STMIA R0,{R1,R2} ;Save these in the frame @@ -546,7 +541,6 @@ ctrl_endwhile ROUT LDMIA R1,{R0,R1} ;Load the line and offset STR R0,sail_line ;Save the line counter LDR R14,sail_tokAnchor ;Find the anchor of the file - LDR R14,[R14] ;Pointless instruction ADD R10,R14,R1 ;Get the new offset SUB R10,R10,#1 ;Backtrack to read prev token MOV R9,#-1 ;Give bogus current token @@ -646,7 +640,6 @@ ctrl_gosub ROUT MOV R0,#cFrame__gosub ;Create a REPEAT frame BL ctrl__pushFrame ;Stick that on the stack LDR R2,sail_tokAnchor ;Find anchor of script buff - LDR R2,[R2] ;SODDING WIMPEXTENSION!!! SUB R2,R10,R2 ;Work out current offset LDR R1,sail_line ;Get the current line number STMIA R0,{R1,R2} ;Save these in the frame @@ -656,7 +649,6 @@ ctrl_gosub ROUT LDMIB R3,{R0,R1} ;Load out address/line STR R1,sail_line ;Store the line number LDR R1,sail_tokAnchor ;Load anchor address - LDR R1,[R1,#0] ;WimpExtension is bollocks MOV R9,#-1 ;Don't confuse getToken ADD R10,R0,R1 ;This is where we are BL getToken ;Prime the lookahead token @@ -683,7 +675,6 @@ ctrl_return ROUT LDMIA R1,{R0,R1} ;Load the line and offset STR R0,sail_line ;Save the line counter LDR R14,sail_tokAnchor ;Find the anchor of the file - LDR R14,[R14] ;Pointless instruction ADD R10,R14,R1 ;Get the new offset SUB R10,R10,#1 ;Backtrac a little MOV R9,#-1 ;Give bogus current token @@ -830,7 +821,6 @@ ctrl_goto ROUT LDMIB R0,{R0,R1} ;Load out address/line STR R1,sail_line ;Store the line number LDR R1,sail_tokAnchor ;Load anchor address - LDR R1,[R1,#0] ;WimpExtension is bollocks MOV R9,#-1 ;Don't confuse getToken ADD R10,R0,R1 ;This is where we are BL getToken ;Prime the lookahead token @@ -915,7 +905,7 @@ ctrl_case ROUT CMPEQ R9,#':' ;No -- check for colon CMPNE R9,#&0A ;Newline? BEQ %80ctrl_case ;Yes -- let it rip - CMP R9,#'"' ;Is this a quote? + CMP R9,#'""' ;Is this a quote? EOREQ R5,R5,#1 ;Yes -- toggle quoted bit BL getToken ;Get another token B %b00 ;And keep going @@ -1262,9 +1252,8 @@ ctrl_findDATA ROUT STMFD R13!,{R1,R2,R14} ;Save some registers LDR R0,sail_dataPtr ;Load the current position LDR R1,sail_tokAnchor ;Load the anchor - LDR R1,[R1] ADD R0,R1,R0 ;Point into the file - LDR R2,sail_dataLine ;Line number of DATA + LDR R2,sail_dataLine ;Line number of DATA ; --- Search the file for DATA, or EOF --- @@ -1292,7 +1281,6 @@ ctrl_read ROUT LDR R4,sail_dataPtr ;Load the current position LDR R5,sail_tokAnchor ;Load the anchor - LDR R5,[R5] ADD R4,R5,R4 ;Point into the file 00ctrl_read LDRB R14,[R4,#0] ;Load the byte there @@ -1764,6 +1752,7 @@ ctrl_fn ROUT BL stracc_ensure ;Get current strac position LDMFD R13!,{R0} ;Load registers back again STR R1,[R0,#cFn__stracc] ;Save this away + ; Oh, bugger. This doesn't work. LDR R14,sail_currAnchor ;Load the current anchor STR R14,sail_oldAnchor ;Save this as the old one LDR R14,sail_tokAnchor ;Now we work from the file