[Atsoft-commit] CVS: dcgen/main ui-kos.c,1.7,1.8
Brought to you by:
atani
|
From: Mike D. <at...@us...> - 2002-02-18 16:08:07
|
Update of /cvsroot/atsoft/dcgen/main
In directory usw-pr-cvs1:/tmp/cvs-serv22402
Modified Files:
ui-kos.c
Log Message:
Cleanedup various problems with the palette (disabled new code for now, it has a bug in it still) and the faster palette based sq copy now works again, some reason with the latest KOS it doesnt like doing 32 pixel copies (expanded). The current code will render 16 pixels (expanded) in one shot.
Index: ui-kos.c
===================================================================
RCS file: /cvsroot/atsoft/dcgen/main/ui-kos.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** ui-kos.c 14 Feb 2002 05:56:27 -0000 1.7
--- ui-kos.c 18 Feb 2002 16:02:29 -0000 1.8
***************
*** 16,21 ****
// This is used to enable the 64bit transfer of the txr
// to the TA from the internal array (palette expanded).
! //#define USE_64_BIT_TXR_XFER 1
! #undef USE_64_BIT_TXR_XFER
// the USE_64_BIT_TXR_XFER is broken right now. Will be fixed shortly.
--- 16,21 ----
// This is used to enable the 64bit transfer of the txr
// to the TA from the internal array (palette expanded).
! #define USE_64_BIT_TXR_XFER 1
! //#undef USE_64_BIT_TXR_XFER
// the USE_64_BIT_TXR_XFER is broken right now. Will be fixed shortly.
***************
*** 28,37 ****
pvr_ptr_t txr_base;
pvr_ptr_t txr_base_ex;
- uint32 old_pal_fmt;
uint8 screen[512*512];
uint16 screen_ex[512*512];
pvr_poly_cxt_t txr_ex_ctx;
pvr_poly_cxt_t txr_pal_ctx;
- #define PAL_FMT_RGB565 1
#define PAL_BANK_SHIFT (25)
#define PAL_BANK_MASK (3 << PAL_BANK_SHIFT)
--- 28,35 ----
***************
*** 94,107 ****
txr_base_ex = (pvr_ptr_t)pvr_mem_malloc(512*512*2);
- //old_pal_fmt = *(volatile uint32 *)0xa05f8108;
- //*(volatile uint32 *)0xa05f8108 = PAL_FMT_RGB565;
-
//PVR_SET(PVR_TEXTURE_MODULO, 10);
! pvr_poly_cxt_txr(&txr_pal_ctx, PVR_LIST_TR_POLY, PVR_TXRFMT_PAL8BPP, 512, 512, txr_base, 0);
#ifdef USE_TWIDDLED_TXR
! pvr_poly_cxt_txr(&txr_ex_ctx, PVR_LIST_TR_POLY, PVR_TXRFMT_RGB565, 512, 512, txr_base_ex, 0);
#else
! pvr_poly_cxt_txr(&txr_ex_ctx, PVR_LIST_TR_POLY, PVR_TXRFMT_RGB565|PVR_TXRFMT_NONTWIDDLED, 512, 512, txr_base_ex, 0);
#endif
ui_initjoysticks();
--- 92,102 ----
txr_base_ex = (pvr_ptr_t)pvr_mem_malloc(512*512*2);
//PVR_SET(PVR_TEXTURE_MODULO, 10);
! pvr_poly_cxt_txr(&txr_pal_ctx, PVR_LIST_TR_POLY, PVR_TXRFMT_PAL8BPP|PVR_TXRFMT_TWIDDLED, 512, 512, txr_base, 0);
#ifdef USE_TWIDDLED_TXR
! pvr_poly_cxt_txr(&txr_ex_ctx, PVR_LIST_TR_POLY, PVR_TXRFMT_ARGB1555|PVR_TXRFMT_TWIDDLED, 512, 512, txr_base_ex, 0);
#else
! pvr_poly_cxt_txr(&txr_ex_ctx, PVR_LIST_TR_POLY, PVR_TXRFMT_ARGB1555|PVR_TXRFMT_NONTWIDDLED, 512, 512, txr_base_ex, 0);
#endif
ui_initjoysticks();
***************
*** 113,117 ****
pvr_mem_free(txr_base);
pvr_mem_free(txr_base_ex);
- //*(volatile uint32 *)0xa05f8108 = old_pal_fmt;
}
--- 108,111 ----
***************
*** 215,231 ****
{
b = (*p++ & 0x0E);
! r = (*p & 0x0E);
! g = ((*p++ & 0xE0) >> 4);
! pals[i] = (r << 11) | (g << 6) | (b << 1);
! pals[i + 64] = (r << 10) | (g << 5) | (b) | 0x510;
! pals[i + 128] = (r << 10) | (g << 5) | (b);
vdp_cramf[i] = 0;
}
if(ui_rendermode != PALETTED_TXR) return;
for(i = 0; i < 64; i++)
{
! (*palette)[0][i ] = pals[i ];
! (*palette)[0][i + 64 ] = pals[i + 64 ];
! (*palette)[0][i + 128] = pals[i + 128];
}
}
--- 209,236 ----
{
b = (*p++ & 0x0E);
! g = (*p & 0xE0);
! r = ((*p++ & 0x0E) >> 4);
! #if 0
! pals[i] = 0x8000 | (r << 11) | (g << 6) | (b);
! pals[i + 64] = 0x8000 | (r << 10) | (g << 5) | (b >> 1) | (16 << 10) | (16 << 6) | 16;
! pals[i + 128] = 0x8000 | (r << 10) | (g << 5) | (b >> 1);
! #else
! pals[i] = 0x8000 | (r << 11) | (g << 6) | (b << 1);
! pals[i + 64] = 0x8000 | (r << 10) | (g << 5) | (b) | 0x510;
! pals[i + 128] = 0x8000 | (r << 10) | (g << 5) | (b);
vdp_cramf[i] = 0;
+ #endif
+
}
if(ui_rendermode != PALETTED_TXR) return;
for(i = 0; i < 64; i++)
{
! if(vdp_cramf[i])
! {
! vdp_cramf[i] = 0;
! (*palette)[0][i ] = (pals[i ] & 0x7FFF);
! (*palette)[0][i + 64 ] = (pals[i + 64 ] & 0x7FFF);
! (*palette)[0][i + 128] = (pals[i + 128] & 0x7FFF);
! }
}
}
***************
*** 242,246 ****
static void texture_memcpy64_pal(void *dest, void *src)
{
! int cnt = 32;
unsigned char *s = (unsigned char *)src;
unsigned int *d = (unsigned int *)(void *)
--- 247,251 ----
static void texture_memcpy64_pal(void *dest, void *src)
{
! int cnt = 64;
unsigned char *s = (unsigned char *)src;
unsigned int *d = (unsigned int *)(void *)
***************
*** 253,257 ****
COPYPIXEL(2);
COPYPIXEL(3);
! asm("pref @%0" : : "r" (s+4*16));
COPYPIXEL(4);
COPYPIXEL(5);
--- 258,262 ----
COPYPIXEL(2);
COPYPIXEL(3);
! //asm("pref @%0" : : "r" (s+4*16));
COPYPIXEL(4);
COPYPIXEL(5);
***************
*** 260,268 ****
asm("pref @%0" : : "r" (d));
d += 8;
COPYPIXEL(0);
COPYPIXEL(1);
COPYPIXEL(2);
COPYPIXEL(3);
! asm("pref @%0" : : "r" (s+4*16));
COPYPIXEL(4);
COPYPIXEL(5);
--- 265,274 ----
asm("pref @%0" : : "r" (d));
d += 8;
+ /*
COPYPIXEL(0);
COPYPIXEL(1);
COPYPIXEL(2);
COPYPIXEL(3);
! //asm("pref @%0" : : "r" (s+4*16));
COPYPIXEL(4);
COPYPIXEL(5);
***************
*** 271,274 ****
--- 277,281 ----
asm("pref @%0" : : "r" (d));
d += 8;
+ */
}
}
|