llvm-mos-sdk
mapper.h
Go to the documentation of this file.
1 #ifndef _MAPPER_H_
2 #define _MAPPER_H_
3 
4 #include <stdbool.h>
5 
6 #ifdef __cplusplus
7 extern "C" {
8 #endif
9 
10 // Enables/disables disk I/O registers.
12 
13 // Enables/disables sound I/O registers.
15 
16 // Set the next byte to write to disk.
18 
19 #define TRANSFER_WRITE 0
20 #define TRANSFER_READ 1
21 
22 // Set the current disk transfer mode. Your options are
23 // TRANSFER_WRITE and TRANSFER_READ.
25 
26 #define MIRROR_VERTICAL 0
27 #define MIRROR_HORIZONTAL 1
28 
29 // Set the current mirroring mode. Your options are
30 // MIRROR_HORIZONTAL and MIRROR_VERTICAL.
31 void set_mirroring(char mirroring);
32 
33 // Set all 8 bits of the $4025 FDS Control register.
34 void fds_set_ctrl(char value);
35 
36 // Write 7-bit data to the rear expansion port ($4026).
38 
39 struct __fds_read {
40  unsigned char disk_status;
41  unsigned char data;
42  unsigned char drive_status;
43  unsigned char ext_data;
44 };
45 
46 #define FDS_READ (*(volatile struct __fds_read*)0x4030)
47 
48 struct __fds_apu {
49  unsigned char wavetable[64];
50  struct {
51  unsigned char vol_env;
52  unsigned char unused;
53  unsigned char freq_lo;
54  unsigned char freq_hi;
55  } wave;
56  struct {
57  unsigned char env;
58  unsigned char counter;
59  unsigned char freq_lo;
60  unsigned char freq_hi;
61  unsigned char mod_table;
62  } mod;
63  unsigned char write_vol;
64  unsigned char env_speed;
65  unsigned char unused[5];
66  unsigned char vol_gain;
67  unsigned char wave_acm;
68  unsigned char mod_gain;
69  unsigned char mod_acm;
70  unsigned char mod_ctr_gain;
71  unsigned char mod_ctr_inc;
72  unsigned char wave_value;
73  unsigned char mod_ctr_val;
74 };
75 
76 #define FDS_APU (*(volatile struct __fds_apu*)0x4040)
77 
78 #ifdef __cplusplus
79 }
80 #endif
81 
82 #endif
char value
Definition: bios.h:265
void fds_set_sound_io(bool value)
void set_mirroring(char mirroring)
void fds_write_ext_data(char value)
void fds_write_disk_data(char value)
void fds_set_ctrl(char value)
void fds_set_transfer_mode(bool mode)
void fds_set_disk_io(bool value)
const void uint16_t uint8_t mode
Definition: memory.h:58
char const void * data
Definition: neslib.h:92