joncampbell123 / dosbox-x

DOSBox-X fork of the DOSBox project
GNU General Public License v2.0
2.81k stars 383 forks source link

PC-98: FMP Music Disk Volume 8 intro does not play, special fully-nested mode not handled #3456

Closed Pawlicker closed 2 years ago

Pawlicker commented 2 years ago

Code of Conduct & Contributing Guidelines

Have you checked that no other similar bug report(s) already exists?

Edit: #1138 is about special fully-nested mode as well.

What operating system(s) this bug have occurred on?

KDE Neon, 5.13.0-40-generic #45~20.04.1-Ubuntu SMP Mon Apr 4 09:38:31 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

What version(s) of DOSBox-X have this bug?

0.83.25 SDL2 Linux64

Describe the bug

FMP Music Disk Volume 8 (DL link here) does not show the intro that normally plays when the disk is loaded on a real machine or Neko Project 21w. Instead it loads jumps right to the fake POST screen part of the intro and dumps a bunch of errors in the console before loading the rest of the software.

Expected behavior

Here's a video of the intro playing, before the fake POST screen and loader kicks in. https://www.youtube.com/watch?v=gL0mUtGrhHA

Steps to reproduce the behaviour

  1. Boot FMP Disk 8 via DOS commands.
  2. It will skip the intro and go right to the fake POST screen part.

Used configuration

flatpak run com.dosbox_x.DOSBox-X -set machine=pc98 -c "imgmount 2 ./fmpmd8.hdi -t hdd -fs none" -c "boot c:"

I'm not using the sound rom/samples as I'm not sure where to place them on the flatpak version.

Emulator log

