libmsx
C library for MSX
Loading...
Searching...
No Matches
scc.h
Go to the documentation of this file.
1// -*- coding: utf-8-unix -*-
2/*
3 * Copyright (c) 2021-2024 Daishi Mori (mori0091)
4 *
5 * This software is released under the MIT License.\n
6 * See https://github.com/mori0091/libmsx/blob/main/LICENSE
7 *
8 * GitHub libmsx project\n
9 * https://github.com/mori0091/libmsx
10 */
26#pragma once
27
28#ifndef SCC_H_
29#define SCC_H_
30
31#include <stdint.h>
32
51 int8_t data[32];
52};
53
62 volatile const struct SCC_Waveform * ro_waveform;
67 volatile struct SCC_Waveform * wo_waveform;
71 volatile uint16_t * rw_fdr;
75 volatile uint8_t * rw_volume;
76};
77
81struct SCC_Device {
85 volatile uint8_t * rw_channel_mask;
90 volatile uint8_t * wo_deformation;
95};
96
106struct SCC {
107 uint8_t slot;
108 uint8_t version;
109 uint8_t mode;
110 const struct SCC_Device * device;
111};
112
120uint8_t SCC_inspect(uint8_t slot);
121
142uint8_t SCC_find(struct SCC * scc);
143
157void SCC_set_mode(struct SCC * scc, uint8_t mode);
158
171uint8_t SCC_get_mode(struct SCC * scc);
172
183void SCC_enable(const struct SCC * scc);
184
195void SCC_disable(const struct SCC * scc);
196
199#endif // SCC_H_
const struct SCC_Device * device
Pointer to device interface.
Definition scc.h:110
volatile uint8_t * rw_volume
Pointer to read/write data from/to the volume register.
Definition scc.h:75
volatile uint8_t * wo_deformation
Pointer to write a value to the deformation register.
Definition scc.h:90
uint8_t slot
Slot address of the SCC/SCC+.
Definition scc.h:107
uint8_t version
1 if SCC, 2 or greater value if SCC+.
Definition scc.h:108
int8_t data[32]
Definition scc.h:51
volatile const struct SCC_Waveform * ro_waveform
Pointer to read data from the 32-byte waveform data register.
Definition scc.h:62
volatile uint8_t * rw_channel_mask
Pointer to read/write a value from/to the channel mask register.
Definition scc.h:85
volatile struct SCC_Waveform * wo_waveform
Pointer to write data to the 32-byte waveform data register.
Definition scc.h:67
struct SCC_Channel channels[5]
Device interface for each 5 channels.
Definition scc.h:94
volatile uint16_t * rw_fdr
Pointer to read/write data from/to the frequency division ratio register.
Definition scc.h:71
uint8_t mode
1 if SCC compatible mode, 2 if SCC+ mode.
Definition scc.h:109
uint8_t SCC_get_mode(struct SCC *scc)
MSX Check which mode the SCC handle is set to.
void SCC_enable(const struct SCC *scc)
MSX Enable SCC/SCC+ sound chip.
void SCC_set_mode(struct SCC *scc, uint8_t mode)
MSX Set the SCC handle to SCC compatible mode or SCC+ mode.
uint8_t SCC_find(struct SCC *scc)
MSX Find SCC/SCC+ sound chip.
void SCC_disable(const struct SCC *scc)
MSX Disable SCC/SCC+ sound chip.
uint8_t SCC_inspect(uint8_t slot)
MSX Inspect whether SCC/SCC+ is on the given slot.
SCC Handle.
Definition scc.h:106
Device interface for a sound channel of SCC/SCC+ sound chip.
Definition scc.h:57
Device interface for SCC/SCC+ sound chip.
Definition scc.h:81
The structure of the SCC/SCC+ 32-byte waveform data register.
Definition scc.h:50