.include "macros.inc"
.section .text, "ax"
.global __close_console
__close_console:
li r3, 0
blr
.global __write_console
__write_console:
mflr r0
li r3, 0
stw r0, 4(r1)
stwu r1, -0x28(r1)
stw r31, 0x24(r1)
addi r31, r5, 0
stw r30, 0x20(r1)
addi r30, r4, 0
lwz r0, initialized$16@sda21(r13)
cmpwi r0, 0
bne lbl_800863F8
lis r3, 0x0000E100@ha
addi r3, r3, 0x0000E100@l
bl InitializeUART
cmpwi r3, 0
bne lbl_800863F8
li r0, 1
stw r0, initialized$16@sda21(r13)
lbl_800863F8:
cmpwi r3, 0
beq lbl_80086408
li r3, 1
b lbl_80086430
lbl_80086408:
mr r3, r30
lwz r4, 0(r31)
bl WriteUARTN
cmpwi r3, 0
beq lbl_8008642C
li r0, 0
stw r0, 0(r31)
li r3, 1
b lbl_80086430
lbl_8008642C:
li r3, 0
lbl_80086430:
lwz r0, 0x2c(r1)
lwz r31, 0x24(r1)
lwz r30, 0x20(r1)
mtlr r0
addi r1, r1, 0x28
blr
.global __read_console
__read_console:
mflr r0
li r3, 0
stw r0, 4(r1)
stwu r1, -0x30(r1)
stw r31, 0x2c(r1)
stw r30, 0x28(r1)
addi r30, r5, 0
stw r29, 0x24(r1)
addi r29, r4, 0
lwz r0, initialized$16@sda21(r13)
cmpwi r0, 0
bne lbl_80086494
lis r3, 0x0000E100@ha
addi r3, r3, 0x0000E100@l
bl InitializeUART
cmpwi r3, 0
bne lbl_80086494
li r0, 1
stw r0, initialized$16@sda21(r13)
lbl_80086494:
cmpwi r3, 0
beq lbl_800864A4
li r3, 1
b lbl_8008650C
lbl_800864A4:
lwz r31, 0(r30)
li r0, 0
li r3, 0
stw r0, 0(r30)
b lbl_800864E0
lbl_800864B8:
addi r3, r29, 0
li r4, 1
bl ReadUARTN
lwz r4, 0(r30)
addi r0, r4, 1
stw r0, 0(r30)
lbz r0, 0(r29)
cmplwi r0, 0xd
beq lbl_800864F4
addi r29, r29, 1
lbl_800864E0:
lwz r0, 0(r30)
cmplw r0, r31
bgt lbl_800864F4
cmpwi r3, 0
beq lbl_800864B8
lbl_800864F4:
cmpwi r3, 0
bne lbl_80086504
li r0, 0
b lbl_80086508
lbl_80086504:
li r0, 1
lbl_80086508:
clrlwi r3, r0, 0x18
lbl_8008650C:
lwz r0, 0x34(r1)
lwz r31, 0x2c(r1)
lwz r30, 0x28(r1)
mtlr r0
lwz r29, 0x24(r1)
addi r1, r1, 0x30
blr
.section .sbss, "wa"
initialized$16:
.skip 0x8