LOG: Screen report: Method 'XRandR' (1920.000 x 1080.000 pixels) at (0.000 x 0.000) (280.000 x 160.000 mm) (11.024 x 6.299 in) (174.171 x 171.450 DPI)
LOG: PC-98 INT 18 AH=42h CH=0xC0
LOG: PC-98 INT 18 AH=42h CH=0x80
LOG: WARNING: No translation support (to host) for code page 0
LOG:    3046009 ERROR BIOS:Keyboard layout file auto not found
LOG:    3046009 ERROR BIOS:Keyboard layout file auto not found
LOG: XMS: 50 handles allocated for use by the DOS environment
LOG: EMS page frame at 0xd000-0xdfff
LOG: COMMAND.COM env size:             720 bytes
LOG: COMMAND.COM environment block:    0x0801 sz=0x002d
LOG: COMMAND.COM main body (PSP):      0x082f sz=0x009a
LOG: COMMAND.COM stack:                0x0849
LOG: IDE: index 0 slave=0
LOG: Image file has .HDI extension, assuming HDI image and will take on parameters in header.
LOG: HDI header: sectorsize is 512 bytes/sector, header is 4096 bytes, hdd size (plus header) is 3620864 bytes
LOG: HDI: Geometry is C/H/S 52/8/17
LOG: Mapping BIOS DISK C/H/S 52/8/17 as IDE 52/8/17
LOG: Booting guest OS stack_seg=0x0030 load_seg=0x1fe0
LOG: PC-98 INT 18 AH=42h CH=0x80
LOG: Removing UMB block 0xc600-0xcfff
LOG: Alright: DOS kernel shutdown, booting a guest OS
LOG:   CS:IP=1fe0:0000 SS:SP=0030:00d4 AX=4100 BX=0200 CX=8000 DX=0001
LOG: PC-98 INT 1Bh unknown SCSI BIOS call AX=00A0 BX=0200 CX=8000 DX=0001 SI=1FE0 DI=FFFE DS=0000 ES=1FE0
LOG: PC-98 INT 1Bh unknown SCSI BIOS call AX=00A0 BX=1C00 CX=1C20 DX=0002 SI=1D20 DI=FFFE DS=0000 ES=1C20
LOG: PC-98 INT 1Bh unknown SCSI BIOS call AX=00A0 BX=0400 CX=0000 DX=0002 SI=1D20 DI=FFFE DS=0000 ES=1C20
LOG: PC-98 INT 1Bh unknown SCSI BIOS call AX=00A0 BX=0400 CX=0034 DX=0000 SI=1D20 DI=FFFE DS=0000 ES=1C20
LOG: PC-98 INT 1Bh unknown SCSI BIOS call AX=00A0 BX=0200 CX=0100 DX=0001 SI=0800 DI=FFFE DS=0000 ES=1C20
LOG: PC-98 INT 1Bh unknown SCSI BIOS call AX=00A0 BX=0400 CX=0001 DX=0000 SI=0200 DI=FFFE DS=0000 ES=1FA0
LOG: PC-98 INT 1Bh unknown SCSI BIOS call AX=00A0 BX=0400 CX=0001 DX=0000 SI=0200 DI=FFFE DS=0000 ES=1FA0
LOG: PC-98 INT 1Ah unknown call AX=0000 BX=0800 CX=0000 DX=0000 SI=03FC DI=0400 DS=0000 ES=0000
LOG: PIC:ICW4: 1d, special fully-nested mode not handled
LOG: DOSBox-X has switched to max cycles, because of the setting: cycles=auto.
If the game runs too fast, try a fixed cycles amount in DOSBox-X's options.
LOG: PIC:ICW4: 1d, special fully-nested mode not handled
LOG: PIC:ICW4: 1d, special fully-nested mode not handled
LOG:    7350759 ERROR CPU:Write 0 to rom at d0000
LOG:    7350759 ERROR CPU:Write ffff to rom at d0002
LOG:    7350759 ERROR CPU:Write ffff to rom at d0000
LOG:    7350759 ERROR CPU:Write ffff to rom at d0002
LOG:    7350855 ERROR CPU:Write 0 to rom at d1000
LOG:    7350855 ERROR CPU:Write ffff to rom at d1002
LOG:    7350855 ERROR CPU:Write ffff to rom at d1000
LOG:    7350855 ERROR CPU:Write ffff to rom at d1002
LOG:    7350919 ERROR CPU:Write 0 to rom at d2000
LOG:    7350919 ERROR CPU:Write ffff to rom at d2002
LOG:    7350919 ERROR CPU:Write ffff to rom at d2000
LOG:    7350919 ERROR CPU:Write ffff to rom at d2002
LOG:    7350983 ERROR CPU:Write 0 to rom at d3000
LOG:    7350983 ERROR CPU:Write ffff to rom at d3002
LOG:    7350983 ERROR CPU:Write ffff to rom at d3000
LOG:    7350983 ERROR CPU:Write ffff to rom at d3002
LOG:    7351079 ERROR CPU:Write 0 to rom at d4000
LOG:    7351079 ERROR CPU:Write ffff to rom at d4002
LOG:    7351079 ERROR CPU:Write ffff to rom at d4000
LOG:    7351079 ERROR CPU:Write ffff to rom at d4002
LOG:    7351143 ERROR CPU:Write 0 to rom at d5000
LOG:    7351143 ERROR CPU:Write ffff to rom at d5002
LOG:    7351143 ERROR CPU:Write ffff to rom at d5000
LOG:    7351143 ERROR CPU:Write ffff to rom at d5002
LOG:    7351207 ERROR CPU:Write 0 to rom at d6000
LOG:    7351207 ERROR CPU:Write ffff to rom at d6002
LOG:    7351207 ERROR CPU:Write ffff to rom at d6000
LOG:    7351207 ERROR CPU:Write ffff to rom at d6002
LOG:    7351303 ERROR CPU:Write 0 to rom at d7000
LOG:    7351303 ERROR CPU:Write ffff to rom at d7002
LOG:    7351303 ERROR CPU:Write ffff to rom at d7000
LOG:    7351303 ERROR CPU:Write ffff to rom at d7002
LOG:    7351367 ERROR CPU:Write 0 to rom at d8000
LOG:    7351367 ERROR CPU:Write ffff to rom at d8002
LOG:    7351367 ERROR CPU:Write ffff to rom at d8000
LOG:    7351367 ERROR CPU:Write ffff to rom at d8002
LOG:    7351431 ERROR CPU:Write 0 to rom at d9000
LOG:    7351431 ERROR CPU:Write ffff to rom at d9002
LOG:    7351431 ERROR CPU:Write ffff to rom at d9000
LOG:    7351431 ERROR CPU:Write ffff to rom at d9002
LOG:    7351495 ERROR CPU:Write 0 to rom at da000
LOG:    7351495 ERROR CPU:Write ffff to rom at da002
LOG:    7351495 ERROR CPU:Write ffff to rom at da000
LOG:    7351495 ERROR CPU:Write ffff to rom at da002
LOG:    7351559 ERROR CPU:Write 0 to rom at db000
LOG:    7351559 ERROR CPU:Write ffff to rom at db002
LOG:    7351559 ERROR CPU:Write ffff to rom at db000
LOG:    7351559 ERROR CPU:Write ffff to rom at db002
LOG:    7351623 ERROR CPU:Write 0 to rom at dc000
LOG:    7351623 ERROR CPU:Write ffff to rom at dc002
LOG:    7351623 ERROR CPU:Write ffff to rom at dc000
LOG:    7351623 ERROR CPU:Write ffff to rom at dc002
LOG:    7351687 ERROR CPU:Write 0 to rom at dd000
LOG:    7351687 ERROR CPU:Write ffff to rom at dd002
LOG:    7351687 ERROR CPU:Write ffff to rom at dd000
LOG:    7351687 ERROR CPU:Write ffff to rom at dd002
LOG:    7351751 ERROR CPU:Write 0 to rom at de000
LOG:    7351751 ERROR CPU:Write ffff to rom at de002
LOG:    7351751 ERROR CPU:Write ffff to rom at de000
LOG:    7351751 ERROR CPU:Write ffff to rom at de002
LOG:    7351815 ERROR CPU:Write 0 to rom at df000
LOG:    7351815 ERROR CPU:Write ffff to rom at df002
LOG:    7351815 ERROR CPU:Write ffff to rom at df000
LOG:    7351815 ERROR CPU:Write ffff to rom at df002
LOG: PC-98 memcpy: src=0x19f30 dst=0x120000 data=0x176e1 count=0x1000
LOG: PC-98 memcpy: src=0x19f30 dst=0x123000 data=0x176e1 count=0x1000
LOG: PC-98 memcpy: src=0x1af30 dst=0x124000 data=0x176e1 count=0x1000
LOG: PC-98 memcpy: src=0x1af30 dst=0x125000 data=0x176e1 count=0x1000
LOG: PC-98 memcpy: src=0x1af30 dst=0x126000 data=0x176e1 count=0x1000
LOG: PC-98 memcpy: src=0x19f30 dst=0x127000 data=0x176e1 count=0x1000
LOG: PC-98 memcpy: src=0x19f30 dst=0x128000 data=0x176e1 count=0x1000
LOG: PC-98 memcpy: src=0x19f30 dst=0x129000 data=0x176e1 count=0x1000
LOG: PC-98 memcpy: src=0x19f30 dst=0x12a000 data=0x176e1 count=0x1000
LOG: PC-98 memcpy: src=0x127000 dst=0x139000 data=0x176e1 count=0x1000
LOG: PC-98 memcpy: src=0x127000 dst=0x13a000 data=0x176e1 count=0x1000
LOG: PC-98 memcpy: src=0x127000 dst=0x13b000 data=0x176e1 count=0x1000
LOG: PC-98 memcpy: src=0x127000 dst=0x13c000 data=0x176e1 count=0x1000
LOG: PC-98 memcpy: src=0x127000 dst=0x13d000 data=0x176e1 count=0x1000
LOG: PC-98 memcpy: src=0x127000 dst=0x13e000 data=0x176e1 count=0x1000
LOG: PC-98 memcpy: src=0x127000 dst=0x13f000 data=0x176e1 count=0x1000
LOG: PC-98 memcpy: src=0x127000 dst=0x140000 data=0x176e1 count=0x1000
LOG: PC-98 memcpy: src=0x127510 dst=0x123000 data=0x176e1 count=0x100
LOG: PC-98 memcpy: src=0xc38e dst=0x136086 data=0x176e1 count=0x8
LOG: PC-98 memcpy: src=0xc38e dst=0x13608e data=0x176e1 count=0x8
LOG: PC-98 memcpy: src=0xc38e dst=0x136096 data=0x176e1 count=0x8
LOG: PC-98 memcpy: src=0xc38e dst=0x13609e data=0x176e1 count=0x8
LOG: PC-98 memcpy: src=0xc38e dst=0x1360a6 data=0x176e1 count=0x8
LOG: PC-98 memcpy: src=0xc38e dst=0x1360ae data=0x176e1 count=0x8
LOG: PC-98 memcpy: src=0xc38e dst=0x1360b6 data=0x176e1 count=0x8
LOG: PC-98 memcpy: src=0xc38e dst=0x1360be data=0x176e1 count=0x8
LOG: PC-98 memcpy: src=0x19f30 dst=0x1360c6 data=0x176e1 count=0x100
LOG: PC-98 memcpy: src=0x19f30 dst=0x1361c6 data=0x176e1 count=0x200
LOG: PC-98 memcpy: src=0x19f30 dst=0x1363c6 data=0x176e1 count=0x400
LOG: PC-98 memcpy: src=0xc3a0 dst=0x12c000 data=0x176e1 count=0x7070
LOG: PC-98 memcpy: src=0x9380 dst=0x133070 data=0x176e1 count=0x3016
LOG: PC-98 memcpy: src=0x8530 dst=0x136c10 data=0x176e1 count=0x480
LOG: PC-98 memcpy: src=0x8b50 dst=0x137090 data=0x176e1 count=0x800
LOG: PC-98 memcpy: src=0x89b0 dst=0x137890 data=0x176e1 count=0xfef
LOG: PC-98 INT 18 AH=42h CH=0xC0

