Skip to content

Commit

Permalink
Cleanups for MAME 0.122.
Browse files Browse the repository at this point in the history
Added missing driver entry for orbs.
  • Loading branch information
aaronsgiles committed Dec 18, 2007
1 parent 75265e5 commit b347392
Show file tree
Hide file tree
Showing 13 changed files with 188 additions and 187 deletions.
22 changes: 11 additions & 11 deletions src/emu/sound/m58817.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
M58817 interface
Written for MAME by couriersud
- structure from TMS5110 interface
- this is a wrapper around the TMS5110 interface
- M58817 & TMS5110 seem to be similar, however it is very probable
that they use different "coding" tables for energy, pitch
- Speech is understandable, but off
- This driver supports to use a "sample" interface instead as well
- this is a wrapper around the TMS5110 interface
- M58817 & TMS5110 seem to be similar, however it is very probable
that they use different "coding" tables for energy, pitch
- Speech is understandable, but off
- This driver supports to use a "sample" interface instead as well
******************************************************************************/

Expand Down Expand Up @@ -56,7 +56,7 @@ static int speech_rom_read_bit(void)
const UINT8 *table = memory_region(info->intf->rom_region);

int r;

if (info->speech_rom_bitnum<0)
r = 0;
else
Expand Down Expand Up @@ -85,8 +85,8 @@ static void m58817_state_loop(void *chip, int data)
case 0x00: // reset ????
info->count=0;
/*To be extremely accurate there should be a delays between each of
the function calls below. In real they happen with the frequency of 160 kHz.
*/
the function calls below. In real they happen with the frequency of 160 kHz.
*/

if (info->intf->rom_region != -1)
{
Expand Down Expand Up @@ -138,7 +138,7 @@ static void m58817_state_loop(void *chip, int data)
tms5110_PDC_set(info->chip, 0);
tms5110_PDC_set(info->chip, 1);
tms5110_PDC_set(info->chip, 0);
}
}
else
{
for (i=0;i<M58817_MAX_SAMPLES;i++)
Expand Down Expand Up @@ -239,7 +239,7 @@ WRITE8_HANDLER( m58817_CTL_w )
struct m58817_info *info = sndti_token(SOUND_M58817, 0);

/* bring up to date first */
//stream_update(info->stream);
//stream_update(info->stream);
info->command_latch = data & 0x0f;
}

Expand Down
50 changes: 25 additions & 25 deletions src/emu/sound/scsp.c
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ static void SCSP_StartSlot(struct _SCSP *SCSP, struct _SLOT *slot)
slot->active=1;
start_offset = PCM8B(slot) ? SA(slot) : SA(slot) & 0x7FFFE;
slot->base=SCSP->SCSPRAM + start_offset;
slot->cur_addr=0;
slot->cur_addr=0;
slot->nxt_addr=1<<SHIFT;
slot->step=SCSP_Step(slot);
Compute_EG(SCSP,slot);
Expand Down Expand Up @@ -1183,28 +1183,28 @@ INLINE INT32 SCSP_UpdateSlot(struct _SCSP *SCSP, struct _SLOT *slot)
addr1=(slot->cur_addr>>(SHIFT-1))&0x7fffe;
addr2=(slot->nxt_addr>>(SHIFT-1))&0x7fffe;
}

