mirror of
https://github.com/kanjitalk755/macemu.git
synced 2024-11-29 14:49:44 +00:00
Fixed a bunch of warnings in MSVC.
This commit is contained in:
parent
f35cb736c7
commit
c92feaf767
@ -349,7 +349,7 @@ void ADBInterrupt(void)
|
|||||||
if (relative_mouse) {
|
if (relative_mouse) {
|
||||||
|
|
||||||
// Mouse movement (relative) and buttons
|
// Mouse movement (relative) and buttons
|
||||||
if (mx != 0 || my != 0 || mb[0] != old_mouse_button[0] || mb[1] != old_mouse_button[1] || mb[2] != old_mouse_button[2]) {
|
if (mx != 0 || my != 0 || !!mb[0] != old_mouse_button[0] || !!mb[1] != old_mouse_button[1] || !!mb[2] != old_mouse_button[2]) {
|
||||||
|
|
||||||
// Call mouse ADB handler
|
// Call mouse ADB handler
|
||||||
if (mouse_reg_3[1] == 4) {
|
if (mouse_reg_3[1] == 4) {
|
||||||
@ -371,9 +371,9 @@ void ADBInterrupt(void)
|
|||||||
r.d[0] = (mouse_reg_3[0] << 4) | 0x0c; // Talk 0
|
r.d[0] = (mouse_reg_3[0] << 4) | 0x0c; // Talk 0
|
||||||
Execute68k(r.a[1], &r);
|
Execute68k(r.a[1], &r);
|
||||||
|
|
||||||
old_mouse_button[0] = mb[0];
|
old_mouse_button[0] = mb[0] != 0;
|
||||||
old_mouse_button[1] = mb[1];
|
old_mouse_button[1] = mb[1] != 0;
|
||||||
old_mouse_button[2] = mb[2];
|
old_mouse_button[2] = mb[2] != 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
@ -406,7 +406,7 @@ void ADBInterrupt(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Send mouse button events
|
// Send mouse button events
|
||||||
if (mb[0] != old_mouse_button[0] || mb[1] != old_mouse_button[1] || mb[2] != old_mouse_button[2]) {
|
if (!!mb[0] != old_mouse_button[0] || !!mb[1] != old_mouse_button[1] || !!mb[2] != old_mouse_button[2]) {
|
||||||
uint32 mouse_base = adb_base + 16;
|
uint32 mouse_base = adb_base + 16;
|
||||||
|
|
||||||
// Call mouse ADB handler
|
// Call mouse ADB handler
|
||||||
@ -429,9 +429,9 @@ void ADBInterrupt(void)
|
|||||||
r.d[0] = (mouse_reg_3[0] << 4) | 0x0c; // Talk 0
|
r.d[0] = (mouse_reg_3[0] << 4) | 0x0c; // Talk 0
|
||||||
Execute68k(r.a[1], &r);
|
Execute68k(r.a[1], &r);
|
||||||
|
|
||||||
old_mouse_button[0] = mb[0];
|
old_mouse_button[0] = mb[0] != 0;
|
||||||
old_mouse_button[1] = mb[1];
|
old_mouse_button[1] = mb[1] != 0;
|
||||||
old_mouse_button[2] = mb[2];
|
old_mouse_button[2] = mb[2] != 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -557,7 +557,7 @@ int16 CDROMControl(uint32 pb, uint32 dce)
|
|||||||
}
|
}
|
||||||
|
|
||||||
case 76: // ModifyPostEvent
|
case 76: // ModifyPostEvent
|
||||||
info->mount_non_hfs = ReadMacInt16(pb + csParam);
|
info->mount_non_hfs = ReadMacInt16(pb + csParam) != 0;
|
||||||
return noErr;
|
return noErr;
|
||||||
|
|
||||||
case 79: { // Change block size
|
case 79: { // Change block size
|
||||||
@ -792,7 +792,7 @@ int16 CDROMControl(uint32 pb, uint32 dce)
|
|||||||
if (!position2msf(*info, ReadMacInt16(pb + csParam), ReadMacInt32(pb + csParam + 2), false, start_m, start_s, start_f))
|
if (!position2msf(*info, ReadMacInt16(pb + csParam), ReadMacInt32(pb + csParam + 2), false, start_m, start_s, start_f))
|
||||||
return paramErr;
|
return paramErr;
|
||||||
|
|
||||||
if (!SysCDScan(info->fh, start_m, start_s, start_f, ReadMacInt16(pb + csParam + 6))) {
|
if (!SysCDScan(info->fh, start_m, start_s, start_f, ReadMacInt16(pb + csParam + 6) != 0)) {
|
||||||
return paramErr;
|
return paramErr;
|
||||||
} else {
|
} else {
|
||||||
return noErr;
|
return noErr;
|
||||||
@ -944,7 +944,7 @@ int16 CDROMStatus(uint32 pb, uint32 dce)
|
|||||||
if (ReadMacInt16(pb + csParam) > 0) {
|
if (ReadMacInt16(pb + csParam) > 0) {
|
||||||
uint32 adr = ReadMacInt32(pb + csParam + 2);
|
uint32 adr = ReadMacInt32(pb + csParam + 2);
|
||||||
WriteMacInt16(pb + csParam, 1); // 1 format
|
WriteMacInt16(pb + csParam, 1); // 1 format
|
||||||
WriteMacInt32(adr, SysGetFileSize(info->fh) / 512); // Number of blocks
|
WriteMacInt32(adr, uint32(SysGetFileSize(info->fh) / 512)); // Number of blocks
|
||||||
WriteMacInt32(adr + 4, 0); // heads/track/sectors
|
WriteMacInt32(adr + 4, 0); // heads/track/sectors
|
||||||
return noErr;
|
return noErr;
|
||||||
} else {
|
} else {
|
||||||
|
@ -200,7 +200,7 @@ bool DiskMountVolume(void *fh)
|
|||||||
WriteMacInt8(info->status + dsWriteProt, info->read_only ? 0xff : 0);
|
WriteMacInt8(info->status + dsWriteProt, info->read_only ? 0xff : 0);
|
||||||
find_hfs_partition(*info);
|
find_hfs_partition(*info);
|
||||||
if (info->start_byte == 0)
|
if (info->start_byte == 0)
|
||||||
info->num_blocks = SysGetFileSize(info->fh) / 512;
|
info->num_blocks = uint32(SysGetFileSize(info->fh) / 512);
|
||||||
WriteMacInt16(info->status + dsDriveSize, info->num_blocks & 0xffff);
|
WriteMacInt16(info->status + dsDriveSize, info->num_blocks & 0xffff);
|
||||||
WriteMacInt16(info->status + dsDriveS1, info->num_blocks >> 16);
|
WriteMacInt16(info->status + dsDriveS1, info->num_blocks >> 16);
|
||||||
info->to_be_mounted = true;
|
info->to_be_mounted = true;
|
||||||
@ -288,7 +288,7 @@ int16 DiskOpen(uint32 pb, uint32 dce)
|
|||||||
WriteMacInt8(info->status + dsWriteProt, info->read_only ? 0x80 : 0);
|
WriteMacInt8(info->status + dsWriteProt, info->read_only ? 0x80 : 0);
|
||||||
find_hfs_partition(*info);
|
find_hfs_partition(*info);
|
||||||
if (info->start_byte == 0)
|
if (info->start_byte == 0)
|
||||||
info->num_blocks = SysGetFileSize(info->fh) / 512;
|
info->num_blocks = uint32(SysGetFileSize(info->fh) / 512);
|
||||||
info->to_be_mounted = true;
|
info->to_be_mounted = true;
|
||||||
}
|
}
|
||||||
D(bug(" %d blocks\n", info->num_blocks));
|
D(bug(" %d blocks\n", info->num_blocks));
|
||||||
|
@ -111,7 +111,7 @@ void EmulOp(uint16 opcode, M68kRegisters *r)
|
|||||||
}
|
}
|
||||||
|
|
||||||
case M68K_EMUL_OP_CLKNOMEM: { // Clock/PRAM operations
|
case M68K_EMUL_OP_CLKNOMEM: { // Clock/PRAM operations
|
||||||
bool is_read = r->d[1] & 0x80;
|
bool is_read = (r->d[1] & 0x80) != 0;
|
||||||
if ((r->d[1] & 0x78) == 0x38) {
|
if ((r->d[1] & 0x78) == 0x38) {
|
||||||
// XPRAM
|
// XPRAM
|
||||||
uint8 reg = (r->d[1] << 5) & 0xe0 | (r->d[1] >> 10) & 0x1f;
|
uint8 reg = (r->d[1] << 5) & 0xe0 | (r->d[1] >> 10) & 0x1f;
|
||||||
|
@ -334,7 +334,7 @@ static void pstrcpy(char *dst, const char *src)
|
|||||||
// Convert C string to pascal string
|
// Convert C string to pascal string
|
||||||
static void cstr2pstr(char *dst, const char *src)
|
static void cstr2pstr(char *dst, const char *src)
|
||||||
{
|
{
|
||||||
*dst++ = strlen(src);
|
*dst++ = char(strlen(src));
|
||||||
char c;
|
char c;
|
||||||
while ((c = *src++) != 0) {
|
while ((c = *src++) != 0) {
|
||||||
// Note: we are converting host ':' characters to Mac '/' characters here
|
// Note: we are converting host ':' characters to Mac '/' characters here
|
||||||
@ -2158,7 +2158,7 @@ static int16 fs_get_wd_info(uint32 pb, uint32 vcb)
|
|||||||
int16 ExtFSHFS(uint32 vcb, uint16 selectCode, uint32 paramBlock, uint32 globalsPtr, int16 fsid)
|
int16 ExtFSHFS(uint32 vcb, uint16 selectCode, uint32 paramBlock, uint32 globalsPtr, int16 fsid)
|
||||||
{
|
{
|
||||||
uint16 trapWord = selectCode & 0xf0ff;
|
uint16 trapWord = selectCode & 0xf0ff;
|
||||||
bool hfs = selectCode & kHFSMask;
|
bool hfs = (selectCode & kHFSMask) != 0;
|
||||||
switch (trapWord) {
|
switch (trapWord) {
|
||||||
case kFSMOpen:
|
case kFSMOpen:
|
||||||
return fs_open(paramBlock, hfs ? ReadMacInt32(paramBlock + ioDirID) : 0, vcb, false);
|
return fs_open(paramBlock, hfs ? ReadMacInt32(paramBlock + ioDirID) : 0, vcb, false);
|
||||||
|
@ -177,7 +177,7 @@ bool InitAll(const char *vmdir)
|
|||||||
XPRAM[0x56] = 0x42; // 'B'
|
XPRAM[0x56] = 0x42; // 'B'
|
||||||
XPRAM[0x57] = 0x32; // '2'
|
XPRAM[0x57] = 0x32; // '2'
|
||||||
const monitor_desc &main_monitor = *VideoMonitors[0];
|
const monitor_desc &main_monitor = *VideoMonitors[0];
|
||||||
XPRAM[0x58] = main_monitor.depth_to_apple_mode(main_monitor.get_current_mode().depth);
|
XPRAM[0x58] = uint8(main_monitor.depth_to_apple_mode(main_monitor.get_current_mode().depth));
|
||||||
XPRAM[0x59] = 0;
|
XPRAM[0x59] = 0;
|
||||||
|
|
||||||
#if EMULATED_68K
|
#if EMULATED_68K
|
||||||
|
@ -86,7 +86,7 @@ static void Long(uint32 data)
|
|||||||
static void Word(uint16 data)
|
static void Word(uint16 data)
|
||||||
{
|
{
|
||||||
srom[p++] = data >> 8;
|
srom[p++] = data >> 8;
|
||||||
srom[p++] = data;
|
srom[p++] = uint8(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void String(const char *str)
|
static void String(const char *str)
|
||||||
@ -98,7 +98,7 @@ static void String(const char *str)
|
|||||||
|
|
||||||
static void PString(const char *str)
|
static void PString(const char *str)
|
||||||
{
|
{
|
||||||
srom[p++] = strlen(str);
|
srom[p++] = uint8(strlen(str));
|
||||||
while ((srom[p++] = *str++) != 0) ;
|
while ((srom[p++] = *str++) != 0) ;
|
||||||
p--;
|
p--;
|
||||||
if (p & 1)
|
if (p & 1)
|
||||||
@ -211,17 +211,17 @@ static uint32 VMonitor(const monitor_desc &m, uint32 videoType, uint32 videoName
|
|||||||
Offs(0x40, gammaDir); // Gamma directory
|
Offs(0x40, gammaDir); // Gamma directory
|
||||||
Rsrc(0x7d, 6); // Video attributes: Default to color, built-in
|
Rsrc(0x7d, 6); // Video attributes: Default to color, built-in
|
||||||
if (m.has_depth(VDEPTH_1BIT))
|
if (m.has_depth(VDEPTH_1BIT))
|
||||||
Offs(m.depth_to_apple_mode(VDEPTH_1BIT), vidMode1); // Video mode parameters for 1 bit
|
Offs(uint8(m.depth_to_apple_mode(VDEPTH_1BIT)), vidMode1); // Video mode parameters for 1 bit
|
||||||
if (m.has_depth(VDEPTH_2BIT))
|
if (m.has_depth(VDEPTH_2BIT))
|
||||||
Offs(m.depth_to_apple_mode(VDEPTH_2BIT), vidMode2); // Video mode parameters for 2 bit
|
Offs(uint8(m.depth_to_apple_mode(VDEPTH_2BIT)), vidMode2); // Video mode parameters for 2 bit
|
||||||
if (m.has_depth(VDEPTH_4BIT))
|
if (m.has_depth(VDEPTH_4BIT))
|
||||||
Offs(m.depth_to_apple_mode(VDEPTH_4BIT), vidMode4); // Video mode parameters for 4 bit
|
Offs(uint8(m.depth_to_apple_mode(VDEPTH_4BIT)), vidMode4); // Video mode parameters for 4 bit
|
||||||
if (m.has_depth(VDEPTH_8BIT))
|
if (m.has_depth(VDEPTH_8BIT))
|
||||||
Offs(m.depth_to_apple_mode(VDEPTH_8BIT), vidMode8); // Video mode parameters for 8 bit
|
Offs(uint8(m.depth_to_apple_mode(VDEPTH_8BIT)), vidMode8); // Video mode parameters for 8 bit
|
||||||
if (m.has_depth(VDEPTH_16BIT))
|
if (m.has_depth(VDEPTH_16BIT))
|
||||||
Offs(m.depth_to_apple_mode(VDEPTH_16BIT), vidMode16); // Video mode parameters for 16 bit
|
Offs(uint8(m.depth_to_apple_mode(VDEPTH_16BIT)), vidMode16); // Video mode parameters for 16 bit
|
||||||
if (m.has_depth(VDEPTH_32BIT))
|
if (m.has_depth(VDEPTH_32BIT))
|
||||||
Offs(m.depth_to_apple_mode(VDEPTH_32BIT), vidMode32); // Video mode parameters for 32 bit
|
Offs(uint8(m.depth_to_apple_mode(VDEPTH_32BIT)), vidMode32); // Video mode parameters for 32 bit
|
||||||
EndOfList();
|
EndOfList();
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user