mirror of
https://github.com/LNH-team/pico-launcher.git
synced 2026-06-02 09:06:54 +02:00
Add new shared pointer and make use of it
This commit is contained in:
15
arm9/source/core/SharedPtrAsm.s
Normal file
15
arm9/source/core/SharedPtrAsm.s
Normal file
@@ -0,0 +1,15 @@
|
||||
.section .itcm
|
||||
.arm
|
||||
|
||||
// r0 = &refCount
|
||||
.global shared_ptr_increase_ref_count
|
||||
.type shared_ptr_increase_ref_count, %function
|
||||
shared_ptr_increase_ref_count:
|
||||
mrs r2, cpsr
|
||||
orr r1, r2, #0x80
|
||||
msr cpsr_c, r1
|
||||
ldr r12, [r0]
|
||||
add r12, r12, #1
|
||||
str r12, [r0]
|
||||
msr cpsr_c, r2
|
||||
bx lr
|
||||
Reference in New Issue
Block a user