Commit 2c9aad90 authored by Robert Sprowson's avatar Robert Sprowson
Browse files

Make Mike's macros permanent.

While the HAL and kernel were being split some temporary macros were used for the bits being worked on, after 12 years of use they're probably safe to adopt.
mjsCallHAL -> CallHAL; mjsAddressHAL -> AddressHAL; mjsHAL -> HAL.
OS_VIDCDividerSWI code now always does NoSuchSWI (had been switched out previously).
File vduhint.s no longer assembled (was empty).


Version 5.35, 4.79.2.150. Tagged as 'Kernel-5_35-4_79_2_150'
parent 5fcf3e37
......@@ -13,11 +13,11 @@
GBLS Module_ComponentPath
Module_MajorVersion SETS "5.35"
Module_Version SETA 535
Module_MinorVersion SETS "4.79.2.149"
Module_Date SETS "18 May 2012"
Module_ApplicationDate SETS "18-May-12"
Module_MinorVersion SETS "4.79.2.150"
Module_Date SETS "21 May 2012"
Module_ApplicationDate SETS "21-May-12"
Module_ComponentName SETS "Kernel"
Module_ComponentPath SETS "castle/RiscOS/Sources/Kernel"
Module_FullVersion SETS "5.35 (4.79.2.149)"
Module_HelpVersion SETS "5.35 (18 May 2012) 4.79.2.149"
Module_FullVersion SETS "5.35 (4.79.2.150)"
Module_HelpVersion SETS "5.35 (21 May 2012) 4.79.2.150"
END
......@@ -5,19 +5,19 @@
*
*/
#define Module_MajorVersion_CMHG 5.35
#define Module_MinorVersion_CMHG 4.79.2.149
#define Module_Date_CMHG 18 May 2012
#define Module_MinorVersion_CMHG 4.79.2.150
#define Module_Date_CMHG 21 May 2012
#define Module_MajorVersion "5.35"
#define Module_Version 535
#define Module_MinorVersion "4.79.2.149"
#define Module_Date "18 May 2012"
#define Module_MinorVersion "4.79.2.150"
#define Module_Date "21 May 2012"
#define Module_ApplicationDate "18-May-12"
#define Module_ApplicationDate "21-May-12"
#define Module_ComponentName "Kernel"
#define Module_ComponentPath "castle/RiscOS/Sources/Kernel"
#define Module_FullVersion "5.35 (4.79.2.149)"
#define Module_HelpVersion "5.35 (18 May 2012) 4.79.2.149"
#define Module_FullVersion "5.35 (4.79.2.150)"
#define Module_HelpVersion "5.35 (21 May 2012) 4.79.2.150"
#define Module_LibraryVersionInfo "5:35"
......@@ -1185,16 +1185,12 @@ CLine_Softcopy # 1 ; Added for Morris - Monitor id
VRAMWidth # 1 ; 0 => no VRAM, 1 => 32-bits wide, 2 => 64-bits wide
[ {FALSE} ;;; mjsHAL no LCD support
LCD_Active # 1 ; Added to support LCD/CRT switching. bm 6 bits 0=>External CRT in use, 1=>Mono, 2=>Passive colour, 3=>Active colour
; bit 7 unset=>single panel, set=>dual panel
LCD_Inverted # 1 ; Added to support LCD palette inversion. 0=normal, 1=inverted. Note that the inversion is invisible to apps.
[ :DEF: ShowWS
! 0, "LCD_Active flag byte held at ":CC::STR:(LCD_Active)
]
|
# 2 ; SPARE
]
]
[ HAL
......@@ -1414,18 +1410,8 @@ ChocolateMSBlocks # 4 ; -> array of blocks for module SWI hash n
! 0, "ChocolateMSBlocks at ":CC::STR:(ChocolateMSBlocks)
]
[ :LNOT: HAL
mjs_tempHALworkspace # 4 ; required only temporarily for semi-HALised code still in RO kernel
[ :DEF: ShowWS
! 0, "*** mjs_tempHALworkspace should be removed when kernel/HAL split permits"
]
; !!!! Free Space (36 bytes)
OldSWIHashspace # 9*4
|
; !!!! Free Space (40 bytes)
OldSWIHashspace # 10*4
]
|
; !!!! Free Space (64 bytes)
OldSWIHashspace # 16*4
......
......@@ -180,12 +180,6 @@ SixteenMByte EQU (1024*1024 * 16)
KEEP
; *****************************************************************************
; mjs Oct 2000 kernel/HAL split
; SetDAG stuff is no more, routines like SetVinit now call equivalent HAL
; routine
; **************** CAM manipulation utility routines ***********************************
; **************************************************************************************
......@@ -468,8 +462,8 @@ SSETMEMC ROUT
MOV r1, #0 ; no funny business with DPMS
MOV r0, #0
MOV r1
mjsAddressHAL
mjsCallHAL HAL_Video_SetBlank
AddressHAL
CallHAL HAL_Video_SetBlank
Pull "r0-r3, r9, r14"
]
......
......@@ -113,7 +113,6 @@
$GetMemInfo
! 0, "Main kernel size = &" :CC: :STR: (.-KernelBase)
StartOfVduDriver
GET s.vdu.vduhint
GET s.vdu.VduDriver
GET s.vdu.VduSWIs
GET s.vdu.VduPalette
......
......@@ -872,11 +872,7 @@ MMUon_nol1ptoverlap
AddressHAL
CallHAL HAL_Init
[ DebugHALTX
BL DebugHALPrint
= "HAL initialised",0
ALIGN
]
DebugTX "HAL initialised"
LDR a1, =ZeroPage
LDR v1, [a1, #InitUsedBlock]
......
......@@ -16,28 +16,9 @@
SUBT Arthur Variables
OPT 4
; -----------------------------------------------------------------------------
;
; mjs Oct 2000 kernel/HAL split
;
; macros that can be switched between doing real HAL calls and pseudo
; HAL calls with r9-> mjs pseudo HAL workspace
;
; these have been handy for interim HALising of kernel code in-situ
; (particularly used for video stuff), but can probably disappear later
;
[ HAL
MACRO
mjsAddressHAL $zero
AddressHAL $zero
MEND
MACRO
mjsCallHAL $rout
CallHAL $rout
MEND
; +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
; handy macros:
; +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
MACRO
DebugTX $str
......@@ -47,24 +28,6 @@
ALIGN
]
MEND
|
MACRO
mjsAddressHAL
LDR r9, =mjs_tempHALworkspace
LDR r9, [r9] ; sb -> pseudo HAL workspace
MEND
MACRO
mjsCallHAL $rout
BL $rout
MEND
] ;HAL
; +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
; handy macros:
; +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
MACRO
$l CheckSpaceOnStack $space, $faildest, $tmp
......@@ -804,14 +767,8 @@ JTABLE & SWIWriteC
& NoSuchSWI ; SpecialControl
& NoSuchSWI ; EnterUSR32SWI
& NoSuchSWI ; EnterUSR26SWI
& NoSuchSWI ; VIDCDividerSWI
; End of unavailable SWIs.
; Should not cause any problems on any machine. STB flag just to be safe though.
[ STB :LAND: {FALSE}
& VIDCDividerSWI
|
! 0, "mjsHAL - VIDCDividerSWI not implemented"
& NoSuchSWI
]
& NVMemorySWI
& NoSuchSWI
& NoSuchSWI
......
......@@ -37,12 +37,6 @@ SixteenMByte EQU (1024*1024 * 16)
KEEP
; *****************************************************************************
; mjs Oct 2000 kernel/HAL split
; SetDAG stuff is no more, routines like SetVinit now call equivalent HAL
; routine
; **************** CAM manipulation utility routines ***********************************
; **************************************************************************************
......@@ -319,8 +313,8 @@ SSETMEMC ROUT
MOV r1, #0 ; no funny business with DPMS
MOV r0, #0
MOV r1
mjsAddressHAL
mjsCallHAL HAL_Video_SetBlank
AddressHAL
CallHAL HAL_Video_SetBlank
Pull "r0-r3, r9, r14"
]
......
......@@ -1521,8 +1521,8 @@ Vdu23_0_8 ROUT
Pull "R14"
|
Push "R0-R3, R9, R12, LR"
mjsAddressHAL
mjsCallHAL HAL_Video_SetInterlace
AddressHAL
CallHAL HAL_Video_SetInterlace
Pull "R0-R3, R9, R12, LR"
]
......
......@@ -177,24 +177,24 @@ VduInit ROUT
STRB R0, [WsPtr, #ExternalFramestore]
Push "r4, r9, r12"
mjsAddressHAL
AddressHAL
MOV r4, r12 ; temp WsPtr
mjsCallHAL HAL_Video_Features
CallHAL HAL_Video_Features
; Set bit 31 of features if HAL_Video_Render supported
CheckHAL HAL_Video_Render, r1
ORREQ r0, r0, #1:SHL:31
STR r0, [r4, #HALVideoFeatures]
[ :LNOT:UseGraphicsV
mjsCallHAL HAL_Video_PixelFormats
CallHAL HAL_Video_PixelFormats
STR r0, [r4, #HWPixelFormats]
mjsCallHAL HAL_Video_BufferAlignment
CallHAL HAL_Video_BufferAlignment
STR r0, [r4, #HWBufferAlign]
]
Pull "r4, r9, r12"
;;; sort this out!
! 0, "mjsHAL not doing anything useful with HAL_Video_BufferAlignment"
! 0, "mjsHAL not dealing with lack of h/w pointer"
! 0, "HAL not doing anything useful with HAL_Video_BufferAlignment"
! 0, "HAL not dealing with lack of h/w pointer"
LDR R0, =RangeC+SpriteReason_SwitchOutputToSprite
STR R0, [WsPtr, #SpriteMaskSelect]
......@@ -245,18 +245,6 @@ VduInit ROUT
MOV R2, #7 ; copy 7 pages
BL DoResetFont
[ :LNOT: HAL
;
; mjsHAL - temporary workspace while semi HALised code still in kernel
;
MOV r3, #mjs_thalwk_size
BL ClaimSysHeapNode ; this had better succeed!
LDR r4, =mjs_tempHALworkspace
STR r2, [r4, #0]
BL mjs_tempHALworkspace_init
;
]
;initialise the 6 pointer shape pointers and blocks
;(shape buffers are 6 * &100 starting at CursorData)
;
......@@ -906,7 +894,7 @@ TV_Mode_string
[ {FALSE} ;;; LCDPowerCtrl :LAND: :LNOT: STB
;;; mjsHAL no LCD support
;;; HAL no LCD support
;Switch LCD off here if it is _not_ an LCD mode
MOV R3, #0
LDRB R3, [R3, #LCD_Active]
......@@ -1090,8 +1078,8 @@ TV_Mode_string
MOV R4, #GraphicsV_SetMode
BL CallGraphicsV
|
mjsAddressHAL
mjsCallHAL HAL_Video_SetMode
AddressHAL
CallHAL HAL_Video_SetMode
Pull "R0-R3, R9, R12" ; restore registers after HAL call
]
......@@ -1127,7 +1115,7 @@ TV_Mode_string
BL FF
[ {FALSE} ;;; LCDPowerCtrl :LAND: :LNOT: STB
;;; mjsHAL no LCD support
;;; HAL no LCD support
;Switch the LCD on if LCD mode
Push "r0"
MOV R1, #0
......@@ -1747,10 +1735,7 @@ svc_PortMan
MOVNE PC, LR
[ {TRUE}
;;;mjsHAL - may need sorting/HAL split
;;; for now, switched out coz kernel doesn't have VIDCControlSoftCopy any more!
;;;
! 0, "mjsHAL - svc_PortMan currently broken by kernel/HAL split"
! 0, "HAL - svc_PortMan broken by kernel/HAL split due to lack of VIDCControlSoftCopy"
MOV PC, LR
|
; When PortManager restarts, we need to put TV_Mode back. PortMan defaults to
......
......@@ -84,75 +84,75 @@ GV_VSync ROUT
GV_SetMode
Push "r0-r3, r9, lr"
mjsAddressHAL WsPtr
AddressHAL WsPtr
MOV r4, #0
mjsCallHAL HAL_Video_SetMode
CallHAL HAL_Video_SetMode
Pull "r0-r3, r9, pc"
GV_SetInterlace
Push "r0-r3, r9, lr"
mjsAddressHAL WsPtr
AddressHAL WsPtr
MOV r4, #0
mjsCallHAL HAL_Video_SetInterlace
CallHAL HAL_Video_SetInterlace
Pull "r0-r3, r9, pc"
GV_SetBlank
Push "r0-r3, r9, lr"
mjsAddressHAL WsPtr
AddressHAL WsPtr
MOV r4, #0
mjsCallHAL HAL_Video_SetBlank
CallHAL HAL_Video_SetBlank
Pull "r0-r3, r9, pc"
GV_UpdatePointer
Push "r0-r3, r9, lr"
mjsAddressHAL WsPtr
AddressHAL WsPtr
MOV r4, #0
mjsCallHAL HAL_Video_UpdatePointer
CallHAL HAL_Video_UpdatePointer
Pull "r0-r3, r9, pc"
GV_SetDMAAddress
Push "r0-r3, r9, lr"
mjsAddressHAL WsPtr
AddressHAL WsPtr
MOV r4, #0
mjsCallHAL HAL_Video_SetDAG
CallHAL HAL_Video_SetDAG
Pull "r0-r3, r9, pc"
GV_VetMode
Push "r1-r3, r9, lr"
mjsAddressHAL WsPtr
AddressHAL WsPtr
MOV r4, #0
mjsCallHAL HAL_Video_VetMode
CallHAL HAL_Video_VetMode
Pull "r1-r3, r9, pc"
GV_DisplayFeatures
Push "r0,r1,r3, r9, lr"
mjsAddressHAL WsPtr
AddressHAL WsPtr
MOV r4, #0
mjsCallHAL HAL_Video_Features
CallHAL HAL_Video_Features
STR r0, [sp, #0]
mjsCallHAL HAL_Video_PixelFormats
CallHAL HAL_Video_PixelFormats
STR r0, [sp, #4]
mjsCallHAL HAL_Video_BufferAlignment
CallHAL HAL_Video_BufferAlignment
MOV r2, r0
Pull "r0,r1,r3, r9, pc"
GV_WritePaletteEntry
Push "r0-r3, r9, lr"
mjsAddressHAL WsPtr
AddressHAL WsPtr
MOV r4, #0
mjsCallHAL HAL_Video_WritePaletteEntry
CallHAL HAL_Video_WritePaletteEntry
Pull "r0-r3, r9, pc"
GV_WritePaletteEntries
Push "r0-r3, r9, lr"
mjsAddressHAL WsPtr
AddressHAL WsPtr
MOV r4, #0
mjsCallHAL HAL_Video_WritePaletteEntries
CallHAL HAL_Video_WritePaletteEntries
Pull "r0-r3, r9, pc"
GV_ReadPaletteEntry
Push "r0,r2-r3, r9, lr"
mjsAddressHAL WsPtr
AddressHAL WsPtr
CheckHAL HAL_Video_ReadPaletteEntry, r3
Pull "r0,r2-r3, r9, pc", EQ
MOV r4, #0
......@@ -172,17 +172,17 @@ GV_Render
MOVEQ pc, lr
Push "r0-r3, r9, lr"
ORR r0, r0, #1:SHL:31
mjsAddressHAL
mjsCallHAL HAL_Video_Render
AddressHAL
CallHAL HAL_Video_Render
TEQ r0, #0
MOVPL r4, #0
Pull "r0-r3, r9, pc"
GV_IICOp
Push "r9, lr"
mjsAddressHAL WsPtr
AddressHAL WsPtr
MOV r4, #0
mjsCallHAL HAL_Video_IICOp
CallHAL HAL_Video_IICOp
Pull "r9, pc"
CallGraphicsV
......
......@@ -85,7 +85,7 @@ MOSPaletteV ROUT
B PV_BulkRead ; 7
B PV_BulkWrite ; 8
B PV_GammaCorrect ; 9
[ LCDInvert
[ LCDInvert :LAND: :LNOT: HAL
B PV_LCDInvert ; 10
|
MOV pc, lr ; 10
......@@ -641,8 +641,8 @@ UpdateSettingCommon ROUT
BCC %FT10 ; only hit hardware if flash state = first
;;;mjsHAL
;;; old code had possible LCD greyscale munging, not supported in interim s.vduhint code
;;; mjs
;;; Pre HAL code had possible LCD greyscale munging, not supported in interim s.vduhint code
;;;
[ UseGraphicsV
Push "r0-r2,r4,lr"
......@@ -661,8 +661,8 @@ UpdateSettingCommon ROUT
CMP r0, #256 ; HI if pointer
MOVLS r0, r0, LSR #8 ; type 0=normal, 1=border
MOVHI r0, #2 ; type 2=pointer
mjsAddressHAL
mjsCallHAL HAL_Video_WritePaletteEntry
AddressHAL
CallHAL HAL_Video_WritePaletteEntry
Pull "r0-r3, r12, lr"
]
......@@ -692,8 +692,8 @@ UpdateSettingCommon ROUT
BCS %FT20 ; only hit hardware if flash state = second
;;;mjsHAL
;;; old code had possible LCD greyscale munging, not supported in interim s.vduhint code
;;; mjs
;;; Pre HAL code had possible LCD greyscale munging, not supported in interim s.vduhint code
;;;
[ UseGraphicsV
Push "r0-r2,r4,lr"
......@@ -712,8 +712,8 @@ UpdateSettingCommon ROUT
CMP r0, #256 ; HI if pointer
MOVLS r0, r0, LSR #8 ; type 0=normal, 1=border
MOVHI r0, #2 ; type 2=pointer
mjsAddressHAL
mjsCallHAL HAL_Video_WritePaletteEntry
AddressHAL
CallHAL HAL_Video_WritePaletteEntry
Pull "r0-r3, r12, lr"
]
......@@ -905,8 +905,8 @@ DoR0Flash
BL CallGraphicsV
|
PHPSEI r10 ; disable IRQs round this bit
mjsAddressHAL
mjsCallHAL HAL_Video_WritePaletteEntries
AddressHAL
CallHAL HAL_Video_WritePaletteEntries
PLP r10
MOV r4, #0
]
......@@ -936,7 +936,7 @@ UpdateAllPalette ROUT
Entry "r0-r3, r10-r11"
|
Entry "r0-r3, r9, r10-r12"
mjsAddressHAL
AddressHAL
]
;sort out which palette to use
LDROSB r0, FlashState
......@@ -975,18 +975,18 @@ UpdateAllPalette ROUT
MOV r0, #0 ; type 0 (normal)
MOV r2, #0 ; start at entry 0
MOV r3, #256 ; 256 entries
mjsCallHAL HAL_Video_WritePaletteEntries
CallHAL HAL_Video_WritePaletteEntries
;next, border colour
LDR r1, [r10] ; border colour
MOV r0, #1 ; type 1
MOV r2, #0 ; index 0
mjsCallHAL HAL_Video_WritePaletteEntry
CallHAL HAL_Video_WritePaletteEntry
;finally, pointer colours
ADD r1, r10, #4 ; pointer to pointer colours (oh yes)
MOV r0, #2 ; type 2
MOV r2, #1 ; start at index 1
MOV r3, #3 ; 3 entries
mjsCallHAL HAL_Video_WritePaletteEntries
CallHAL HAL_Video_WritePaletteEntries
]
;
PLP r11
......@@ -1022,8 +1022,8 @@ PV_BlankScreen ROUT
BL CallGraphicsV
|
Push "r0, r12"
mjsAddressHAL
mjsCallHAL HAL_Video_SetBlank
AddressHAL
CallHAL HAL_Video_SetBlank
Pull "r0, r12"
]
......@@ -1213,7 +1213,7 @@ PV_SetSupremacyXfer ROUT
Pull "r0-r3, pc"
[ LCDInvert
[ LCDInvert :LAND: :LNOT: HAL
; *****************************************************************************
;
; PV_LCDInvert - Invert the LCD palette
......@@ -1223,8 +1223,6 @@ PV_SetSupremacyXfer ROUT
; out: r4 = 0
PV_LCDInvert ROUT
;;;mjsHAL not supported
;;;
MOV r4, #0
Pull "pc"
]
......@@ -1237,8 +1235,8 @@ PV_VIDCDisable ROUT
Push "r0-r3, r9, r12"
MOV r0, #1
mjsAddressHAL
mjsCallHAL HAL_Video_SetPowerSave
AddressHAL
CallHAL HAL_Video_SetPowerSave
MOV r4, #0
Pull "r0-r3, r9, r12, pc"
......@@ -1249,8 +1247,8 @@ PV_VIDCRestore ROUT
Push "r0-r3, r9, r12"
MOV r0, #0
mjsAddressHAL
mjsCallHAL HAL_Video_SetPowerSave
AddressHAL
CallHAL HAL_Video_SetPowerSave
MOV r4, #0
Pull "r0-r3, r9, r12, pc"
......
......@@ -398,8 +398,8 @@ UpdatePointer ROUT
Pull "PC"
|
Push "R9, R12, LR"
mjsAddressHAL
mjsCallHAL HAL_Video_UpdatePointer
AddressHAL
CallHAL HAL_Video_UpdatePointer
Pull "R9, R12, PC"
]
......
......@@ -814,8 +814,8 @@ FindOKMode ROUT
MOVNE r0, #0
Pull "r4"
|
mjsAddressHAL
mjsCallHAL HAL_Video_VetMode
AddressHAL
CallHAL HAL_Video_VetMode
]
04
CMP r0,#0
......@@ -2115,45 +2115,4 @@ ScreenMode_ForceCleanCache
; Screen caching isn't supported yet. Just do nothing.
MOV pc,lr
;;;mjsHAL - VIDCDividerSWI is horrible VIDC specific API, compiled out
;;;
; Should not cause any problems on any machine. STB flag just to be safe though.
[ STB :LAND: {FALSE}
; *****************************************************************************
;
; VIDCDividerSWI - Entry point for SWI OS_VIDCDivider
;
; in: r0 = Value for divider - 1
;
; out: r0 = Preserved or error if V set
;
VIDCDividerSWI Entry "r0-r1,WsPtr"
CMP r0, #8 ; Check the value is in range.
BCC %FT10 ; Continue if so.
PullEnv ; Else return an error.
ADR r0, ErrorBlock_BadVIDCDivider ; Get address of error.
[ International
BL TranslateError ; Translate the error.
]
ORR lr, lr, #V_bit ; Return with V bit set.
ExitSWIHandler
10
VDWS WsPtr ; Get the VDU work space.
LDR r1, [WsPtr, #VIDCControlSoftCopy] ; Get the old control register value.
BIC r1, r1, #7:SHL:CR_PixelDivShift ; Mask out the old divider.
ORR r1, r1, r0, LSL #CR_PixelDivShift ; ORR in the new...
STR r1, [WsPtr, #VIDCControlSoftCopy] ; Write back to work space.
MOV r0, #VIDC
STR r1, [r0, #0] ; Write to VIDC also.
PullEnv ; Done.
ExitSWIHandler
ErrorBlock_BadVIDCDivider
& 0
= "BadVIDCDiv:Bad VIDC divider value.", 0
]
END
......@@ -2243,8 +2243,8 @@ Do_HALDAG
Pull "r4, pc"
|
Push "r3, r9, r12, lr" ; we can corrupt r0-r2
mjsAddressHAL
mjsCallHAL HAL_Video_SetDAG
AddressHAL
CallHAL HAL_Video_SetDAG
Pull "r3, r9, r12, pc"
]
......
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