Merge pull request #2376 from Wengier/master

Some fixes
This commit is contained in:
Jonathan Campbell
2021-03-16 22:52:09 -07:00
committed by GitHub
5 changed files with 66 additions and 49 deletions

View File

@@ -2,6 +2,8 @@
- CD-ROM image emulation now supports ISO images
that are 2GB or larger, 32-bit integer size limit
has been lifted.
- Increased upper limit of "prebuffer" config option
(in [mixer] section) from 100 to 250. (Wengier)
- Added scrollbar buttons to the Configuration Tool,
so that the scrollbars better resemble the style of
the Windows 3.1 scrollbars.
@@ -24,17 +26,17 @@
if the start is not a multiple of the ratio of
logical to physical sector size. This allows the
HDI image of Dragon Knight 4 to mount.
- Fixed Windows 9x installation failures caused by
FAT driver changes in the previous version.
- Fixed Windows 95/98 installation failures caused by
FAT driver and DOS API changes in previous version.
- Fixed well-intended but erroneous fall through case
in the INT15 handler that prevented 3rd party mouse
drivers from detecting the PS/2 mouse.
- Fixed the color issue with the Configuration Tool
in the macOS SDL1 build. (ant_222)
- Fixed setting option "ttf.wp=xy3" or "ttf.wp=xy4"
not working (but "ttf.wp=xy" did work). (Wengier)
- Fixed preview function in WordStar not working for
TrueType font output in previous version. (Wengier)
- Increased upper limit of "prebuffer" config option
(in [mixer] section) from 100 to 250. (Wengier)
- Integrated SVN commits (Allofich)
- r4416: Added ability to start and stop avi
recording, and to start keymapper, from config.

View File

@@ -30,12 +30,12 @@ static void dyn_mmx_op(Bitu op) {
if (decode.modrm.mod < 3) {
dyn_fill_ea();
gen_call_function((void*)&gen_mmx_op, "%I%I%I%Ddr", op, decode.modrm.val, imm, DREG(EA));
dyn_call_function_pagefault_check((void*)&gen_mmx_op, "%I%I%I%Ddr", op, decode.modrm.val, imm, DREG(EA));
}
else {
if ((op == 0x71) || (op == 0x72) || (op == 0x73))
decode_fetchb_imm(imm);
gen_call_function((void*)&gen_mmx_op, "%I%I%I", op, decode.modrm.val, imm);
dyn_call_function_pagefault_check((void*)&gen_mmx_op, "%I%I%I", op, decode.modrm.val, imm);
}
}

View File