Additional context

No response

grapeli commented 2 years ago

It works and plays for me.

https://user-images.githubusercontent.com/452325/166557891-01c23a19-e350-420a-bc0e-3b9444c0fffb.mp4

edit: On the video link, loading of Music Disk Volume 8 starts from 37 seconds, before the intorduction is assembled.

This part is definitely not from PC98.

https://user-images.githubusercontent.com/452325/166565744-37b4dbe5-5db6-452c-8673-275a3be45b50.mp4

Pawlicker commented 2 years ago

It works and plays for me.

edit: On the video link, loading of Music Disk Volume 8 starts from 37 seconds, before the intorduction is assembled.

This part is definitely not from PC98.

The bat file calls an opening demo (md8op.com) before loading the player itself. On the real machine this is how it looks. The same applies if you run the music disk under NP21w.

https://user-images.githubusercontent.com/92184373/166613949-a5d3bd10-f733-4d45-8bd3-f78ea11b2ce0.mp4

grapeli commented 2 years ago

I booted this disc (volume 8) under Neko Project 21/W and indeed the intro looks just like the videos you link to. Sorry for the confusion.

grapeli commented 2 years ago

The startup batch FMPD8.BAT contains the following commands.

fmp r
fmp s -#29 -vf00 -vs00 -vr00 -vp00 -vz00 -s -cx -d$0
ppz8 s -i00 -b08 -aw61 -d3
chkppz8
if errorlevel 1 goto PPZ
chk_ems /e88
if errorlevel 1 goto NO_EMS
play pl.ozi /c /d
md8op /c
goto PLAY

