a2bejwld/a2bejwld/sound.h
Jeremy Rand 20ad7dda1c Add code from Total Replay to detect the sound chip automatically on startup. This then leads to a complete rethinking about how to save/load the options for the game. It used to ask what slot the mockingboard was in (if any) and whether it had a speech chip. Now, the game should just know this information. So, I turned the first boolean in the save file into an options file version byte and bumped it to "2". The boolean was always true and was kind of a very simple "magic number" to say that the contents was valid. Now it is a version number of the contents. The slot number and boolean for the speech chip is are now each turned into booleans - one to say whether to enable a mockingboard if found and the other to enable the speech chip if found.
This means there are three booleans in the options related to sound now.  The first one enables/disables sound entirely and is default on.  The second is only relevant if the sound is enabled and says "use a mockingboard if present".  Again this is true by default.  Finally, the this says "use a speech chip on the mockingboard if present" and is only relevant if the mockingboard is also enabled.

So, the basic approach now is to default the "best" sound options and auto-detect the sound HW at launch.  The user can then use the options to downgrade their sound all the way to basic Apple // sound or turn off the sound entirely.
2020-03-04 22:23:09 -05:00

41 lines
926 B
C

//
// sound.h
// a2bejwld
//
// Created by Jeremy Rand on 2016-12-18.
// Copyright © 2016 Jeremy Rand. All rights reserved.
//
#ifndef __a2bejwld__sound__
#define __a2bejwld__sound__
#include <stdbool.h>
#include <stdint.h>
#include "mockingboard.h"
extern void soundInit(bool enableSounds, bool enableMockingBoard, bool enableSpeechChip);
extern void soundShutdown(void);
extern void beginClearGemSound(void);
extern void playSoundForExplodingGem(void);
extern void playSoundForStarringGem(void);
extern void playSoundForSpecialGem(void);
extern void playClearGemSound(uint8_t frame);
extern void playLandingSound(uint8_t numLanded);
extern void speakGo(void);
extern void speakLevelComplete(void);
extern void speakGetReady(void);
extern void speakNoMoreMoves(void);
extern bool speakGood(void);
extern bool speakExcellent(void);
extern bool speakIncredible(void);
#endif /* defined(__a2bejwld__sound__) */