ResidualVM logo ResidualVM website - Forums - Contact us BuildBot - Doxygen - Wiki curved edge

mame.cpp File Reference

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
#include <math.h>
#include "mame.h"
#include "audio/mixer.h"
#include "common/system.h"
#include "common/textconsole.h"
#include "common/util.h"
Include dependency graph for mame.cpp:

Go to the source code of this file.

Namespaces

namespace  OPL
namespace  OPL::MAME

Defines

#define OPL_ARRATE   141280
#define OPL_DRRATE   1956000
#define FREQ_BITS   24
#define FREQ_RATE   (1<<(FREQ_BITS-20))
#define TL_BITS   (FREQ_BITS+2)
#define OPL_OUTSB   (TL_BITS+3-16)
#define OPL_MAXOUT   (0x7fff<<OPL_OUTSB)
#define OPL_MINOUT   (-(0x8000<<OPL_OUTSB))
#define SIN_ENT_SHIFT   11
#define SIN_ENT   (1<<SIN_ENT_SHIFT)
#define EG_AST   0
#define EG_STEP   (96.0/EG_ENT)
#define VIB_ENT   512
#define VIB_SHIFT   (32-9)
#define AMS_ENT   512
#define AMS_SHIFT   (32-9)
#define VIB_RATE_SHIFT   8
#define VIB_RATE   (1<<VIB_RATE_SHIFT)
#define SLOT1   0
#define SLOT2   1
#define ENV_MOD_RR   0x00
#define ENV_MOD_DR   0x01
#define ENV_MOD_AR   0x02
#define TL_MAX   (EG_ENT * 2)
#define ML(a)   (uint)(a * 2)
#define SC_KSL(mydb)   ((uint) (mydb / (EG_STEP / 2)))
#define SC_SL(db)   (int)(db * ((3 / EG_STEP) * (1 << ENV_BITS))) + EG_DST
#define OP_OUT(slot, env, con)   slot->wavetable[((slot->Cnt + con)>>(24-SIN_ENT_SHIFT)) & (SIN_ENT-1)][env]
#define WHITE_NOISE_db   6.0

Functions

void OPL::MAME::OPLBuildTables (int ENV_BITS_PARAM, int EG_ENT_PARAM)
void OPL::MAME::OPL_STATUS_SET (FM_OPL *OPL, int flag)
void OPL::MAME::OPL_STATUS_RESET (FM_OPL *OPL, int flag)
void OPL::MAME::OPL_STATUSMASK_SET (FM_OPL *OPL, int flag)
void OPL::MAME::OPL_KEYON (OPL_SLOT *SLOT)
void OPL::MAME::OPL_KEYOFF (OPL_SLOT *SLOT)
uint OPL::MAME::OPL_CALC_SLOT (OPL_SLOT *SLOT)
static void OPL::MAME::set_algorythm (OPL_CH *CH)
void OPL::MAME::CALC_FCSLOT (OPL_CH *CH, OPL_SLOT *SLOT)
void OPL::MAME::set_mul (FM_OPL *OPL, int slot, int v)
void OPL::MAME::set_ksl_tl (FM_OPL *OPL, int slot, int v)
void OPL::MAME::set_ar_dr (FM_OPL *OPL, int slot, int v)
void OPL::MAME::set_sl_rr (FM_OPL *OPL, int slot, int v)
void OPL::MAME::OPL_CALC_CH (OPL_CH *CH)
void OPL::MAME::OPL_CALC_RH (FM_OPL *OPL, OPL_CH *CH)
static void OPL::MAME::init_timetables (FM_OPL *OPL, int ARRATE, int DRRATE)
static int OPL::MAME::OPLOpenTable (void)
static void OPL::MAME::OPLCloseTable (void)
void OPL::MAME::CSMKeyControll (OPL_CH *CH)
static void OPL::MAME::OPL_initalize (FM_OPL *OPL)
void OPL::MAME::OPLWriteReg (FM_OPL *OPL, int r, int v)
static int OPL::MAME::OPL_LockTable (void)
static void OPL::MAME::OPL_UnLockTable (void)
void OPL::MAME::YM3812UpdateOne (FM_OPL *OPL, int16 *buffer, int length)
void OPL::MAME::OPLResetChip (FM_OPL *OPL)
FM_OPL * OPL::MAME::OPLCreate (int type, int clock, int rate)
void OPL::MAME::OPLDestroy (FM_OPL *OPL)
void OPL::MAME::OPLSetTimerHandler (FM_OPL *OPL, OPL_TIMERHANDLER TimerHandler, int channelOffset)
void OPL::MAME::OPLSetIRQHandler (FM_OPL *OPL, OPL_IRQHANDLER IRQHandler, int param)
void OPL::MAME::OPLSetUpdateHandler (FM_OPL *OPL, OPL_UPDATEHANDLER UpdateHandler, int param)
int OPL::MAME::OPLWrite (FM_OPL *OPL, int a, int v)
unsigned char OPL::MAME::OPLRead (FM_OPL *OPL, int a)
int OPL::MAME::OPLTimerOver (FM_OPL *OPL, int c)
FM_OPL * OPL::MAME::makeAdLibOPL (int rate)

