OSDN Git Service

hw/display/artist: Refactor x/y coordination extraction
authorHelge Deller <deller@gmx.de>
Thu, 3 Sep 2020 05:23:47 +0000 (07:23 +0200)
committerHelge Deller <deller@gmx.de>
Thu, 3 Sep 2020 15:30:04 +0000 (17:30 +0200)
commitc7050f3f167b80e844c6c52f9586c4632a4f54f3
tree21ef5d80fec7db0993ca8c6869203441627237bf
parent95aad497d9f1cc96b6913e61c95fca116af69b93
hw/display/artist: Refactor x/y coordination extraction

Simplify the code by using new introduced ADDR_TO_Y() and ADDR_TO_X()
macros. Those macros extract the x/y-coordinate from the given uint32.

As further simplification the extraction of the x/y coordinates for
VRAM_WRITE_INCR_Y and VRAM_WRITE_INCR_X can be done centrally in
vram_bit_write(), so move this code up into the function.

ADDR_TO_Y() is still limited to 10 bits which allow to address up to of
1024 lines - this will be increased in a follow-up patch.

Signed-off-by: Helge Deller <deller@gmx.de>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
hw/display/artist.c