Skip to content

Convert MMIO accesses in assembly to C#837

Open
uyjulian wants to merge 1 commit intops2dev:masterfrom
uyjulian:asm_mmio_cleanup
Open

Convert MMIO accesses in assembly to C#837
uyjulian wants to merge 1 commit intops2dev:masterfrom
uyjulian:asm_mmio_cleanup

Conversation

@uyjulian
Copy link
Copy Markdown
Member

@uyjulian uyjulian commented May 7, 2026

For better readability

Tested working

Comment thread ee/debug/src/scr_printf.c
" lw %1, -0x6000(%0) \n"
" .set pop \n"
: "=&r"(dma_addr), "=&r"(status));
while ((*((vu32 *)0x1000a000) & 0x100) != 0); // Wait until STR bit of D2_CHCR = 0
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice improvement to readability. But can you go 1 step further and also replace the magic numbers with their register definitions? Like R_EE_D2_CHCR in this case?

#define A_EE_D2_CHCR (0x1000a000)

#define R_EE_D2_CHCR ((vu32 *)A_EE_D2_CHCR)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants