Skip to content

Commit

Permalink
leftovers, most notably reduce page0[0x100000] to page0[0x100000/4] i…
Browse files Browse the repository at this point in the history
…n at91
  • Loading branch information
toxieainc committed Sep 26, 2023
1 parent eb45229 commit 5870379
Show file tree
Hide file tree
Showing 14 changed files with 130 additions and 135 deletions.
1 change: 1 addition & 0 deletions ext/vgm/vgmwrite.c
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,7 @@ void vgm_start(struct RunningMachine *machine)
return;

// start the timer
//PINMAME change: if also done if not logging (like in original source), then cpu slices change, leading to timing issues on some machines
timer_pulse(TIME_IN_HZ(44100), 0, vgmfile_callback); //44.1 KHz VGM pulse timer

// Get the Game Information and write the GD3 Tag
Expand Down
1 change: 1 addition & 0 deletions release/whatsnew.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ Refined Bally-32 sound emulation (so it also does not require the sample package
Disabled mechanical sample use (solenoids, bumpers, etc) via the pinmame.zip sample package if running VPinMAME or libPinMAME (as this should be handled by the table itself then)
Fixed 6 million dollar man 7 digit conversion display
Fixed inverted switches for ffv101
Fixed im_185 fast flip detection
Fixed regressions by reducing the pre-shutdown time for Joctronic, NSM, Juegos Populares, after fixing timeslice issue related to the VGM file dump feature (which uses a fast timer)
Added support for the old SC-01 Votrax ROM version (wired only to the Mars - God of War Prototype so far)
Fixed regression/crashes for Elvis and Monopoly (introduced in 3.1)
Expand Down
2 changes: 1 addition & 1 deletion src/cpu/adsp2100/2100dasm.c
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ unsigned dasm2100(char *buffer, unsigned pc)
buffer += sprintf(buffer, "??? (%06X)", op);
break;
case 0x0a:
/* 00001010 00000000 0000xxxx conditional return */
/* 00001010 00000000 000xxxxx conditional return */
if ((op & 0x00ffe0) == 0x000000)
{
buffer += sprintf(buffer, "%s", condition[op & 15]);
Expand Down
15 changes: 5 additions & 10 deletions src/cpu/arm7/arm7core.c
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,6 @@ INLINE data32_t decodeShift( data32_t insn, data32_t *pCarry)
static int loadInc ( data32_t pat, data32_t rbv, data32_t s)
{
int i, result;
UINT32 data;

result = 0;
rbv &= ~3;
Expand All @@ -446,7 +445,7 @@ static int loadInc ( data32_t pat, data32_t rbv, data32_t s)
if ((pat >> i) & 1)
{
if (ARM7.pendingAbtD == 0) {
data = READ32(rbv += 4);
UINT32 data = READ32(rbv += 4);
if (i == 15) {
//if (s) /* Pull full contents from stack */
SET_REGISTER( 15, data );
Expand All @@ -465,7 +464,6 @@ static int loadInc ( data32_t pat, data32_t rbv, data32_t s)
static int loadIncMode(data32_t pat, data32_t rbv, data32_t s, int mode)
{
int i, result;
UINT32 data;

result = 0;
rbv &= ~3;
Expand All @@ -475,7 +473,7 @@ static int loadIncMode(data32_t pat, data32_t rbv, data32_t s, int mode)
{
if (ARM7.pendingAbtD == 0) // "Overwriting of registers stops when the abort happens."
{
data = READ32(rbv += 4);
UINT32 data = READ32(rbv += 4);
if (i == 15) {
//if (s) /* Pull full contents from stack */
SET_MODE_REGISTER(mode, 15, data);
Expand All @@ -493,7 +491,6 @@ static int loadIncMode(data32_t pat, data32_t rbv, data32_t s, int mode)
static int loadDec( data32_t pat, data32_t rbv, data32_t s)
{
int i, result;
UINT32 data;

result = 0;
rbv &= ~3;
Expand All @@ -502,7 +499,7 @@ static int loadDec( data32_t pat, data32_t rbv, data32_t s)
if ((pat >> i) & 1)
{
if (ARM7.pendingAbtD == 0) {
data = READ32(rbv -= 4);
UINT32 data = READ32(rbv -= 4);
if (i == 15) {
//if (s) /* Pull full contents from stack */
SET_REGISTER( 15, data );
Expand All @@ -521,7 +518,6 @@ static int loadDec( data32_t pat, data32_t rbv, data32_t s)
static int loadDecMode(data32_t pat, data32_t rbv, data32_t s, int mode)
{
int i, result;
UINT32 data;

result = 0;
rbv &= ~3;
Expand All @@ -531,7 +527,7 @@ static int loadDecMode(data32_t pat, data32_t rbv, data32_t s, int mode)
{
if (ARM7.pendingAbtD == 0) // "Overwriting of registers stops when the abort happens."
{
data = READ32(rbv -= 4);
UINT32 data = READ32(rbv -= 4);
if (i == 15) {
//if (s) /* Pull full contents from stack */
SET_MODE_REGISTER(mode, 15, data);
Expand Down Expand Up @@ -590,7 +586,7 @@ static int storeIncMode(data32_t pat, data32_t rbv, int mode)
// classic CV: 3005aa0 does the DMA thing
static int storeDec( data32_t pat, data32_t rbv)
{
int i, result = 0, cnt;
int i, result = 0, cnt;

// pre-count the # of registers doing DMA
for (i = 15; i >= 0; i--)
Expand Down Expand Up @@ -852,7 +848,6 @@ static void HandleCoProcDO(data32_t insn)
//Co-Processor Register Transfer - To/From Arm to Co-Proc
static void HandleCoProcRT(data32_t insn)
{

/* xxxx 1110 oooL nnnn dddd cccc ppp1 mmmm */

// Load (MRC) data from Co-Proc to ARM7 register
Expand Down
1 change: 0 additions & 1 deletion src/cpu/arm7/arm7core.h
Original file line number Diff line number Diff line change
Expand Up @@ -389,4 +389,3 @@ EXTERN char *(*arm7_dasm_cop_do_callback)( char *pBuf, data32_t opcode, char *pC
#endif

#endif /* ARM7CORE_H */

23 changes: 11 additions & 12 deletions src/cpu/at91/at91.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ extern int activecpu;

//Flags for Testing
#define INT_BLOCK_FIQ 0 //Turn on/off blocking of specified Interrupt (Leave OFF for non-test situation)
#define INT_BLOCK_IRQ0 0
#define INT_BLOCK_IRQ0 0
#define INT_BLOCK_TC0 0
#define INT_BLOCK_TC1 0
#define INT_BLOCK_TC2 0
Expand Down Expand Up @@ -120,10 +120,10 @@ static void timer_trigger_event(int timer_num);
#define WRITE32(addr,data) at91_cpu_write32(addr,data)
#define PTR_READ32 &at91_cpu_read32
#define PTR_WRITE32 &at91_cpu_write32
#define PTR_READ16 &arm7_cpu_read16
#define PTR_WRITE16 &arm7_cpu_write16
#define PTR_READ8 &arm7_cpu_read8
#define PTR_WRITE8 &arm7_cpu_write8
#define PTR_READ16 &arm7_cpu_read16
#define PTR_WRITE16 &arm7_cpu_write16
#define PTR_READ8 &arm7_cpu_read8
#define PTR_WRITE8 &arm7_cpu_write8

/* Macros that need to be defined according to the cpu implementation specific need */
#define ARMREG(reg) at91.sArmRegister[reg]
Expand Down Expand Up @@ -179,8 +179,8 @@ typedef struct
ARM7CORE_REGS //these must be included in your cpu specific register implementation
int prev_cycles; //# of previous cycles used since last opcode was performed.
int tot_prev_cycles; //# of total previous cycles
int remap; //flag if remap of ram occurred
data32_t aic_vectors[32]; //holds vector address for each interrupt 0-31
int remap; //flag if remap of ram occurred
data32_t aic_vectors[32]; //holds vector address for each interrupt 0-31
data32_t aic_smr[32]; //Holds IRQ priorities
data32_t aic_irqmask; //holds the irq enabled mask for each interrupt 0-31 (0 = disabled, 1 = enabled) - 1 bit per interrupt.
data32_t aic_irqstatus; //holds the status of the current interrupt # - 0-31 are valid #
Expand All @@ -204,7 +204,7 @@ typedef struct
int cpunum; //CPU num
data32_t *page0_ram_ptr; //holder for the pointer set by the driver to ram @ page 0.
data32_t *reset_ram_ptr; //holder for the pointer set by the driver to ram swap location.
data32_t page0[0x100000]; //Hold copy of original boot rom data @ page 0.
data32_t page0[0x100000/4]; //Hold copy of original boot rom data @ page 0.
#if USE_MAME_TIMERS
mame_timer* timer[MAX_TIMER]; //handle to mame timer for each clock
#endif
Expand Down Expand Up @@ -1196,7 +1196,7 @@ INLINE void internal_write (int addr, data32_t data)
break;
}

default:
default:
LOG(("%08x: AT91-OCP WRITE: %08x = %08x\n",activecpu_get_pc(),addr,data));
}
}
Expand Down Expand Up @@ -1766,7 +1766,7 @@ void at91_fire_irq(int irqline)
// {
// return;
// }
// Always mark as pending, but don't fire if masked.
// Always mark as pending, but don't fire if masked.

if(irqline == AT91_FIQ_IRQ)
{
Expand Down Expand Up @@ -1961,12 +1961,11 @@ INLINE BeforeOpCodeHook(void)
if( (TC_RUNNING(0) || TC_RUNNING(1) || TC_RUNNING(2)) ) //for speed we use this, but really it should loop and check using MAX_TIMER var
{
int i;
int cycles = 0;

//Check each timer
for(i=0; i<MAX_TIMER; i++)
{
cycles = at91.prev_cycles; //How many cycles have passed since last check?
int cycles = at91.prev_cycles; //How many cycles have passed since last check?
cycles+= at91.tc_clock[i].halfticks; //Add half ticks since last time
//Is this timer running?
if(TC_RUNNING(i))
Expand Down
2 changes: 1 addition & 1 deletion src/cpu/i8039/8039dasm.c
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ static int OpInizialized = 0;

static void InitDasm8039(void)
{
const char **ops;
const char * const *ops;
int i;

ops = Formats; i = 0;
Expand Down
Loading

0 comments on commit 5870379

Please sign in to comment.