Commit a3488144 authored by Ben Avison's avatar Ben Avison
Browse files

Applied some polish ahead of the Raspberry Pi release

Detail:
  * Simplified the icon bar menu (all the old options are still available
    from the menu on the "task display" window).
  * Fixed the heroes list code - it looks like this broke when the ROM moved
    to a top-bit-set address, and nobody bothered fixing it until now.
  * Made the code to reset the machine manually conditional on NoARMv3,
    since all ARMv3+ machines have OSes that implement OS_Reset. This makes
    the module build cleanly for all current ROM builds.
Admin:
  Tested in a Raspberry Pi build

Version 1.39. Tagged as 'Switcher-1_39'
parent 8a727f93
No preview for this file type
......@@ -11,13 +11,13 @@
GBLS Module_HelpVersion
GBLS Module_ComponentName
GBLS Module_ComponentPath
Module_MajorVersion SETS "1.38"
Module_Version SETA 138
Module_MajorVersion SETS "1.39"
Module_Version SETA 139
Module_MinorVersion SETS ""
Module_Date SETS "12 Aug 2012"
Module_ApplicationDate SETS "12-Aug-12"
Module_Date SETS "12 Sep 2012"
Module_ApplicationDate SETS "12-Sep-12"
Module_ComponentName SETS "Switcher"
Module_ComponentPath SETS "castle/RiscOS/Sources/Desktop/Switcher"
Module_FullVersion SETS "1.38"
Module_HelpVersion SETS "1.38 (12 Aug 2012)"
Module_FullVersion SETS "1.39"
Module_HelpVersion SETS "1.39 (12 Sep 2012)"
END
/* (1.38)
/* (1.39)
*
* This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.1.
*
*/
#define Module_MajorVersion_CMHG 1.38
#define Module_MajorVersion_CMHG 1.39
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 12 Aug 2012
#define Module_Date_CMHG 12 Sep 2012
#define Module_MajorVersion "1.38"
#define Module_Version 138
#define Module_MajorVersion "1.39"
#define Module_Version 139
#define Module_MinorVersion ""
#define Module_Date "12 Aug 2012"
#define Module_Date "12 Sep 2012"
#define Module_ApplicationDate "12-Aug-12"
#define Module_ApplicationDate "12-Sep-12"
#define Module_ComponentName "Switcher"
#define Module_ComponentPath "castle/RiscOS/Sources/Desktop/Switcher"
#define Module_FullVersion "1.38"
#define Module_HelpVersion "1.38 (12 Aug 2012)"
#define Module_LibraryVersionInfo "1:38"
#define Module_FullVersion "1.39"
#define Module_HelpVersion "1.39 (12 Sep 2012)"
#define Module_LibraryVersionInfo "1:39"
......@@ -22,6 +22,7 @@
GET Hdr:Macros
GET Hdr:System
GET Hdr:Machine.<Machine>
GET Hdr:CPU.Arch
GET Hdr:UserIF.<UserIF>
GET Hdr:Proc
GET Hdr:CMOS
......@@ -266,9 +267,8 @@ savedesk_nexttask # 4 ; age of next task to consider
ml_savedbox # 4 ; length of mb_savedbox
autosave # 4 ; flag for savestate
menuclick # 1 ; non-zero then called during decodemenu
soft_poweroff # 1 ; non-zero if PSU has software control
# 2 ; spare
# 3 ; spare
global_taskage # 4 ; for sorting tasks into order of creation
......@@ -312,7 +312,7 @@ h_shutdown # 4
h_powerdown # 4
messagedata # 4 ; pointer to 16-byte message file descriptor
m_iconbarmenu_width # 4 ; original width of iconbarmenu
m_taskdisplaymenu_width # 4 ; original width of taskdisplaymenu
menu_userblk # 4 ; pointer to task block
......@@ -322,19 +322,23 @@ mb_newtask # 1024 ; *command to pass to Wimp_StartTask
mb_taskname # 40 ; Task '<taskname>'
ram_menustart # 0
m_iconbarmenu # m_headersize+mi_size* 4
[ Freeze
m_iconbarmenu # m_headersize+mi_size* 10
m_taskdisplaymenu # m_headersize+mi_size* 10
|
m_iconbarmenu # m_headersize+mi_size* 9
m_taskdisplaymenu # m_headersize+mi_size* 9
]
m_task # m_headersize+mi_size* 1
m_newtask # m_headersize+mi_size* 1
ram_menuend # 0
mm_info * m_iconbarmenu + m_headersize + mi_submenu + mi_size * mo_ic_info
mm_config * m_iconbarmenu + m_headersize + mi_size * mo_ic_config
mm_savedbox * m_iconbarmenu + m_headersize + mi_submenu + mi_size * mo_ic_savestate
mm_info_td * m_taskdisplaymenu + m_headersize + mi_submenu + mi_size * mo_td_info
mm_config_td * m_taskdisplaymenu + m_headersize + mi_size * mo_td_config
mm_savedbox * m_taskdisplaymenu + m_headersize + mi_submenu + mi_size * mo_td_savestate
mm_info_ic * m_iconbarmenu + m_headersize + mi_submenu + mi_size * mo_ic_info
mm_config_ic * m_iconbarmenu + m_headersize + mi_size * mo_ic_config
h_savedbox # 4 ; copied into mm_savedbox in CopyMenus
max_mem_drag # 4 ; maximum memory for next drag
......@@ -3423,6 +3427,7 @@ restart
SWI XOS_Reset ; on RISC OS 3.5 and above, do simple reset
[ NoARMv3
MOV r1, #Service_PreReset
SWI XOS_ServiceCall
......@@ -3437,6 +3442,7 @@ restart
LDR r1, [r0]
STR r1, [r0, -r0] ; poke reset address from ROM to vectors
MOV PC, #0 ; jeronimo
]
;..............................................................................
[ PowerDownReset
......@@ -4922,13 +4928,13 @@ gettext_callafter
; the pointer to a meaningful message.
gettext EntryS "R0-R5"
MOV R0,#0
STRB R0,changetext ; don't change text again (until next time non-zero)
LDR R3,nextstring ; -> next string
MOVS R0,R3
ADRMIL R0,AuthorsTextCopy ; -> copy of the string
MOV R0,R3
CMP R0,#-1
ADREQL R0,AuthorsTextCopy ; -> copy of the string
ADR R1,AuthorsText ; -> buffer to put the string into
MOV R4,#(AuthorsTextCopy-AuthorsText)-1
......@@ -4940,7 +4946,7 @@ gettext EntryS "R0-R5"
BHI %BT10 ; loop back until it has all been copied
CMP R3,#-1 ; was it the default text?
BLE %FT20 ; having copied then exit
BEQ %FT20 ; having copied then exit
LDRB R2,[R0]
TEQ R2,#0 ; any more messages?
......@@ -5490,9 +5496,6 @@ copyr0r2
;..............................................................................
click_menu
MOV R0,#0
STRB R0,menuclick ; internal flag to indicate if I need to make a menu?
;
LDR R0,[R1,#b_window]
LDR R14,info_handle
CMP R0,R14 ; is it the info dialogue
......@@ -5584,24 +5587,20 @@ notinfobox
CMP R0,#iconbar_whandle ; forget it unless iconbar
Pull "PC",NE
ADRL R0,mstr_taskwindow
MOV R4,#0
BL make_mb_taskname ; R2 = no of chars in buffer
LDR R2,[R1] ; mouse x
MOV R3,#96 + 4*44 - 12
ADRL R1,m_iconbarmenu
STR R1,menuhandle
LDR R14,[R1,#16] ; get menu width
SUB R2,R2,R14,ASR #1 ; ensure mouse ptr is in middle
ADD R3,R3,#12
SWI XWimp_CreateMenu
Pull "PC",VS
LDR R14,m_iconbarmenu+m_headersize+mi_iconflags+mi_size* mo_ic_task
BIC R14,R14,#is_shaded
STR R14,m_iconbarmenu+m_headersize+mi_iconflags+mi_size* mo_ic_task
MOV R14,#-1
STR R14,m_iconbarmenu+m_headersize+mi_submenu+mi_size* mo_ic_task
[ Freeze
BL setfreezeentry
MOV R14,#96 + 10*44 - 12 ; 1 extra menu entry (Info)
|
MOV R14,#96 + 9*44 - 12 ; 1 extra menu entry (Info)
]
STR R14,[R1,#b_y] ; fake mouse y-coord
MOV userblk,#-2 ; copied into [menutask]
B zapwidth
MOV R0,#0
STRB R0,keycount ; reset the index into the key counter loop
BL refind_font
Pull "PC"
noticonbar
LDMIA R1,{cx0,cy0} ; cx0,cy0 = mouse click coords
......@@ -5624,12 +5623,12 @@ noticonbar
02
nottask1
CMP userblk,#0
LDR R14,m_iconbarmenu+m_headersize+mi_iconflags+mi_size* mo_ic_task
LDR R14,m_taskdisplaymenu+m_headersize+mi_iconflags+mi_size* mo_td_task
ORRLE R14,R14,#is_shaded
BICGT R14,R14,#is_shaded
STR R14,m_iconbarmenu+m_headersize+mi_iconflags+mi_size* mo_ic_task
STR R14,m_taskdisplaymenu+m_headersize+mi_iconflags+mi_size* mo_td_task
ADRL R14,m_task
STR R14,m_iconbarmenu+m_headersize+mi_submenu+mi_size* mo_ic_task
STR R14,m_taskdisplaymenu+m_headersize+mi_submenu+mi_size* mo_td_task
[ Freeze
BL setfreezeentry
]
......@@ -5638,18 +5637,18 @@ nottask1
ADDGT R4,userblk,#icb_taskname
BL make_mb_taskname ; R2 = no of chars in result
; R2 = number of characters in mo_ic_task menu entry
; R2 = number of characters in mo_td_task menu entry
zapwidth
Pull "PC",VS
MOV R2,R2,LSL #4 ; multiply by 16
ADD R2,R2,#12 ; and add 12
LDR r14, m_iconbarmenu_width
LDR r14, m_taskdisplaymenu_width
CMP r2, r14
MOVLT r2, r14
;
STR R2,m_iconbarmenu+m_itemwidth
STR R2,m_taskdisplaymenu+m_itemwidth
;
gomenu
CMP userblk,#0
......@@ -5686,13 +5685,9 @@ gomenu
ADD R1,sp,#4
SWIVC XWimp_SetIconState
LDR R1,[sp],#5*4 ; restore R1 and correct stack
;
LDRB R0,menuclick
CMP R0,#0 ; need to open the menu?
BNE %FT10
;
LDMIA R1,{R2,R3} ; mouse x,y (may be faked)
ADRL R1,m_iconbarmenu
ADRL R1,m_taskdisplaymenu
STR R1,menuhandle
LDR R14,[R1,#16] ; get menu width
SUB R2,R2,R14,ASR #1 ; ensure mouse ptr is in middle
......@@ -5702,7 +5697,6 @@ gomenu
MOV R0,#0
STRB R0,keycount ; reset the index into the key counter loop
10
BL refind_font
Pull "PC"
......@@ -5712,10 +5706,10 @@ setfreezeentry
SWI XPortable_ReadFeatures ;Bitset returned in R1
MOVVS R1,#0
TST R1,#PortableFeature_Stop
LDR R14,m_iconbarmenu+m_headersize+mi_iconflags+mi_size* mo_ic_freeze
LDR R14,m_taskdisplaymenu+m_headersize+mi_iconflags+mi_size* mo_td_freeze
ORREQ R14,R14,#is_shaded
BICNE R14,R14,#is_shaded
STR R14,m_iconbarmenu+m_headersize+mi_iconflags+mi_size* mo_ic_freeze
STR R14,m_taskdisplaymenu+m_headersize+mi_iconflags+mi_size* mo_td_freeze
EXITS
]
......@@ -5771,35 +5765,38 @@ menu_selection
decodemenu
Push "LR"
;
decodelp
MOV R14,#flg_exit ; default action if used
STRB R14,shutdownflag
ADRL R14,m_iconbarmenu
TEQ R1,R14
BEQ sel_iconbar
ADRL R14,m_taskdisplaymenu
TEQ R1,R14
Pull "PC",NE
Debug mn,"Must be a valid menu",R1
sel_iconbar
MOV R14,#flg_exit ; default action if used
STRB R14,shutdownflag
sel_taskdisplay
LDR R14,[R2],#4 ; top-level menu
TEQ R14,#mo_ic_newtask
TEQ R14,#mo_td_newtask
BEQ gonewtask
TEQ R14,#mo_ic_task
TEQ R14,#mo_td_task
BEQ gotask
TEQ R14,#mo_ic_exit
TEQ R14,#mo_td_exit
BEQ goexit
TEQ R14,#mo_ic_config
TEQ R14,#mo_td_config
BEQ goconfig
[ Freeze
TEQ R14,#mo_ic_freeze
TEQ R14,#mo_td_freeze
BEQ gofreeze
]
TEQ R14,#mo_ic_shutdown
TEQ R14,#mo_td_shutdown
BEQ goshutdown
TEQ R14,#mo_ic_taskw
TEQ R14,#mo_td_taskw
BEQ key_taskwindow
TEQ R14,#mo_ic_shell
TEQ R14,#mo_td_shell
Pull "PC",NE
;
......@@ -5808,6 +5805,16 @@ key_shellcli
SWI XWimp_StartTask
Pull "PC"
sel_iconbar
LDR R14,[R2],#4 ; top-level menu
TEQ R14,#mo_ic_config
BEQ goconfig
TEQ R14,#mo_ic_taskw
BEQ key_taskwindow
TEQ R14,#mo_ic_shutdown
BEQ goshutdown
Pull "PC"
key_taskwindow
MOV R0,#0
SWI XWimp_ReadSysInfo
......@@ -5931,13 +5938,6 @@ openswitcher
Pull "PC",NE
;
LDR R2,menutask ; task to be killed
BL %FT10
;
MOV userblk,#-1 ; no task has been selected
STRB userblk,menuclick
B nottask1
10
Push "LR"
B goquitit
;........................................................................
......@@ -6568,19 +6568,25 @@ str_newline = 10,0
rom_menustart
m_iconbarmenu Menu T00
m_iconbarmenu Menu T03
mo_ic_info Item M00
mo_ic_newtask Item M01,m_newtask
mo_ic_task Item M02,m_task
mo_ic_config Item M09
mo_ic_shell Item M03
mo_ic_taskw Item M04
mo_ic_savestate Item M05
mo_ic_exit Item M06
mo_ic_shutdown Item M08
m_taskdisplaymenu Menu T00
mo_td_info Item M00
mo_td_newtask Item M01,m_newtask
mo_td_task Item M02,m_task
mo_td_config Item M09
mo_td_shell Item M03
mo_td_taskw Item M04
mo_td_savestate Item M05
mo_td_exit Item M06
[ Freeze
mo_ic_freeze Item M07
mo_td_freeze Item M07
]
mo_ic_shutdown Item M08
mo_td_shutdown Item M08
m_task Menu T02
mo_ts_quit Item M12
......@@ -6619,29 +6625,31 @@ CopyMenus Entry "r1-r7"
MOV r0, #OSFile_ReadNoPath
SWI XOS_File
09
LDR r14, mm_config + 8
LDR r14, mm_config_td + 8
ORRVS r14, r14, #is_shaded
TEQ r0, #object_directory
ORRNE r14, r14, #is_shaded
BICEQ r14, r14, #is_shaded ; directory was found
STR r14, mm_config + 8
STR r14, mm_config_td + 8
STR r14, mm_config_ic + 8
LDR r14, info_handle
STR r14, mm_info
STR r14, mm_info_td
STR r14, mm_info_ic
LDR r14, h_savedbox
STR r14, mm_savedbox
wsaddr r14, mb_taskname
STR r14, m_iconbarmenu + m_headersize + mo_ic_task * mi_size + mi_icondata
STR r14, m_taskdisplaymenu + m_headersize + mo_td_task * mi_size + mi_icondata
LDR r1, =12*16 + 12 ; correct width of m_newtask
LDR r14, m_newtask + m_itemwidth
CMP r1, r14
STRGT r1, m_newtask + m_itemwidth
LDR r14, m_iconbarmenu + m_itemwidth
STR r14, m_iconbarmenu_width ; save for later
LDR r14, m_taskdisplaymenu + m_itemwidth
STR r14, m_taskdisplaymenu_width ; save for later
EXIT
LTORG
......
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