ReactOS 0.4.16-dev-2232-gc2aaa52
machxbox.h File Reference
#include "mm.h"
#include <drivers/xbox/xgpu.h>
Include dependency graph for machxbox.h:

Go to the source code of this file.

Functions

VOID XboxConsPutChar (int Ch)
 
BOOLEAN XboxConsKbHit (VOID)
 
int XboxConsGetCh (VOID)
 
VOID XboxVideoInit (VOID)
 
VOID XboxVideoClearScreen (UCHAR Attr)
 
VIDEODISPLAYMODE XboxVideoSetDisplayMode (PCSTR DisplayModem, BOOLEAN Init)
 
VOID XboxVideoGetDisplaySize (PULONG Width, PULONG Height, PULONG Depth)
 
ULONG XboxVideoGetBufferSize (VOID)
 
VOID XboxVideoGetFontsFromFirmware (PULONG RomFontPointers)
 
VOID XboxVideoSetTextCursorPosition (UCHAR X, UCHAR Y)
 
VOID XboxVideoHideShowTextCursor (BOOLEAN Show)
 
VOID XboxVideoPutChar (int Ch, UCHAR Attr, unsigned X, unsigned Y)
 
VOID XboxVideoCopyOffScreenBufferToVRAM (PVOID Buffer)
 
BOOLEAN XboxVideoIsPaletteFixed (VOID)
 
VOID XboxVideoSetPaletteColor (UCHAR Color, UCHAR Red, UCHAR Green, UCHAR Blue)
 
VOID XboxVideoGetPaletteColor (UCHAR Color, UCHAR *Red, UCHAR *Green, UCHAR *Blue)
 
VOID XboxVideoSync (VOID)
 
VOID XboxVideoPrepareForReactOS (VOID)
 
VOID XboxPrepareForReactOS (VOID)
 
VOID XboxMemInit (VOID)
 
PFREELDR_MEMORY_DESCRIPTOR XboxMemGetMemoryMap (ULONG *MemoryMapSize)
 
BOOLEAN XboxDiskReadLogicalSectors (UCHAR DriveNumber, ULONGLONG SectorNumber, ULONG SectorCount, PVOID Buffer)
 
BOOLEAN XboxDiskGetDriveGeometry (UCHAR DriveNumber, PGEOMETRY DriveGeometry)
 
ULONG XboxDiskGetCacheableBlockCount (UCHAR DriveNumber)
 
TIMEINFOXboxGetTime (VOID)
 
PCONFIGURATION_COMPONENT_DATA XboxHwDetect (_In_opt_ PCSTR Options)
 
VOID XboxHwIdle (VOID)
 
VOID XboxSetLED (PCSTR Pattern)
 

Function Documentation

◆ XboxConsGetCh()

int XboxConsGetCh ( VOID  )

Definition at line 79 of file xboxcons.c.

80{
81 /* No keyboard support yet */
82 while (1) ;
83
84 return 0;
85}

Referenced by MachInit().

◆ XboxConsKbHit()

BOOLEAN XboxConsKbHit ( VOID  )

Definition at line 72 of file xboxcons.c.

73{
74 /* No keyboard support yet */
75 return FALSE;
76}
#define FALSE
Definition: types.h:117

Referenced by MachInit().

◆ XboxConsPutChar()

VOID XboxConsPutChar ( int  Ch)

Definition at line 29 of file xboxcons.c.

