More newline and whitespace cleanups
This commit is contained in:
@@ -43,7 +43,7 @@
|
||||
#else
|
||||
#define pre_gap1 0
|
||||
#endif
|
||||
|
||||
|
||||
#define pre_track pre_gap1 + length_gap1
|
||||
#define pre_gap length_sync + length_am + 4 + length_crc
|
||||
#define pre_data length_sync + length_am
|
||||
|
||||
@@ -32,7 +32,7 @@ static inline float adgold_highpass_iir(int i, float NewSample) {
|
||||
y[i][0] = ACoef[0] * x[i][0];
|
||||
for(n=1; n<=NCoef; n++)
|
||||
y[i][0] += ACoef[n] * x[i][n] - BCoef[n] * y[i][n];
|
||||
|
||||
|
||||
return y[i][0];
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ static inline float adgold_lowpass_iir(int i, float NewSample) {
|
||||
y[i][0] = ACoef[0] * x[i][0];
|
||||
for(n=1; n<=NCoef; n++)
|
||||
y[i][0] += ACoef[n] * x[i][n] - BCoef[n] * y[i][n];
|
||||
|
||||
|
||||
return y[i][0];
|
||||
}
|
||||
|
||||
@@ -98,7 +98,7 @@ static inline float adgold_pseudo_stereo_iir(float NewSample) {
|
||||
y[0] = ACoef[0] * x[0];
|
||||
for(n=1; n<=NCoef; n++)
|
||||
y[0] += ACoef[n] * x[n] - BCoef[n] * y[n];
|
||||
|
||||
|
||||
return y[0];
|
||||
}
|
||||
|
||||
@@ -115,7 +115,7 @@ static inline float dss_iir(float NewSample) {
|
||||
-1.41898265221812010000,
|
||||
0.55326988968868285000
|
||||
};
|
||||
|
||||
|
||||
static float y[NCoef+1]; /* output samples */
|
||||
static float x[NCoef+1]; /* input samples */
|
||||
int n;
|
||||
@@ -164,7 +164,7 @@ static inline float dac_iir(int i, float NewSample) {
|
||||
y[i][0] = ACoef[0] * x[i][0];
|
||||
for(n=1; n<=NCoef; n++)
|
||||
y[i][0] += ACoef[n] * x[i][n] - BCoef[n] * y[i][n];
|
||||
|
||||
|
||||
return y[i][0];
|
||||
}
|
||||
|
||||
@@ -350,7 +350,7 @@ static inline double sb_iir(int c, int i, double NewSample) {
|
||||
-1.41898265221812010000,
|
||||
0.55326988968868285000
|
||||
};
|
||||
|
||||
|
||||
static double y[2][2][NCoef+1]; /* output samples */
|
||||
static double x[2][2][NCoef+1]; /* input samples */
|
||||
int n;
|
||||
@@ -399,7 +399,7 @@ static inline double low_fir_sb16(int c, int i, double NewSample)
|
||||
if (pos[c] > SB16_NCoef)
|
||||
pos[c] = 0;
|
||||
}
|
||||
|
||||
|
||||
return out;
|
||||
}
|
||||
|
||||
|
||||
@@ -333,8 +333,8 @@ extern void addreadlookup(uint32_t virt, uint32_t phys);
|
||||
extern void addwritelookup(uint32_t virt, uint32_t phys);
|
||||
|
||||
extern void mem_mapping_set(mem_mapping_t *,
|
||||
uint32_t base,
|
||||
uint32_t size,
|
||||
uint32_t base,
|
||||
uint32_t size,
|
||||
uint8_t (*read_b)(uint32_t addr, void *p),
|
||||
uint16_t (*read_w)(uint32_t addr, void *p),
|
||||
uint32_t (*read_l)(uint32_t addr, void *p),
|
||||
@@ -345,8 +345,8 @@ extern void mem_mapping_set(mem_mapping_t *,
|
||||
uint32_t flags,
|
||||
void *p);
|
||||
extern void mem_mapping_add(mem_mapping_t *,
|
||||
uint32_t base,
|
||||
uint32_t size,
|
||||
uint32_t base,
|
||||
uint32_t size,
|
||||
uint8_t (*read_b)(uint32_t addr, void *p),
|
||||
uint16_t (*read_w)(uint32_t addr, void *p),
|
||||
uint32_t (*read_l)(uint32_t addr, void *p),
|
||||
@@ -434,7 +434,7 @@ static __inline uint32_t get_phys(uint32_t addr)
|
||||
return get_phys_phys | (addr & 0xfff);
|
||||
|
||||
get_phys_virt = addr;
|
||||
|
||||
|
||||
if (!(cr0 >> 31)) {
|
||||
get_phys_phys = (addr & rammask) & ~0xfff;
|
||||
return addr & rammask;
|
||||
|
||||
@@ -181,7 +181,7 @@ typedef struct {
|
||||
int mem_size, mem_start, mem_end;
|
||||
|
||||
int tx_timer_index;
|
||||
int tx_timer_active;
|
||||
int tx_timer_active;
|
||||
|
||||
void *priv;
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
* VARCem Virtual ARchaeological Computer EMulator.
|
||||
* An emulator of (mostly) x86-based PC systems and devices,
|
||||
* using the ISA,EISA,VLB,MCA and PCI system buses, roughly
|
||||
|
||||
@@ -308,7 +308,7 @@
|
||||
#define IDC_COMBO_RPM_MODE 1202
|
||||
|
||||
#define IDC_COMBO_LANG 1009 /* change language dialog */
|
||||
#define IDC_COMBO_ICON 1010
|
||||
#define IDC_COMBO_ICON 1010
|
||||
#define IDC_CHECKBOX_GLOBAL 1300
|
||||
#define IDC_BUTTON_DEFAULT 1302
|
||||
#define IDC_BUTTON_DEFICON 1304
|
||||
|
||||
@@ -197,8 +197,8 @@
|
||||
#define CD_FRAMES 75 /* frames per second */
|
||||
#define CD_FRAMESIZE 2048 /* bytes per frame, "cooked" mode */
|
||||
#define CD_MAX_BYTES (CD_MINS * CD_SECS * CD_FRAMES * CD_FRAMESIZE)
|
||||
#define CD_MAX_SECTORS (CD_MAX_BYTES / 512)
|
||||
|
||||
#define CD_MAX_SECTORS (CD_MAX_BYTES / 512)
|
||||
|
||||
/* Event notification classes for GET EVENT STATUS NOTIFICATION */
|
||||
#define GESN_NO_EVENTS 0
|
||||
#define GESN_OPERATIONAL_CHANGE 1
|
||||
@@ -340,7 +340,7 @@ typedef struct scsi_common_s {
|
||||
double callback;
|
||||
} scsi_common_t;
|
||||
|
||||
typedef struct {
|
||||
typedef struct {
|
||||
int32_t buffer_length;
|
||||
|
||||
uint8_t status, phase;
|
||||
|
||||
@@ -33,5 +33,5 @@ extern const device_t ncr53c825a_pci_device;
|
||||
extern const device_t ncr53c860_pci_device;
|
||||
extern const device_t ncr53c875_pci_device;
|
||||
|
||||
|
||||
|
||||
#endif /*SCSI_NCR53C8XX_H*/
|
||||
|
||||
@@ -23,4 +23,4 @@
|
||||
|
||||
extern const device_t spock_device;
|
||||
|
||||
#endif /*SCSI_SPOCK_H*/
|
||||
#endif /*SCSI_SPOCK_H*/
|
||||
|
||||
@@ -493,7 +493,7 @@ typedef struct {
|
||||
pc_timer_t timer, ResetCB;
|
||||
|
||||
Req_t Req;
|
||||
|
||||
|
||||
fdc_t *fdc;
|
||||
} x54x_t;
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ typedef struct {
|
||||
|
||||
int count;
|
||||
uint8_t trd, mce, wten: 1;
|
||||
|
||||
|
||||
int16_t out_l, out_r;
|
||||
double cd_vol_l, cd_vol_r;
|
||||
int fm_vol_l, fm_vol_r;
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
#define EMU8K_MEM_ADDRESS_MASK 0xFFFFFF
|
||||
#define EMU8K_RAM_MEM_START 0x200000
|
||||
#define EMU8K_FM_MEM_ADDRESS 0xFFFFE0
|
||||
#define EMU8K_RAM_POINTERS_MASK 0x3F
|
||||
#define EMU8K_RAM_POINTERS_MASK 0x3F
|
||||
#define EMU8K_LFOCHORUS_SIZE 0x4000
|
||||
/*
|
||||
* Everything in this file assumes little endian
|
||||
@@ -18,7 +18,7 @@ typedef struct emu8k_mem_internal_t {
|
||||
uint16_t fract_lw_address;
|
||||
uint16_t fract_address;
|
||||
uint32_t int_address;
|
||||
};
|
||||
};
|
||||
};
|
||||
} emu8k_mem_internal_t;
|
||||
|
||||
@@ -30,13 +30,13 @@ typedef struct emu8k_mem_pointers_t {
|
||||
uint16_t lw_address;
|
||||
uint8_t hb_address;
|
||||
uint8_t unused_address;
|
||||
};
|
||||
};
|
||||
};
|
||||
} emu8k_mem_pointers_t;
|
||||
|
||||
/*
|
||||
* From the Soundfount 2.0 fileformat Spec.:
|
||||
*
|
||||
*
|
||||
An envelope generates a control signal in six phases.
|
||||
When key-on occurs, a delay period begins during which the envelope value is zero.
|
||||
The envelope then rises in a convex curve to a value of one during the attack phase.
|
||||
@@ -46,25 +46,25 @@ typedef struct emu8k_mem_pointers_t {
|
||||
When a value of one is reached, the envelope enters a hold phase during which it remains at one.
|
||||
When the hold phase ends, the envelope enters a decay phase during which its value decreases linearly to a sustain level.
|
||||
" For the Volume Envelope, the decay phase linearly ramps toward the sustain level, causing a constant dB change for each time unit. "
|
||||
When the sustain level is reached, the envelope enters sustain phase, during which the envelope stays at the sustain level.
|
||||
|
||||
When the sustain level is reached, the envelope enters sustain phase, during which the envelope stays at the sustain level.
|
||||
|
||||
Whenever a key-off occurs, the envelope immediately enters a release phase during which the value linearly ramps from the current value to zero.
|
||||
" For the Volume Envelope, the release phase linearly ramps toward zero from the current level, causing a constant dB change for each time unit"
|
||||
|
||||
When zero is reached, the envelope value remains at zero.
|
||||
|
||||
|
||||
Modulation of pitch and filter cutoff are in octaves, semitones, and cents.
|
||||
These parameters can be modulated to varying degree, either positively or negatively, by the modulation envelope.
|
||||
The degree of modulation is specified in cents for the full-scale attack peak.
|
||||
|
||||
|
||||
The volume envelope operates in dB, with the attack peak providing a full scale output, appropriately scaled by the initial volume.
|
||||
The zero value, however, is actually zero gain.
|
||||
The implementation in the EMU8000 provides for 96 dB of amplitude control.
|
||||
When 96 dB of attenuation is reached in the final gain amplifier, an abrupt jump to zero gain
|
||||
When 96 dB of attenuation is reached in the final gain amplifier, an abrupt jump to zero gain
|
||||
(infinite dB of attenuation) occurs. In a 16-bit system, this jump is inaudible
|
||||
*/
|
||||
/* It seems that the envelopes don't really have a decay/release stage,
|
||||
* but instead they have a volume ramper that can be triggered
|
||||
* but instead they have a volume ramper that can be triggered
|
||||
* automatically (after hold period), or manually (by activating release)
|
||||
* and the "sustain" value is the target of any of both cases.
|
||||
* Some programs like cubic player and AWEAmp use this, and it was
|
||||
@@ -77,9 +77,9 @@ typedef struct emu8k_mem_pointers_t {
|
||||
* contains the destination volume, and the lower byte contains the ramp time.
|
||||
*/
|
||||
|
||||
/* attack_amount is linear amplitude (added directly to value).
|
||||
/* attack_amount is linear amplitude (added directly to value).
|
||||
* ramp_amount_db is linear dB (added directly to value too, but needs conversion to get linear amplitude).
|
||||
* value range is 21bits for both, linear amplitude being 1<<21 = 0dBFS and 0 = -96dBFS (which is shortcut to silence),
|
||||
* value range is 21bits for both, linear amplitude being 1<<21 = 0dBFS and 0 = -96dBFS (which is shortcut to silence),
|
||||
* and db amplutide being 0 = 0dBFS and -(1<<21) = -96dBFS (which is shortcut to silence).
|
||||
* This allows to operate db values by simply adding them.
|
||||
*/
|
||||
@@ -100,8 +100,8 @@ typedef struct emu8k_chorus_eng_t {
|
||||
double lfodepth_multip;
|
||||
double delay_offset_samples_right;
|
||||
emu8k_mem_internal_t lfo_inc;
|
||||
emu8k_mem_internal_t lfo_pos;
|
||||
|
||||
emu8k_mem_internal_t lfo_pos;
|
||||
|
||||
int32_t chorus_left_buffer[EMU8K_LFOCHORUS_SIZE];
|
||||
int32_t chorus_right_buffer[EMU8K_LFOCHORUS_SIZE];
|
||||
|
||||
@@ -112,16 +112,16 @@ typedef struct emu8k_chorus_eng_t {
|
||||
|
||||
|
||||
/* Reverb parameters description, extracted from AST sources.
|
||||
Mix level
|
||||
Decay
|
||||
Link return amp
|
||||
Mix level
|
||||
Decay
|
||||
Link return amp
|
||||
Link type Switches between normal or panned
|
||||
Room reso ( ms) L&R (Ref 6 +1)
|
||||
Ref 1 x2 (11 ms)R
|
||||
Ref 2 x4 (22 ms)R
|
||||
Ref 3 x8 (44 ms)L
|
||||
Ref 4 x13(71 ms)R
|
||||
Ref 5 x19(105ms)L
|
||||
Ref 1 x2 (11 ms)R
|
||||
Ref 2 x4 (22 ms)R
|
||||
Ref 3 x8 (44 ms)L
|
||||
Ref 4 x13(71 ms)R
|
||||
Ref 5 x19(105ms)L
|
||||
Ref 6 x ( ms)R (multiplier changes with room reso)
|
||||
Ref 1-6 filter L&R
|
||||
Ref 1-6 amp L&R
|
||||
@@ -131,7 +131,7 @@ typedef struct emu8k_chorus_eng_t {
|
||||
Ref 4 feedback L&R
|
||||
Ref 5 feedback L&R
|
||||
Ref 6 feedback L&R
|
||||
*/
|
||||
*/
|
||||
typedef struct emu8k_reverb_combfilter_t {
|
||||
int read_pos;
|
||||
int32_t reflection[MAX_REFL_SIZE];
|
||||
@@ -151,11 +151,11 @@ typedef struct emu8k_reverb_eng_t {
|
||||
|
||||
uint8_t refl_in_amp;
|
||||
|
||||
emu8k_reverb_combfilter_t reflections[6];
|
||||
emu8k_reverb_combfilter_t reflections[6];
|
||||
emu8k_reverb_combfilter_t allpass[8];
|
||||
emu8k_reverb_combfilter_t tailL;
|
||||
emu8k_reverb_combfilter_t tailR;
|
||||
|
||||
|
||||
emu8k_reverb_combfilter_t damper;
|
||||
} emu8k_reverb_eng_t;
|
||||
|
||||
@@ -204,7 +204,7 @@ typedef struct emu8k_voice_t
|
||||
uint32_t unknown_data0_5;
|
||||
union {
|
||||
uint32_t psst;
|
||||
struct {
|
||||
struct {
|
||||
uint16_t psst_lw_address;
|
||||
uint8_t psst_hw_address;
|
||||
uint8_t psst_pan;
|
||||
@@ -213,7 +213,7 @@ typedef struct emu8k_voice_t
|
||||
};
|
||||
union {
|
||||
uint32_t csl;
|
||||
struct {
|
||||
struct {
|
||||
uint16_t csl_lw_address;
|
||||
uint8_t csl_hw_address;
|
||||
uint8_t csl_chor_send;
|
||||
@@ -234,12 +234,12 @@ typedef struct emu8k_voice_t
|
||||
#define CCCA_DMA_ACTIVE(ccca) (ccca&0x04000000)
|
||||
#define CCCA_DMA_WRITE_MODE(ccca) (ccca&0x02000000)
|
||||
#define CCCA_DMA_WRITE_RIGHT(ccca) (ccca&0x01000000)
|
||||
|
||||
|
||||
uint16_t envvol;
|
||||
#define ENVVOL_NODELAY(envol) (envvol&0x8000)
|
||||
/* Verified with a soundfont bank. 7FFF is the minimum delay time, and 0 is the max delay time */
|
||||
#define ENVVOL_TO_EMU_SAMPLES(envvol) (envvol&0x8000) ? 0 : ((0x8000-(envvol&0x7FFF)) <<5)
|
||||
|
||||
|
||||
uint16_t dcysusv;
|
||||
#define DCYSUSV_IS_RELEASE(dcysusv) (dcysusv&0x8000)
|
||||
#define DCYSUSV_GENERATOR_ENGINE_ON(dcysusv) !(dcysusv&0x0080)
|
||||
@@ -247,39 +247,39 @@ typedef struct emu8k_voice_t
|
||||
/* Inverting the range compared to documentation because the envelope runs from 0dBFS = 0 to -96dBFS = (1 <<21) */
|
||||
#define DCYSUSV_SUS_TO_ENV_RANGE(susvalue) (((0x7F-susvalue) << 21)/0x7F)
|
||||
#define DCYSUSV_DECAYRELEASE_GET(dcysusv) (dcysusv&0x7F)
|
||||
|
||||
|
||||
uint16_t envval;
|
||||
#define ENVVAL_NODELAY(enval) (envval&0x8000)
|
||||
/* Verified with a soundfont bank. 7FFF is the minimum delay time, and 0 is the max delay time */
|
||||
#define ENVVAL_TO_EMU_SAMPLES(envval)(envval&0x8000) ? 0 : ((0x8000-(envval&0x7FFF)) <<5)
|
||||
|
||||
|
||||
uint16_t dcysus;
|
||||
#define DCYSUS_IS_RELEASE(dcysus) (dcysus&0x8000)
|
||||
#define DCYSUS_SUSVALUE_GET(dcysus) ((dcysus>>8)&0x7F)
|
||||
#define DCYSUS_SUS_TO_ENV_RANGE(susvalue) ((susvalue << 21)/0x7F)
|
||||
#define DCYSUS_DECAYRELEASE_GET(dcysus) (dcysus&0x7F)
|
||||
|
||||
|
||||
uint16_t atkhldv;
|
||||
#define ATKHLDV_TRIGGER(atkhldv) !(atkhldv&0x8000)
|
||||
#define ATKHLDV_HOLD(atkhldv) ((atkhldv>>8)&0x7F)
|
||||
#define ATKHLDV_HOLD_TO_EMU_SAMPLES(atkhldv) (4096*(0x7F-((atkhldv>>8)&0x7F)))
|
||||
#define ATKHLDV_ATTACK(atkhldv) (atkhldv&0x7F)
|
||||
|
||||
|
||||
uint16_t lfo1val, lfo2val;
|
||||
#define LFOxVAL_NODELAY(lfoxval) (lfoxval&0x8000)
|
||||
#define LFOxVAL_TO_EMU_SAMPLES(lfoxval) (lfoxval&0x8000) ? 0 : ((0x8000-(lfoxval&0x7FFF)) <<5)
|
||||
|
||||
|
||||
uint16_t atkhld;
|
||||
#define ATKHLD_TRIGGER(atkhld) !(atkhld&0x8000)
|
||||
#define ATKHLD_HOLD(atkhld) ((atkhld>>8)&0x7F)
|
||||
#define ATKHLD_HOLD_TO_EMU_SAMPLES(atkhld) (4096*(0x7F-((atkhld>>8)&0x7F)))
|
||||
#define ATKHLD_ATTACK(atkhld) (atkhld&0x7F)
|
||||
|
||||
|
||||
|
||||
|
||||
uint16_t ip;
|
||||
#define INTIAL_PITCH_CENTER 0xE000
|
||||
#define INTIAL_PITCH_OCTAVE 0x1000
|
||||
|
||||
|
||||
union {
|
||||
uint16_t ifatn;
|
||||
struct{
|
||||
@@ -315,17 +315,17 @@ typedef struct emu8k_voice_t
|
||||
int8_t fm2frq2_lfo2_vibrato;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
int env_engine_on;
|
||||
|
||||
|
||||
emu8k_mem_internal_t addr, loop_start, loop_end;
|
||||
|
||||
|
||||
int32_t initial_att;
|
||||
int32_t initial_filter;
|
||||
|
||||
emu8k_envelope_t vol_envelope;
|
||||
emu8k_envelope_t mod_envelope;
|
||||
|
||||
|
||||
int64_t lfo1_speed, lfo2_speed;
|
||||
emu8k_mem_internal_t lfo1_count, lfo2_count;
|
||||
int32_t lfo1_delay_samples, lfo2_delay_samples;
|
||||
@@ -353,12 +353,12 @@ typedef struct emu8k_t
|
||||
uint32_t hwcf4, hwcf5, hwcf6, hwcf7;
|
||||
|
||||
uint16_t init1[32], init2[32], init3[32], init4[32];
|
||||
|
||||
|
||||
uint32_t smalr, smarr, smalw, smarw;
|
||||
uint16_t smld_buffer, smrd_buffer;
|
||||
|
||||
uint16_t wc;
|
||||
|
||||
|
||||
uint16_t id;
|
||||
|
||||
/* The empty block is used to act as an unallocated memory returning zero. */
|
||||
@@ -369,14 +369,14 @@ typedef struct emu8k_t
|
||||
uint32_t ram_end_addr;
|
||||
|
||||
int cur_reg, cur_voice;
|
||||
|
||||
|
||||
int16_t out_l, out_r;
|
||||
|
||||
|
||||
emu8k_chorus_eng_t chorus_engine;
|
||||
int32_t chorus_in_buffer[SOUNDBUFLEN];
|
||||
emu8k_reverb_eng_t reverb_engine;
|
||||
int32_t reverb_in_buffer[SOUNDBUFLEN];
|
||||
|
||||
|
||||
int pos;
|
||||
int32_t buffer[SOUNDBUFLEN * 2];
|
||||
|
||||
@@ -450,7 +450,7 @@ Section E - Introduction to the EMU8000 Chip
|
||||
|
||||
Amplifier
|
||||
The amplifier determines the loudness of an audio signal.
|
||||
|
||||
|
||||
LFO1
|
||||
An LFO, or Low Frequency Oscillator, is normally used to
|
||||
periodically modulate, that is, change a sound parameter,
|
||||
@@ -459,11 +459,11 @@ Section E - Introduction to the EMU8000 Chip
|
||||
modulation). It operates at sub-audio frequency from
|
||||
0.042 Hz to 10.71 Hz. The LFO1 in the EMU8000 modulates
|
||||
the pitch, volume and filter cutoff simultaneously.
|
||||
|
||||
|
||||
LFO2
|
||||
The LFO2 is similar to the LFO1, except that it modulates
|
||||
the pitch of the audio signal only.
|
||||
|
||||
|
||||
Resonance
|
||||
A filter alone would be like an equalizer, making a
|
||||
bright audio signal duller, but the addition of resonance
|
||||
@@ -472,7 +472,7 @@ Section E - Introduction to the EMU8000 Chip
|
||||
signals at the cutoff frequency, giving the audio signal
|
||||
a subtle wah-wah, that is, imagine a siren sound going
|
||||
from bright to dull to bright again periodically.
|
||||
|
||||
|
||||
LFO1 to Volume (Tremolo)
|
||||
The LFO1's output is routed to the amplifier, with the
|
||||
depth of oscillation determined by LFO1 to Volume. LFO1
|
||||
@@ -486,7 +486,7 @@ Section E - Introduction to the EMU8000 Chip
|
||||
oscillating). An example of a GM instrument that makes
|
||||
use of LFO1 to Volume is instrument number 45, Tremolo
|
||||
Strings.
|
||||
|
||||
|
||||
LFO1 to Filter Cutoff (Wah-Wah)
|
||||
The LFO1's output is routed to the filter, with the depth
|
||||
of oscillation determined by LFO1 to Filter. LFO1 to
|
||||
@@ -504,7 +504,7 @@ Section E - Introduction to the EMU8000 Chip
|
||||
oscillator, producing a vibrato effect. An example of a
|
||||
GM instrument that makes use of LFO1 to Pitch is
|
||||
instrument number 57, Trumpet.
|
||||
|
||||
|
||||
LFO2 to Pitch (Vibrato)
|
||||
The LFO1 in the EMU8000 can simultaneously modulate
|
||||
pitch, volume and filter. LFO2, on the other hand,
|
||||
@@ -513,7 +513,7 @@ Section E - Introduction to the EMU8000 Chip
|
||||
periodic fluctuation in the pitch of the oscillator,
|
||||
producing a vibrato effect. When this is coupled with
|
||||
LFO1 to Pitch, a complex vibrato effect can be achieved.
|
||||
|
||||
|
||||
Volume Envelope
|
||||
The character of a musical instrument is largely
|
||||
determined by its volume envelope, the way in which the
|
||||
@@ -539,7 +539,7 @@ Section E - Introduction to the EMU8000 Chip
|
||||
as a key is held down.
|
||||
Release The time it takes the envelope to fall to the
|
||||
zero level after the key is released.
|
||||
|
||||
|
||||
Using these six parameters can yield very realistic
|
||||
reproduction of the volume envelope characteristics of
|
||||
many musical instruments.
|
||||
@@ -560,14 +560,14 @@ Section E - Introduction to the EMU8000 Chip
|
||||
useful in creating synthetic sci-fi sound textures. An
|
||||
example of a GM instrument that makes use of the filter
|
||||
envelope is instrument number 86, Pad 8 (Sweep).
|
||||
|
||||
|
||||
Pitch/Filter Envelope Modulation
|
||||
These two parameters determine the modulation depth of
|
||||
the pitch and filter envelope. In the wind instrument
|
||||
example above, a small amount of pitch envelope
|
||||
modulation is desirable to simulate its natural pitch
|
||||
characteristics.
|
||||
|
||||
|
||||
This rich modulation capability of the EMU8000 is fully
|
||||
exploited by the SB AWE32 MIDI drivers. The driver also
|
||||
provides you with a means to change these parameters over
|
||||
@@ -621,9 +621,9 @@ Section E - Introduction to the EMU8000 Chip
|
||||
Short Delay (feed back)
|
||||
This chorus variation simulates a short delay repeated
|
||||
(feedback) many times.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Registers to write the Chorus Parameters to (all are 16-bit, unless noted):
|
||||
(codified as in register,port,voice. port 0=0x620, 2=0x622, 4=0xA20, 6=0xA22, 8=0xE20)
|
||||
( 3409 = register 3, port A20, voice 9)
|
||||
@@ -702,16 +702,16 @@ Hall 1:
|
||||
0x7224,0x7224,0x7254,0x7284,0x4448,0x4548,0xA440,0xA540,
|
||||
0x842B,0x852B,0x842B,0x852B,0x842A,0x852A,0x842A,0x852A,
|
||||
0x8429,0x8529,0x8429,0x8529
|
||||
|
||||
|
||||
Hall 2:
|
||||
|
||||
|
||||
0xB488,0xA470,0x9570,0x84B5,0x383A,0x3EB5,0x7254,0x7234,
|
||||
0x7224,0x7254,0x7264,0x7294,0x44C3,0x45C3,0xA404,0xA504,
|
||||
0x842A,0x852A,0x842A,0x852A,0x8429,0x8529,0x8429,0x8529,
|
||||
0x8428,0x8528,0x8428,0x8528
|
||||
0x8428,0x8528,0x8428,0x8528
|
||||
|
||||
Plate:
|
||||
|
||||
|
||||
0xB4FF,0xA470,0x9570,0x84B5,0x383A,0x3EB5,0x7234,0x7234,
|
||||
0x7234,0x7234,0x7234,0x7234,0x4448,0x4548,0xA440,0xA540,
|
||||
0x842A,0x852A,0x842A,0x852A,0x8429,0x8529,0x8429,0x8529,
|
||||
|
||||
@@ -52,11 +52,11 @@ typedef enum MpuDataType
|
||||
T_COMMAND
|
||||
} MpuDataType;
|
||||
|
||||
typedef enum RecState
|
||||
{
|
||||
M_RECOFF,
|
||||
typedef enum RecState
|
||||
{
|
||||
M_RECOFF,
|
||||
M_RECSTB,
|
||||
M_RECON
|
||||
M_RECON
|
||||
} RecState;
|
||||
|
||||
/* Messages sent to MPU-401 from host */
|
||||
@@ -84,7 +84,7 @@ typedef struct mpu_t
|
||||
uint8_t rec_queue[MPU401_INPUT_QUEUE];
|
||||
int rec_queue_pos, rec_queue_used;
|
||||
uint32_t ch_toref[16];
|
||||
struct track
|
||||
struct track
|
||||
{
|
||||
int counter;
|
||||
uint8_t value[3], sys_val,
|
||||
@@ -141,7 +141,7 @@ typedef struct mpu_t
|
||||
uint8_t chan, trmask;
|
||||
uint32_t key[4];
|
||||
} chanref[5], inputref[16];
|
||||
pc_timer_t mpu401_event_callback, mpu401_eoi_callback,
|
||||
pc_timer_t mpu401_event_callback, mpu401_eoi_callback,
|
||||
mpu401_reset_callback;
|
||||
void (*ext_irq_update)(void *priv, int set);
|
||||
int (*ext_irq_pending)(void *priv);
|
||||
|
||||
@@ -57,17 +57,17 @@ typedef struct sb_ct1345_mixer_t
|
||||
double mic;
|
||||
/*see sb_ct1745_mixer for values for input selector*/
|
||||
int32_t input_selector;
|
||||
|
||||
|
||||
int input_filter;
|
||||
int in_filter_freq;
|
||||
int output_filter;
|
||||
|
||||
|
||||
int stereo;
|
||||
int stereo_isleft;
|
||||
|
||||
|
||||
uint8_t index;
|
||||
uint8_t regs[256];
|
||||
|
||||
|
||||
} sb_ct1345_mixer_t;
|
||||
/* SB16 and AWE32 */
|
||||
typedef struct sb_ct1745_mixer_t
|
||||
@@ -82,7 +82,7 @@ typedef struct sb_ct1745_mixer_t
|
||||
|
||||
int bass_l, bass_r;
|
||||
int treble_l, treble_r;
|
||||
|
||||
|
||||
int output_selector;
|
||||
#define OUTPUT_MIC 1
|
||||
#define OUTPUT_CD_R 2
|
||||
@@ -101,12 +101,12 @@ typedef struct sb_ct1745_mixer_t
|
||||
#define INPUT_MIDI_L 64
|
||||
|
||||
int mic_agc;
|
||||
|
||||
|
||||
int32_t input_gain_L;
|
||||
int32_t input_gain_R;
|
||||
double output_gain_L;
|
||||
double output_gain_R;
|
||||
|
||||
|
||||
uint8_t index;
|
||||
uint8_t regs[256];
|
||||
} sb_ct1745_mixer_t;
|
||||
@@ -127,7 +127,7 @@ typedef struct sb_t
|
||||
void *gameport;
|
||||
|
||||
int pos;
|
||||
|
||||
|
||||
uint8_t pos_regs[8], pnp_rom[512];
|
||||
|
||||
uint16_t opl_pnp_addr;
|
||||
|
||||
@@ -25,10 +25,10 @@ typedef struct sn76489_t
|
||||
uint8_t firstdat;
|
||||
int type;
|
||||
int extra_divide;
|
||||
|
||||
|
||||
int16_t buffer[SOUNDBUFLEN];
|
||||
int pos;
|
||||
|
||||
|
||||
double psgconst;
|
||||
} sn76489_t;
|
||||
|
||||
|
||||
@@ -5,21 +5,21 @@ typedef struct ym7128_t
|
||||
{
|
||||
int a0, sci;
|
||||
uint8_t dat;
|
||||
|
||||
|
||||
int reg_sel;
|
||||
uint8_t regs[32];
|
||||
|
||||
|
||||
int gl[8], gr[8];
|
||||
int vm, vc, vl, vr;
|
||||
int c0, c1;
|
||||
int t[9];
|
||||
|
||||
|
||||
int16_t filter_dat;
|
||||
int16_t prev_l, prev_r;
|
||||
|
||||
|
||||
int16_t delay_buffer[2400];
|
||||
int delay_pos;
|
||||
|
||||
|
||||
int16_t last_samp;
|
||||
} ym7128_t;
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ typedef union
|
||||
32:32 fixed point format, with the integer part compared against the TSC. The
|
||||
fractional part is used when advancing the timestamp to ensure a more accurate
|
||||
period.
|
||||
|
||||
|
||||
As the timer only stores 32 bits of integer timestamp, and the TSC is 64 bits,
|
||||
the timer period can only be at most 0x7fffffff CPU cycles. To allow room for
|
||||
(optimistic) CPU frequency growth, timer period must be at most 1 second.
|
||||
|
||||
@@ -20,7 +20,7 @@ enum
|
||||
EEPROM_OP_WRITE = 5,
|
||||
EEPROM_OP_READ = 6,
|
||||
EEPROM_OP_ERASE = 7,
|
||||
|
||||
|
||||
EEPROM_OP_WRALMAIN = -1
|
||||
};
|
||||
|
||||
|
||||
@@ -22,12 +22,12 @@
|
||||
typedef struct cga_t
|
||||
{
|
||||
mem_mapping_t mapping;
|
||||
|
||||
|
||||
int crtcreg;
|
||||
uint8_t crtc[32];
|
||||
|
||||
|
||||
uint8_t cgastat;
|
||||
|
||||
|
||||
uint8_t cgamode, cgacol;
|
||||
|
||||
int fontbase;
|
||||
@@ -41,13 +41,13 @@ typedef struct cga_t
|
||||
|
||||
uint64_t dispontime, dispofftime;
|
||||
pc_timer_t timer;
|
||||
|
||||
|
||||
int firstline, lastline;
|
||||
|
||||
|
||||
int drawcursor;
|
||||
|
||||
|
||||
uint8_t *vram;
|
||||
|
||||
|
||||
uint8_t charbuffer[256];
|
||||
|
||||
int revision;
|
||||
|
||||
@@ -8,15 +8,15 @@
|
||||
typedef struct mda_t
|
||||
{
|
||||
mem_mapping_t mapping;
|
||||
|
||||
|
||||
uint8_t crtc[32];
|
||||
int crtcreg;
|
||||
|
||||
|
||||
uint8_t ctrl, stat;
|
||||
|
||||
|
||||
uint64_t dispontime, dispofftime;
|
||||
pc_timer_t timer;
|
||||
|
||||
|
||||
int firstline, lastline;
|
||||
|
||||
int linepos, displine;
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
*
|
||||
* This file is part of the 86Box distribution.
|
||||
*
|
||||
* Emulation of the Olivetti OGC 8-bit ISA (GO708) and
|
||||
* Emulation of the Olivetti OGC 8-bit ISA (GO708) and
|
||||
* M21/M24/M28 16-bit bus (GO317/318/380/709) video cards.
|
||||
*
|
||||
*
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
*
|
||||
* This file is part of the 86Box distribution.
|
||||
*
|
||||
* Emulation of the Olivetti OGC 8-bit ISA (GO708) and
|
||||
* Emulation of the Olivetti OGC 8-bit ISA (GO708) and
|
||||
* M21/M24/M28 16-bit bus (GO317/318/380/709) video cards.
|
||||
*
|
||||
*
|
||||
|
||||
@@ -48,7 +48,7 @@ typedef struct pgc_cmd {
|
||||
uint8_t hex;
|
||||
void (*handler)(struct pgc *);
|
||||
int (*parser) (struct pgc *, pgc_cl_t *, int);
|
||||
int p;
|
||||
int p;
|
||||
} pgc_cmd_t;
|
||||
|
||||
typedef struct pgc {
|
||||
@@ -98,7 +98,7 @@ typedef struct pgc {
|
||||
int waiting_error_fifo;
|
||||
int ascii_mode;
|
||||
int result_count;
|
||||
|
||||
|
||||
int fontbase;
|
||||
int linepos,
|
||||
displine;
|
||||
@@ -116,7 +116,7 @@ typedef struct pgc {
|
||||
|
||||
int drawcursor;
|
||||
|
||||
int (*inputbyte)(struct pgc *, uint8_t *result);
|
||||
int (*inputbyte)(struct pgc *, uint8_t *result);
|
||||
} pgc_t;
|
||||
|
||||
|
||||
|
||||
@@ -120,7 +120,7 @@ typedef struct svga_t
|
||||
/* Called when VC=R18 and friends. If this returns zero then MA resetting
|
||||
is skipped. Matrox Mystique in Power mode reuses this counter for
|
||||
vertical line interrupt*/
|
||||
int (*line_compare)(struct svga_t *svga);
|
||||
int (*line_compare)(struct svga_t *svga);
|
||||
|
||||
/*Called at the start of vertical sync*/
|
||||
void (*vsync_callback)(struct svga_t *svga);
|
||||
@@ -148,7 +148,7 @@ typedef struct svga_t
|
||||
uint16_t ksc5601_english_font_type;
|
||||
|
||||
int vertical_linedbl;
|
||||
|
||||
|
||||
/*Used to implement CRTC[0x17] bit 2 hsync divisor*/
|
||||
int hsync_divisor;
|
||||
|
||||
@@ -167,7 +167,7 @@ typedef struct svga_t
|
||||
} svga_t;
|
||||
|
||||
|
||||
extern int svga_init(const device_t *info, svga_t *svga, void *p, int memsize,
|
||||
extern int svga_init(const device_t *info, svga_t *svga, void *p, int memsize,
|
||||
void (*recalctimings_ex)(struct svga_t *svga),
|
||||
uint8_t (*video_in) (uint16_t addr, void *p),
|
||||
void (*video_out)(uint16_t addr, uint8_t val, void *p),
|
||||
|
||||
@@ -103,7 +103,7 @@ static uint32_t (*address_remap_funcs[16])(svga_t *svga, uint32_t in_addr) =
|
||||
void svga_recalc_remap_func(svga_t *svga)
|
||||
{
|
||||
int func_nr;
|
||||
|
||||
|
||||
if (svga->fb_only || svga->force_byte_mode)
|
||||
func_nr = 0;
|
||||
else {
|
||||
@@ -117,7 +117,7 @@ void svga_recalc_remap_func(svga_t *svga)
|
||||
func_nr = VAR_WORD_MODE_MA15;
|
||||
else
|
||||
func_nr = VAR_WORD_MODE_MA13;
|
||||
|
||||
|
||||
if (!(svga->crtc[0x17] & 0x01))
|
||||
func_nr |= VAR_ROW0_MA13;
|
||||
if (!(svga->crtc[0x17] & 0x02))
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
typedef struct vga_t
|
||||
{
|
||||
svga_t svga;
|
||||
|
||||
|
||||
rom_t bios_rom;
|
||||
} vga_t;
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*Registers :
|
||||
|
||||
|
||||
alphaMode
|
||||
fbzMode & 0x1f3fff
|
||||
fbzColorPath
|
||||
@@ -30,8 +30,8 @@ typedef struct voodoo_x86_data_t
|
||||
uint32_t fbzColorPath;
|
||||
uint32_t textureMode[2];
|
||||
uint32_t tLOD[2];
|
||||
uint32_t trexInit1;
|
||||
int is_tiled;
|
||||
uint32_t trexInit1;
|
||||
int is_tiled;
|
||||
} voodoo_x86_data_t;
|
||||
|
||||
//static voodoo_x86_data_t voodoo_x86_data[2][BLOCK_NUM];
|
||||
@@ -187,7 +187,7 @@ static inline int codegen_texture_fetch(uint8_t *code_block, voodoo_t *voodoo, v
|
||||
addlong(offsetof(voodoo_state_t, lod_max[tmu]));
|
||||
addbyte(0xc1); /*SHR EAX, 8*/
|
||||
addbyte(0xe8);
|
||||
addbyte(8);
|
||||
addbyte(8);
|
||||
addbyte(0x89); /*MOV state->lod, EAX*/
|
||||
addbyte(0x87);
|
||||
addlong(offsetof(voodoo_state_t, lod));
|
||||
@@ -219,7 +219,7 @@ static inline int codegen_texture_fetch(uint8_t *code_block, voodoo_t *voodoo, v
|
||||
addlong(offsetof(voodoo_state_t, tex_s));
|
||||
addbyte(0xc1); /*SHR EBX, 8*/
|
||||
addbyte(0xeb);
|
||||
addbyte(8);
|
||||
addbyte(8);
|
||||
addbyte(0x48); /*MOV state->tex_t, RCX*/
|
||||
addbyte(0x89);
|
||||
addbyte(0x8f);
|
||||
@@ -552,7 +552,7 @@ static inline int codegen_texture_fetch(uint8_t *code_block, voodoo_t *voodoo, v
|
||||
addbyte(0x0f);
|
||||
addbyte(0x67);
|
||||
addbyte(0xc0);
|
||||
|
||||
|
||||
addbyte(0x4c); /*MOV RSI, R15*/
|
||||
addbyte(0x89);
|
||||
addbyte(0xfe);
|
||||
@@ -560,7 +560,7 @@ static inline int codegen_texture_fetch(uint8_t *code_block, voodoo_t *voodoo, v
|
||||
addbyte(0x66); /*MOV EAX, XMM0*/
|
||||
addbyte(0x0f);
|
||||
addbyte(0x7e);
|
||||
addbyte(0xc0);
|
||||
addbyte(0xc0);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -677,7 +677,7 @@ static inline int codegen_texture_fetch(uint8_t *code_block, voodoo_t *voodoo, v
|
||||
}
|
||||
|
||||
static inline void voodoo_generate(uint8_t *code_block, voodoo_t *voodoo, voodoo_params_t *params, voodoo_state_t *state, int depthop)
|
||||
{
|
||||
{
|
||||
int block_pos = 0;
|
||||
int z_skip_pos = 0;
|
||||
int a_skip_pos = 0;
|
||||
@@ -715,7 +715,7 @@ static inline void voodoo_generate(uint8_t *code_block, voodoo_t *voodoo, voodoo
|
||||
addbyte(0x56);
|
||||
addbyte(0x41); /*PUSH R15*/
|
||||
addbyte(0x57);
|
||||
|
||||
|
||||
addbyte(0x49); /*MOV R15, xmm_01_w*/
|
||||
addbyte(0xbf);
|
||||
addquad((uint64_t)(uintptr_t)&xmm_01_w);
|
||||
@@ -880,7 +880,7 @@ static inline void voodoo_generate(uint8_t *code_block, voodoo_t *voodoo, voodoo
|
||||
*(uint8_t *)&code_block[depth_jump_pos] = (block_pos - depth_jump_pos) - 1;
|
||||
if (depth_jump_pos)
|
||||
*(uint8_t *)&code_block[depth_jump_pos2] = (block_pos - depth_jump_pos2) - 1;
|
||||
|
||||
|
||||
if ((params->fogMode & (FOG_ENABLE|FOG_CONSTANT|FOG_Z|FOG_ALPHA)) == FOG_ENABLE)
|
||||
{
|
||||
addbyte(0x89); /*MOV state->w_depth[EDI], EAX*/
|
||||
@@ -914,7 +914,7 @@ static inline void voodoo_generate(uint8_t *code_block, voodoo_t *voodoo, voodoo
|
||||
{
|
||||
addbyte(0x03); /*ADD EAX, params->zaColor[ESI]*/
|
||||
addbyte(0x86);
|
||||
addlong(offsetof(voodoo_params_t, zaColor));
|
||||
addlong(offsetof(voodoo_params_t, zaColor));
|
||||
addbyte(0x25); /*AND EAX, 0xffff*/
|
||||
addlong(0xffff);
|
||||
}
|
||||
@@ -1000,14 +1000,14 @@ static inline void voodoo_generate(uint8_t *code_block, voodoo_t *voodoo, voodoo
|
||||
|
||||
/*XMM0 = colour*/
|
||||
/*XMM2 = 0 (for unpacking*/
|
||||
|
||||
|
||||
/*EDI = state, ESI = params*/
|
||||
|
||||
if ((params->textureMode[0] & TEXTUREMODE_LOCAL_MASK) == TEXTUREMODE_LOCAL || !voodoo->dual_tmus)
|
||||
{
|
||||
/*TMU0 only sampling local colour or only one TMU, only sample TMU0*/
|
||||
block_pos = codegen_texture_fetch(code_block, voodoo, params, state, block_pos, 0);
|
||||
|
||||
|
||||
addbyte(0x66); /*MOVD XMM0, EAX*/
|
||||
addbyte(0x0f);
|
||||
addbyte(0x6e);
|
||||
@@ -1023,7 +1023,7 @@ static inline void voodoo_generate(uint8_t *code_block, voodoo_t *voodoo, voodoo
|
||||
{
|
||||
/*TMU0 in pass-through mode, only sample TMU1*/
|
||||
block_pos = codegen_texture_fetch(code_block, voodoo, params, state, block_pos, 1);
|
||||
|
||||
|
||||
addbyte(0x66); /*MOVD XMM0, EAX*/
|
||||
addbyte(0x0f);
|
||||
addbyte(0x6e);
|
||||
@@ -1331,7 +1331,7 @@ static inline void voodoo_generate(uint8_t *code_block, voodoo_t *voodoo, voodoo
|
||||
addbyte(0xd8);
|
||||
addbyte(3);
|
||||
}
|
||||
|
||||
|
||||
block_pos = codegen_texture_fetch(code_block, voodoo, params, state, block_pos, 0);
|
||||
|
||||
addbyte(0x66); /*MOVD XMM0, EAX*/
|
||||
@@ -1342,7 +1342,7 @@ static inline void voodoo_generate(uint8_t *code_block, voodoo_t *voodoo, voodoo
|
||||
addbyte(0x0f);
|
||||
addbyte(0x6e);
|
||||
addbyte(0xf8);
|
||||
|
||||
|
||||
if (params->textureMode[0] & TEXTUREMODE_TRILINEAR)
|
||||
{
|
||||
addbyte(0x8b); /*MOV EAX, state->lod*/
|
||||
@@ -1567,7 +1567,7 @@ static inline void voodoo_generate(uint8_t *code_block, voodoo_t *voodoo, voodoo
|
||||
addbyte(0xef);
|
||||
addbyte(0xc9);
|
||||
}
|
||||
|
||||
|
||||
addbyte(0x66); /*PACKUSWB XMM0, XMM0*/
|
||||
addbyte(0x0f);
|
||||
addbyte(0x67);
|
||||
@@ -1580,7 +1580,7 @@ static inline void voodoo_generate(uint8_t *code_block, voodoo_t *voodoo, voodoo
|
||||
addbyte(0x0f);
|
||||
addbyte(0x67);
|
||||
addbyte(0xc9);
|
||||
|
||||
|
||||
if (tca_zero_other)
|
||||
{
|
||||
addbyte(0x31); /*XOR EAX, EAX*/
|
||||
@@ -1848,7 +1848,7 @@ static inline void voodoo_generate(uint8_t *code_block, voodoo_t *voodoo, voodoo
|
||||
addbyte(0x8f);
|
||||
addlong(offsetof(voodoo_state_t, ia));
|
||||
addbyte(0x31); /*XOR EAX, EAX*/
|
||||
addbyte(0xc0);
|
||||
addbyte(0xc0);
|
||||
addbyte(0xba); /*MOV EDX, 0xff*/
|
||||
addlong(0xff);
|
||||
addbyte(0xc1);/*SAR ECX, 12*/
|
||||
@@ -1877,7 +1877,7 @@ static inline void voodoo_generate(uint8_t *code_block, voodoo_t *voodoo, voodoo
|
||||
if (a_sel != A_SEL_ITER_A)
|
||||
{
|
||||
addbyte(0x31); /*XOR EAX, EAX*/
|
||||
addbyte(0xc0);
|
||||
addbyte(0xc0);
|
||||
addbyte(0xba); /*MOV EDX, 0xff*/
|
||||
addlong(0xff);
|
||||
}
|
||||
@@ -1893,7 +1893,7 @@ static inline void voodoo_generate(uint8_t *code_block, voodoo_t *voodoo, voodoo
|
||||
addbyte(0x47);
|
||||
addbyte(0xca);
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
addbyte(0xb9); /*MOV ECX, 0xff*/
|
||||
addlong(0xff);
|
||||
@@ -1910,7 +1910,7 @@ static inline void voodoo_generate(uint8_t *code_block, voodoo_t *voodoo, voodoo
|
||||
addbyte(0x89); /*MOV EDX, EBX*/
|
||||
addbyte(0xda);
|
||||
}
|
||||
|
||||
|
||||
if (cca_sub_clocal)
|
||||
{
|
||||
addbyte(0x29); /*SUB EDX, ECX*/
|
||||
@@ -2127,7 +2127,7 @@ static inline void voodoo_generate(uint8_t *code_block, voodoo_t *voodoo, voodoo
|
||||
addbyte(0x31); /*XOR EAX, EAX*/
|
||||
addbyte(0xc0);
|
||||
}
|
||||
|
||||
|
||||
if (!(cc_mselect == 0 && cc_reverse_blend == 0) && cc_mselect == CC_MSELECT_AOTHER)
|
||||
{
|
||||
/*Copy a_other to XMM3 before it gets modified*/
|
||||
@@ -2141,7 +2141,7 @@ static inline void voodoo_generate(uint8_t *code_block, voodoo_t *voodoo, voodoo
|
||||
addbyte(0xdb);
|
||||
addbyte(0x00);
|
||||
}
|
||||
|
||||
|
||||
if (cca_add && (params->alphaMode & ((1 << 0) | (1 << 4))))
|
||||
{
|
||||
addbyte(0x01); /*ADD EDX, ECX*/
|
||||
@@ -2236,7 +2236,7 @@ static inline void voodoo_generate(uint8_t *code_block, voodoo_t *voodoo, voodoo
|
||||
addbyte(0x0f);
|
||||
addbyte(0xef);
|
||||
addbyte(0xdb);
|
||||
break;
|
||||
break;
|
||||
}
|
||||
addbyte(0xf3); /*MOV XMM4, XMM0*/
|
||||
addbyte(0x0f);
|
||||
@@ -2277,7 +2277,7 @@ static inline void voodoo_generate(uint8_t *code_block, voodoo_t *voodoo, voodoo
|
||||
addbyte(0x6b);
|
||||
addbyte(0xc0);
|
||||
}
|
||||
|
||||
|
||||
if (cc_add == 1)
|
||||
{
|
||||
addbyte(0x66); /*PADDW XMM0, XMM1*/
|
||||
@@ -2302,8 +2302,8 @@ static inline void voodoo_generate(uint8_t *code_block, voodoo_t *voodoo, voodoo
|
||||
|
||||
if (params->fogMode & FOG_ENABLE)
|
||||
{
|
||||
if (params->fogMode & FOG_CONSTANT)
|
||||
{
|
||||
if (params->fogMode & FOG_CONSTANT)
|
||||
{
|
||||
addbyte(0x66); /*MOVD XMM3, params->fogColor[ESI]*/
|
||||
addbyte(0x0f);
|
||||
addbyte(0x6e);
|
||||
@@ -2313,15 +2313,15 @@ static inline void voodoo_generate(uint8_t *code_block, voodoo_t *voodoo, voodoo
|
||||
addbyte(0x0f);
|
||||
addbyte(0xdc);
|
||||
addbyte(0xc3);
|
||||
}
|
||||
else
|
||||
{
|
||||
}
|
||||
else
|
||||
{
|
||||
addbyte(0x66); /*PUNPCKLBW XMM0, XMM2*/
|
||||
addbyte(0x0f);
|
||||
addbyte(0x60);
|
||||
addbyte(0xc2);
|
||||
|
||||
if (!(params->fogMode & FOG_ADD))
|
||||
if (!(params->fogMode & FOG_ADD))
|
||||
{
|
||||
addbyte(0x66); /*MOVD XMM3, params->fogColor[ESI]*/
|
||||
addbyte(0x0f);
|
||||
@@ -2332,7 +2332,7 @@ static inline void voodoo_generate(uint8_t *code_block, voodoo_t *voodoo, voodoo
|
||||
addbyte(0x0f);
|
||||
addbyte(0x60);
|
||||
addbyte(0xda);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
addbyte(0x66); /*PXOR XMM3, XMM3*/
|
||||
@@ -2340,7 +2340,7 @@ static inline void voodoo_generate(uint8_t *code_block, voodoo_t *voodoo, voodoo
|
||||
addbyte(0xef);
|
||||
addbyte(0xdb);
|
||||
}
|
||||
|
||||
|
||||
if (!(params->fogMode & FOG_MULT))
|
||||
{
|
||||
addbyte(0x66); /*PSUBW XMM3, XMM0*/
|
||||
@@ -2394,7 +2394,7 @@ static inline void voodoo_generate(uint8_t *code_block, voodoo_t *voodoo, voodoo
|
||||
fog_a = params->fogTable[fog_idx].fog;
|
||||
fog_a += (params->fogTable[fog_idx].dfog * ((w_depth >> 2) & 0xff)) >> 10;*/
|
||||
break;
|
||||
|
||||
|
||||
case FOG_Z:
|
||||
addbyte(0x8b); /*MOV EAX, state->z[EDI]*/
|
||||
addbyte(0x87);
|
||||
@@ -2406,7 +2406,7 @@ static inline void voodoo_generate(uint8_t *code_block, voodoo_t *voodoo, voodoo
|
||||
addlong(0xff);
|
||||
// fog_a = (z >> 20) & 0xff;
|
||||
break;
|
||||
|
||||
|
||||
case FOG_ALPHA:
|
||||
addbyte(0x8b); /*MOV EAX, state->ia[EDI]*/
|
||||
addbyte(0x87);
|
||||
@@ -2428,7 +2428,7 @@ static inline void voodoo_generate(uint8_t *code_block, voodoo_t *voodoo, voodoo
|
||||
addbyte(0xc3);
|
||||
// fog_a = CLAMP(ia >> 12);
|
||||
break;
|
||||
|
||||
|
||||
case FOG_W:
|
||||
addbyte(0x8b); /*MOV EAX, state->w[EDI]+4*/
|
||||
addbyte(0x87);
|
||||
@@ -2540,7 +2540,7 @@ static inline void voodoo_generate(uint8_t *code_block, voodoo_t *voodoo, voodoo
|
||||
{
|
||||
addbyte(0xC3); /*RET*/
|
||||
}
|
||||
|
||||
|
||||
if (params->alphaMode & (1 << 4))
|
||||
{
|
||||
addbyte(0x49); /*MOV R8, rgb565*/
|
||||
@@ -2581,7 +2581,7 @@ static inline void voodoo_generate(uint8_t *code_block, voodoo_t *voodoo, voodoo
|
||||
addbyte(0x0f);
|
||||
addbyte(0x7e);
|
||||
addbyte(0xf4);
|
||||
|
||||
|
||||
switch (dest_afunc)
|
||||
{
|
||||
case AFUNC_AZERO:
|
||||
@@ -2919,7 +2919,7 @@ static inline void voodoo_generate(uint8_t *code_block, voodoo_t *voodoo, voodoo
|
||||
case AFUNC_ACOLORBEFOREFOG:
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
addbyte(0x66); /*PADDW XMM0, XMM4*/
|
||||
addbyte(0x0f);
|
||||
addbyte(0xfd);
|
||||
@@ -2942,7 +2942,7 @@ static inline void voodoo_generate(uint8_t *code_block, voodoo_t *voodoo, voodoo
|
||||
addbyte(0x0f);
|
||||
addbyte(0x7e);
|
||||
addbyte(0xc0);
|
||||
|
||||
|
||||
if (params->fbzMode & FBZ_RGB_WMASK)
|
||||
{
|
||||
if (dither)
|
||||
@@ -3142,7 +3142,7 @@ static inline void voodoo_generate(uint8_t *code_block, voodoo_t *voodoo, voodoo
|
||||
addbyte(0x0f);
|
||||
addbyte(0x6f);
|
||||
addbyte(0x86);
|
||||
addlong(offsetof(voodoo_params_t, dBdX));
|
||||
addlong(offsetof(voodoo_params_t, dBdX));
|
||||
addbyte(0x8b); /*MOV EAX, params->dZdX[ESI]*/
|
||||
addbyte(0x86);
|
||||
addlong(offsetof(voodoo_params_t, dZdX));
|
||||
@@ -3204,7 +3204,7 @@ static inline void voodoo_generate(uint8_t *code_block, voodoo_t *voodoo, voodoo
|
||||
addbyte(0xc7);
|
||||
addbyte(0x01); /*ADD state->z[EDI], EAX*/
|
||||
addbyte(0x87);
|
||||
addlong(offsetof(voodoo_state_t, z));
|
||||
addlong(offsetof(voodoo_state_t, z));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -3222,7 +3222,7 @@ static inline void voodoo_generate(uint8_t *code_block, voodoo_t *voodoo, voodoo
|
||||
addbyte(0xc7);
|
||||
addbyte(0x29); /*SUB state->z[EDI], EAX*/
|
||||
addbyte(0x87);
|
||||
addlong(offsetof(voodoo_state_t, z));
|
||||
addlong(offsetof(voodoo_state_t, z));
|
||||
}
|
||||
|
||||
if (voodoo->dual_tmus)
|
||||
@@ -3290,7 +3290,7 @@ static inline void voodoo_generate(uint8_t *code_block, voodoo_t *voodoo, voodoo
|
||||
addbyte(0xfb);
|
||||
addbyte(0xe6);
|
||||
}
|
||||
|
||||
|
||||
addbyte(0xf3); /*MOVDQU state->tmu1_s, XMM3*/
|
||||
addbyte(0x0f);
|
||||
addbyte(0x7f);
|
||||
@@ -3302,7 +3302,7 @@ static inline void voodoo_generate(uint8_t *code_block, voodoo_t *voodoo, voodoo
|
||||
addbyte(0xa7);
|
||||
addlong(offsetof(voodoo_state_t, tmu1_w));
|
||||
}
|
||||
|
||||
|
||||
addbyte(0x83); /*ADD state->pixel_count[EDI], 1*/
|
||||
addbyte(0x87);
|
||||
addlong(offsetof(voodoo_state_t, pixel_count));
|
||||
@@ -3324,13 +3324,13 @@ static inline void voodoo_generate(uint8_t *code_block, voodoo_t *voodoo, voodoo
|
||||
addbyte(0x87);
|
||||
addlong(offsetof(voodoo_state_t, texel_count));
|
||||
addbyte(2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
addbyte(0x8b); /*MOV EAX, state->x[EDI]*/
|
||||
addbyte(0x87);
|
||||
addlong(offsetof(voodoo_state_t, x));
|
||||
|
||||
|
||||
if (state->xdir > 0)
|
||||
{
|
||||
addbyte(0x83); /*ADD state->x[EDI], 1*/
|
||||
@@ -3354,18 +3354,18 @@ static inline void voodoo_generate(uint8_t *code_block, voodoo_t *voodoo, voodoo
|
||||
addlong(loop_jump_pos - (block_pos + 4));
|
||||
|
||||
addbyte(0x41); /*POP R15*/
|
||||
addbyte(0x5f);
|
||||
addbyte(0x5f);
|
||||
addbyte(0x41); /*POP R14*/
|
||||
addbyte(0x5e);
|
||||
addbyte(0x41); /*POP R13*/
|
||||
addbyte(0x5d);
|
||||
addbyte(0x5d);
|
||||
addbyte(0x41); /*POP R12*/
|
||||
addbyte(0x5c);
|
||||
addbyte(0x5b); /*POP RBX*/
|
||||
addbyte(0x5b); /*POP RBX*/
|
||||
addbyte(0x5e); /*POP RSI*/
|
||||
addbyte(0x5f); /*POP RDI*/
|
||||
addbyte(0x5d); /*POP RBP*/
|
||||
|
||||
|
||||
addbyte(0xC3); /*RET*/
|
||||
}
|
||||
int voodoo_recomp = 0;
|
||||
@@ -3375,11 +3375,11 @@ static inline void *voodoo_get_block(voodoo_t *voodoo, voodoo_params_t *params,
|
||||
int b = last_block[odd_even];
|
||||
voodoo_x86_data_t *voodoo_x86_data = voodoo->codegen_data;
|
||||
voodoo_x86_data_t *data;
|
||||
|
||||
|
||||
for (c = 0; c < 8; c++)
|
||||
{
|
||||
data = &voodoo_x86_data[odd_even + c*4]; //&voodoo_x86_data[odd_even][b];
|
||||
|
||||
|
||||
if (state->xdir == data->xdir &&
|
||||
params->alphaMode == data->alphaMode &&
|
||||
params->fbzMode == data->fbzMode &&
|
||||
@@ -3395,13 +3395,13 @@ static inline void *voodoo_get_block(voodoo_t *voodoo, voodoo_params_t *params,
|
||||
last_block[odd_even] = b;
|
||||
return data->code_block;
|
||||
}
|
||||
|
||||
|
||||
b = (b + 1) & 7;
|
||||
}
|
||||
voodoo_recomp++;
|
||||
data = &voodoo_x86_data[odd_even + next_block_to_write[odd_even]*4];
|
||||
// code_block = data->code_block;
|
||||
|
||||
|
||||
voodoo_generate(data->code_block, voodoo, params, state, depth_op);
|
||||
|
||||
data->xdir = state->xdir;
|
||||
@@ -3417,7 +3417,7 @@ voodoo_recomp++;
|
||||
data->is_tiled = (params->col_tiled || params->aux_tiled) ? 1 : 0;
|
||||
|
||||
next_block_to_write[odd_even] = (next_block_to_write[odd_even] + 1) & 7;
|
||||
|
||||
|
||||
return data->code_block;
|
||||
}
|
||||
|
||||
@@ -3432,7 +3432,7 @@ void voodoo_codegen_init(voodoo_t *voodoo)
|
||||
int d[4];
|
||||
int _ds = c & 0xf;
|
||||
int dt = c >> 4;
|
||||
|
||||
|
||||
alookup[c] = _mm_set_epi32(0, 0, c | (c << 16), c | (c << 16));
|
||||
aminuslookup[c] = _mm_set_epi32(0, 0, (255-c) | ((255-c) << 16), (255-c) | ((255-c) << 16));
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*Registers :
|
||||
|
||||
|
||||
alphaMode
|
||||
fbzMode & 0x1f3fff
|
||||
fbzColorPath
|
||||
@@ -202,7 +202,7 @@ static inline int codegen_texture_fetch(uint8_t *code_block, voodoo_t *voodoo, v
|
||||
addbyte(0xd8);
|
||||
addbyte(0xc1); /*SHR EAX, 8*/
|
||||
addbyte(0xe8);
|
||||
addbyte(8);
|
||||
addbyte(8);
|
||||
addbyte(0x66); /*MOVQ state->tex_s, XMM4*/
|
||||
addbyte(0x0f);
|
||||
addbyte(0xd6);
|
||||
@@ -418,7 +418,7 @@ static inline int codegen_texture_fetch(uint8_t *code_block, voodoo_t *voodoo, v
|
||||
addbyte(0x7e);
|
||||
addbyte(0x0c);
|
||||
addbyte(0x82);
|
||||
|
||||
|
||||
if (state->clamp_s[tmu])
|
||||
{
|
||||
addbyte(0xeb); /*JMP +*/
|
||||
@@ -492,7 +492,7 @@ static inline int codegen_texture_fetch(uint8_t *code_block, voodoo_t *voodoo, v
|
||||
addbyte(0x0f);
|
||||
addbyte(0x60);
|
||||
addbyte(0xca);
|
||||
|
||||
|
||||
addbyte(0x81); /*ADD ESI, bilinear_lookup*/
|
||||
addbyte(0xc6);
|
||||
addlong((uint32_t)bilinear_lookup);
|
||||
@@ -532,7 +532,7 @@ static inline int codegen_texture_fetch(uint8_t *code_block, voodoo_t *voodoo, v
|
||||
addbyte(0x0f);
|
||||
addbyte(0x67);
|
||||
addbyte(0xc0);
|
||||
|
||||
|
||||
addbyte(0x8b); /*MOV ESI, [ESP+8]*/
|
||||
addbyte(0x74);
|
||||
addbyte(0x24);
|
||||
@@ -541,7 +541,7 @@ static inline int codegen_texture_fetch(uint8_t *code_block, voodoo_t *voodoo, v
|
||||
addbyte(0x66); /*MOV EAX, XMM0*/
|
||||
addbyte(0x0f);
|
||||
addbyte(0x7e);
|
||||
addbyte(0xc0);
|
||||
addbyte(0xc0);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -660,7 +660,7 @@ static inline int codegen_texture_fetch(uint8_t *code_block, voodoo_t *voodoo, v
|
||||
}
|
||||
|
||||
static inline void voodoo_generate(uint8_t *code_block, voodoo_t *voodoo, voodoo_params_t *params, voodoo_state_t *state, int depthop)
|
||||
{
|
||||
{
|
||||
int block_pos = 0;
|
||||
int z_skip_pos = 0;
|
||||
int a_skip_pos = 0;
|
||||
@@ -690,7 +690,7 @@ static inline void voodoo_generate(uint8_t *code_block, voodoo_t *voodoo, voodoo
|
||||
addbyte(0x57); /*PUSH EDI*/
|
||||
addbyte(0x56); /*PUSH ESI*/
|
||||
addbyte(0x53); /*PUSH EBX*/
|
||||
|
||||
|
||||
addbyte(0x8b); /*MOV EDI, [ESP+4]*/
|
||||
addbyte(0x7c);
|
||||
addbyte(0x24);
|
||||
@@ -791,7 +791,7 @@ static inline void voodoo_generate(uint8_t *code_block, voodoo_t *voodoo, voodoo
|
||||
*(uint8_t *)&code_block[depth_jump_pos] = (block_pos - depth_jump_pos) - 1;
|
||||
if (depth_jump_pos)
|
||||
*(uint8_t *)&code_block[depth_jump_pos2] = (block_pos - depth_jump_pos2) - 1;
|
||||
|
||||
|
||||
if ((params->fogMode & (FOG_ENABLE|FOG_CONSTANT|FOG_Z|FOG_ALPHA)) == FOG_ENABLE)
|
||||
{
|
||||
addbyte(0x89); /*MOV state->w_depth[EDI], EAX*/
|
||||
@@ -820,13 +820,13 @@ static inline void voodoo_generate(uint8_t *code_block, voodoo_t *voodoo, voodoo
|
||||
addbyte(0x47);
|
||||
addbyte(0xc3);
|
||||
}
|
||||
|
||||
|
||||
if (params->fbzMode & FBZ_DEPTH_BIAS)
|
||||
{
|
||||
addbyte(0x0f); /*MOVSX EDX, params->zaColor[ESI]*/
|
||||
addbyte(0xbf);
|
||||
addbyte(0x96);
|
||||
addlong(offsetof(voodoo_params_t, zaColor));
|
||||
addlong(offsetof(voodoo_params_t, zaColor));
|
||||
if (params->fbzMode & FBZ_W_BUFFER)
|
||||
{
|
||||
addbyte(0xbb); /*MOV EBX, 0xffff*/
|
||||
@@ -935,14 +935,14 @@ static inline void voodoo_generate(uint8_t *code_block, voodoo_t *voodoo, voodoo
|
||||
// voodoo_combine = &code_block[block_pos];
|
||||
/*XMM0 = colour*/
|
||||
/*XMM2 = 0 (for unpacking*/
|
||||
|
||||
|
||||
/*EDI = state, ESI = params*/
|
||||
|
||||
if ((params->textureMode[0] & TEXTUREMODE_LOCAL_MASK) == TEXTUREMODE_LOCAL || !voodoo->dual_tmus)
|
||||
{
|
||||
/*TMU0 only sampling local colour or only one TMU, only sample TMU0*/
|
||||
block_pos = codegen_texture_fetch(code_block, voodoo, params, state, block_pos, 0);
|
||||
|
||||
|
||||
addbyte(0x66); /*MOVD XMM0, EAX*/
|
||||
addbyte(0x0f);
|
||||
addbyte(0x6e);
|
||||
@@ -958,7 +958,7 @@ static inline void voodoo_generate(uint8_t *code_block, voodoo_t *voodoo, voodoo
|
||||
{
|
||||
/*TMU0 in pass-through mode, only sample TMU1*/
|
||||
block_pos = codegen_texture_fetch(code_block, voodoo, params, state, block_pos, 1);
|
||||
|
||||
|
||||
addbyte(0x66); /*MOVD XMM0, EAX*/
|
||||
addbyte(0x0f);
|
||||
addbyte(0x6e);
|
||||
@@ -1268,7 +1268,7 @@ static inline void voodoo_generate(uint8_t *code_block, voodoo_t *voodoo, voodoo
|
||||
addbyte(0xd8);
|
||||
addbyte(3);
|
||||
}
|
||||
|
||||
|
||||
block_pos = codegen_texture_fetch(code_block, voodoo, params, state, block_pos, 0);
|
||||
|
||||
addbyte(0x66); /*MOVD XMM0, EAX*/
|
||||
@@ -1279,7 +1279,7 @@ static inline void voodoo_generate(uint8_t *code_block, voodoo_t *voodoo, voodoo
|
||||
addbyte(0x0f);
|
||||
addbyte(0x6e);
|
||||
addbyte(0xf8);
|
||||
|
||||
|
||||
if (params->textureMode[0] & TEXTUREMODE_TRILINEAR)
|
||||
{
|
||||
addbyte(0x8b); /*MOV EAX, state->lod*/
|
||||
@@ -1475,7 +1475,7 @@ static inline void voodoo_generate(uint8_t *code_block, voodoo_t *voodoo, voodoo
|
||||
addbyte(0xeb);
|
||||
addbyte(24);
|
||||
}
|
||||
|
||||
|
||||
if (tc_add_clocal)
|
||||
{
|
||||
addbyte(0x66); /*PADDW XMM1, XMM0*/
|
||||
@@ -1495,7 +1495,7 @@ static inline void voodoo_generate(uint8_t *code_block, voodoo_t *voodoo, voodoo
|
||||
addbyte(0xfd);
|
||||
addbyte(0xcc);
|
||||
}
|
||||
|
||||
|
||||
addbyte(0x66); /*PACKUSWB XMM0, XMM0*/
|
||||
addbyte(0x0f);
|
||||
addbyte(0x67);
|
||||
@@ -1516,7 +1516,7 @@ static inline void voodoo_generate(uint8_t *code_block, voodoo_t *voodoo, voodoo
|
||||
addbyte(0x0d);
|
||||
addlong((uint32_t)&xmm_ff_b);
|
||||
}
|
||||
|
||||
|
||||
if (tca_zero_other)
|
||||
{
|
||||
addbyte(0x31); /*XOR EAX, EAX*/
|
||||
@@ -1783,7 +1783,7 @@ static inline void voodoo_generate(uint8_t *code_block, voodoo_t *voodoo, voodoo
|
||||
addbyte(0x8f);
|
||||
addlong(offsetof(voodoo_state_t, ia));
|
||||
addbyte(0x31); /*XOR EAX, EAX*/
|
||||
addbyte(0xc0);
|
||||
addbyte(0xc0);
|
||||
addbyte(0xba); /*MOV EDX, 0xff*/
|
||||
addlong(0xff);
|
||||
addbyte(0xc1);/*SAR ECX, 12*/
|
||||
@@ -1812,7 +1812,7 @@ static inline void voodoo_generate(uint8_t *code_block, voodoo_t *voodoo, voodoo
|
||||
if (a_sel != A_SEL_ITER_A)
|
||||
{
|
||||
addbyte(0x31); /*XOR EAX, EAX*/
|
||||
addbyte(0xc0);
|
||||
addbyte(0xc0);
|
||||
addbyte(0xba); /*MOV EDX, 0xff*/
|
||||
addlong(0xff);
|
||||
}
|
||||
@@ -1828,7 +1828,7 @@ static inline void voodoo_generate(uint8_t *code_block, voodoo_t *voodoo, voodoo
|
||||
addbyte(0x47);
|
||||
addbyte(0xca);
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
addbyte(0xb9); /*MOV ECX, 0xff*/
|
||||
addlong(0xff);
|
||||
@@ -1845,7 +1845,7 @@ static inline void voodoo_generate(uint8_t *code_block, voodoo_t *voodoo, voodoo
|
||||
addbyte(0x89); /*MOV EDX, EBX*/
|
||||
addbyte(0xda);
|
||||
}
|
||||
|
||||
|
||||
if (cca_sub_clocal)
|
||||
{
|
||||
addbyte(0x29); /*SUB EDX, ECX*/
|
||||
@@ -2061,7 +2061,7 @@ static inline void voodoo_generate(uint8_t *code_block, voodoo_t *voodoo, voodoo
|
||||
addbyte(0x31); /*XOR EAX, EAX*/
|
||||
addbyte(0xc0);
|
||||
}
|
||||
|
||||
|
||||
if (!(cc_mselect == 0 && cc_reverse_blend == 0) && cc_mselect == CC_MSELECT_AOTHER)
|
||||
{
|
||||
/*Copy a_other to XMM3 before it gets modified*/
|
||||
@@ -2075,13 +2075,13 @@ static inline void voodoo_generate(uint8_t *code_block, voodoo_t *voodoo, voodoo
|
||||
addbyte(0xdb);
|
||||
addbyte(0x00);
|
||||
}
|
||||
|
||||
|
||||
if (cca_add && (params->alphaMode & ((1 << 0) | (1 << 4))))
|
||||
{
|
||||
addbyte(0x01); /*ADD EDX, ECX*/
|
||||
addbyte(0xca);
|
||||
}
|
||||
|
||||
|
||||
if ((params->alphaMode & ((1 << 0) | (1 << 4))))
|
||||
{
|
||||
addbyte(0x85); /*TEST EDX, EDX*/
|
||||
@@ -2212,7 +2212,7 @@ static inline void voodoo_generate(uint8_t *code_block, voodoo_t *voodoo, voodoo
|
||||
addbyte(0x6b);
|
||||
addbyte(0xc0);
|
||||
}
|
||||
|
||||
|
||||
if (cc_add == 1)
|
||||
{
|
||||
addbyte(0x66); /*PADDW XMM0, XMM1*/
|
||||
@@ -2242,8 +2242,8 @@ static inline void voodoo_generate(uint8_t *code_block, voodoo_t *voodoo, voodoo
|
||||
// addlong(offsetof(voodoo_state_t, out));
|
||||
if (params->fogMode & FOG_ENABLE)
|
||||
{
|
||||
if (params->fogMode & FOG_CONSTANT)
|
||||
{
|
||||
if (params->fogMode & FOG_CONSTANT)
|
||||
{
|
||||
addbyte(0x66); /*MOVD XMM3, params->fogColor[ESI]*/
|
||||
addbyte(0x0f);
|
||||
addbyte(0x6e);
|
||||
@@ -2253,20 +2253,20 @@ static inline void voodoo_generate(uint8_t *code_block, voodoo_t *voodoo, voodoo
|
||||
addbyte(0x0f);
|
||||
addbyte(0xdc);
|
||||
addbyte(0xc3);
|
||||
/* src_r += params->fogColor.r;
|
||||
src_g += params->fogColor.g;
|
||||
/* src_r += params->fogColor.r;
|
||||
src_g += params->fogColor.g;
|
||||
src_b += params->fogColor.b; */
|
||||
}
|
||||
else
|
||||
{
|
||||
}
|
||||
else
|
||||
{
|
||||
/*int fog_r, fog_g, fog_b, fog_a; */
|
||||
|
||||
|
||||
addbyte(0x66); /*PUNPCKLBW XMM0, XMM2*/
|
||||
addbyte(0x0f);
|
||||
addbyte(0x60);
|
||||
addbyte(0xc2);
|
||||
|
||||
if (!(params->fogMode & FOG_ADD))
|
||||
if (!(params->fogMode & FOG_ADD))
|
||||
{
|
||||
addbyte(0x66); /*MOVD XMM3, params->fogColor[ESI]*/
|
||||
addbyte(0x0f);
|
||||
@@ -2277,7 +2277,7 @@ static inline void voodoo_generate(uint8_t *code_block, voodoo_t *voodoo, voodoo
|
||||
addbyte(0x0f);
|
||||
addbyte(0x60);
|
||||
addbyte(0xda);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
addbyte(0x66); /*PXOR XMM3, XMM3*/
|
||||
@@ -2285,7 +2285,7 @@ static inline void voodoo_generate(uint8_t *code_block, voodoo_t *voodoo, voodoo
|
||||
addbyte(0xef);
|
||||
addbyte(0xdb);
|
||||
}
|
||||
|
||||
|
||||
if (!(params->fogMode & FOG_MULT))
|
||||
{
|
||||
addbyte(0x66); /*PSUBW XMM3, XMM0*/
|
||||
@@ -2340,7 +2340,7 @@ static inline void voodoo_generate(uint8_t *code_block, voodoo_t *voodoo, voodoo
|
||||
fog_a = params->fogTable[fog_idx].fog;
|
||||
fog_a += (params->fogTable[fog_idx].dfog * ((w_depth >> 2) & 0xff)) >> 10;*/
|
||||
break;
|
||||
|
||||
|
||||
case FOG_Z:
|
||||
addbyte(0x8b); /*MOV EAX, state->z[EDI]*/
|
||||
addbyte(0x87);
|
||||
@@ -2352,7 +2352,7 @@ static inline void voodoo_generate(uint8_t *code_block, voodoo_t *voodoo, voodoo
|
||||
addlong(0xff);
|
||||
// fog_a = (z >> 20) & 0xff;
|
||||
break;
|
||||
|
||||
|
||||
case FOG_ALPHA:
|
||||
addbyte(0x8b); /*MOV EAX, state->ia[EDI]*/
|
||||
addbyte(0x87);
|
||||
@@ -2374,7 +2374,7 @@ static inline void voodoo_generate(uint8_t *code_block, voodoo_t *voodoo, voodoo
|
||||
addbyte(0xc3);
|
||||
// fog_a = CLAMP(ia >> 12);
|
||||
break;
|
||||
|
||||
|
||||
case FOG_W:
|
||||
addbyte(0x8b); /*MOV EAX, state->w[EDI]+4*/
|
||||
addbyte(0x87);
|
||||
@@ -2496,7 +2496,7 @@ static inline void voodoo_generate(uint8_t *code_block, voodoo_t *voodoo, voodoo
|
||||
{
|
||||
addbyte(0xC3); /*RET*/
|
||||
}
|
||||
|
||||
|
||||
if (params->alphaMode & (1 << 4))
|
||||
{
|
||||
addbyte(0x8b); /*MOV EAX, state->x[EDI]*/
|
||||
@@ -2533,7 +2533,7 @@ static inline void voodoo_generate(uint8_t *code_block, voodoo_t *voodoo, voodoo
|
||||
addbyte(0x0f);
|
||||
addbyte(0x7e);
|
||||
addbyte(0xf4);
|
||||
|
||||
|
||||
switch (dest_afunc)
|
||||
{
|
||||
case AFUNC_AZERO:
|
||||
@@ -2862,7 +2862,7 @@ static inline void voodoo_generate(uint8_t *code_block, voodoo_t *voodoo, voodoo
|
||||
case AFUNC_ACOLORBEFOREFOG:
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
addbyte(0x66); /*PADDW XMM0, XMM4*/
|
||||
addbyte(0x0f);
|
||||
addbyte(0xfd);
|
||||
@@ -2873,7 +2873,7 @@ static inline void voodoo_generate(uint8_t *code_block, voodoo_t *voodoo, voodoo
|
||||
addbyte(0x67);
|
||||
addbyte(0xc0);
|
||||
}
|
||||
//#endif
|
||||
//#endif
|
||||
|
||||
// addbyte(0x8b); /*MOV EDX, x (ESP+12)*/
|
||||
// addbyte(0x54);
|
||||
@@ -2892,13 +2892,13 @@ static inline void voodoo_generate(uint8_t *code_block, voodoo_t *voodoo, voodoo
|
||||
addbyte(0x0f);
|
||||
addbyte(0x7e);
|
||||
addbyte(0xc0);
|
||||
|
||||
|
||||
if (params->fbzMode & FBZ_RGB_WMASK)
|
||||
{
|
||||
// addbyte(0x89); /*MOV state->rgb_out[EDI], EAX*/
|
||||
// addbyte(0x87);
|
||||
// addlong(offsetof(voodoo_state_t, rgb_out));
|
||||
|
||||
|
||||
if (dither)
|
||||
{
|
||||
addbyte(0x8b); /*MOV ESI, real_y (ESP+16)*/
|
||||
@@ -3149,7 +3149,7 @@ static inline void voodoo_generate(uint8_t *code_block, voodoo_t *voodoo, voodoo
|
||||
addbyte(0x0f);
|
||||
addbyte(0x6f);
|
||||
addbyte(0x86);
|
||||
addlong(offsetof(voodoo_params_t, dBdX));
|
||||
addlong(offsetof(voodoo_params_t, dBdX));
|
||||
addbyte(0x8b); /*MOV EAX, params->dZdX[ESI]*/
|
||||
addbyte(0x86);
|
||||
addlong(offsetof(voodoo_params_t, dZdX));
|
||||
@@ -3211,7 +3211,7 @@ static inline void voodoo_generate(uint8_t *code_block, voodoo_t *voodoo, voodoo
|
||||
addbyte(0xc7);
|
||||
addbyte(0x01); /*ADD state->z[EDI], EAX*/
|
||||
addbyte(0x87);
|
||||
addlong(offsetof(voodoo_state_t, z));
|
||||
addlong(offsetof(voodoo_state_t, z));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -3229,7 +3229,7 @@ static inline void voodoo_generate(uint8_t *code_block, voodoo_t *voodoo, voodoo
|
||||
addbyte(0xc7);
|
||||
addbyte(0x29); /*SUB state->z[EDI], EAX*/
|
||||
addbyte(0x87);
|
||||
addlong(offsetof(voodoo_state_t, z));
|
||||
addlong(offsetof(voodoo_state_t, z));
|
||||
}
|
||||
|
||||
addbyte(0xf3); /*MOVDQU state->tmu0_s, XMM3*/
|
||||
@@ -3247,7 +3247,7 @@ static inline void voodoo_generate(uint8_t *code_block, voodoo_t *voodoo, voodoo
|
||||
addbyte(0xd6);
|
||||
addbyte(0x87);
|
||||
addlong(offsetof(voodoo_state_t, w));
|
||||
|
||||
|
||||
addbyte(0x83); /*ADD state->pixel_count[EDI], 1*/
|
||||
addbyte(0x87);
|
||||
addlong(offsetof(voodoo_state_t, pixel_count));
|
||||
@@ -3269,12 +3269,12 @@ static inline void voodoo_generate(uint8_t *code_block, voodoo_t *voodoo, voodoo
|
||||
addbyte(0x87);
|
||||
addlong(offsetof(voodoo_state_t, texel_count));
|
||||
addbyte(2);
|
||||
}
|
||||
}
|
||||
}
|
||||
addbyte(0x8b); /*MOV EAX, state->x[EDI]*/
|
||||
addbyte(0x87);
|
||||
addlong(offsetof(voodoo_state_t, x));
|
||||
|
||||
|
||||
if (state->xdir > 0)
|
||||
{
|
||||
addbyte(0x83); /*ADD state->x[EDI], 1*/
|
||||
@@ -3296,14 +3296,14 @@ static inline void voodoo_generate(uint8_t *code_block, voodoo_t *voodoo, voodoo
|
||||
addbyte(0x0f); /*JNZ loop_jump_pos*/
|
||||
addbyte(0x85);
|
||||
addlong(loop_jump_pos - (block_pos + 4));
|
||||
|
||||
addbyte(0x5b); /*POP EBX*/
|
||||
|
||||
addbyte(0x5b); /*POP EBX*/
|
||||
addbyte(0x5e); /*POP ESI*/
|
||||
addbyte(0x5f); /*POP EDI*/
|
||||
addbyte(0x5d); /*POP EBP*/
|
||||
|
||||
|
||||
addbyte(0xC3); /*RET*/
|
||||
|
||||
|
||||
if (params->textureMode[1] & TEXTUREMODE_TRILINEAR)
|
||||
cs = cs;
|
||||
}
|
||||
@@ -3315,11 +3315,11 @@ static inline void *voodoo_get_block(voodoo_t *voodoo, voodoo_params_t *params,
|
||||
int b = last_block[odd_even];
|
||||
voodoo_x86_data_t *data;
|
||||
voodoo_x86_data_t *codegen_data = voodoo->codegen_data;
|
||||
|
||||
|
||||
for (c = 0; c < 8; c++)
|
||||
{
|
||||
data = &codegen_data[odd_even + b*4];
|
||||
|
||||
|
||||
if (state->xdir == data->xdir &&
|
||||
params->alphaMode == data->alphaMode &&
|
||||
params->fbzMode == data->fbzMode &&
|
||||
@@ -3335,13 +3335,13 @@ static inline void *voodoo_get_block(voodoo_t *voodoo, voodoo_params_t *params,
|
||||
last_block[odd_even] = b;
|
||||
return data->code_block;
|
||||
}
|
||||
|
||||
|
||||
b = (b + 1) & 7;
|
||||
}
|
||||
voodoo_recomp++;
|
||||
data = &codegen_data[odd_even + next_block_to_write[odd_even]*4];
|
||||
// code_block = data->code_block;
|
||||
|
||||
|
||||
voodoo_generate(data->code_block, voodoo, params, state, depth_op);
|
||||
|
||||
data->xdir = state->xdir;
|
||||
@@ -3357,7 +3357,7 @@ voodoo_recomp++;
|
||||
data->is_tiled = (params->col_tiled || params->aux_tiled) ? 1 : 0;
|
||||
|
||||
next_block_to_write[odd_even] = (next_block_to_write[odd_even] + 1) & 7;
|
||||
|
||||
|
||||
return data->code_block;
|
||||
}
|
||||
|
||||
@@ -3372,7 +3372,7 @@ void voodoo_codegen_init(voodoo_t *voodoo)
|
||||
int d[4];
|
||||
int _ds = c & 0xf;
|
||||
int dt = c >> 4;
|
||||
|
||||
|
||||
alookup[c] = _mm_set_epi32(0, 0, c | (c << 16), c | (c << 16));
|
||||
aminuslookup[c] = _mm_set_epi32(0, 0, (255-c) | ((255-c) << 16), (255-c) | ((255-c) << 16));
|
||||
|
||||
|
||||
@@ -236,7 +236,7 @@ typedef struct voodoo_t
|
||||
|
||||
int row_width, aux_row_width;
|
||||
int block_width;
|
||||
|
||||
|
||||
int col_tiled, aux_tiled;
|
||||
|
||||
uint8_t *fb_mem, *tex_mem[2];
|
||||
@@ -368,7 +368,7 @@ typedef struct voodoo_t
|
||||
uint32_t bltCommand;
|
||||
|
||||
uint32_t leftOverlayBuf;
|
||||
|
||||
|
||||
struct
|
||||
{
|
||||
int dst_x, dst_y;
|
||||
@@ -396,7 +396,7 @@ typedef struct voodoo_t
|
||||
uint32_t srcFormat;
|
||||
uint32_t srcSize;
|
||||
uint32_t srcXY;
|
||||
|
||||
|
||||
uint32_t colorPattern[64];
|
||||
|
||||
int bres_error_0, bres_error_1;
|
||||
@@ -415,11 +415,11 @@ typedef struct voodoo_t
|
||||
int srcX, srcY;
|
||||
int src_stride;
|
||||
int old_srcX;
|
||||
|
||||
|
||||
/*Used for handling packed 24bpp host data*/
|
||||
int host_data_remainder;
|
||||
uint32_t old_host_data;
|
||||
|
||||
|
||||
/*Polyfill coordinates*/
|
||||
int lx[2], rx[2];
|
||||
int ly[2], ry[2];
|
||||
@@ -431,18 +431,18 @@ typedef struct voodoo_t
|
||||
int lx_cur, rx_cur;
|
||||
|
||||
clip_t clip[2];
|
||||
|
||||
|
||||
uint8_t host_data[16384];
|
||||
int host_data_count;
|
||||
int host_data_size_src, host_data_size_dest;
|
||||
int src_stride_src, src_stride_dest;
|
||||
|
||||
|
||||
int src_bpp;
|
||||
|
||||
int line_pix_pos, line_bit_pos;
|
||||
int line_rep_cnt, line_bit_mask_size;
|
||||
} banshee_blt;
|
||||
|
||||
|
||||
struct
|
||||
{
|
||||
uint32_t vidOverlayStartCoords;
|
||||
@@ -450,12 +450,12 @@ typedef struct voodoo_t
|
||||
uint32_t vidOverlayDudx, vidOverlayDudxOffsetSrcWidth;
|
||||
uint32_t vidOverlayDvdy, vidOverlayDvdyOffset;
|
||||
//uint32_t vidDesktopOverlayStride;
|
||||
|
||||
|
||||
int start_x, start_y;
|
||||
int end_x, end_y;
|
||||
int size_x, size_y;
|
||||
int overlay_bytes;
|
||||
|
||||
|
||||
unsigned int src_y;
|
||||
} overlay;
|
||||
|
||||
@@ -469,7 +469,7 @@ typedef struct voodoo_t
|
||||
|
||||
int fb_write_buffer, fb_draw_buffer;
|
||||
int buffer_cutoff;
|
||||
|
||||
|
||||
uint32_t tile_base, tile_stride;
|
||||
int tile_stride_shift, tile_x, tile_x_real;
|
||||
|
||||
@@ -507,7 +507,7 @@ typedef struct voodoo_t
|
||||
uint8_t fifo_thread_run, render_thread_run[4];
|
||||
|
||||
uint8_t *vram, *changedvram;
|
||||
|
||||
|
||||
void *p;
|
||||
} voodoo_t;
|
||||
|
||||
|
||||
@@ -147,7 +147,7 @@ enum
|
||||
SST_cmdFifoAMax = 0x1f0,
|
||||
SST_cmdFifoDepth = 0x1f4,
|
||||
SST_cmdFifoHoles = 0x1f8,
|
||||
|
||||
|
||||
SST_colBufferAddr = 0x1ec, /*Banshee*/
|
||||
SST_colBufferStride = 0x1f0, /*Banshee*/
|
||||
SST_auxBufferAddr = 0x1f4, /*Banshee*/
|
||||
@@ -175,10 +175,10 @@ enum
|
||||
SST_fbiInit5 = 0x244,
|
||||
SST_fbiInit6 = 0x248,
|
||||
SST_fbiInit7 = 0x24c,
|
||||
|
||||
|
||||
SST_swapPending = 0x24c, /*Banshee*/
|
||||
SST_leftOverlayBuf = 0x250, /*Banshee*/
|
||||
|
||||
|
||||
SST_sSetupMode = 0x260,
|
||||
SST_sVx = 0x264,
|
||||
SST_sVy = 0x268,
|
||||
|
||||
@@ -103,4 +103,4 @@ typedef FAudioSubmixVoice IXAudio27SubmixVoice;
|
||||
|
||||
typedef FAudioSubmixVoice IXAudio2SubmixVoice;
|
||||
#define IXAudio2SubmixVoice_GetVoiceDetails FAudioVoice_GetVoiceDetails
|
||||
#define IXAudio2SubmixVoice_DestroyVoice FAudioVoice_DestroyVoice
|
||||
#define IXAudio2SubmixVoice_DestroyVoice FAudioVoice_DestroyVoice
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
* This file is distributed as a part of the Discord Game SDK.
|
||||
* Downloading, accessing, or using the API or SDK is bound by
|
||||
* the Discord Developer Terms of Service:
|
||||
@@ -650,4 +650,4 @@ enum EDiscordResult DiscordCreate(DiscordVersion version, struct DiscordCreatePa
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
/*
|
||||
* Copyright (c) 2000-2008 Marc Alexander Lehmann <schmorp@schmorp.de>
|
||||
*
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modifica-
|
||||
* tion, are permitted provided that the following conditions are met:
|
||||
*
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
*
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MER-
|
||||
* CHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
||||
@@ -73,7 +73,7 @@
|
||||
* and lzf_c.c.
|
||||
*
|
||||
*/
|
||||
unsigned int
|
||||
unsigned int
|
||||
lzf_compress (const void *const in_data, unsigned int in_len,
|
||||
void *out_data, unsigned int out_len);
|
||||
|
||||
@@ -92,7 +92,7 @@ lzf_compress (const void *const in_data, unsigned int in_len,
|
||||
*
|
||||
* This function is very fast, about as fast as a copying loop.
|
||||
*/
|
||||
unsigned int
|
||||
unsigned int
|
||||
lzf_decompress (const void *const in_data, unsigned int in_len,
|
||||
void *out_data, unsigned int out_len);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user