Skip to content

Commit 8c1b0ab

Browse files
author
mamedev
committed
MAME 0.120u4
1 parent 1c7f4a8 commit 8c1b0ab

File tree

519 files changed

+10813
-9156
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

519 files changed

+10813
-9156
lines changed

src/emu/cpu/i8051/i8051.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,7 @@ static READ32_HANDLER((*hold_eram_iaddr_callback));
407407
#define SERIALPORT_IRQ ((R_SCON & 0x03) && GET_ES)
408408

409409
#if (HAS_I8052 || HAS_I8752)
410-
#define NO_PENDING_IRQ !(R_TCON & 0xaa) && !(SERIALPORT_IRQ) && !GET_TF2 && !GET_EXF2
410+
#define NO_PENDING_IRQ !(R_TCON & 0xaa) && !(SERIALPORT_IRQ) && !GET_ET2 //!GET_TF2 && !GET_EXF2
411411
#else
412412
#define NO_PENDING_IRQ !(R_TCON & 0xaa) && !(SERIALPORT_IRQ)
413413
#endif
@@ -1512,7 +1512,7 @@ INLINE UINT8 check_interrupts(void)
15121512
}
15131513
#if (HAS_I8052 || HAS_I8752)
15141514
//Timer 2 overflow (Either Timer Overflow OR External Interrupt)
1515-
if(!i8051.priority_request && (GET_TF2 || GET_EXF2) && (!i8051.int_vec || (i8051.int_vec && GET_PT2))) {
1515+
if(!i8051.priority_request && GET_ET2 && (GET_TF2 || GET_EXF2) && (!i8051.int_vec || (i8051.int_vec && GET_PT2))) {
15161516
//Set vector & priority level request
15171517
i8051.int_vec = V_TF2;
15181518
i8051.priority_request = GET_PT2;

src/emu/cpu/tms32031/32031ops.c

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,7 @@ static void negf(union genreg *dst, union genreg *src)
375375
SET_MANTISSA(dst, -man);
376376
SET_EXPONENT(dst, EXPONENT(src));
377377
}
378-
else if (EXPONENT(src) != -128)
378+
else
379379
{
380380
SET_MANTISSA(dst, man ^ 0x80000000);
381381
if (man == 0)
@@ -1263,14 +1263,16 @@ static UINT32 (*indirect_1_def[0x20])(UINT8) =
12631263

12641264
#define ABSF(dreg, sreg) \
12651265
{ \
1266-
if ((INT32)FREGMAN(sreg) >= 0) \
1266+
INT32 man = FREGMAN(sreg); \
1267+
CLR_NZVUF(); \
1268+
tms32031.r[dreg] = tms32031.r[sreg]; \
1269+
if (man < 0) \
12671270
{ \
1268-
tms32031.r[dreg] = tms32031.r[sreg]; \
1269-
CLR_NZVUF(); \
1270-
OR_NZF(&tms32031.r[dreg]); \
1271+
SET_MANTISSA(&tms32031.r[dreg], ~man); \
1272+
if (man == (INT32)0x80000000 && FREGEXP(sreg) == 127) \
1273+
IREG(TMR_ST) |= VFLAG | LVFLAG; \
12711274
} \
1272-
else \
1273-
negf(&tms32031.r[dreg], &tms32031.r[sreg]); \
1275+
OR_NZF(&tms32031.r[dreg]); \
12741276
}
12751277

12761278
static void absf_reg(void)

src/emu/cpu/tms32031/tms32031.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -779,14 +779,14 @@ void tms32031_get_info(UINT32 state, cpuinfo *info)
779779
case CPUINFO_STR_REGISTER + TMS32031_R5: sprintf(info->s, " R5:%08X", tms32031.r[TMR_R5].i32[0]); break;
780780
case CPUINFO_STR_REGISTER + TMS32031_R6: sprintf(info->s, " R6:%08X", tms32031.r[TMR_R6].i32[0]); break;
781781
case CPUINFO_STR_REGISTER + TMS32031_R7: sprintf(info->s, " R7:%08X", tms32031.r[TMR_R7].i32[0]); break;
782-
case CPUINFO_STR_REGISTER + TMS32031_R0F: sprintf(info->s, "R0F:%8g", dsp_to_double(&tms32031.r[TMR_R0])); break;
783-
case CPUINFO_STR_REGISTER + TMS32031_R1F: sprintf(info->s, "R1F:%8g", dsp_to_double(&tms32031.r[TMR_R1])); break;
784-
case CPUINFO_STR_REGISTER + TMS32031_R2F: sprintf(info->s, "R2F:%8g", dsp_to_double(&tms32031.r[TMR_R2])); break;
785-
case CPUINFO_STR_REGISTER + TMS32031_R3F: sprintf(info->s, "R3F:%8g", dsp_to_double(&tms32031.r[TMR_R3])); break;
786-
case CPUINFO_STR_REGISTER + TMS32031_R4F: sprintf(info->s, "R4F:%8g", dsp_to_double(&tms32031.r[TMR_R4])); break;
787-
case CPUINFO_STR_REGISTER + TMS32031_R5F: sprintf(info->s, "R5F:%8g", dsp_to_double(&tms32031.r[TMR_R5])); break;
788-
case CPUINFO_STR_REGISTER + TMS32031_R6F: sprintf(info->s, "R6F:%8g", dsp_to_double(&tms32031.r[TMR_R6])); break;
789-
case CPUINFO_STR_REGISTER + TMS32031_R7F: sprintf(info->s, "R7F:%8g", dsp_to_double(&tms32031.r[TMR_R7])); break;
782+
case CPUINFO_STR_REGISTER + TMS32031_R0F: sprintf(info->s, "R0F:!%12g", dsp_to_double(&tms32031.r[TMR_R0])); break;
783+
case CPUINFO_STR_REGISTER + TMS32031_R1F: sprintf(info->s, "R1F:!%12g", dsp_to_double(&tms32031.r[TMR_R1])); break;
784+
case CPUINFO_STR_REGISTER + TMS32031_R2F: sprintf(info->s, "R2F:!%12g", dsp_to_double(&tms32031.r[TMR_R2])); break;
785+
case CPUINFO_STR_REGISTER + TMS32031_R3F: sprintf(info->s, "R3F:!%12g", dsp_to_double(&tms32031.r[TMR_R3])); break;
786+
case CPUINFO_STR_REGISTER + TMS32031_R4F: sprintf(info->s, "R4F:!%12g", dsp_to_double(&tms32031.r[TMR_R4])); break;
787+
case CPUINFO_STR_REGISTER + TMS32031_R5F: sprintf(info->s, "R5F:!%12g", dsp_to_double(&tms32031.r[TMR_R5])); break;
788+
case CPUINFO_STR_REGISTER + TMS32031_R6F: sprintf(info->s, "R6F:!%12g", dsp_to_double(&tms32031.r[TMR_R6])); break;
789+
case CPUINFO_STR_REGISTER + TMS32031_R7F: sprintf(info->s, "R7F:!%12g", dsp_to_double(&tms32031.r[TMR_R7])); break;
790790
case CPUINFO_STR_REGISTER + TMS32031_AR0: sprintf(info->s, "AR0:%08X", tms32031.r[TMR_AR0].i32[0]); break;
791791
case CPUINFO_STR_REGISTER + TMS32031_AR1: sprintf(info->s, "AR1:%08X", tms32031.r[TMR_AR1].i32[0]); break;
792792
case CPUINFO_STR_REGISTER + TMS32031_AR2: sprintf(info->s, "AR2:%08X", tms32031.r[TMR_AR2].i32[0]); break;

src/emu/debug/debugvw.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -945,6 +945,8 @@ static void add_register(debug_view *view, int regnum, const char *str)
945945
valstart++, vallen--;
946946
while (isspace(str[valstart + vallen - 1]) && vallen > 0)
947947
vallen--;
948+
if (str[valstart] == '!')
949+
valstart++, vallen--;
948950

949951
/* note the register number and info */
950952
regdata->reg[view->total_rows].lastval =

src/emu/eigccppc.h

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -380,4 +380,55 @@ INLINE INT32 _atomic_add32(INT32 volatile *ptr, INT32 delta)
380380
}
381381

382382

383+
/*-------------------------------------------------
384+
atomic_increment32 - atomically increment the
385+
32-bit value in memory at 'ptr', returning the
386+
final result.
387+
-------------------------------------------------*/
388+
389+
#define atomic_increment32 _atomic_increment32
390+
INLINE INT32 _atomic_increment32(INT32 volatile *ptr)
391+
{
392+
register INT32 result;
393+
394+
__asm__ __volatile__ (
395+
"1: lwarx %[result], 0, %[ptr] \n"
396+
" addi %[result], %[result], 1 \n"
397+
" sync \n"
398+
" stwcx. %[result], 0, %[ptr] \n"
399+
" bne- 1b \n"
400+
: [result] "=&b" (result)
401+
: [ptr] "r" (ptr)
402+
: "cr0"
403+
);
404+
405+
return result;
406+
}
407+
408+
409+
/*-------------------------------------------------
410+
atomic_decrement32 - atomically decrement the
411+
32-bit value in memory at 'ptr', returning the
412+
final result.
413+
-------------------------------------------------*/
414+
415+
#define atomic_decrement32 _atomic_decrement32
416+
INLINE INT32 _atomic_decrement32(INT32 volatile *ptr)
417+
{
418+
register INT32 result;
419+
420+
__asm__ __volatile__ (
421+
"1: lwarx %[result], 0, %[ptr] \n"
422+
" addi %[result], %[result], -1 \n"
423+
" sync \n"
424+
" stwcx. %[result], 0, %[ptr] \n"
425+
" bne- 1b \n"
426+
: [result] "=&b" (result)
427+
: [ptr] "r" (ptr)
428+
: "cr0"
429+
);
430+
431+
return result;
432+
}
433+
383434
#endif /* __EIGCCPPC__ */

src/emu/eigccx86.h

Lines changed: 51 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -496,20 +496,63 @@ INLINE INT32 _atomic_exchange32(INT32 volatile *ptr, INT32 exchange)
496496
#define atomic_add32 _atomic_add32
497497
INLINE INT32 _atomic_add32(INT32 volatile *ptr, INT32 delta)
498498
{
499-
register INT32 result;
499+
register INT32 result = delta;
500500

501501
__asm__ __volatile__ (
502-
" mov %[delta],%[result] ;"
503-
" lock ; xadd %[result],%[ptr] ;"
504-
" add %[delta],%[result] ;"
505-
: [ptr] "+m" (*ptr)
506-
, [result] "=&r" (result)
507-
: [delta] "rmi" (delta)
502+
" lock ; xadd %[result], %[ptr] ;"
503+
: [ptr] "+m" (*ptr)
504+
, [result] "+r" (result)
505+
:
508506
: "%cc"
509507
);
510508

511-
return result;
509+
return result + delta;
512510
}
513511

514512

513+
/*-------------------------------------------------
514+
atomic_increment32 - atomically increment the
515+
32-bit value in memory at 'ptr', returning the
516+
final result.
517+
-------------------------------------------------*/
518+
519+
#define atomic_increment32 _atomic_increment32
520+
INLINE INT32 _atomic_increment32(INT32 volatile *ptr)
521+
{
522+
register INT32 result = 1;
523+
524+
__asm__ __volatile__ (
525+
" lock ; xadd %[result], %[ptr] ;"
526+
: [ptr] "+m" (*ptr)
527+
, [result] "+r" (result)
528+
:
529+
: "%cc"
530+
);
531+
532+
return result + 1;
533+
}
534+
535+
536+
/*-------------------------------------------------
537+
atomic_decrement32 - atomically decrement the
538+
32-bit value in memory at 'ptr', returning the
539+
final result.
540+
-------------------------------------------------*/
541+
542+
#define atomic_decrement32 _atomic_decrement32
543+
INLINE INT32 _atomic_decrement32(INT32 volatile *ptr)
544+
{
545+
register INT32 result = -1;
546+
547+
__asm__ __volatile__ (
548+
" lock ; xadd %[result], %[ptr] ;"
549+
: [ptr] "+m" (*ptr)
550+
, [result] "+r" (result)
551+
:
552+
: "%cc"
553+
);
554+
555+
return result - 1;
556+
}
557+
515558
#endif /* __EIGCCX86__ */

src/emu/eminline.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,7 @@ INLINE INT32 atomic_add32(INT32 volatile *ptr, INT32 delta)
375375
-------------------------------------------------*/
376376

377377
#ifndef atomic_increment32
378-
INLINE INT32 atomic_increment32(INT32 volatile *ptr, INT32 delta)
378+
INLINE INT32 atomic_increment32(INT32 volatile *ptr)
379379
{
380380
return atomic_add32(ptr, 1);
381381
}
@@ -394,7 +394,7 @@ INLINE INT32 atomic_increment32(INT32 volatile *ptr, INT32 delta)
394394
-------------------------------------------------*/
395395

396396
#ifndef atomic_decrement32
397-
INLINE INT32 atomic_decrement32(INT32 volatile *ptr, INT32 delta)
397+
INLINE INT32 atomic_decrement32(INT32 volatile *ptr)
398398
{
399399
return atomic_add32(ptr, -1);
400400
}

src/emu/emu.mak

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,6 @@ EMUVIDEOOBJS = \
167167
$(EMUVIDEO)/crtc6845.o \
168168
$(EMUVIDEO)/generic.o \
169169
$(EMUVIDEO)/poly.o \
170-
$(EMUVIDEO)/polynew.o \
171170
$(EMUVIDEO)/resnet.o \
172171
$(EMUVIDEO)/s2636.o \
173172
$(EMUVIDEO)/tlc34076.o \

src/emu/inptport.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2402,6 +2402,15 @@ void input_port_parse_diplocation(input_port_entry *in, const char *location)
24022402
if (curname == NULL)
24032403
fatalerror("Switch location '%s' missing switch name!", location);
24042404

2405+
/* if the number is preceded by a '!' it's active high */
2406+
if (*number == '!')
2407+
{
2408+
in->diploc[index].invert = 1;
2409+
number++;
2410+
}
2411+
else
2412+
in->diploc[index].invert = 0;
2413+
24052414
/* now scan the switch number */
24062415
if (sscanf(number, "%d", &val) != 1)
24072416
fatalerror("Switch location '%s' has invalid format!", location);

src/emu/inptport.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -585,6 +585,7 @@ struct _input_port_entry
585585
{
586586
const char *swname; /* name of the physical DIP switch */
587587
UINT8 swnum; /* physical switch number */
588+
UINT8 invert; /* is this an active-high DIP? */
588589
} diploc[8];
589590

590591
/* valid if type is IPT_KEYBOARD */
@@ -765,7 +766,7 @@ struct _inp_header
765766
#define PORT_DIPSETTING(default,name) \
766767
INPUT_PORT_UINT32_PAIR(INPUT_TOKEN_DIPSETTING, default), INPUT_PORT_PTR(name),
767768

768-
/* physical location, of the form: name:sw,[name:]sw,... */
769+
/* physical location, of the form: name:[!]sw,[name:][!]sw,... */
769770
/* note that these are specified LSB-first */
770771
#define PORT_DIPLOCATION(location_) \
771772
INPUT_PORT_UINT32(INPUT_TOKEN_DIPLOCATION), INPUT_PORT_PTR(location_),

src/emu/sound/scsp.c

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ static void Compute_EG(struct _SCSP *SCSP,struct _SLOT *slot)
376376
if(KRS(slot)!=0xf)
377377
rate=2*(octave+KRS(slot))+((FNS(slot)>>9)&1);
378378
else
379-
rate=((FNS(slot)>>9)&1);
379+
rate=0; //rate=((FNS(slot)>>9)&1);
380380

381381
slot->EG.volume=0;
382382
slot->EG.AR=Get_AR(SCSP,rate,AR(slot));
@@ -397,17 +397,20 @@ static int EG_Update(struct _SLOT *slot)
397397
slot->EG.volume+=slot->EG.AR;
398398
if(slot->EG.volume>=(0x3ff<<EG_SHIFT))
399399
{
400-
slot->EG.state=DECAY1;
401-
if(slot->EG.D1R>=(1024<<EG_SHIFT)) //Skip DECAY1, go directly to DECAY2
402-
slot->EG.state=DECAY2;
400+
if (!LPSLNK(slot))
401+
{
402+
slot->EG.state=DECAY1;
403+
if(slot->EG.D1R>=(1024<<EG_SHIFT)) //Skip DECAY1, go directly to DECAY2
404+
slot->EG.state=DECAY2;
405+
}
403406
slot->EG.volume=0x3ff<<EG_SHIFT;
404407
}
405408
if(slot->EG.EGHOLD)
406409
return 0x3ff<<(SHIFT-10);
407410
break;
408411
case DECAY1:
409412
slot->EG.volume-=slot->EG.D1R;
410-
if(slot->EG.volume>>(EG_SHIFT+5)>=slot->EG.DL)
413+
if(slot->EG.volume>>(EG_SHIFT+5)<=slot->EG.DL)
411414
slot->EG.state=DECAY2;
412415
break;
413416
case DECAY2:
@@ -561,7 +564,7 @@ static void SCSP_Init(struct _SCSP *SCSP, const struct SCSPinterface *intf, int
561564
if(iPAN&0x4) SegaDB-=12;
562565
if(iPAN&0x8) SegaDB-=24;
563566

564-
if(iPAN==0xf) PAN=0.0;
567+
if((iPAN&0xf)==0xf) PAN=0.0;
565568
else PAN=pow(10.0,SegaDB/20.0);
566569

567570
if(iPAN<0x10)
@@ -1172,6 +1175,12 @@ INLINE INT32 SCSP_UpdateSlot(struct _SCSP *SCSP, struct _SLOT *slot)
11721175
addr&=0x7ffff;
11731176
}
11741177
*/
1178+
if(addr==LSA(slot))
1179+
{
1180+
if(LPSLNK(slot) && slot->EG.state==ATTACK)
1181+
slot->EG.state = DECAY1;
1182+
}
1183+
11751184
if(PCM8B(slot)) //8 bit signed
11761185
{
11771186
INT8 *p=(INT8 *) (slot->base+BYTE_XOR_BE((slot->cur_addr>>SHIFT)));
@@ -1193,6 +1202,11 @@ INLINE INT32 SCSP_UpdateSlot(struct _SCSP *SCSP, struct _SLOT *slot)
11931202

11941203
}
11951204

1205+
if(SBCTL(slot)&0x1)
1206+
sample ^= 0x7FFF;
1207+
if(SBCTL(slot)&0x2)
1208+
sample = (INT16)(sample^0x8000);
1209+
11961210
if(slot->Backwards)
11971211
slot->cur_addr-=step;
11981212
else

src/emu/uimenu.c

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ struct _dip_descriptor
100100
const char * dip_name;
101101
UINT16 total_dip_mask;
102102
UINT16 total_dip_settings;
103+
UINT16 dip_invert_mask;
103104
UINT16 selected_dip_feature_mask;
104105
};
105106

