.include "macros.inc"
.section .text, "ax"
.global TRKMessageIntoReply
TRKMessageIntoReply:
mflr r0
stw r0, 4(r1)
stwu r1, -0x18(r1)
stw r31, 0x14(r1)
addi r31, r5, 0
stw r30, 0x10(r1)
addi r30, r4, 0
li r4, 1
stw r29, 0xc(r1)
addi r29, r3, 0
bl TRKResetBuffer
lwz r3, 0xc(r29)
cmplwi r3, 0x880
bge lbl_80088B80
addi r0, r3, 1
add r3, r29, r3
stw r0, 0xc(r29)
stb r30, 0x10(r3)
lwz r3, 8(r29)
addi r0, r3, 1
stw r0, 8(r29)
lbl_80088B80:
lwz r3, 0xc(r29)
cmplwi r3, 0x880
bge lbl_80088BA8
addi r0, r3, 1
add r3, r29, r3
stw r0, 0xc(r29)
stb r31, 0x10(r3)
lwz r3, 8(r29)
addi r0, r3, 1
stw r0, 8(r29)
lbl_80088BA8:
lwz r31, 0x14(r1)
lwz r30, 0x10(r1)
lwz r29, 0xc(r1)
addi r1, r1, 0x18
lwz r0, 4(r1)
mtlr r0
blr
.global TRKSendACK
TRKSendACK:
mflr r0
stw r0, 4(r1)
stwu r1, -0x10(r1)
stw r31, 0xc(r1)
li r31, 3
stw r30, 8(r1)
addi r30, r3, 0
lbl_80088BE0:
mr r3, r30
bl TRKMessageSend
cmpwi r3, 0
addi r31, r31, -1
beq lbl_80088BFC
cmpwi r31, 0
bgt lbl_80088BE0
lbl_80088BFC:
lwz r31, 0xc(r1)
lwz r30, 8(r1)
addi r1, r1, 0x10
lwz r0, 4(r1)
mtlr r0
blr
.global TRKStandardACK
TRKStandardACK:
mflr r0
stw r0, 4(r1)
stwu r1, -0x10(r1)
stw r31, 0xc(r1)
mr r31, r3
bl TRKMessageIntoReply
mr r3, r31
bl TRKSendACK
lwz r31, 0xc(r1)
addi r1, r1, 0x10
lwz r0, 4(r1)
mtlr r0
blr
.global TRKDoUnsupported
TRKDoUnsupported:
mflr r0
li r4, 0x80
stw r0, 4(r1)
li r5, 0x10
stwu r1, -8(r1)
bl TRKStandardACK
addi r1, r1, 8
lwz r0, 4(r1)
mtlr r0
blr
.global TRKDoConnect
TRKDoConnect:
mflr r0
li r4, 0x80
stw r0, 4(r1)
li r5, 0
stwu r1, -8(r1)
bl TRKStandardACK
addi r1, r1, 8
lwz r0, 4(r1)
mtlr r0
blr
.global TRKDoDisconnect
TRKDoDisconnect:
mflr r0
li r4, 0x80
stw r0, 4(r1)
li r5, 0
stwu r1, -0x18(r1)
stw r31, 0x14(r1)
bl TRKStandardACK
or. r31, r3, r3
bne lbl_80088CD0
addi r3, r1, 8
li r4, 1
bl TRKConstructEvent
addi r3, r1, 8
bl TRKPostEvent
lbl_80088CD0:
mr r3, r31
lwz r31, 0x14(r1)
addi r1, r1, 0x18
lwz r0, 4(r1)
mtlr r0
blr
.global TRKDoReset
TRKDoReset:
mflr r0
li r4, 0x80
stw r0, 4(r1)
li r5, 0
stwu r1, -8(r1)
bl TRKStandardACK
bl __TRK_reset
li r3, 0
addi r1, r1, 8
lwz r0, 4(r1)
mtlr r0
blr
.global TRKDoVersions
TRKDoVersions:
mflr r0
stw r0, 4(r1)
stwu r1, -0x10(r1)
stw r31, 0xc(r1)
mr r31, r3
lwz r0, 8(r3)
cmplwi r0, 1
beq lbl_80088D4C
addi r3, r31, 0
li r4, 0x80
li r5, 2
bl TRKStandardACK
b lbl_80088E88
lbl_80088D4C:
addi r3, r31, 0
li r4, 0x80
li r5, 0
bl TRKMessageIntoReply
addi r3, r1, 8
bl TRKTargetVersions
cmpwi r3, 0
bne lbl_80088DA4
lwz r3, 0xc(r31)
lbz r5, 8(r1)
cmplwi r3, 0x880
blt lbl_80088D84
li r3, 0x301
b lbl_80088DA4
lbl_80088D84:
addi r0, r3, 1
add r4, r31, r3
stw r0, 0xc(r31)
li r3, 0
stb r5, 0x10(r4)
lwz r4, 8(r31)
addi r0, r4, 1
stw r0, 8(r31)
lbl_80088DA4:
cmpwi r3, 0
bne lbl_80088DE4
lwz r3, 0xc(r31)
lbz r5, 9(r1)
cmplwi r3, 0x880
blt lbl_80088DC4
li r3, 0x301
b lbl_80088DE4
lbl_80088DC4:
addi r0, r3, 1
add r4, r31, r3
stw r0, 0xc(r31)
li r3, 0
stb r5, 0x10(r4)
lwz r4, 8(r31)
addi r0, r4, 1
stw r0, 8(r31)
lbl_80088DE4:
cmpwi r3, 0
bne lbl_80088E24
lwz r3, 0xc(r31)
lbz r5, 0xa(r1)
cmplwi r3, 0x880
blt lbl_80088E04
li r3, 0x301
b lbl_80088E24
lbl_80088E04:
addi r0, r3, 1
add r4, r31, r3
stw r0, 0xc(r31)
li r3, 0
stb r5, 0x10(r4)
lwz r4, 8(r31)
addi r0, r4, 1
stw r0, 8(r31)
lbl_80088E24:
cmpwi r3, 0
bne lbl_80088E64
lwz r3, 0xc(r31)
lbz r5, 0xb(r1)
cmplwi r3, 0x880
blt lbl_80088E44
li r3, 0x301
b lbl_80088E64
lbl_80088E44:
addi r0, r3, 1
add r4, r31, r3
stw r0, 0xc(r31)
li r3, 0
stb r5, 0x10(r4)
lwz r4, 8(r31)
addi r0, r4, 1
stw r0, 8(r31)
lbl_80088E64:
cmpwi r3, 0
beq lbl_80088E80
addi r3, r31, 0
li r4, 0x80
li r5, 3
bl TRKStandardACK
b lbl_80088E88
lbl_80088E80:
mr r3, r31
bl TRKSendACK
lbl_80088E88:
lwz r31, 0xc(r1)
addi r1, r1, 0x10
lwz r0, 4(r1)
mtlr r0
blr
.global TRKDoSupportMask
TRKDoSupportMask:
mflr r0
stw r0, 4(r1)
stwu r1, -0x30(r1)
stw r31, 0x2c(r1)
mr r31, r3
lwz r0, 8(r3)
cmplwi r0, 1
beq lbl_80088ED0
addi r3, r31, 0
li r4, 0x80
li r5, 2
bl TRKStandardACK
b lbl_80088F64
lbl_80088ED0:
addi r3, r31, 0
li r4, 0x80
li r5, 0
bl TRKMessageIntoReply
addi r3, r1, 8
bl TRKTargetSupportMask
cmpwi r3, 0
bne lbl_80088F00
addi r3, r31, 0
addi r4, r1, 8
li r5, 0x20
bl TRKAppendBuffer
lbl_80088F00:
cmpwi r3, 0
bne lbl_80088F40
lwz r3, 0xc(r31)
cmplwi r3, 0x880
blt lbl_80088F1C
li r3, 0x301
b lbl_80088F40
lbl_80088F1C:
addi r0, r3, 1
add r4, r31, r3
stw r0, 0xc(r31)
li r0, 2
li r3, 0
stb r0, 0x10(r4)
lwz r4, 8(r31)
addi r0, r4, 1
stw r0, 8(r31)
lbl_80088F40:
cmpwi r3, 0
beq lbl_80088F5C
addi r3, r31, 0
li r4, 0x80
li r5, 3
bl TRKStandardACK
b lbl_80088F64
lbl_80088F5C:
mr r3, r31
bl TRKSendACK
lbl_80088F64:
lwz r31, 0x2c(r1)
addi r1, r1, 0x30
lwz r0, 4(r1)
mtlr r0
blr
.global TRKDoCPUType
TRKDoCPUType:
mflr r0
stw r0, 4(r1)
stwu r1, -0x18(r1)
stw r31, 0x14(r1)
mr r31, r3
lwz r0, 8(r3)
cmplwi r0, 1
beq lbl_80088FAC
addi r3, r31, 0
li r4, 0x80
li r5, 2
bl TRKStandardACK
b lbl_800891A8
lbl_80088FAC:
addi r3, r31, 0
li r4, 0x80
li r5, 0
bl TRKMessageIntoReply
addi r3, r1, 8
bl TRKTargetCPUType
cmpwi r3, 0
bne lbl_80089004
lwz r3, 0xc(r31)
lbz r5, 8(r1)
cmplwi r3, 0x880
blt lbl_80088FE4
li r3, 0x301
b lbl_80089004
lbl_80088FE4:
addi r0, r3, 1
add r4, r31, r3
stw r0, 0xc(r31)
li r3, 0
stb r5, 0x10(r4)
lwz r4, 8(r31)
addi r0, r4, 1
stw r0, 8(r31)
lbl_80089004:
cmpwi r3, 0
bne lbl_80089044
lwz r3, 0xc(r31)
lbz r5, 9(r1)
cmplwi r3, 0x880
blt lbl_80089024
li r3, 0x301
b lbl_80089044
lbl_80089024:
addi r0, r3, 1
add r4, r31, r3
stw r0, 0xc(r31)
li r3, 0
stb r5, 0x10(r4)
lwz r4, 8(r31)
addi r0, r4, 1
stw r0, 8(r31)
lbl_80089044:
cmpwi r3, 0
bne lbl_80089084
lwz r3, 0xc(r31)
lbz r5, 0xa(r1)
cmplwi r3, 0x880
blt lbl_80089064
li r3, 0x301
b lbl_80089084
lbl_80089064:
addi r0, r3, 1
add r4, r31, r3
stw r0, 0xc(r31)
li r3, 0
stb r5, 0x10(r4)
lwz r4, 8(r31)
addi r0, r4, 1
stw r0, 8(r31)
lbl_80089084:
cmpwi r3, 0
bne lbl_800890C4
lwz r3, 0xc(r31)
lbz r5, 0xb(r1)
cmplwi r3, 0x880
blt lbl_800890A4
li r3, 0x301
b lbl_800890C4
lbl_800890A4:
addi r0, r3, 1
add r4, r31, r3
stw r0, 0xc(r31)
li r3, 0
stb r5, 0x10(r4)
lwz r4, 8(r31)
addi r0, r4, 1
stw r0, 8(r31)
lbl_800890C4:
cmpwi r3, 0
bne lbl_80089104
lwz r3, 0xc(r31)
lbz r5, 0xc(r1)
cmplwi r3, 0x880
blt lbl_800890E4
li r3, 0x301
b lbl_80089104
lbl_800890E4:
addi r0, r3, 1
add r4, r31, r3
stw r0, 0xc(r31)
li r3, 0
stb r5, 0x10(r4)
lwz r4, 8(r31)
addi r0, r4, 1
stw r0, 8(r31)
lbl_80089104:
cmpwi r3, 0
bne lbl_80089144
lwz r3, 0xc(r31)
lbz r5, 0xd(r1)
cmplwi r3, 0x880
blt lbl_80089124
li r3, 0x301
b lbl_80089144
lbl_80089124:
addi r0, r3, 1
add r4, r31, r3
stw r0, 0xc(r31)
li r3, 0
stb r5, 0x10(r4)
lwz r4, 8(r31)
addi r0, r4, 1
stw r0, 8(r31)
lbl_80089144:
cmpwi r3, 0
bne lbl_80089184
lwz r3, 0xc(r31)
lbz r5, 0xe(r1)
cmplwi r3, 0x880
blt lbl_80089164
li r3, 0x301
b lbl_80089184
lbl_80089164:
addi r0, r3, 1
add r4, r31, r3
stw r0, 0xc(r31)
li r3, 0
stb r5, 0x10(r4)
lwz r4, 8(r31)
addi r0, r4, 1
stw r0, 8(r31)
lbl_80089184:
cmpwi r3, 0
beq lbl_800891A0
addi r3, r31, 0
li r4, 0x80
li r5, 3
bl TRKStandardACK
b lbl_800891A8
lbl_800891A0:
mr r3, r31
bl TRKSendACK
lbl_800891A8:
lwz r31, 0x14(r1)
addi r1, r1, 0x18
lwz r0, 4(r1)
mtlr r0
blr
.global TRKDoReadMemory
TRKDoReadMemory:
mflr r0
stw r0, 4(r1)
stwu r1, -0x820(r1)
stw r31, 0x81c(r1)
mr r31, r3
stw r30, 0x818(r1)
lwz r0, 8(r3)
cmplwi r0, 8
beq lbl_800891F4
addi r3, r31, 0
li r4, 0x80
li r5, 2
bl TRKStandardACK
b lbl_8008938C
lbl_800891F4:
addi r3, r31, 0
li r4, 0
bl TRKSetBufferPosition
addi r3, r31, 0
addi r4, r1, 8
bl TRKReadBuffer1_ui8
or. r30, r3, r3
bne lbl_80089224
addi r3, r31, 0
addi r4, r1, 9
bl TRKReadBuffer1_ui8
mr r30, r3
lbl_80089224:
cmpwi r30, 0
bne lbl_8008923C
addi r3, r31, 0
addi r4, r1, 0xa
bl TRKReadBuffer1_ui16
mr r30, r3
lbl_8008923C:
cmpwi r30, 0
bne lbl_80089254
addi r3, r31, 0
addi r4, r1, 0xc
bl TRKReadBuffer1_ui32
mr r30, r3
lbl_80089254:
lbz r0, 9(r1)
rlwinm. r0, r0, 0, 0x1e, 0x1e
beq lbl_80089274
addi r3, r31, 0
li r4, 0x80
li r5, 0x12
bl TRKStandardACK
b lbl_8008938C
lbl_80089274:
lhz r0, 0xa(r1)
cmplwi r0, 0x800
ble lbl_80089294
addi r3, r31, 0
li r4, 0x80
li r5, 0x11
bl TRKStandardACK
b lbl_8008938C
lbl_80089294:
addi r3, r31, 0
li r4, 0x80
li r5, 0
bl TRKMessageIntoReply
cmpwi r30, 0
bne lbl_8008931C
lbz r0, 9(r1)
lhz r3, 0xa(r1)
rlwinm. r0, r0, 0, 0x1c, 0x1c
stw r3, 0x10(r1)
beq lbl_800892C8
li r6, 0
b lbl_800892CC
lbl_800892C8:
li r6, 1
lbl_800892CC:
lwz r4, 0xc(r1)
addi r3, r1, 0x14
addi r5, r1, 0x10
li r7, 1
bl TRKTargetAccessMemory
lwz r0, 0x10(r1)
or. r30, r3, r3
sth r0, 0xa(r1)
bne lbl_80089300
mr r3, r31
lhz r4, 0xa(r1)
bl TRKAppendBuffer1_ui16
mr r30, r3
lbl_80089300:
cmpwi r30, 0
bne lbl_8008931C
lwz r5, 0x10(r1)
addi r3, r31, 0
addi r4, r1, 0x14
bl TRKAppendBuffer
mr r30, r3
lbl_8008931C:
cmpwi r30, 0
beq lbl_80089384
addi r0, r30, -1792
cmplwi r0, 6
bgt lbl_80089370
lis r3, "@175"@ha
addi r3, r3, "@175"@l
slwi r0, r0, 2
lwzx r0, r3, r0
mtctr r0
bctr
lbl_80089348:
li r5, 0x15
b lbl_80089374
lbl_80089350:
li r5, 0x13
b lbl_80089374
lbl_80089358:
li r5, 0x21
b lbl_80089374
lbl_80089360:
li r5, 0x22
b lbl_80089374
lbl_80089368:
li r5, 0x20
b lbl_80089374
lbl_80089370:
li r5, 3
lbl_80089374:
addi r3, r31, 0
li r4, 0x80
bl TRKStandardACK
b lbl_8008938C
lbl_80089384:
mr r3, r31
bl TRKSendACK
lbl_8008938C:
lwz r31, 0x81c(r1)
lwz r30, 0x818(r1)
addi r1, r1, 0x820
lwz r0, 4(r1)
mtlr r0
blr
.global TRKDoWriteMemory
TRKDoWriteMemory:
mflr r0
stw r0, 4(r1)
stwu r1, -0x820(r1)
stw r31, 0x81c(r1)
mr r31, r3
stw r30, 0x818(r1)
lwz r0, 8(r3)
cmplwi r0, 8
bgt lbl_800893DC
addi r3, r31, 0
li r4, 0x80
li r5, 2
bl TRKStandardACK
b lbl_80089588
lbl_800893DC:
addi r3, r31, 0
li r4, 0
bl TRKSetBufferPosition
addi r3, r31, 0
addi r4, r1, 8
bl TRKReadBuffer1_ui8
or. r30, r3, r3
bne lbl_8008940C
addi r3, r31, 0
addi r4, r1, 9
bl TRKReadBuffer1_ui8
mr r30, r3
lbl_8008940C:
cmpwi r30, 0
bne lbl_80089424
addi r3, r31, 0
addi r4, r1, 0xa
bl TRKReadBuffer1_ui16
mr r30, r3
lbl_80089424:
cmpwi r30, 0
bne lbl_8008943C
addi r3, r31, 0
addi r4, r1, 0xc
bl TRKReadBuffer1_ui32
mr r30, r3
lbl_8008943C:
lbz r0, 9(r1)
rlwinm. r0, r0, 0, 0x1e, 0x1e
beq lbl_8008945C
addi r3, r31, 0
li r4, 0x80
li r5, 0x12
bl TRKStandardACK
b lbl_80089588
lbl_8008945C:
lhz r4, 0xa(r1)
lwz r3, 8(r31)
addi r0, r4, 8
cmplw r3, r0
bne lbl_80089478
cmplwi r4, 0x800
ble lbl_8008948C
lbl_80089478:
addi r3, r31, 0
li r4, 0x80
li r5, 0x11
bl TRKStandardACK
b lbl_80089588
lbl_8008948C:
cmpwi r30, 0
bne lbl_800894E8
stw r4, 0x10(r1)
addi r3, r31, 0
addi r4, r1, 0x14
lwz r5, 0x10(r1)
bl TRKReadBuffer
or. r30, r3, r3
bne lbl_800894E0
lbz r0, 9(r1)
rlwinm. r0, r0, 0, 0x1c, 0x1c
beq lbl_800894C4
li r6, 0
b lbl_800894C8
lbl_800894C4:
li r6, 1
lbl_800894C8:
lwz r4, 0xc(r1)
addi r3, r1, 0x14
addi r5, r1, 0x10
li r7, 0
bl TRKTargetAccessMemory
mr r30, r3
lbl_800894E0:
lwz r0, 0x10(r1)
sth r0, 0xa(r1)
lbl_800894E8:
cmpwi r30, 0
bne lbl_80089500
addi r3, r31, 0
li r4, 0x80
li r5, 0
bl TRKMessageIntoReply
lbl_80089500:
cmpwi r30, 0
bne lbl_80089518
mr r3, r31
lhz r4, 0xa(r1)
bl TRKAppendBuffer1_ui16
mr r30, r3
lbl_80089518:
cmpwi r30, 0
beq lbl_80089580
addi r0, r30, -1792
cmplwi r0, 6
bgt lbl_8008956C
lis r3, "@214"@ha
addi r3, r3, "@214"@l
slwi r0, r0, 2
lwzx r0, r3, r0
mtctr r0
bctr
lbl_80089544:
li r5, 0x15
b lbl_80089570
lbl_8008954C:
li r5, 0x13
b lbl_80089570
lbl_80089554:
li r5, 0x21
b lbl_80089570
lbl_8008955C:
li r5, 0x22
b lbl_80089570
lbl_80089564:
li r5, 0x20
b lbl_80089570
lbl_8008956C:
li r5, 3
lbl_80089570:
addi r3, r31, 0
li r4, 0x80
bl TRKStandardACK
b lbl_80089588
lbl_80089580:
mr r3, r31
bl TRKSendACK
lbl_80089588:
lwz r31, 0x81c(r1)
lwz r30, 0x818(r1)
addi r1, r1, 0x820
lwz r0, 4(r1)
mtlr r0
blr
.global TRKDoReadRegisters
TRKDoReadRegisters:
mflr r0
stw r0, 4(r1)
stwu r1, -0x18(r1)
stw r31, 0x14(r1)
mr r31, r3
lwz r0, 8(r3)
cmplwi r0, 6
beq lbl_800895D4
addi r3, r31, 0
li r4, 0x80
li r5, 2
bl TRKStandardACK
b lbl_80089790
lbl_800895D4:
addi r3, r31, 0
li r4, 0
bl TRKSetBufferPosition
addi r3, r31, 0
addi r4, r1, 8
bl TRKReadBuffer1_ui8
cmpwi r3, 0
bne lbl_80089600
addi r3, r31, 0
addi r4, r1, 9
bl TRKReadBuffer1_ui8
lbl_80089600:
cmpwi r3, 0
bne lbl_80089614
addi r3, r31, 0
addi r4, r1, 0xa
bl TRKReadBuffer1_ui16
lbl_80089614:
cmpwi r3, 0
bne lbl_80089628
addi r3, r31, 0
addi r4, r1, 0xc
bl TRKReadBuffer1_ui16
lbl_80089628:
lhz r4, 0xa(r1)
lhz r0, 0xc(r1)
cmplw r4, r0
ble lbl_8008964C
addi r3, r31, 0
li r4, 0x80
li r5, 0x14
bl TRKStandardACK
b lbl_80089790
lbl_8008964C:
cmpwi r3, 0
bne lbl_80089664
addi r3, r31, 0
li r4, 0x80
li r5, 0
bl TRKMessageIntoReply
lbl_80089664:
lbz r0, 9(r1)
clrlwi r0, r0, 0x1d
cmpwi r0, 2
beq lbl_800896CC
bge lbl_80089688
cmpwi r0, 0
beq lbl_80089694
bge lbl_800896B0
b lbl_80089704
lbl_80089688:
cmpwi r0, 4
bge lbl_80089704
b lbl_800896E8
lbl_80089694:
lhz r3, 0xa(r1)
mr r5, r31
lhz r4, 0xc(r1)
addi r6, r1, 0x10
li r7, 1
bl TRKTargetAccessDefault
b lbl_80089708
lbl_800896B0:
lhz r3, 0xa(r1)
mr r5, r31
lhz r4, 0xc(r1)
addi r6, r1, 0x10
li r7, 1
bl TRKTargetAccessFP
b lbl_80089708
lbl_800896CC:
lhz r3, 0xa(r1)
mr r5, r31
lhz r4, 0xc(r1)
addi r6, r1, 0x10
li r7, 1
bl TRKTargetAccessExtended1
b lbl_80089708
lbl_800896E8:
lhz r3, 0xa(r1)
mr r5, r31
lhz r4, 0xc(r1)
addi r6, r1, 0x10
li r7, 1
bl TRKTargetAccessExtended2
b lbl_80089708
lbl_80089704:
li r3, 0x703
lbl_80089708:
cmpwi r3, 0
beq lbl_80089788
cmpwi r3, 0x704
beq lbl_8008975C
bge lbl_80089734
cmpwi r3, 0x702
beq lbl_80089754
bge lbl_80089744
cmpwi r3, 0x701
bge lbl_8008974C
b lbl_80089774
lbl_80089734:
cmpwi r3, 0x706
beq lbl_8008976C
bge lbl_80089774
b lbl_80089764
lbl_80089744:
li r5, 0x12
b lbl_80089778
lbl_8008974C:
li r5, 0x14
b lbl_80089778
lbl_80089754:
li r5, 0x15
b lbl_80089778
lbl_8008975C:
li r5, 0x21
b lbl_80089778
lbl_80089764:
li r5, 0x22
b lbl_80089778
lbl_8008976C:
li r5, 0x20
b lbl_80089778
lbl_80089774:
li r5, 3
lbl_80089778:
addi r3, r31, 0
li r4, 0x80
bl TRKStandardACK
b lbl_80089790
lbl_80089788:
mr r3, r31
bl TRKSendACK
lbl_80089790:
lwz r31, 0x14(r1)
addi r1, r1, 0x18
lwz r0, 4(r1)
mtlr r0
blr
.global TRKDoWriteRegisters
TRKDoWriteRegisters:
mflr r0
stw r0, 4(r1)
stwu r1, -0x20(r1)
stw r31, 0x1c(r1)
stw r30, 0x18(r1)
mr r30, r3
lwz r0, 8(r3)
cmplwi r0, 6
bgt lbl_800897DC
addi r3, r30, 0
li r4, 0x80
li r5, 2
bl TRKStandardACK
b lbl_80089994
lbl_800897DC:
addi r3, r30, 0
li r4, 0
bl TRKSetBufferPosition
addi r3, r30, 0
addi r4, r1, 8
bl TRKReadBuffer1_ui8
cmpwi r3, 0
bne lbl_80089808
addi r3, r30, 0
addi r4, r1, 9
bl TRKReadBuffer1_ui8
lbl_80089808:
cmpwi r3, 0
bne lbl_8008981C
addi r3, r30, 0
addi r4, r1, 0xa
bl TRKReadBuffer1_ui16
lbl_8008981C:
cmpwi r3, 0
bne lbl_80089830
addi r3, r30, 0
addi r4, r1, 0xc
bl TRKReadBuffer1_ui16
lbl_80089830:
lhz r3, 0xa(r1)
lhz r4, 0xc(r1)
cmplw r3, r4
ble lbl_80089854
addi r3, r30, 0
li r4, 0x80
li r5, 0x14
bl TRKStandardACK
b lbl_80089994
lbl_80089854:
lbz r0, 9(r1)
cmpwi r0, 2
beq lbl_800898B0
bge lbl_80089874
cmpwi r0, 0
beq lbl_80089880
bge lbl_80089898
b lbl_800898E0
lbl_80089874:
cmpwi r0, 4
bge lbl_800898E0
b lbl_800898C8
lbl_80089880:
addi r6, r1, 0x10
addi r5, r30, 0
li r7, 0
bl TRKTargetAccessDefault
mr r31, r3
b lbl_800898E4
lbl_80089898:
addi r6, r1, 0x10
addi r5, r30, 0
li r7, 0
bl TRKTargetAccessFP
mr r31, r3
b lbl_800898E4
lbl_800898B0:
addi r6, r1, 0x10
addi r5, r30, 0
li r7, 0
bl TRKTargetAccessExtended1
mr r31, r3
b lbl_800898E4
lbl_800898C8:
addi r6, r1, 0x10
addi r5, r30, 0
li r7, 0
bl TRKTargetAccessExtended2
mr r31, r3
b lbl_800898E4
lbl_800898E0:
li r31, 0x703
lbl_800898E4:
cmpwi r31, 0
bne lbl_800898FC
addi r3, r30, 0
li r4, 0x80
li r5, 0
bl TRKMessageIntoReply
lbl_800898FC:
cmpwi r31, 0
beq lbl_8008998C
cmpwi r31, 0x703
beq lbl_80089940
bge lbl_80089928
cmpwi r31, 0x701
beq lbl_80089948
bge lbl_80089958
cmpwi r31, 0x302
beq lbl_80089950
b lbl_80089978
lbl_80089928:
cmpwi r31, 0x706
beq lbl_80089970
bge lbl_80089978
cmpwi r31, 0x705
bge lbl_80089968
b lbl_80089960
lbl_80089940:
li r5, 0x12
b lbl_8008997C
lbl_80089948:
li r5, 0x14
b lbl_8008997C
lbl_80089950:
li r5, 2
b lbl_8008997C
lbl_80089958:
li r5, 0x15
b lbl_8008997C
lbl_80089960:
li r5, 0x21
b lbl_8008997C
lbl_80089968:
li r5, 0x22
b lbl_8008997C
lbl_80089970:
li r5, 0x20
b lbl_8008997C
lbl_80089978:
li r5, 3
lbl_8008997C:
addi r3, r30, 0
li r4, 0x80
bl TRKStandardACK
b lbl_80089994
lbl_8008998C:
mr r3, r30
bl TRKSendACK
lbl_80089994:
lwz r31, 0x1c(r1)
lwz r30, 0x18(r1)
addi r1, r1, 0x20
lwz r0, 4(r1)
mtlr r0
blr
.global TRKDoFlushCache
TRKDoFlushCache:
mflr r0
stw r0, 4(r1)
stwu r1, -0x20(r1)
stw r31, 0x1c(r1)
stw r30, 0x18(r1)
mr r30, r3
lwz r0, 8(r3)
cmplwi r0, 0xa
beq lbl_800899E4
addi r3, r30, 0
li r4, 0x80
li r5, 2
bl TRKStandardACK
b lbl_80089ACC
lbl_800899E4:
addi r3, r30, 0
li r4, 0
bl TRKSetBufferPosition
addi r3, r30, 0
addi r4, r1, 8
bl TRKReadBuffer1_ui8
or. r31, r3, r3
bne lbl_80089A14
addi r3, r30, 0
addi r4, r1, 9
bl TRKReadBuffer1_ui8
mr r31, r3
lbl_80089A14:
cmpwi r31, 0
bne lbl_80089A2C
addi r3, r30, 0
addi r4, r1, 0xc
bl TRKReadBuffer1_ui32
mr r31, r3
lbl_80089A2C:
cmpwi r31, 0
bne lbl_80089A44
addi r3, r30, 0
addi r4, r1, 0x10
bl TRKReadBuffer1_ui32
mr r31, r3
lbl_80089A44:
lwz r4, 0xc(r1)
lwz r5, 0x10(r1)
cmplw r4, r5
ble lbl_80089A68
addi r3, r30, 0
li r4, 0x80
li r5, 0x13
bl TRKStandardACK
b lbl_80089ACC
lbl_80089A68:
cmpwi r31, 0
bne lbl_80089A7C
lbz r3, 9(r1)
bl TRKTargetFlushCache
mr r31, r3
lbl_80089A7C:
cmpwi r31, 0
bne lbl_80089A94
addi r3, r30, 0
li r4, 0x80
li r5, 0
bl TRKMessageIntoReply
lbl_80089A94:
cmpwi r31, 0
beq lbl_80089AC4
cmpwi r31, 0x703
beq lbl_80089AA8
b lbl_80089AB0
lbl_80089AA8:
li r5, 0x12
b lbl_80089AB4
lbl_80089AB0:
li r5, 3
lbl_80089AB4:
addi r3, r30, 0
li r4, 0x80
bl TRKStandardACK
b lbl_80089ACC
lbl_80089AC4:
mr r3, r30
bl TRKSendACK
lbl_80089ACC:
lwz r31, 0x1c(r1)
lwz r30, 0x18(r1)
addi r1, r1, 0x20
lwz r0, 4(r1)
mtlr r0
blr
.global TRKDoContinue
TRKDoContinue:
mflr r0
stw r0, 4(r1)
stwu r1, -0x10(r1)
stw r31, 0xc(r1)
mr r31, r3
bl TRKTargetStopped
cmpwi r3, 0
bne lbl_80089B18
addi r3, r31, 0
li r4, 0x80
li r5, 0x16
bl TRKStandardACK
b lbl_80089B34
lbl_80089B18:
addi r3, r31, 0
li r4, 0x80
li r5, 0
bl TRKStandardACK
cmpwi r3, 0
bne lbl_80089B34
bl TRKTargetContinue
lbl_80089B34:
lwz r31, 0xc(r1)
addi r1, r1, 0x10
lwz r0, 4(r1)
mtlr r0
blr
.global TRKDoStep
TRKDoStep:
mflr r0
stw r0, 4(r1)
stwu r1, -0x18(r1)
stw r31, 0x14(r1)
mr r31, r3
lwz r0, 8(r3)
cmplwi r0, 3
bge lbl_80089B7C
addi r3, r31, 0
li r4, 0x80
li r5, 2
bl TRKStandardACK
b lbl_80089D38
lbl_80089B7C:
addi r3, r31, 0
li r4, 0
bl TRKSetBufferPosition
addi r3, r31, 0
addi r4, r1, 8
bl TRKReadBuffer1_ui8
cmpwi r3, 0
bne lbl_80089BA8
addi r3, r31, 0
addi r4, r1, 9
bl TRKReadBuffer1_ui8
lbl_80089BA8:
lbz r0, 9(r1)
cmpwi r0, 0x10
beq lbl_80089BDC
bge lbl_80089BD0
cmpwi r0, 1
beq lbl_80089C10
bge lbl_80089C88
cmpwi r0, 0
bge lbl_80089BDC
b lbl_80089C88
lbl_80089BD0:
cmpwi r0, 0x12
bge lbl_80089C88
b lbl_80089C10
lbl_80089BDC:
cmpwi r3, 0
bne lbl_80089BF0
addi r3, r31, 0
addi r4, r1, 0xa
bl TRKReadBuffer1_ui8
lbl_80089BF0:
lbz r0, 0xa(r1)
cmplwi r0, 1
bge lbl_80089C9C
addi r3, r31, 0
li r4, 0x80
li r5, 0x11
bl TRKStandardACK
b lbl_80089D38
lbl_80089C10:
lwz r0, 8(r31)
cmplwi r0, 0xa
beq lbl_80089C30
addi r3, r31, 0
li r4, 0x80
li r5, 2
bl TRKStandardACK
b lbl_80089D38
lbl_80089C30:
cmpwi r3, 0
bne lbl_80089C44
addi r3, r31, 0
addi r4, r1, 0xc
bl TRKReadBuffer1_ui32
lbl_80089C44:
cmpwi r3, 0
bne lbl_80089C58
addi r3, r31, 0
addi r4, r1, 0x10
bl TRKReadBuffer1_ui32
lbl_80089C58:
bl TRKTargetGetPC
lwz r0, 0xc(r1)
cmplw r3, r0
blt lbl_80089C74
lwz r0, 0x10(r1)
cmplw r3, r0
ble lbl_80089C9C
lbl_80089C74:
addi r3, r31, 0
li r4, 0x80
li r5, 0x11
bl TRKStandardACK
b lbl_80089D38
lbl_80089C88:
addi r3, r31, 0
li r4, 0x80
li r5, 0x12
bl TRKStandardACK
b lbl_80089D38
lbl_80089C9C:
bl TRKTargetStopped
cmpwi r3, 0
bne lbl_80089CBC
addi r3, r31, 0
li r4, 0x80
li r5, 0x16
bl TRKStandardACK
b lbl_80089D38
lbl_80089CBC:
addi r3, r31, 0
li r4, 0x80
li r5, 0
bl TRKStandardACK
cmpwi r3, 0
bne lbl_80089D38
lbz r0, 9(r1)
cmpwi r0, 0x10
beq lbl_80089D08
bge lbl_80089CFC
cmpwi r0, 1
beq lbl_80089D20
bge lbl_80089D38
cmpwi r0, 0
bge lbl_80089D08
b lbl_80089D38
lbl_80089CFC:
cmpwi r0, 0x12
bge lbl_80089D38
b lbl_80089D20
lbl_80089D08:
subfic r0, r0, 0x10
lbz r3, 0xa(r1)
cntlzw r0, r0
srwi r4, r0, 5
bl TRKTargetSingleStep
b lbl_80089D38
lbl_80089D20:
subfic r0, r0, 0x11
lwz r3, 0xc(r1)
cntlzw r0, r0
lwz r4, 0x10(r1)
srwi r5, r0, 5
bl TRKTargetStepOutOfRange
lbl_80089D38:
lwz r31, 0x14(r1)
addi r1, r1, 0x18
lwz r0, 4(r1)
mtlr r0
blr
.global TRKDoStop
TRKDoStop:
mflr r0
stw r0, 4(r1)
stwu r1, -0x10(r1)
stw r31, 0xc(r1)
mr r31, r3
bl TRKTargetStop
cmpwi r3, 0x704
beq lbl_80089D94
bge lbl_80089D7C
cmpwi r3, 0
beq lbl_80089D8C
b lbl_80089DAC
lbl_80089D7C:
cmpwi r3, 0x706
beq lbl_80089DA4
bge lbl_80089DAC
b lbl_80089D9C
lbl_80089D8C:
li r5, 0
b lbl_80089DB0
lbl_80089D94:
li r5, 0x21
b lbl_80089DB0
lbl_80089D9C:
li r5, 0x22
b lbl_80089DB0
lbl_80089DA4:
li r5, 0x20
b lbl_80089DB0
lbl_80089DAC:
li r5, 1
lbl_80089DB0:
addi r3, r31, 0
li r4, 0x80
bl TRKStandardACK
lwz r31, 0xc(r1)
addi r1, r1, 0x10
lwz r0, 4(r1)
mtlr r0
blr
.section .data, "wa"
"@175":
.4byte lbl_80089350
.4byte lbl_80089370
.4byte lbl_80089348
.4byte lbl_80089370
.4byte lbl_80089358
.4byte lbl_80089360
.4byte lbl_80089368
"@214":
.4byte lbl_8008954C
.4byte lbl_8008956C
.4byte lbl_80089544
.4byte lbl_8008956C
.4byte lbl_80089554
.4byte lbl_8008955C
.4byte lbl_80089564