Now build on x64 platform, still need lots of rework...

This commit is contained in:
Godzil
2019-09-02 16:02:03 +01:00
parent 56b69d2281
commit 0219258ee9
31 changed files with 310 additions and 1771 deletions

View File

@@ -299,7 +299,7 @@ void SuperEagle (u8 *srcPtr, u32 srcPitch, u8 *deltaPtr,
{
u8 *dP;
u16 *bP;
u16 *xP;
//u16 *xP;
u32 inc_bP;
{

View File

@@ -102,7 +102,7 @@ public:
nupdates = 0;
is_console = 1;
}
~Surface() {
virtual ~Surface() {
if ( ! is_console ) {
SDL_FreeSurface(surface);
}

View File

@@ -12,8 +12,8 @@
////////////////////////////////////////////////////////////////////////////////
// alternate the commenting of the following defines to get audio port tracing
#define dbgprintf //
//#define dbgprintf printf
#define dbgprintf(...)
//#define dbgprintf(...) printf(...)
#include <stdio.h>
#include <stdlib.h>
@@ -234,11 +234,13 @@ void ws_audio_port_write(Uint32 port, Uint8 value)
ws_audio_set_channel_frequency(3,i);
break;
case 0x88:
dbgprintf("0x88 <- 0x%2x\n", value); fflush(stdout);
dbgprintf("0x88 <- 0x%2x\n", value);
// fflush(stdout);
ws_audio_set_channel_pan(0,(value&0xF0)>>4,value&0x0F);
break;
case 0x89:
dbgprintf("0x89 <- 0x%2x\n", value); fflush(stdout);
dbgprintf("0x89 <- 0x%2x\n", value);
// fflush(stdout);
ws_audio_set_channel_pan(1,(value&0xF0)>>4,value&0x0F);
break;
case 0x8A:
@@ -256,7 +258,8 @@ void ws_audio_port_write(Uint32 port, Uint8 value)
SwpTime=(((unsigned int)value)+1)<<5;
break;
case 0x8E:
dbgprintf("0x8E <- 0x%2x = %d %d %d %d %d %d %d %d \n", value, value & 0x80 ? 1 : 0, value & 0x40 ? 1 : 0, value & 0x20 ? 1 : 0, value & 0x10 ? 1 : 0, value & 8 ? 1 : 0, value & 4 ? 1 : 0, value & 2 ? 1 : 0, value & 1), fflush(stdout); /* ctl */
dbgprintf("0x8E <- 0x%2x = %d %d %d %d %d %d %d %d \n", value, value & 0x80 ? 1 : 0, value & 0x40 ? 1 : 0, value & 0x20 ? 1 : 0, value & 0x10 ? 1 : 0, value & 8 ? 1 : 0, value & 4 ? 1 : 0, value & 2 ? 1 : 0, value & 1);
//fflush(stdout); /* ctl */
if (value & 0x10)
{
ws_audio_set_channel_pdata(5,value&0x07);
@@ -269,7 +272,8 @@ void ws_audio_port_write(Uint32 port, Uint8 value)
WaveMap=((unsigned int)value)<<6;
break;
case 0x90:
dbgprintf("0x90 <- 0x%2x = %d %d %d %d %d %d %d %d \n", value, value & 0x80 ? 1 : 0, value & 0x40 ? 1 : 0, value & 0x20 ? 1 : 0, value & 0x10 ? 1 : 0, value & 8 ? 1 : 0, value & 4 ? 1 : 0, value & 2 ? 1 : 0, value & 1), fflush(stdout); /* ctl */
dbgprintf("0x90 <- 0x%2x = %d %d %d %d %d %d %d %d \n", value, value & 0x80 ? 1 : 0, value & 0x40 ? 1 : 0, value & 0x20 ? 1 : 0, value & 0x10 ? 1 : 0, value & 8 ? 1 : 0, value & 4 ? 1 : 0, value & 2 ? 1 : 0, value & 1);
//fflush(stdout); /* ctl */
if (value&0x01)
{
@@ -515,9 +519,10 @@ int ws_audio_seal_init(void)
AGetAudioDevCaps(nDevId, &caps);
fprintf(log_get(),"audio: %2d. %s\n", nDevId, caps.szProductName);
}
/* open audio device */
//info.nDeviceId = AUDIO_DEVICE_MAPPER;
info.nDeviceId = 1;
info.nDeviceId = 0;
info.wFormat = AUDIO_FORMAT_16BITS | AUDIO_FORMAT_STEREO; // | AUDIO_MIXER_BASS;
info.nSampleRate = 44100;
if ((rc = AOpenAudio(&info)) != AUDIO_ERROR_NONE)
@@ -664,7 +669,7 @@ void ws_audio_seal_done(void)
ADestroyAudioData(&ws_audio_sweep_wave);
// release pcm channels
for (i=0;i<6;i++)
for (i=0;i<4;i++)
ADestroyAudioVoice(ws_audio_pcm_voice[i]);
// release noise channel
@@ -1091,9 +1096,9 @@ void ws_audio_set_pcm(int Data)
////////////////////////////////////////////////////////////////////////////////
void ws_audio_flash_pcm(void)
{
int result;
void *ptr1,*ptr2;
DWORD len1,len2;
//int result;
//void *ptr1,*ptr2;
DWORD len1; //,len2;
const DWORD WrPos[16]=
{
@@ -1104,6 +1109,10 @@ void ws_audio_flash_pcm(void)
};
len1=BUFSIZEP;
if (ws_audio_noise_wave.lpData == NULL)
return;
memcpy(&ws_audio_noise_wave.lpData[WrPos[PcmWrPos]], PDataP, len1);
AWriteAudioData(&ws_audio_noise_wave, 0, ws_audio_noise_wave.dwLength);
@@ -1317,11 +1326,11 @@ void ws_audio_readState(int fp)
////////////////////////////////////////////////////////////////////////////////
void ws_audio_writeState(int fp)
{
long lpdwPosition;
long lpdwFrequency;
unsigned int lpnVolume;
unsigned int lpnPanning;
int lpnStatus;
int32_t lpdwPosition;
int32_t lpdwFrequency;
uint16_t lpnVolume;
uint16_t lpnPanning;
int8_t lpnStatus;
write(fp,&PCMPos,sizeof(DWORD));
write(fp,&TickZ,sizeof(DWORD));

View File

@@ -1,8 +1,9 @@
Sint32 startTime, endTime, totalFrames;
Uint32 nNormalLast=0;
Sint32 nNormalFrac=0;
Sint32 nTime=0,nCount=0; int i=0;
//Sint32 startTime, endTime, totalFrames;
//Uint32 nNormalLast=0;
//Sint32 nNormalFrac=0;
//Sint32 nTime=0,
Sint32 nCount=0; int i=0;
double dTime = 0.0, dNormalLast = 0.0, dTemp;
Sint32 surfacePitch;

View File

@@ -8,10 +8,10 @@
console.option("windowed output");
console.option("fixed window");
console.option("center window");
totalFrames=0;
startTime=clock();
nNormalLast=0;// Last value of timeGetTime()
nNormalFrac=0; // Extra fraction we did
//totalFrames=0;
//startTime=clock();
//nNormalLast=0;// Last value of timeGetTime()
//nNormalFrac=0; // Extra fraction we did
//nNormalLast=timeGetTime();
// hopefully, we only care about time delta, not time of day...
//nNormalLast = SDL_GetTicks();

View File

@@ -47,7 +47,7 @@
strcpy(old_rom_path,ws_rom_path);
//gui_open();
#ifndef GUI_OPEN_WARNED
#warning XXX something ought to take place here...
//#warning XXX something ought to take place here...
#define GUI_OPEN_WARNED
#endif
app_terminate = 1;

View File

@@ -6,5 +6,5 @@
while (!ws_executeLine(backbuffer,0));
while (!ws_executeLine(backbuffer,1));
totalFrames++;
//totalFrames++;

View File

@@ -1,4 +1,4 @@
endTime=clock();
float fps=totalFrames/(((float)(endTime-startTime))/(float)CLOCKS_PER_SEC);
//endTime=clock();
//float fps=totalFrames/(((float)(endTime-startTime))/(float)CLOCKS_PER_SEC);
console.close();
delete surface;

View File

@@ -759,14 +759,22 @@ void ws_gpu_renderScanline(int16 *framebuffer)
uint8 *ws_tileRow=ws_tileCache_getTileRow( tileInfo&0x1ff, lineInTile, tileInfo&0x8000, tileInfo&0x4000, tileInfo&0x2000);
int16 *wsc_paletteAlias=&wsc_palette[((tileInfo>>9)&0x0f)<<4];
if (*ws_tileRow) *scanlinePtr=wsc_paletteAlias[*ws_tileRow]; scanlinePtr++; ws_tileRow++;
if (*ws_tileRow) *scanlinePtr=wsc_paletteAlias[*ws_tileRow]; scanlinePtr++; ws_tileRow++;
if (*ws_tileRow) *scanlinePtr=wsc_paletteAlias[*ws_tileRow]; scanlinePtr++; ws_tileRow++;
if (*ws_tileRow) *scanlinePtr=wsc_paletteAlias[*ws_tileRow]; scanlinePtr++; ws_tileRow++;
if (*ws_tileRow) *scanlinePtr=wsc_paletteAlias[*ws_tileRow]; scanlinePtr++; ws_tileRow++;
if (*ws_tileRow) *scanlinePtr=wsc_paletteAlias[*ws_tileRow]; scanlinePtr++; ws_tileRow++;
if (*ws_tileRow) *scanlinePtr=wsc_paletteAlias[*ws_tileRow]; scanlinePtr++; ws_tileRow++;
if (*ws_tileRow) *scanlinePtr=wsc_paletteAlias[*ws_tileRow]; scanlinePtr++; ws_tileRow++;
if (*ws_tileRow) *scanlinePtr=wsc_paletteAlias[*ws_tileRow];
scanlinePtr++; ws_tileRow++;
if (*ws_tileRow) *scanlinePtr=wsc_paletteAlias[*ws_tileRow];
scanlinePtr++; ws_tileRow++;
if (*ws_tileRow) *scanlinePtr=wsc_paletteAlias[*ws_tileRow];
scanlinePtr++; ws_tileRow++;
if (*ws_tileRow) *scanlinePtr=wsc_paletteAlias[*ws_tileRow];
scanlinePtr++; ws_tileRow++;
if (*ws_tileRow) *scanlinePtr=wsc_paletteAlias[*ws_tileRow];
scanlinePtr++; ws_tileRow++;
if (*ws_tileRow) *scanlinePtr=wsc_paletteAlias[*ws_tileRow];
scanlinePtr++; ws_tileRow++;
if (*ws_tileRow) *scanlinePtr=wsc_paletteAlias[*ws_tileRow];
scanlinePtr++; ws_tileRow++;
if (*ws_tileRow) *scanlinePtr=wsc_paletteAlias[*ws_tileRow];
scanlinePtr++; ws_tileRow++;
}
// render the last clipped tile
@@ -835,25 +843,41 @@ void ws_gpu_renderScanline(int16 *framebuffer)
if ((tileInfo>>9)&0x04)
{
if (*ws_tileRow) *scanlinePtr=ws_shades[ws_paletteColors[ws_paletteAlias[*ws_tileRow]]]; scanlinePtr++; ws_tileRow++;
if (*ws_tileRow) *scanlinePtr=ws_shades[ws_paletteColors[ws_paletteAlias[*ws_tileRow]]]; scanlinePtr++; ws_tileRow++;
if (*ws_tileRow) *scanlinePtr=ws_shades[ws_paletteColors[ws_paletteAlias[*ws_tileRow]]]; scanlinePtr++; ws_tileRow++;
if (*ws_tileRow) *scanlinePtr=ws_shades[ws_paletteColors[ws_paletteAlias[*ws_tileRow]]]; scanlinePtr++; ws_tileRow++;
if (*ws_tileRow) *scanlinePtr=ws_shades[ws_paletteColors[ws_paletteAlias[*ws_tileRow]]]; scanlinePtr++; ws_tileRow++;
if (*ws_tileRow) *scanlinePtr=ws_shades[ws_paletteColors[ws_paletteAlias[*ws_tileRow]]]; scanlinePtr++; ws_tileRow++;
if (*ws_tileRow) *scanlinePtr=ws_shades[ws_paletteColors[ws_paletteAlias[*ws_tileRow]]]; scanlinePtr++; ws_tileRow++;
if (*ws_tileRow) *scanlinePtr=ws_shades[ws_paletteColors[ws_paletteAlias[*ws_tileRow]]]; scanlinePtr++; ws_tileRow++;
if (*ws_tileRow) *scanlinePtr=ws_shades[ws_paletteColors[ws_paletteAlias[*ws_tileRow]]];
scanlinePtr++; ws_tileRow++;
if (*ws_tileRow) *scanlinePtr=ws_shades[ws_paletteColors[ws_paletteAlias[*ws_tileRow]]];
scanlinePtr++; ws_tileRow++;
if (*ws_tileRow) *scanlinePtr=ws_shades[ws_paletteColors[ws_paletteAlias[*ws_tileRow]]];
scanlinePtr++; ws_tileRow++;
if (*ws_tileRow) *scanlinePtr=ws_shades[ws_paletteColors[ws_paletteAlias[*ws_tileRow]]];
scanlinePtr++; ws_tileRow++;
if (*ws_tileRow) *scanlinePtr=ws_shades[ws_paletteColors[ws_paletteAlias[*ws_tileRow]]];
scanlinePtr++; ws_tileRow++;
if (*ws_tileRow) *scanlinePtr=ws_shades[ws_paletteColors[ws_paletteAlias[*ws_tileRow]]];
scanlinePtr++; ws_tileRow++;
if (*ws_tileRow) *scanlinePtr=ws_shades[ws_paletteColors[ws_paletteAlias[*ws_tileRow]]];
scanlinePtr++; ws_tileRow++;
if (*ws_tileRow) *scanlinePtr=ws_shades[ws_paletteColors[ws_paletteAlias[*ws_tileRow]]];
scanlinePtr++; ws_tileRow++;
}
else
{
*scanlinePtr=ws_shades[ws_paletteColors[ws_paletteAlias[*ws_tileRow]]]; scanlinePtr++; ws_tileRow++;
*scanlinePtr=ws_shades[ws_paletteColors[ws_paletteAlias[*ws_tileRow]]]; scanlinePtr++; ws_tileRow++;
*scanlinePtr=ws_shades[ws_paletteColors[ws_paletteAlias[*ws_tileRow]]]; scanlinePtr++; ws_tileRow++;
*scanlinePtr=ws_shades[ws_paletteColors[ws_paletteAlias[*ws_tileRow]]]; scanlinePtr++; ws_tileRow++;
*scanlinePtr=ws_shades[ws_paletteColors[ws_paletteAlias[*ws_tileRow]]]; scanlinePtr++; ws_tileRow++;
*scanlinePtr=ws_shades[ws_paletteColors[ws_paletteAlias[*ws_tileRow]]]; scanlinePtr++; ws_tileRow++;
*scanlinePtr=ws_shades[ws_paletteColors[ws_paletteAlias[*ws_tileRow]]]; scanlinePtr++; ws_tileRow++;
*scanlinePtr=ws_shades[ws_paletteColors[ws_paletteAlias[*ws_tileRow]]]; scanlinePtr++; ws_tileRow++;
*scanlinePtr=ws_shades[ws_paletteColors[ws_paletteAlias[*ws_tileRow]]];
scanlinePtr++; ws_tileRow++;
*scanlinePtr=ws_shades[ws_paletteColors[ws_paletteAlias[*ws_tileRow]]];
scanlinePtr++; ws_tileRow++;
*scanlinePtr=ws_shades[ws_paletteColors[ws_paletteAlias[*ws_tileRow]]];
scanlinePtr++; ws_tileRow++;
*scanlinePtr=ws_shades[ws_paletteColors[ws_paletteAlias[*ws_tileRow]]];
scanlinePtr++; ws_tileRow++;
*scanlinePtr=ws_shades[ws_paletteColors[ws_paletteAlias[*ws_tileRow]]];
scanlinePtr++; ws_tileRow++;
*scanlinePtr=ws_shades[ws_paletteColors[ws_paletteAlias[*ws_tileRow]]];
scanlinePtr++; ws_tileRow++;
*scanlinePtr=ws_shades[ws_paletteColors[ws_paletteAlias[*ws_tileRow]]];
scanlinePtr++; ws_tileRow++;
*scanlinePtr=ws_shades[ws_paletteColors[ws_paletteAlias[*ws_tileRow]]];
scanlinePtr++; ws_tileRow++;
}
}
@@ -937,9 +961,9 @@ void ws_gpu_renderScanline(int16 *framebuffer)
if (ws_ioRam[0x00]&0x02)
{
int ws_fgWindow_x0=ws_ioRam[0x08];
int ws_fgWindow_y0=ws_ioRam[0x09];
//int ws_fgWindow_y0=ws_ioRam[0x09];
int ws_fgWindow_x1=ws_ioRam[0x0a];
int ws_fgWindow_y1=ws_ioRam[0x0b];
//int ws_fgWindow_y1=ws_ioRam[0x0b];
int ws_fgScroll_x=ws_ioRam[0x12];
int ws_fgScroll_y=ws_ioRam[0x13];
@@ -998,14 +1022,22 @@ void ws_gpu_renderScanline(int16 *framebuffer)
int16 *wsc_paletteAlias=&wsc_palette[((tileInfo>>9)&0x0f)<<4];
if (*ws_tileRow) *scanlinePtr=wsc_paletteAlias[*ws_tileRow]; scanlinePtr++; ws_tileRow++;
if (*ws_tileRow) *scanlinePtr=wsc_paletteAlias[*ws_tileRow]; scanlinePtr++; ws_tileRow++;
if (*ws_tileRow) *scanlinePtr=wsc_paletteAlias[*ws_tileRow]; scanlinePtr++; ws_tileRow++;
if (*ws_tileRow) *scanlinePtr=wsc_paletteAlias[*ws_tileRow]; scanlinePtr++; ws_tileRow++;
if (*ws_tileRow) *scanlinePtr=wsc_paletteAlias[*ws_tileRow]; scanlinePtr++; ws_tileRow++;
if (*ws_tileRow) *scanlinePtr=wsc_paletteAlias[*ws_tileRow]; scanlinePtr++; ws_tileRow++;
if (*ws_tileRow) *scanlinePtr=wsc_paletteAlias[*ws_tileRow]; scanlinePtr++; ws_tileRow++;
if (*ws_tileRow) *scanlinePtr=wsc_paletteAlias[*ws_tileRow]; scanlinePtr++; ws_tileRow++;
if (*ws_tileRow) *scanlinePtr=wsc_paletteAlias[*ws_tileRow];
scanlinePtr++; ws_tileRow++;
if (*ws_tileRow) *scanlinePtr=wsc_paletteAlias[*ws_tileRow];
scanlinePtr++; ws_tileRow++;
if (*ws_tileRow) *scanlinePtr=wsc_paletteAlias[*ws_tileRow];
scanlinePtr++; ws_tileRow++;
if (*ws_tileRow) *scanlinePtr=wsc_paletteAlias[*ws_tileRow];
scanlinePtr++; ws_tileRow++;
if (*ws_tileRow) *scanlinePtr=wsc_paletteAlias[*ws_tileRow];
scanlinePtr++; ws_tileRow++;
if (*ws_tileRow) *scanlinePtr=wsc_paletteAlias[*ws_tileRow];
scanlinePtr++; ws_tileRow++;
if (*ws_tileRow) *scanlinePtr=wsc_paletteAlias[*ws_tileRow];
scanlinePtr++; ws_tileRow++;
if (*ws_tileRow) *scanlinePtr=wsc_paletteAlias[*ws_tileRow];
scanlinePtr++; ws_tileRow++;
}
// render the last clipped tile
@@ -1073,25 +1105,41 @@ void ws_gpu_renderScanline(int16 *framebuffer)
if ((tileInfo>>9)&0x04)
{
if (*ws_tileRow) *scanlinePtr=ws_shades[ws_paletteColors[ws_paletteAlias[*ws_tileRow]]]; scanlinePtr++; ws_tileRow++;
if (*ws_tileRow) *scanlinePtr=ws_shades[ws_paletteColors[ws_paletteAlias[*ws_tileRow]]]; scanlinePtr++; ws_tileRow++;
if (*ws_tileRow) *scanlinePtr=ws_shades[ws_paletteColors[ws_paletteAlias[*ws_tileRow]]]; scanlinePtr++; ws_tileRow++;
if (*ws_tileRow) *scanlinePtr=ws_shades[ws_paletteColors[ws_paletteAlias[*ws_tileRow]]]; scanlinePtr++; ws_tileRow++;
if (*ws_tileRow) *scanlinePtr=ws_shades[ws_paletteColors[ws_paletteAlias[*ws_tileRow]]]; scanlinePtr++; ws_tileRow++;
if (*ws_tileRow) *scanlinePtr=ws_shades[ws_paletteColors[ws_paletteAlias[*ws_tileRow]]]; scanlinePtr++; ws_tileRow++;
if (*ws_tileRow) *scanlinePtr=ws_shades[ws_paletteColors[ws_paletteAlias[*ws_tileRow]]]; scanlinePtr++; ws_tileRow++;
if (*ws_tileRow) *scanlinePtr=ws_shades[ws_paletteColors[ws_paletteAlias[*ws_tileRow]]]; scanlinePtr++; ws_tileRow++;
if (*ws_tileRow) *scanlinePtr=ws_shades[ws_paletteColors[ws_paletteAlias[*ws_tileRow]]];
scanlinePtr++; ws_tileRow++;
if (*ws_tileRow) *scanlinePtr=ws_shades[ws_paletteColors[ws_paletteAlias[*ws_tileRow]]];
scanlinePtr++; ws_tileRow++;
if (*ws_tileRow) *scanlinePtr=ws_shades[ws_paletteColors[ws_paletteAlias[*ws_tileRow]]];
scanlinePtr++; ws_tileRow++;
if (*ws_tileRow) *scanlinePtr=ws_shades[ws_paletteColors[ws_paletteAlias[*ws_tileRow]]];
scanlinePtr++; ws_tileRow++;
if (*ws_tileRow) *scanlinePtr=ws_shades[ws_paletteColors[ws_paletteAlias[*ws_tileRow]]];
scanlinePtr++; ws_tileRow++;
if (*ws_tileRow) *scanlinePtr=ws_shades[ws_paletteColors[ws_paletteAlias[*ws_tileRow]]];
scanlinePtr++; ws_tileRow++;
if (*ws_tileRow) *scanlinePtr=ws_shades[ws_paletteColors[ws_paletteAlias[*ws_tileRow]]];
scanlinePtr++; ws_tileRow++;
if (*ws_tileRow) *scanlinePtr=ws_shades[ws_paletteColors[ws_paletteAlias[*ws_tileRow]]];
scanlinePtr++; ws_tileRow++;
}
else
{
*scanlinePtr=ws_shades[ws_paletteColors[ws_paletteAlias[*ws_tileRow]]]; scanlinePtr++; ws_tileRow++;
*scanlinePtr=ws_shades[ws_paletteColors[ws_paletteAlias[*ws_tileRow]]]; scanlinePtr++; ws_tileRow++;
*scanlinePtr=ws_shades[ws_paletteColors[ws_paletteAlias[*ws_tileRow]]]; scanlinePtr++; ws_tileRow++;
*scanlinePtr=ws_shades[ws_paletteColors[ws_paletteAlias[*ws_tileRow]]]; scanlinePtr++; ws_tileRow++;
*scanlinePtr=ws_shades[ws_paletteColors[ws_paletteAlias[*ws_tileRow]]]; scanlinePtr++; ws_tileRow++;
*scanlinePtr=ws_shades[ws_paletteColors[ws_paletteAlias[*ws_tileRow]]]; scanlinePtr++; ws_tileRow++;
*scanlinePtr=ws_shades[ws_paletteColors[ws_paletteAlias[*ws_tileRow]]]; scanlinePtr++; ws_tileRow++;
*scanlinePtr=ws_shades[ws_paletteColors[ws_paletteAlias[*ws_tileRow]]]; scanlinePtr++; ws_tileRow++;
*scanlinePtr=ws_shades[ws_paletteColors[ws_paletteAlias[*ws_tileRow]]];
scanlinePtr++; ws_tileRow++;
*scanlinePtr=ws_shades[ws_paletteColors[ws_paletteAlias[*ws_tileRow]]];
scanlinePtr++; ws_tileRow++;
*scanlinePtr=ws_shades[ws_paletteColors[ws_paletteAlias[*ws_tileRow]]];
scanlinePtr++; ws_tileRow++;
*scanlinePtr=ws_shades[ws_paletteColors[ws_paletteAlias[*ws_tileRow]]];
scanlinePtr++; ws_tileRow++;
*scanlinePtr=ws_shades[ws_paletteColors[ws_paletteAlias[*ws_tileRow]]];
scanlinePtr++; ws_tileRow++;
*scanlinePtr=ws_shades[ws_paletteColors[ws_paletteAlias[*ws_tileRow]]];
scanlinePtr++; ws_tileRow++;
*scanlinePtr=ws_shades[ws_paletteColors[ws_paletteAlias[*ws_tileRow]]];
scanlinePtr++; ws_tileRow++;
*scanlinePtr=ws_shades[ws_paletteColors[ws_paletteAlias[*ws_tileRow]]];
scanlinePtr++; ws_tileRow++;
}
}
@@ -1170,14 +1218,22 @@ void ws_gpu_renderScanline(int16 *framebuffer)
if ((*ws_tileRow)&&(column>=ws_fgWindow_x0)&&(column<=ws_fgWindow_x1)) *scanlinePtr=wsc_paletteAlias[*ws_tileRow]; scanlinePtr++; ws_tileRow++; column++;
if ((*ws_tileRow)&&(column>=ws_fgWindow_x0)&&(column<=ws_fgWindow_x1)) *scanlinePtr=wsc_paletteAlias[*ws_tileRow]; scanlinePtr++; ws_tileRow++; column++;
if ((*ws_tileRow)&&(column>=ws_fgWindow_x0)&&(column<=ws_fgWindow_x1)) *scanlinePtr=wsc_paletteAlias[*ws_tileRow]; scanlinePtr++; ws_tileRow++; column++;
if ((*ws_tileRow)&&(column>=ws_fgWindow_x0)&&(column<=ws_fgWindow_x1)) *scanlinePtr=wsc_paletteAlias[*ws_tileRow]; scanlinePtr++; ws_tileRow++; column++;
if ((*ws_tileRow)&&(column>=ws_fgWindow_x0)&&(column<=ws_fgWindow_x1)) *scanlinePtr=wsc_paletteAlias[*ws_tileRow]; scanlinePtr++; ws_tileRow++; column++;
if ((*ws_tileRow)&&(column>=ws_fgWindow_x0)&&(column<=ws_fgWindow_x1)) *scanlinePtr=wsc_paletteAlias[*ws_tileRow]; scanlinePtr++; ws_tileRow++; column++;
if ((*ws_tileRow)&&(column>=ws_fgWindow_x0)&&(column<=ws_fgWindow_x1)) *scanlinePtr=wsc_paletteAlias[*ws_tileRow]; scanlinePtr++; ws_tileRow++; column++;
if ((*ws_tileRow)&&(column>=ws_fgWindow_x0)&&(column<=ws_fgWindow_x1)) *scanlinePtr=wsc_paletteAlias[*ws_tileRow]; scanlinePtr++; ws_tileRow++; column++;
if ((*ws_tileRow)&&(column>=ws_fgWindow_x0)&&(column<=ws_fgWindow_x1)) *scanlinePtr=wsc_paletteAlias[*ws_tileRow];
scanlinePtr++; ws_tileRow++; column++;
if ((*ws_tileRow)&&(column>=ws_fgWindow_x0)&&(column<=ws_fgWindow_x1)) *scanlinePtr=wsc_paletteAlias[*ws_tileRow];
scanlinePtr++; ws_tileRow++; column++;
if ((*ws_tileRow)&&(column>=ws_fgWindow_x0)&&(column<=ws_fgWindow_x1)) *scanlinePtr=wsc_paletteAlias[*ws_tileRow];
scanlinePtr++; ws_tileRow++; column++;
if ((*ws_tileRow)&&(column>=ws_fgWindow_x0)&&(column<=ws_fgWindow_x1)) *scanlinePtr=wsc_paletteAlias[*ws_tileRow];
scanlinePtr++; ws_tileRow++; column++;
if ((*ws_tileRow)&&(column>=ws_fgWindow_x0)&&(column<=ws_fgWindow_x1)) *scanlinePtr=wsc_paletteAlias[*ws_tileRow];
scanlinePtr++; ws_tileRow++; column++;
if ((*ws_tileRow)&&(column>=ws_fgWindow_x0)&&(column<=ws_fgWindow_x1)) *scanlinePtr=wsc_paletteAlias[*ws_tileRow];
scanlinePtr++; ws_tileRow++; column++;
if ((*ws_tileRow)&&(column>=ws_fgWindow_x0)&&(column<=ws_fgWindow_x1)) *scanlinePtr=wsc_paletteAlias[*ws_tileRow];
scanlinePtr++; ws_tileRow++; column++;
if ((*ws_tileRow)&&(column>=ws_fgWindow_x0)&&(column<=ws_fgWindow_x1)) *scanlinePtr=wsc_paletteAlias[*ws_tileRow];
scanlinePtr++; ws_tileRow++; column++;
}
// render the last clipped tile
@@ -1235,14 +1291,22 @@ void ws_gpu_renderScanline(int16 *framebuffer)
int16 *ws_paletteAlias=&ws_palette[((tileInfo>>9)&0x0f)<<2];
if ((*ws_tileRow)&&(column>=ws_fgWindow_x0)&&(column<=ws_fgWindow_x1)) *scanlinePtr=ws_shades[ws_paletteColors[ws_paletteAlias[*ws_tileRow]]]; scanlinePtr++; ws_tileRow++; column++;
if ((*ws_tileRow)&&(column>=ws_fgWindow_x0)&&(column<=ws_fgWindow_x1)) *scanlinePtr=ws_shades[ws_paletteColors[ws_paletteAlias[*ws_tileRow]]]; scanlinePtr++; ws_tileRow++; column++;
if ((*ws_tileRow)&&(column>=ws_fgWindow_x0)&&(column<=ws_fgWindow_x1)) *scanlinePtr=ws_shades[ws_paletteColors[ws_paletteAlias[*ws_tileRow]]]; scanlinePtr++; ws_tileRow++; column++;
if ((*ws_tileRow)&&(column>=ws_fgWindow_x0)&&(column<=ws_fgWindow_x1)) *scanlinePtr=ws_shades[ws_paletteColors[ws_paletteAlias[*ws_tileRow]]]; scanlinePtr++; ws_tileRow++; column++;
if ((*ws_tileRow)&&(column>=ws_fgWindow_x0)&&(column<=ws_fgWindow_x1)) *scanlinePtr=ws_shades[ws_paletteColors[ws_paletteAlias[*ws_tileRow]]]; scanlinePtr++; ws_tileRow++; column++;
if ((*ws_tileRow)&&(column>=ws_fgWindow_x0)&&(column<=ws_fgWindow_x1)) *scanlinePtr=ws_shades[ws_paletteColors[ws_paletteAlias[*ws_tileRow]]]; scanlinePtr++; ws_tileRow++; column++;
if ((*ws_tileRow)&&(column>=ws_fgWindow_x0)&&(column<=ws_fgWindow_x1)) *scanlinePtr=ws_shades[ws_paletteColors[ws_paletteAlias[*ws_tileRow]]]; scanlinePtr++; ws_tileRow++; column++;
if ((*ws_tileRow)&&(column>=ws_fgWindow_x0)&&(column<=ws_fgWindow_x1)) *scanlinePtr=ws_shades[ws_paletteColors[ws_paletteAlias[*ws_tileRow]]]; scanlinePtr++; ws_tileRow++; column++;
if ((*ws_tileRow)&&(column>=ws_fgWindow_x0)&&(column<=ws_fgWindow_x1)) *scanlinePtr=ws_shades[ws_paletteColors[ws_paletteAlias[*ws_tileRow]]];
scanlinePtr++; ws_tileRow++; column++;
if ((*ws_tileRow)&&(column>=ws_fgWindow_x0)&&(column<=ws_fgWindow_x1)) *scanlinePtr=ws_shades[ws_paletteColors[ws_paletteAlias[*ws_tileRow]]];
scanlinePtr++; ws_tileRow++; column++;
if ((*ws_tileRow)&&(column>=ws_fgWindow_x0)&&(column<=ws_fgWindow_x1)) *scanlinePtr=ws_shades[ws_paletteColors[ws_paletteAlias[*ws_tileRow]]];
scanlinePtr++; ws_tileRow++; column++;
if ((*ws_tileRow)&&(column>=ws_fgWindow_x0)&&(column<=ws_fgWindow_x1)) *scanlinePtr=ws_shades[ws_paletteColors[ws_paletteAlias[*ws_tileRow]]];
scanlinePtr++; ws_tileRow++; column++;
if ((*ws_tileRow)&&(column>=ws_fgWindow_x0)&&(column<=ws_fgWindow_x1)) *scanlinePtr=ws_shades[ws_paletteColors[ws_paletteAlias[*ws_tileRow]]];
scanlinePtr++; ws_tileRow++; column++;
if ((*ws_tileRow)&&(column>=ws_fgWindow_x0)&&(column<=ws_fgWindow_x1)) *scanlinePtr=ws_shades[ws_paletteColors[ws_paletteAlias[*ws_tileRow]]];
scanlinePtr++; ws_tileRow++; column++;
if ((*ws_tileRow)&&(column>=ws_fgWindow_x0)&&(column<=ws_fgWindow_x1)) *scanlinePtr=ws_shades[ws_paletteColors[ws_paletteAlias[*ws_tileRow]]];
scanlinePtr++; ws_tileRow++; column++;
if ((*ws_tileRow)&&(column>=ws_fgWindow_x0)&&(column<=ws_fgWindow_x1)) *scanlinePtr=ws_shades[ws_paletteColors[ws_paletteAlias[*ws_tileRow]]];
scanlinePtr++; ws_tileRow++; column++;
}
// render the last clipped tile
@@ -1309,14 +1373,22 @@ void ws_gpu_renderScanline(int16 *framebuffer)
if ((*ws_tileRow)&&((column<ws_fgWindow_x0)||(column>ws_fgWindow_x1))) *scanlinePtr=wsc_paletteAlias[*ws_tileRow]; scanlinePtr++; ws_tileRow++; column++;
if ((*ws_tileRow)&&((column<ws_fgWindow_x0)||(column>ws_fgWindow_x1))) *scanlinePtr=wsc_paletteAlias[*ws_tileRow]; scanlinePtr++; ws_tileRow++; column++;
if ((*ws_tileRow)&&((column<ws_fgWindow_x0)||(column>ws_fgWindow_x1))) *scanlinePtr=wsc_paletteAlias[*ws_tileRow]; scanlinePtr++; ws_tileRow++; column++;
if ((*ws_tileRow)&&((column<ws_fgWindow_x0)||(column>ws_fgWindow_x1))) *scanlinePtr=wsc_paletteAlias[*ws_tileRow]; scanlinePtr++; ws_tileRow++; column++;
if ((*ws_tileRow)&&((column<ws_fgWindow_x0)||(column>ws_fgWindow_x1))) *scanlinePtr=wsc_paletteAlias[*ws_tileRow]; scanlinePtr++; ws_tileRow++; column++;
if ((*ws_tileRow)&&((column<ws_fgWindow_x0)||(column>ws_fgWindow_x1))) *scanlinePtr=wsc_paletteAlias[*ws_tileRow]; scanlinePtr++; ws_tileRow++; column++;
if ((*ws_tileRow)&&((column<ws_fgWindow_x0)||(column>ws_fgWindow_x1))) *scanlinePtr=wsc_paletteAlias[*ws_tileRow]; scanlinePtr++; ws_tileRow++; column++;
if ((*ws_tileRow)&&((column<ws_fgWindow_x0)||(column>ws_fgWindow_x1))) *scanlinePtr=wsc_paletteAlias[*ws_tileRow]; scanlinePtr++; ws_tileRow++; column++;
if ((*ws_tileRow)&&((column<ws_fgWindow_x0)||(column>ws_fgWindow_x1))) *scanlinePtr=wsc_paletteAlias[*ws_tileRow];
scanlinePtr++; ws_tileRow++; column++;
if ((*ws_tileRow)&&((column<ws_fgWindow_x0)||(column>ws_fgWindow_x1))) *scanlinePtr=wsc_paletteAlias[*ws_tileRow];
scanlinePtr++; ws_tileRow++; column++;
if ((*ws_tileRow)&&((column<ws_fgWindow_x0)||(column>ws_fgWindow_x1))) *scanlinePtr=wsc_paletteAlias[*ws_tileRow];
scanlinePtr++; ws_tileRow++; column++;
if ((*ws_tileRow)&&((column<ws_fgWindow_x0)||(column>ws_fgWindow_x1))) *scanlinePtr=wsc_paletteAlias[*ws_tileRow];
scanlinePtr++; ws_tileRow++; column++;
if ((*ws_tileRow)&&((column<ws_fgWindow_x0)||(column>ws_fgWindow_x1))) *scanlinePtr=wsc_paletteAlias[*ws_tileRow];
scanlinePtr++; ws_tileRow++; column++;
if ((*ws_tileRow)&&((column<ws_fgWindow_x0)||(column>ws_fgWindow_x1))) *scanlinePtr=wsc_paletteAlias[*ws_tileRow];
scanlinePtr++; ws_tileRow++; column++;
if ((*ws_tileRow)&&((column<ws_fgWindow_x0)||(column>ws_fgWindow_x1))) *scanlinePtr=wsc_paletteAlias[*ws_tileRow];
scanlinePtr++; ws_tileRow++; column++;
if ((*ws_tileRow)&&((column<ws_fgWindow_x0)||(column>ws_fgWindow_x1))) *scanlinePtr=wsc_paletteAlias[*ws_tileRow];
scanlinePtr++; ws_tileRow++; column++;
}
// render the last clipped tile
@@ -1372,14 +1444,22 @@ void ws_gpu_renderScanline(int16 *framebuffer)
uint8 *ws_tileRow=ws_tileCache_getTileRow( tileInfo&0x1ff, lineInTile, tileInfo&0x8000, tileInfo&0x4000, tileInfo&0x2000);
int16 *ws_paletteAlias=&ws_palette[((tileInfo>>9)&0x0f)<<2];
if ((*ws_tileRow)&&((column<ws_fgWindow_x0)||(column>ws_fgWindow_x1))) *scanlinePtr=ws_shades[ws_paletteColors[ws_paletteAlias[*ws_tileRow]]]; scanlinePtr++; ws_tileRow++; column++;
if ((*ws_tileRow)&&((column<ws_fgWindow_x0)||(column>ws_fgWindow_x1))) *scanlinePtr=ws_shades[ws_paletteColors[ws_paletteAlias[*ws_tileRow]]]; scanlinePtr++; ws_tileRow++; column++;
if ((*ws_tileRow)&&((column<ws_fgWindow_x0)||(column>ws_fgWindow_x1))) *scanlinePtr=ws_shades[ws_paletteColors[ws_paletteAlias[*ws_tileRow]]]; scanlinePtr++; ws_tileRow++; column++;
if ((*ws_tileRow)&&((column<ws_fgWindow_x0)||(column>ws_fgWindow_x1))) *scanlinePtr=ws_shades[ws_paletteColors[ws_paletteAlias[*ws_tileRow]]]; scanlinePtr++; ws_tileRow++; column++;
if ((*ws_tileRow)&&((column<ws_fgWindow_x0)||(column>ws_fgWindow_x1))) *scanlinePtr=ws_shades[ws_paletteColors[ws_paletteAlias[*ws_tileRow]]]; scanlinePtr++; ws_tileRow++; column++;
if ((*ws_tileRow)&&((column<ws_fgWindow_x0)||(column>ws_fgWindow_x1))) *scanlinePtr=ws_shades[ws_paletteColors[ws_paletteAlias[*ws_tileRow]]]; scanlinePtr++; ws_tileRow++; column++;
if ((*ws_tileRow)&&((column<ws_fgWindow_x0)||(column>ws_fgWindow_x1))) *scanlinePtr=ws_shades[ws_paletteColors[ws_paletteAlias[*ws_tileRow]]]; scanlinePtr++; ws_tileRow++; column++;
if ((*ws_tileRow)&&((column<ws_fgWindow_x0)||(column>ws_fgWindow_x1))) *scanlinePtr=ws_shades[ws_paletteColors[ws_paletteAlias[*ws_tileRow]]]; scanlinePtr++; ws_tileRow++; column++;
if ((*ws_tileRow)&&((column<ws_fgWindow_x0)||(column>ws_fgWindow_x1))) *scanlinePtr=ws_shades[ws_paletteColors[ws_paletteAlias[*ws_tileRow]]];
scanlinePtr++; ws_tileRow++; column++;
if ((*ws_tileRow)&&((column<ws_fgWindow_x0)||(column>ws_fgWindow_x1))) *scanlinePtr=ws_shades[ws_paletteColors[ws_paletteAlias[*ws_tileRow]]];
scanlinePtr++; ws_tileRow++; column++;
if ((*ws_tileRow)&&((column<ws_fgWindow_x0)||(column>ws_fgWindow_x1))) *scanlinePtr=ws_shades[ws_paletteColors[ws_paletteAlias[*ws_tileRow]]];
scanlinePtr++; ws_tileRow++; column++;
if ((*ws_tileRow)&&((column<ws_fgWindow_x0)||(column>ws_fgWindow_x1))) *scanlinePtr=ws_shades[ws_paletteColors[ws_paletteAlias[*ws_tileRow]]];
scanlinePtr++; ws_tileRow++; column++;
if ((*ws_tileRow)&&((column<ws_fgWindow_x0)||(column>ws_fgWindow_x1))) *scanlinePtr=ws_shades[ws_paletteColors[ws_paletteAlias[*ws_tileRow]]];
scanlinePtr++; ws_tileRow++; column++;
if ((*ws_tileRow)&&((column<ws_fgWindow_x0)||(column>ws_fgWindow_x1))) *scanlinePtr=ws_shades[ws_paletteColors[ws_paletteAlias[*ws_tileRow]]];
scanlinePtr++; ws_tileRow++; column++;
if ((*ws_tileRow)&&((column<ws_fgWindow_x0)||(column>ws_fgWindow_x1))) *scanlinePtr=ws_shades[ws_paletteColors[ws_paletteAlias[*ws_tileRow]]];
scanlinePtr++; ws_tileRow++; column++;
if ((*ws_tileRow)&&((column<ws_fgWindow_x0)||(column>ws_fgWindow_x1))) *scanlinePtr=ws_shades[ws_paletteColors[ws_paletteAlias[*ws_tileRow]]];
scanlinePtr++; ws_tileRow++; column++;
}
// render the last clipped tile