30{
32 BOOLEAN NeedScroll;
33
35
36 NeedScroll = (CurrentCursorY >= Height);
37 if (NeedScroll)
38 {
41 }
42
43 if (c == '\r')
44 {
46 }
47 else if (c == '\n')
48 {
50
51 if (!NeedScroll)
53 }
54 else if (c == '\t')
55 {
56 CurrentCursorX = (CurrentCursorX + 8) & ~ 7;
57 }
58 else
59 {
62 }
63
64 if (CurrentCursorX >= Width)
65 {
68 }
69}
unsigned char BOOLEAN
const GLubyte * c
Definition: glext.h:8905
#define Unused(x)
Definition: atlwin.h:28
uint32_t ULONG
Definition: typedefs.h:59
_In_ HFONT _Out_ PUINT _Out_ PUINT Width
Definition: font.h:89
_In_ HFONT _Out_ PUINT Height
Definition: font.h:88
VOID FbConsScrollUp(_In_ UCHAR Attr)
Definition: vidfb.c:513
static unsigned CurrentCursorX
Definition: xboxcons.c:24
static unsigned CurrentCursorY
Definition: xboxcons.c:25
static UCHAR CurrentAttr
Definition: xboxcons.c:26
VOID XboxVideoPutChar(int Ch, UCHAR Attr, unsigned X, unsigned Y)
Definition: xboxvideo.c:43
VOID XboxVideoGetDisplaySize(PULONG Width, PULONG Height, PULONG Depth)
Definition: xboxvideo.c:157

Referenced by MachInit().

◆ XboxDiskGetCacheableBlockCount()

ULONG XboxDiskGetCacheableBlockCount ( UCHAR  DriveNumber)

Definition at line 194 of file xboxdisk.c.

195{
196 PDEVICE_UNIT DeviceUnit;
197
198 DeviceUnit = XboxDiskDriveNumberToDeviceUnit(DriveNumber);
199 if (!DeviceUnit)
200 return 1; // Unknown count.
201
202 /*
203 * If LBA is supported then the block size will be 64 sectors (32k).
204 * If not then the block size is the size of one track.
205 */
206 if (DeviceUnit->Flags & ATA_DEVICE_LBA)
207 return 64;
208 else
209 return DeviceUnit->SectorsPerTrack;
210}
#define ATA_DEVICE_LBA
Definition: hwide.h:31
Data structure for the ATA device.
Definition: hwide.h:12
ULONG SectorsPerTrack
Definition: hwide.h:20
ULONG Flags
Definition: hwide.h:29
static PDEVICE_UNIT XboxDiskDriveNumberToDeviceUnit(UCHAR DriveNumber)
Definition: xboxdisk.c:101

Referenced by MachInit().

◆ XboxDiskGetDriveGeometry()

BOOLEAN XboxDiskGetDriveGeometry ( UCHAR  DriveNumber,
PGEOMETRY  DriveGeometry 
)

Definition at line 174 of file xboxdisk.c.

175{
176 PDEVICE_UNIT DeviceUnit;
177
178 TRACE("XboxDiskGetDriveGeometry(0x%x)\n", DriveNumber);
179
180 DeviceUnit = XboxDiskDriveNumberToDeviceUnit(DriveNumber);
181 if (!DeviceUnit)
182 return FALSE;
183
184 Geometry->Cylinders = DeviceUnit->Cylinders;
185 Geometry->Heads = DeviceUnit->Heads;
186 Geometry->SectorsPerTrack = DeviceUnit->SectorsPerTrack;
187 Geometry->BytesPerSector = DeviceUnit->SectorSize;
188 Geometry->Sectors = DeviceUnit->TotalSectors;
189
190 return TRUE;
191}
#define TRUE
Definition: types.h:120
#define TRACE(s)
Definition: solgame.cpp:4
ULONG Cylinders
Definition: hwide.h:14
ULONG SectorSize
Definition: hwide.h:23
ULONG64 TotalSectors
Definition: hwide.h:26
ULONG Heads
Definition: hwide.h:17

Referenced by MachInit(), and XboxGetHarddiskConfigurationData().

◆ XboxDiskReadLogicalSectors()

BOOLEAN XboxDiskReadLogicalSectors ( UCHAR  DriveNumber,
ULONGLONG  SectorNumber,
ULONG  SectorCount,
PVOID  Buffer 
)

◆ XboxGetTime()

TIMEINFO * XboxGetTime ( VOID  )