@@ -4150,24 +4150,33 @@ void DOS_Int21_71a8(char* name1, const char* name2) {
MEM_StrCopy(SegPhys(ds)+reg_si,name1,DOSNAMEBUF);
int i,j=0,o=0;
char c[13];
const char* s = strrchr(name1, '.');
for (i=0;i<8;j++) {
if (name1[j] == 0 || s-name1 <= j) break;
if (name1[j] == '.') continue;
c[o++] = toupper(name1[j]);
i++;
}
if (s != NULL) {
s++;
if (s != 0 && reg_dh == 1) c[o++] = '.';
for (i=0;i<3;i++) {
if (*(s+i) == 0) break;
c[o++] = toupper(*(s+i));
}
}
assert(o <= 12);
c[o] = 0;
MEM_BlockWrite(SegPhys(es)+reg_di,c,strlen(c)+1);
if (reg_dh == 0) memset(c, 0, sizeof(c));
if (strcmp(name1, ".") && strcmp(name1, "..")) {
const char* s = strrchr(name1, '.');
for (i=0;i<8;j++) {
if (name1[j] == 0 || (s==NULL?8:s-name1) <= j) {
if (reg_dh == 0 && s != NULL) for (int j=0; j<8-i; j++) c[o++] = ' ';
break;
}
while (name1[j]&&name1[j]<=32||name1[j]==127||name1[j]=='"'||name1[j]=='+'||name1[j]=='='||name1[j]=='.'||name1[j]==','||name1[j]==';'||name1[j]==':'||name1[j]=='<'||name1[j]=='>'||name1[j]=='['||name1[j]==']'||name1[j]=='|'||name1[j]=='?'||name1[j]=='*') j++;
c[o++] = toupper(name1[j]);
i++;
}
if (s != NULL) {
s++;
if (s != 0 && reg_dh == 1) c[o++] = '.';
j=0;
for (i=0;i<3;i++) {
if (*(s+i+j) == 0) break;
while (*(s+i+j)&&*(s+i+j)<=32||*(s+i+j)==127||*(s+i+j)=='"'||*(s+i+j)=='+'||*(s+i+j)=='='||*(s+i+j)==','||*(s+i+j)==';'||*(s+i+j)==':'||*(s+i+j)=='<'||*(s+i+j)=='>'||*(s+i+j)=='['||*(s+i+j)==']'||*(s+i+j)=='|'||*(s+i+j)=='?'||*(s+i+j)=='*') j++;
c[o++] = toupper(*(s+i+j));
}
}
assert(o <= 12);
c[o] = 0;
} else
strcpy(c, name1);
MEM_BlockWrite(SegPhys(es)+reg_di,c,reg_dh==1?strlen(c)+1:11);
reg_ax=0;
CALLBACK_SCF(false);
} else {

View File

@@ -1204,8 +1204,8 @@ bool DOS_CreateTempFile(char * const name,uint16_t * entry) {
for (i=0;i<8;i++) {
tempname[i]=(rand()%26)+'A';
}
tempname[8]=0;
if (DOS_FileExists(name)) {cont=true;continue;}
tempname[8]='.';tempname[9]='T';tempname[10]='M';tempname[11]='P';tempname[12]=0;
//if (DOS_FileExists(name)) {cont=true;continue;} // FIXME: Check name uniqueness
} while (cont || (!DOS_CreateFile(name,0,entry) && dos.errorcode==DOSERR_FILE_ALREADY_EXISTS));
if (dos.errorcode) return false;
return true;

View File

@@ -1923,37 +1923,45 @@ public:
SDL_FreeSurface(surface);
}
void update(SDL_Surface *dest, int scale) const {
char *dp, *sp, *spx, *sr0, *dr, *dr0;
int x, y, v, h, p;
uint32_t *pixP, alpha;
SDL_PixelFormat *fmt;
static bool get_dest_pix
( char* sp, SDL_PixelFormat *sf, SDL_PixelFormat *df, Uint32* pix )
{ Uint8 r, g, b, a;
SDL_GetRGBA( *(Uint32*)sp, sf, &r, &g, &b, &a );
*pix = SDL_MapRGBA( df, r, g, b, a );
return a>0;
}
fmt = surface->format;
void update(SDL_Surface *dest, int scale) const {
char *dp, *sp, *sr0, *dr, *dr0;
int x, y, v, h;
uint32_t pix;
SDL_PixelFormat *fmt, *df;
bool is_alpha;
// Direct blitting for pixel-to-pixel scale:
if( scale == 1 )
{ SDL_BlitSurface(surface, NULL, dest, NULL);
return;
}
fmt = surface->format;
df = dest ->format;
SDL_LockSurface( dest );
SDL_LockSurface( surface );
dr0 = (char*)dest ->pixels;
sr0 = (char*)surface->pixels;
//LOG_MSG(
// "CONF: upscaling. surface: %i x %i, dest: %i x %i",
// surface->w, surface->h, dest->w, dest->h );
for( y = 0; y < surface->h; y += 1 )
{ dp = dr0;
sp = sr0;
for( x = 0; x < surface->w; x += 1 )
{ pixP = (uint32_t*)sp;
alpha = *pixP & fmt->Amask;
alpha = alpha >> fmt->Ashift;
alpha = alpha << fmt->Aloss;
{ is_alpha = get_dest_pix( sp, fmt, df, &pix ) > 0;
for( h = 0; h < scale; h += 1 )
{ spx = sp;
for( p = 0; p < fmt->BytesPerPixel; p += 1 )
{ if( alpha > 0 ) *dp = *spx;
dp += 1;
spx += 1;
}
{ if( is_alpha )
{ memcpy( dp, &pix, df->BytesPerPixel ); }
dp += df->BytesPerPixel;
}
sp = spx;
sp += fmt->BytesPerPixel;
}
sr0 = sr0 + surface->pitch;
@@ -1966,9 +1974,7 @@ public:
}
SDL_UnlockSurface( dest );
SDL_UnlockSurface( surface );
//SDL_BlitSurface(surface, NULL, dest, NULL);
}
}
};
ScreenSDL::~ScreenSDL() {