Commit 694750de authored by Jeffrey Lee's avatar Jeffrey Lee
Browse files

Assorted GraphicsV improvements

Detail:
  This set of changes:
  * Adds basic support for multiple GraphicsV drivers, by way of some new OS_ScreenMode reason codes for registering/deregistering, selecting and enumerating drivers (11, 64-68)
  * Tidies up handling of HAL video calls so that the HAL calls will be transformed into a bona fide GraphicsV driver if they're implemented
  * Changes handling of 16bpp gamma table entries so that they're sent to GraphicsV in a generic form instead of in a VIDC-specific form
  * Adds a new GraphicsV call and defines new VIDC list items to allow GraphicsV drivers to utilise the new pixel formats
  File changes:
  * h/VIDCList, hdr/VIDCList, Makefile - Add new header export containing VIDC list type 3 definitions, to avoid repeated definitions in other components
  * Resources/UK/Messages - Add new GraphicsV/OS_ScreenMode error strings and some missing processor type strings
  * hdr/KernelWS - Clean up some pre-GraphicsV definitions, and add new workspace locations for storing the current GraphicsV driver number and the driver list
  * hdr/Options - Remove obsolete InverseTextTransparency option
  * hdr/VduExt - Add VDU variable 192 for storing GraphicsV driver number (same as ROL's VideoV driver number). Remove old 'Flag_*' mode flag definitions (use new 'ModeFlag_*' defintions instead). Add new OS_ScreenMode reason codes.
  * s/ARM600, s/VMSAv6, s/vdu/vdu23, s/vdu/vdugrafa, s/vdu/vdugrafd, s/vdu/vdupalxx, s/vdu/vdupointer, s/vdu/vduwrch - Strip out pre-GraphicsV code. Update GraphicsV code to use correct driver number.
  * s/ArthurSWIs - Pass the default GraphicsV claimant the VduDriverWorkSpace instead of ZeroPage
  * s/Getall - Add Hdr:VIDCList and s/vdu/VduGrafHAL to list of GETs
  * s/NewIRQs - Remove HAL VSync IRQ initialisation, is now handled by grafvhal. Remove old HAL VsyncIRQ entry point, all VSyncs are now handled by VsyncIRQ_ExtEntry.
  * s/PMF/osbyte - Stop OS_Byte 19 waiting forever if no video driver is active
  * s/PMF/osinit - Remove HAL VSync IRQ initialisation, is now handled by grafvhal
  * s/vdu/vducursoft - Use new workspace variable names and flag names
  * s/vdu/vdudecl - Remove old HALDAG_* definitions, GVDAG_* definitions are used instead. Add definition of the per-driver workspace structure and flags.
  * s/vdu/vdudriver - Remove pre-GraphicsV code. Update InitialiseMode to check for and initialise a HAL driver. Use cached driver features word in a few places instead of calling GraphicsV each time. Update PalIndexTable to disable VIDC mangling of 16bpp gamma tables.
  * s/vdu/vdugrafv, s/vdu/vdugrafhal - HAL<->GraphicsV code split off into its own file (vdugrafhal). Default GraphicsV claimant now only deals with VSync events for the active driver.
  * s/vdu/vdumodes - Get rid of old VIDC List type 3 definiton; now in hdr/VIDCList
  * s/vdu/vduswis - Added OS_ScreenMode reason codes 11 and 64-68 for registering, deregistering, selecting and enumerating GraphicsV drivers. Update mode set code to not bother checking if the driver supports the pixel format; instead we assume that the driver's vet mode call will do the check for us.
Admin:
  Tested in Tungsten, IOMD, OMAP3 & BCM2835 ROMs
  Requires HdrSrc-2_38 and updated video driver modes


Version 5.35, 4.79.2.203. Tagged as 'Kernel-5_35-4_79_2_203'
parent 574ab818
......@@ -74,6 +74,7 @@ EXPORTS = ${EXP_HDR}.EnvNumbers \
${EXP_HDR}.GPIODevice \
${EXP_HDR}.OSEntries \
${EXP_HDR}.OSRSI6 \
${EXP_HDR}.VIDCList \
${C_EXP_HDR}.ModHand \
${C_EXP_HDR}.RISCOS \
${C_EXP_HDR}.HALEntries \
......@@ -81,7 +82,8 @@ EXPORTS = ${EXP_HDR}.EnvNumbers \
${C_EXP_HDR}.OSEntries \
${C_EXP_HDR}.Variables \
${C_EXP_HDR}.OSRSI6 \
${C_EXP_HDR}.VduExt
${C_EXP_HDR}.VduExt \
${C_EXP_HDR}.VIDCList
#
# Generic rules:
......@@ -183,6 +185,9 @@ ${EXP_HDR}.GPIODevice: hdr.GPIODevice
${EXP_HDR}.OSRSI6: hdr.OSRSI6
${CP} hdr.OSRSI6 $@ ${CPFLAGS}
${EXP_HDR}.VIDCList: hdr.VIDCList
${CP} hdr.VIDCList $@ ${CPFLAGS}
${C_EXP_HDR}.ModHand: hdr.ModHand
${MKDIR} ${C_EXP_HDR}
${PERL} Build:Hdr2H hdr.ModHand $@
......@@ -215,6 +220,10 @@ ${C_EXP_HDR}.VduExt: hdr.VduExt
${MKDIR} ${C_EXP_HDR}
${PERL} Build:Hdr2H hdr.VduExt $@
${C_EXP_HDR}.VIDCList: o.Global.h.VIDCList h.VIDCList
${CP} h.VIDCList $@ ${CPFLAGS}
print o.Global.h.VIDCList { >> $@ }
o.Global.h.HALDevice: hdr.HALDevice
${MKDIR} o.Global.h
dir o
......@@ -227,6 +236,12 @@ o.Global.h.OSEntries: hdr.OSEntries
${PERL} Build:Hdr2H ^.hdr.OSEntries Global.h.OSEntries
back
o.Global.h.VIDCList: hdr.VIDCList
${MKDIR} o.Global.h
dir o
${PERL} Build:Hdr2H ^.hdr.VIDCList Global.h.VIDCList
back
BBETYPE = kernel
bbe-kernel: bbe-generic-resources-get-alias
BBE_Export_File_In_Dir Resources.${LOCALE} CmdHelp
......
......@@ -164,6 +164,8 @@ BadVIDCDiv:Bad VIDC divider value
BadPlatReas:Unknown OS_PlatformFeatures reason code
UnConv:Unsupported conversion
BadKeyHandler:Bad key handler
BadGDriver:Bad graphics driver number
TooManyGDrivers:Too many graphics drivers
600:ARM 600 Processor
610:ARM 610 Processor
......@@ -180,3 +182,6 @@ SA1110:SA-1110 Processor
922T:ARM 922T Processor
X80200:80200 Processor
X80321:80321 Processor
CortexA8:Cortex-A8 Processor
CortexA9:Cortex-A9 Processor
ARM1176JZF_S:ARM1176JZF-S Processor
......@@ -13,11 +13,11 @@
GBLS Module_ComponentPath
Module_MajorVersion SETS "5.35"
Module_Version SETA 535
Module_MinorVersion SETS "4.79.2.202"
Module_Date SETS "20 Nov 2013"
Module_ApplicationDate SETS "20-Nov-13"
Module_MinorVersion SETS "4.79.2.203"
Module_Date SETS "15 Dec 2013"
Module_ApplicationDate SETS "15-Dec-13"
Module_ComponentName SETS "Kernel"
Module_ComponentPath SETS "castle/RiscOS/Sources/Kernel"
Module_FullVersion SETS "5.35 (4.79.2.202)"
Module_HelpVersion SETS "5.35 (20 Nov 2013) 4.79.2.202"
Module_FullVersion SETS "5.35 (4.79.2.203)"
Module_HelpVersion SETS "5.35 (15 Dec 2013) 4.79.2.203"
END
......@@ -5,19 +5,19 @@
*
*/
#define Module_MajorVersion_CMHG 5.35
#define Module_MinorVersion_CMHG 4.79.2.202
#define Module_Date_CMHG 20 Nov 2013
#define Module_MinorVersion_CMHG 4.79.2.203
#define Module_Date_CMHG 15 Dec 2013
#define Module_MajorVersion "5.35"
#define Module_Version 535
#define Module_MinorVersion "4.79.2.202"
#define Module_Date "20 Nov 2013"
#define Module_MinorVersion "4.79.2.203"
#define Module_Date "15 Dec 2013"
#define Module_ApplicationDate "20-Nov-13"
#define Module_ApplicationDate "15-Dec-13"
#define Module_ComponentName "Kernel"
#define Module_ComponentPath "castle/RiscOS/Sources/Kernel"
#define Module_FullVersion "5.35 (4.79.2.202)"
#define Module_HelpVersion "5.35 (20 Nov 2013) 4.79.2.202"
#define Module_FullVersion "5.35 (4.79.2.203)"
#define Module_HelpVersion "5.35 (15 Dec 2013) 4.79.2.203"
#define Module_LibraryVersionInfo "5:35"
/* Copyright 2013 Castle Technology Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef GLOBAL_VIDCLIST_H
#include <stdint.h>
typedef struct
{
int32_t index;
uint32_t value;
} ControlList;
typedef struct
{
uint32_t Type;
uint32_t PixelDepth;
uint32_t HorizSyncWidth;
uint32_t HorizBackPorch;
uint32_t HorizLeftBorder;
uint32_t HorizDisplaySize;
uint32_t HorizRightBorder;
uint32_t HorizFrontPorch;
uint32_t VertiSyncWidth;
uint32_t VertiBackPorch;
uint32_t VertiTopBorder;
uint32_t VertiDisplaySize;
uint32_t VertiBottomBorder;
uint32_t VertiFrontPorch;
uint32_t PixelRate;
uint32_t SyncPol;
ControlList ControlList[1];
} VIDCList3;
#endif
/* In the exported copy of this file, the Hdr2H translation of hdr.VIDCList will follow. */
......@@ -772,6 +772,8 @@ BlankPalAddr # 4 ; address of block for blank palette
FirPalAddr # 4 ; address of block for first flash state palette
SecPalAddr # 4 ; address of block for second flash state palette
CurrentGraphicsVDriver # 4 ; Current driver number
PointerShapes # 0
PointerShape1 # 4 ; pointers to defined shapes 1 to 4
PointerShape2 # 4
......@@ -793,15 +795,11 @@ PointerY # 4
! 0, "PointerShapes @ ":CC::STR:(PointerShapes)
]
HALVideoFeatures # 4 ; features word from HAL
GraphicsVFeatures # 4 ; features word from current driver, refreshed each mode change
TrueVideoPhysAddr # 4 ; VideoPhysAddr is a lie, use this instead
[ :LNOT: UseGraphicsV
HWPixelFormats # 4 ; pixel formats word from HAL
HWBufferAlign # 4 ; buffer alignment word from HAL
# 35*4 - 6*PointerBlkSize ; SPARE (avoiding changes of exported addresses for now)
|
# 37*4 - 6*PointerBlkSize ; SPARE (avoiding changes of exported addresses for now)
]
MaxGraphicsVDrivers * 8
GraphicsVDrivers # MaxGraphicsVDrivers*4 ; List of drivers
# 4*4 ; SPARE (avoiding changes of exported addresses for now)
TextFgColour # 4 ; Fg/Bg colour stored as a colour number, computed on VDU 18 and re-poked!
TextBgColour # 4 ;
......@@ -1261,7 +1259,7 @@ ProcVec_End # 0
ProcVecPreVeneersSize * 4*4 ; Space for preveneers for loading handler addresses from 0 page.
ProcVecPreVeneers # ProcVecPreVeneersSize
IRQMax # 4 ; from HAL_IRQMax
IRQMax # 4 ; from HAL_IRQMax
[ :DEF: ShowWS
! 0, "Free space before DebuggerSpace = ":CC::STR:(&300-@)
......
......@@ -287,9 +287,6 @@ DebugROMPostInit SETL (:LNOT: ChocolateService) :LAND: {FALSE}
GBLL DebugTerminal ; default WRCH and RDCH through HAL
DebugTerminal SETL {FALSE}
GBLL InverseTextTransparency
InverseTextTransparency SETL {FALSE}
GBLL DebugHeaps ; initialise claimed and freed blocks
DebugHeaps SETL {FALSE} ; (may slow things down unacceptably)
......
; Copyright 2013 Castle Technology Ltd
;
; Licensed under the Apache License, Version 2.0 (the "License");
; you may not use this file except in compliance with the License.
; You may obtain a copy of the License at
;
; http://www.apache.org/licenses/LICENSE-2.0
;
; Unless required by applicable law or agreed to in writing, software
; distributed under the License is distributed on an "AS IS" BASIS,
; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
; See the License for the specific language governing permissions and
; limitations under the License.
;
SUBT VIDC List type 3 format => &.Hdr.VIDCList
OldOpt SETA {OPT}
OPT OptNoList+OptNoP1List
;
; format of a VIDC list type 3
;
^ 0
VIDCList3_Type # 4 ; must be '3'
VIDCList3_PixelDepth # 4 ; Log2BPP
VIDCList3_HorizSyncWidth # 4
VIDCList3_HorizBackPorch # 4
VIDCList3_HorizLeftBorder # 4
VIDCList3_HorizDisplaySize # 4
VIDCList3_HorizRightBorder # 4
VIDCList3_HorizFrontPorch # 4
VIDCList3_VertiSyncWidth # 4
VIDCList3_VertiBackPorch # 4
VIDCList3_VertiTopBorder # 4
VIDCList3_VertiDisplaySize # 4
VIDCList3_VertiBottomBorder # 4
VIDCList3_VertiFrontPorch # 4
VIDCList3_PixelRate # 4
VIDCList3_SyncPol # 4 ; sync polarity/flag bits
VIDCList3_ControlList # 0 ; possibly empty list of pairs of index,value words
;
; and VIDCList3 is terminated by a -1 word
;
; Indices in VIDCList3_ControlList
;
^ 1
ControlList_LCDMode # 1
ControlList_LCDDualPanelMode # 1
ControlList_LCDOffset0 # 1
ControlList_LCDOffset1 # 1
ControlList_HiResMode # 1
ControlList_DACControl # 1
ControlList_RGBPedestals # 1
ControlList_ExternalRegister # 1
ControlList_HClockSelect # 1
ControlList_RClockFrequency # 1
ControlList_DPMSState # 1
ControlList_Interlaced # 1 ; deprecated - use the sync/pol flag instead
ControlList_OutputFormat # 1
ControlList_ExtraBytes # 1
ControlList_NColour # 1
ControlList_ModeFlags # 1
ControlList_InvalidReason # 0
ControlList_Terminator * -1
; bits/flags in VIDCList3_SyncPol word:
;
SyncPol_InvertHSync * 1
SyncPol_InvertVSync * 2
SyncPol_InterlaceSpecified * 4 ; if set, interlace bit has been specified, else filled in by kernel
SyncPol_Interlace * 8 ; set=interlaced, either specified by service call claimant or filled in from *TV by kernel
OPT OldOpt
END
......@@ -100,25 +100,15 @@ VduExt_BorderB # 1
VduExt_BorderR # 1
VduExt_BorderT # 1
^ &C0
VduExt_CurrentGraphicsVDriver # 1
^ &100
VduExt_WindowWidth # 1
VduExt_WindowHeight # 1
; Bits in ModeFlags
[ {TRUE} ; These old definitions are going away soon
Flag_NonGraphic * 1
Flag_Teletext * 2
Flag_GapMode * 4
Flag_BBCGapMode * 8
Flag_HiResMono * 16
Flag_DoubleVertical * 32
Flag_HardScrollDisabled * 64 ; set when outputting to a sprite
Flag_FullPalette * 128 ; set when palette is not brain damaged
Flag_InterlacedMode * 256 ; set when full interlaced mode
]
ModeFlag_NonGraphic * 1:SHL:0
ModeFlag_Teletext * 1:SHL:1
ModeFlag_GapMode * 1:SHL:2
......@@ -131,7 +121,7 @@ ModeFlag_64k * ModeFlag_FullPalette ; Used with log2bpp==4 to in
ModeFlag_InterlacedMode * 1:SHL:8 ; set when interlaced mode with hardware using two seperate framebuffers
ModeFlag_GreyscalePalette * 1:SHL:9 ; palette is gradient from black to white
ModeFlag_ChromaSubsampleMode * ModeFlag_GreyscalePalette ; Used with log2bpp==7 to indicate chroma mode
; bits 10-11 reserved (by ROL?)
; bits 10-11 reserved
ModeFlag_DataFormat_Mask * &F:SHL:12
ModeFlag_DataFormatFamily_Mask * 3:SHL:12 ; 0=RGB, 1=misc (CMYK), 2=YCbCr, 3=reserved
ModeFlag_DataFormatFamily_RGB * 0:SHL:12
......@@ -148,6 +138,9 @@ ModeFlag_DataFormatSub_Video * 4:SHL:12 ; 0=full range, 1=video range
ModeFlag_DataFormatSub_709 * 8:SHL:12 ; 0=ITU-R BT.601, 1=ITU-R BT.709
; Invalid GraphicsV driver number
GraphicsVInvalid * -2
; OS_ScreenMode reason codes
ScreenModeReason_SelectMode * 0
......@@ -168,6 +161,13 @@ ScreenModeReason_ModeSpecifierToString * 14
ScreenModeReason_SelectModeByString * 15
ScreenModeReason_Limit1 * 16 ; (not a valid reason code)
ScreenModeReason_RegisterDriver * 64
ScreenModeReason_StartDriver * 65
ScreenModeReason_StopDriver * 66
ScreenModeReason_DeregisterDriver * 67
ScreenModeReason_EnumerateDrivers * 68
ScreenModeReason_Limit2 * 69 ; (not a valid reason code)
ScreenModeReason_ROL_ReadMaximumDriver * 253
ScreenModeReason_ROL_DeregisterDriver * 254
ScreenModeReason_ROL_RegisterDriver * 255
......
......@@ -381,27 +381,17 @@ SSETMEMC ROUT
; bit 11 => Sound DMA enable
; bit 12 => OS mode
[ UseGraphicsV
Push "r0,r1,r4, r14"
TST r11, #(1 :SHL: 10)
MOVEQ r0, #1 ; blank (video DMA disable)
MOVNE r0, #0 ; unblank (video DMA enable)
MOV r1, #0 ; no funny business with DPMS
MOV r4, #GraphicsV_SetBlank
ADD r4, r12, #VduDriverWorkSpace
LDR r4, [r4, #CurrentGraphicsVDriver]
MOV r4, r4, LSL #24
ORR r4, r4, #GraphicsV_SetBlank
BL CallGraphicsV
Pull "r0,r1,r4, r14"
|
Push "r0-r3, r9, r14" ; can corrupt r12
TST r11, #(1 :SHL: 10)
MOVEQ r0, #1 ; blank (video DMA disable)
MOVNE r0, #0 ; unblank (video DMA enable)
MOV r1, #0 ; no funny business with DPMS
MOV r0, #0
MOV r1
AddressHAL
CallHAL HAL_VideoSetBlank
Pull "r0-r3, r9, r14"
]
WritePSRc SVC_mode+I_bit, r11
ExitSWIHandler
......
......@@ -642,7 +642,7 @@ defaultvectab
& 0, 0, NaffVector ; LowPriorityEventV &28
& 0, 0, NaffVector ; &29
[ UseGraphicsV
& 0, ZeroPage, MOSGraphicsV ; GraphicsV * &2a
& 0, ZeroPage+VduDriverWorkSpace, MOSGraphicsV ; GraphicsV * &2a
|
& 0, 0, NaffVector ; GraphicsV * &2a
]
......
......@@ -68,6 +68,7 @@
GET Hdr:MsgTrans
GET Hdr:PaletteV
GET Hdr:GraphicsV
GET Hdr:VIDCList
GET Hdr:Wimp
GET Hdr:ColourTran
GET Hdr:Debug
......@@ -133,6 +134,7 @@ StartOfVduDriver
GET s.vdu.VduGrafK
GET s.vdu.VduGrafL
GET s.vdu.VduGrafV
GET s.vdu.VduGrafHAL
GET s.vdu.VduWrch
GET s.vdu.Vdu23
GET s.vdu.VduPointer
......
......@@ -213,16 +213,6 @@ FillInDefaultIRQ1VDevices
ADD a1, v1, a1, LSL #2
STMIB a1, {a2, a3}
; Now the VSync
MOV a1, #0
CallHAL HAL_VideoFlybackDevice
CMP a1, #-1
LDRNE a2, =ZeroPage+OsbyteVars
LDRNE a3, =VsyncIRQ
ADDNE a1, a1, a1, LSL #1
ADDNE a1, v1, a1, LSL #2
STMNEIB a1, {a2, a3}
1
[ NumberOfPodules > 0
; Now Podule bits
......@@ -764,17 +754,9 @@ FalseVsyncIRQ ROUT
TST R0, #1
MOVEQ pc, lr
Push "lr"
B VsyncIRQ_ExtEntry
VsyncIRQ ROUT
; Don't push r14 - we're using new interface, and claim the vector
Push "r9,r12"
AddressHAL
CallHAL HAL_IRQClear ; Clear the vsync interrupt
Pull "r9,r12"
; Fall through...
VsyncIRQ_ExtEntry
VsyncIRQ_ExtEntry ROUT
LDRB R0, CFStime ; decrement 'CFS' timer !
SUB R0, R0, #1
STRB R0, CFStime
......
......@@ -550,6 +550,11 @@ Osbyte13 ROUT
TSTNE R1, #1 ; NE => blanked and DPMS turned off HSyncs
MyOsbyte NE ; if true exit immediately
; Also, exit now if we don't have a driver active
LDR R0, [R2,#CurrentGraphicsVDriver]
CMP R0, #GraphicsVInvalid
MyOsbyte EQ
LDRB R2, CFStime
10
BIC R1, R3, #I32_bit
......
......@@ -136,14 +136,6 @@ BuffPtrInitLoop
CallHAL HAL_IRQClear ; clear timer 0 IRQ
MOV R0, R4
CallHAL HAL_IRQEnable ; enable timer 0 IRQ
CallHAL HAL_VideoFlybackDevice
CMP R0, #-1
MOVNE R5, R0
CallHAL HAL_IRQClear, NE ; clear vsync IRQ
CMP R5, #-1
MOVNE R0, R5
CallHAL HAL_IRQEnable, NE ; enable vsync IRQ
Pull "r9,r12"
|
MOV R1, #IOC
......
......@@ -293,27 +293,17 @@ SSETMEMC ROUT
; bit 11 => Sound DMA enable
; bit 12 => OS mode
[ UseGraphicsV
Push "r0,r1,r4, r14"
TST r11, #(1 :SHL: 10)
MOVEQ r0, #1 ; blank (video DMA disable)
MOVNE r0, #0 ; unblank (video DMA enable)
MOV r1, #0 ; no funny business with DPMS
MOV r4, #GraphicsV_SetBlank
ADD r4, r12, #VduDriverWorkSpace
LDR r4, [WsPtr, #CurrentGraphicsVDriver]
MOV r4, r4, LSL #24
ORR r4, r4, #GraphicsV_SetBlank
BL CallGraphicsV
Pull "r0,r1,r4, r14"
|
Push "r0-r3, r9, r14" ; can corrupt r12
TST r11, #(1 :SHL: 10)
MOVEQ r0, #1 ; blank (video DMA disable)
MOVNE r0, #0 ; unblank (video DMA enable)
MOV r1, #0 ; no funny business with DPMS
MOV r0, #0
MOV r1
AddressHAL
CallHAL HAL_VideoSetBlank
Pull "r0-r3, r9, r14"
]
WritePSRc SVC_mode+I_bit, r11
ExitSWIHandler
......
......@@ -1514,19 +1514,12 @@ Vdu23_0_8 ROUT
TST R1, #1
EORNE R0, R0, #1 ; toggle if *TV n,1 and number +ve
10
[ UseGraphicsV
Push "R14"
MOV R4, #GraphicsV_SetInterlace
LDR R4, [WsPtr, #CurrentGraphicsVDriver]
MOV R4, R4, LSL #24
ORR R4, R4, #GraphicsV_SetInterlace
BL CallGraphicsV
Pull "R14"
|
Push "R0-R3, R9, R12, LR"
AddressHAL
CallHAL HAL_VideoSetInterlace
Pull "R0-R3, R9, R12, LR"
]
MOV PC, R14
Pull "PC"
[ DoVdu23_0_12
......
......@@ -101,8 +101,8 @@ PreWrchCursor
STR R0, [WsPtr, #CursorStack]
MOV R2,R14
LDR R14, [WsPtr, #HALVideoFeatures]
TST R14, #2
LDR R14, [WsPtr, #GraphicsVFeatures]
TST R14, #GVDisplayFeature_HardwarePointer
BLEQ RemovePointer
MOV R14,R2
......@@ -279,8 +279,8 @@ Cursor32loop
PostWrchCursor ROUT
LDR R6,[WsPtr, #HALVideoFeatures]
TST R6,#2
LDR R6,[WsPtr, #GraphicsVFeatures]
TST R6,#GVDisplayFeature_HardwarePointer
BNE %FT10
MOV R6,R14
......@@ -471,7 +471,7 @@ Vdu23_0_11
LDR R1, [WsPtr, #ModeFlags]
TST R1, #ModeFlag_DoubleVertical ; if double vertical
MOVNE R0, R0, LSL #1 ; then double cursor value
MOVNE R0, R0, LSL #1 ; then double cursor value
LDR R1, [WsPtr, #RowMult]
CMP R0, R1
......
......@@ -54,10 +54,6 @@ PhysCursorStartAdr * CursorSoundPhysRAM
; Reason codes for generalised DAG interface
HALDAG_VInit * 0
HALDAG_VStart * 1
HALDAG_VEnd * 2
HALDAG_VRender * 3
; Layout of palette space
......@@ -74,7 +70,17 @@ Pal_BTable # 256
Pal_STable # 256
Pal_Blocksize # 0
; GraphicsV driver state
; For each allocated driver number, the corresponding word of GraphicsVDrivers
; points to an instance of the following structure:
^ 0
GVDriver_RegisterFlags # 4 ; Flags on registration
GVDriver_Name # 4 ; Name on registration
GVDriver_StateFlags # 4 ; Current state flags
GVDriver_Size # 0
GVDriverState_Started * 1:SHL:0 ; ScreenMode_StartDriver called
;
; Macro Definitions
......
......@@ -178,28 +178,17 @@ VduInit ROUT
STR R0, [WsPtr, #VduSaveAreaPtr] ; indicate no save area yet
STR R0, [WsPtr, #ClipBoxEnable] ; no clip box calculating
STRB R0, [WsPtr, #ExternalFramestore]
STR R0, [WsPtr, #GraphicsVFeatures]
MOV R3, #MaxGraphicsVDrivers
LDR R2, =ZeroPage+VduDriverWorkSpace+GraphicsVDrivers
01
STR R0, [R2], #4
SUBS R3, R3, #1
BNE %BT01
MOV R0, #GraphicsVInvalid
STR R0, [WsPtr, #CurrentGraphicsVDriver]
STR R14, [WsPtr, #TrueVideoPhysAddr] ; init TrueVideoPhysAddr for internal RAM/VRAM framestore case
Push "r4, r9, r12"
AddressHAL
MOV r4, r12 ; temp WsPtr
CallHAL HAL_VideoFeatures
; Set bit 31 of features if HAL_VideoRender supported
CheckHAL HAL_VideoRender, r1
ORREQ r0, r0, #1:SHL:31
STR r0, [r4, #HALVideoFeatures]
[ :LNOT:UseGraphicsV
CallHAL HAL_VideoPixelFormats
STR r0, [r4, #HWPixelFormats]
CallHAL HAL_VideoBufferAlignment
STR r0, [r4, #HWBufferAlign]
]
Pull "r4, r9, r12"
;;; sort this out!
! 0, "HAL not doing anything useful with HAL_VideoBufferAlignment"
! 0, "HAL not dealing with lack of h/w pointer"
LDR R0, =RangeC+SpriteReason_SwitchOutputToSprite
STR R0, [WsPtr, #SpriteMaskSelect]
......@@ -339,10 +328,27 @@ VduInit ROUT
; before printing "RISC OS ..."
;
; in: -
; out: All registers may be corrupted (except R13_svc !)
; out: r0 = corrupt, or error pointer
; All other registers preserved
;
InitialiseMode Entry
InitialiseMode ROUT
; if we don't have a video driver yet, now is a good time to check if the HAL
; provides one
LDR r0, =ZeroPage+VduDriverWorkSpace+CurrentGraphicsVDriver
LDR r0, [r0]
CMP r0, #GraphicsVInvalid
BEQ VduGrafHAL_Init ; tail-call since InitialiseMode will get called again when the HAL registers itself
Entry "r1-r12"
; Refresh cached features flags before we start calling this new driver
MOV r4, r0, LSL #24
ORR R4, R4, #GraphicsV_DisplayFeatures
BL CallGraphicsV
VDWS WsPtr
STR r0, [WsPtr, #GraphicsVFeatures]
[ SoftResets
MOV r0, #&FD ; read last reset type
MOV r1, #0
......@@ -358,11 +364,12 @@ InitialiseMode Entry
SWI XOS_ReadSysInfo ; always use configured value
]
; at this stage, r0 = current screen mode either mode number or mode specifier
; lets give the HAL a chance to be fussy.
AddressHAL
CallHAL HAL_VideoStartupMode
; lets give the driver a chance to be fussy.
LDR R4, [WsPtr, #CurrentGraphicsVDriver]
ORR R4, R4, #GraphicsV_StartupMode
BL CallGraphicsV
01
MOV r1, r0
MOV r0, #ScreenModeReason_SelectMode
......@@ -755,18 +762,17 @@ ModeChangeSub ROUT
AND r1, r2, #&7F
CMP r1, #NumModes ; mode number
BHS mchsub_3
Push "r3, r4"
[ UseGraphicsV
Push "r0-r2"
MOV r4, #GraphicsV_DisplayFeatures
Push "r0-r4"
LDR r4, [WsPtr, #CurrentGraphicsVDriver]
MOV r4, r4, LSL #24
ORR r4, r4, #GraphicsV_DisplayFeatures
BL CallGraphicsV
TEQ r4, #0
MOVEQ r0, #0
MOVEQ r4, r1
MOVNE r4, #2_111111
STR r0, [WsPtr, #GraphicsVFeatures] ; refresh cached features
Pull "r0-r2"
|
LDR r4, [WsPtr, #HWPixelFormats] ; bits 0 to 3 set for 1,2,4,8 bpp supported
]
ADR lr, ModePromoTable ; table of mode promotions
mchsub_1
MOV r1, r1, LSL #1
......@@ -823,22 +829,17 @@ mchsub_3
RSBS R1, R9, R11, LSL R2 ; extra amount we need
BLS %FT08 ; enough memory, so skip
[ UseGraphicsV
LDRB R0, [WsPtr, #ExternalFramestore]
TEQ R0, #0
BEQ %FT05
; External framestore in use; does driver support growing/reallocating it?
Push "r1-r2,r4"
MOV r4, #GraphicsV_DisplayFeatures
BL CallGraphicsV
Pull "r1-r2,r4"
TST r0, #1<<5
LDR R0, [WsPtr, #GraphicsVFeatures]
TST r0, #GVDisplayFeature_VariableFramestore
BNE %FT08 ; realloc supported, assume driver can allocate required memory since it OK'd the mode
B %FT06 ; not supported, complain
05
]
; try to extend the amount of screen memory
......@@ -934,23 +935,22 @@ TV_Mode_string
STR R3, [WsPtr, #ScreenSize] ; store screensize BEFORE calling
; ConvertBankToAddress (was a bug!)
[ UseGraphicsV
Push "r0-r6"
MOV r4, #GraphicsV_DisplayFeatures
BL CallGraphicsV
; If driver handles memory allocation, must change mode before asking for memory
TST r0, #1<<5
LDR r0, [WsPtr, #GraphicsVFeatures]
TST r0, #GVDisplayFeature_VariableFramestore
ADDNE R0, R13, #wkwordsize+7*4 ; R0 -> VIDCList3
BLNE HardwareModeChange
MOV r4, #GraphicsV_FramestoreAddress
LDR r4, [WsPtr, #CurrentGraphicsVDriver]
MOV r4, r4, LSL #24
ORR r4, r4, #GraphicsV_FramestoreAddress
BL CallGraphicsV
TEQ r4, #0
BNE %FT581
[ {TRUE}
; for mapping in, round start address down and size up to megabyte boundaries
; r0 = physical start, r1= size
; so frame buffer is wholly contained within the mapped in area
......@@ -975,27 +975,6 @@ TV_Mode_string
STR r3, [WsPtr, #ScreenEndAddr] ; actual screen end
MOV r14, #1
B %FT582
|
MOV r1, r1, LSR #20 ; round size down to 1MB
MOV r2, r1, LSL #20
ADD r0, r0, #1:SHL:20 ; round addr up to 1MB
SUB r0, r0, #1
MOV r0, r0, LSR #20 ; (because of OS_Memory 13 limits)
MOV r1, r0, LSL #20
MOV r0, #13 ; map in permanently
ORR r0, r0, #1:SHL:8 ; buffered, uncached
ORR r0, r0, #1:SHL:16+1:SHL:17 ; doubly map, access permission specified
SWI XOS_Memory
BVS %FT581
ADD r0, r1, r5 ; reconstruct base phys address
STR r0, [WsPtr, #TrueVideoPhysAddr] ; and update our copy
STR r2, [WsPtr, #TotalScreenSize]
ADD r3, r3, r2
STR r3, [WsPtr, #ScreenEndAddr]
MOV r14, #1
B %FT582
]
581
MOV r0, #128+2
SWI XOS_ReadDynamicArea
......@@ -1006,7 +985,6 @@ TV_Mode_string
582
Pull "r0-r6"
STRB r14, [WsPtr, #ExternalFramestore]
]
TEQ R2, #0 ; Shadowing or not ?
LDR R3, [WsPtr, #VduStatus]
......@@ -1082,9 +1060,8 @@ TV_Mode_string
; finished doing other variables
; tell hardware to change mode, unless already done
MOV r4, #GraphicsV_DisplayFeatures
BL CallGraphicsV
TST r0, #1<<5
LDR r0, [WsPtr, #GraphicsVFeatures]
TST r0, #GVDisplayFeature_VariableFramestore
ADDEQ R0, R13, #wkwordsize ; R0 -> VIDCList3
BLEQ HardwareModeChange
......@@ -1197,9 +1174,17 @@ HardwareModeChange
;kernel/HAL split - call the HAL to program video controller for mode,
;
MOV R4, #GraphicsV_SetMode
LDR R4, [WsPtr, #CurrentGraphicsVDriver]
MOV R4, R4, LSL #24
ORR R4, R4, #GraphicsV_SetMode
BL CallGraphicsV
LDR R4, [WsPtr, #CurrentGraphicsVDriver]
MOV R4, R4, LSL #24
ORR R4, R4, #GraphicsV_DisplayFeatures
BL CallGraphicsV
STR R0, [WsPtr, #GraphicsVFeatures] ; refresh cached features just in case something's happened to change them
Pull "R0-R4, PC"
......@@ -1375,32 +1360,24 @@ PushModeInfoCommonNoService
ORR r14, r14, #ModeFlag_InterlacedMode
STR r14, [r9, #wkModeFlags]
58
[ UseGraphicsV
Push "r0-r2,r4"
MOV r4, #GraphicsV_DisplayFeatures
BL CallGraphicsV
Push "r0-r2"
LDR r0, [WsPtr, #GraphicsVFeatures]
TST r0, #GVDisplayFeature_HardwareScroll
LDREQ r14, [r9, #wkModeFlags]
ORREQ r14, r14, #ModeFlag_HardScrollDisabled
STREQ r14, [r9, #wkModeFlags]
; claim or release falsevsync vector if vsyncs supported/not supported
Push "r0"
TST r0, #1<<4 ; NE = VSyncs not generated?
MOV a1, #TickerV
LDR a2, =FalseVsyncIRQ
LDR a3, =ZeroPage+OsbyteVars
TST r0, #GVDisplayFeature_NoVsyncIRQ ; are VSyncs not generated?
MOV r0, #TickerV
LDR r1, =FalseVsyncIRQ
LDR r2, =ZeroPage+OsbyteVars
BEQ %ft2
SWI XOS_Claim
B %ft1
2 SWI XOS_Release
1
Pull "r0"
TST r0, #1 ; bit 0 is h/w scroll support
Pull "r0-r2,r4"
|
LDR r14, [WsPtr, #HALVideoFeatures]
TST r14, #1 ; bit 0 is h/w scroll support
]
LDREQ r14, [r9, #wkModeFlags]
ORREQ r14, r14, #ModeFlag_HardScrollDisabled
STREQ r14, [r9, #wkModeFlags]
Pull "r0-r2"
; hopefully, R7 is still set from up there to be NZ if no VIDC stuff necessary
......@@ -1718,7 +1695,7 @@ NColourTable & NColour_0, NColour_1, NColour_2
& 4095 ; 4K sprite
& NColour_5, NColour_5 ; YCbCr 422 & 420 (not supported)
ASSERT . - NColourTable = (SpriteType_RO5MAX-1)*4
PalIndexTable = 0, 1, 2, 3, 6, 7
PalIndexTable = 0, 1, 2, 3, 7, 7 ; TODO get rid of palette 6 if VIDC mangling is gone for good
ALIGN ; makes ECFIndexTable more accessible
ECFIndexTable = 4, 2, 3, 5, 5, 5
ALIGN
......
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