Definition at line 46 of file xboxrtc.c.

47{
48 static TIMEINFO TimeInfo;
49
51 {
52 ;
53 }
54
55 TimeInfo.Second = BCD_INT(HalpQueryCMOS(0));
56 TimeInfo.Minute = BCD_INT(HalpQueryCMOS(2));
57 TimeInfo.Hour = BCD_INT(HalpQueryCMOS(4));
58 TimeInfo.Day = BCD_INT(HalpQueryCMOS(7));
59 TimeInfo.Month = BCD_INT(HalpQueryCMOS(8));
60 TimeInfo.Year = BCD_INT(HalpQueryCMOS(9));
61 if (TimeInfo.Year > 80)
62 TimeInfo.Year += 1900;
63 else
64 TimeInfo.Year += 2000;
65
66 return &TimeInfo;
67}
Definition: fw.h:10
USHORT Month
Definition: fw.h:12
USHORT Day
Definition: fw.h:13
USHORT Minute
Definition: fw.h:15
USHORT Hour
Definition: fw.h:14
USHORT Second
Definition: fw.h:16
USHORT Year
Definition: fw.h:11
static UCHAR BCD_INT(_In_ UCHAR Bcd)
Definition: xboxrtc.c:26
static UCHAR HalpQueryCMOS(UCHAR Reg)
Definition: xboxrtc.c:33
#define RTC_REG_A_UIP
Definition: xboxrtc.c:22
#define RTC_REGISTER_A
Definition: xboxrtc.c:21

Referenced by MachInit().

◆ XboxHwDetect()

PCONFIGURATION_COMPONENT_DATA XboxHwDetect ( _In_opt_ PCSTR  Options)

Definition at line 291 of file machxbox.c.

293{
295 ULONG BusNumber = 0;
296
297 TRACE("DetectHardware()\n");
298
299 /* Create the 'System' key */
300 FldrCreateSystemKey(&SystemKey, "Original Xbox (PC/AT like)");
301
304
305 /* TODO: Build actual Xbox's hardware configuration tree */
306 DetectPciBios(SystemKey, &BusNumber);
307 DetectIsaBios(Options, SystemKey, &BusNumber);
308
309 /* On XBOX, the display controller is on PCI bus #1 */
310 {
312 ULONG NumPciBus = 0;
313 ULONG PciBusToFind = 1;
314
315 /* PCI buses are under the System Key (i.e. siblings) */
316 for (BusKey = SystemKey->Child; BusKey; BusKey = BusKey->Sibling)
317 {
318 ERR("** XBOX: Current bus '%s' **\n", BusKey->ComponentEntry.Identifier);
319
320 /* Try to get a match */
321 if ((BusKey->ComponentEntry.Class == AdapterClass) &&
323 /* Verify it's a PCI key */
324 (BusKey->ComponentEntry.Identifier &&
325 !_stricmp(BusKey->ComponentEntry.Identifier, "PCI")))
326 {
327 /* Got a PCI bus, check whether it's the one to find */
328 if (NumPciBus == PciBusToFind)
329 {
330 ERR("** XBOX: PCI bus #%lu found!\n **\n", PciBusToFind);
331 break;
332 }
333 /* Nope, continue */
334 ++NumPciBus;
335 }
336 }
337 if (BusKey)
338 {
339 ERR("** XBOX: Adding Display Controller on PCI #1 **\n");
341 }
342 }
343
344 TRACE("DetectHardware() Done\n");
345 return SystemKey;
346}
VOID FldrCreateSystemKey(_Out_ PCONFIGURATION_COMPONENT_DATA *SystemNode, _In_ PCSTR IdentifierString)
Definition: archwsup.c:135
#define ERR(fmt,...)
Definition: precomp.h:57
VOID DetectPciBios(PCONFIGURATION_COMPONENT_DATA SystemKey, ULONG *BusNumber)
Definition: hwpci.c:174
FIND_PCI_BIOS FindPciBios
Definition: hwpci.c:26
#define _stricmp
Definition: cat.c:22
static VOID DetectDisplayController(_In_ PCONFIGURATION_COMPONENT_DATA BusKey)
Definition: machxbox.c:155
static PCM_PARTIAL_RESOURCE_LIST XboxGetHarddiskConfigurationData(UCHAR DriveNumber, ULONG *pSize)
Definition: machxbox.c:97
static VOID DetectIsaBios(_In_opt_ PCSTR Options, _Inout_ PCONFIGURATION_COMPONENT_DATA SystemKey, _Out_ ULONG *BusNumber)
Definition: machxbox.c:228
BOOLEAN XboxFindPciBios(PPCI_REGISTRY_INFO BusData)
Definition: machxbox.c:35
GET_HARDDISK_CONFIG_DATA GetHarddiskConfigurationData
Definition: pchw.c:45
@ AdapterClass
Definition: arc.h:102
@ MultiFunctionAdapter
Definition: arc.h:125
CONFIGURATION_COMPONENT ComponentEntry
Definition: arc.h:287
struct _CONFIGURATION_COMPONENT_DATA * Sibling
Definition: arc.h:286
struct _CONFIGURATION_COMPONENT_DATA * Child
Definition: arc.h:285
CONFIGURATION_TYPE Type
Definition: arc.h:161
CONFIGURATION_CLASS Class
Definition: arc.h:160
_In_ PWDFDEVICE_INIT _In_ PWDF_REMOVE_LOCK_OPTIONS Options
Definition: wdfdevice.h:3540
_In_opt_ PUNICODE_STRING _In_ PDRIVER_OBJECT _In_ PDEVICE_OBJECT _In_ INTERFACE_TYPE _In_ ULONG BusNumber
Definition: halfuncs.h:160

