Previous 199869 Revisions Next

r26355 Friday 22nd November, 2013 at 12:25:44 UTC by Jürgen Buchmüller
Comment fixes. Try to adjust HLC counting. Set and reset debugger access flags.
[/branches/alto2/src/emu/cpu/alto2]a2disp.c a2mem.c

branches/alto2/src/emu/cpu/alto2/a2disp.c
r26354r26355
248248   *pix++ = (word >>  0) & 1;
249249}
250250
251#define   HLC1   ((m_dsp.hlc >>  0) & 1)      //!< horizontal line counter bit 0
251#define   HLC1   ((m_dsp.hlc >>  0) & 1)      //!< horizontal line counter bit 0 (mid of the scanline)
252252#define   HLC2   ((m_dsp.hlc >>  1) & 1)      //!< horizontal line counter bit 1
253253#define   HLC4   ((m_dsp.hlc >>  2) & 1)      //!< horizontal line counter bit 2
254254#define   HLC8   ((m_dsp.hlc >>  3) & 1)      //!< horizontal line counter bit 3
r26354r26355
258258#define   HLC128   ((m_dsp.hlc >>  7) & 1)      //!< horizontal line counter bit 7
259259#define   HLC256   ((m_dsp.hlc >>  8) & 1)      //!< horizontal line counter bit 8
260260#define   HLC512   ((m_dsp.hlc >>  9) & 1)      //!< horizontal line counter bit 9
261#define   HLC1024 ((m_dsp.hlc >> 10) & 1)      //!< horizontal line counter bit 10
261#define   HLC1024 ((m_dsp.hlc >> 10) & 1)      //!< horizontal line counter bit 10 (odd/even field)
262262
263263#define GET_SETMODE_SPEEDY(mode) X_RDBITS(mode,16,0,0)  //!< get the pixel clock speed from a SETMODE<- bus value
264264#define GET_SETMODE_INVERSE(mode) X_RDBITS(mode,16,1,1) //!< get the inverse video flag from a SETMODE<- bus value
r26354r26355
351351
352352   UINT8 a63 = m_disp_a63[m_dsp.state];
353353   if (A63_HLCGATE(a63)) {
354      /* reset or count horizontal line counters */
355      if (m_dsp.hlc == ALTO2_DISPLAY_HLC_END)
354      // reset or count horizontal line counters
355      m_dsp.hlc += 1;
356      if (m_dsp.hlc == ALTO2_DISPLAY_HLC_END + 1)
356357         m_dsp.hlc = ALTO2_DISPLAY_HLC_START;
357      else
358         m_dsp.hlc++;
359358      /* start the refresh task _twice_ on each scanline */
360359      m_task_wakeup |= 1 << task_mrt;
361360      if (m_ewfct) {
branches/alto2/src/emu/cpu/alto2/a2mem.c
r26354r26355
619619   if (addr < m_mem.size) {
620620      LOG((LOG_MEM,2, "   MAR←; mar = %#o\n", addr));
621621      m_mem.access = ALTO2_MEM_RAM;
622      /* fetch memory double-word to read/write latches */
622      // fetch the memory double-word to the read/write latches
623623      m_mem.rmdd = m_mem.wmdd = m_mem.ram[m_mem.mar/2];
624      // keep track of the current CPU cycle
624625      m_mem.cycle = cycle();
625626   } else {
626627      m_mem.access = ALTO2_MEM_NIRVANA;
r26354r26355
672673#endif
673674
674675   if (m_mem.access & ALTO2_MEM_ODD) {
676      // after reading the odd word, reset the access flag
675677      m_mem.access = ALTO2_MEM_NONE;
676678   } else {
679      // after reading the even word word, toggle access flag (and address) to the odd word
677680      m_mem.mar ^= ALTO2_MEM_ODD;
678681      m_mem.access ^= ALTO2_MEM_ODD;
682      // extend the read succeeds window by one cycle
679683      m_mem.cycle++;
680684   }
681685   return m_mem.md;
r26354r26355
730734#if   ALTO2_DEBUG
731735   watch_write(m_mem.mar, m_mem.md);
732736#endif
733   /* don't reset mem.access to permit double word exchange */
737   // Toggle the odd/even word access flag
738   // NB: don't reset mem.access to permit double word exchange
734739   m_mem.mar ^= ALTO2_MEM_ODD;
735740   m_mem.access ^= ALTO2_MEM_ODD;
741   // extend the write succeeds window by one cycle
736742   m_mem.cycle++;
737743}
738744
r26354r26355
744750 */
745751UINT16 alto2_cpu_device::debug_read_mem(UINT32 addr)
746752{
753   space(AS_2).set_debugger_access(true);
747754   int base_addr = addr & 0177777;
748755   int data = 0177777;
749756   if (base_addr >= ALTO2_IO_PAGE_BASE && addr < ALTO2_RAM_SIZE) {
r26354r26355
751758   } else {
752759      data = (addr & ALTO2_MEM_ODD) ? GET_ODD(m_mem.ram[addr/2]) : GET_EVEN(m_mem.ram[addr/2]);
753760   }
761   space(AS_2).set_debugger_access(false);
754762   return data;
755763}
756764
r26354r26355
762770 */
763771void alto2_cpu_device::debug_write_mem(UINT32 addr, UINT16 data)
764772{
773   space(AS_2).set_debugger_access(true);
765774   int base_addr = addr & 0177777;
766775   if (base_addr >= ALTO2_IO_PAGE_BASE && addr < ALTO2_RAM_SIZE) {
767776      m_iomem->write_word(m_iomem->address_to_byte(base_addr), data);
r26354r26355
770779   } else {
771780      PUT_EVEN(m_mem.ram[addr/2], data);
772781   }
782   space(AS_2).set_debugger_access(false);
773783}
774784
775785/**

Previous 199869 Revisions Next


© 1997-2024 The MAME Team