mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2025-06-01 23:38:23 -04:00
strat: use m_ for member variables
This commit is contained in:
parent
ce28591ab2
commit
a595c232b9
425 changed files with 8531 additions and 8484 deletions
stratosphere/fatal/source
|
@ -70,10 +70,10 @@ namespace ams::fatal::srv {
|
|||
/* Task definitions. */
|
||||
class ShowFatalTask : public ITaskWithStack<0x8000> {
|
||||
private:
|
||||
ViDisplay display;
|
||||
ViLayer layer;
|
||||
NWindow win;
|
||||
NvMap map;
|
||||
ViDisplay m_display;
|
||||
ViLayer m_layer;
|
||||
NWindow m_win;
|
||||
NvMap m_map;
|
||||
private:
|
||||
Result SetupDisplayInternal();
|
||||
Result SetupDisplayExternal();
|
||||
|
@ -156,19 +156,19 @@ namespace ams::fatal::srv {
|
|||
R_TRY(SetupDisplayExternal());
|
||||
|
||||
/* Open the default display. */
|
||||
R_TRY(viOpenDefaultDisplay(std::addressof(this->display)));
|
||||
R_TRY(viOpenDefaultDisplay(std::addressof(m_display)));
|
||||
|
||||
/* Reset the display magnification to its default value. */
|
||||
s32 display_width, display_height;
|
||||
R_TRY(viGetDisplayLogicalResolution(std::addressof(this->display), std::addressof(display_width), std::addressof(display_height)));
|
||||
R_TRY(viGetDisplayLogicalResolution(std::addressof(m_display), std::addressof(display_width), std::addressof(display_height)));
|
||||
|
||||
/* viSetDisplayMagnification was added in 3.0.0. */
|
||||
if (hos::GetVersion() >= hos::Version_3_0_0) {
|
||||
R_TRY(viSetDisplayMagnification(std::addressof(this->display), 0, 0, display_width, display_height));
|
||||
R_TRY(viSetDisplayMagnification(std::addressof(m_display), 0, 0, display_width, display_height));
|
||||
}
|
||||
|
||||
/* Create layer to draw to. */
|
||||
R_TRY(viCreateLayer(std::addressof(this->display), std::addressof(this->layer)));
|
||||
R_TRY(viCreateLayer(std::addressof(m_display), std::addressof(m_layer)));
|
||||
|
||||
/* Setup the layer. */
|
||||
{
|
||||
|
@ -183,16 +183,16 @@ namespace ams::fatal::srv {
|
|||
const float layer_x = static_cast<float>((display_width - LayerWidth) / 2);
|
||||
const float layer_y = static_cast<float>((display_height - LayerHeight) / 2);
|
||||
|
||||
R_TRY(viSetLayerSize(std::addressof(this->layer), LayerWidth, LayerHeight));
|
||||
R_TRY(viSetLayerSize(std::addressof(m_layer), LayerWidth, LayerHeight));
|
||||
|
||||
/* Set the layer's Z at display maximum, to be above everything else .*/
|
||||
R_TRY(viSetLayerZ(std::addressof(this->layer), FatalLayerZ));
|
||||
R_TRY(viSetLayerZ(std::addressof(m_layer), FatalLayerZ));
|
||||
|
||||
/* Center the layer in the screen. */
|
||||
R_TRY(viSetLayerPosition(std::addressof(this->layer), layer_x, layer_y));
|
||||
R_TRY(viSetLayerPosition(std::addressof(m_layer), layer_x, layer_y));
|
||||
|
||||
/* Create framebuffer. */
|
||||
R_TRY(nwindowCreateFromLayer(std::addressof(this->win), std::addressof(this->layer)));
|
||||
R_TRY(nwindowCreateFromLayer(std::addressof(m_win), std::addressof(m_layer)));
|
||||
R_TRY(this->InitializeNativeWindow());
|
||||
}
|
||||
|
||||
|
@ -229,14 +229,14 @@ namespace ams::fatal::srv {
|
|||
/* Draw error message and firmware. */
|
||||
font::SetPosition(start_x, start_y);
|
||||
font::SetFontSize(16.0f);
|
||||
font::PrintFormat(config.GetErrorMessage(), this->context->result.GetModule(), this->context->result.GetDescription(), this->context->result.GetValue());
|
||||
font::PrintFormat(config.GetErrorMessage(), m_context->result.GetModule(), m_context->result.GetDescription(), m_context->result.GetValue());
|
||||
font::AddSpacingLines(0.5f);
|
||||
font::PrintFormatLine( "Program: %016lX", static_cast<u64>(this->context->program_id));
|
||||
font::PrintFormatLine( "Program: %016lX", static_cast<u64>(m_context->program_id));
|
||||
font::AddSpacingLines(0.5f);
|
||||
|
||||
font::PrintFormatLine("Firmware: %s (Atmosphère %u.%u.%u-%s)", config.GetFirmwareVersion().display_version, ATMOSPHERE_RELEASE_VERSION, ams::GetGitRevision());
|
||||
font::AddSpacingLines(1.5f);
|
||||
if (!exosphere::ResultVersionMismatch::Includes(this->context->result)) {
|
||||
if (!exosphere::ResultVersionMismatch::Includes(m_context->result)) {
|
||||
font::Print(config.GetErrorDescription());
|
||||
} else {
|
||||
/* Print a special message for atmosphere version mismatch. */
|
||||
|
@ -260,7 +260,7 @@ namespace ams::fatal::srv {
|
|||
u32 pc_x = 0;
|
||||
|
||||
/* Note architecutre. */
|
||||
const bool is_aarch32 = this->context->cpu_ctx.architecture == CpuContext::Architecture_Aarch32;
|
||||
const bool is_aarch32 = m_context->cpu_ctx.architecture == CpuContext::Architecture_Aarch32;
|
||||
|
||||
/* Print GPRs. */
|
||||
font::SetFontSize(14.0f);
|
||||
|
@ -273,8 +273,8 @@ namespace ams::fatal::srv {
|
|||
u32 x = font::GetX();
|
||||
font::PrintFormat("%s:", aarch32::CpuContext::RegisterNameStrings[i]);
|
||||
font::SetPosition(x + 47, font::GetY());
|
||||
if (this->context->cpu_ctx.aarch32_ctx.HasRegisterValue(static_cast<aarch32::RegisterName>(i))) {
|
||||
font::PrintMonospaceU32(this->context->cpu_ctx.aarch32_ctx.r[i]);
|
||||
if (m_context->cpu_ctx.aarch32_ctx.HasRegisterValue(static_cast<aarch32::RegisterName>(i))) {
|
||||
font::PrintMonospaceU32(m_context->cpu_ctx.aarch32_ctx.r[i]);
|
||||
font::PrintMonospaceBlank(8);
|
||||
} else {
|
||||
font::PrintMonospaceBlank(16);
|
||||
|
@ -283,8 +283,8 @@ namespace ams::fatal::srv {
|
|||
pc_x = font::GetX();
|
||||
font::PrintFormat("%s:", aarch32::CpuContext::RegisterNameStrings[i + (aarch32::RegisterName_GeneralPurposeCount / 2)]);
|
||||
font::SetPosition(pc_x + 47, font::GetY());
|
||||
if (this->context->cpu_ctx.aarch32_ctx.HasRegisterValue(static_cast<aarch32::RegisterName>(i + (aarch32::RegisterName_GeneralPurposeCount / 2)))) {
|
||||
font::PrintMonospaceU32(this->context->cpu_ctx.aarch32_ctx.r[i + (aarch32::RegisterName_GeneralPurposeCount / 2)]);
|
||||
if (m_context->cpu_ctx.aarch32_ctx.HasRegisterValue(static_cast<aarch32::RegisterName>(i + (aarch32::RegisterName_GeneralPurposeCount / 2)))) {
|
||||
font::PrintMonospaceU32(m_context->cpu_ctx.aarch32_ctx.r[i + (aarch32::RegisterName_GeneralPurposeCount / 2)]);
|
||||
font::PrintMonospaceBlank(8);
|
||||
} else {
|
||||
font::PrintMonospaceBlank(16);
|
||||
|
@ -303,8 +303,8 @@ namespace ams::fatal::srv {
|
|||
u32 x = font::GetX();
|
||||
font::PrintFormat("%s:", aarch64::CpuContext::RegisterNameStrings[i]);
|
||||
font::SetPosition(x + 47, font::GetY());
|
||||
if (this->context->cpu_ctx.aarch64_ctx.HasRegisterValue(static_cast<aarch64::RegisterName>(i))) {
|
||||
font::PrintMonospaceU64(this->context->cpu_ctx.aarch64_ctx.x[i]);
|
||||
if (m_context->cpu_ctx.aarch64_ctx.HasRegisterValue(static_cast<aarch64::RegisterName>(i))) {
|
||||
font::PrintMonospaceU64(m_context->cpu_ctx.aarch64_ctx.x[i]);
|
||||
} else {
|
||||
font::PrintMonospaceBlank(16);
|
||||
}
|
||||
|
@ -312,8 +312,8 @@ namespace ams::fatal::srv {
|
|||
pc_x = font::GetX();
|
||||
font::PrintFormat("%s:", aarch64::CpuContext::RegisterNameStrings[i + (aarch64::RegisterName_GeneralPurposeCount / 2)]);
|
||||
font::SetPosition(pc_x + 47, font::GetY());
|
||||
if (this->context->cpu_ctx.aarch64_ctx.HasRegisterValue(static_cast<aarch64::RegisterName>(i + (aarch64::RegisterName_GeneralPurposeCount / 2)))) {
|
||||
font::PrintMonospaceU64(this->context->cpu_ctx.aarch64_ctx.x[i + (aarch64::RegisterName_GeneralPurposeCount / 2)]);
|
||||
if (m_context->cpu_ctx.aarch64_ctx.HasRegisterValue(static_cast<aarch64::RegisterName>(i + (aarch64::RegisterName_GeneralPurposeCount / 2)))) {
|
||||
font::PrintMonospaceU64(m_context->cpu_ctx.aarch64_ctx.x[i + (aarch64::RegisterName_GeneralPurposeCount / 2)]);
|
||||
} else {
|
||||
font::PrintMonospaceBlank(16);
|
||||
}
|
||||
|
@ -336,17 +336,17 @@ namespace ams::fatal::srv {
|
|||
font::SetPosition(x + 47, font::GetY());
|
||||
}
|
||||
if (is_aarch32) {
|
||||
font::PrintMonospaceU32(this->context->cpu_ctx.aarch32_ctx.pc);
|
||||
font::PrintMonospaceU32(m_context->cpu_ctx.aarch32_ctx.pc);
|
||||
} else {
|
||||
font::PrintMonospaceU64(this->context->cpu_ctx.aarch64_ctx.pc);
|
||||
font::PrintMonospaceU64(m_context->cpu_ctx.aarch64_ctx.pc);
|
||||
}
|
||||
|
||||
/* Print Backtrace. */
|
||||
u32 bt_size;
|
||||
if (is_aarch32) {
|
||||
bt_size = this->context->cpu_ctx.aarch32_ctx.stack_trace_size;
|
||||
bt_size = m_context->cpu_ctx.aarch32_ctx.stack_trace_size;
|
||||
} else {
|
||||
bt_size = this->context->cpu_ctx.aarch64_ctx.stack_trace_size;
|
||||
bt_size = m_context->cpu_ctx.aarch64_ctx.stack_trace_size;
|
||||
}
|
||||
|
||||
|
||||
|
@ -354,29 +354,29 @@ namespace ams::fatal::srv {
|
|||
if (bt_size == 0) {
|
||||
if (is_aarch32) {
|
||||
font::Print("Start Address: ");
|
||||
font::PrintMonospaceU32(this->context->cpu_ctx.aarch32_ctx.base_address);
|
||||
font::PrintMonospaceU32(m_context->cpu_ctx.aarch32_ctx.base_address);
|
||||
font::PrintLine("");
|
||||
} else {
|
||||
font::Print("Start Address: ");
|
||||
font::PrintMonospaceU64(this->context->cpu_ctx.aarch64_ctx.base_address);
|
||||
font::PrintMonospaceU64(m_context->cpu_ctx.aarch64_ctx.base_address);
|
||||
font::PrintLine("");
|
||||
}
|
||||
} else {
|
||||
if (is_aarch32) {
|
||||
font::Print("Backtrace - Start Address: ");
|
||||
font::PrintMonospaceU32(this->context->cpu_ctx.aarch32_ctx.base_address);
|
||||
font::PrintMonospaceU32(m_context->cpu_ctx.aarch32_ctx.base_address);
|
||||
font::PrintLine("");
|
||||
font::AddSpacingLines(0.5f);
|
||||
for (u32 i = 0; i < aarch32::CpuContext::MaxStackTraceDepth / 2; i++) {
|
||||
u32 bt_cur = 0, bt_next = 0;
|
||||
if (i < this->context->cpu_ctx.aarch32_ctx.stack_trace_size) {
|
||||
bt_cur = this->context->cpu_ctx.aarch32_ctx.stack_trace[i];
|
||||
if (i < m_context->cpu_ctx.aarch32_ctx.stack_trace_size) {
|
||||
bt_cur = m_context->cpu_ctx.aarch32_ctx.stack_trace[i];
|
||||
}
|
||||
if (i + aarch32::CpuContext::MaxStackTraceDepth / 2 < this->context->cpu_ctx.aarch32_ctx.stack_trace_size) {
|
||||
bt_next = this->context->cpu_ctx.aarch32_ctx.stack_trace[i + aarch32::CpuContext::MaxStackTraceDepth / 2];
|
||||
if (i + aarch32::CpuContext::MaxStackTraceDepth / 2 < m_context->cpu_ctx.aarch32_ctx.stack_trace_size) {
|
||||
bt_next = m_context->cpu_ctx.aarch32_ctx.stack_trace[i + aarch32::CpuContext::MaxStackTraceDepth / 2];
|
||||
}
|
||||
|
||||
if (i < this->context->cpu_ctx.aarch32_ctx.stack_trace_size) {
|
||||
if (i < m_context->cpu_ctx.aarch32_ctx.stack_trace_size) {
|
||||
u32 x = font::GetX();
|
||||
font::PrintFormat("BT[%02d]: ", i);
|
||||
font::SetPosition(x + 72, font::GetY());
|
||||
|
@ -385,7 +385,7 @@ namespace ams::fatal::srv {
|
|||
font::Print(" ");
|
||||
}
|
||||
|
||||
if (i + aarch32::CpuContext::MaxStackTraceDepth / 2 < this->context->cpu_ctx.aarch32_ctx.stack_trace_size) {
|
||||
if (i + aarch32::CpuContext::MaxStackTraceDepth / 2 < m_context->cpu_ctx.aarch32_ctx.stack_trace_size) {
|
||||
u32 x = font::GetX();
|
||||
font::PrintFormat("BT[%02d]: ", i + aarch32::CpuContext::MaxStackTraceDepth / 2);
|
||||
font::SetPosition(x + 72, font::GetY());
|
||||
|
@ -398,19 +398,19 @@ namespace ams::fatal::srv {
|
|||
}
|
||||
} else {
|
||||
font::Print("Backtrace - Start Address: ");
|
||||
font::PrintMonospaceU64(this->context->cpu_ctx.aarch64_ctx.base_address);
|
||||
font::PrintMonospaceU64(m_context->cpu_ctx.aarch64_ctx.base_address);
|
||||
font::PrintLine("");
|
||||
font::AddSpacingLines(0.5f);
|
||||
for (u32 i = 0; i < aarch64::CpuContext::MaxStackTraceDepth / 2; i++) {
|
||||
u64 bt_cur = 0, bt_next = 0;
|
||||
if (i < this->context->cpu_ctx.aarch64_ctx.stack_trace_size) {
|
||||
bt_cur = this->context->cpu_ctx.aarch64_ctx.stack_trace[i];
|
||||
if (i < m_context->cpu_ctx.aarch64_ctx.stack_trace_size) {
|
||||
bt_cur = m_context->cpu_ctx.aarch64_ctx.stack_trace[i];
|
||||
}
|
||||
if (i + aarch64::CpuContext::MaxStackTraceDepth / 2 < this->context->cpu_ctx.aarch64_ctx.stack_trace_size) {
|
||||
bt_next = this->context->cpu_ctx.aarch64_ctx.stack_trace[i + aarch64::CpuContext::MaxStackTraceDepth / 2];
|
||||
if (i + aarch64::CpuContext::MaxStackTraceDepth / 2 < m_context->cpu_ctx.aarch64_ctx.stack_trace_size) {
|
||||
bt_next = m_context->cpu_ctx.aarch64_ctx.stack_trace[i + aarch64::CpuContext::MaxStackTraceDepth / 2];
|
||||
}
|
||||
|
||||
if (i < this->context->cpu_ctx.aarch64_ctx.stack_trace_size) {
|
||||
if (i < m_context->cpu_ctx.aarch64_ctx.stack_trace_size) {
|
||||
u32 x = font::GetX();
|
||||
font::PrintFormat("BT[%02d]: ", i);
|
||||
font::SetPosition(x + 72, font::GetY());
|
||||
|
@ -418,7 +418,7 @@ namespace ams::fatal::srv {
|
|||
font::Print(" ");
|
||||
}
|
||||
|
||||
if (i + aarch64::CpuContext::MaxStackTraceDepth / 2 < this->context->cpu_ctx.aarch64_ctx.stack_trace_size) {
|
||||
if (i + aarch64::CpuContext::MaxStackTraceDepth / 2 < m_context->cpu_ctx.aarch64_ctx.stack_trace_size) {
|
||||
u32 x = font::GetX();
|
||||
font::PrintFormat("BT[%02d]: ", i + aarch64::CpuContext::MaxStackTraceDepth / 2);
|
||||
font::SetPosition(x + 72, font::GetY());
|
||||
|
@ -439,7 +439,7 @@ namespace ams::fatal::srv {
|
|||
R_TRY(nvFenceInit());
|
||||
|
||||
/* Create nvmap. */
|
||||
R_TRY(nvMapCreate(std::addressof(this->map), g_framebuffer_memory, sizeof(g_framebuffer_memory), 0x20000, NvKind_Pitch, true));
|
||||
R_TRY(nvMapCreate(std::addressof(m_map), g_framebuffer_memory, sizeof(g_framebuffer_memory), 0x20000, NvKind_Pitch, true));
|
||||
|
||||
/* Setup graphics buffer. */
|
||||
{
|
||||
|
@ -458,14 +458,14 @@ namespace ams::fatal::srv {
|
|||
grbuf.planes[0].layout = NvLayout_BlockLinear;
|
||||
grbuf.planes[0].kind = NvKind_Generic_16BX2;
|
||||
grbuf.planes[0].block_height_log2 = 4;
|
||||
grbuf.nvmap_id = nvMapGetId(std::addressof(this->map));
|
||||
grbuf.nvmap_id = nvMapGetId(std::addressof(m_map));
|
||||
grbuf.stride = FatalScreenWidthAligned;
|
||||
grbuf.total_size = sizeof(g_framebuffer_memory);
|
||||
grbuf.planes[0].pitch = FatalScreenWidthAlignedBytes;
|
||||
grbuf.planes[0].size = sizeof(g_framebuffer_memory);
|
||||
grbuf.planes[0].offset = 0;
|
||||
|
||||
R_TRY(nwindowConfigureBuffer(std::addressof(this->win), 0, std::addressof(grbuf)));
|
||||
R_TRY(nwindowConfigureBuffer(std::addressof(m_win), 0, std::addressof(grbuf)));
|
||||
}
|
||||
|
||||
return ResultSuccess();
|
||||
|
@ -473,9 +473,9 @@ namespace ams::fatal::srv {
|
|||
|
||||
void ShowFatalTask::DisplayPreRenderedFrame() {
|
||||
s32 slot;
|
||||
R_ABORT_UNLESS(nwindowDequeueBuffer(std::addressof(this->win), std::addressof(slot), nullptr));
|
||||
R_ABORT_UNLESS(nwindowDequeueBuffer(std::addressof(m_win), std::addressof(slot), nullptr));
|
||||
dd::FlushDataCache(g_framebuffer_memory, sizeof(g_framebuffer_memory));
|
||||
R_ABORT_UNLESS(nwindowQueueBuffer(std::addressof(this->win), this->win.cur_slot, NULL));
|
||||
R_ABORT_UNLESS(nwindowQueueBuffer(std::addressof(m_win), m_win.cur_slot, NULL));
|
||||
}
|
||||
|
||||
Result ShowFatalTask::ShowFatal() {
|
||||
|
@ -493,7 +493,7 @@ namespace ams::fatal::srv {
|
|||
|
||||
Result ShowFatalTask::Run() {
|
||||
/* Don't show the fatal error screen until we've verified the battery is okay. */
|
||||
this->context->battery_event->Wait();
|
||||
m_context->battery_event->Wait();
|
||||
|
||||
return ShowFatal();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue