Home Download Musics Developers
API Sources Tools File Format Technicals

paulaemul.h

Go to the documentation of this file.
00001 
00012 /* Copyright (C) 1998-2003 Ben(jamin) Gerard */
00013 
00014 #ifndef _PAULA_EMUL_H_
00015 #define _PAULA_EMUL_H_
00016 
00017 #ifdef __cplusplus
00018 extern "C" {
00019 #endif
00020 
00021 #include "emu68/struct68.h"
00022 
00045 /*
00046  *
00047  * @par Register map
00048  *
00049  * @code {
00050  *
00051  * // NAME SZ  ADDR    
00052  *
00053  * VHPOSR  (B) DFF006 [xxxxxxxx] Vertical/Horizontal electron bean position.
00054  *
00055  * INTREQR (W) DFF01E [-M---DCBA--------] Interrupt request read (M=Master).
00056  * INTREQW (W) DFF09C [-M---DCBA--------] Interrupt request write (M=Master).
00057  *
00058  * INTENAR (W) DFF01C Interrupt enable read.
00059  * INTENAW (W) DFF09A Interrupt enable write.
00060  *
00061  * DMACONW (W) DFF096 [S00000E00000DBCA] DMA control register write (E=Enable).
00062  * DMACONR (W) DFF002 [000000E00000DBCA] DMA control register read (E=Enable).
00063  *
00064  * VOICEA      DFF0A0
00065  * VOICEB      DFF0B0
00066  * VOICEC      DFF0C0
00067  * VOICED      DFF0D0
00068  *
00069  * VOICEX
00070  * +0 (L) START  [00000000 00000xxx xxxxxxxx xxxxxxx0] start address (even).
00071  * +4 (W) LENGHT [xxxxxxxx xxxxxxxx] Length in word (0=010000).
00072  * +6 (W) PERIOD [0000xxxx xxxxxxxx] Period (in paula cycle).
00073  * +8 (B) VOLUME [0xxxxxxx] Volume [0-64] (presume value > 64 => 64).
00074  * }
00075  */
00076 
00077 
00079 #define PAULA_VHPOSR    0x06
00080 
00094 #define PAULA_INTREQR   0x1E  
00095 #define PAULA_INTREQRH  0x1E  
00096 #define PAULA_INTREQRL  0x1F  
00098 #define PAULA_INTREQ    0x9C  
00099 #define PAULA_INTREQH   0x9C  
00100 #define PAULA_INTREQL   0x9D  
00102 #define PAULA_INTENAR   0x1C  
00103 #define PAULA_INTENARH  0x1C  
00104 #define PAULA_INTENARL  0x1D  
00106 #define PAULA_INTENA    0x9A  
00107 #define PAULA_INTENAH   0x9A  
00108 #define PAULA_INTENAL   0x9B  
00124 #define PAULA_DMACONR   0x02  
00125 #define PAULA_DMACONRH  0x02  
00126 #define PAULA_DMACONRL  0x03  
00128 #define PAULA_DMACON    0x96  
00129 #define PAULA_DMACONH   0x96  
00130 #define PAULA_DMACONL   0x97  
00153 #define PAULA_ADKCON    0x9E  
00154 #define PAULA_ADKCONR   0x10  
00155 #define PAULA_ADKCONRH  0x10
00156 #define PAULA_ADKCONRL  0x11
00157 
00163 #define PAULA_VOICE(I) ((0xA+(I))<<4) 
00164 #define PAULA_VOICEA   0xA0           
00165 #define PAULA_VOICEB   0xB0           
00166 #define PAULA_VOICEC   0xC0           
00167 #define PAULA_VOICED   0xD0           
00174 #define PAULA_PER 2.79365E-7      
00175 #define PAULA_FRQ 3579610.53837   
00180 #define PAULA_CT_FIX            13
00181 
00187 typedef struct
00188 {
00189   u32 adr;   
00190   u32 start; 
00191   u32 end;   
00193 /*  int v[16]; //$$$ */
00194 
00195 } paulav_t;
00196 
00197 extern u8 paula[];        
00198 extern paulav_t paulav[]; 
00199 extern int paula_dmacon;  
00200 extern int paula_intena;  
00201 extern int paula_intreq;  
00202 extern int paula_adkcon;  
00203 extern int paula_interpol; 
00221 unsigned int PL_sampling_rate(unsigned int f);
00222 
00237 int PL_reset(void);
00238 
00252 int PL_init(void);
00253 
00275 void PL_mix(u32 *b, u8 *mem68, int n);
00276 
00284 #ifdef __cplusplus
00285 }
00286 #endif
00287 
00288 #endif /* #ifndef _PAULA_EMUL_H_ */