File diff suppressed because it is too large Load Diff

View File

@@ -65,7 +65,7 @@ void ws_io_reset(void)
ws_key_button_2=0;
int i;
for (i=0;i<0x100;i++)
ws_ioRam[i]=initialIoValue[i];
ws_ioRam[i]= initialIoValue[i];
for (i=0;i<0xc9;i++)
cpu_writeport(i,initialIoValue[i]);
@@ -162,8 +162,11 @@ void set_baudrate(int speed)
{
cfsetospeed(&options, B38400);
}
#if 0
options.c_cflag &= ~CNEW_RTSCTS;
#else
options.c_cflag &= ~CRTSCTS;
#endif
options.c_cflag |= (CLOCAL | CREAD);
options.c_lflag &= ~(ICANON | ECHO | ECHOE | ISIG);
@@ -254,9 +257,9 @@ void write_serial(unsigned char value)
BYTE cpu_readport(BYTE port)
{
int w1,w2;
BYTE retVal;
BYTE retVal = 0;
if (port >= 0xBA) && (port <= 0xBE)
if ((port >= 0xBA) && (port <= 0xBE))
{
printf("Reading IEEP %02X\n", port);
}
@@ -453,7 +456,8 @@ BYTE cpu_readport(BYTE port)
goto exit;
default:
if (port > 0xD0) printf("ReadIO %02X <= %02X\n", port, retVal);
if (port > 0xD0)
printf("ReadIO %02X <= %02X\n", port, retVal);
break;
}
@@ -475,11 +479,11 @@ exit:
////////////////////////////////////////////////////////////////////////////////
void cpu_writeport(DWORD port,BYTE value)
{
unsigned short F0dbg = 0;
int w1,w2;
//unsigned short F0dbg = 0;
int w1; //,w2;
int unknown_io_port=0;
if (port >= 0xBA) && (port <= 0xBE)
if ((port >= 0xBA) && (port <= 0xBE))
{
printf("Writing IEEP %02X <= %02X\n", port, value);
}
@@ -696,6 +700,8 @@ void cpu_writeport(DWORD port,BYTE value)
case 0xF1: printf("%d\n", (signed short)((value << 8) | ws_ioRam[0xF0])); break;
case 0xF2: printf("%c", value); fflush(stdout); break;
case 0xB7: break; /* Somwthing to write there, but what? */
default:
unknown_io_port=1;
}

