From: Pokemonhacker <pok...@us...> - 2006-01-04 13:43:16
|
Update of /cvsroot/vba/VisualBoyAdvance/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9247 Modified Files: bios.cpp GBA.cpp GBAinline.h RTC.cpp Log Message: - bios.cpp : corrected a bug in registerRamReset. - gba.cpp/gbainline.h : corrected the mirroring of Vram. - gba.cpp : changed slightly the emulation of gbasavetype. - RTC.cpp : vba now ignores rtc command 0x64. Index: bios.cpp =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/bios.cpp,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** bios.cpp 3 Sep 2005 12:28:23 -0000 1.18 --- bios.cpp 4 Jan 2006 13:42:58 -0000 1.19 *************** *** 869,872 **** --- 869,874 ---- // no need to trace here. this is only called directly from GBA.cpp // to emulate bios initialization + + CPUUpdateRegister(0x0, 0x80); if(flags) { *************** *** 894,909 **** if(flags & 0x80) { int i; ! for(i = 0; i < 8; i++) CPUUpdateRegister(0x200+i*2, 0); ! CPUUpdateRegister(0x202, 0xFFFF); ! ! for(i = 0; i < 8; i++) CPUUpdateRegister(0x4+i*2, 0); ! for(i = 0; i < 16; i++) CPUUpdateRegister(0x20+i*2, 0); ! for(i = 0; i < 24; i++) CPUUpdateRegister(0xb0+i*2, 0); --- 896,909 ---- if(flags & 0x80) { int i; ! for(i = 0; i < 0x10; i++) CPUUpdateRegister(0x200+i*2, 0); ! for(i = 0; i < 0xF; i++) CPUUpdateRegister(0x4+i*2, 0); ! for(i = 0; i < 0x20; i++) CPUUpdateRegister(0x20+i*2, 0); ! for(i = 0; i < 0x18; i++) CPUUpdateRegister(0xb0+i*2, 0); Index: GBA.cpp =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/GBA.cpp,v retrieving revision 1.63 retrieving revision 1.64 diff -C2 -d -r1.63 -r1.64 *** GBA.cpp 3 Sep 2005 12:28:23 -0000 1.63 --- GBA.cpp 4 Jan 2006 13:42:58 -0000 1.64 *************** *** 1036,1039 **** --- 1036,1042 ---- gbaSaveType = 2; break; + case 5: + gbaSaveType = 5; + break; default: systemMessage(MSG_UNSUPPORTED_SAVE_TYPE, *************** *** 1121,1125 **** } ! if(gbaSaveType) { FILE *file = fopen(fileName, "wb"); --- 1124,1128 ---- } ! if((gbaSaveType) && (gbaSaveType!=5)) { FILE *file = fopen(fileName, "wb"); *************** *** 3172,3177 **** break; case 6: ! if ((address & 0xFFFFFF) < 0x18000) ! WRITE16LE(((u16 *)&vram[address & 0x1fffe]), value); break; case 7: --- 3175,3184 ---- break; case 6: ! address = (address & 0x1fffe); ! if (((DISPCNT & 7) >2) && ((address & 0x1C000) == 0x18000)) ! return; ! if ((address & 0x18000) == 0x18000) ! address &= 0x17fff; ! WRITE16LE(((u16 *)&vram[address]), value); break; case 7: *************** *** 3300,3307 **** break; case 6: // no need to switch // byte writes to OBJ VRAM are ignored ! if ((address & 0xFFFFFF) < objTilesAddress[((DISPCNT&7)+1)>>2]) ! *((u16 *)&vram[address & 0x1FFFE]) = (b << 8) | b; break; case 7: --- 3307,3320 ---- break; case 6: + address = (address & 0x1fffe); + if (((DISPCNT & 7) >2) && ((address & 0x1C000) == 0x18000)) + return; + if ((address & 0x18000) == 0x18000) + address &= 0x17fff; + // no need to switch // byte writes to OBJ VRAM are ignored ! if ((address) < objTilesAddress[((DISPCNT&7)+1)>>2]) ! *((u16 *)&vram[address]) = (b << 8) | b; break; case 7: *************** *** 3317,3321 **** goto unwritable; case 14: ! if(!eepromInUse | cpuSramEnabled | cpuFlashEnabled) { (*cpuSaveGameFunc)(address, b); break; --- 3330,3337 ---- goto unwritable; case 14: ! if (!(saveType == 5) && (!eepromInUse | cpuSramEnabled | cpuFlashEnabled)) { ! ! //if(!cpuEEPROMEnabled && (cpuSramEnabled | cpuFlashEnabled)) { ! (*cpuSaveGameFunc)(address, b); break; *************** *** 3721,3724 **** --- 3737,3742 ---- } + saveType = gbaSaveType = cpuSaveType; + ARM_PREFETCH; Index: GBAinline.h =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/GBAinline.h,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** GBAinline.h 30 Sep 2005 16:06:32 -0000 1.14 --- GBAinline.h 4 Jan 2006 13:42:59 -0000 1.15 *************** *** 102,106 **** break; case 6: ! value = READ32LE(((u32 *)&vram[address & 0x1fffc])); break; case 7: --- 102,114 ---- break; case 6: ! address = (address & 0x1fffc); ! if (((DISPCNT & 7) >2) && ((address & 0x1C000) == 0x18000)) ! { ! value = 0; ! break; ! } ! if ((address & 0x18000) == 0x18000) ! address &= 0x17fff; ! value = READ32LE(((u32 *)&vram[address])); break; case 7: *************** *** 230,234 **** break; case 6: ! value = READ16LE(((u16 *)&vram[address & 0x1fffe])); break; case 7: --- 238,250 ---- break; case 6: ! address = (address & 0x1fffe); ! if (((DISPCNT & 7) >2) && ((address & 0x1C000) == 0x18000)) ! { ! value = 0; ! break; ! } ! if ((address & 0x18000) == 0x18000) ! address &= 0x17fff; ! value = READ16LE(((u16 *)&vram[address])); break; case 7: *************** *** 317,321 **** return paletteRAM[address & 0x3ff]; case 6: ! return vram[address & 0x1ffff]; case 7: return oam[address & 0x3ff]; --- 333,342 ---- return paletteRAM[address & 0x3ff]; case 6: ! address = (address & 0x1ffff); ! if (((DISPCNT & 7) >2) && ((address & 0x1C000) == 0x18000)) ! return 0; ! if ((address & 0x18000) == 0x18000) ! address &= 0x17fff; ! return vram[address]; case 7: return oam[address & 0x3ff]; *************** *** 372,376 **** if(address & 3) { if(systemVerbose & VERBOSE_UNALIGNED_MEMORY) { ! log("Unaliagned word write: %08x to %08x from %08x\n", value, address, --- 393,397 ---- if(address & 3) { if(systemVerbose & VERBOSE_UNALIGNED_MEMORY) { ! log("Unaligned word write: %08x to %08x from %08x\n", value, address, *************** *** 409,416 **** break; case 0x06: ! if(address & 0x10000) ! WRITE32LE(((u32 *)&vram[address & 0x17ffc]), value); ! else ! WRITE32LE(((u32 *)&vram[address & 0x1fffc]), value); break; case 0x07: --- 430,439 ---- break; case 0x06: ! address = (address & 0x1fffc); ! if (((DISPCNT & 7) >2) && ((address & 0x1C000) == 0x18000)) ! return; ! if ((address & 0x18000) == 0x18000) ! address &= 0x17fff; ! WRITE32LE(((u32 *)&vram[address]), value); break; case 0x07: Index: RTC.cpp =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/RTC.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** RTC.cpp 13 Oct 2004 21:07:03 -0000 1.8 --- RTC.cpp 4 Jan 2006 13:42:59 -0000 1.9 *************** *** 1,5 **** // VisualBoyAdvance - Nintendo Gameboy/GameboyAdvance (TM) emulator. // Copyright (C) 1999-2003 Forgotten ! // Copyright (C) 2004 Forgotten and the VBA development team // This program is free software; you can redistribute it and/or modify --- 1,5 ---- // VisualBoyAdvance - Nintendo Gameboy/GameboyAdvance (TM) emulator. // Copyright (C) 1999-2003 Forgotten ! // Copyright (C) 2005 Forgotten and the VBA development team // This program is free software; you can redistribute it and/or modify *************** *** 120,123 **** --- 120,125 ---- rtcClockData.state = DATA; break; + case 0x64: + break; case 0x65: { |