Skip to content

Commit ad0344e

Browse files
authored
Merge branch '86Box:master' into master
2 parents 7631c3d + d7cae42 commit ad0344e

31 files changed

+1074
-215
lines changed

src/chipset/intel_piix.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1712,7 +1712,7 @@ const device_t piix4_device = {
17121712
.name = "Intel 82371AB/EB (PIIX4/PIIX4E)",
17131713
.internal_name = "piix4",
17141714
.flags = DEVICE_PCI,
1715-
.local = 0x71100014,
1715+
.local = 0x71100004,
17161716
.init = piix_init,
17171717
.close = piix_close,
17181718
.reset = piix_reset,

src/chipset/umc_hb4.c

Lines changed: 2 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,8 @@ hb4_smram(hb4_t *dev)
270270
}
271271

272272
umc_smram_recalc(dev->smram_base >> 12, 1);
273+
274+
flushmmucache();
273275
}
274276

275277
static void
@@ -398,55 +400,6 @@ hb4_close(void *priv)
398400
free(dev);
399401
}
400402

401-
static void
402-
ims8848_write(uint16_t addr, uint8_t val, void *priv)
403-
{
404-
hb4_t *dev = (hb4_t *) priv;
405-
406-
switch (addr) {
407-
case 0x22:
408-
dev->idx = val;
409-
break;
410-
case 0x23:
411-
if (((val & 0x0f) == ((dev->idx >> 4) & 0x0f)) && ((val & 0xf0) == ((dev->idx << 4) & 0xf0)))
412-
dev->access_data = 1;
413-
break;
414-
case 0x24:
415-
if (dev->access_data)
416-
dev->access_data = 0;
417-
break;
418-
419-
default:
420-
break;
421-
}
422-
}
423-
424-
static uint8_t
425-
ims8848_read(uint16_t addr, void *priv)
426-
{
427-
uint8_t ret = 0xff;
428-
hb4_t *dev = (hb4_t *) priv;
429-
430-
switch (addr) {
431-
case 0x22:
432-
ret = dev->idx;
433-
break;
434-
case 0x23:
435-
ret = (dev->idx >> 4) | (dev->idx << 4);
436-
break;
437-
case 0x24:
438-
if (dev->access_data) {
439-
ret = dev->pci_conf[dev->idx];
440-
dev->access_data = 0;
441-
}
442-
break;
443-
default:
444-
break;
445-
}
446-
447-
return ret;
448-
}
449-
450403
static void *
451404
hb4_init(UNUSED(const device_t *info))
452405
{
@@ -463,8 +416,6 @@ hb4_init(UNUSED(const device_t *info))
463416
dev->smram_base = 0x000a0000;
464417
hb4_reset(dev);
465418

466-
io_sethandler(0x0022, 0x0003, ims8848_read, NULL, NULL, ims8848_write, NULL, NULL, dev);
467-
468419
return dev;
469420
}
470421

src/device/kbc_at.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -830,7 +830,9 @@ write_p2(atkbc_t *dev, uint8_t val)
830830
softresetx86(); /* Pulse reset! */
831831
cpu_set_edx();
832832
flushmmucache();
833-
if ((kbc_ven == KBC_VEN_ALI) || !strcmp(machine_get_internal_name(), "spc7700plw"))
833+
if ((kbc_ven == KBC_VEN_ALI) ||
834+
!strcmp(machine_get_internal_name(), "spc7700plw") ||
835+
!strcmp(machine_get_internal_name(), "pl4600c"))
834836
smbase = 0x00030000;
835837