Referenced by MachInit().

◆ XboxHwIdle()

VOID XboxHwIdle ( VOID  )

Definition at line 348 of file machxbox.c.

349{
350 /* UNIMPLEMENTED */
351}

Referenced by MachInit().

◆ XboxMemGetMemoryMap()

PFREELDR_MEMORY_DESCRIPTOR XboxMemGetMemoryMap ( ULONG MemoryMapSize)

Definition at line 228 of file xboxmem.c.

229{
230 memory_map_t * MbMap;
231 INT Count, i;
232
233 TRACE("XboxMemGetMemoryMap()\n");
234
236 if (MbMap)
237 {
238 /* Obtain memory map via multiboot spec */
239
240 for (i = 0; i < Count; i++, MbMap++)
241 {
242 TRACE("i = %d, base_addr_low = 0x%p, length_low = 0x%p\n", i, MbMap->base_addr_low, MbMap->length_low);
243
244 if (MbMap->base_addr_high > 0 || MbMap->length_high > 0)
245 {
246 ERR("Memory descriptor base or size is greater than 4 GB, should not happen on Xbox!\n");
247 ASSERT(FALSE);
248 }
249
251 MbMap->base_addr_low,
252 MbMap->length_low,
254 }
255 }
256 else
257 {
258 /* Synthesize memory map */
259
260 /* Available RAM block */
262 0,
263 AvailableMemoryMb * 1024 * 1024,
264 LoaderFree);
265
266 if (FrameBufferSize != 0)
267 {
268 /* Video memory */
273 "Video memory");
274 }
275 }
276
277 *MemoryMapSize = PcMemFinalizeMemoryMap(XboxMemoryMap);
278 return XboxMemoryMap;
279}
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define ASSERT(a)
Definition: mode.c:44
int Count
Definition: noreturn.cpp:7
@ LoaderFree
Definition: arc.h:295
@ LoaderFirmwarePermanent
Definition: arc.h:299
unsigned long base_addr_low
Definition: multiboot.h:119
unsigned long length_low
Definition: multiboot.h:121
unsigned long type
Definition: multiboot.h:123
unsigned long base_addr_high
Definition: multiboot.h:120
unsigned long length_high
Definition: multiboot.h:122
int32_t INT
Definition: typedefs.h:58
memory_map_t * XboxGetMultibootMemoryMap(INT *Count)
Definition: xboxmem.c:175
ULONG FrameBufferSize
Definition: xboxvideo.c:30
static FREELDR_MEMORY_DESCRIPTOR XboxMemoryMap[MAX_BIOS_DESCRIPTORS+1]
Definition: xboxmem.c:225
ULONG PcMemFinalizeMemoryMap(PFREELDR_MEMORY_DESCRIPTOR MemoryMap)
Definition: pcmem.c:554
static ULONG AvailableMemoryMb
Definition: xboxmem.c:28
VOID ReserveMemory(PFREELDR_MEMORY_DESCRIPTOR MemoryMap, ULONG_PTR BaseAddress, SIZE_T Size, TYPE_OF_MEMORY MemoryType, PCHAR Usage)
Definition: pcmem.c:491
TYPE_OF_MEMORY XboxMultibootMemoryType(ULONG Type)
Definition: xboxmem.c:206
ULONG_PTR FrameBuffer
Definition: xboxvideo.c:29
VOID SetMemory(PFREELDR_MEMORY_DESCRIPTOR MemoryMap, ULONG_PTR BaseAddress, SIZE_T Size, TYPE_OF_MEMORY MemoryType)
Definition: pcmem.c:534

