Commit fa42b0ad authored by Jeffrey Lee's avatar Jeffrey Lee
Browse files

Replace OS_SpriteOp reason code magic numbers with definitions. Add support for new screen modes.

Detail:
  s/Tiling, s/Tiling3D, s/Watchdog, s/Wimp05, s/Wimp07, s/Wimp09 - Replaced OS_SpriteOp reason code magic numbers with symbolic definitions.
  s/Wimp01 - Update *WimpMode / Wimp_SetMode to use OS_ScreenMode 13 (mode string to specifer) in place of its own code if a mode specifier string has been given. Note - mode number handling is unchanged, so a mode specifier string which begins with a mode number will currently have the specifier part ignored.
  s/Wimp01, s/Wimp02 - Flag_* -> ModeFlag_* renaming
  s/Wimp02 - Fix mode specifier copying to only stop copying when we hit a mode variable of -1. Previous code would also stop if the variable value was -1. Update mode set code to apply the Wimp's special greyscale palettes if the greyscale mode flag is set (i.e. greyscale mode was set via specifier generated by OS_ScreenMode 13)
Admin:
  Tested on BB-xM


Version 5.31. Tagged as 'Wimp-5_31'
parent 2404aff8
......@@ -11,13 +11,13 @@
GBLS Module_HelpVersion
GBLS Module_ComponentName
GBLS Module_ComponentPath
Module_MajorVersion SETS "5.30"
Module_Version SETA 530
Module_MajorVersion SETS "5.31"
Module_Version SETA 531
Module_MinorVersion SETS ""
Module_Date SETS "01 Jun 2013"
Module_ApplicationDate SETS "01-Jun-13"
Module_Date SETS "07 Aug 2013"
Module_ApplicationDate SETS "07-Aug-13"
Module_ComponentName SETS "Wimp"
Module_ComponentPath SETS "castle/RiscOS/Sources/Desktop/Wimp"
Module_FullVersion SETS "5.30"
Module_HelpVersion SETS "5.30 (01 Jun 2013)"
Module_FullVersion SETS "5.31"
Module_HelpVersion SETS "5.31 (07 Aug 2013)"
END
/* (5.30)
/* (5.31)
*
* This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.1.
*
*/
#define Module_MajorVersion_CMHG 5.30
#define Module_MajorVersion_CMHG 5.31
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 01 Jun 2013
#define Module_Date_CMHG 07 Aug 2013
#define Module_MajorVersion "5.30"
#define Module_Version 530
#define Module_MajorVersion "5.31"
#define Module_Version 531
#define Module_MinorVersion ""
#define Module_Date "01 Jun 2013"
#define Module_Date "07 Aug 2013"
#define Module_ApplicationDate "01-Jun-13"
#define Module_ApplicationDate "07-Aug-13"
#define Module_ComponentName "Wimp"
#define Module_ComponentPath "castle/RiscOS/Sources/Desktop/Wimp"
#define Module_FullVersion "5.30"
#define Module_HelpVersion "5.30 (01 Jun 2013)"
#define Module_LibraryVersionInfo "5:30"
#define Module_FullVersion "5.31"
#define Module_HelpVersion "5.31 (07 Aug 2013)"
#define Module_LibraryVersionInfo "5:31"
......@@ -311,8 +311,7 @@ findwimpspritefordepth
LDR R2,list_at
CMP R2,#0
BNE %FT05
MOV R0,#24
ORR R0,R0,#256
MOV R0,#SpriteReason_SelectSprite+256
[ SpritePriority
LDR R1,baseofhisprites
|
......@@ -321,8 +320,7 @@ findwimpspritefordepth
ADD R2,SP,#4
SWI XOS_SpriteOp
BVC %FT07
MOV R0,#24
ORR R0,R0,#256
MOV R0,#SpriteReason_SelectSprite+256
[ SpritePriority
LDR R1,baseoflosprites
|
......
......@@ -149,7 +149,7 @@ TileWindowBackground
bne %FT00
adr r2,tile_1
mov r0,#24 :OR: 256
mov r0,#SpriteReason_SelectSprite :OR: 256
swi XOS_SpriteOp
bvs %FT00
......@@ -392,7 +392,7 @@ find_tile_sprite
Pull "r0-r3,pc"
02 mov r0,#24 :OR: 256
02 mov r0,#SpriteReason_SelectSprite :OR: 256
[ SpritePriority
ldr r1,baseofhisprites
|
......@@ -404,7 +404,7 @@ find_tile_sprite
mov r3,sp
bvc %BT01
mov r0,#24 :OR: 256
mov r0,#SpriteReason_SelectSprite :OR: 256
[ SpritePriority
ldr r1,baseoflosprites
|
......
......@@ -331,7 +331,7 @@ screen_callback
Push "R0-R3,lr"
MOV R3,#1
ADR R2,scrn_pathname
MOV R0,#2
MOV R0,#SpriteReason_ScreenSave
SWI XOS_SpriteOp
MOVVS R1,#1
MOVVS R2,#0
......
......@@ -2513,6 +2513,22 @@ Wimp_SetMode_Code
[ Medusa
setmode_from_specifier
; R1 -> string
[ {TRUE}
; See if the OS can handle the conversion for us
MOV R0,#ScreenModeReason_ModeStringToSpecifier
SUB SP,SP,#ModeSelector_MaxSize
MOV R2,SP
MOV R3,#ModeSelector_MaxSize
SWI XOS_ScreenMode
ADDVS SP,SP,#ModeSelector_MaxSize
BVS setmode_from_specifier_manual
MOV R0,SP
SWI XWimp_SetMode
; TODO anything extra here?
ADD SP,SP,#ModeSelector_MaxSize
Pull "PC"
setmode_from_specifier_manual
]
MOV R0,#-1
LDR R12,[R12]
Push "R12"
......@@ -2702,7 +2718,7 @@ scan_ended
CMP R0,R14
MOVHI R0,#0
MOVHI R14,R5,LSR #3
MOVLS R0,#Flag_DoubleVertical
MOVLS R0,#ModeFlag_DoubleVertical
MOVLS R14,R5,LSR #4
SUB R14,R14,#1
STR R0,[R12,#-16] ; store the mode flags
......@@ -3313,7 +3329,7 @@ Init
]
MOV R0,#62
MOV R0,#SpriteReason_ReadSaveAreaSize
MOV R2,#0
SWI XOS_SpriteOp ; get size of area
MOVVC R0,#ModHandReason_Claim
......
......@@ -1790,7 +1790,7 @@ validatemode
MOVCSS r0,#1 ; For the NE on MyXError below ! Carry preserved
BCS %FT01
;
TST R2,#Flag_NonGraphic ; NE => this is a non-graphic mode
TST R2,#ModeFlag_NonGraphic ; NE => this is a non-graphic mode
BNE %FT01
;
MOV R1,#VduExt_Log2BPP
......@@ -1844,32 +1844,27 @@ copy_mode_specifier
MOVLO PC,LR ; V will be clear
Push "R0-R3,LR"
MOV R2,#20 ; skip permanent bit
MOV R2,#ModeSelector_ModeVars ; skip permanent bit
ADD R0,R0,R2
5
LDR R14,[R0],#4
ADD R2,R2,#4
LDR R14,[R0],#8
ADD R2,R2,#8
CMP R14,#-1
BNE %BT5
; need R2 of RMA
MOV R3,R2
; need R2-4 of RMA
SUB R3,R2,#4
MOV R0,#ModHandReason_Claim
BL XROS_Module
LDRVS R0,currentmode
STRVS R0,[SP] ; use old mode if can't claim
Pull "R0-R3,PC",VS
MOV R3,R2
LDR R1,[SP]
LDR R1,[SP] ; get source block
STR R2,[SP] ; return copied block
7
LDR R14,[R1],#4
STR R14,[R3],#4
CMP R14,#-1
SUBS R3,R3,#4
STR R14,[R2],#4
BNE %BT7
SUB R14,R3,R2 ; -1 is allowed in first bit
CMP R14,#24
BLO %BT7
; R2 -> copy of specifier
STR R2,[SP]
CLRV
Pull "R0-R3,PC"
]
......@@ -2008,10 +2003,26 @@ nomodemess
BLVC int_allbutmode ; sets up mode variables etc.
[ Medusa
ADRL R14,greys_mode
LDRB R14,[R14]
Push "r3-r4"
; for 4bpp & 8bpp, check the OS's greyscale palette flag and set our flag if appropriate
; in 1bpp & 2bpp we don't care, we always use greyscale
; we probably don't care in 8bpp as well (since the OS will have set the palette for us), but we'll still set the flag just to be sure
ADRL R4,greys_mode
LDR R3,log2bpp
TEQ R3,#3
TEQNE R3,#2
BNE %FT50
MOV R0,#-1
MOV R1,#VduExt_ModeFlags
SWI XOS_ReadModeVariable
TST R2,#ModeFlag_GreyscalePalette
ORRNE R3,R3,#128
STRNEB R3,[R4]
50
LDRB R14,[R4]
TEQ R14,#0
BLNE recalc_greys_palette
Pull "r3-r4"
]
; attempt to recache the borders if required
......
......@@ -354,6 +354,8 @@ caret_cross * 3*caret_stroke ; width of cross-pieces (OS units)
upfancyfont
LDR R14,log2bpp
TEQ R14,#3
LDREQ R14,modeflags
TSTEQ R14,#ModeFlag_FullPalette
SWIEQ XColourTrans_GCOLToColourNumber
MOV R2,#&14 ; use OS units
......@@ -4345,7 +4347,7 @@ menu_checkforsprite Entry "R0-R6"
BEQ %FT07
TEQ R1,#1
BEQ %FT05 ; in wimp area
MOV R0,#24+256
MOV R0,#SpriteReason_SelectSprite+256
SWI XOS_SpriteOp
B %FT07
|
......@@ -4378,13 +4380,13 @@ menu_checkforsprite Entry "R0-R6"
Push "R2"
CMP R1, #1 ; try any user area before either Wimp area
SETPSR V_bit, R0, EQ ; SETV will *not* do, it corrupts Z
MOVNE R0, #512+40 ; attempt to read sprite information
MOVNE R0, #512+SpriteReason_ReadSpriteSize ; attempt to read sprite information
SWINE XOS_SpriteOp
MOVVS R0, #512+40
MOVVS R0, #512+SpriteReason_ReadSpriteSize
LDRVS R1, baseofhisprites
LDRVS R2, [SP]
SWIVS XOS_SpriteOp ; not there? try again within high-priority area
MOVVS R0, #512+40
MOVVS R0, #512+SpriteReason_ReadSpriteSize
LDRVS R1, baseoflosprites
LDRVS R2, [SP]
SWIVS XOS_SpriteOp ; not there? try again within low-priority area
......@@ -4393,10 +4395,10 @@ menu_checkforsprite Entry "R0-R6"
TEQ R1,#1
LDREQ R1,baseofsprites ; area may be 1 from above
MOV R0,#40+512
MOV R0,#SpriteReason_ReadSpriteSize+512
SWI XOS_SpriteOp
LDRVS R1,baseofromsprites
MOVVS R0,#40+512
MOVVS R0,#SpriteReason_ReadSpriteSize+512
SWIVS XOS_SpriteOp
]
EXIT VS
......
......@@ -2500,9 +2500,9 @@ oldapploop
Push "R2"
CMP R1, #1 ; try any user area before either Wimp area
SETPSR V_bit, R0, EQ ; SETV will *not* do, it corrupts Z
MOVNE R0, #256+24 ; attempt to select sprite
MOVNE R0, #256+SpriteReason_SelectSprite ; attempt to select sprite
SWINE XOS_SpriteOp
MOVVS R0, #256+24
MOVVS R0, #256+SpriteReason_SelectSprite
LDRVS R1, baseofhisprites
LDRVS R2, [SP]
SWIVS XOS_SpriteOp ; not there? try again within high-priority area
......@@ -2514,11 +2514,11 @@ oldapploop
|
CMP R1,#1
LDREQ R1,baseofsprites
MOV R0,#24+256 ; attempt to select sprite
MOV R0,#SpriteReason_SelectSprite+256 ; attempt to select sprite
Push "R2"
SWI XOS_SpriteOp
LDRVS R1,baseofromsprites
MOVVS R0,#256+24 ; would have been done by the error!
MOVVS R0,#256+SpriteReason_SelectSprite ; would have been done by the error!
LDRVS R2,[SP]
SWIVS XOS_SpriteOp ; not there? try again within the ROM
Pull "R2" ; sprite op can stuff R2
......
......@@ -242,7 +242,7 @@ makespritelist Entry "R0-R4,R8-R9"
SUB R4, R4, #spName
]
MOV R0, #512
ORR R0, R0, #25
ORR R0, R0, #SpriteReason_DeleteSprite
MOV R1, R8
MOV R2, R4
SWI XOS_SpriteOp ; delete the unnecessary sprite
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment