diff --git a/app/src/main/CMakeLists.txt b/app/src/main/CMakeLists.txt index 62657cb..6f994e6 100644 --- a/app/src/main/CMakeLists.txt +++ b/app/src/main/CMakeLists.txt @@ -53,7 +53,7 @@ target_sources(cosmic PRIVATE ${COSMIC_DIR}/gs/synth_tables.cpp ${COSMIC_DIR}/gs/synth_engine.cpp ${COSMIC_DIR}/gs/gif_bridge.cpp - ${COSMIC_DIR}/gs/transfer_queue.s + ${COSMIC_DIR}/gs/transfer_queue.S ${COSMIC_DIR}/vu/vecu.cpp ${COSMIC_DIR}/vu/vu_time.cpp ${COSMIC_DIR}/vu/vif10_upload.cpp diff --git a/app/src/main/cpp/cosmic/gs/transfer_queue.s b/app/src/main/cpp/cosmic/gs/transfer_queue.S similarity index 73% rename from app/src/main/cpp/cosmic/gs/transfer_queue.s rename to app/src/main/cpp/cosmic/gs/transfer_queue.S index 8a2dd8f..b3c26eb 100644 --- a/app/src/main/cpp/cosmic/gs/transfer_queue.s +++ b/app/src/main/cpp/cosmic/gs/transfer_queue.S @@ -12,16 +12,18 @@ declFunc gifQueueSize // Macro adr_l and unconditional jumps are being used as a priority, due to the enabled LTO gifQueueReset: prologue - eor v0.16b, v0.16b, v0.16b + eor v0.16b, v0.16b, v0.16b // v0 = 0.0, 0.0 ... mov x9, 0 + mov w12, 0 adr_l x10, gQueue cleanUp: + mov w9, w12 lsl x9, x9, #4 - add x10, x10, x9 - st1 {v0.16b}, [x10] // ((u128*)qQueue[w0]) = v0 + add x11, x10, x9 + st1 {v0.16b}, [x11] // ((u128*)qQueue[w0]) = v0 - add w9, w9, #1 - sub w11, w9, #16 + add w12, w12, #1 + sub w11, w12, #16 cbz w11, #8 b cleanUp mov x9, 1 @@ -34,17 +36,19 @@ gifQueueSize: prologue // We can pre-load the array values into the L2 cache since we'll be accessing it shortly mov x10, 0 + mov w11, 0 adr_l x9, gQueue loadIntoL2: // ((u8*)gQueue)[w1 * 64] + mov x10, x11 lsl x10, x10, #6 - add x9, x9, x10 + add x12, x9, x10 - prfm pldl2keep, [x9] + prfm pldl2keep, [x12] - add w10, w10, #4 - sub w11, w10, #16 - cbz w11, #0x8 + add w11, w11, #1 + sub w10, w11, #4 + cbz w10, #0x8 b loadIntoL2 ldr_l x0, qSize diff --git a/app/src/main/cpp/cosmic/vm/emu_vm.h b/app/src/main/cpp/cosmic/vm/emu_vm.h index 6124ec5..65e328e 100644 --- a/app/src/main/cpp/cosmic/vm/emu_vm.h +++ b/app/src/main/cpp/cosmic/vm/emu_vm.h @@ -25,7 +25,7 @@ namespace cosmic::vm { std::shared_ptr mips; std::shared_ptr iop; std::shared_ptr mpegDecoder; - std::shared_ptr gsGif; + std::shared_ptr gsGif; std::shared_ptr screenEngine; u8 frames;