Commit dfc35704 authored by Neil Turton's avatar Neil Turton
Browse files

Module merged

parent fea03a6f
......@@ -74,13 +74,17 @@ DoStarPodules ENTRY "r7-r8", 8 ; Stack frame for text c
next_podule_loop
TEQ r7, #1
ADRNE r4, Token_ExtROM ; or ExtROM as appropriate
[ {TRUE} ; get ReadInfo Description for extension ROMs just like podules
ADREQ r4, Token_PodStd ; Set MsgTrans token for PodStd
|
ADRNE r5, null_string
BNE got_podule_message
ADR r4, Token_PodStd ; Set MsgTrans token for PodStd
[ NetworkPodule
]
[ NetworkPodule
TEQ r6, #NumberOfPodules
ADREQ r4, Token_PodNet
]
]
MOV r0, #Podule_ReadInfo_Description
MOV r1, sp ; Place to return address
MOV r2, #4 ; Size of return buffer
......
......@@ -18,6 +18,8 @@
GET Hdr:ListOpts
GET Hdr:Macros
GET Hdr:System
GET Hdr:Machine.<Machine>
$GetIO
GET Hdr:CMOS
GET Hdr:ModHand
GET Hdr:Debug
......@@ -30,6 +32,7 @@
GET Hdr:Proc
GET Hdr:Symbols
GET Hdr:MsgTrans
GET Hdr:PoduleReg
GET Time+Date
......
......@@ -35,6 +35,7 @@
; 16-Oct-91 TMD Fixed bug G-RO-9079 (*PoduleSave/PoduleLoad with no
; loader gives exception)
; 14-Oct-92 TMD Split off Victoria-specific version
; 25-Mar-95 JRH changed dline, dreg etc calls to DLINE, DREG since tutu is dead
OPT OptPage
SVCEntry ROUT
......@@ -903,7 +904,9 @@ ReadInfo_CMOSAddress
MOVS pc, lr
ReadInfo_CMOSSize
MOV r2, #4
CMP r2, #0 ; don't have CMOS on extension ROM
MOVLT r2, #0 ; we don't have no CMOS
MOVGE r2, #4 ; otherwise fixed amount
MOVS pc, lr
ReadInfo_ROMAddress
......@@ -1057,7 +1060,9 @@ ReadInfo_EASIAddress
ReadInfo_EASISize
[ EASISpace
MOV r2, #16*1024*1024
TST r2, r2
MOVPL r2, #0 ; <0 : we don't have no EASI
MOVMI r2, #16*1024*1024 ; >0 : fixed amount
|
MOV r2, #0
]
......@@ -1130,7 +1135,11 @@ ReadInfo_FIQValue
ReadInfo_EthernetLow
Push "r0, r1, lr"
LDR r2, [ r3, #PoduleNode_BaseAddress ]
[ NetworkPodule
LDR r0, =NetworkBaseChip
|
LDR r0, =PoduleBase0
]
TEQ r0, r2
ADRNEL r0, ErrorBlock_ECNoNet
BLNE copy_error_zero
......@@ -1149,7 +1158,11 @@ ExitReadInfo_EthernetLow
ReadInfo_EthernetHigh
Push "r0, r1, lr"
LDR r2, [ r3, #PoduleNode_BaseAddress ]
[ NetworkPodule
LDR r0, =NetworkBaseChip
|
LDR r0, =PoduleBase0
]
TEQ r0, r2
ADRNEL r0, ErrorBlock_ECNoNet
BLNE copy_error_zero
......
......@@ -61,13 +61,16 @@ FixLoaderBug SETL True
NumberOfPodules SETA 8
GBLL NetworkPodule
NetworkPodule SETL True
NetworkPodule SETL NetPodSupport ; System build option
GBLL EASISpace
EASISpace SETL True
GBLL ExtensionROMs
ExtensionROMs SETL False
ExtensionROMs SETL ExtROMSupport ; System build option
; We only know how to fake up STB2 MPEG1, MPEG2 (and MPEG0) podules
ASSERT (FakePodule0 = 0) :LOR: (FakePodule0 = ProdType_STB2_MPEG1) :LOR: (FakePodule0 = ProdType_STB2_MPEG2)
[ :LNOT: ReleaseVersion
! 0, "This version supports " :CC: ((:STR:NumberOfPodules) :RIGHT: 1) :CC: " podules"
......@@ -163,23 +166,29 @@ NetworkFIQRequest * &03200034
NetworkFIQMask * &03200038
NetworkFIQValue * &02
[ NetworkPodule
[ NetworkPodule
MaximumPodule * NumberOfPodules + 1
NumberOfNetworkPodule * MaximumPodule - 1
IOTCR * &032000C4
|
|
MaximumPodule * NumberOfPodules
]
]
[ ExtensionROMs
[ False ; Victoria
StartOfROM * &03500000 ; VIDC moved out of way
[ ExtensionROMs
[ {TRUE}
StartOfROM * &03800000
EndOfROM * &04000000
|
|
StartOfROM * &03400000
EndOfROM * &04000000
]
]
]
]
[ FakePodule0 <> 0
MachineConfig * (IOMD_Base + IOMD_CLINES)
MPEGfittedbit * IOMD_C_MPEGfitted
MPEGIDByte * 0
]
maxint * &7FFFFFFF
......@@ -349,6 +358,50 @@ $PoduleString
PoduleString SETS "ROMNodeChainHead * Podule" :CC: ((:STR: PoduleInstance) :RIGHT: 1) :CC: " + PoduleNode_Link"
$PoduleString
[ FakePodule0 <> 0
MPEG0descoff * (MPEG0desc - MPEG0contents)/4 ; offset of description from start
MPEG0desclen * (MPEG0end - MPEG0desc)/4 ; length of description
MPEG0contents DCD &00, &02, &00, (ProdType_STB2_MPEG0 :AND: &FF), (ProdType_STB2_MPEG0 :SHR: 8)
DCD (Manf_OnlineMedia :AND: &FF), (Manf_OnlineMedia :SHR: 8), &00
DCD 0, 0, 0, 0, 0, 0, 0, 0
DCD &f5, MPEG0desclen, &00, &00, MPEG0descoff, &00, &00, &00
DCD 0, 0, 0, 0, 0, 0, 0, 0
MPEG0desc DCD 'I', 'n', 't', 'e', 'r', 'n', 'a', 'l'
DCD ' ', 'v', 'i', 'd', 'e', 'o', ' ', 'h'
DCD 'a', 'r', 'd', 'w', 'a', 'r', 'e', 0
MPEG0end
ALIGN
[ FakePodule0 = ProdType_STB2_MPEG1
MPEG1descoff * (MPEG1desc - MPEG1contents)/4 ; offset of description from start
MPEG1desclen * (MPEG1end - MPEG1desc)/4 ; length of description
MPEG1contents DCD &00, &02, &00, (ProdType_STB2_MPEG1 :AND: &FF), (ProdType_STB2_MPEG1 :SHR: 8)
DCD (Manf_OnlineMedia :AND: &FF), (Manf_OnlineMedia :SHR: 8), &00
DCD 0, 0, 0, 0, 0, 0, 0, 0
DCD &f5, MPEG1desclen, &00, &00, MPEG1descoff, &00, &00, &00
DCD 0, 0, 0, 0, 0, 0, 0, 0
MPEG1desc DCD 'I', 'n', 't', 'e', 'r', 'n', 'a', 'l'
DCD ' ', 'M', 'P', 'E', 'G', '1', ' ', 'h'
DCD 'a', 'r', 'd', 'w', 'a', 'r', 'e', 0
MPEG1end
ALIGN
|
; it's the STB2/2
MPEG1descoff * (MPEG1desc - MPEG1contents)/4 ; offset of description from start
MPEG1desclen * (MPEG1end - MPEG1desc)/4 ; length of description
MPEG1contents DCD &00, &02, &00, (ProdType_STB2_MPEG2 :AND: &FF), (ProdType_STB2_MPEG2 :SHR: 8)
DCD (Manf_OnlineMedia :AND: &FF), (Manf_OnlineMedia :SHR: 8), &00
DCD 0, 0, 0, 0, 0, 0, 0, 0
DCD &f5, MPEG1desclen, &00, &00, MPEG1descoff, &00, &00, &00
DCD 0, 0, 0, 0, 0, 0, 0, 0
MPEG1desc DCD 'I', 'n', 't', 'e', 'r', 'n', 'a', 'l'
DCD ' ', 'M', 'P', 'E', 'G', '2', ' ', 'h'
DCD 'a', 'r', 'd', 'w', 'a', 'r', 'e', 0
MPEG1end
ALIGN
]
]
; *****************************************************************************************************************
;
; ExtensionROMLoader - Loader for reading extension ROM
......@@ -592,9 +645,37 @@ InitialisationLoop
INC r3, 4 ; at the start of workspace
CMP r3, # :INDEX: EndOfInitialisationArea
BLT InitialisationLoop
[ ExtensionROMs
[ ExtensionROMs
BL FindExtensionROMs
]
]
; If this is a Set-Top Box, then we know we've got MPEG hardware fitted as Podule0 but without the (EP)ROM
; We'll make if look like its a real podule
[ FakePodule0 <> 0
ADRL r0, NormalPoduleNodeOffsets ; work out address of podule0 node
LDR r0, [r0]
ADD r0, r0, r2 ; make it an absolute address
MOV r1, #MPEGIDByte
STRB r1, [ r0, #PoduleNode_IDByte ] ; set ID byte to make ConvertR3ToPoduleNode happy
MOV r1, #BitZero
STRB r1, [ r0, #PoduleNode_Flags ] ; This is a (fake) Podule
MOV r1, #PoduleCMOS
STR r1, [ r0, #PoduleNode_CMOS ] ; We don't have no CMOS
MOV r1, #-1
STR r1, [ r0, #PoduleNode_DMA ] ; We don't do DMA
; See if MPEG is fitted and point the podule ROM address to the appropriate fake header
; The description string will be extracted from this block in the normal way when chunks get enumerated
LDR r3, =MachineConfig
LDRB r1, [r3]
TST r1, #MPEGfittedbit
ADREQ r1, MPEG0contents
ADRNE r1, MPEG1contents
STR r1, [ r0, #PoduleNode_ROMAddress ] ; Location to read header from
]
BL LoadAllLoaders ; ensure all loaders are loaded
ReInitialisation ; Address of workspace in R2, Address of Private word in R12
......@@ -719,27 +800,27 @@ TryNextPodule
ADD r8, r8, #1 ; Go to the next podule
CMP r8, #MaximumPodule
BCC LoadLoadersLoop
[ ExtensionROMs
LDR r10, number_of_extension_roms
[ DebugModule
BREG r10, "There are &", cc
[ ExtensionROMs
LDR r9, number_of_extension_roms ; jharris: was r10, but r10 gets trashed by EnumerateChunks
[ DebugModule
BREG r9, "There are &", cc
DLINE " extension ROMs"
]
TEQ r10, #0
BEQ %99
]
TEQ r9, #0
BEQ ExitLoadLoaders ; jharris: was BEQ to (non-existent) 99
MOV r8, #-2
LoadExtensionROMLoop
[ DebugModule
[ DebugModule
BREG r8, "Doing extension ROM &"
]
]
MOV r3, r8
BL ConvertR3ToPoduleNode
[ DebugModule
[ DebugModule
BVC %74
ADD r14, r0, #4
DSTRING r14, "Error from ConvertR3ToPoduleNode: "
74
]
]
BVS NextExtensionROM
MOV r0, #0 ; Start with chunk zero
ExtensionChunkLoop
......@@ -750,19 +831,19 @@ ExtensionChunkLoop
BNE ExtensionChunkLoop ; No, so get another one
NextExtensionROM
DEC r8
DECS r10
DECS r9 ; jharris
BNE LoadExtensionROMLoop
]
]
ExitLoadLoaders
ADD sp, sp, #16 ; Remove frame
Pull "r8-r12, lr"
LDR r2, [ r12 ] ; reload workspace ptr from priv word
MOV pc, lr
[ NetworkPodule
[ NetworkPodule
AddressOfNetworkBaseROM
DCD NetworkBaseROM
]
]
EasyLookup ROUT
; In: R1 Pointer to token
......
......@@ -33,7 +33,7 @@ ROMChunkSize * 64*1024
ROMValidationString SETS "ExtnROM0"
GBLL DebugROMExtend
DebugROMExtend SETL {FALSE}
DebugROMExtend SETL ( :LNOT: ReleaseVersion ) :LAND: {FALSE}
MACRO
$label dreg $reg, $string, $cc, $routine
......@@ -825,8 +825,9 @@ AddROMNode ENTRY "R0-R4, R9-R11"
MOV R0, #0
STR R0, [R11, #PoduleNode_Link] ; zero link
[ EASISpace
STR r0, [ r11, #PoduleNode_EASIPhysical ]
STR r0, [ r11, #PoduleNode_EASILogical ]
; STR r0, [ r11, #PoduleNode_EASIPhysical ]
; STR r0, [ r11, #PoduleNode_EASILogical ]
STR r0, [ r11, #PoduleNode_EASIAddress ]
]
STR r0, [ r11, #PoduleNode_DescriptionOffset ]
STR r0, [ r11, #PoduleNode_Type ] ; Does Flags and Spare
......@@ -836,6 +837,7 @@ AddROMNode ENTRY "R0-R4, R9-R11"
LDR r0, [ sp ] ; Restore stacked ROM start address
STR r0, [ r11, #PoduleNode_ROMAddress ]
STR r0, [ r11, #PoduleNode_BaseAddress ] ; store in base address as well
STR r0, [ r11, #PoduleNode_CombinedAddress ] ; and combined address
STR r1, [ r11, #PoduleNode_Checksum ]
MOV r0, #NIL ; No loader at the moment
STR r0, [ r11, #PoduleNode_LoaderOffset ]
......@@ -864,8 +866,5 @@ AddROMNode ENTRY "R0-R4, R9-R11"
EXIT
[ DebugROMExtend
InsertDebugRoutines
]
]
END
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