diff --git a/Sources/SprExtend b/Sources/SprExtend index dab2e452460895b53064d8f8eebec09b9b0ef2bb..5c8fcf17188021fbd908e49285698406a862ea5f 100644 --- a/Sources/SprExtend +++ b/Sources/SprExtend @@ -257,6 +257,15 @@ $l LDR $temp, [$sprite, #$offset] BHI %F99 ; out of range MEND + MACRO +$l CheckAlignedAndSensible $addr,$failed +$l TST $addr, #3 ; word aligned? + BNE $failed + CMP $addr, #256 ; outside processor vectors? + BLO $failed + MEND + + ; ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ; Data areas & register allocation ; ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ diff --git a/Sources/SprOp b/Sources/SprOp index fadbcc3f3beb9d8e1d3a4a42ee2da9f7337f973b..13e2d9c16d8231c5d9fe36c1de035b69b06e366c 100644 --- a/Sources/SprOp +++ b/Sources/SprOp @@ -1042,6 +1042,12 @@ getspritename ADRL R3,spritename ADD R4,R3,#12 + + CMP R2,#256 ; sensible name ptr? + BHS %FT01 + ADR R0,ErrorBlock_BadAddress + BL copy_error_one + B %FT99 01 LDRB R0,[R2],#1 CMP R0,#" " ; ignore control characters and <space> too! @@ -1056,7 +1062,7 @@ getspritename CMP R3,R4 ; pad with nulls STRCCB R0,[R3],#1 BCC %BT03 -99 +99 STRVS R0,[R13] Pull "R0-R1,R3-R4,PC" MakeSpriteErrorBlock NoWorkSpace,,NoWork @@ -1076,14 +1082,17 @@ getspriteaddr ADREQ R0, ErrorBlock_NoWorkSpace ; can't do anything with this! addr r1, Title, EQ BLEQ copy_error_one ; Always sets the V bit - BVS %FT99 + BVS %FT98 MOV R1,R0 ; R1 -> system sprite area STR R1,[sp] ; return for AppendSprite + B %FT01 00 + CheckAlignedAndSensible R1,%F99 TEQ R14,#&200 ; R2 --> sprite already - BEQ %FT99 + BEQ %FT97 +01 ADRL R14,spritename LDMIA R14,{R3,R4,R5} @@ -1101,7 +1110,7 @@ getspriteaddr ] BLCS get_sprite_doesnt_exist_error ; r0-> error block, V set - BVS %FT99 + BVS %FT98 LDMIA R2,{R1,R6,R7,R8} ; get link plus name TEQ R6,R3 @@ -1109,9 +1118,17 @@ getspriteaddr TEQEQ R8,R5 ADDNE R2,R2,R1 BNE %BT04 +97 + CheckAlignedAndSensible R2,%F99 +98 + Pull "R1,R3-R9,PC" 99 + ADR R0,ErrorBlock_BadAddress + BL copy_error_one Pull "R1,R3-R9,PC" + MakeErrorBlock BadAddress + ; makepalette16bpp ; convert palette to 16bpp for output to 16bpp mode plotting directly from palette ; if this is not done, the spriteextend blitter will run out of registers! @@ -2889,8 +2906,7 @@ Go_CheckSpriteArea Push "r1-r5, lr" ; 6 regs + r0/r10/r11 to mess with, total 9 - TST r1, #3 ; at least need an aligned area to start with - BNE %FT99 + CheckAlignedAndSensible r1,%F99 ; at least need an aligned area to start with ASSERT SpriteAreaCBsize = (4 * 4) LDMIA r1, {r2-r5} diff --git a/VersionASM b/VersionASM index ca35831bacac78efa1f408240c1fca5f8dfe511a..53ac12282c1d7a737f456fb9fe906f51c88169a5 100644 --- a/VersionASM +++ b/VersionASM @@ -11,13 +11,13 @@ GBLS Module_HelpVersion GBLS Module_ComponentName GBLS Module_ComponentPath -Module_MajorVersion SETS "1.42" -Module_Version SETA 142 +Module_MajorVersion SETS "1.43" +Module_Version SETA 143 Module_MinorVersion SETS "" -Module_Date SETS "14 Apr 2011" -Module_ApplicationDate SETS "14-Apr-11" +Module_Date SETS "25 Jun 2011" +Module_ApplicationDate SETS "25-Jun-11" Module_ComponentName SETS "SprExtend" Module_ComponentPath SETS "mixed/RiscOS/Sources/Video/Render/SprExtend" -Module_FullVersion SETS "1.42" -Module_HelpVersion SETS "1.42 (14 Apr 2011)" +Module_FullVersion SETS "1.43" +Module_HelpVersion SETS "1.43 (25 Jun 2011)" END diff --git a/VersionNum b/VersionNum index 2902fea919b0b7f46cfc6b7478f207a29d46d143..e99c764db31f5e23e6ec8b5379aee5de2b52f475 100644 --- a/VersionNum +++ b/VersionNum @@ -1,23 +1,23 @@ -/* (1.42) +/* (1.43) * * This file is automatically maintained by srccommit, do not edit manually. * Last processed by srccommit version: 1.1. * */ -#define Module_MajorVersion_CMHG 1.42 +#define Module_MajorVersion_CMHG 1.43 #define Module_MinorVersion_CMHG -#define Module_Date_CMHG 14 Apr 2011 +#define Module_Date_CMHG 25 Jun 2011 -#define Module_MajorVersion "1.42" -#define Module_Version 142 +#define Module_MajorVersion "1.43" +#define Module_Version 143 #define Module_MinorVersion "" -#define Module_Date "14 Apr 2011" +#define Module_Date "25 Jun 2011" -#define Module_ApplicationDate "14-Apr-11" +#define Module_ApplicationDate "25-Jun-11" #define Module_ComponentName "SprExtend" #define Module_ComponentPath "mixed/RiscOS/Sources/Video/Render/SprExtend" -#define Module_FullVersion "1.42" -#define Module_HelpVersion "1.42 (14 Apr 2011)" -#define Module_LibraryVersionInfo "1:42" +#define Module_FullVersion "1.43" +#define Module_HelpVersion "1.43 (25 Jun 2011)" +#define Module_LibraryVersionInfo "1:43"