2 // libn64/rcp/vi.c: VI helper functions.
4 // n64chain: A (free) open-source N64 development toolchain.
5 // Copyright 2014-16 Tyler J. Stachecki <stachecki.tyler@gmail.com>
7 // This file is subject to the terms and conditions defined in
8 // 'LICENSE', which is part of this source code package.
13 void vi_flush_state(const vi_state_t
*state
) {
14 uint32_t vi_region
= 0xA4400000U
;
15 uint32_t data
, end_ptr
;
20 "addiu %[end_ptr], %[vi_region], 0x30\n"
23 "ld %[data], 0x30(%[state])\n\t"
24 "addiu %[state], %[state], -0x8\n\t"
25 "sw %[data], 0x4(%[end_ptr])\n\t"
26 "dsrl32 %[data], %[data], 0x0\n\t"
27 "sw %[data], 0x0(%[end_ptr])\n\t"
28 "bne %[vi_region], %[end_ptr], 1b\n\t"
29 "addiu %[end_ptr], %[end_ptr], -0x8\n\t"
33 : [state
] "=&r" (state
), [data
] "=&r" (data
),
34 [end_ptr
] "=&r" (end_ptr
), [vi_region
] "=&r" (vi_region
)
35 : "0" (state
), "3" (vi_region
)