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-2025 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 */
27#pragma once
28
29#ifndef SCC_H_
30#define SCC_H_
31
32#include <stdint.h>
33
52 int8_t data[32];
53};
54
63 volatile const struct SCC_Waveform * ro_waveform;
68 volatile struct SCC_Waveform * wo_waveform;
72 volatile uint16_t * rw_fdr;
76 volatile uint8_t * rw_volume;
77};
78
82struct SCC_Device {
86 volatile uint8_t * rw_channel_mask;
91 volatile uint8_t * wo_deformation;
96};
97
107struct SCC {
108 uint8_t slot;
109 uint8_t version;
110 uint8_t mode;
111 const struct SCC_Device * device;
112};
113
121uint8_t SCC_inspect(uint8_t slot);
122
143uint8_t SCC_find(struct SCC * scc);
144
158void SCC_set_mode(struct SCC * scc, uint8_t mode);
159
172uint8_t SCC_get_mode(struct SCC * scc);
173
184void SCC_enable(const struct SCC * scc);
185
196void SCC_disable(const struct SCC * scc);
197
200#endif // SCC_H_
const struct SCC_Device * device
Pointer to device interface.
Definition scc.h:111
volatile uint8_t * rw_volume
Pointer to read/write data from/to the volume register.
Definition scc.h:76
volatile uint8_t * wo_deformation
Pointer to write a value to the deformation register.
Definition scc.h:91
uint8_t slot
Slot address of the SCC/SCC+.
Definition scc.h:108
uint8_t version
1 if SCC, 2 or greater value if SCC+.
Definition scc.h:109
int8_t data[32]
Definition scc.h:52
volatile const struct SCC_Waveform * ro_waveform
Pointer to read data from the 32-byte waveform data register.
Definition scc.h:63
volatile uint8_t * rw_channel_mask
Pointer to read/write a value from/to the channel mask register.
Definition scc.h:86
volatile struct SCC_Waveform * wo_waveform
Pointer to write data to the 32-byte waveform data register.
Definition scc.h:68
struct SCC_Channel channels[5]
Device interface for each 5 channels.
Definition scc.h:95
volatile uint16_t * rw_fdr
Pointer to read/write data from/to the frequency division ratio register.
Definition scc.h:72
uint8_t mode
1 if SCC compatible mode, 2 if SCC+ mode.
Definition scc.h:110
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:107
Device interface for a sound channel of SCC/SCC+ sound chip.
Definition scc.h:58
Device interface for SCC/SCC+ sound chip.
Definition scc.h:82
The structure of the SCC/SCC+ 32-byte waveform data register.
Definition scc.h:51