836838
/* Yes, this is a hack, but until someone gets ahold of the real PCD-2L

src/disk/hdc_ide_rz1000.c

Lines changed: 3 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -130,38 +130,6 @@ rz1000_pci_write(int func, int addr, uint8_t val, void *priv)
130130
rz1000_ide_handlers(dev);
131131
}
132132
break;
133-
case 0x10:
134-
dev->regs[0x10] = (val & 0xf8) | 1;
135-
rz1000_ide_handlers(dev);
136-
break;
137-
case 0x11:
138-
dev->regs[0x11] = val;
139-
rz1000_ide_handlers(dev);
140-
break;
141-
case 0x14:
142-
dev->regs[0x14] = (val & 0xfc) | 1;
143-
rz1000_ide_handlers(dev);
144-
break;
145-
case 0x15:
146-
dev->regs[0x15] = val;
147-
rz1000_ide_handlers(dev);
148-
break;
149-
case 0x18:
150-
dev->regs[0x18] = (val & 0xf8) | 1;
151-
rz1000_ide_handlers(dev);
152-
break;
153-
case 0x19:
154-
dev->regs[0x19] = val;
155-
rz1000_ide_handlers(dev);
156-
break;
157-
case 0x1c:
158-
dev->regs[0x1c] = (val & 0xfc) | 1;
159-
rz1000_ide_handlers(dev);
160-
break;
161-
case 0x1d:
162-
dev->regs[0x1d] = val;
163-
rz1000_ide_handlers(dev);
164-
break;
165133
case 0x40 ... 0x4f:
166134
dev->regs[addr] = val;
167135
break;
@@ -233,16 +201,13 @@ rz1000_reset(void *priv)
233201
dev->regs[0x01] = 0x10;
234202
dev->regs[0x02] = 0x00; /* RZ-1000 */
235203
dev->regs[0x03] = 0x10;
236-
dev->regs[0x04] = 0x01;
204+
dev->regs[0x04] = 0x00;
237205
dev->regs[0x07] = 0x02; /* DEVSEL timing: 01 medium */
238206
dev->regs[0x08] = 0x02; /* Revision 02 */
239207
dev->regs[0x09] = dev->local; /* Programming interface */
240208
dev->regs[0x0a] = 0x01; /* IDE controller */
241209
dev->regs[0x0b] = 0x01; /* Mass storage controller */
242210