@@ -167,8 +168,10 @@ static UINT32 menu_quit_game(UINT32 state);
167168
static UINT32 menu_select_game(UINT32 state);
168169
#ifdef MESS
169170
static UINT32 menu_file_manager(UINT32 state);
171+
#if HAS_WAVE
170172
static UINT32 menu_tape_control(UINT32 state);
171-
#endif
173+
#endif /* HAS_WAVE */
174+
#endif /* MESS */
172175

173176
/* menu helpers */
174177
static void menu_render_triangle(mame_bitmap *dest, const mame_bitmap *source, const rectangle *sbounds, void *param);
@@ -1727,14 +1730,16 @@ static UINT32 menu_file_manager(UINT32 state)
17271730
-------------------------------------------------*/
17281731

17291732
#ifdef MESS
1733+
#if HAS_WAVE
17301734
static UINT32 menu_tape_control(UINT32 state)
17311735
{
17321736
int result = tapecontrol(state);
17331737
if (result == 0)
17341738
return ui_menu_stack_pop();
17351739
return result;
17361740
}
1737-
#endif
1741+
#endif /* HAS_WAVE */
1742+
#endif /* MESS */
17381743

17391744

17401745

@@ -2209,6 +2214,10 @@ static void dip_switch_build_model(input_port_entry *entry, int item_is_selected
22092214
/* indicate the toggle exists in the switch */
22102215
dip_switch_model[model_index].total_dip_mask |= toggle_switch_mask;
22112216

2217+
/* if it's inverted, mark it as such */
2218+
if (entry->diploc[dip_declaration_index].invert)
2219+
dip_switch_model[model_index].dip_invert_mask |= toggle_switch_mask;
2220+
22122221
/* if isolated bit is on, set the toggle on */
22132222
if ((1 << value_mask_bit) & entry->default_value)
22142223
dip_switch_model[model_index].total_dip_settings |= toggle_switch_mask;
@@ -2279,7 +2288,7 @@ static void dip_switch_draw_one(float dip_menu_x1, float dip_menu_y1, float dip_
22792288
{
22802289
/* yes, draw the switch position for a single toggle switch in a switch field */
22812290
int feature_field_selected = ((bit_mask & dip_switch_model[model_index].selected_dip_feature_mask) != 0);
2282-
dip_on = ((bit_mask & dip_switch_model[model_index].total_dip_settings) != 0);
2291+
dip_on = ((bit_mask & (dip_switch_model[model_index].total_dip_settings ^ dip_switch_model[model_index].dip_invert_mask)) != 0);
22832292

22842293
render_ui_add_rect(x1, dip_on ? y1_on : y1_off,
22852294
x2, dip_on ? y2_on : y2_off,

0 commit comments

Comments
 (0)