sprintf(buffer, "0x%08X", screenBase); ::SetWindowText(GetDlgItem(IDC_MAPBASE), buffer);
buffer.Format("0x%08X", screenBase); m_mapbase.SetWindowText(buffer);
void MapView::paint(){  if(vram == NULL)    return;  int mode = DISPCNT & 7;  switch(bg) {  default:  case 0:    control = BG0CNT;    break;  case 1:    control = BG1CNT;    break;  case 2:    control = BG2CNT;    break;  case 3:    control = BG3CNT;    break;  }    switch(mode) {  case 0:    renderMode0();    break;  case 1:    renderMode1();    break;  case 2:    renderMode2();    break;  case 3:    renderMode3();    break;  case 4:    renderMode4();    break;  case 5:    renderMode5();    break;  }  enableButtons(mode);  SIZE s;  mapView.GetScrollSize(s);  if(s.cx != w || s.cy != h)    mapView.setSize(w, h);  if(mapView.getStretch())    mapView.SetScrollSize(1,1);  mapView.refresh();  char buffer[32];    u32 charBase = ((control >> 2) & 0x03) * 0x4000 + 0x6000000;  u32 screenBase = ((control >> 8) & 0x1f) * 0x800 + 0x6000000;    sprintf(buffer, "%d", mode);  ::SetWindowText(GetDlgItem(IDC_MODE), buffer);  if(mode >= 3) {    ::SetWindowText(GetDlgItem(IDC_MAPBASE), "");    ::SetWindowText(GetDlgItem(IDC_CHARBASE), "");  } else {    sprintf(buffer, "0x%08X", screenBase);    ::SetWindowText(GetDlgItem(IDC_MAPBASE), buffer);        sprintf(buffer, "0x%08X", charBase);    ::SetWindowText(GetDlgItem(IDC_CHARBASE), buffer);  }  sprintf(buffer, "%dx%d", w, h);  ::SetWindowText(GetDlgItem(IDC_DIM), buffer);  ::SetWindowText(GetDlgItem(IDC_NUMCOLORS), control & 0x80 ? "256" : "16");  sprintf(buffer, "%d", control & 3);  ::SetWindowText(GetDlgItem(IDC_PRIORITY), buffer);  ::SetWindowText(GetDlgItem(IDC_MOSAIC), control & 0x40 ? "1" : "0");  ::SetWindowText(GetDlgItem(IDC_OVERFLOW), bg <= 1 ? "" :                  control & 0x2000 ? "1" : "0");}