PicoDrive hacks

git-svn-id: file:///home/notaz/opt/svn/PicoDrive@216 be3aeb3a-fb24-0410-a615-afba39da0efa
This commit is contained in:
notaz 2007-08-05 19:37:36 +00:00
parent 0e11c502b0
commit 3335750a7d
5 changed files with 23 additions and 8 deletions

View file

@ -1,6 +1,10 @@
m68kops.c : m68kmake m68kops.c : m68kmake
./$< ./$<
m68kmake : m68kmake.c m68k_in.c
$(CC) -o $@ $<
clean: clean:
$(RM) m68kops.c m68kops.h m68kmake *.o $(RM) m68kops.c m68kops.h m68kmake *.o

View file

@ -1262,8 +1262,9 @@ M68KMAKE_OP(adda, 32, ., a)
M68KMAKE_OP(adda, 32, ., .) M68KMAKE_OP(adda, 32, ., .)
{ {
uint* r_dst = &AX; uint* r_dst = &AX;
uint src = M68KMAKE_GET_OPER_AY_32; // notaz
*r_dst = MASK_OUT_ABOVE_32(*r_dst + M68KMAKE_GET_OPER_AY_32); *r_dst = MASK_OUT_ABOVE_32(*r_dst + src);
} }
@ -7132,8 +7133,9 @@ M68KMAKE_OP(movem, 32, re, pd)
if(register_list & (1 << i)) if(register_list & (1 << i))
{ {
ea -= 4; ea -= 4;
m68ki_write_16(ea+2, REG_DA[15-i] & 0xFFFF ); m68ki_write_16(ea, REG_DA[15-i] ); // notaz Cyclone hack
m68ki_write_16(ea, (REG_DA[15-i] >> 16) & 0xFFFF ); //m68ki_write_16(ea+2, REG_DA[15-i] & 0xFFFF );
//m68ki_write_16(ea, (REG_DA[15-i] >> 16) & 0xFFFF );
count++; count++;
} }
AY = ea; AY = ea;
@ -9785,8 +9787,9 @@ M68KMAKE_OP(suba, 32, ., a)
M68KMAKE_OP(suba, 32, ., .) M68KMAKE_OP(suba, 32, ., .)
{ {
uint* r_dst = &AX; uint* r_dst = &AX;
uint src = M68KMAKE_GET_OPER_AY_32; // notaz
*r_dst = MASK_OUT_ABOVE_32(*r_dst - M68KMAKE_GET_OPER_AY_32); *r_dst = MASK_OUT_ABOVE_32(*r_dst - src);
} }

View file

@ -102,7 +102,7 @@
/* If ON, the CPU will monitor the trace flags and take trace exceptions /* If ON, the CPU will monitor the trace flags and take trace exceptions
*/ */
#define M68K_EMULATE_TRACE OPT_OFF #define M68K_EMULATE_TRACE OPT_ON
/* If ON, CPU will call the output reset callback when it encounters a reset /* If ON, CPU will call the output reset callback when it encounters a reset

View file

@ -790,6 +790,9 @@ int m68k_execute(int num_cycles)
/* Make sure we're not stopped */ /* Make sure we're not stopped */
if(!CPU_STOPPED) if(!CPU_STOPPED)
{ {
// notaz
m68ki_check_interrupts();
/* Set our pool of clock cycles available */ /* Set our pool of clock cycles available */
SET_CYCLES(num_cycles); SET_CYCLES(num_cycles);
m68ki_initial_cycles = num_cycles; m68ki_initial_cycles = num_cycles;
@ -803,11 +806,13 @@ int m68k_execute(int num_cycles)
/* Main loop. Keep going until we run out of clock cycles */ /* Main loop. Keep going until we run out of clock cycles */
// notaz // notaz
m68ki_trace_t1();
while(GET_CYCLES() >= 0) while(GET_CYCLES() >= 0)
// do // do
{ {
/* Set tracing accodring to T1. (T0 is done inside instruction) */ /* Set tracing accodring to T1. (T0 is done inside instruction) */
m68ki_trace_t1(); /* auto-disable (see m68kcpu.h) */ //m68ki_trace_t1(); /* auto-disable (see m68kcpu.h) */
/* Set the address space for reads */ /* Set the address space for reads */
m68ki_use_data_space(); /* auto-disable (see m68kcpu.h) */ m68ki_use_data_space(); /* auto-disable (see m68kcpu.h) */
@ -820,11 +825,13 @@ int m68k_execute(int num_cycles)
/* Read an instruction and call its handler */ /* Read an instruction and call its handler */
REG_IR = m68ki_read_imm_16(); REG_IR = m68ki_read_imm_16();
USE_CYCLES(CYC_INSTRUCTION[REG_IR]); // notaz
m68ki_instruction_jump_table[REG_IR](); m68ki_instruction_jump_table[REG_IR]();
USE_CYCLES(CYC_INSTRUCTION[REG_IR]);
/* Trace m68k_exception, if necessary */ /* Trace m68k_exception, if necessary */
m68ki_exception_if_trace(); /* auto-disable (see m68kcpu.h) */ m68ki_exception_if_trace(); /* auto-disable (see m68kcpu.h) */
m68ki_trace_t1(); /* notaz */
} // while(GET_CYCLES() > 0); // notaz } // while(GET_CYCLES() > 0); // notaz
/* set previous PC to current PC for the next entry into the loop */ /* set previous PC to current PC for the next entry into the loop */

View file

@ -1534,7 +1534,8 @@ INLINE void m68ki_set_sr_noint_nosp(uint value)
INLINE void m68ki_set_sr(uint value) INLINE void m68ki_set_sr(uint value)
{ {
m68ki_set_sr_noint(value); m68ki_set_sr_noint(value);
m68ki_check_interrupts(); if (GET_CYCLES() >= 0) // notaz
m68ki_check_interrupts();
} }