Lines Matching refs:GUSregb

33 #define GUSregb(position) (*            (gusptr+(position)))  macro
55 return GUSregb(IRQStatReg2x6); in gus_read()
58 if (GUSregb(GUS45TimerCtrl) & 1) in gus_read()
59 return GUSregb(TimerStatus2x8); in gus_read()
60 return GUSregb(AdLibStatus2x8); /* AdLibStatus */ in gus_read()
63 return GUSregb(AdLibData2x9); /* AdLibData */ in gus_read()
65 return GUSregb(AdLibCommand2xA); /* AdLib2x8_2xA */ in gus_read()
69 switch (GUSregb(RegCtrl_2xF) & 0x07) in gus_read()
72 if (GUSregb(MixerCtrlReg2x0) & 0x40) in gus_read()
73 return GUSregb(IRQ_2xB); /* control register select bit */ in gus_read()
75 return GUSregb(DMA_2xB); in gus_read()
79 return GUSregb(Jumper_2xB); /* Joystick/MIDI enable (JumperReg) */ in gus_read()
86 value_read = GUSregb(SB2xCd); in gus_read()
87 if (GUSregb(StatRead_2xF) & 0x20) in gus_read()
88 GUSregb(SB2xCd) ^= 0x80; /* toggle MSB on read */ in gus_read()
92 if (GUSregb(RegCtrl_2xF) & 0x80) /* 2xE read IRQ enabled? */ in gus_read()
94 GUSregb(StatRead_2xF) |= 0x80; in gus_read()
97 return GUSregb(SB2xE); /* SB2xE */ in gus_read()
101 value_read = (GUSregb(StatRead_2xF) & 0xf9); in gus_read()
102 if (GUSregb(MixerCtrlReg2x0) & 0x08) in gus_read()
108 return GUSregb(VoiceSelReg3x2); /* VoiceSelReg */ in gus_read()
110 return GUSregb(FunkSelReg3x3); /* FunkSelReg */ in gus_read()
113 switch (GUSregb(FunkSelReg3x3)) in gus_read()
117 value_read = GUSregb(GUS41DMACtrl); /* &0xfb */ in gus_read()
118 GUSregb(GUS41DMACtrl) &= 0xbb; in gus_read()
121 if (GUSregb(IRQStatReg2x6) & 0x80) in gus_read()
124 GUSregb(IRQStatReg2x6) &= 0x7f; in gus_read()
125 if (!GUSregb(IRQStatReg2x6)) in gus_read()
133 return GUSregb(GUS45TimerCtrl); /* TimerCtrlReg */ in gus_read()
137 return GUSregb(GUS49SampCtrl) & 0xbf; /* SampCtrlReg */ in gus_read()
156 int offset = 2 * (GUSregb(FunkSelReg3x3) & 0x0f); in gus_read()
157 offset += ((int) GUSregb(VoiceSelReg3x2) & 0x1f) << 5; /* = Voice*32 + Function*2 */ in gus_read()
163 return GUSregb(NumVoices); in gus_read()
166 return GUSregb(SynVoiceIRQ8f); in gus_read()
199 GUSregb(MixerCtrlReg2x0) = (uint8_t) data; in gus_write()
202 if (GUSregb(GUS45TimerCtrl) & 0x20) /* SB IRQ enabled? -> set 2x6IRQ bit */ in gus_write()
204 GUSregb(TimerStatus2x8) |= 0x08; in gus_write()
205 GUSregb(IRQStatReg2x6) = 0x10; in gus_write()
211 GUSregb(AdLibCommand2xA) = (uint8_t) data; in gus_write()
215 …if ((GUSregb(AdLibCommand2xA) == 0x04) && (!(GUSregb(GUS45TimerCtrl) & 1))) /* GUS auto timer mode… in gus_write()
218GUSregb(TimerStatus2x8) &= 0x1f; /* AdLib IRQ reset? -> clear maskable adl. timer int regs */ in gus_write()
220 GUSregb(TimerDataReg2x9) = (uint8_t) data; in gus_write()
224 GUSregb(AdLibData2x9) = (uint8_t) data; in gus_write()
225 if (GUSregb(GUS45TimerCtrl) & 0x02) in gus_write()
227 GUSregb(TimerStatus2x8) |= 0x01; in gus_write()
228 GUSregb(IRQStatReg2x6) = 0x10; in gus_write()
234 GUSregb(AdLibStatus2x8) = (uint8_t) data; in gus_write()
237 switch (GUSregb(RegCtrl_2xF) & 0x7) in gus_write()
240 if (GUSregb(MixerCtrlReg2x0) & 0x40) in gus_write()
241 GUSregb(IRQ_2xB) = (uint8_t) data; /* control register select bit */ in gus_write()
243 GUSregb(DMA_2xB) = (uint8_t) data; in gus_write()
247 GUSregb(StatRead_2xF) = 0; /* ToDo: is this identical with GUS classic? */ in gus_write()
248 if (!GUSregb(IRQStatReg2x6)) in gus_write()
252 GUSregb(Jumper_2xB) = (uint8_t) data; in gus_write()
258 if (GUSregb(GUS45TimerCtrl) & 0x20) in gus_write()
260 GUSregb(TimerStatus2x8) |= 0x10; /* SB IRQ enabled? -> set 2xCIRQ bit */ in gus_write()
261 GUSregb(IRQStatReg2x6) = 0x10; in gus_write()
266 GUSregb(SB2xCd) = (uint8_t) data; in gus_write()
269 GUSregb(SB2xE) = (uint8_t) data; in gus_write()
272 GUSregb(RegCtrl_2xF) = (uint8_t) data; in gus_write()
275 GUSregb(VoiceSelReg3x2) = (uint8_t) data; in gus_write()
278 GUSregb(FunkSelReg3x3) = (uint8_t) data; in gus_write()
289 GUSregb(voice << 5) &= 0x7f; /* clear voice reg irq bit */ in gus_write()
291 GUSregb(IRQStatReg2x6) &= 0xdf; in gus_write()
292 if (!GUSregb(IRQStatReg2x6)) in gus_write()
294 GUSregb(SynVoiceIRQ8f) = voice | 0x60; /* (bit==0 => IRQ wartend) */ in gus_write()
306GUSregb((voice << 5) + VSRVolRampControl) &= 0x7f; /* clear voice volume reg irq bit */ in gus_write()
308 GUSregb(IRQStatReg2x6) &= 0xbf; in gus_write()
309 if (!GUSregb(IRQStatReg2x6)) in gus_write()
311 GUSregb(SynVoiceIRQ8f) = voice | 0x80; /* (bit==0 => IRQ wartend) */ in gus_write()
316 GUSregb(SynVoiceIRQ8f) = 0xe8; /* kein IRQ wartet */ in gus_write()
334 switch (GUSregb(FunkSelReg3x3)) in gus_write()
353 if (!(GUSregb(GUS4cReset) & 0x01)) in gus_write()
355 offset = 2 * (GUSregb(FunkSelReg3x3) & 0x0f); in gus_write()
356 offset += (GUSregb(VoiceSelReg3x2) & 0x1f) << 5; /* = Voice*32 + Function*2 */ in gus_write()
362 GUSregb(NumVoices) = (uint8_t) data; in gus_write()
367 GUSregb(GUS41DMACtrl) = (uint8_t) data; in gus_write()
373 GUSregb(GUS50DMAHigh) &= 0xf; /* compatibility stuff... */ in gus_write()
384 GUSregb(GUS45TimerCtrl) = (uint8_t) data; in gus_write()
386GUSregb(TimerStatus2x8) &= 0xe7; /* sb IRQ dis? -> clear 2x8/2xC sb IRQ flags */ in gus_write()
388GUSregb(TimerStatus2x8) &= 0xfe; /* adlib data IRQ dis? -> clear 2x8 adlib IRQ flag */ in gus_write()
389 if (!(GUSregb(TimerStatus2x8) & 0x19)) in gus_write()
390GUSregb(IRQStatReg2x6) &= 0xef; /* 0xe6; $$clear IRQ if both IRQ bits are inactive or cleared … in gus_write()
392 if ((GUSregw(TimerIRQs) > 1) && (GUSregb(TimerDataReg2x9) & 3)) in gus_write()
394 if (GUSregb(TimerDataReg2x9) & 1) /* start timer 1 (80us decrement rate) */ in gus_write()
396 if (!(GUSregb(TimerDataReg2x9) & 0x40)) in gus_write()
397 GUSregb(TimerStatus2x8) |= 0xc0; /* maskable bits */ in gus_write()
400 GUSregb(TimerStatus2x8) |= 4; /* nonmaskable bit */ in gus_write()
401 GUSregb(IRQStatReg2x6) |= 4; /* timer 1 irq pending */ in gus_write()
404 if (GUSregb(TimerDataReg2x9) & 2) /* start timer 2 (320us decrement rate) */ in gus_write()
406 if (!(GUSregb(TimerDataReg2x9) & 0x20)) in gus_write()
407 GUSregb(TimerStatus2x8) |= 0xa0; /* maskable bits */ in gus_write()
410 GUSregb(TimerStatus2x8) |= 2; /* nonmaskable bit */ in gus_write()
411 GUSregb(IRQStatReg2x6) |= 8; /* timer 2 irq pending */ in gus_write()
426 GUSregb(TimerStatus2x8) &= 0xfb; /* clear non-maskable timer1 bit */ in gus_write()
427 GUSregb(IRQStatReg2x6) &= 0xfb; in gus_write()
431 GUSregb(TimerStatus2x8) &= 0xfd; /* clear non-maskable timer2 bit */ in gus_write()
432 GUSregb(IRQStatReg2x6) &= 0xf7; in gus_write()
434 if (!GUSregb(IRQStatReg2x6)) in gus_write()
438 GUSregb(GUS46Counter1) = (uint8_t) data; in gus_write()
441 GUSregb(GUS47Counter2) = (uint8_t) data; in gus_write()
445 GUSregb(GUS49SampCtrl) = (uint8_t) data; in gus_write()
449 GUSregb(GUS4cReset) = (uint8_t) data; in gus_write()
450 if (!(GUSregb(GUS4cReset) & 1)) /* reset... */ in gus_write()
456 GUSregb(NumVoices) = 0xcd; in gus_write()
457 GUSregb(IRQStatReg2x6) = 0; in gus_write()
458 GUSregb(TimerStatus2x8) = 0; in gus_write()
459 GUSregb(AdLibData2x9) = 0; in gus_write()
460 GUSregb(TimerDataReg2x9) = 0; in gus_write()
461 GUSregb(GUS41DMACtrl) = 0; in gus_write()
462 GUSregb(GUS45TimerCtrl) = 0; in gus_write()
463 GUSregb(GUS49SampCtrl) = 0; in gus_write()
464 GUSregb(GUS4cReset) &= 0xf9; /* clear IRQ and DAC enable bits */ in gus_write()
519 int offset = (GUSregw(GUS42DMAStart) << 4) + (GUSregb(GUS50DMAHigh) & 0xf); in gus_dma_transferdata()
526GUSregb(GUS50DMAHigh) = (uint8_t) ((count + GUSregb(GUS50DMAHigh)) & 0xf); /* ToDo: add 16bit GU… in gus_dma_transferdata()
528 if (GUSregb(GUS41DMACtrl) & 0x02) /* direction, 0 := sysram->gusram */ in gus_dma_transferdata()
535 if ((GUSregb(GUS41DMACtrl) & 0x80) && (!(GUSregb(GUS41DMACtrl) & 0x02))) in gus_dma_transferdata()
539 if (GUSregb(GUS41DMACtrl) & 0x40) in gus_dma_transferdata()
549 (GUSregb(GUS41DMACtrl)) &= 0xfe; /* clear DMA request bit */ in gus_dma_transferdata()
550 if (GUSregb(GUS41DMACtrl) & 0x20) /* DMA terminal count IRQ */ in gus_dma_transferdata()
552 GUSregb(IRQStatReg2x6) |= 0x80; in gus_dma_transferdata()