Variables

int OPL::MAME::ENV_BITS
int OPL::MAME::EG_ENT
int OPL::MAME::EG_OFF
int OPL::MAME::EG_DED
int OPL::MAME::EG_DST
int OPL::MAME::EG_AED
static const int OPL::MAME::slot_array [32]
static uint OPL::MAME::KSL_TABLE [8 *16]
static const double OPL::MAME::KSL_TABLE_SEED [8 *16]
static int OPL::MAME::SL_TABLE [16]
static const uint OPL::MAME::SL_TABLE_SEED [16]
static int * OPL::MAME::TL_TABLE
static int ** OPL::MAME::SIN_TABLE
static int * OPL::MAME::AMS_TABLE
static int * OPL::MAME::VIB_TABLE
static int * OPL::MAME::ENV_CURVE
static const uint OPL::MAME::MUL_TABLE [16]
static int OPL::MAME::RATE_0 [16]
static int OPL::MAME::num_lock = 0
static void * OPL::MAME::cur_chip = NULL
static OPL_CH * OPL::MAME::S_CH
static OPL_CH * OPL::MAME::E_CH
OPL_SLOT * OPL::MAME::SLOT7_1
OPL_SLOT * OPL::MAME::SLOT7_2
OPL_SLOT * OPL::MAME::SLOT8_1
OPL_SLOT * OPL::MAME::SLOT8_2
static int OPL::MAME::outd [1]
static int OPL::MAME::ams
static int OPL::MAME::vib
int * OPL::MAME::ams_table
int * OPL::MAME::vib_table
static int OPL::MAME::amsIncr
static int OPL::MAME::vibIncr
static int OPL::MAME::feedback2

Define Documentation

#define AMS_ENT   512

Definition at line 122 of file mame.cpp.

#define AMS_SHIFT   (32-9)

Definition at line 123 of file mame.cpp.

#define EG_AST   0

Definition at line 115 of file mame.cpp.

#define EG_STEP   (96.0/EG_ENT)

Definition at line 117 of file mame.cpp.

#define ENV_MOD_AR   0x02

Definition at line 137 of file mame.cpp.

#define ENV_MOD_DR   0x01

Definition at line 136 of file mame.cpp.

#define ENV_MOD_RR   0x00

Definition at line 135 of file mame.cpp.

#define FREQ_BITS   24

Definition at line 81 of file mame.cpp.

#define FREQ_RATE   (1<<(FREQ_BITS-20))

Definition at line 84 of file mame.cpp.

#define ML (   a  )     (uint)(a * 2)

Definition at line 222 of file mame.cpp.

#define OP_OUT (   slot,
  env,
  con 
)    slot->wavetable[((slot->Cnt + con)>>(24-SIN_ENT_SHIFT)) & (SIN_ENT-1)][env]

Definition at line 495 of file mame.cpp.

#define OPL_ARRATE   141280

Definition at line 78 of file mame.cpp.

#define OPL_DRRATE   1956000

Definition at line 79 of file mame.cpp.

#define OPL_MAXOUT   (0x7fff<<OPL_OUTSB)

Definition at line 89 of file mame.cpp.

#define OPL_MINOUT   (-(0x8000<<OPL_OUTSB))

Definition at line 90 of file mame.cpp.

#define OPL_OUTSB   (TL_BITS+3-16)

Definition at line 88 of file mame.cpp.

#define SC_KSL (   mydb  )     ((uint) (mydb / (EG_STEP / 2)))

Definition at line 258 of file mame.cpp.

#define SC_SL (   db  )     (int)(db * ((3 / EG_STEP) * (1 << ENV_BITS))) + EG_DST

Definition at line 259 of file mame.cpp.

#define SIN_ENT   (1<<SIN_ENT_SHIFT)

Definition at line 101 of file mame.cpp.

#define SIN_ENT_SHIFT   11

Definition at line 99 of file mame.cpp.

#define SLOT1   0

Definition at line 131 of file mame.cpp.

#define SLOT2   1

Definition at line 132 of file mame.cpp.

#define TL_BITS   (FREQ_BITS+2)

Definition at line 85 of file mame.cpp.

#define TL_MAX   (EG_ENT * 2)

Definition at line 201 of file mame.cpp.

#define VIB_ENT   512

Definition at line 120 of file mame.cpp.

#define VIB_RATE   (1<<VIB_RATE_SHIFT)

Definition at line 126 of file mame.cpp.

#define VIB_RATE_SHIFT   8

Definition at line 125 of file mame.cpp.

#define VIB_SHIFT   (32-9)

Definition at line 121 of file mame.cpp.

#define WHITE_NOISE_db   6.0

Definition at line 538 of file mame.cpp.



Generated on Sat Jun 22 2019 05:01:06 for ResidualVM by doxygen 1.7.1
curved edge   curved edge