sc68fordevelopers  2.2.1
Data Structures
paulaemul.h File Reference

Paula emulator (Amiga soundchip). More...

Go to the source code of this file.

Data Structures

struct  paulav_t
 Paula voice information data structure. More...
 

Functions

Initialization functions.
unsigned int PL_sampling_rate (unsigned int f)
 Set/Get sampling rate. More...
 
int PL_reset (void)
 Paula hardware reset. More...
 
int PL_init (void)
 Paula first one first initialization. More...
 
Emulation functions
void PL_mix (u32 *b, u8 *mem68, int n)
 Execute Paula emulation. More...
 

Variables

Internal Paula emulation data.
u8 paula []
 Paula regiter data storage.
 
paulav_t paulav []
 Paula voices(channel) table (4 voices)
 
int paula_dmacon
 Shadow DMACON. More...
 
int paula_intena
 Shadow INTENA. More...
 
int paula_intreq
 Shadow INTREQ. More...
 
int paula_adkcon
 Shadow ADKCON. More...
 

Detailed Description

Paula emulator (Amiga soundchip).

Author
Benjamin Gerard ben@s.nosp@m.ashi.nosp@m.pa.co.nosp@m.m
Date
1998/07/18
Id
paulaemul.h,v 2.0 2003/08/21 04:58:35 benjihan Exp
About Amiga hardware registers

Amiga hardware registers could have a different address for read and write access. It is the case for DMA control register (DMACON).

Registers could be (B)yte or (W)ord wide.

SET/CLR bit

Some hardware registers work with a SET/CLEAR bit. When writing these registers the value is not copied as is. The operation depends on the value of S the most signifiant bit (#15).

Function Documentation

unsigned int PL_sampling_rate ( unsigned int  f)

Set/Get sampling rate.

The PL_sampling_rate() function set Paula emulator sampling rate. f is given in hz. If f is 0 the current replay is return.

Parameters
fsampling rate in hz (0 to get current value).
Returns
new sampling rate
int PL_reset ( void  )

Paula hardware reset.

The PL_reset() reset function perform a Paula reset. It performs following operations :

  • all registers zeroed
  • all internal voices set to dummy 2 samples len address.
  • general DMA enabled
  • all audio DMA disabled
  • interrupt master enabled
  • all audio interrupt disbled
Returns
error-code (always success)
0 Success
int PL_init ( void  )

Paula first one first initialization.

The PL_init() must be call before all other PL functions. It performs following operations:

  • Init output level (volume) table.
  • Hardware reset
  • Set replay frequency to default (44100 Hz) if not already set
Returns
error-code (always success)
0 Success
See also
PL_reset()
void PL_mix ( u32 b,
u8 mem68,
int  n 
)

Execute Paula emulation.

The PL_mix() function processes sample mixing with current internal parameters for n samples. Mixed samples are stored in a large enough (at least n) 32 bit pcm buffer pointed by b. mem68 is a pointer to the 68K memory buffer. The Paula emulator assume that this buffer is at least the size of the Amiga "chip" RAM. This implies at leat 512Kb and PCM data must be in the first 512Kb.

Parameters
bPointer to destination 32-bit data buffer
mem68Pointer to 68K memory buffer start address
nNumber of sample to mix in b buffer

Variable Documentation

int paula_dmacon

Shadow DMACON.

int paula_intena

Shadow INTENA.

int paula_intreq

Shadow INTREQ.

int paula_adkcon

Shadow ADKCON.