:PPZ
ppz s /w /m0

:PLAY
md8
fmp r
goto END
:NO_EMS
:END

There seems to be a error under dosbox-x when checking chkppz8 and the boot sequence without an intro follows. You can force this intro. Close the player. Enter these commands.

fmp s -#29 -vf00 -vs00 -vr00 -vp00 -vz00 -s -cx -d$0
md8op /c

After playing it, the system locks up.

https://user-images.githubusercontent.com/452325/166802627-2742d520-07c8-432b-a7c4-39c92fd0fe56.mp4

maron2000 commented 2 years ago

FMP incorrectly detects "86board" as "Speak Board", therefore, ppz8 complains that there are no 86board. On np21/w, if you switch the sound board to "Speak Board", the same occurs.

guest os_000

maron2000 commented 2 years ago

For your interest, PPZ.com is a 3ch PCM driver using PSG. https://www.vector.co.jp/soft/dos/art/se003768.html

PPZ8.com is a 8ch PCM driver using 9801-86 board or WSS PCM feature. https://www.vector.co.jp/soft/dos/art/se022226.html

myon98 commented 2 years ago

I think implementing the Sound ID (I/O 0xa460) is required to announce the presence of 86PCM. (Or WSS, because PPZ8 also supports it)

FMP first tries reading from the Sound ID to see if it has a 86 card or equivalent, and then falls back to probing to detect pre-73/86 or third-party cards, and detects a Speak Board (OPNA w/ ADPCM DRAM) when it sees an OPNA. But PPZ8 probably only tries Sound ID because it's looking for a linear and streaming PCM.

