From 9a50f36153c749ddb499c5fe29f7d2e14bdf1ec2 Mon Sep 17 00:00:00 2001 From: Romain Dolbeau Date: Sat, 4 Jun 2022 11:11:28 +0200 Subject: [PATCH] add a byte-reversed access mode to accel registers, avoid the byte-reverse on the host --- .../NuBusFPGAInit/NuBusFPGAInit.c | 27 ++++--- .../NuBusFPGAInit/NuBusFPGA_HW.h | 15 ++-- nubus-to-ztex-gateware/goblin_accel.py | 80 ++++++++++++------- 3 files changed, 74 insertions(+), 48 deletions(-) diff --git a/nubus-to-ztex-gateware/NuBusFPGAInit/NuBusFPGAInit.c b/nubus-to-ztex-gateware/NuBusFPGAInit/NuBusFPGAInit.c index d34d81d..c197d28 100644 --- a/nubus-to-ztex-gateware/NuBusFPGAInit/NuBusFPGAInit.c +++ b/nubus-to-ztex-gateware/NuBusFPGAInit/NuBusFPGAInit.c @@ -67,6 +67,9 @@ static inline unsigned long brev(const unsigned long r) { #define WAIT_FOR_HW(accel) \ while (accel->reg_status & brev(1<reg_status & (1<MINRECT.bottom - qdstack->MINRECT.top; short dstshift = qdstack->DSTSHIFT; @@ -520,23 +523,23 @@ int hwblit(char* stack, char* p_fb_base, /* short dstshift, */ short mode, Patte return 0; #else - WAIT_FOR_HW(accel); + WAIT_FOR_HW_LE(accel_le); - accel->reg_width = brev(width); - accel->reg_height = brev(height); - accel->reg_bitblt_dst_x = brev(dstv.left << dstshift); - accel->reg_bitblt_dst_y = brev(dstv.top); + accel_le->reg_width = (width); + accel_le->reg_height = (height); + accel_le->reg_bitblt_dst_x = (dstv.left << dstshift); + accel_le->reg_bitblt_dst_y = (dstv.top); if (mode == 0) { - accel->reg_bitblt_src_x = brev(srcv.left << dstshift); - accel->reg_bitblt_src_y = brev(srcv.top); - accel->reg_cmd = brev(1<reg_bitblt_src_x = (srcv.left << dstshift); + accel_le->reg_bitblt_src_y = (srcv.top); + accel_le->reg_cmd = (1<reg_fgcolor = qdstack->EXPAT[0]; - accel->reg_cmd = brev(1<reg_fgcolor = (qdstack->EXPAT[0]); + accel_le->reg_cmd = (1<