From: Pokemonhacker <pok...@us...> - 2005-09-03 12:29:32
|
Update of /cvsroot/vba/VisualBoyAdvance/src/win32 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22519 Modified Files: MainWndFile.cpp MapView.cpp MemoryViewerDlg.cpp OamView.cpp PaletteView.cpp TileView.cpp Log Message: SRC : Arm-new.h : - Fixed the clockticks and the bus prefetch emulation. Bios.cpp : - Fixed a bug in void BIOS_BitUnPack(). GBA.cpp : - HBLANK duration now set to 224 ticks. - Added partial clockticks emulation for swi when no bios is used. - Changed the timers handling (and updated the savestate to version 9). - Tweaked the IRQ delay handling ; tweaked the bus prefetch emulation. GBA.h : - Changed the timers handling (and updated the savestate to version 9). GBAinline.h : - Changed the timers handling. Gfx.cpp : - Added 'max number of objects per line' emulation. Gfx.h : - Added 'max number of objects per line' emulation. : - Fixed a display bug (objects overlapping to the right were now shown on the left). thumb.h : - Fixed the clockticks and the bus prefetch emulation. GB : gbCheats.cpp : - Fixed a bug in the code comparison (thx jdratlif). SDL : SDL.cpp : - Made it that the screen is redrawn when you load/save a savestate. WIN32 : MainWndFile.cpp : - Made it that the screen is redrawn when you load/save a savestate. MapView.cpp : - Corrected a crash bug when no rom were loaded. MemoryViewerDlg.cpp : - Corrected a crash bug when no rom were loaded. OamView.cpp : - Corrected a crash bug when no rom were loaded. PaletteView.cpp : - Corrected a crash bug when no rom were loaded. TileView.cpp : - Corrected a crash bug when no rom were loaded. Index: MapView.cpp =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/win32/MapView.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** MapView.cpp 25 Jun 2005 06:23:31 -0000 1.8 --- MapView.cpp 3 Sep 2005 12:29:23 -0000 1.9 *************** *** 999,1033 **** } ! void MapView::OnSave() { ! CString filename; ! if(theApp.captureFormat == 0) ! filename = "map.png"; ! else ! filename = "map.bmp"; ! LPCTSTR exts[] = {".png", ".bmp" }; ! CString filter = theApp.winLoadFilter(IDS_FILTER_PNG); ! CString title = winResLoadString(IDS_SELECT_CAPTURE_NAME); ! FileDlg dlg(this, ! filename, ! filter, ! theApp.captureFormat ? 2 : 1, ! theApp.captureFormat ? "BMP" : "PNG", ! exts, ! "", ! title, ! true); ! if(dlg.DoModal() == IDCANCEL) { ! return; ! } ! if(dlg.getFilterIndex() == 2) ! saveBMP(dlg.GetPathName()); ! else ! savePNG(dlg.GetPathName()); } --- 999,1036 ---- } ! void MapView::OnSave() { ! if(rom != NULL) ! { ! CString filename; ! if(theApp.captureFormat == 0) ! filename = "map.png"; ! else ! filename = "map.bmp"; ! LPCTSTR exts[] = {".png", ".bmp" }; ! CString filter = theApp.winLoadFilter(IDS_FILTER_PNG); ! CString title = winResLoadString(IDS_SELECT_CAPTURE_NAME); ! FileDlg dlg(this, ! filename, ! filter, ! theApp.captureFormat ? 2 : 1, ! theApp.captureFormat ? "BMP" : "PNG", ! exts, ! "", ! title, ! true); ! if(dlg.DoModal() == IDCANCEL) { ! return; ! } ! if(dlg.getFilterIndex() == 2) ! saveBMP(dlg.GetPathName()); ! else ! savePNG(dlg.GetPathName()); ! } } Index: MainWndFile.cpp =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/win32/MainWndFile.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** MainWndFile.cpp 25 Jun 2005 06:23:31 -0000 1.10 --- MainWndFile.cpp 3 Sep 2005 12:29:23 -0000 1.11 *************** *** 38,41 **** --- 38,42 ---- extern void remoteCleanUp(); + extern void InterframeCleanup(); void MainWnd::OnFileOpen() *************** *** 255,269 **** filename.Format("%s\\%s%d.sgm", saveDir, buffer, nID); bool res = loadSaveGame(filename); theApp.rewindCount = 0; theApp.rewindCounter = 0; theApp.rewindSaveNeeded = false; ! ! CString format = winResLoadString(IDS_LOADED_STATE_N); ! buffer.Format(format, nID); ! ! systemScreenMessage(buffer); ! return res; } --- 256,275 ---- filename.Format("%s\\%s%d.sgm", saveDir, buffer, nID); + CString format = winResLoadString(IDS_LOADED_STATE_N); + buffer.Format(format, nID); + bool res = loadSaveGame(filename); + if (theApp.paused) + InterframeCleanup(); + + systemScreenMessage(buffer); + + systemDrawScreen(); + theApp.rewindCount = 0; theApp.rewindCounter = 0; theApp.rewindSaveNeeded = false; ! return res; } *************** *** 340,343 **** --- 346,351 ---- systemScreenMessage(buffer); + + systemDrawScreen(); return res; Index: OamView.cpp =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/win32/OamView.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** OamView.cpp 13 May 2004 15:06:55 -0000 1.4 --- OamView.cpp 3 Sep 2005 12:29:23 -0000 1.5 *************** *** 464,498 **** void OamView::OnSave() { ! CString captureBuffer; ! if(theApp.captureFormat == 0) ! captureBuffer = "oam.png"; ! else ! captureBuffer = "oam.bmp"; ! LPCTSTR exts[] = {".png", ".bmp" }; ! CString filter = theApp.winLoadFilter(IDS_FILTER_PNG); ! CString title = winResLoadString(IDS_SELECT_CAPTURE_NAME); ! FileDlg dlg(this, ! captureBuffer, ! filter, ! theApp.captureFormat ? 2 : 1, ! theApp.captureFormat ? "BMP" : "PNG", ! exts, ! "", ! title, ! true); ! if(dlg.DoModal() == IDCANCEL) { ! return; ! } ! captureBuffer = dlg.GetPathName(); ! if(dlg.getFilterIndex() == 2) ! saveBMP(captureBuffer); ! else ! savePNG(captureBuffer); } --- 464,501 ---- void OamView::OnSave() { ! if(rom != NULL) ! { ! CString captureBuffer; ! if(theApp.captureFormat == 0) ! captureBuffer = "oam.png"; ! else ! captureBuffer = "oam.bmp"; ! LPCTSTR exts[] = {".png", ".bmp" }; ! CString filter = theApp.winLoadFilter(IDS_FILTER_PNG); ! CString title = winResLoadString(IDS_SELECT_CAPTURE_NAME); ! FileDlg dlg(this, ! captureBuffer, ! filter, ! theApp.captureFormat ? 2 : 1, ! theApp.captureFormat ? "BMP" : "PNG", ! exts, ! "", ! title, ! true); ! if(dlg.DoModal() == IDCANCEL) { ! return; ! } ! captureBuffer = dlg.GetPathName(); ! if(dlg.getFilterIndex() == 2) ! saveBMP(captureBuffer); ! else ! savePNG(captureBuffer); ! } } Index: MemoryViewerDlg.cpp =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/win32/MemoryViewerDlg.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** MemoryViewerDlg.cpp 13 May 2004 15:06:55 -0000 1.4 --- MemoryViewerDlg.cpp 3 Sep 2005 12:29:23 -0000 1.5 *************** *** 321,363 **** void MemoryViewerDlg::OnSave() { ! MemoryViewerAddressSize dlg; ! CString buffer; ! dlg.setAddress(m_viewer.getCurrentAddress()); ! LPCTSTR exts[] = { ".dmp" }; ! if(dlg.DoModal() == IDOK) { ! CString filter = theApp.winLoadFilter(IDS_FILTER_DUMP); ! CString title = winResLoadString(IDS_SELECT_DUMP_FILE); ! FileDlg file(this, ! buffer, ! filter, ! 0, ! "DMP", ! exts, ! "", ! title, ! true); ! if(file.DoModal() == IDOK) { ! buffer = file.GetPathName(); ! FILE *f = fopen(buffer, "wb"); ! if(f == NULL) { ! systemMessage(IDS_ERROR_CREATING_FILE, buffer); ! return; ! } ! int size = dlg.getSize(); ! u32 addr = dlg.getAddress(); ! for(int i = 0; i < size; i++) { ! fputc(CPUReadByteQuick(addr), f); ! addr++; ! } ! fclose(f); } } --- 321,366 ---- void MemoryViewerDlg::OnSave() { ! if(rom != NULL) ! { ! MemoryViewerAddressSize dlg; ! CString buffer; ! dlg.setAddress(m_viewer.getCurrentAddress()); ! LPCTSTR exts[] = { ".dmp" }; ! if(dlg.DoModal() == IDOK) { ! CString filter = theApp.winLoadFilter(IDS_FILTER_DUMP); ! CString title = winResLoadString(IDS_SELECT_DUMP_FILE); ! FileDlg file(this, ! buffer, ! filter, ! 0, ! "DMP", ! exts, ! "", ! title, ! true); ! if(file.DoModal() == IDOK) { ! buffer = file.GetPathName(); ! FILE *f = fopen(buffer, "wb"); ! if(f == NULL) { ! systemMessage(IDS_ERROR_CREATING_FILE, buffer); ! return; ! } ! int size = dlg.getSize(); ! u32 addr = dlg.getAddress(); ! for(int i = 0; i < size; i++) { ! fputc(CPUReadByteQuick(addr), f); ! addr++; ! } ! fclose(f); ! } } } *************** *** 366,420 **** void MemoryViewerDlg::OnLoad() { ! CString buffer; ! LPCTSTR exts[] = { ".dmp" }; ! CString filter = theApp.winLoadFilter(IDS_FILTER_DUMP); ! CString title = winResLoadString(IDS_SELECT_DUMP_FILE); ! FileDlg file(this, ! buffer, ! filter, ! 0, ! "DMP", ! exts, ! "", ! title, ! false); ! if(file.DoModal() == IDOK) { ! buffer = file.GetPathName(); ! FILE *f = fopen(buffer, "rb"); ! if(f == NULL) { ! systemMessage(IDS_CANNOT_OPEN_FILE, ! "Cannot open file %s", ! buffer); ! return; ! } ! MemoryViewerAddressSize dlg; ! fseek(f, 0, SEEK_END); ! int size = ftell(f); ! fseek(f, 0, SEEK_SET); ! dlg.setAddress(m_viewer.getCurrentAddress()); ! dlg.setSize(size); ! if(dlg.DoModal() == IDOK) { ! int size = dlg.getSize(); ! u32 addr = dlg.getAddress(); ! for(int i = 0; i < size; i++) { ! int c = fgetc(f); ! if(c == -1) ! break; ! CPUWriteByteQuick(addr, c); ! addr++; } ! OnRefresh(); } ! fclose(f); ! } } --- 369,426 ---- void MemoryViewerDlg::OnLoad() { ! if(rom != NULL) ! { ! CString buffer; ! LPCTSTR exts[] = { ".dmp" }; ! CString filter = theApp.winLoadFilter(IDS_FILTER_DUMP); ! CString title = winResLoadString(IDS_SELECT_DUMP_FILE); ! FileDlg file(this, ! buffer, ! filter, ! 0, ! "DMP", ! exts, ! "", ! title, ! false); ! if(file.DoModal() == IDOK) { ! buffer = file.GetPathName(); ! FILE *f = fopen(buffer, "rb"); ! if(f == NULL) { ! systemMessage(IDS_CANNOT_OPEN_FILE, ! "Cannot open file %s", ! buffer); ! return; ! } ! MemoryViewerAddressSize dlg; ! fseek(f, 0, SEEK_END); ! int size = ftell(f); ! fseek(f, 0, SEEK_SET); ! dlg.setAddress(m_viewer.getCurrentAddress()); ! dlg.setSize(size); ! if(dlg.DoModal() == IDOK) { ! int size = dlg.getSize(); ! u32 addr = dlg.getAddress(); ! for(int i = 0; i < size; i++) { ! int c = fgetc(f); ! if(c == -1) ! break; ! CPUWriteByteQuick(addr, c); ! addr++; ! } ! OnRefresh(); } ! fclose(f); } ! } } Index: TileView.cpp =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/win32/TileView.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TileView.cpp 13 May 2004 15:06:55 -0000 1.2 --- TileView.cpp 3 Sep 2005 12:29:23 -0000 1.3 *************** *** 266,301 **** void TileView::OnSave() { ! CString captureBuffer; ! if(theApp.captureFormat == 0) ! captureBuffer = "tiles.png"; ! else ! captureBuffer = "tiles.bmp"; ! LPCTSTR exts[] = {".png", ".bmp" }; ! CString filter = theApp.winLoadFilter(IDS_FILTER_PNG); ! CString title = winResLoadString(IDS_SELECT_CAPTURE_NAME); ! FileDlg dlg(this, ! captureBuffer, ! filter, ! theApp.captureFormat ? 2 : 1, ! theApp.captureFormat ? "BMP" : "PNG", ! exts, ! "", ! title, ! true); ! if(dlg.DoModal() == IDCANCEL) { ! return; ! } ! captureBuffer = dlg.GetPathName(); ! if(dlg.getFilterIndex() == 2) ! saveBMP(captureBuffer); ! else ! savePNG(captureBuffer); } --- 266,304 ---- void TileView::OnSave() { ! if(rom != NULL) ! { ! CString captureBuffer; ! if(theApp.captureFormat == 0) ! captureBuffer = "tiles.png"; ! else ! captureBuffer = "tiles.bmp"; ! LPCTSTR exts[] = {".png", ".bmp" }; ! CString filter = theApp.winLoadFilter(IDS_FILTER_PNG); ! CString title = winResLoadString(IDS_SELECT_CAPTURE_NAME); ! FileDlg dlg(this, ! captureBuffer, ! filter, ! theApp.captureFormat ? 2 : 1, ! theApp.captureFormat ? "BMP" : "PNG", ! exts, ! "", ! title, ! true); ! if(dlg.DoModal() == IDCANCEL) { ! return; ! } ! captureBuffer = dlg.GetPathName(); ! if(dlg.getFilterIndex() == 2) ! saveBMP(captureBuffer); ! else ! savePNG(captureBuffer); ! } } Index: PaletteView.cpp =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/win32/PaletteView.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** PaletteView.cpp 31 Oct 2004 18:25:40 -0000 1.5 --- PaletteView.cpp 3 Sep 2005 12:29:23 -0000 1.6 *************** *** 110,158 **** void PaletteView::save(int which) { ! CString captureBuffer; ! if(which == 0) ! captureBuffer = "bg.pal"; ! else ! captureBuffer = "obj.pal"; ! LPCTSTR exts[] = {".pal", ".pal", ".act" }; ! CString filter = theApp.winLoadFilter(IDS_FILTER_PAL); ! CString title = winResLoadString(IDS_SELECT_PALETTE_NAME); ! FileDlg dlg(this, ! captureBuffer, ! filter, ! 1, ! "PAL", ! exts, ! "", ! title, ! true); ! if(dlg.DoModal() == IDCANCEL) { ! return; ! } ! captureBuffer = dlg.GetPathName(); ! PaletteViewControl *p = NULL; ! if(which == 0) ! p = &paletteView; ! else ! p = &paletteViewOBJ; ! switch(dlg.getFilterIndex()) { ! case 0: ! case 1: ! p->saveMSPAL(captureBuffer); ! break; ! case 2: ! p->saveJASCPAL(captureBuffer); ! break; ! case 3: ! p->saveAdobe(captureBuffer); ! break; } } --- 110,161 ---- void PaletteView::save(int which) { ! if(rom != NULL) ! { ! CString captureBuffer; ! if(which == 0) ! captureBuffer = "bg.pal"; ! else ! captureBuffer = "obj.pal"; ! LPCTSTR exts[] = {".pal", ".pal", ".act" }; ! CString filter = theApp.winLoadFilter(IDS_FILTER_PAL); ! CString title = winResLoadString(IDS_SELECT_PALETTE_NAME); ! FileDlg dlg(this, ! captureBuffer, ! filter, ! 1, ! "PAL", ! exts, ! "", ! title, ! true); ! if(dlg.DoModal() == IDCANCEL) { ! return; ! } ! captureBuffer = dlg.GetPathName(); ! PaletteViewControl *p = NULL; ! if(which == 0) ! p = &paletteView; ! else ! p = &paletteViewOBJ; ! switch(dlg.getFilterIndex()) { ! case 0: ! case 1: ! p->saveMSPAL(captureBuffer); ! break; ! case 2: ! p->saveJASCPAL(captureBuffer); ! break; ! case 3: ! p->saveAdobe(captureBuffer); ! break; ! } } } |