/*if(MDL(slot)!=0 || MDXSL(slot)!=0 || MDYSL(slot)!=0)
{
INT32 smp=(SCSP->RINGBUF[(SCSP->BUFPTR+MDXSL(slot))&63]+SCSP->RINGBUF[(SCSP->BUFPTR+MDYSL(slot))&63])/2;
INT32 cycle=LEA(slot)-LSA(slot); // cycle corresponds to 2 pi
smp*=cycle; // associate cycle with full 16-bit sample range
smp>>=0x1A-MDL(slot); // ex. for MDL=0xF, sample range corresponds to +/- 64 pi (32=2^5 cycles) so shift by 11 (16-5 == 0x1A-0xF)
while(smp<0) smp+=cycle; smp%=cycle; // keep modulation sampler within a single cycle
if(!PCM8B(slot)) smp<<=1;
addr1+=smp; addr2+=smp;
if(!PCM8B(slot))
{
addr1&=0x7fffe; addr2&=0x7fffe;
}
else
{
addr1&=0x7ffff; addr2&=0x7ffff;
}
}*/
{
INT32 smp=(SCSP->RINGBUF[(SCSP->BUFPTR+MDXSL(slot))&63]+SCSP->RINGBUF[(SCSP->BUFPTR+MDYSL(slot))&63])/2;
INT32 cycle=LEA(slot)-LSA(slot); // cycle corresponds to 2 pi
smp*=cycle; // associate cycle with full 16-bit sample range
smp>>=0x1A-MDL(slot); // ex. for MDL=0xF, sample range corresponds to +/- 64 pi (32=2^5 cycles) so shift by 11 (16-5 == 0x1A-0xF)
while(smp<0) smp+=cycle; smp%=cycle; // keep modulation sampler within a single cycle
if(!PCM8B(slot)) smp<<=1;
addr1+=smp; addr2+=smp;
if(!PCM8B(slot))
{
addr1&=0x7fffe; addr2&=0x7fffe;
}
else
{
addr1&=0x7ffff; addr2&=0x7ffff;
}
}*/

