[Atsoft-commit] CVS: dcgen/main generator.c,1.10,1.11 reg68k.c,1.1.1.1,1.2 ui-kos.c,1.6,1.7 vdp.c,1.
Brought to you by:
atani
|
From: Mike D. <at...@us...> - 2002-02-14 05:56:30
|
Update of /cvsroot/atsoft/dcgen/main
In directory usw-pr-cvs1:/tmp/cvs-serv5112/main
Modified Files:
generator.c reg68k.c ui-kos.c vdp.c
Log Message:
Index: generator.c
===================================================================
RCS file: /cvsroot/atsoft/dcgen/main/generator.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** generator.c 13 Feb 2002 07:57:25 -0000 1.10
--- generator.c 14 Feb 2002 05:56:27 -0000 1.11
***************
*** 25,29 ****
unsigned int gen_quit = 0;
unsigned int gen_debugmode = 0;
! unsigned int gen_loglevel = 0; /* 2 = NORMAL, 1 = CRITICAL */
unsigned int gen_autodetect = 1; /* 0 = no, 1 = yes */
unsigned int gen_musiclog = 0; /* 0 = no, 1 = GYM, 2 = GNM */
--- 25,29 ----
unsigned int gen_quit = 0;
unsigned int gen_debugmode = 0;
! unsigned int gen_loglevel = 3; /* 2 = NORMAL, 1 = CRITICAL */
unsigned int gen_autodetect = 1; /* 0 = no, 1 = yes */
unsigned int gen_musiclog = 0; /* 0 = no, 1 = GYM, 2 = GNM */
Index: reg68k.c
===================================================================
RCS file: /cvsroot/atsoft/dcgen/main/reg68k.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** reg68k.c 18 Jan 2002 02:42:51 -0000 1.1.1.1
--- reg68k.c 14 Feb 2002 05:56:27 -0000 1.2
***************
*** 90,97 ****
do {
- //#ifndef DREAMCAST
pc24 = reg68k_pc & 0xffffff;
if ((pc24 & 0xff0000) == 0xff0000) {
- //#endif
/* executing code from RAM, do not use compiled information */
do {
--- 90,95 ----
***************
*** 109,113 ****
while (!step_piib->flags.endblk);
list = NULL; /* stop compiler warning ;( */
- //#ifndef DREAMCAST
} else {
index = (pc24 >> 1) & (LEN_IPCLISTTABLE - 1);
--- 107,110 ----
***************
*** 141,145 ****
cpu68k_clocks += list->clocks;
}
- //#endif
}
while (clks > 0);
--- 138,141 ----
Index: ui-kos.c
===================================================================
RCS file: /cvsroot/atsoft/dcgen/main/ui-kos.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** ui-kos.c 13 Feb 2002 07:57:25 -0000 1.6
--- ui-kos.c 14 Feb 2002 05:56:27 -0000 1.7
***************
*** 16,20 ****
// 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
// Do not use a twiddled txr as it is really slow.
--- 16,22 ----
// 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.
// Do not use a twiddled txr as it is really slow.
***************
*** 29,34 ****
uint8 screen[512*512];
uint16 screen_ex[512*512];
! pvr_poly_hdr_t screen_poly;
! pvr_poly_hdr_t screen_poly_pal;
#define PAL_FMT_RGB565 1
#define PAL_BANK_SHIFT (25)
--- 31,36 ----
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)
***************
*** 89,94 ****
int ui_init(int argc, char *argv[])
{
- pvr_poly_cxt_t tmp;
- pvr_poly_cxt_t pal_tmp;
txr_base = (pvr_ptr_t)pvr_mem_malloc(512*512);
txr_base_ex = (pvr_ptr_t)pvr_mem_malloc(512*512*2);
--- 91,94 ----
***************
*** 97,110 ****
//*(volatile uint32 *)0xa05f8108 = PAL_FMT_RGB565;
! PVR_SET(PVR_TEXTURE_MODULO, 10);
! pvr_poly_cxt_txr(&pal_tmp, PVR_LIST_TR_POLY, PVR_TXRFMT_PAL8BPP, 512, 512, txr_base, 0);
#ifdef USE_TWIDDLED_TXR
! pvr_poly_cxt_txr(&tmp, PVR_LIST_TR_POLY, PVR_TXRFMT_RGB565, 512, 512, txr_base_ex, 0);
#else
! pvr_poly_cxt_txr(&tmp, PVR_LIST_TR_POLY, PVR_TXRFMT_RGB565|PVR_TXRFMT_NONTWIDDLED, 512, 512, txr_base_ex, 0);
#endif
- pvr_poly_compile(&screen_poly, &tmp);
- pvr_poly_compile(&screen_poly_pal, &pal_tmp);
ui_initjoysticks();
return 0;
--- 97,108 ----
//*(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();
return 0;
***************
*** 209,213 ****
}
! void __inline palette_update()
{
int i;
--- 207,211 ----
}
! void inline palette_update()
{
int i;
***************
*** 248,253 ****
unsigned int *d = (unsigned int *)(void *)
(0xe0000000 | (((unsigned long)dest) & 0x03ffffe0));
! QACR0 = ((0xa4000000>>26)<<2)&0x1c;
! QACR1 = ((0xa4000000>>26)<<2)&0x1c;
while(cnt--) {
COPYPIXEL(0);
--- 246,251 ----
unsigned int *d = (unsigned int *)(void *)
(0xe0000000 | (((unsigned long)dest) & 0x03ffffe0));
! QACR0 = (((unsigned int)dest>>26)<<2)&0x1c;
! QACR1 = (((unsigned int)dest>>26)<<2)&0x1c;
while(cnt--) {
COPYPIXEL(0);
***************
*** 297,301 ****
vdp_renderline(line, p, 0);
}
! palette_update();
}
--- 295,299 ----
vdp_renderline(line, p, 0);
}
! //palette_update();
}
***************
*** 303,306 ****
--- 301,305 ----
{
pvr_vertex_t vert;
+ pvr_poly_hdr_t screen_poly;
uint32 y_size = 240;
uint32 x_size = 320;
***************
*** 333,340 ****
--- 332,341 ----
{
txr_twiddle_copy_general(&screen[0], txr_base, 512, 512, 8);
+ pvr_poly_compile(&screen_poly, &txr_pal_ctx);
}
else
{
uint32 y_offs = 0;
+ pvr_poly_compile(&screen_poly, &txr_ex_ctx);
#ifdef USE_64_BIT_TXR_XFER
unsigned short *dst = (unsigned short *)txr_base_ex;
***************
*** 365,381 ****
pvr_wait_ready();
pvr_scene_begin();
pvr_list_begin(PVR_LIST_OP_POLY);
pvr_dummy_poly(PVR_LIST_OP_POLY);
pvr_list_finish();
pvr_list_begin(PVR_LIST_TR_POLY);
! pvr_dummy_poly(PVR_LIST_TR_POLY);
! if(ui_rendermode == PALETTED_TXR)
! {
! pvr_prim(&screen_poly_pal, sizeof(screen_poly_pal));
! }
! else
! {
! pvr_prim(&screen_poly, sizeof(screen_poly));
! }
vert.flags = PVR_CMD_VERTEX;
vert.argb = PVR_PACK_COLOR(1,1,1,1);
--- 366,377 ----
pvr_wait_ready();
pvr_scene_begin();
+
pvr_list_begin(PVR_LIST_OP_POLY);
pvr_dummy_poly(PVR_LIST_OP_POLY);
pvr_list_finish();
+
pvr_list_begin(PVR_LIST_TR_POLY);
! pvr_prim(&screen_poly, sizeof(screen_poly));
!
vert.flags = PVR_CMD_VERTEX;
vert.argb = PVR_PACK_COLOR(1,1,1,1);
***************
*** 409,412 ****
--- 405,409 ----
pvr_list_finish();
+
pvr_scene_finish();
}
Index: vdp.c
===================================================================
RCS file: /cvsroot/atsoft/dcgen/main/vdp.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** vdp.c 24 Jan 2002 06:05:36 -0000 1.3
--- vdp.c 14 Feb 2002 05:56:27 -0000 1.4
***************
*** 214,218 ****
LOG_DEBUG1(("%08X STATUS READ %02X", regs68k.pc, ret));
- LOG_VERBOSE(("%08X STATUS READ %02X", regs68k.pc, ret));
return (ret);
--- 214,217 ----
***************
*** 1436,1441 ****
unsigned int i, line;
uint32 background;
! unsigned int vertcells = vdp_reg[1] & 1 << 3 ? 30 : 28;
! uint8 *linedata;
/* fill in background */
--- 1435,1440 ----
unsigned int i, line;
uint32 background;
! unsigned int vertcells = (vdp_reg[1] & 0x08) ? 30 : 28;
! uint8 *linedata = framedata;
/* fill in background */
***************
*** 1446,1469 ****
for (line = 0; line < vertcells * 8; line++) {
! linedata = framedata + line * lineoffset;
for (i = 0; i < (320 / 4); i++) {
((uint32 *)linedata)[i] = background;
}
}
if (vdp_reg[1] & 1 << 6) {
if (vdp_layerB)
vdp_layer_simple(1, 0, framedata, lineoffset);
if (vdp_layerA)
vdp_layer_simple(0, 0, framedata, lineoffset);
if (vdp_layerH && (vdp_reg[12] & 1 << 3))
vdp_shadow_simple(framedata, lineoffset);
if (vdp_layerS)
vdp_sprites_simple(0, framedata, lineoffset);
if (vdp_layerBp)
vdp_layer_simple(1, 1, framedata, lineoffset);
if (vdp_layerAp)
vdp_layer_simple(0, 1, framedata, lineoffset);
if (vdp_layerSp)
vdp_sprites_simple(1, framedata, lineoffset);
}
--- 1445,1488 ----
for (line = 0; line < vertcells * 8; line++) {
! #ifdef DREAMCAST
! memset4(linedata, background, 320/4);
! #else
for (i = 0; i < (320 / 4); i++) {
((uint32 *)linedata)[i] = background;
}
+ #endif
+ linedata += lineoffset;
}
if (vdp_reg[1] & 1 << 6) {
+ #ifndef DREAMCAST
if (vdp_layerB)
+ #endif
vdp_layer_simple(1, 0, framedata, lineoffset);
+ #ifndef DREAMCAST
if (vdp_layerA)
+ #endif
vdp_layer_simple(0, 0, framedata, lineoffset);
+ #ifdef DREAMCAST
+ if (vdp_reg[12] & 0x08)
+ #else
if (vdp_layerH && (vdp_reg[12] & 1 << 3))
+ #endif
vdp_shadow_simple(framedata, lineoffset);
+ #ifndef DREAMCAST
if (vdp_layerS)
+ #endif
vdp_sprites_simple(0, framedata, lineoffset);
+ #ifndef DREAMCAST
if (vdp_layerBp)
+ #endif
vdp_layer_simple(1, 1, framedata, lineoffset);
+ #ifndef DREAMCAST
if (vdp_layerAp)
+ #endif
vdp_layer_simple(0, 1, framedata, lineoffset);
+ #ifndef DREAMCAST
if (vdp_layerSp)
+ #endif
vdp_sprites_simple(1, framedata, lineoffset);
}
***************
*** 1895,1899 ****
cellinfo =
LOCENDIAN16(patterndata[(hoffset >> 3) + hwidth * (voffset >> 3)]);
! if (((uint8)((cellinfo & 1 << 15) ? 1 : 0)) == priority) {
/* plot cell */
palette = (cellinfo >> 13) & 3;
--- 1914,1918 ----
cellinfo =
LOCENDIAN16(patterndata[(hoffset >> 3) + hwidth * (voffset >> 3)]);
! if (((uint8)((cellinfo & 0x8000) ? 1 : 0)) == priority) {
/* plot cell */
palette = (cellinfo >> 13) & 3;
|