Example #1
0
void ShowLabels()
{
   SetDlgItemText(dlg, IDC_LABEL_TEXT, curlabel);
   HWND list = GetDlgItem(dlg, IDC_LABELS);

   while (SendMessage(list, LB_GETCOUNT, 0, 0))
      SendMessage(list, LB_DELETESTRING, 0, 0);

   unsigned ln = strlen(curlabel); lcount = 0;
   char *s; //Alone Coder 0.36.7
   for (unsigned p = 0; p < 4; p++)
   {
      u8 *base = am_r(p*PAGE);
      for (unsigned i = 0; i < mon_labels.n_pairs; i++)
      {
         u8 *label = mon_labels.pairs[i].address;
         if (label < base || label >= base + PAGE)
             continue;
         char *name = mon_labels.pairs[i].name_offs + mon_labels.names;
         if (ln)
         {
            // unfortunately, strstr() is case sensitive, use loop
            for (/*char * */s = name; *s; s++)
               if (!strnicmp(s, curlabel, ln)) break;
            if (!*s) continue;
         }
         char zz[0x400];
         sprintf(zz, "%04X %s", (label - base) + (p * PAGE), name);
         SendMessage(list, LB_ADDSTRING, 0, (LPARAM)zz); lcount++;
      }
   }
   SendMessage(list, LB_SETCURSEL, 0, 0);
   SetFocus(list);
}
Example #2
0
void spectrum_frame()
{
   if (!temp.inputblock || input.keymode != K_INPUT::KM_DEFAULT)
      input.make_matrix();

   init_snd_frame();
   init_frame();

   if(cpu.dbgchk)
   {
       cpu.SetDbgMemIf();
       z80dbg::z80loop();
   }
   else
   {
       cpu.SetFastMemIf();
       z80fast::z80loop();
   }
   if (modem.open_port)
       modem.io();

   flush_snd_frame();
   flush_frame();
   showleds();

   if (!cpu.iff1 || // int disabled in CPU
        ((conf.mem_model == MM_ATM710 || conf.mem_model == MM_ATM3) && !(comp.pFF77 & 0x20))) // int disabled by ATM hardware
   {
      unsigned char *mp = am_r(cpu.pc);
      if (cpu.halted)
      {
          strcpy(statusline, "CPU HALTED");
          statcnt = 10;
      }
      if (*(unsigned short*)mp == WORD2(0x18,0xFE) ||
          ((*mp == 0xC3) && *(unsigned short*)(mp+1) == (unsigned short)cpu.pc))
      {
         strcpy(statusline, "CPU STOPPED");
         statcnt = 10;
      }
   }

   comp.t_states += conf.frame;
   cpu.t -= conf.frame;
   cpu.eipos -= conf.frame;
   comp.frame_counter++;
}
Example #3
0
/*
unsigned char TMainZ80::rm(unsigned addr) { return z80fast::rm(addr); }

unsigned char TMainZ80::dbgrm(unsigned addr) { return ::rmdbg(addr); }

void TMainZ80::wm(unsigned addr, unsigned char val) { z80fast::wm(addr, val); }

void TMainZ80::dbgwm(unsigned addr, unsigned char val) { ::wmdbg(addr, val); }
*/
u8 *TMainZ80::DirectMem(unsigned addr) const
{
    return am_r(addr);
}