243-
dev->regs[0x3c] = 0x14; /* IRQ 14 */
244-
dev->regs[0x3d] = 0x01; /* INTA */
245-
246211
dev->irq_mode[0] = dev->irq_mode[1] = 0;
247212
dev->irq_pin = PCI_INTA;
248213
dev->irq_line = 14;
@@ -299,7 +264,7 @@ const device_t ide_rz1000_pci_device = {
299264
.name = "PC Technology RZ-1000 PCI",
300265
.internal_name = "ide_rz1000_pci",
301266
.flags = DEVICE_PCI,
302-
.local = 0x6000a,
267+
.local = 0x60000,
303268
.init = rz1000_init,
304269
.close = rz1000_close,
305270
.reset = rz1000_reset,
@@ -313,7 +278,7 @@ const device_t ide_rz1000_pci_single_channel_device = {
313278
.name = "PC Technology RZ-1000 PCI",
314279
.internal_name = "ide_rz1000_pci_single_channel",
315280
.flags = DEVICE_PCI,
316-
.local = 0x2000a,
281+
.local = 0x20000,
317282
.init = rz1000_init,
318283
.close = rz1000_close,
319284
.reset = rz1000_reset,

src/include/86box/snd_mmb.h

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
/*
2+
* 86Box A hypervisor and IBM PC system emulator that specializes in
3+
* running old operating systems and software designed for IBM
4+
* PC systems and compatibles from 1981 through fairly recent
5+
* system designs based on the PCI bus.
6+
*
7+
* This file is part of the 86Box distribution.
8+
*
9+
* Mindscape Music Board emulation.
10+
*
11+
* Authors: Roy Baer, <https://pcem-emulator.co.uk/>
12+
* Jasmine Iwanek, <[email protected]>
13+
*
14+
* Copyright 2025 Roy Baer.
15+
* Copyright 2025 Jasmine Iwanek.
16+
*/
17+
#ifndef _SOUND_SND_MMB_H_
18+
#define _SOUND_SND_MMB_H_
19+
20+
#define MMB_FREQ FREQ_48000
21+
22+
/* NOTE:
23+
* The constant clock rate is a deviation from the real hardware which has
24+
* the design flaw that the clock rate is always half the ISA bus clock.
25+
*/
26+
#define MMB_CLOCK 2386364
27+
28+
typedef struct ay_3_891x_s {
29+
uint8_t index;
30+
uint8_t regs[16];
31+
struct ayumi chip;
32+
} ay_3_891x_t;
33+
34+
typedef struct mmb_s {
35+
ay_3_891x_t first;
36+
ay_3_891x_t second;
37+
38+
int16_t buffer[SOUNDBUFLEN * 2];
39+
int pos;
40+
} mmb_t;
41+
42+
#endif /* _SOUND_SND_MMB_H_ */

src/include/86box/sound.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,9 @@ extern const device_t ps1snd_device;
205205
extern const device_t ssi2001_device;
206206
extern const device_t entertainer_device;
207207

208+
/* Mindscape Music Board */
209+
extern const device_t mmb_device;
210+
208211
/* Pro Audio Spectrum Plus, 16, and 16D */
209212
extern const device_t pasplus_device;
210213
extern const device_t pas16_device;

src/include/86box/video.h

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ using atomic_int = std::atomic_int;
3636
#define getcolg(color) (((color) >> 8) & 0xFF)
3737
#define getcolb(color) ((color) & 0xFF)
3838

39+
#ifdef __cplusplus
40+
extern "C" {
41+
#endif
42+
3943
enum {
4044
VID_NONE = 0,
4145
VID_INTERNAL
@@ -49,10 +53,6 @@ enum {
4953
FULLSCR_SCALE_INT43
5054
};
5155

52-
#ifdef __cplusplus
53-
extern "C" {
54-
#endif
55-
5656
enum {
5757
VIDEO_ISA = 0,
5858
VIDEO_MCA,
@@ -71,6 +71,11 @@ enum {
7171

7272
#define VIDEO_FLAG_TYPE_SECONDARY VIDEO_FLAG_TYPE_SPECIAL
7373

74+
#define FONT_IBM_MDA_437_PATH "roms/video/mda/mda.rom"
75+
#define FONT_IBM_MDA_437_NORDIC_PATH "roms/video/mda/4733197.bin"
76+
#define FONT_KAM_PATH "roms/video/mda/kam.bin"
77+
#define FONT_KAMCL16_PATH "roms/video/mda/kamcl16.bin"
78+
7479
typedef struct video_timings_t {
7580
int type;
7681
int write_b;
@@ -189,15 +194,15 @@ extern uint32_t pal_lookup[256];
189194
#endif
190195
extern int video_fullscreen;
191196
extern int video_fullscreen_scale;
192-
extern uint8_t fontdat[2048][8];
193-
extern uint8_t fontdatm[2048][16];
194-
extern uint8_t fontdat2[2048][8];
195-
extern uint8_t fontdatm2[2048][16];
196-
extern uint8_t fontdatw[512][32];
197-
extern uint8_t fontdat8x12[256][16];
198-
extern uint8_t fontdat12x18[256][36];
199-
extern dbcs_font_t *fontdatksc5601;
200-
extern dbcs_font_t *fontdatksc5601_user;
197+
extern uint8_t fontdat[2048][8]; /* IBM CGA font */
198+
extern uint8_t fontdatm[2048][16]; /* IBM MDA font */
199+
extern uint8_t fontdat2[2048][8]; /* IBM CGA 2nd instance font */
200+
extern uint8_t fontdatm2[2048][16]; /* IBM MDA 2nd instance font */
201+
extern uint8_t fontdatw[512][32]; /* Wyse700 font */
202+
extern uint8_t fontdat8x12[256][16]; /* MDSI Genius font */
203+
extern uint8_t fontdat12x18[256][36]; /* IM1024 font */
204+
extern dbcs_font_t *fontdatksc5601; /* Korean KSC-5601 font */
205+
extern dbcs_font_t *fontdatksc5601_user; /* Korean KSC-5601 user defined font */
201206
extern uint32_t *video_6to8;
202207
extern uint32_t *video_8togs;
203208
extern uint32_t *video_8to32;
@@ -277,8 +282,8 @@ extern uint8_t video_force_resize_get_monitor(int monitor_index);
277282
extern void video_force_resize_set_monitor(uint8_t res, int monitor_index);
278283
extern void video_update_timing(void);
279284

280-
extern void loadfont_ex(char *s, int format, int offset);
281-
extern void loadfont(char *s, int format);
285+
extern void loadfont_ex(char *fn, int format, int offset);
286+
extern void loadfont(char *fn, int format);
282287

283288
extern int get_actual_size_x(void);
284289
extern int get_actual_size_y(void);

src/machine/m_amstrad.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2936,7 +2936,7 @@ machine_amstrad_init(const machine_t *model, int type)
29362936
break;
29372937

29382938
case AMS_PC1640:
2939-
loadfont("roms/video/mda/mda.rom", 0);
2939+
loadfont(FONT_IBM_MDA_437_PATH, 0);
29402940
device_context(&vid_1640_device);
29412941
ams->language = device_get_config_int("language");
29422942
vid_init_1640(ams);

src/machine/m_at_386dx_486.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1727,7 +1727,6 @@ machine_at_sb486pv_init(const machine_t *model)
17271727
device_context_restore();
17281728

17291729
machine_at_common_init(model);
1730-
device_add(&ide_pci_device);
17311730

17321731
pci_init(PCI_CONFIG_TYPE_2);
17331732
pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0);

src/machine/m_at_socket370.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -386,17 +386,16 @@ machine_at_awo671r_init(const machine_t *model)
386386
pci_register_slot(0x0A, PCI_CARD_NORMAL, 2, 3, 4, 1);
387387
pci_register_slot(0x0B, PCI_CARD_NORMAL, 3, 4, 1, 2);
388388
pci_register_slot(0x0C, PCI_CARD_NORMAL, 4, 1, 2, 3);
389-
pci_register_slot(0x0D, PCI_CARD_NORMAL, 2, 3, 4, 1);
389+
pci_register_slot(0x0D, PCI_CARD_VIDEO, 2, 3, 4, 1);
390390
pci_register_slot(0x01, PCI_CARD_AGPBRIDGE, 1, 2, 3, 4);
391391
device_add(&i440bx_device);
392392
device_add(&piix4e_device);
393393
device_add_inst(&w83977ef_device, 1);
394394
device_add_inst(&w83977ef_device, 2);
395395
device_add(&keyboard_ps2_pci_device);
396396
device_add(&sst_flash_39sf020_device);
397-
if (gfxcard[0] == VID_INTERNAL) {
398-
device_add(&chips_69000_onboard_device);
399-
}
397+
if (gfxcard[0] == VID_INTERNAL)
398+
device_add(machine_get_vid_device(machine));
400399
spd_register(SPD_TYPE_SDRAM, 0x3, 256);
401400

402401
return ret;

src/machine/m_at_socket4.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -270,8 +270,7 @@ machine_at_valuepointp60_init(const machine_t *model)
270270
pci_register_slot(0x02, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0);
271271
device_add(&keyboard_ps2_ps1_pci_device);
272272
device_add(&sio_device);
273-
device_add(&ide_rz1000_pci_single_channel_device);
274-
device_add(&fdc37c665_device);
273+
device_add(&fdc37c665_ide_device);
275274
device_add(&intel_flash_bxt_ami_device);
276275

277276
device_add(&i430lx_device);

src/machine/m_pcjr.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1541,7 +1541,7 @@ machine_pcjr_init(UNUSED(const machine_t *model))
15411541

15421542
/* Initialize the video controller. */
15431543
video_reset(gfxcard[0]);
1544-
loadfont("roms/video/mda/mda.rom", 0);
1544+
loadfont(FONT_IBM_MDA_437_PATH, 0);
15451545
device_context(&pcjr_device);
15461546
pcjr_vid_init(pcjr);
15471547
device_context_restore();

src/machine/m_xt_olivetti.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2366,8 +2366,8 @@ machine_xt_m240_init(const machine_t *model)
23662366
m24_kbd_t *m24_kbd;
23672367
nvr_t *nvr;
23682368

2369-
ret = bios_load_interleaved("roms/machines/m240/olivetti_m240_pchj_2.12_low.bin",
2370-
"roms/machines/m240/olivetti_m240_pchk_2.12_high.bin",
2369+
ret = bios_load_interleaved("roms/machines/m240/olivetti_m240_pchm_2.12_low.bin",
2370+
"roms/machines/m240/olivetti_m240_pchl_2.12_high.bin",
23712371
0x000f8000, 32768, 0);
23722372

23732373
if (bios_only || !ret)

src/machine/machine_table.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16502,7 +16502,7 @@ const machine_t machines[] = {
1650216502
.device = NULL,
1650316503
.fdc_device = NULL,
1650416504
.sio_device = NULL,
16505-
.vid_device = NULL,
16505+
.vid_device = &chips_69000_onboard_device,
1650616506
.snd_device = NULL,
1650716507
.net_device = NULL
1650816508
},

0 commit comments

Comments
 (0)