Page Menu
Home
Phabricator (Chris)
Search
Configure Global Search
Log In
Files
F621589
Gb_Oscs.h
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None
Gb_Oscs.h
View Options
// Private oscillators used by Gb_Apu
// Gb_Snd_Emu 0.1.5
#ifndef GB_OSCS_H
#define GB_OSCS_H
#include
"blargg_common.h"
#include
"Blip_Buffer.h"
struct
Gb_Osc
{
enum
{
trigger
=
0x80
};
enum
{
len_enabled_mask
=
0x40
};
Blip_Buffer
*
outputs
[
4
];
// NULL, right, left, center
Blip_Buffer
*
output
;
int
output_select
;
BOOST
::
uint8_t
*
regs
;
// osc's 5 registers
int
delay
;
int
last_amp
;
int
volume
;
int
length
;
int
enabled
;
void
reset
();
void
clock_length
();
int
frequency
()
const
{
return
(
regs
[
4
]
&
7
)
*
0x100
+
regs
[
3
];
}
};
struct
Gb_Env
:
Gb_Osc
{
int
env_delay
;
void
reset
();
void
clock_envelope
();
bool
write_register
(
int
,
int
);
};
struct
Gb_Square
:
Gb_Env
{
enum
{
period_mask
=
0x70
};
enum
{
shift_mask
=
0x07
};
typedef
Blip_Synth
<
blip_good_quality
,
1
>
Synth
;
Synth
const
*
synth
;
int
sweep_delay
;
int
sweep_freq
;
int
phase
;
void
reset
();
void
clock_sweep
();
void
run
(
blip_time_t
,
blip_time_t
,
int
playing
);
};
struct
Gb_Noise
:
Gb_Env
{
typedef
Blip_Synth
<
blip_med_quality
,
1
>
Synth
;
Synth
const
*
synth
;
unsigned
bits
;
void
run
(
blip_time_t
,
blip_time_t
,
int
playing
);
};
struct
Gb_Wave
:
Gb_Osc
{
typedef
Blip_Synth
<
blip_med_quality
,
1
>
Synth
;
Synth
const
*
synth
;
int
wave_pos
;
enum
{
wave_size
=
32
};
BOOST
::
uint8_t
wave
[
wave_size
];
void
write_register
(
int
,
int
);
void
run
(
blip_time_t
,
blip_time_t
,
int
playing
);
};
inline
void
Gb_Env::reset
()
{
env_delay
=
0
;
Gb_Osc
::
reset
();
}
#endif
File Metadata
Details
Attached
Mime Type
text/x-c
Expires
Sat, Nov 14, 7:17 PM (19 h, 53 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
132869
Default Alt Text
Gb_Oscs.h (1 KB)
Attached To
Mode
R75 R-Tech1
Attached
Detach File
Event Timeline