After reading the WiiBrew article listed below, I wrote this up in ASM really quick. Most likely you will just freeze. Either due to C0 codetype not being able to do IOS function calls or I jacked up the Vector Pointers...
Disconnect Wii Remote Bluetooth [WiiBrew]
Wiibrew C code - https://wiibrew.org/wiki//dev/usb/oh1
This code is to constantly d/c the bluetooth on the Wiimote. So basically it disables the wii remote for your game.
This code is wii-game-universal, as long as you have the game's function addresses for the 3 IOS functions listed in the XYZ values.
X values = Function Address for IOS_Open
Y values = Function Address for IOS_Ioctvl
Z values = Function Address for IOS_Close
Region-Free
00000FA0 00000020
00000FC0 00000000
02000FE0 00000000
02001000 00000000
02001020 00000300
00001040 00000000
04001060 030C0000
060009B0 00000048
XXXXXXXX YYYYYYYY
ZZZZZZZZ 00000000
80000FA0 00000001
80000FC0 00000001
80000FE0 00000002
80001000 00000002
80001020 00000002
80001040 00000001
80001060 00000003
C0000000 00000012
7D8802A6 9421FF80
BC610008 3FE08000
4800001D 2F646576
2F757362 2F6F6831
2F353765 2F333035
00000000 7C6802A6
38800002 819F09B0
7D8803A6 4E800021
2C030000 41800038
7C7E1B78 38800000
38A00006 38C00001
3CE08000 60E709C0
819F09B4 7D8803A6
4E800021 7FC3F378
819F09B8 7D8803A6
4E800021 B8610008
38210080 7D8803A6
4E800020 00000000
#MKW PAL IOS FUNCTIONS!
IOS_Open, 0x801938F8
IOS_Ioctlv, 0x801945E0
IOS_Close, 0x80193AD8
---
#C0
.macro push_stack
mflr r12
stwu sp, -0x80 (sp)
stmw r3, 0x8 (sp)
.endm
.macro pop_stack
lmw r3, 0x8 (sp)
addi sp, sp, 0x80
mtlr r12
.endm
push_stack
lis r31, 0x8000 #For loading shit
bl the_string
.string "/dev/usb/oh1/57e/305"
.align 2
the_string:
mflr r3
li r4, 2
#IOS Open
lwz r12, 0x09B0 (r31)
mtlr r12
blrl
cmpwi r3, 0
blt- _error
mr r30, r3
li r4, 0
li r5, 6
li 6, 1
lis r7, 0x8000
ori r7, r7, 0x09C0
#IOS_Ioctvl
lwz r12, 0x09B4 (r31)
mtlr r12
blrl
#No return value check? Ok.
mr r3, r30
#IOS_Close
lwz r12, 0x09B8 (r31)
mtlr r12
blrl
_error:
pop_stack
Disconnect Wii Remote Bluetooth [WiiBrew]
Wiibrew C code - https://wiibrew.org/wiki//dev/usb/oh1
This code is to constantly d/c the bluetooth on the Wiimote. So basically it disables the wii remote for your game.
This code is wii-game-universal, as long as you have the game's function addresses for the 3 IOS functions listed in the XYZ values.
X values = Function Address for IOS_Open
Y values = Function Address for IOS_Ioctvl
Z values = Function Address for IOS_Close
Region-Free
00000FA0 00000020
00000FC0 00000000
02000FE0 00000000
02001000 00000000
02001020 00000300
00001040 00000000
04001060 030C0000
060009B0 00000048
XXXXXXXX YYYYYYYY
ZZZZZZZZ 00000000
80000FA0 00000001
80000FC0 00000001
80000FE0 00000002
80001000 00000002
80001020 00000002
80001040 00000001
80001060 00000003
C0000000 00000012
7D8802A6 9421FF80
BC610008 3FE08000
4800001D 2F646576
2F757362 2F6F6831
2F353765 2F333035
00000000 7C6802A6
38800002 819F09B0
7D8803A6 4E800021
2C030000 41800038
7C7E1B78 38800000
38A00006 38C00001
3CE08000 60E709C0
819F09B4 7D8803A6
4E800021 7FC3F378
819F09B8 7D8803A6
4E800021 B8610008
38210080 7D8803A6
4E800020 00000000
#MKW PAL IOS FUNCTIONS!
IOS_Open, 0x801938F8
IOS_Ioctlv, 0x801945E0
IOS_Close, 0x80193AD8
---
#C0
.macro push_stack
mflr r12
stwu sp, -0x80 (sp)
stmw r3, 0x8 (sp)
.endm
.macro pop_stack
lmw r3, 0x8 (sp)
addi sp, sp, 0x80
mtlr r12
.endm
push_stack
lis r31, 0x8000 #For loading shit
bl the_string
.string "/dev/usb/oh1/57e/305"
.align 2
the_string:
mflr r3
li r4, 2
#IOS Open
lwz r12, 0x09B0 (r31)
mtlr r12
blrl
cmpwi r3, 0
blt- _error
mr r30, r3
li r4, 0
li r5, 6
li 6, 1
lis r7, 0x8000
ori r7, r7, 0x09C0
#IOS_Ioctvl
lwz r12, 0x09B4 (r31)
mtlr r12
blrl
#No return value check? Ok.
mr r3, r30
#IOS_Close
lwz r12, 0x09B8 (r31)
mtlr r12
blrl
_error:
pop_stack