Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Darkmode #7

Closed
wants to merge 2,320 commits into from
Closed

Darkmode #7

wants to merge 2,320 commits into from

Conversation

OBattler
Copy link

@OBattler OBattler commented Feb 3, 2025

Summary

Briefly describe what you are submitting.

Checklist

References

Provide links to datasheets or other documentation that helped you implement this pull request.

OBattler and others added 30 commits January 3, 2025 14:49
Two fixes Battler noticed.

Co-Authored-By: TC1995 <[email protected]>
Co-Authored-By: Miran Grča <[email protected]>
Don't clobber the GPIO I/O Base value.

According to the PC87307 datasheet, port 0x60 bits [2:7] are read-only
for the Parallel Port (4) device and cannot be altered by software.
For others devices, the 0x60 port may be written with any value.

The SGI firmware emits the following PC87307 initialization sequence
after each reset:

/* Select the GPIO device (7) */
SIO IDX: 2E <-- 07
SIO DAT: 2F <-- 07

/* I/O Base MSB = 0x0F */
SIO IDX: 2E <-- 60
SIO DAT: 2F <-- 0F

/* I/O Base LSB = 0xC0 */
SIO IDX: 2E <-- 61
SIO DAT: 2F <-- C0

/* Enable address decoding (I/O Base = 0xFC0) */
SIO IDX: 2E <-- 30
SIO DAT: 2F <-- 01

The GPIO I/O Base is erroneously assigned to 0x7C0. Fix by removing the 0x07 mask.
pc87307: Fix GPIO base address configuration
Fixes low pitch problems when MIDI is played back through the software synth.

Co-Authored-By: Cacodemon345 <[email protected]>
Add CT1297 to CT5880, seen on the CT4810
Fix wrong sample rate of ES1370 software synth playback
…ble (interpreter and x86-64 recompiler only).
format

Update snd_sb.c
OBattler and others added 28 commits January 30, 2025 08:15
…ave (fixes data playing as audio, producing nasty artifacts, in some games), and increased the media history for all drive types from 4 to 10, also refactored cdrom_read_sector() and moved the last module-wide variables into the cdrom_t struct.
Also make some, but few, of HDD model names more accurate.
Make HDD models' speeds accurate
Initial work for Gameport instancing
…o the correct IR bytes, fixes Windows 95 Setup GPF'ing.
Actually make it work on NT by setting bit 0 of the read only config2 reg.
… fault when pat_src is 8 (eg. in Windows 95 on the MCA XGA).
@OBattler OBattler closed this Feb 3, 2025
ct->attr = DATA_TRACK;
sscanf(type, "MODE%" PRIu32 "/%" PRIu32,
&mode, &(ct->sector_size));
ct->mode = mode;

Check failure

Code scanning / CodeQL

Missing return-value check for a 'scanf'-like function High

This variable is read, but may not have been written. It should be guarded by a check that the
call to sscanf
returns at least 1.
recalc_ems(dev);
}
} else {
for (uint8_t i = 0; i < (sltptr / EMS_PGSIZE); i++)

Check failure

Code scanning / CodeQL

Comparison of narrow type with wide type in loop condition High

Comparison between
i
of type uint8_t and
... / ...
of wider type unsigned int.

wd76c10_shadow_ram_do_recalc(dev, vbios_states, dev->vbios_states, 0, 4, 0x000c0000);
wd76c10_shadow_ram_do_recalc(dev, bios_states, dev->bios_states, 0, 8, 0x000e0000);

Check failure

Code scanning / CodeQL

Comparison of narrow type with wide type in loop condition High

Comparison between
i
of type uint8_t and
... + ...
of wider type int.
if (doIncrement) {
sigExact = sig;
++sig;
sig &= ~(uint64_t) (! (sigExtra & UINT64_C(0x7FFFFFFFFFFFFFFF)) & roundNearEven);

Check failure

Code scanning / CodeQL

Incorrect 'not' operator usage High

Usage of a logical not (!) expression as a bitwise operator.
sig = UINT64_C(0x8000000000000000);
sigExact >>= 1; // must scale also, or else later tests will fail
} else {
sig &= ~(uint64_t) (! (sigExtra & UINT64_C(0x7FFFFFFFFFFFFFFF)) & roundNearEven);

Check failure

Code scanning / CodeQL

Incorrect 'not' operator usage High

Usage of a logical not (!) expression as a bitwise operator.
entry_t t_ent = { 0 };
memcpy(&t_ent, j_ent, sizeof(entry_t));
/* J: Contents of I, list of J */
memcpy(j_ent->name, i_ent->name, sizeof(entry_t) - sizeof(i_ent->list));

Check failure

Code scanning / CodeQL

Static array access may cause overflow

Potential buffer-overflow: 'name' has size 128 not 1664.
/* J: Contents of I, list of J */
memcpy(j_ent->name, i_ent->name, sizeof(entry_t) - sizeof(i_ent->list));
/* I: Contents of J, list of I */
memcpy(i_ent->name, t_ent.name, sizeof(entry_t) - sizeof(i_ent->list));

Check failure

Code scanning / CodeQL

Static array access may cause overflow

Potential buffer-overflow: 'name' has size 128 not 1664.
else {
if (log->suppr_seen && log->seen) {
log_copy(log, fmt2, "*** %d repeats ***\n", 1024);
fprintf(stdlog, fmt2, log->seen);

Check failure

Code scanning / CodeQL

Non-constant format string Critical

The format string argument to
fprintf
has a source which cannot be verified to originate from a string literal.
The format string argument to
fprintf
has a source which cannot be verified to originate from a string literal.
The format string argument to
fprintf
has a source which cannot be verified to originate from a string literal.
log->seen = 0;
strcpy(log->buff, temp);
log_copy(log, fmt2, temp, 1024);
fprintf(stdlog, fmt2, ap);

Check failure

Code scanning / CodeQL

Non-constant format string Critical

The format string argument to
fprintf
has a source which cannot be verified to originate from a string literal.
The format string argument to
fprintf
has a source which cannot be verified to originate from a string literal.
The format string argument to
fprintf
has a source which cannot be verified to originate from a string literal.
svga_recalctimings(&dev->svga);
if (!(val & VBE_DISPI_NOCLEARMEM)) {
memset(dev->svga.vram, 0,
dev->vbe_regs[VBE_DISPI_INDEX_YRES] * dev->svga.rowoffset);

Check failure

Code scanning / CodeQL

Multiplication result converted to larger type High

Multiplication result may overflow 'int' before it is converted to 'unsigned long'.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.