[Atsoft-commit] CVS: dcgen/main Makefile,1.5,1.6 gensoundp-kos.c,1.3,1.4 mem68k.c,1.1.1.1,1.2 ui-kos
Brought to you by:
atani
|
From: Mike D. <at...@us...> - 2002-04-08 16:44:13
|
Update of /cvsroot/atsoft/dcgen/main
In directory usw-pr-cvs1:/tmp/cvs-serv12097/main
Modified Files:
Makefile gensoundp-kos.c mem68k.c ui-kos.c uip-kos.c vdp.c
Log Message:
Makefile.prefab: moved "-finline-funcs" optimization flag to the default set of "RELEASE" flags.
vdp.c: cleaned up and sped up some sections of code.
mem68k.c: cleanedup and sped up memory reading.
ui-kos.c: general code cleanup, worked out the correct values for the palette code, colors are a bit dark but are correct.
uip-kos.c: made it so it could compile again.
fm.c: general warnings cleanup (removed logging calls).
gensoundp-kos.c: general warnings cleanup.
Index: Makefile
===================================================================
RCS file: /cvsroot/atsoft/dcgen/main/Makefile,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** Makefile 13 Feb 2002 07:57:25 -0000 1.5
--- Makefile 8 Apr 2002 01:15:33 -0000 1.6
***************
*** 1,4 ****
! #OBJS = cpu68k.o cpuz80.o event.o font.o generator.o gensound.o initcart.o logo.o mem68k.o memz80.o reg68k.o snprintf.o state.o ui-console.o vdp.o gensoundp-kos.o uip-kos.o uiplot.o sndstream.o ta_text.o
OBJS = cpu68k.o cpuz80.o event.o font.o generator.o gensound.o initcart.o logo.o mem68k.o memz80.o reg68k.o snprintf.o state.o vdp.o gensoundp-kos.o ui-kos.o ta_text.o
SUBDIRS =
--- 1,4 ----
! #OBJS = cpu68k.o cpuz80.o event.o font.o generator.o gensound.o initcart.o logo.o mem68k.o memz80.o reg68k.o snprintf.o state.o ui-console.o vdp.o gensoundp-kos.o uip-kos.o uiplot.o ta_text.o
OBJS = cpu68k.o cpuz80.o event.o font.o generator.o gensound.o initcart.o logo.o mem68k.o memz80.o reg68k.o snprintf.o state.o vdp.o gensoundp-kos.o ui-kos.o ta_text.o
SUBDIRS =
Index: gensoundp-kos.c
===================================================================
RCS file: /cvsroot/atsoft/dcgen/main/gensoundp-kos.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** gensoundp-kos.c 12 Feb 2002 05:56:20 -0000 1.3
--- gensoundp-kos.c 8 Apr 2002 01:15:33 -0000 1.4
***************
*** 21,30 ****
/*** file scoped variables ***/
- static int soundp_dev = -1;
- static int soundp_format;
- static int soundp_stereo;
- static int soundp_frag;
static int buffered_samples = 0;
- static unsigned int soundp_speed;
unsigned char *audio_buffer = NULL;
unsigned char *audio_temp = NULL;
--- 21,25 ----
***************
*** 131,135 ****
// For right now the sound is entirely disabled.
// The sound is to be worked on again in the near future.
! return;
if(audio_buffer == NULL)
{
--- 126,130 ----
// For right now the sound is entirely disabled.
// The sound is to be worked on again in the near future.
! return 0;
if(audio_buffer == NULL)
{
Index: mem68k.c
===================================================================
RCS file: /cvsroot/atsoft/dcgen/main/mem68k.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** mem68k.c 18 Jan 2002 02:42:46 -0000 1.1.1.1
--- mem68k.c 8 Apr 2002 01:15:33 -0000 1.2
***************
*** 184,193 ****
uint8 *mem68k_memptr_rom(uint32 addr)
{
! if (addr < cpu68k_romlen) {
! return (cpu68k_rom + addr);
! }
! LOG_CRITICAL(("%08X [MEM] Invalid memory access to ROM 0x%X ROMSIZE: 0x%X", regs68k.pc,
! addr, cpu68k_romlen));
! return cpu68k_rom;
}
--- 184,188 ----
uint8 *mem68k_memptr_rom(uint32 addr)
{
! return (cpu68k_rom + addr);
}
***************
*** 204,209 ****
uint8 mem68k_fetch_bad_byte(uint32 addr)
{
- LOG_CRITICAL(("%08X [MEM] Invalid memory fetch (byte) 0x%X", regs68k.pc,
- addr));
return 0;
}
--- 199,202 ----
***************
*** 211,216 ****
uint16 mem68k_fetch_bad_word(uint32 addr)
{
- LOG_CRITICAL(("%08X [MEM] Invalid memory fetch (word) 0x%X", regs68k.pc,
- addr));
return 0;
}
--- 204,207 ----
***************
*** 218,223 ****
uint32 mem68k_fetch_bad_long(uint32 addr)
{
- LOG_CRITICAL(("%08X [MEM] Invalid memory fetch (long) 0x%X", regs68k.pc,
- addr));
return 0;
}
--- 209,212 ----
***************
*** 225,242 ****
void mem68k_store_bad_byte(uint32 addr, uint8 data)
{
- LOG_CRITICAL(("%08X [MEM] Invalid memory store (byte) 0x%X = %X", regs68k.pc,
- addr, data));
}
void mem68k_store_bad_word(uint32 addr, uint16 data)
{
- LOG_CRITICAL(("%08X [MEM] Invalid memory store (word) 0x%X = %X", regs68k.pc,
- addr, data));
}
void mem68k_store_bad_long(uint32 addr, uint32 data)
{
- LOG_CRITICAL(("%08X [MEM] Invalid memory store (long) 0x%X = %X", regs68k.pc,
- addr, data));
}
--- 214,225 ----
***************
*** 246,255 ****
uint8 mem68k_fetch_rom_byte(uint32 addr)
{
! if (addr < cpu68k_romlen) {
! return (*(uint8 *)(cpu68k_rom + addr));
! }
! LOG_CRITICAL(("%08X [ROM] Invalid memory fetch (byte) 0x%X ROMSIZE:0x%X", regs68k.pc,
! addr, cpu68k_romlen));
! return 0;
}
--- 229,233 ----
uint8 mem68k_fetch_rom_byte(uint32 addr)
{
! return (*(uint8 *)(cpu68k_rom + addr));
}
***************
*** 262,268 ****
}
#endif
! if (addr < cpu68k_romlen) {
! return LOCENDIAN16(*(uint16 *)(cpu68k_rom + addr));
! }
LOG_CRITICAL(("%08X [ROM] Invalid memory fetch (word) 0x%X 0x%X", regs68k.pc,
addr, cpu68k_romlen));
--- 240,244 ----
}
#endif
! return LOCENDIAN16(*(uint16 *)(cpu68k_rom + addr));
LOG_CRITICAL(("%08X [ROM] Invalid memory fetch (word) 0x%X 0x%X", regs68k.pc,
addr, cpu68k_romlen));
***************
*** 278,310 ****
}
#endif
- if (addr < cpu68k_romlen) {
#ifdef ALIGNLONGS
! return (LOCENDIAN16(*(uint16 *)(cpu68k_rom + addr)) << 16) |
! LOCENDIAN16(*(uint16 *)(cpu68k_rom + addr + 2));
#else
! return LOCENDIAN32(*(uint32 *)(cpu68k_rom + addr));
#endif
- }
- LOG_CRITICAL(("%08X [ROM] Invalid memory fetch (long) 0x%X 0x%X", regs68k.pc,
- addr, cpu68k_romlen));
- return 0;
}
void mem68k_store_rom_byte(uint32 addr, uint8 data)
{
- LOG_CRITICAL(("%08X [ROM] Invalid memory store (byte) 0x%X = %X", regs68k.pc,
- addr, data));
}
void mem68k_store_rom_word(uint32 addr, uint16 data)
{
- LOG_CRITICAL(("%08X [ROM] Invalid memory store (word) 0x%X = %X", regs68k.pc,
- addr, data));
}
void mem68k_store_rom_long(uint32 addr, uint32 data)
{
- LOG_CRITICAL(("%08X [ROM] Invalid memory store (long) 0x%X = %X", regs68k.pc,
- addr, data));
}
--- 254,275 ----
}
#endif
#ifdef ALIGNLONGS
! return (LOCENDIAN16(*(uint16 *)(cpu68k_rom + addr)) << 16) |
! LOCENDIAN16(*(uint16 *)(cpu68k_rom + addr + 2));
#else
! return LOCENDIAN32(*(uint32 *)(cpu68k_rom + addr));
#endif
}
void mem68k_store_rom_byte(uint32 addr, uint8 data)
{
}
void mem68k_store_rom_word(uint32 addr, uint16 data)
{
}
void mem68k_store_rom_long(uint32 addr, uint32 data)
{
}
Index: ui-kos.c
===================================================================
RCS file: /cvsroot/atsoft/dcgen/main/ui-kos.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** ui-kos.c 4 Apr 2002 03:26:15 -0000 1.11
--- ui-kos.c 8 Apr 2002 01:15:33 -0000 1.12
***************
*** 37,45 ****
unsigned short pals[256] = {0};
- enum
- {
- SCREEN_100, SCREEN_200
- } ui_screenmode = SCREEN_200;
-
enum
{
--- 37,40 ----
***************
*** 91,101 ****
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();
--- 86,94 ----
txr_base_ex = (pvr_ptr_t)pvr_mem_malloc(512*512*2);
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_RGB565|PVR_TXRFMT_TWIDDLED, 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();
***************
*** 150,184 ****
mem68k_cont[pad].c = !(cond.buttons & CONT_B);
pad++;
- if(!gen_quit)
- {
- gen_quit = !(cond.buttons & CONT_Y);
- }
! if(!cond.ltrig && cond.rtrig)
{
ui_vdpsimple = !ui_vdpsimple;
- /*
- if(ui_rendermode == PALETTED_TXR)
- {
- ui_rendermode = EXPANDED_TXR;
- }
- else if(ui_rendermode == EXPANDED_TXR)
- {
- ui_rendermode = PALETTED_TXR;
- }
- */
- }
- else if(cond.ltrig && !cond.rtrig)
- {
- if(ui_screenmode == SCREEN_100)
- {
- ui_screenmode = SCREEN_200;
- }
- else if(ui_screenmode == SCREEN_200)
- {
- ui_screenmode = SCREEN_100;
- }
}
! else if(cond.rtrig && cond.ltrig)
{
sound_stop();
--- 143,152 ----
mem68k_cont[pad].c = !(cond.buttons & CONT_B);
pad++;
! if(cond.ltrig && !cond.rtrig)
{
ui_vdpsimple = !ui_vdpsimple;
}
! else if(!cond.ltrig && cond.rtrig)
{
sound_stop();
***************
*** 186,189 ****
--- 154,161 ----
sound_start();
}
+ else if(cond.rtrig && cond.ltrig && !gen_quit)
+ {
+ gen_quit = 1;
+ }
}
}
***************
*** 204,223 ****
int i;
uint8 *p = (uint8 *)vdp_cram;
- uint8 r, g, b;
for(i = 0; i < 64; i++)
{
! 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) | (16 << 10) | (16 << 6) | 16;
! pals[i + 128] = 0x8000 | (r << 10) | (g << 5) | (b);
vdp_cramf[i] = 0;
- #endif
}
if(ui_rendermode != PALETTED_TXR) return;
--- 176,197 ----
int i;
uint8 *p = (uint8 *)vdp_cram;
for(i = 0; i < 64; i++)
{
! p = (uint8 *)(vdp_cram + (i << 1));
! pals[i] = /* normal */
! (p[0] & 0x0E) << 1 |
! (p[1] & 0x0E) << 12 |
! (p[1] & 0xE0) << 3;
! pals[i + 64] = /* hilight */
! (p[0] & 0x0E) |
! (p[1] & 0x0E) << 11|
! (p[1] & 0xE0) << 2|
! (16) | (16 << 11) |
! (16 << 6);
! pals[i + 128] = /* shadow */
! (p[0] & 0x0E) |
! (p[1] & 0x0E) << 11|
! (p[1] & 0xE0) << 2;
vdp_cramf[i] = 0;
}
if(ui_rendermode != PALETTED_TXR) return;
***************
*** 263,279 ****
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);
- COPYPIXEL(6);
- COPYPIXEL(7);
- asm("pref @%0" : : "r" (d));
- d += 8;
- */
}
}
--- 237,240 ----
***************
*** 307,312 ****
pvr_vertex_t vert;
pvr_poly_hdr_t screen_poly;
! uint32 y_size = 240;
! uint32 x_size = 320;
uint32 x = 0, y = 0;
uint32 u_max = (vdp_reg[12] & 1) ? 320 : 256;
--- 268,273 ----
pvr_vertex_t vert;
pvr_poly_hdr_t screen_poly;
! uint32 y_size = 480;
! uint32 x_size = 640;
uint32 x = 0, y = 0;
uint32 u_max = (vdp_reg[12] & 1) ? 320 : 256;
***************
*** 317,330 ****
{
vdp_renderframe(&screen[0], 512);
- }
- if(ui_screenmode == SCREEN_100)
- {
- x = 160;
- y = 80;
- }
- else
- {
- y_size = 480;
- x_size = 640;
}
// on a VGA cable we need to offset by 40.
--- 278,281 ----
Index: uip-kos.c
===================================================================
RCS file: /cvsroot/atsoft/dcgen/main/uip-kos.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** uip-kos.c 23 Jan 2002 08:08:28 -0000 1.2
--- uip-kos.c 8 Apr 2002 01:15:33 -0000 1.3
***************
*** 93,102 ****
if(maple_device_func(idx, unit) & MAPLE_FUNC_CONTROLLER)
{
! controllers[idx].address = maple_create_addr(idx, unit);
controller_count++;
}
else if(maple_device_func(idx, unit) & MAPLE_FUNC_LCD)
{
! controllers[idx].vmus[controllers[idx].vmu_count++] = maple_create_addr(idx, unit);
}
}
--- 93,102 ----
if(maple_device_func(idx, unit) & MAPLE_FUNC_CONTROLLER)
{
! controllers[idx].address = maple_addr(idx, unit);
controller_count++;
}
else if(maple_device_func(idx, unit) & MAPLE_FUNC_LCD)
{
! controllers[idx].vmus[controllers[idx].vmu_count++] = maple_addr(idx, unit);
}
}
***************
*** 218,233 ****
}
! if(cond.rtrig && !cond.ltrig)
! {
! ui_info ^= 1;
! ui_clearnext = 2;
!
! }
! else if(cond.ltrig && !cond.rtrig)
{
ui_fullscreen ^= 1;
ui_clearnext = 2;
}
! else if(cond.rtrig && cond.ltrig)
{
sound_stop();
--- 218,227 ----
}
! if(cond.ltrig && !cond.rtrig)
{
ui_fullscreen ^= 1;
ui_clearnext = 2;
}
! else if(!cond.ltrig && cond.rtrig)
{
sound_stop();
***************
*** 236,239 ****
--- 230,237 ----
sound_start();
}
+ else if(cond.rtrig && cond.ltrig && !quit)
+ {
+ quit = 1;
+ }
}
***************
*** 257,259 ****
--- 255,276 ----
{
return 0;
+ }
+
+ int ui_check_cond(uint32 flags)
+ {
+ int i;
+ cont_cond_t cond;
+ for(i = 0; i < 4; i++)
+ {
+ if(controllers[i].address == 0)
+ {
+ continue;
+ }
+ cont_get_cond(controllers[i].address, &cond);
+ if(!(cond.buttons & flags))
+ {
+ return 1;
+ }
+ }
+ return 0;
}
Index: vdp.c
===================================================================
RCS file: /cvsroot/atsoft/dcgen/main/vdp.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** vdp.c 4 Apr 2002 03:26:15 -0000 1.5
--- vdp.c 8 Apr 2002 01:15:33 -0000 1.6
***************
*** 83,87 ****
/*** forward references ***/
- void vdp_ramcopy_vram(int type);
void vdp_dma_vramcopy(void);
void vdp_dma_fill(uint8 data);
--- 83,86 ----
***************
*** 213,304 ****
vdp_ctrlflag = 0; /* Charles MacDonald - so he claims ;) */
[...1176 lines suppressed...]
! }
! }
! else
! {
! if(cpu68k_clocks > vdp_event_end)
! {
! return 0x0;
! }
percent = ((float)(cpu68k_clocks - vdp_event_hint) /
(float)(vdp_event_end - vdp_event_hint));
if (vdp_reg[12] & 1)
! {
! return ((uint8)(0xE4 + percent * 28) & 0xff);
! }
else
! {
! return ((uint8)(0xE8 + percent * 24) & 0xff);
! }
}
}
|