Previous 199869 Revisions Next

r26425 Monday 25th November, 2013 at 22:57:47 UTC by Jürgen Buchmüller
Update comments and remove obsolete code
[/branches/alto2/src/emu/cpu/alto2]a2emu.c

branches/alto2/src/emu/cpu/alto2/a2emu.c
r26424r26425
1212/** @brief CTL2K_U3 address line for F2 function */
1313#define   CTL2K_U3(f2) (f2 == f2_emu_idisp ? 0x80 : 0x00)
1414
15/** @brief set non-zero to use expressions after the schematics for RSEL[3-4] */
16#define   USE_SCHEMATICS_RSEL   0
17
1815/**
1916 * width,from,to of the 16 bit instruction register
2017 *                     1 1 1 1 1 1
r26424r26425
237234 * </PRE>
238235 */
239236
240#if   USE_SCHEMATICS_RSEL
241#define   RA3(f2,ir,rs)   (\
242   (((ALTO2_GET(f2,4,0,2)==5 && ALTO2_GET(ir,16,3,3)==0) ? 0 : 1) && \
243   ((ALTO2_GET(f2,4,0,2)==7 && ALTO2_GET(ir,16,1,1)==0) ? 0 : 1) && \
244   (ALTO2_GET(rs,5,3,3)==0)) ? 0 : 1)
245
246#define   RA4(f2,ir,rs)   (\
247   (((ALTO2_GET(f2,4,0,2)==5 && ALTO2_GET(ir,16,4,4)==0) ? 0 : 1) && \
248   ((ALTO2_GET(f2,4,0,2)==7 && ALTO2_GET(ir,16,2,2)==0) ? 0 : 1) && \
249   (ALTO2_GET(rs,5,4,4)==0)) ? 0 : 1)
250#endif   /* USE_SCHEMATICS_RSEL */
251
252237/**
253238 * @brief bs_disp early: drive bus by IR[8-15], possibly sign extended
254239 *
r26424r26425
367352}
368353
369354/**
370 * @brief f2_busodd late: branch on odd bus
355 * @brief branch on odd bus
371356 */
372357void alto2_cpu_device::f2_late_busodd()
373358{
r26424r26425
377362}
378363
379364/**
380 * @brief f2_magic late: shift and use T[0] or T[15]
365 * @brief f2_magic late: shift and use T[0] or T[15] for bit 15 or 0
381366 */
382367void alto2_cpu_device::f2_late_magic()
383368{
r26424r26425
403388}
404389
405390/**
406 * @brief dns early: modify RESELECT with DstAC = (3 - IR[3-4])
391 * @brief do novel shifts: modify RESELECT with DstAC = (3 - IR[3-4])
407392 */
408393void alto2_cpu_device::f2_early_load_dns()
409394{
410#if   USE_SCHEMATICS_RSEL
411   X_WRBITS(m_rsel, 5, 3, 3, RA3(f2_emu_load_dns, m_emu.ir, m_rsel));
412   X_WRBITS(m_rsel, 5, 4, 4, RA4(f2_emu_load_dns, m_emu.ir, m_rsel));
413#else
414395   X_WRBITS(m_rsel, 5, 3, 4, IR_DstAC(m_emu.ir) ^ 3);
415#endif
416396   LOG((LOG_EMU,2,"   DNS←; rsel := DstAC (%#o %s)\n", m_rsel, r_name(m_rsel)));
417397}
418398
419399/**
420 * @brief f2_load_dns late: do novel shifts
400 * @brief do novel shifts
421401 *
422402 * <PRE>
423403 * New emulator carry is selected by instruction register
r26424r26425
499479}
500480
501481/**
502 * @brief f2_acdest early: modify RSELECT with DstAC = (3 - IR[3-4])
482 * @brief destiantion accu: modify RSELECT with DstAC = (3 - IR[3-4])
503483 */
504484void alto2_cpu_device::f2_early_acdest()
505485{
506#if   USE_SCHEMATICS_RSEL
507   ALTO2_PUT(m_rsel, 5, 3, 3, RA3(f2_emu_acdest, m_emu.ir, m_rsel));
508   ALTO2_PUT(m_rsel, 5, 4, 4, RA4(f2_emu_acdest, m_emu.ir, m_rsel));
509#else
510486   X_WRBITS(m_rsel, 5, 3, 4, IR_DstAC(m_emu.ir) ^ 3);
511#endif
512487   LOG((LOG_EMU,2,"   ACDEST←; mux (rsel:%#o %s)\n", m_rsel, r_name(m_rsel)));
513488}
514489
r26424r26425
555530#endif   /* DEBUG */
556531
557532/**
558 * @brief f2_load_ir late: load instruction register IR and branch on IR[0,5-7]
533 * @brief load instruction register IR and branch on IR[0,5-7]
559534 *
560535 * Loading the IR clears the skip latch.
561536 */
r26424r26425
563538{
564539   UINT16 r = (X_BIT(m_bus,16,0) << 3) | X_RDBITS(m_bus,16,5,7);
565540
541#if   ALTO2_DEBUG
566542   /* special logging of some opcodes */
567543   switch (m_bus) {
568544   case op_CYCLE:
r26424r26425
595571         m_r[rsel_ac2], m_r[rsel_ac3]));
596572      break;
597573   case op_BITBLT:
598#if   ALTO2_DEBUG
599574      bitblt_info();
600#endif
601575      break;
602576   case op_RDRAM:
603577      LOG((LOG_EMU,3,"   RDRAM addr:%#o\n", m_r[rsel_ac1]));
r26424r26425
615589      LOG((LOG_EMU,3,"   XMSTA [bank:%o AC1:#o] = AC0 (%#o)\n", m_bank_reg[m_task] & 3, m_r[rsel_ac1], m_r[rsel_ac0]));
616590      break;
617591   }
592#endif
618593   m_emu.ir = m_bus;
619594   m_emu.skip = 0;
620595   m_next2 |= r;
r26424r26425
622597
623598
624599/**
625 * @brief f2_idisp late: branch on: arithmetic IR_SH, others PROM ctl2k_u3[IR[1-7]]
600 * @brief branch on: arithmetic IR_SH, others PROM ctl2k_u3[IR[1-7]]
626601 */
627602void alto2_cpu_device::f2_late_idisp()
628603{
r26424r26425
642617}
643618
644619/**
645 * @brief f2_acsource early: modify RSELECT with SrcAC = (3 - IR[1-2])
620 * @brief source accu: modify RSELECT with SrcAC = (3 - IR[1-2])
646621 */
647622void alto2_cpu_device::f2_early_acsource()
648623{
649#if   USE_SCHEMATICS_RSEL
650   X_WRBITS(m_rsel, 5, 3, 3, RA3(f2_emu_acsource, m_emu.ir, m_rsel));
651   X_WRBITS(m_rsel, 5, 4, 4, RA4(f2_emu_acsource, m_emu.ir, m_rsel));
652#else
653624   X_WRBITS(m_rsel, 5, 3, 4, IR_SrcAC(m_emu.ir) ^ 3);
654#endif
655625   LOG((LOG_EMU,2,"   ←ACSOURCE; rsel := SrcAC (%#o %s)\n", m_rsel, r_name(m_rsel)));
656626}
657627
658628/**
659 * @brief f2_acsource late: branch on: arithmetic IR_SH, others PROM ctl2k_u3[IR[1-7]]
629 * @brief branch on: arithmetic IR_SH, others PROM ctl2k_u3[IR[1-7]]
660630 */
661631void alto2_cpu_device::f2_late_acsource()
662632{

Previous 199869 Revisions Next


© 1997-2024 The MAME Team