if(PCM8B(slot)) //8 bit signed
{
INT8 *p1=(signed char *) (SCSP->SCSPRAM+((SA(slot)+addr1)^1));
Expand Down Expand Up @@ -1236,10 +1236,10 @@ INLINE INT32 SCSP_UpdateSlot(struct _SCSP *SCSP, struct _SLOT *slot)
else
slot->cur_addr+=step;
slot->nxt_addr=slot->cur_addr+(1<<SHIFT);

addr1=slot->cur_addr>>SHIFT;
addr2=slot->nxt_addr>>SHIFT;

if(addr1>=LSA(slot) && !(slot->Backwards))
{
if(LPSLNK(slot) && slot->EG.state==ATTACK)
Expand Down Expand Up @@ -1298,7 +1298,7 @@ INLINE INT32 SCSP_UpdateSlot(struct _SCSP *SCSP, struct _SLOT *slot)

if(!STWINH(slot))
*RBUFDST=sample;

return sample;
}

Expand Down
2 changes: 1 addition & 1 deletion src/emu/sound/sound.mak
Original file line number Diff line number Diff line change
Expand Up @@ -600,7 +600,7 @@ endif
SOUNDDEFS += -DHAS_M58817=$(if $(filter M58817,$(SOUNDS)),1,0)

ifneq ($(filter M58817,$(SOUNDS)),)
SOUNDOBJS += $(SOUNDOBJ)/m58817.o
SOUNDOBJS += $(SOUNDOBJ)/m58817.o
endif


Expand Down
24 changes: 12 additions & 12 deletions src/mame/audio/dkong.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
****************************************************************/

/* Set to 1 to use speech synthesizer instead of samples.
* Disabled by default since M58817 emulation is not
* Disabled by default since M58817 emulation is not
* complete due to missing information about coefficients.
*/

#define RADARSC1_USE_M58817 (0)

#define ACTIVELOW_PORT_BIT(P,A,D) (((P) & (~(1 << (A)))) | (((D) ^ 1) << (A)))
Expand Down Expand Up @@ -693,7 +693,7 @@ static SOUND_START( radarsc1 )
static SOUND_RESET( dkong )
{
dkong_state *state = machine->driver_data;

state->mcustatus = 0;
state->page = 0;

Expand All @@ -709,12 +709,12 @@ static SOUND_RESET( dkongjr )
int i;

sound_reset_dkong(machine);

state->envelope = 0;
state->tt = 0;
state->decay = 0;
state->sh_climb_count = 0;

for (i=0;i<10;i++)
state->dkongjr_latch[i]=0;
}
Expand All @@ -725,7 +725,7 @@ static SOUND_RESET( dkongjr )
*
****************************************************************/

/*
/*
http://www.freepatentsonline.com/4633500.html
Expand Down Expand Up @@ -803,7 +803,7 @@ static READ8_HANDLER( dkong_sh_tune_r )
dkong_state *state = Machine->driver_data;
UINT8 *SND = memory_region(REGION_CPU2);

if ( state->page & 0x40 )
if ( state->page & 0x40 )
{
return soundlatch_r(0) & 0x0F;
}
Expand Down Expand Up @@ -982,22 +982,22 @@ WRITE8_HANDLER( dkongjr_snd_w1 )
case 3: /* Port 3 write ==> PB 5 */
I8035_P2_W_AL(5,data & 1);
break;
#if 0 // above verified from schematics
#if 0 // above verified from schematics
case 3: /* roar */
if (data)
sample_start (7,2,0);
break;
#endif
case 4: /* Port 4 write */
I8035_T_W_AL(1, data & 1);
I8035_T_W_AL(1, data & 1);
break;
case 5: /* Port 5 write */
I8035_T_W_AL(0, data & 1);
I8035_T_W_AL(0, data & 1);
break;
case 6: /* Port 6 write ==> PB 4 */
I8035_P2_W_AL(4,data & 1);
break;
#if 0 // above verified from schematics
#if 0 // above verified from schematics
case 6: /* snapjaw */
if (data)
sample_stop (7);
Expand All @@ -1022,7 +1022,7 @@ WRITE8_HANDLER( dkongjr_snd_w2 )
case 0:
dkong_audio_irq_w(0, data & 1);
break;
#if 0 // above verified from schematics
#if 0 // above verified from schematics
case 0: /* death */
if (data)
sample_stop (7);
Expand Down
2 changes: 1 addition & 1 deletion src/mame/drivers/cave.c
Original file line number Diff line number Diff line change
Expand Up @@ -4375,7 +4375,7 @@ GAME( 1995, donpachi, 0, donpachi, cave, donpachi, ROT270, "Atlus/Cav
GAME( 1995, donpacjp, donpachi, donpachi, cave, donpachi, ROT270, "Atlus/Cave", "DonPachi (Japan)" , 0 )
GAME( 1995, donpackr, donpachi, donpachi, cave, donpachi, ROT270, "Atlus/Cave", "DonPachi (Korea)" , 0 )
GAME( 1995, donpachk, donpachi, donpachi, cave, donpachi, ROT270, "Atlus/Cave", "DonPachi (Hong Kong)" , 0 )
GAME( 1995, metmqstr, 0, metmqstr, metmqstr, metmqstr, ROT0, "Banpresto/Pandorabox", "Metamoqester (International)" , 0 )
GAME( 1995, metmqstr, 0, metmqstr, metmqstr, metmqstr, ROT0, "Banpresto/Pandorabox", "Metamoqester (International)" , 0 )
GAME( 1995, nmaster, metmqstr, metmqstr, metmqstr, metmqstr, ROT0, "Banpresto/Pandorabox", "Oni - The Ninja Master (Japan)" , 0 )
GAME( 1995, plegends, 0, pwrinst2, metmqstr, pwrins2j, ROT0, "Atlus/Cave", "Power Instinct Legends (US, Ver. 95/06/20)" , 0 )
GAME( 1995, plegendj, plegends, pwrinst2, metmqstr, pwrins2j, ROT0, "Atlus/Cave", "Gouketsuji Ichizoku Saikyou Densetsu (Japan, Ver. 95/06/20)", 0 )
Expand Down
56 changes: 28 additions & 28 deletions src/mame/drivers/dkong.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
Clarify
- 8ballact: read 1507 no mapped
- drakton - add dkongjr conversion
- dkong3 dma (Z80 dma)
- dkong3 dma (Z80 dma)
- implement 74LS259 (8bit addressable latches), 74LS175 (QUAD D FlipFlop), 74LS373 (Octal transparent latch)
Done:
Expand Down Expand Up @@ -56,35 +56,35 @@
Couriersud: 12/2007
- changed dkong/radarscp based games to use hardware-conformant I8035 memory maps
- Added drakton clone drktnjr on dkongjr hardware
- wrote M58817 sound driver and hooked it up
Uses tms5110 speech synthesis. LPC format is identical, however coefficients
seem to be different. Until coefficients are known, samples are used.
- moved address remapping proms to REGION_USER1 (hunchbkd & co)
- Service now adds credit
- Hooked up coin_counters
- remove GAME_NOT_WORKING GAME_WRONG_COLORS from hunchbkd
- fixed shootgal0121u4red
- dkongjr: mapped more interface lines between sound board and cpu board
- tagged all inputs, all reads use tag names
- moved more static vars into dkong_state
- changed dkong/radarscp based games to use hardware-conformant I8035 memory maps
- Added drakton clone drktnjr on dkongjr hardware
- wrote M58817 sound driver and hooked it up
Uses tms5110 speech synthesis. LPC format is identical, however coefficients
seem to be different. Until coefficients are known, samples are used.
- moved address remapping proms to REGION_USER1 (hunchbkd & co)
- Service now adds credit
- Hooked up coin_counters
- remove GAME_NOT_WORKING GAME_WRONG_COLORS from hunchbkd
- fixed shootgal0121u4red
- dkongjr: mapped more interface lines between sound board and cpu board
- tagged all inputs, all reads use tag names
- moved more static vars into dkong_state
General notes
The dma8257 is responsible for copying sprite data from 0x6900 (or where ever it is located) to 0x7400 (sprite banks).
2650 based games had a rom for address lookups. This is needed for proper operation of the 8257 code.
Where this was missing, I copied the entry from hunchbkd and marked it as BAD_DUMP.
Additional protection was done by pals. The only driver with a PAL entry is herbiedk.
2650 based games had a rom for address lookups. This is needed for proper operation of the 8257 code.
Where this was missing, I copied the entry from hunchbkd and marked it as BAD_DUMP.
Additional protection was done by pals. The only driver with a PAL entry is herbiedk.
I added NO_DUMP entries for the other 2650 games.
Thanks to Mike I was able to closer analyze TKG02/03/04 schematics. The radar scope to donkey kong conversions done
should lead to the same discrete sound as TKG04 (2 board boards). However the colours are different.
Red girders are back. Until the release of TKG04, the 2 board release, schematics were largely identical with radar scope.
There were slight modifications from release to release in the analog video logic. Already at TKG2-02(03) the
darlington amplifier for the blue channel was replaced with a emitter one by leaving away (OMIT in schematics)
a resistor and transistor. Later on, TKG3-06, 4066 switches and background generation circuits for radarscope were removed.
I have added a driver configuration switch to switch between TKG4 and TKG2-01 (radarscope) palettes.
Thanks to Mike I was able to closer analyze TKG02/03/04 schematics. The radar scope to donkey kong conversions done
should lead to the same discrete sound as TKG04 (2 board boards). However the colours are different.
Red girders are back. Until the release of TKG04, the 2 board release, schematics were largely identical with radar scope.
There were slight modifications from release to release in the analog video logic. Already at TKG2-02(03) the
darlington amplifier for the blue channel was replaced with a emitter one by leaving away (OMIT in schematics)
a resistor and transistor. Later on, TKG3-06, 4066 switches and background generation circuits for radarscope were removed.
I have added a driver configuration switch to switch between TKG4 and TKG2-01 (radarscope) palettes.
At a later stage, a TKG2-02 will be added as well.
Expand Down Expand Up @@ -486,7 +486,7 @@ static WRITE8_HANDLER( p8257_drq_w )
static READ8_HANDLER( dkong_in2_r )
{
UINT8 r;

r = (readinputportbytag("IN2") & 0xBF) | (dkong_audio_status_r(0) << 6);
coin_counter_w(offset, r >> 7);
if (r & 0x10)
Expand Down Expand Up @@ -849,7 +849,7 @@ static INPUT_PORTS_START( dkong_in2 )
PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_SERVICE ) /* not connected - held to high - used as service */
PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN ) /* not connected - held to high */
PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_SPECIAL ) /* status from sound cpu */
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_COIN1 )
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_COIN1 )
INPUT_PORTS_END

static INPUT_PORTS_START( dkong_dsw0 )
Expand Down
10 changes: 5 additions & 5 deletions src/mame/drivers/gotya.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ TODO: Emulated sound
HD38882PA06
I think HD38880 is a CPU/MCU, because the game just sends it a sound command (0-0x1a)
couriersud:
The chips above are speech synthesis chips. HD38880 is the main chip
whereas HD38882 is an eprom interface. PARCOR based.
http://www.freepatentsonline.com/4435832.html
Datasheet lists no parcor coefficients
The chips above are speech synthesis chips. HD38880 is the main chip
whereas HD38882 is an eprom interface. PARCOR based.
http://www.freepatentsonline.com/4435832.html
Datasheet lists no parcor coefficients
****************************************************************************/

Expand Down
Loading

0 comments on commit b347392

Please sign in to comment.