#include "mm.h"
#include <drivers/xbox/xgpu.h>
Go to the source code of this file.
|
VOID | XboxConsPutChar (int Ch) |
|
BOOLEAN | XboxConsKbHit (VOID) |
|
int | XboxConsGetCh (VOID) |
|
VOID | XboxVideoInit (VOID) |
|
VOID | XboxVideoClearScreen (UCHAR Attr) |
|
VIDEODISPLAYMODE | XboxVideoSetDisplayMode (char *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 | XboxVideoScrollUp (VOID) |
|
VOID | XboxPrepareForReactOS (VOID) |
|
VOID | XboxMemInit (VOID) |
|
PFREELDR_MEMORY_DESCRIPTOR | XboxMemGetMemoryMap (ULONG *MemoryMapSize) |
|
VOID | XboxDiskInit (BOOLEAN Init) |
|
BOOLEAN | XboxDiskReadLogicalSectors (UCHAR DriveNumber, ULONGLONG SectorNumber, ULONG SectorCount, PVOID Buffer) |
|
BOOLEAN | XboxDiskGetDriveGeometry (UCHAR DriveNumber, PGEOMETRY DriveGeometry) |
|
ULONG | XboxDiskGetCacheableBlockCount (UCHAR DriveNumber) |
|
TIMEINFO * | XboxGetTime (VOID) |
|
PCONFIGURATION_COMPONENT_DATA | XboxHwDetect (_In_opt_ PCSTR Options) |
|
VOID | XboxHwIdle (VOID) |
|
VOID | XboxSetLED (PCSTR Pattern) |
|
◆ XboxConsGetCh()
◆ XboxConsKbHit()
◆ XboxConsPutChar()
Definition at line 26 of file xboxcons.c.
27{
30
32
34 if (NeedScroll)
35 {
38 }
39
41 {
43 }
45 {
47
48 if (!NeedScroll)
50 }
52 {
54 }
55 else
56 {
59 }
60
62 {
65 }
66}
_In_ HFONT _Out_ PUINT _Out_ PUINT Width
_In_ HFONT _Out_ PUINT Height
static unsigned CurrentAttr
static unsigned CurrentCursorX
static unsigned CurrentCursorY
VOID XboxVideoPutChar(int Ch, UCHAR Attr, unsigned X, unsigned Y)
VOID XboxVideoGetDisplaySize(PULONG Width, PULONG Height, PULONG Depth)
VOID XboxVideoScrollUp(VOID)
Referenced by MachInit().
◆ XboxDiskGetCacheableBlockCount()
ULONG XboxDiskGetCacheableBlockCount |
( |
UCHAR |
DriveNumber | ) |
|
Definition at line 123 of file xboxdisk.c.
124{
126
128 if (!DeviceUnit)
129 return 1;
130
131
132
133
134
136 return 64;
137 else
139}
static PDEVICE_UNIT XboxDiskDriveNumberToDeviceUnit(UCHAR DriveNumber)
Referenced by MachInit().
◆ XboxDiskGetDriveGeometry()
◆ XboxDiskInit()
Definition at line 26 of file xboxdisk.c.
27{
31
33 {
34
36 for (UnitNumber = 0; UnitNumber <= DetectedCount; UnitNumber++)
37 {
39 if (DeviceUnit)
40 {
42 {
45 }
46 else
47 {
50 }
51 }
52 }
54 }
55 else
56 {
58 }
59}
PDEVICE_UNIT AtaGetDevice(IN UCHAR UnitNumber)
BOOLEAN AtaInit(OUT PUCHAR DetectedCount)
static PDEVICE_UNIT HardDrive
static BOOLEAN AtaInitialized
static PDEVICE_UNIT CdDrive
Referenced by XboxDiskDriveNumberToDeviceUnit(), and XboxPrepareForReactOS().
◆ XboxDiskReadLogicalSectors()
◆ XboxGetTime()
Definition at line 40 of file xboxrtc.c.
41{
43
45 {
46 ;
47 }
48
55 if (TimeInfo.
Year > 80)
56 TimeInfo.
Year += 1900;
57 else
58 TimeInfo.
Year += 2000;
59
60 return &TimeInfo;
61}
static UCHAR HalpQueryCMOS(UCHAR Reg)
Referenced by MachInit().
◆ XboxHwDetect()
Definition at line 266 of file machxbox.c.
268{
271
272 TRACE(
"DetectHardware()\n");
273
274
276
279
280
283
284 TRACE(
"DetectHardware() Done\n");
285 return SystemKey;
286}
VOID FldrCreateSystemKey(_Out_ PCONFIGURATION_COMPONENT_DATA *SystemNode, _In_ PCSTR IdentifierString)
VOID DetectPciBios(PCONFIGURATION_COMPONENT_DATA SystemKey, ULONG *BusNumber)
FIND_PCI_BIOS FindPciBios
static PCM_PARTIAL_RESOURCE_LIST XboxGetHarddiskConfigurationData(UCHAR DriveNumber, ULONG *pSize)
static VOID DetectIsaBios(_In_opt_ PCSTR Options, _Inout_ PCONFIGURATION_COMPONENT_DATA SystemKey, _Out_ ULONG *BusNumber)
BOOLEAN XboxFindPciBios(PPCI_REGISTRY_INFO BusData)
GET_HARDDISK_CONFIG_DATA GetHarddiskConfigurationData
_In_ PWDFDEVICE_INIT _In_ PWDF_REMOVE_LOCK_OPTIONS Options
_In_opt_ PUNICODE_STRING _In_ PDRIVER_OBJECT _In_ PDEVICE_OBJECT _In_ INTERFACE_TYPE _In_ ULONG BusNumber
Referenced by MachInit().
◆ XboxHwIdle()
◆ XboxMemGetMemoryMap()
Definition at line 228 of file xboxmem.c.
229{
232
233 TRACE(
"XboxMemGetMemoryMap()\n");
234
236 if (MbMap)
237 {
238
239
240 for (
i = 0;
i <
Count;
i++, MbMap++)
241 {
243
245 {
246 ERR(
"Memory descriptor base or size is greater than 4 GB, should not happen on Xbox!\n");
248 }
249
254 }
255 }
256 else
257 {
258
259
260
262 0,
265
267 {
268
273 "Video memory");
274 }
275 }
276
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
@ LoaderFirmwarePermanent
unsigned long base_addr_low
unsigned long base_addr_high
unsigned long length_high
memory_map_t * XboxGetMultibootMemoryMap(INT *Count)
FREELDR_MEMORY_DESCRIPTOR XboxMemoryMap[MAX_BIOS_DESCRIPTORS+1]
ULONG PcMemFinalizeMemoryMap(PFREELDR_MEMORY_DESCRIPTOR MemoryMap)
static ULONG AvailableMemoryMb
VOID ReserveMemory(PFREELDR_MEMORY_DESCRIPTOR MemoryMap, ULONG_PTR BaseAddress, SIZE_T Size, TYPE_OF_MEMORY MemoryType, PCHAR Usage)
TYPE_OF_MEMORY XboxMultibootMemoryType(ULONG Type)
VOID SetMemory(PFREELDR_MEMORY_DESCRIPTOR MemoryMap, ULONG_PTR BaseAddress, SIZE_T Size, TYPE_OF_MEMORY MemoryType)
Referenced by MachInit().
◆ XboxMemInit()
Definition at line 117 of file xboxmem.c.
118{
123
126
127
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
134 PciCfg1.
u.
bits.RegisterNumber = 0x84;
135
138
143
145 {
146
151 {
152
154 {
155
157 }
158 else
159 {
161 }
162 }
163 }
164
165
168
170
172}
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
#define WRITE_REGISTER_ULONG(r, v)
#define PCI_TYPE1_DATA_PORT
#define PCI_TYPE1_ADDRESS_PORT
VOID NTAPI WRITE_PORT_ULONG(IN PULONG Port, IN ULONG Value)
PPC_QUAL void __wbinvd(void)
struct _PCI_TYPE1_CFG_BITS::@157::@158 bits
union _PCI_TYPE1_CFG_BITS::@157 u
static VOID XboxInitializePCI(VOID)
static ULONG InstalledMemoryMb
Referenced by MachInit().
◆ XboxPrepareForReactOS()
Definition at line 373 of file machxbox.c.
374{
375
379
380
382}
#define DebugDisableScreenPort()
VOID __cdecl DiskStopFloppyMotor(VOID)
VOID XboxDiskInit(BOOLEAN Init)
VOID XboxVideoPrepareForReactOS(VOID)
Referenced by MachInit().
◆ XboxSetLED()
Definition at line 198 of file xboxi2c.c.
198 {
201
208 case 'r':
210 break;
211 case 'g':
213 break;
214 case 'o':
217 break;
218 }
220 }
222 }
223}
ACPI_SIZE strlen(const char *String)
GLint GLint GLint GLint GLint x
GLdouble GLdouble GLdouble r
static void I2cSetFrontpanelLed(UCHAR b)
Referenced by MachInit().
◆ XboxVideoClearScreen()
Definition at line 126 of file xboxvideo.c.
127{
128 ULONG FgColor, BgColor;
129
131
133}
static VOID XboxVideoClearScreenColor(ULONG Color, BOOLEAN FullScreen)
static VOID XboxVideoAttrToColors(UCHAR Attr, ULONG *FgColor, ULONG *BgColor)
Referenced by MachInit().
◆ XboxVideoCopyOffScreenBufferToVRAM()
VOID XboxVideoCopyOffScreenBufferToVRAM |
( |
PVOID |
Buffer | ) |
|
Definition at line 275 of file xboxvideo.c.
276{
279
281 {
283 {
285 OffScreenBuffer += 2;
286 }
287 }
288}
static ULONG ScreenHeight
Referenced by MachInit().
◆ XboxVideoGetBufferSize()
◆ XboxVideoGetDisplaySize()
Definition at line 243 of file xboxvideo.c.
244{
248}
_In_opt_ PALLOCATE_FUNCTION _In_opt_ PFREE_FUNCTION _In_ ULONG _In_ SIZE_T _In_ ULONG _In_ USHORT Depth
Referenced by MachInit(), and XboxConsPutChar().
◆ XboxVideoGetFontsFromFirmware()
VOID XboxVideoGetFontsFromFirmware |
( |
PULONG |
RomFontPointers | ) |
|
◆ XboxVideoGetPaletteColor()
◆ XboxVideoHideShowTextCursor()
◆ XboxVideoInit()
Definition at line 196 of file xboxvideo.c.
197{
198
200
202
203
205 {
206
208 WARN(
"Could not detect framebuffer memory size, fallback to 4 MB\n");
209 }
210
213
216 {
218 }
219 else
220 {
222 }
224
225
229
231
233}
#define READ_REGISTER_ULONG(r)
ULONG XboxGetFramebufferSize(PVOID Offset)
#define MAKE_COLOR(Red, Green, Blue)
static ULONG BytesPerPixel
UCHAR NvGetCrtc(UCHAR Index)
#define NV2A_CRTC_FRAMEBUFFER_START
#define NV2A_RAMDAC_FP_VVALID_END
#define NV2A_RAMDAC_FP_HVALID_END
Referenced by MachInit().
◆ XboxVideoIsPaletteFixed()
◆ XboxVideoPrepareForReactOS()
VOID XboxVideoPrepareForReactOS |
( |
VOID |
| ) |
|
◆ XboxVideoPutChar()
◆ XboxVideoScrollUp()
◆ XboxVideoSetDisplayMode()
◆ XboxVideoSetPaletteColor()
◆ XboxVideoSetTextCursorPosition()
◆ XboxVideoSync()
◆ BitmapFont8x16
UCHAR BitmapFont8x16[256 *16] |
|
extern |