Referenced by MachInit().

◆ XboxMemInit()

VOID XboxMemInit ( VOID  )

Definition at line 117 of file xboxmem.c.

118{
119 PCI_TYPE1_CFG_BITS PciCfg1;
120 UCHAR ControlRegion[TEST_SIZE];
121 PVOID MembaseTop = (PVOID)(64 * 1024 * 1024);
122 PVOID MembaseLow = (PVOID)0;
123
125 WRITE_REGISTER_ULONG((PULONG)(NvBase + NV2A_FB_CFG0 + 4), 0x11448000);
126
127 /* Select Host to PCI bridge */
128 PciCfg1.u.bits.Enable = 1;
129 PciCfg1.u.bits.BusNumber = 0;
130 PciCfg1.u.bits.DeviceNumber = 0;
131 PciCfg1.u.bits.FunctionNumber = 0;
132 PciCfg1.u.bits.Reserved = 0;
133 /* Prepare hardware for 128 MB */
134 PciCfg1.u.bits.RegisterNumber = 0x84;
135
138
140 memset(ControlRegion, TEST_PATTERN1, TEST_SIZE);
141 memset(MembaseTop, TEST_PATTERN1, TEST_SIZE);
142 __wbinvd();
143
144 if (memcmp(MembaseTop, ControlRegion, TEST_SIZE) == 0)
145 {
146 /* Looks like there is memory .. maybe a 128MB box */
147 memset(ControlRegion, TEST_PATTERN2, TEST_SIZE);
148 memset(MembaseTop, TEST_PATTERN2, TEST_SIZE);
149 __wbinvd();
150 if (memcmp(MembaseTop, ControlRegion, TEST_SIZE) == 0)
151 {
152 /* Definitely looks like there is memory */
153 if (memcmp(MembaseLow, ControlRegion, TEST_SIZE) == 0)
154 {
155 /* Hell, we find the Test-string at 0x0 too! */
157 }
158 else
159 {
160 InstalledMemoryMb = 128;
161 }
162 }
163 }
164
165 /* Set hardware for amount of memory detected */
168
170
172}
#define WRITE_REGISTER_ULONG(r, v)
Definition: arm.h:11
#define PCI_TYPE1_DATA_PORT
Definition: hardware.h:45
#define PCI_TYPE1_ADDRESS_PORT
Definition: hardware.h:44
_ACRTIMP int __cdecl memcmp(const void *, const void *, size_t)
Definition: string.c:2802
VOID NTAPI WRITE_PORT_ULONG(IN PULONG Port, IN ULONG Value)
Definition: portio.c:123
PPC_QUAL void __wbinvd(void)
Definition: intrin_ppc.h:759
#define memset(x, y, z)
Definition: compat.h:39
union _PCI_TYPE1_CFG_BITS::@195 u
struct _PCI_TYPE1_CFG_BITS::@195::@196 bits
uint32_t * PULONG
Definition: typedefs.h:59
void * PVOID
Definition: typedefs.h:50
static VOID XboxInitializePCI(VOID)
Definition: xboxmem.c:59
#define TEST_PATTERN2
Definition: xboxmem.c:36
#define TEST_SIZE
Definition: xboxmem.c:34
ULONG NvBase
Definition: xboxvideo.c:28
#define TEST_PATTERN1
Definition: xboxmem.c:35
static ULONG InstalledMemoryMb
Definition: xboxmem.c:27
#define NV2A_FB_CFG0
Definition: xgpu.h:19
unsigned char UCHAR
Definition: xmlstorage.h:181

