I'm currently writing a game menu program to sit in the AUTO folder which will then list the available games allow a user to select and run them.
I've got the basics working but because it runs before the sound control panel has started the sound defaults to maximum volume with the internal speaker turned on.
What I would like to do is allow the program's configuration file to contain the default volume and whether the internal speaker is enabled.
I think I can probably work out how to use the Microwire interface to control the volume from C but I've found no documentation about how to control the internal speaker. The Atari TT release notes don't mention it and merely say that the DMA sound system is the same as the STe's. I'm guessing that it would be the same on the Mega STe.
Does anyone know?
Controlling the TT sound system.
Moderator: troed
- stephen_usher
- Posts: 5678
- Joined: Mon Nov 13, 2017 7:19 pm
- Location: Oxford, UK.
- Contact:
Controlling the TT sound system.
Intro retro computers since before they were retro...
ZX81->Spectrum->Memotech MTX->Sinclair QL->520STM->BBC Micro->TT030->PCs & Sun Workstations.
Added code to the MiNT kernel (still there the last time I checked) + put together MiNTOS.
Collection now with added Macs, Amigas, Suns and Acorns.
ZX81->Spectrum->Memotech MTX->Sinclair QL->520STM->BBC Micro->TT030->PCs & Sun Workstations.
Added code to the MiNT kernel (still there the last time I checked) + put together MiNTOS.
Collection now with added Macs, Amigas, Suns and Acorns.
- stephen_usher
- Posts: 5678
- Joined: Mon Nov 13, 2017 7:19 pm
- Location: Oxford, UK.
- Contact:
Re: Controlling the TT sound system.
Someone on the Atari Forum pointed me at the XCONTROL.ACC source file 'block2.c' which uses the following to control the TT speaker:
P.S. I think I've seen why my volume setting might be broken, I should use 0x04c0 rather than 0x0400 to add to the volume level (0 -> 40).
Now, I've put this in my code and it makes not a darned bit of difference, as you can see here with my broken for some reason volume setting code...void
Set_Speaker( void )
{
if( IsSpeaker() )
{
if( cur_value.TT_Speaker )
Offgibit( 0xBf ); /* Turn off Speaker */
else
Ongibit( 0x40 ); /* Turn on Speaker */
}
}
What fun the STe/TT sound system is, not!#include <osbind.h>
#include <string.h>
#define MICROWIRE_DATA_ADDR 0xff8922
#define MICROWIRE_MASK_ADDR 0xff8924
unsigned short *mw_mask = MICROWIRE_MASK_ADDR;
unsigned short *mw_data = MICROWIRE_DATA_ADDR;
unsigned short value;
void do_microwire();
void set_volume(int volume)
{
value = 0x0400 + volume;
Supexec(do_microwire);
return;
}
void do_microwire()
{
int i;
unsigned short mask = 0x07ff;
*mw_mask = mask;
while(*mw_mask != mask) i++;
*mw_data = value;
}
void set_speaker(int onoff)
{
if (onoff == 0)
Offgibit(0x8f);
else
Ongibit(0x40);
return;
}
P.S. I think I've seen why my volume setting might be broken, I should use 0x04c0 rather than 0x0400 to add to the volume level (0 -> 40).
Intro retro computers since before they were retro...
ZX81->Spectrum->Memotech MTX->Sinclair QL->520STM->BBC Micro->TT030->PCs & Sun Workstations.
Added code to the MiNT kernel (still there the last time I checked) + put together MiNTOS.
Collection now with added Macs, Amigas, Suns and Acorns.
ZX81->Spectrum->Memotech MTX->Sinclair QL->520STM->BBC Micro->TT030->PCs & Sun Workstations.
Added code to the MiNT kernel (still there the last time I checked) + put together MiNTOS.
Collection now with added Macs, Amigas, Suns and Acorns.
- stephen_usher
- Posts: 5678
- Joined: Mon Nov 13, 2017 7:19 pm
- Location: Oxford, UK.
- Contact:
Re: Controlling the TT sound system.
Doh! I've just re-read the TT Release Notes again and found what it says is the speaker on/off:
Still Ongibit(6) and Offgibit(6) still don't do anything for the speaker.
I'm guessing that the '*' means TT only, but that doesn't fit with the bits 0-3 definitions.PROGRAMMABLE SOUND GENERATOR
(also provides bi-directional parallel printer port and miscellaneous output latch)
8800 RO xxxx xxxx ---- ---- PSG Read Data
8800 WO 0000 0000 ---- ---- PSG Register Select
8802 WO xxxx xxxx ---- ---- PSG Write Data
Port A Bit Assignments
7 *LAN Select (0 routes SCC Port A to LAN connector)
6 *Speaker Disable (0 disables internal speaker)
5 Printer Port Strobe
4 *DTR (MFP-ST serial port)
3 *RTS (MFP-ST serial port)
2 *Floppy 1 Select
1 *Floppy 0 Select
0 *Floppy Side 0 Select
Still Ongibit(6) and Offgibit(6) still don't do anything for the speaker.
Intro retro computers since before they were retro...
ZX81->Spectrum->Memotech MTX->Sinclair QL->520STM->BBC Micro->TT030->PCs & Sun Workstations.
Added code to the MiNT kernel (still there the last time I checked) + put together MiNTOS.
Collection now with added Macs, Amigas, Suns and Acorns.
ZX81->Spectrum->Memotech MTX->Sinclair QL->520STM->BBC Micro->TT030->PCs & Sun Workstations.
Added code to the MiNT kernel (still there the last time I checked) + put together MiNTOS.
Collection now with added Macs, Amigas, Suns and Acorns.
- stephen_usher
- Posts: 5678
- Joined: Mon Nov 13, 2017 7:19 pm
- Location: Oxford, UK.
- Contact:
Re: Controlling the TT sound system.
Oh well, it turns out Ongibit(0x40) was working to turn off the speaker but the game I was testing all the time, "Bubble Bobble" (or the hard disk loader) seems to reset the PSG Port A for some unknown reason.
I only found this out after trying many things including upgrading mintlibs to patchlevel 46 from 44, making sure that the argument passed was an unsigned short etc.
I'd given up and moved onto the machine detection part. Then I tried "Chaos Engine" and amazingly there was no sound from the speaker!
So, the final job will be turning off the CPU caches if the machine is a TT.
I only found this out after trying many things including upgrading mintlibs to patchlevel 46 from 44, making sure that the argument passed was an unsigned short etc.
I'd given up and moved onto the machine detection part. Then I tried "Chaos Engine" and amazingly there was no sound from the speaker!
So, the final job will be turning off the CPU caches if the machine is a TT.
Intro retro computers since before they were retro...
ZX81->Spectrum->Memotech MTX->Sinclair QL->520STM->BBC Micro->TT030->PCs & Sun Workstations.
Added code to the MiNT kernel (still there the last time I checked) + put together MiNTOS.
Collection now with added Macs, Amigas, Suns and Acorns.
ZX81->Spectrum->Memotech MTX->Sinclair QL->520STM->BBC Micro->TT030->PCs & Sun Workstations.
Added code to the MiNT kernel (still there the last time I checked) + put together MiNTOS.
Collection now with added Macs, Amigas, Suns and Acorns.
- stephen_usher
- Posts: 5678
- Joined: Mon Nov 13, 2017 7:19 pm
- Location: Oxford, UK.
- Contact:
Re: Controlling the TT sound system.
Just in case you're interested I've finished my game menu program and you can download it here:
http://www.lingula.org.uk/~steve/downlo ... enu.tar.gz
http://www.lingula.org.uk/~steve/downlo ... enu.tar.gz
Intro retro computers since before they were retro...
ZX81->Spectrum->Memotech MTX->Sinclair QL->520STM->BBC Micro->TT030->PCs & Sun Workstations.
Added code to the MiNT kernel (still there the last time I checked) + put together MiNTOS.
Collection now with added Macs, Amigas, Suns and Acorns.
ZX81->Spectrum->Memotech MTX->Sinclair QL->520STM->BBC Micro->TT030->PCs & Sun Workstations.
Added code to the MiNT kernel (still there the last time I checked) + put together MiNTOS.
Collection now with added Macs, Amigas, Suns and Acorns.
- stephen_usher
- Posts: 5678
- Joined: Mon Nov 13, 2017 7:19 pm
- Location: Oxford, UK.
- Contact:
Re: Controlling the TT sound system.
Darn! The board won't allow the attachment of *.zoo files. So, here's a link to the binary download...
http://www.lingula.org.uk/~steve/downloads/gamemenu.zoo
http://www.lingula.org.uk/~steve/downloads/gamemenu.zoo
Intro retro computers since before they were retro...
ZX81->Spectrum->Memotech MTX->Sinclair QL->520STM->BBC Micro->TT030->PCs & Sun Workstations.
Added code to the MiNT kernel (still there the last time I checked) + put together MiNTOS.
Collection now with added Macs, Amigas, Suns and Acorns.
ZX81->Spectrum->Memotech MTX->Sinclair QL->520STM->BBC Micro->TT030->PCs & Sun Workstations.
Added code to the MiNT kernel (still there the last time I checked) + put together MiNTOS.
Collection now with added Macs, Amigas, Suns and Acorns.
- stephen_usher
- Posts: 5678
- Joined: Mon Nov 13, 2017 7:19 pm
- Location: Oxford, UK.
- Contact:
Re: Controlling the TT sound system.
ZOO is one of the old standard formats for the Atari, along with LHarc.
Intro retro computers since before they were retro...
ZX81->Spectrum->Memotech MTX->Sinclair QL->520STM->BBC Micro->TT030->PCs & Sun Workstations.
Added code to the MiNT kernel (still there the last time I checked) + put together MiNTOS.
Collection now with added Macs, Amigas, Suns and Acorns.
ZX81->Spectrum->Memotech MTX->Sinclair QL->520STM->BBC Micro->TT030->PCs & Sun Workstations.
Added code to the MiNT kernel (still there the last time I checked) + put together MiNTOS.
Collection now with added Macs, Amigas, Suns and Acorns.
Re: Controlling the TT sound system.
I can't even remember last time I saw a zoo file. I never added it into the forum support list. Most users will download on PC first , so easier to use zip as easily supported on ST and PC IMO
https://www.exxosforum.co.uk/atari/ All my hardware guides - mods - games - STOS
https://www.exxosforum.co.uk/atari/store2/ - All my hardware mods for sale - Please help support by making a purchase.
viewtopic.php?f=17&t=1585 Have you done the Mandatory Fixes ?
Just because a lot of people agree on something, doesn't make it a fact. ~exxos ~
People should find solutions to problems, not find problems with solutions.
https://www.exxosforum.co.uk/atari/store2/ - All my hardware mods for sale - Please help support by making a purchase.
viewtopic.php?f=17&t=1585 Have you done the Mandatory Fixes ?
Just because a lot of people agree on something, doesn't make it a fact. ~exxos ~
People should find solutions to problems, not find problems with solutions.
- stephen_usher
- Posts: 5678
- Joined: Mon Nov 13, 2017 7:19 pm
- Location: Oxford, UK.
- Contact:
Re: Controlling the TT sound system.
I'm not sure I have something as modern as zip or unzip on any of my Ataris.
Hey! I'm still using GCC 2.5.8 and mintlib pl. 46 after all.
Intro retro computers since before they were retro...
ZX81->Spectrum->Memotech MTX->Sinclair QL->520STM->BBC Micro->TT030->PCs & Sun Workstations.
Added code to the MiNT kernel (still there the last time I checked) + put together MiNTOS.
Collection now with added Macs, Amigas, Suns and Acorns.
ZX81->Spectrum->Memotech MTX->Sinclair QL->520STM->BBC Micro->TT030->PCs & Sun Workstations.
Added code to the MiNT kernel (still there the last time I checked) + put together MiNTOS.
Collection now with added Macs, Amigas, Suns and Acorns.
Re: Controlling the TT sound system.
Easy to dostephen_usher wrote: ↑Tue May 29, 2018 7:38 pm I'm not sure I have something as modern as zip or unzip on any of my Ataris.
https://www.exxosforum.co.uk/forum/viewt ... ?f=25&t=58
https://www.exxosforum.co.uk/atari/ All my hardware guides - mods - games - STOS
https://www.exxosforum.co.uk/atari/store2/ - All my hardware mods for sale - Please help support by making a purchase.
viewtopic.php?f=17&t=1585 Have you done the Mandatory Fixes ?
Just because a lot of people agree on something, doesn't make it a fact. ~exxos ~
People should find solutions to problems, not find problems with solutions.
https://www.exxosforum.co.uk/atari/store2/ - All my hardware mods for sale - Please help support by making a purchase.
viewtopic.php?f=17&t=1585 Have you done the Mandatory Fixes ?
Just because a lot of people agree on something, doesn't make it a fact. ~exxos ~
People should find solutions to problems, not find problems with solutions.