Skip to content

Commit

Permalink
Merge branch 'master' into merger
Browse files Browse the repository at this point in the history
# Conflicts:
#	CMakeLists.txt
#	src/audio/blaster.c
#	src/cpu.c
#	src/i8237.c
#	src/ports.c
  • Loading branch information
DnCraptor committed Dec 11, 2023
2 parents 28c3d83 + 73d3006 commit 3b137b9
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/cpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -609,11 +609,13 @@ void reset86() {
#endif
init8253();
init8259();

initsermouse(0x378, 4);
sn76489_reset();
#if SOUND_BLASTER
initBlaster(0x220, 7);
#endif

#ifndef PSRAM_ONLY_NO_RAM
memset(RAM, 0x0, RAM_SIZE);
#else
Expand Down Expand Up @@ -4361,6 +4363,7 @@ void writew86(uint32_t addr32, uint16_t v) {

// https://docs.huihoo.com/gnu_linux/own_os/appendix-bios_memory_2.htm
uint8_t read86(uint32_t addr32) {
// Не удаляй плиз коммент
if (addr32 == 0xFC000) { return 0x21; };
#ifndef PSRAM_ONLY_NO_RAM
if (addr32 < DIRECT_RAM_BORDER) { // performance improvement (W/A)
Expand Down
25 changes: 24 additions & 1 deletion src/ports.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ void portout(uint16_t portnum, uint16_t value) {
#endif
case 0x20:
case 0x21: //i8259
out8259(portnum, value);
out8259(portnum, value & 255);
return;
case 0x40:
case 0x41:
Expand Down Expand Up @@ -118,6 +118,18 @@ void portout(uint16_t portnum, uint16_t value) {
#endif
break;
#ifdef SOUND_SYSTEM
case 0xC0:
case 0xC1:
case 0xC2:
case 0xC3:
case 0xC4:
case 0xC5:
case 0xC6:
case 0xC7:
sn76489_out(value);
break;
#if SOUND_BLASTER
//
case 0x220:
case 0x221:
case 0x222:
Expand All @@ -136,15 +148,20 @@ void portout(uint16_t portnum, uint16_t value) {
//case 0x22f:
outBlaster(portnum, value);
break;
#endif
#if DSS
case 0x378:
case 0x37A:
outsoundsource(portnum, value);
break;
#endif
#if SOUND_BLASTER || ADLIB
case 0x388: // adlib
case 0x389:
outadlib(portnum, value);
break;
#endif
#endif
/*
case 0x3B8: // TODO: hercules support
break;
Expand Down Expand Up @@ -427,11 +444,16 @@ uint16_t portin(uint16_t portnum) {
/*case 0x201: // joystick
return 0b11110000;*/
#ifdef SOUND_SYSTEM
#if DSS
case 0x379:
return insoundsource(portnum);
#endif
#if SOUND_BLASTER || ADLIB
case 0x388: // adlib
case 0x389:
return inadlib(portnum);
#endif
#if SOUND_BLASTER
case 0x220:
case 0x221:
case 0x222:
Expand All @@ -448,6 +470,7 @@ uint16_t portin(uint16_t portnum) {
case 0x22d:
case 0x22e:
return inBlaster(portnum);
#endif
#endif
// http://www.techhelpmanual.com/900-video_graphics_array_i_o_ports.html
// https://wiki.osdev.org/VGA_Hardware#Port_0x3C0
Expand Down

0 comments on commit 3b137b9

Please sign in to comment.