mirror of
				https://github.com/PabloMK7/citra.git
				synced 2025-10-31 13:50:03 +00:00 
			
		
		
		
	core: Consolidate core and system state, remove system module & cleanups.
This commit is contained in:
		
							parent
							
								
									707cc66362
								
							
						
					
					
						commit
						232ef55c1a
					
				
					 22 changed files with 278 additions and 330 deletions
				
			
		|  | @ -14,8 +14,6 @@ | |||
| #include "common/scm_rev.h" | ||||
| #include "common/string_util.h" | ||||
| #include "core/core.h" | ||||
| #include "core/settings.h" | ||||
| #include "core/system.h" | ||||
| #include "video_core/debug_utils/debug_utils.h" | ||||
| #include "video_core/video_core.h" | ||||
| 
 | ||||
|  | @ -38,7 +36,7 @@ void EmuThread::run() { | |||
|             if (!was_active) | ||||
|                 emit DebugModeLeft(); | ||||
| 
 | ||||
|             Core::RunLoop(); | ||||
|             Core::System::GetInstance().RunLoop(); | ||||
| 
 | ||||
|             was_active = running || exec_step; | ||||
|             if (!was_active && !stop_run) | ||||
|  | @ -48,7 +46,7 @@ void EmuThread::run() { | |||
|                 emit DebugModeLeft(); | ||||
| 
 | ||||
|             exec_step = false; | ||||
|             Core::SingleStep(); | ||||
|             Core::System::GetInstance().SingleStep(); | ||||
|             emit DebugModeEntered(); | ||||
|             yieldCurrentThread(); | ||||
| 
 | ||||
|  |  | |||
|  | @ -4,8 +4,8 @@ | |||
| 
 | ||||
| #include "citra_qt/configure_general.h" | ||||
| #include "citra_qt/ui_settings.h" | ||||
| #include "core/core.h" | ||||
| #include "core/settings.h" | ||||
| #include "core/system.h" | ||||
| #include "ui_configure_general.h" | ||||
| 
 | ||||
| ConfigureGeneral::ConfigureGeneral(QWidget* parent) | ||||
|  |  | |||
|  | @ -3,8 +3,8 @@ | |||
| // Refer to the license.txt file included.
 | ||||
| 
 | ||||
| #include "citra_qt/configure_graphics.h" | ||||
| #include "core/core.h" | ||||
| #include "core/settings.h" | ||||
| #include "core/system.h" | ||||
| #include "ui_configure_graphics.h" | ||||
| 
 | ||||
| ConfigureGraphics::ConfigureGraphics(QWidget* parent) | ||||
|  |  | |||
|  | @ -6,7 +6,6 @@ | |||
| #include "citra_qt/ui_settings.h" | ||||
| #include "core/hle/service/cfg/cfg.h" | ||||
| #include "core/hle/service/fs/archive.h" | ||||
| #include "core/system.h" | ||||
| #include "ui_configure_system.h" | ||||
| 
 | ||||
| static const std::array<int, 12> days_in_month = {{ | ||||
|  |  | |||
|  | @ -25,7 +25,7 @@ CallstackWidget::CallstackWidget(QWidget* parent) : QDockWidget(parent) { | |||
| 
 | ||||
| void CallstackWidget::OnDebugModeEntered() { | ||||
|     // Stack pointer
 | ||||
|     const u32 sp = Core::g_app_core->GetReg(13); | ||||
|     const u32 sp = Core::AppCore().GetReg(13); | ||||
| 
 | ||||
|     Clear(); | ||||
| 
 | ||||
|  |  | |||
|  | @ -185,13 +185,13 @@ DisassemblerWidget::DisassemblerWidget(QWidget* parent, EmuThread* emu_thread) | |||
| } | ||||
| 
 | ||||
| void DisassemblerWidget::Init() { | ||||
|     model->ParseFromAddress(Core::g_app_core->GetPC()); | ||||
|     model->ParseFromAddress(Core::AppCore().GetPC()); | ||||
| 
 | ||||
|     disasm_ui.treeView->resizeColumnToContents(0); | ||||
|     disasm_ui.treeView->resizeColumnToContents(1); | ||||
|     disasm_ui.treeView->resizeColumnToContents(2); | ||||
| 
 | ||||
|     QModelIndex model_index = model->IndexFromAbsoluteAddress(Core::g_app_core->GetPC()); | ||||
|     QModelIndex model_index = model->IndexFromAbsoluteAddress(Core::AppCore().GetPC()); | ||||
|     disasm_ui.treeView->scrollTo(model_index); | ||||
|     disasm_ui.treeView->selectionModel()->setCurrentIndex( | ||||
|         model_index, QItemSelectionModel::SelectCurrent | QItemSelectionModel::Rows); | ||||
|  | @ -214,8 +214,8 @@ void DisassemblerWidget::OnPause() { | |||
|     emu_thread->SetRunning(false); | ||||
| 
 | ||||
|     // TODO: By now, the CPU might not have actually stopped...
 | ||||
|     if (Core::g_app_core) { | ||||
|         model->SetNextInstruction(Core::g_app_core->GetPC()); | ||||
|     if (Core::System::GetInstance().IsPoweredOn()) { | ||||
|         model->SetNextInstruction(Core::AppCore().GetPC()); | ||||
|     } | ||||
| } | ||||
| 
 | ||||
|  | @ -224,7 +224,7 @@ void DisassemblerWidget::OnToggleStartStop() { | |||
| } | ||||
| 
 | ||||
| void DisassemblerWidget::OnDebugModeEntered() { | ||||
|     u32 next_instr = Core::g_app_core->GetPC(); | ||||
|     u32 next_instr = Core::AppCore().GetPC(); | ||||
| 
 | ||||
|     if (model->GetBreakPoints().IsAddressBreakPoint(next_instr)) | ||||
|         emu_thread->SetRunning(false); | ||||
|  |  | |||
|  | @ -58,16 +58,16 @@ RegistersWidget::RegistersWidget(QWidget* parent) : QDockWidget(parent) { | |||
| } | ||||
| 
 | ||||
| void RegistersWidget::OnDebugModeEntered() { | ||||
|     if (!Core::g_app_core) | ||||
|     if (!Core::System::GetInstance().IsPoweredOn()) | ||||
|         return; | ||||
| 
 | ||||
|     for (int i = 0; i < core_registers->childCount(); ++i) | ||||
|         core_registers->child(i)->setText( | ||||
|             1, QString("0x%1").arg(Core::g_app_core->GetReg(i), 8, 16, QLatin1Char('0'))); | ||||
|             1, QString("0x%1").arg(Core::AppCore().GetReg(i), 8, 16, QLatin1Char('0'))); | ||||
| 
 | ||||
|     for (int i = 0; i < vfp_registers->childCount(); ++i) | ||||
|         vfp_registers->child(i)->setText( | ||||
|             1, QString("0x%1").arg(Core::g_app_core->GetVFPReg(i), 8, 16, QLatin1Char('0'))); | ||||
|             1, QString("0x%1").arg(Core::AppCore().GetVFPReg(i), 8, 16, QLatin1Char('0'))); | ||||
| 
 | ||||
|     UpdateCPSRValues(); | ||||
|     UpdateVFPSystemRegisterValues(); | ||||
|  | @ -127,7 +127,7 @@ void RegistersWidget::CreateCPSRChildren() { | |||
| } | ||||
| 
 | ||||
| void RegistersWidget::UpdateCPSRValues() { | ||||
|     const u32 cpsr_val = Core::g_app_core->GetCPSR(); | ||||
|     const u32 cpsr_val = Core::AppCore().GetCPSR(); | ||||
| 
 | ||||
|     cpsr->setText(1, QString("0x%1").arg(cpsr_val, 8, 16, QLatin1Char('0'))); | ||||
|     cpsr->child(0)->setText( | ||||
|  | @ -191,10 +191,10 @@ void RegistersWidget::CreateVFPSystemRegisterChildren() { | |||
| } | ||||
| 
 | ||||
| void RegistersWidget::UpdateVFPSystemRegisterValues() { | ||||
|     const u32 fpscr_val = Core::g_app_core->GetVFPSystemReg(VFP_FPSCR); | ||||
|     const u32 fpexc_val = Core::g_app_core->GetVFPSystemReg(VFP_FPEXC); | ||||
|     const u32 fpinst_val = Core::g_app_core->GetVFPSystemReg(VFP_FPINST); | ||||
|     const u32 fpinst2_val = Core::g_app_core->GetVFPSystemReg(VFP_FPINST2); | ||||
|     const u32 fpscr_val = Core::AppCore().GetVFPSystemReg(VFP_FPSCR); | ||||
|     const u32 fpexc_val = Core::AppCore().GetVFPSystemReg(VFP_FPEXC); | ||||
|     const u32 fpinst_val = Core::AppCore().GetVFPSystemReg(VFP_FPINST); | ||||
|     const u32 fpinst2_val = Core::AppCore().GetVFPSystemReg(VFP_FPINST2); | ||||
| 
 | ||||
|     QTreeWidgetItem* const fpscr = vfp_system_registers->child(0); | ||||
|     fpscr->setText(1, QString("0x%1").arg(fpscr_val, 8, 16, QLatin1Char('0'))); | ||||
|  |  | |||
|  | @ -391,7 +391,7 @@ WaitTreeWidget::WaitTreeWidget(QWidget* parent) : QDockWidget(tr("Wait Tree"), p | |||
| } | ||||
| 
 | ||||
| void WaitTreeWidget::OnDebugModeEntered() { | ||||
|     if (!Core::g_app_core) | ||||
|     if (!Core::System::GetInstance().IsPoweredOn()) | ||||
|         return; | ||||
|     model->InitItems(); | ||||
|     view->setModel(model); | ||||
|  |  | |||
|  | @ -46,7 +46,6 @@ | |||
| #include "core/gdbstub/gdbstub.h" | ||||
| #include "core/loader/loader.h" | ||||
| #include "core/settings.h" | ||||
| #include "core/system.h" | ||||
| #include "qhexedit.h" | ||||
| #include "video_core/video_core.h" | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue