Previous 15994 Revisions Next

r3096 Sunday 24th August, 2008 at 09:43:03 UTC by Roberto Zandonà
[C65] and [M4510 core] : - removed hack in NOP command (for sure the inhibition of interrupts don't use I flag)
- fixed BRA and BRA_WORD instruction (if condition is false, tmp, EAL and EAH are unchanged) -> this fix boot screen
[src/emu/cpu/m6502]m4510.c ops4510.h opsce02.h

src/emu/cpu/m6502/m4510.c
r3095r3096
133133   UINT8   y;            /* Y index register */
134134   UINT8   z;            /* Z index register */
135135   UINT8   p;            /* Processor status */
136   UINT8 interrupt_inhibit;   /* Some instructions, like MAP, inhibit interrupt */
136137   UINT8   pending_irq;   /* nonzero if an IRQ is pending */
137138   UINT8   after_cli;      /* pending IRQ and last insn cleared I */
138139   UINT8   nmi_state;
r3095r3096
177178
178179static void m4510_init(int index, int clock, const void *config, int (*irqcallback)(int))
179180{
181   m4510.interrupt_inhibit = 0;
180182   m4510.rdmem_id = default_rdmem_id;
181183   m4510.wrmem_id = default_wrmem_id;
182184   m4510.irq_callback = irqcallback;
r3095r3096
197199   m4510.z = 0;
198200   B = 0;
199201   m4510.p = F_E|F_B|F_I|F_Z;   /* set E, I and Z flags */
202   m4510.interrupt_inhibit = 0;
200203   m4510.pending_irq = 0;   /* nonzero if an IRQ is pending */
201204   m4510.after_cli = 0;      /* pending IRQ and last insn cleared I */
202205   m4510.irq_callback = NULL;
r3095r3096
234237
235238INLINE void m4510_take_irq(void)
236239{
237   if( !(P & F_I) )
240   if(( !(P & F_I) ) && (m4510.interrupt_inhibit == 0))
238241   {
239242      EAD = M4510_IRQ_VEC;
240243      m4510_ICount -= 7;
src/emu/cpu/m6502/ops4510.h
r3095r3096
3838
3939#undef NOP
4040#define NOP       \
41  SEI;
41  m4510.interrupt_inhibit = 0; \
42  /* SEI */
4243
4344/* c65 docu says transfer of axyz to the mapper register
4445   so no readback!? */
45#define MAP                                        \
46#define MAP                   \
47  m4510.interrupt_inhibit = 0;         \
4648  m4510.low=m4510.a|(m4510.x<<8); \
4749  m4510.high=m4510.y|(m4510.z<<8); \
4850  m4510.mem[0]=(m4510.low&0x1000) ?  (m4510.low&0xfff)<<8:0;  \
src/emu/cpu/m6502/opsce02.h
r3095r3096
125125      else                           \
126126         pair.w.l++;                     \
127127      EAH = RDMEM(pair.d);                     \
128      RDMEM(PCW-1);                        \
128      /* RDMEM(PCW-1); */                        \
129129      EAW += Y;                        \
130130   }
131131
r3095r3096
135135#define EA_IND                              \
136136   EA_ABS;                              \
137137   tmp = RDMEM(EAD);                        \
138   EAD++;                              \
138   EAL++;                              \
139139   EAH = RDMEM(EAD);                        \
140140   EAL = tmp
141141
r3095r3096
146146   EA_ABS;                              \
147147   EAW += X;                           \
148148   tmp = RDMEM(EAD);                        \
149   EAD++;                              \
149   EAL++;                              \
150150   EAH = RDMEM(EAD);                        \
151151   EAL = tmp
152152
r3095r3096
317317 *  BRA  branch relative
318318 ***************************************************************/
319319#define BRA(cond)                           \
320   tmp = RDOPARG();                        \
321320   if (cond)                           \
322321   {                              \
323      EAW = PCW + (signed char)tmp;                  \
322      tmp = RDOPARG();                     \
323      EAW = PCW + (signed char)tmp;               \
324324      PCD = EAD;                        \
325325      CHANGE_PC;                        \
326   }                              \
327   else                              \
328   {                              \
329      PCW += 1;                        \
326330   }
327331
328332/***************************************************************
329333 *  BRA  branch relative
330334 ***************************************************************/
331#define BRA_WORD(cond)                           \
332   EAL = RDOPARG();                        \
333   EAH = RDOPARG();                        \
335#define BRA_WORD(cond)                        \
334336   if (cond)                           \
335337   {                              \
336      EAW = PCW + (short)(EAW-1);                   \
338      EAL = RDOPARG();                     \
339      EAH = RDOPARG();                     \
340      EAW = PCW + (short)(EAW-1);                \
337341      PCD = EAD;                        \
338342      CHANGE_PC;                        \
343   }                              \
344   else                              \
345   {                              \
346      PCW += 2;                     \
339347   }
340
341348/* 65ce02 ******************************************************
342349 *  BRK Break
343350 *  increment PC, push PC hi, PC lo, flags (with B bit set),

Previous 15994 Revisions Next


© 1998-2018 The MESS Team