Loader improvements (#1378)

* tfrag3 data for merc2

* dma hooks for merc2

* start designing merc2 opengl, seems like the simple approach will be the best here

* before bone packing experiment

* fix up bones.gc

* use uniform buffer

* speedup, fix faces and eyes

* final fixes

* first pass at loader updates, tie is still bad

* temp

* improved loader

* run iop less often
This commit is contained in:
water111
2022-05-28 20:12:33 -04:00
committed by GitHub
parent e56b2e8d56
commit 2e31d82fb2
21 changed files with 1085 additions and 926 deletions
+9 -65
View File
@@ -68,76 +68,20 @@ void IOP::wait_run_iop() {
void IOP::kill_from_ee() {
want_exit = true;
signal_run_iop();
signal_run_iop(true);
}
void IOP::signal_run_iop() {
void IOP::signal_run_iop(bool force) {
std::unique_lock<std::mutex> lk(iters_mutex);
iop_iters_des++; // todo, tune this
if (iop_iters_des - iop_iters_act > 500) {
iop_iters_des = iop_iters_act + 500;
if (iop_iters_act == iop_iters_des || force) {
iop_iters_des++; // todo, tune this
if (iop_iters_des - iop_iters_act > 500) {
iop_iters_des = iop_iters_act + 500;
}
iop_run_cv.notify_all();
}
iop_run_cv.notify_all();
}
IOP::~IOP() {
reset_allocator();
}
// void launch_iop(SystemThreadInterface& interface) {
// IOP iop;
//
// printf("\n\n\n[IOP] Restart!\n");
// iop.reset_allocator();
//
//// dma_init_globals();
//// iso_init_globals();
//// fake_iso_init_globals();
//// // iso_api
//// iso_cd_init_globals();
//// iso_queue_init_globals();
//// // isocommon
//// // overlord
//// ramdisk_init_globals();
//// // sbank
//// // soundcommon
//// srpc_init_globals();
// // ssound
// // stream
//
//// SCE_IOP::PS2_RegisterIOP(&iop);
//// PS2_RegisterIOP_EE(&iop);
// interface.initialization_complete();
//
// printf("[IOP] Wait for OVERLORD to be started...\n");
// iop.wait_for_overlord_start_cmd();
// if(iop.status == IOP_OVERLORD_INIT) {
// printf("[IOP] Run!\n");
// } else {
// printf("[IOP] shutdown!\n");
// return;
// }
//
// iop.reset_allocator();
//
// // init
//#ifdef ENABLE_OVERLORD
// start(iop.overlord_argc, iop.overlord_argv);
//#endif
//
// // unblock the EE, the overlord is set up!
// iop.signal_overlord_init_finish();
//
// // IOP Kernel loop
// while(!interface.get_want_exit() && !iop.want_exit) {
// // the IOP kernel just runs at full blast, so we only run the IOP when the EE is waiting on
// the IOP.
// // Each time the EE is waiting on the IOP, it will run an iteration of the IOP kernel.
// iop.wait_run_iop();
// iop.kernel.dispatchAll();
// }
//
// // stop all threads in the iop kernel.
// // if the threads are not stopped nicely, we will deadlock on trying to destroy the kernel's
// condition variables. iop.kernel.shutdown();
//}
}