Referenced by MachInit().

◆ XboxPrepareForReactOS()

VOID XboxPrepareForReactOS ( VOID  )

Definition at line 440 of file machxbox.c.

441{
442 /* Prepare video and turn off debug messages to screen */
445}
#define DebugDisableScreenPort()
Definition: debug.h:123
VOID XboxVideoPrepareForReactOS(VOID)
Definition: xboxvideo.c:217

Referenced by MachInit().

◆ XboxSetLED()

VOID XboxSetLED ( PCSTR  Pattern)

Definition at line 198 of file xboxi2c.c.

198 {
199 const char *x = pattern;
200 int r, g;
201
202 if(strlen(pattern) == 4) {
203 r = g = 0;
204 while (*x) {
205 r *= 2;
206 g *= 2;
207 switch (*x) {
208 case 'r':
209 r++;
210 break;
211 case 'g':
212 g++;
213 break;
214 case 'o':
215 r++;
216 g++;
217 break;
218 }
219 x++;
220 }
221 I2cSetFrontpanelLed(((r<<4) & 0xF0) + (g & 0xF));
222 }
223}
_ACRTIMP size_t __cdecl strlen(const char *)
Definition: string.c:1592
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
GLubyte * pattern
Definition: glext.h:7787
GLboolean GLboolean g
Definition: glext.h:6204
static void I2cSetFrontpanelLed(UCHAR b)
Definition: xboxi2c.c:188

Referenced by MachInit().

◆ XboxVideoClearScreen()

VOID XboxVideoClearScreen ( UCHAR  Attr)

Definition at line 37 of file xboxvideo.c.

38{
40}
VOID FbConsClearScreen(_In_ UCHAR Attr)
Definition: vidfb.c:413

Referenced by MachInit().

◆ XboxVideoCopyOffScreenBufferToVRAM()

VOID XboxVideoCopyOffScreenBufferToVRAM ( PVOID  Buffer)

Definition at line 187 of file xboxvideo.c.

188{
190}
Definition: bufpool.h:45
VOID FbConsCopyOffScreenBufferToVRAM(_In_ PVOID Buffer)
Copies a full text-mode CGA-style character buffer rectangle to the console.
Definition: vidfb.c:492

Referenced by MachInit().

◆ XboxVideoGetBufferSize()

ULONG XboxVideoGetBufferSize ( VOID  )

Definition at line 163 of file xboxvideo.c.

164{
165 return FbConsGetBufferSize();
166}
ULONG FbConsGetBufferSize(VOID)
Returns the size in bytes, of a full text-mode CGA-style character buffer rectangle that can fill the...
Definition: vidfb.c:481

Referenced by MachInit().

◆ XboxVideoGetDisplaySize()

VOID XboxVideoGetDisplaySize ( PULONG  Width,
PULONG  Height,
PULONG  Depth 
)

Definition at line 157 of file xboxvideo.c.

158{
160}
VOID FbConsGetDisplaySize(_Out_ PULONG Width, _Out_ PULONG Height, _Out_ PULONG Depth)
Returns the width and height in number of CGA characters/attributes, of a full text-mode CGA-style ch...
Definition: vidfb.c:462
_In_opt_ PALLOCATE_FUNCTION _In_opt_ PFREE_FUNCTION _In_ ULONG _In_ SIZE_T _In_ ULONG _In_ USHORT Depth
Definition: exfuncs.h:819

Referenced by MachInit(), and XboxConsPutChar().

◆ XboxVideoGetFontsFromFirmware()

VOID XboxVideoGetFontsFromFirmware ( PULONG  RomFontPointers)

Definition at line 169 of file xboxvideo.c.

170{
171 TRACE("XboxVideoGetFontsFromFirmware(): UNIMPLEMENTED\n");
172}

Referenced by MachInit().

◆ XboxVideoGetPaletteColor()

VOID XboxVideoGetPaletteColor ( UCHAR  Color,
UCHAR Red,
UCHAR Green,
UCHAR Blue 
)

Definition at line 205 of file xboxvideo.c.

206{
207 /* Not supported */
208}

Referenced by MachInit().

◆ XboxVideoHideShowTextCursor()

VOID XboxVideoHideShowTextCursor ( BOOLEAN  Show)

Definition at line 181 of file xboxvideo.c.

182{
183 /* We don't have a cursor yet */
184}

Referenced by MachInit(), and XboxVideoPrepareForReactOS().

◆ XboxVideoInit()

VOID XboxVideoInit ( VOID  )

Definition at line 96 of file xboxvideo.c.

97{
101
102 /* Reuse the framebuffer that was set up by firmware */
104 TRACE("XBOX framebuffer at 0x%p\n", FrameBuffer);
105 /* Verify that the framebuffer address is page-aligned */
107
108 /* Obtain framebuffer memory size from the multiboot memory map */
110 {
111 /* Fallback to Cromwell standard which reserves high 4 MB of RAM */
112 FrameBufferSize = 4 * 1024 * 1024; // See FB_SIZE
113 WARN("Could not detect framebuffer memory size, fallback to 4 MB\n");
114 }
115
118
119 /* Get BPP directly from NV2A CRTC (magic constants are from Cromwell) */
120 BytesPerPixel = 8 * (((NvGetCrtc(0x19) & 0xE0) << 3) | (NvGetCrtc(0x13) & 0xFF)) / ScreenWidth;
121 if (BytesPerPixel == 4)
122 ASSERT((NvGetCrtc(0x28) & 0xF) == BytesPerPixel - 1);
123 else
124 ASSERT((NvGetCrtc(0x28) & 0xF) == BytesPerPixel);
125
126 /* Verify screen resolution */
127 ASSERT(ScreenWidth > 1);
128 ASSERT(ScreenHeight > 1);
129 ASSERT(BytesPerPixel >= 1 && BytesPerPixel <= 4);
130 /* Verify that screen fits framebuffer size */
132
139 BytesPerPixel * 8,
140 NULL))
141 {
142 ERR("Couldn't initialize video framebuffer\n");
143 return;
144 }
145
147}
#define READ_REGISTER_ULONG(r)
Definition: arm.h:10
#define WARN(fmt,...)
Definition: precomp.h:61
#define NULL
Definition: types.h:112
#define ULONG_PTR
Definition: config.h:101
#define PAGE_SIZE
Definition: env_spec_w32.h:49
static UCHAR BytesPerPixel
Definition: bootvid.c:37
static ULONG ScreenWidth
Definition: pcvideo.c:116
static ULONG ScreenHeight
Definition: pcvideo.c:117
VOID VidFbClearScreenColor(_In_ UINT32 Color, _In_ BOOLEAN FullScreen)
Definition: vidfb.c:230
BOOLEAN VidFbInitializeVideo(_Out_opt_ PCM_FRAMEBUF_DEVICE_DATA *pFbData, _In_ ULONG_PTR BaseAddress, _In_ ULONG BufferSize, _In_ UINT32 ScreenWidth, _In_ UINT32 ScreenHeight, _In_ UINT32 PixelsPerScanLine, _In_ UINT32 BitsPerPixel, _In_opt_ PPIXEL_BITMASK PixelMasks)
Initializes internal framebuffer information based on the given parameters.
Definition: vidfb.c:99
ULONG FrameBufferSize
Definition: xboxvideo.c:30
static UCHAR NvGetCrtc(UCHAR Index)
Definition: xboxvideo.c:49
PCM_FRAMEBUF_DEVICE_DATA FrameBufferData
Definition: xboxvideo.c:31
ULONG NvBase
Definition: xboxvideo.c:28
static ULONG XboxGetFramebufferSize(_In_ ULONG_PTR Offset)
Definition: xboxvideo.c:56
ULONG_PTR FrameBuffer
Definition: xboxvideo.c:29
#define MAKE_COLOR(Red, Green, Blue)
Definition: xboxvideo.c:34
#define NV2A_CRTC_FRAMEBUFFER_START
Definition: xgpu.h:21
#define NV2A_RAMDAC_FP_VVALID_END
Definition: xgpu.h:26
#define NV2A_RAMDAC_FP_HVALID_END
Definition: xgpu.h:25

