#78417 - 04/07/12 04:15 AM
Emulation of the DAI Personal Computer with MESS
|
Member
Registered: 04/01/12
Posts: 7
Loc: Brazil
|
The DAI was the first personal computer I bought, in 1980. It stayed with me until 1990, when it stopped to function correctly. At this time, I was living in Brazil and I did not find a way to repair it. But I always kept some nostalgia of my DAI! Sometimes I tried to find one for sale in France, putting announcements in journals, but I was not successful.
Recently, I installed the MESS emulation program (mess.145) in my PC and, using DAI´s ROMs, I could see it functioning again. However, I was disappointed by the fact that the emulation does not reproduce the sounds (only the noise generator seems to function well). I would like to know if it is possible to contact the DAI driver authors, Krzysztof Strzecha and Nathan Woods, or someone who has also worked on this computer in order to solve this problem (in 2004, the authors stated that everything in the emulation was OK). I know that this machine is not very procured, but it is a really rare one, with interesting characteristics.
I can indicate what I observed with the DAI emulation: only the noise is correctly generated by the NOISE function and can be heard from the speakers. But the SOUND function (3 channels) seems to be inactive, giving only a transitory week signal, particularly when glissando is chosen. It seems to me that the D8253 programmable timer is not correctly simulated (or not correctly controlled by the emulation).
The other point is that, when NOISE or SOUND functions are active, the keyboard is very slow, and I guess if there would be an undesired interaction between the TMS5501 and the D8253. The keyboard returns to its normal working after applying the SOUND OFF command.
Is there anybody who could help me to get a good emulation of the DAI Personal Computer with MESS?
|
|
Top
|
|
|
|
#78579 - 04/21/12 03:33 AM
Re: Emulation of the DAI Personal Computer with MESS
[Re: Denis David]
|
Member
Registered: 04/01/12
Posts: 7
Loc: Brazil
|
I tried to understand what is the problem in the DAI emulation. Instead of using the SOUND command, I tried to inform the frequency and the volume with POKEs at the DAI I/O addresses. Putting the volume into the #FD04 and #FD05 addresses works well. But when I tried to write the oscillator frequency into #FC00, for instance, the sound generator continued mute. This gives strength to my argument that the PIT 8253 should not be correctly interfaced in the DAI emulation. At this point, I would like to observe that I didn't meet any reference to the mapping of the DAI I/O in the sources, except in remarks. Does it exist, in the MESS simulation, a file in which these parameters are clearly defined? One more time, I would be very happy if someone could help me!
|
|
Top
|
|
|
|
#78580 - 04/21/12 04:02 AM
Re: Emulation of the DAI Personal Computer with MESS
[Re: Denis David]
|
Very Senior Member
Registered: 03/17/01
Posts: 13172
Loc: USA
|
The code you seek is in src/mess/machine/dai.c. You will see the PIT8253 configuration structure and the 3 output lines connected to the functions "dai_pit_out0", "dai_pit_out1", and "dai_pit_out2".
|
|
Top
|
|
|
|
#78592 - 04/21/12 01:03 PM
Re: Emulation of the DAI Personal Computer with MESS
[Re: Denis David]
|
Member
Registered: 04/01/12
Posts: 7
Loc: Brazil
|
I have found easily these three "signals", but in order to get some sounds, they must be read by the DAI audio section, and when I look at src/mess/audio/dai.c, I don't see where dai_pit_out0/1/2 enter, while the noise signal is clearly seen in the STEAM_UPDATE function. Thus the problem could be that these outputs are not transmitted to the audio section.
Actually, I was also thinking about the possibility that the mode and the frequencies needed by the PIT8253 are not written into the PIT by the DAI software because of an erroneous addressing of the PIT. In DAI, the addresses to inform the PIT are #FD06 for commands, and #FD00, #FD02 and #FD04 for the three channel frequencies. And I don't find where this mapping is specified in the MESS emulation. Do you have any idea about that?
|
|
Top
|
|
|
|
#78593 - 04/21/12 01:58 PM
Re: Emulation of the DAI Personal Computer with MESS
[Re: Denis David]
|
Very Senior Member
Registered: 03/17/01
Posts: 13172
Loc: USA
|
The PIT is mapped in the DAI address map in src/mess/drivers/dai.c. Specifically:
static ADDRESS_MAP_START( dai_mem , AS_PROGRAM, 8, dai_state )
AM_RANGE( 0x0000, 0xbfff) AM_RAMBANK("bank1")
AM_RANGE( 0xc000, 0xdfff) AM_ROM
AM_RANGE( 0xe000, 0xefff) AM_ROMBANK("bank2")
AM_RANGE( 0xf000, 0xf7ff) AM_WRITE(dai_stack_interrupt_circuit_w )
AM_RANGE( 0xf800, 0xf8ff) AM_RAM
AM_RANGE( 0xfb00, 0xfbff) AM_READWRITE(dai_amd9511_r, dai_amd9511_w )
AM_RANGE( 0xfc00, 0xfcff) AM_DEVREADWRITE_LEGACY("pit8253", pit8253_r, pit8253_w )
AM_RANGE( 0xfd00, 0xfdff) AM_READWRITE(dai_io_discrete_devices_r, dai_io_discrete_devices_w )
AM_RANGE( 0xfe00, 0xfeff) AM_DEVREADWRITE("ppi8255", i8255_device, read, write)
AM_RANGE( 0xff00, 0xffff) AM_DEVREADWRITE_LEGACY("tms5501", tms5501_r, tms5501_w )
ADDRESS_MAP_END
The PIT is mapped at 0xFC00. 0xFD00/02/04 go to "dai_io_discrete_devices_r" and "dai_io_discrete_devices_w" which are again defined in src/mess/machine/dai.c. That code believes the only sound-related things in that range are volumes at 0xFD04 and 0xFD05. Incidentally, what version of MESS are you using? The PIT emulation got a lot of bugfixes relatively recently to enable e.g. Windows to boot in our PC driver.
|
|
Top
|
|
|
|
#78600 - 04/21/12 03:14 PM
Re: Emulation of the DAI Personal Computer with MESS
[Re: Denis David]
|
Member
Registered: 04/01/12
Posts: 7
Loc: Brazil
|
Thank you very much for this check. Effectively, I wrote #FD0x for the PIT address, but I was wrong. Thus, the map is correctly informed in the DAI driver. What is preoccupating me is the fact thap this mapping does not inform the details of the addresses. But may be, for the PIT 8253 works well, all the addresses used by the DAI software (#FC00, #FC02, #FC04 and #FC06) are equivalent (the PIT 8253 has a unique I/O port). If it is so, my preoccupation does not have sense.
The version I am using is Mess0145b-64. My computer is a DELL Inspiron running with Windows7.
|
|
Top
|
|
|
|
#78709 - 04/25/12 03:09 AM
Re: Emulation of the DAI Personal Computer with MESS
[Re: Denis David]
|
Member
Registered: 04/01/12
Posts: 7
Loc: Brazil
|
Is it possible to know what are the recently corrected bugs that were affecting the normal working of the PIT8253? From the analysis of these bugs, could it be possible to find an explaination to the absence of sounds in the DAI emulation? Do I use the correct version of MESS (145b-64)? Who fixed these bugs?
|
|
Top
|
|
|
|
#78710 - 04/25/12 03:25 AM
Re: Emulation of the DAI Personal Computer with MESS
[Re: Denis David]
|
Very Senior Member
Registered: 03/17/01
Posts: 13172
Loc: USA
|
Apparently I confused the 8253 with something else, the 8253 has had very little serious debugging work done on it since 2010. In either case, it's quite possible it has bugs in it due to specific cases that the DAI uses and other computers don't.
|
|
Top
|
|
|
|
#78786 - 05/03/12 06:56 PM
Re: Emulation of the DAI Personal Computer with MESS
[Re: Denis David]
|
Member
Registered: 04/01/12
Posts: 7
Loc: Brazil
|
I couldn't spend many time to verify all the code relative to sound emulation in MESS. But I saw that three lines from the PIT8253 are present in the ..\MESS\Mess-Sources\src\mess\machine\DAI.c file:
const struct pit8253_config dai_pit8253_intf = { { { 2000000, DEVCB_NULL, DEVCB_LINE(dai_pit_out0) }, { 2000000, DEVCB_NULL, DEVCB_LINE(dai_pit_out1) }, { 2000000, DEVCB_NULL, DEVCB_LINE(dai_pit_out2) } } };
As the noise channel is working well, this fact tends to confirm that the problem is in the PIT8253 simulation.
I tried to understand how the pit8253 code works, but I recognize that it is not very easy. As R. Belmont suggested that there may have a bug in the PIT8253 code that could have appeared in the last updates, I would like to know if it is possible to obtain the various releases of this code since 2010, or before. Perhaps by comparing the consecutive versions, it would be possible to detect the problem existing in the DAI emulation. Is there anyboby who could help me?
|
|
Top
|
|
|
|
#79711 - 05/29/12 06:37 PM
Re: Emulation of the DAI Personal Computer with MESS
[Re: Denis David]
|
Member
Registered: 06/06/10
Posts: 19
|
@Denis
I have tried to fix the sound and now the PIT seems work and the frequency is generated correctly, but the keyboard problem is still present. Anyway when you have time please check if the sound now is correct.
|
|
Top
|
|
|
|
|
|
4 registered (Tafoid, Praxis, box, B2K24),
23
Guests and
1
Spider online. |
|
Key:
Admin,
Global Mod,
Mod
|
|
4345 Members
9 Forums
7228 Topics
87127 Posts
Max Online: 183 @ 03/06/12 06:21 PM
|
|
|