View File

@@ -74,9 +74,9 @@ void dump_memory()
fp = fopen("memorydump.bin", "wb");
fwrite(internalRam, 1, 0x10000, fp);
/* page 1 */
fwrite(&(ws_staticRam[sramAddressMask]), 1, 0x10000, fp);
fwrite(&(ws_staticRam[0 & sramAddressMask]), 1, 0x10000, fp);
fwrite(&(ws_rom[((ws_ioRam[IO_ROM_BANK_BASE_SELECTOR+2]&((romSize>>16)-1))<<16)]), 1, 0x10000, fp);
fwrite(&(ws_rom[((ws_ioRam[IO_ROM_BANK_BASE_SELECTOR+3]&((romSize>>16)-1))<<16)]), 1, 0x10000, fp);
fwrite(&(ws_rom[((ws_ioRam[IO_ROM_BANK_BASE_SELECTOR+3]&((romSize>>16)-1))<<16)]), 1, 0x10000, fp);
for(i = 4; i < 0x10; i++)
{
int romBank=(256-(((ws_ioRam[IO_ROM_BANK_BASE_SELECTOR]&0xf)<<4)|(i&0xf)));
@@ -274,7 +274,7 @@ uint16 memory_getRomCrc(void)
void ws_sram_load(char *path)
{
FILE *f;
size_t read;
//size_t read;
f = fopen(path, "r");
if (NULL == f)
@@ -283,7 +283,7 @@ void ws_sram_load(char *path)
return;
}
read = fread(ws_staticRam, 1, 0x8000, f);
/*read = */fread(ws_staticRam, 1, 0x8000, f);
//fprintf(log_get(), "read 0x%x (of 0x%x?) bytes of save ram from %s\n", read, ws_rom_sramSize(ws_rom, romSize), path);
fclose(f);
}
@@ -291,7 +291,7 @@ void ws_sram_load(char *path)
void ws_sram_save(char *path)
{
FILE *f;
size_t wrote;
//size_t wrote;
f = fopen(path, "wb");
if (NULL == f)
@@ -300,7 +300,7 @@ void ws_sram_save(char *path)
return;
}
wrote = fwrite(ws_staticRam, 1, 0x8000, f);
/*wrote = */fwrite(ws_staticRam, 1, 0x8000, f);
fflush(f);
//fprintf(log_get(), "wrote 0x%x bytes of save ram to %s\n", wrote, path);
fclose(f);