maron2000 commented 2 years ago

@myon98 Thanks for your information. According to this page, Sound ID is as follows. https://www.mfp.gr.jp/users/takas/prog/wssmix.html

Sound ID is an ID describing PCM capability of NEC sound cards, and is stored in the upper 4bits of port A460. It is shared with OPNA mask flag which are the lower 2bits. Sound ID of 86 board 4 : when using port 188h 5: when using port 288h

Edit: I found the code which returns Sound ID 4. Strange that it isn't effective? Excerpted from pcm86io.c

static REG8 IOINPCALL pcm86_ia460(UINT port) {

    (void)port;
    return(0x40 | (pcm86.extfunc & 1));
}
myon98 commented 2 years ago

I'm not fully familiar with the code structure yet, but I don't see that function being referenced anywhere else. Maybe it just needs a call to cbuscore_attachsndex to register the port, but I'm not sure whether other aspects of 86PCM (that looks like it's from NP2) is integrated into dosbox-x or not yet. I'll probably try looking into it.

myon98 commented 2 years ago

It seems like many parts of 86PCM has not been ported yet, many parts of pcm86c.c are commented out and pcm86io.c is not compiled at all. I might try integrating it but I'm not really sure.

Also in my experience PPZ8 doesn't do really well under the timing characteristics of emulators. Maybe dosbox-x is different in this aspect but I'm not really sure. Perhaps presenting a virtual PPZ8 interrupt interface that gets implemented by the host might be desired for the best quality? (jk)

maron2000 commented 2 years ago

I haven't gone deep in to the code, but assuming you're right, it may explain issue #2970 as well. (The Opening PCM song in Harlem Blade doesn't play)

maron2000 commented 2 years ago

For experiment, I added a code to always return Sound ID=4. FMP.com recognizes the sound card as 86 board, but PPZ8 freezes on loading. The log says Invalid opcode or unhandled PC-98 STOP key interrupt 06h So, I think we need to fix some code of PCM feature. ppz8_000

maron2000 commented 2 years ago

Update on my previous comment. I forgot to boot MS-DOS before loading the demo. If I do so, it successfully loaded PPZ8.com as well.

I refered to Undocumented 9801/9821 Vol.2 for which I/O ports to add. https://www.webtech.co.jp/company/doc/undocumented_mem/io_sound.txt Added ports are A460, A466, A468, A46A, A46C A66E. All values returned are dummy data. (Maybe we don't need all)

I uploaded the hack(patch) on my repository commit 348484bd6fc06819e122cd88f4a0171b7155dc2e I know I shouldn't but since I don't know how to add I/O port address from scratch, I amended timer.cpp, which has some I/O port access. I hope someone can add this in a more neatly and in a way it should be.

I attach a video, something went wrong with the size, but at least you can see it working.

https://user-images.githubusercontent.com/68574602/168460449-25963929-e12a-4f4e-abb5-439708b06571.mp4

Edit:The link to the reference material was wrong, so I fixed it.

grapeli commented 2 years ago

I confirm. Well done. With your patch (hack) now "FMP Music Disk Volume 8" starts with the intro under DOSBox-X.