Referenced by MachInit().

◆ XboxVideoIsPaletteFixed()

BOOLEAN XboxVideoIsPaletteFixed ( VOID  )

Definition at line 193 of file xboxvideo.c.

194{
195 return FALSE;
196}

Referenced by MachInit().

◆ XboxVideoPrepareForReactOS()

VOID XboxVideoPrepareForReactOS ( VOID  )

Definition at line 217 of file xboxvideo.c.

218{
221}
VOID XboxVideoHideShowTextCursor(BOOLEAN Show)
Definition: xboxvideo.c:181

Referenced by XboxPrepareForReactOS().

◆ XboxVideoPutChar()

VOID XboxVideoPutChar ( int  Ch,
UCHAR  Attr,
unsigned  X,
unsigned  Y 
)

Definition at line 43 of file xboxvideo.c.

44{
45 FbConsPutChar(Ch, Attr, X, Y);
46}
#define Y(I)
#define Ch(x, y, z)
Definition: sha2.c:141
VOID FbConsPutChar(_In_ UCHAR Char, _In_ UCHAR Attr, _In_ ULONG Column, _In_ ULONG Row)
Displays a character with specific text attributes at a given position.
Definition: vidfb.c:445

Referenced by MachInit(), and XboxConsPutChar().

◆ XboxVideoSetDisplayMode()

VIDEODISPLAYMODE XboxVideoSetDisplayMode ( PCSTR  DisplayModem,
BOOLEAN  Init 
)

Definition at line 150 of file xboxvideo.c.

151{
152 /* We only have one mode, semi-text */
153 return VideoTextMode;
154}
@ VideoTextMode
Definition: machine.h:35

Referenced by MachInit().

◆ XboxVideoSetPaletteColor()

VOID XboxVideoSetPaletteColor ( UCHAR  Color,
UCHAR  Red,
UCHAR  Green,
UCHAR  Blue 
)

Definition at line 199 of file xboxvideo.c.

200{
201 /* Not supported */
202}

Referenced by MachInit().

◆ XboxVideoSetTextCursorPosition()

VOID XboxVideoSetTextCursorPosition ( UCHAR  X,
UCHAR  Y 
)

Definition at line 175 of file xboxvideo.c.

176{
177 /* We don't have a cursor yet */
178}

Referenced by MachInit().

◆ XboxVideoSync()

VOID XboxVideoSync ( VOID  )

Definition at line 211 of file xboxvideo.c.

212{
213 /* Not supported */
214}

Referenced by MachInit().