View File

@@ -132,11 +132,11 @@ void nec_int(DWORD wektor)
}
}
static void nec_interrupt(unsigned int_num, /*BOOLEAN*/ int md_flag)
static void nec_interrupt(uint32_t int_num, /*BOOLEAN*/ int md_flag)
{
UINT32 dest_seg, dest_off;
if (int_num == -1)
if (int_num == UINT32_MAX)
return;
i_pushf();
@@ -303,7 +303,7 @@ OP( 0x5e, i_pop_si ) { POP(I.regs.w[IX]); CLK(1); }
OP( 0x5f, i_pop_di ) { POP(I.regs.w[IY]); CLK(1); }
OP( 0x60, i_pusha ) {
unsigned tmp=I.regs.w[SP];
uint32_t tmp=I.regs.w[SP];
PUSH(I.regs.w[AW]);
PUSH(I.regs.w[CW]);
PUSH(I.regs.w[DW]);
@@ -315,7 +315,7 @@ OP( 0x60, i_pusha ) {
CLK(9);
}
OP( 0x61, i_popa ) {
unsigned tmp;
uint32_t tmp;
POP(I.regs.w[IY]);
POP(I.regs.w[IX]);
POP(I.regs.w[BP]);
@@ -324,6 +324,7 @@ OP( 0x61, i_popa ) {
POP(I.regs.w[DW]);
POP(I.regs.w[CW]);
POP(I.regs.w[AW]);
(void)tmp; // We need to uppop something and need tmp
CLK(8);
}
OP( 0x62, i_chkind ) {
@@ -560,7 +561,7 @@ OP( 0xbf, i_mov_did16 ) { I.regs.b[IYL] = FETCH; I.regs.b[IYH] = FETCH; CLK(1);
OP( 0xc0, i_rotshft_bd8 ) {
UINT32 src, dst; UINT8 c;
GetModRM; src = (unsigned)GetRMByte(ModRM); dst=src;
GetModRM; src = (uint32_t)GetRMByte(ModRM); dst=src;
c=FETCH;
c&=0x1f;
CLKM(5,3);
@@ -578,7 +579,7 @@ OP( 0xc0, i_rotshft_bd8 ) {
OP( 0xc1, i_rotshft_wd8 ) {
UINT32 src, dst; UINT8 c;
GetModRM; src = (unsigned)GetRMWord(ModRM); dst=src;
GetModRM; src = (uint32_t)GetRMWord(ModRM); dst=src;
c=FETCH;
c&=0x1f;
CLKM(5,3);
@@ -693,11 +694,11 @@ OP( 0xd3, i_rotshft_wcl ) {
}
}
OP( 0xd4, i_aam ) { UINT32 mult=FETCH; mult=0; I.regs.b[AH] = I.regs.b[AL] / 10; I.regs.b[AL] %= 10; SetSZPF_Word(I.regs.w[AW]); CLK(17); }
OP( 0xd5, i_aad ) { UINT32 mult=FETCH; mult=0; I.regs.b[AL] = I.regs.b[AH] * 10 + I.regs.b[AL]; I.regs.b[AH] = 0; SetSZPF_Byte(I.regs.b[AL]); CLK(6); }
OP( 0xd4, i_aam ) { /*UINT32 mult=FETCH; mult=0;*/ I.regs.b[AH] = I.regs.b[AL] / 10; I.regs.b[AL] %= 10; SetSZPF_Word(I.regs.w[AW]); CLK(17); }
OP( 0xd5, i_aad ) { /*UINT32 mult=FETCH; mult=0;*/ I.regs.b[AL] = I.regs.b[AH] * 10 + I.regs.b[AL]; I.regs.b[AH] = 0; SetSZPF_Byte(I.regs.b[AL]); CLK(6); }
OP( 0xd6, i_setalc ) { I.regs.b[AL] = (CF)?0xff:0x00; CLK(3); } /* nop at V30MZ? */
OP( 0xd7, i_trans ) { UINT32 dest = (I.regs.w[BW]+I.regs.b[AL])&0xffff; I.regs.b[AL] = GetMemB(DS, dest); CLK(5); }
OP( 0xd8, i_fpo ) { GetModRM; CLK(3); } /* nop at V30MZ? */
OP( 0xd8, i_fpo ) { /*GetModRM;*/ CLK(3); } /* nop at V30MZ? */
OP( 0xe0, i_loopne ) { INT8 disp = (INT8)FETCH; I.regs.w[CW]--; if (!ZF && I.regs.w[CW]) { I.ip = (WORD)(I.ip+disp); CLK(6); } else CLK(3); }
OP( 0xe1, i_loope ) { INT8 disp = (INT8)FETCH; I.regs.w[CW]--; if ( ZF && I.regs.w[CW]) { I.ip = (WORD)(I.ip+disp); CLK(6); } else CLK(3); }
@@ -852,7 +853,7 @@ static void i_invalid(void)
/*****************************************************************************/
unsigned nec_get_reg(int regnum)
uint32_t nec_get_reg(int regnum)
{
switch( regnum )
{
@@ -880,7 +881,7 @@ unsigned nec_get_reg(int regnum)
void nec_set_irq_line(int irqline, int state);
void nec_set_reg(int regnum, unsigned val)
void nec_set_reg(int regnum, uint32_t val)
{
switch( regnum )
{

View File

@@ -23,7 +23,7 @@ typedef struct
UINT16 ip;
INT32 SignVal;
UINT32 AuxVal, OverVal, ZeroVal, CarryVal, ParityVal; /* 0 or non-0 valued flags */
INT32 AuxVal, OverVal, ZeroVal, CarryVal, ParityVal; /* 0 or non-0 valued flags */
UINT8 TF, IF, DF, MF; /* 0 or 1 valued flags */ /* OB[19.07.99] added Mode Flag V30 */
UINT32 int_vector;
UINT32 pending_irq;
@@ -172,8 +172,8 @@ typedef struct
#define IncWordReg(Reg) \
unsigned tmp = (unsigned)I.regs.w[Reg]; \
unsigned tmp1 = tmp+1; \
uint16_t tmp = (uint16_t)I.regs.w[Reg]; \
uint16_t tmp1 = tmp+1; \
I.OverVal = (tmp == 0x7fff); \
SetAF(tmp1,tmp,1); \
SetSZPF_Word(tmp1); \
@@ -182,8 +182,8 @@ typedef struct
#define DecWordReg(Reg) \
unsigned tmp = (unsigned)I.regs.w[Reg]; \
unsigned tmp1 = tmp-1; \
uint16_t tmp = (uint16_t)I.regs.w[Reg]; \
uint16_t tmp1 = tmp-1; \
I.OverVal = (tmp == 0x8000); \
SetAF(tmp1,tmp,1); \
SetSZPF_Word(tmp1); \
@@ -317,8 +317,8 @@ typedef struct
#define ADD4S { \
int i,v1,v2,result; \
int count = (I.regs.b[CL]+1)/2; \
unsigned di = I.regs.w[IY]; \
unsigned si = I.regs.w[IX]; \
uint16_t di = I.regs.w[IY]; \
uint16_t si = I.regs.w[IX]; \
I.ZeroVal = I.CarryVal = 0; \
for (i=0;i<count;i++) { \
tmp = GetMemB(DS, si); \
@@ -339,8 +339,8 @@ typedef struct
#define SUB4S { \
int count = (I.regs.b[CL]+1)/2; \
int i,v1,v2,result; \
unsigned di = I.regs.w[IY]; \
unsigned si = I.regs.w[IX]; \
uint16_t di = I.regs.w[IY]; \
uint16_t si = I.regs.w[IX]; \
I.ZeroVal = I.CarryVal = 0; \
for (i=0;i<count;i++) { \
tmp = GetMemB(ES, di); \
@@ -366,8 +366,8 @@ typedef struct
#define CMP4S { \
int count = (I.regs.b[CL]+1)/2; \
int i,v1,v2,result; \
unsigned di = I.regs.w[IY]; \
unsigned si = I.regs.w[IX]; \
uint16_t di = I.regs.w[IY]; \
uint16_t si = I.regs.w[IX]; \
I.ZeroVal = I.CarryVal = 0; \
for (i=0;i<count;i++) { \
tmp = GetMemB(ES, di); \

View File

@@ -75,6 +75,7 @@ void ws_patchRom(void)
fprintf(log_get(),"developper Id: 0x%.2x\nGame Id: 0x%.2x\n",rom[romSize-10],rom[romSize-8]);
/*
if((rom[romSize-10]==0x01)&&(rom[romSize-8]==0x27)) // Detective Conan
{
// WS cpu is using cache/pipeline or
@@ -87,7 +88,7 @@ void ws_patchRom(void)
rom[0xfffeb]=0x00;
rom[0xfffec]=0x20;
}
}*/
if (!ws_cyclesByLine) ws_cyclesByLine=256;
}