From: Pokemonhacker <pok...@us...> - 2006-01-04 13:39:01
|
Update of /cvsroot/vba/VisualBoyAdvance/src/gb In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7893 Modified Files: GB.cpp GB.h gbCheats.cpp gbCodes.h gbCodesCB.h gbGfx.cpp gbGlobals.cpp gbGlobals.h gbMemory.cpp gbSGB.cpp gbSound.cpp Log Message: - GB/GBC 'experimental' changes (too many to be listed right now...). Still not 100% perfect, but almost every known bug have been corrected. Index: gbCodes.h =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/gb/gbCodes.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** gbCodes.h 13 May 2004 15:06:46 -0000 1.6 --- gbCodes.h 4 Jan 2006 13:38:47 -0000 1.7 *************** *** 2,6 **** // 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 --- 2,6 ---- // 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 *************** *** 103,107 **** --- 103,109 ---- if(gbCgbMode) { if(gbMemory[0xff4d] & 1) { + gbSpeedSwitch(); + //clockTicks += 228*144-(gbSpeed ? 62 : 63); if(gbSpeed == 0) *************** *** 576,590 **** case 0x76: // HALT - if(IFF & 1) { - PC.W--; IFF |= 0x80; ! } else { ! if((register_IE & register_IF) > 0) ! IFF |= 0x100; ! else { ! PC.W--; ! IFF |= 0x81; ! } ! } break; case 0x77: --- 578,585 ---- case 0x76: // HALT IFF |= 0x80; ! // Takes longer to get out of Halt depending on the gbHardware ??? ! if (gbHardware & 5) ! clockTicks++; break; case 0x77: *************** *** 1337,1341 **** // DI // IFF&=0xFE; ! IFF&=(~0x21); break; // F4 illegal --- 1332,1336 ---- // DI // IFF&=0xFE; ! IFF&=(~0x31); break; // F4 illegal *************** *** 1384,1389 **** case 0xfb: // EI ! IFF|=0x20; break; // FC illegal // FD illegal --- 1379,1388 ---- case 0xfb: // EI ! if (!(IFF & 0x30)) ! IFF|=0x20; break; + case 0xfc: + case 0xfd: + breakpoint = true; // FC illegal // FD illegal *************** *** 1402,1407 **** break; default: ! systemMessage(0, N_("Unknown opcode %02x at %04x"), ! gbReadOpcode(PC.W-1),PC.W-1); ! emulating = false; return; --- 1401,1409 ---- break; default: ! if (gbSystemMessage == false) ! { ! systemMessage(0, N_("Unknown opcode %02x at %04x"), ! gbReadOpcode(PC.W-1),PC.W-1); ! gbSystemMessage =true; ! } return; Index: gbGlobals.cpp =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/gb/gbGlobals.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** gbGlobals.cpp 13 May 2004 15:06:46 -0000 1.5 --- gbGlobals.cpp 4 Jan 2006 13:38:47 -0000 1.6 *************** *** 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 *************** *** 39,42 **** --- 39,43 ---- int gbWindowLine = -1; + bool genericflashcardEnable = false; int gbCgbMode = 0; Index: gbMemory.cpp =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/gb/gbMemory.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** gbMemory.cpp 13 May 2004 15:06:46 -0000 1.3 --- gbMemory.cpp 4 Jan 2006 13:38:47 -0000 1.4 *************** *** 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 *************** *** 42,47 **** case 0x2000: // ROM bank select // value = value & 0x1f; ! if(value == 0) ! value = 1; if(value == gbDataMBC1.mapperROMBank) break; --- 42,47 ---- case 0x2000: // ROM bank select // value = value & 0x1f; ! if((value & 0x1f) == 0) ! value += 1; if(value == gbDataMBC1.mapperROMBank) break; *************** *** 52,56 **** if(gbDataMBC1.mapperMemoryModel == 0) { // model is 16/8, so we have a high address in use ! tmpAddress |= (gbDataMBC1.mapperROMHighAddress) << 19; } --- 52,56 ---- if(gbDataMBC1.mapperMemoryModel == 0) { // model is 16/8, so we have a high address in use ! tmpAddress |= (gbDataMBC1.mapperROMHighAddress & 3) << 19; } *************** *** 74,77 **** --- 74,78 ---- gbDataMBC1.mapperRAMBank = value; gbDataMBC1.mapperRAMAddress = tmpAddress; + gbDataMBC1.mapperROMHighAddress = 0; } else { // 16/8, set the high address *************** *** 84,91 **** --- 85,131 ---- gbMemoryMap[0x06] = &gbRom[tmpAddress + 0x2000]; gbMemoryMap[0x07] = &gbRom[tmpAddress + 0x3000]; + + gbMemoryMap[0x0a] = &gbRam[0]; + gbMemoryMap[0x0b] = &gbRam[0x1000]; + gbDataMBC1.mapperRAMBank = 0; } break; case 0x6000: // memory model select gbDataMBC1.mapperMemoryModel = value & 1; + + if(gbDataMBC1.mapperMemoryModel == 1) { + // 4/32 model, RAM bank switching provided + value = gbDataMBC1.mapperRAMBank & 0x03; + tmpAddress = value << 13; + tmpAddress &= gbRamSizeMask; + gbMemoryMap[0x0a] = &gbRam[tmpAddress]; + gbMemoryMap[0x0b] = &gbRam[tmpAddress + 0x1000]; + gbDataMBC1.mapperRAMBank = value; + gbDataMBC1.mapperRAMAddress = tmpAddress; + + tmpAddress = gbDataMBC1.mapperROMBank << 14; + + + tmpAddress &= gbRomSizeMask; + gbMemoryMap[0x04] = &gbRom[tmpAddress]; + gbMemoryMap[0x05] = &gbRom[tmpAddress + 0x1000]; + gbMemoryMap[0x06] = &gbRom[tmpAddress + 0x2000]; + gbMemoryMap[0x07] = &gbRom[tmpAddress + 0x3000]; + + } else { + // 16/8, set the high address + + tmpAddress = gbDataMBC1.mapperROMBank << 14; + tmpAddress |= (gbDataMBC1.mapperROMHighAddress) << 19; + tmpAddress &= gbRomSizeMask; + gbMemoryMap[0x04] = &gbRom[tmpAddress]; + gbMemoryMap[0x05] = &gbRom[tmpAddress + 0x1000]; + gbMemoryMap[0x06] = &gbRom[tmpAddress + 0x2000]; + gbMemoryMap[0x07] = &gbRom[tmpAddress + 0x3000]; + + gbMemoryMap[0x0a] = &gbRam[0]; + gbMemoryMap[0x0b] = &gbRam[0x1000]; + + } break; } *************** *** 108,115 **** // check current model ! if(gbDataMBC1.mapperMemoryModel == 1) { // model is 16/8, so we have a high address in use tmpAddress |= (gbDataMBC1.mapperROMHighAddress) << 19; } tmpAddress &= gbRomSizeMask; --- 148,157 ---- // check current model ! if(gbDataMBC1.mapperMemoryModel == 0) { // model is 16/8, so we have a high address in use tmpAddress |= (gbDataMBC1.mapperROMHighAddress) << 19; } + gbMemoryMap[0x0a] = &gbRam[0]; + gbMemoryMap[0x0b] = &gbRam[0x1000]; tmpAddress &= gbRomSizeMask; *************** *** 119,123 **** gbMemoryMap[0x07] = &gbRom[tmpAddress + 0x3000]; ! if(gbRamSize) { gbMemoryMap[0x0a] = &gbRam[gbDataMBC1.mapperRAMAddress]; gbMemoryMap[0x0b] = &gbRam[gbDataMBC1.mapperRAMAddress + 0x1000]; --- 161,165 ---- gbMemoryMap[0x07] = &gbRom[tmpAddress + 0x3000]; ! if((gbRamSize) && (gbDataMBC1.mapperMemoryModel == 1)){ gbMemoryMap[0x0a] = &gbRam[gbDataMBC1.mapperRAMAddress]; gbMemoryMap[0x0b] = &gbRam[gbDataMBC1.mapperRAMAddress + 0x1000]; Index: gbGlobals.h =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/gb/gbGlobals.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** gbGlobals.h 13 May 2004 15:06:46 -0000 1.4 --- gbGlobals.h 4 Jan 2006 13:38:47 -0000 1.5 *************** *** 2,6 **** // 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 --- 2,6 ---- // 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 *************** *** 47,50 **** --- 47,60 ---- extern u8 gbObp1[4]; extern u16 gbPalette[128]; + extern bool gbScreenOn; + extern u8 gbSCYLine[190]; + // gbSCXLine is used for the emulation (bug) of the SX change + // found in the Artic Zone game. + extern u8 gbSCXLine[190]; + // gbBgpLine is used for the emulation of the + // Prehistorik Man's title screen scroller. + extern u8 gbBgpLine[190]; + extern u8 gbObp0Line [190]; + extern u8 gbObp1Line [190]; extern u8 register_LCDC; *************** *** 55,60 **** --- 65,72 ---- extern u8 register_WX; extern u8 register_VBK; + extern u8 oldRegister_WY; extern int emulating; + extern bool genericflashcardEnable; extern int gbBorderLineSkip; *************** *** 64,68 **** extern void gbRenderLine(); ! extern void gbDrawSprites(); extern u8 (*gbSerialFunction)(u8); --- 76,80 ---- extern void gbRenderLine(); ! extern int gbDrawSprites(bool); extern u8 (*gbSerialFunction)(u8); Index: gbCodesCB.h =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/gb/gbCodesCB.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** gbCodesCB.h 13 May 2004 15:06:46 -0000 1.3 --- gbCodesCB.h 4 Jan 2006 13:38:47 -0000 1.4 *************** *** 2,6 **** // 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 --- 2,6 ---- // 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 *************** *** 1283,1288 **** break; default: ! systemMessage(0, N_("Unknown opcode %02x at %04x"), ! gbReadOpcode(PC.W-1),PC.W-1); ! emulating = false; return; --- 1283,1291 ---- break; default: ! if (gbSystemMessage == false) ! { ! systemMessage(0, N_("Unknown opcode %02x at %04x"), ! gbReadOpcode(PC.W-1),PC.W-1); ! gbSystemMessage =true; ! } return; Index: GB.h =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/gb/GB.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** GB.h 13 May 2004 15:06:46 -0000 1.5 --- GB.h 4 Jan 2006 13:38:47 -0000 1.6 *************** *** 2,6 **** // 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 --- 2,6 ---- // 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 *************** *** 39,42 **** --- 39,43 ---- extern bool gbLoadRom(const char *); extern void gbEmulate(int); + extern void gbDrawLine(); extern bool gbIsGameboyRom(const char *); extern void gbSoundReset(); Index: gbSound.cpp =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/gb/gbSound.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** gbSound.cpp 13 May 2004 15:06:46 -0000 1.7 --- gbSound.cpp 4 Jan 2006 13:38:47 -0000 1.8 *************** *** 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 *************** *** 223,226 **** --- 223,227 ---- break; case NR30: + gbMemory[NR30] = data; if(!(data & 0x80)) { gbMemory[NR52] &= 0xfb; *************** *** 242,245 **** --- 243,247 ---- break; case NR34: + gbMemory[NR34] = data; freq = 2048 - (((data &7) << 8) | (int)gbMemory[NR33]); if(freq) { Index: gbGfx.cpp =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/gb/gbGfx.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** gbGfx.cpp 13 May 2004 15:06:46 -0000 1.6 --- gbGfx.cpp 4 Jan 2006 13:38:47 -0000 1.7 *************** *** 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 *************** *** 59,62 **** --- 59,63 ---- u16 gbLineMix[160]; + int inUseRegister_WY = 0; void gbRenderLine() *************** *** 89,94 **** // int yLine = (y + gbBorderRowSkip) * gbBorderLineSkip; ! int sx = register_SCX; ! int sy = register_SCY; sy+=y; --- 90,95 ---- // int yLine = (y + gbBorderRowSkip) * gbBorderLineSkip; ! int sx = gbSCXLine[0]; ! int sy = gbSCYLine[0]; sy+=y; *************** *** 114,121 **** tile_map_address++; ! if((register_LCDC & 16) == 0) { ! if(tile < 128) tile += 128; ! else tile -= 128; ! } int tile_pattern_address = tile_pattern + tile * 16 + by*2; --- 115,120 ---- tile_map_address++; ! if(!(register_LCDC & 0x10)) ! tile ^= 0x80; int tile_pattern_address = tile_pattern + tile * 16 + by*2; *************** *** 124,127 **** --- 123,146 ---- if((register_LCDC & 0x01 || gbCgbMode) && (layerSettings & 0x0100)) { while(x < 160) { + + tx = (tx-(sx >> 3) + (gbSCXLine[x]>>3)) & 0x1f; + + sx = gbSCXLine[x]; + + + sy = gbSCYLine[x+(gbSpeed ? 15 : 7)]; + + sy+=y; + + sy &= 255; + + ty = sy >> 3; + + by = sy & 7; + + tile_map_line_y = tile_map + ty * 32; + + tile_map_address = tile_map_line_y + tx; + u8 tile_a = 0; u8 tile_b = 0; *************** *** 156,160 **** c = c + (attrs & 7)*4; } else { ! c = gbBgp[c]; if(gbSgbMode && !gbCgbMode) { int dx = x >> 3; --- 175,179 ---- c = c + (attrs & 7)*4; } else { ! c = (gbBgpLine[x+3]>>(c<<1)) &3; if(gbSgbMode && !gbCgbMode) { int dx = x >> 3; *************** *** 169,174 **** } } ! gbLineMix[x] = gbColorOption ? gbColorFilter[gbPalette[c]] : ! gbPalette[c]; x++; if(x >= 160) --- 188,193 ---- } } ! gbLineMix[x] = gbColorOption ? gbColorFilter[gbPalette[c] & 0x7FFF] : ! gbPalette[c] & 0x7FFF; x++; if(x >= 160) *************** *** 186,198 **** tile = bank0[tile_map_line_y + tx]; ! if((register_LCDC & 16) == 0) { ! if(tile < 128) tile += 128; ! else tile -= 128; ! } tile_pattern_address = tile_pattern + tile * 16 + by * 2; } } else { for(int i = 0; i < 160; i++) { ! gbLineMix[i] = gbPalette[0]; gbLineBuffer[i] = 0; } --- 205,218 ---- tile = bank0[tile_map_line_y + tx]; ! if(!(register_LCDC & 0x10)) ! tile ^= 0x80; ! tile_pattern_address = tile_pattern + tile * 16 + by * 2; } } else { for(int i = 0; i < 160; i++) { ! // Use gbBgp[0] instead of 0 (?) ! // (this fixes white flashes on Last Bible II) ! gbLineMix[i] = gbPalette[gbBgp[0]]; gbLineBuffer[i] = 0; } *************** *** 200,207 **** // do the window display ! if((register_LCDC & 0x20) && (layerSettings & 0x2000)) { ! int wy = register_WY; ! if(y >= wy) { int wx = register_WX; wx -= 7; --- 220,245 ---- // do the window display ! // LCDC.0 also enables/disables the window in !gbCgbMode ?!?! ! // (tested on real hardware) ! // This fixes Last Bible II & Zankurou Musouken ! if((register_LCDC & 0x01 || gbCgbMode) && (register_LCDC & 0x20) && ! (layerSettings & 0x2000) && (gbWindowLine != -2)) { ! ! // Fix (accurate emulation) for most of the window display problems ! // (ie. Zen - Intergalactic Ninja, Urusei Yatsura...). ! if ((gbWindowLine == -1) || (gbWindowLine>144)) ! { ! inUseRegister_WY = oldRegister_WY; ! if (register_LY>oldRegister_WY) ! gbWindowLine = 146; ! } ! ! int wy = inUseRegister_WY; ! if(y >= inUseRegister_WY) { ! ! if (gbWindowLine == -1) ! gbWindowLine = 0; ! int wx = register_WX; wx -= 7; *************** *** 213,220 **** if((register_LCDC & 0x40) != 0) tile_map = 0x1c00; ! ! if(gbWindowLine == -1) { ! gbWindowLine = 0; ! } tx = 0; --- 251,255 ---- if((register_LCDC & 0x40) != 0) tile_map = 0x1c00; ! tx = 0; *************** *** 281,285 **** c = c + (attrs & 7) * 4; } else { ! c = gbBgp[c]; if(gbSgbMode && ! gbCgbMode) { int dx = x >> 3; --- 316,320 ---- c = c + (attrs & 7) * 4; } else { ! c = (gbBgpLine[x+3]>>(c<<1)) &3; if(gbSgbMode && ! gbCgbMode) { int dx = x >> 3; *************** *** 294,299 **** } } ! gbLineMix[x] = gbColorOption ? gbColorFilter[gbPalette[c]] : ! gbPalette[c]; x++; if(x >= 160) --- 329,334 ---- } } ! gbLineMix[x] = gbColorOption ? gbColorFilter[gbPalette[c] & 0x7FFF] : ! gbPalette[c] & 0x7FFF; x++; if(x >= 160) *************** *** 319,325 **** } } } else { for(int i = 0; i < 160; i++) { ! gbLineMix[i] = gbPalette[0]; gbLineBuffer[i] = 0; } --- 354,368 ---- } } + else if (gbWindowLine == -2) + { + inUseRegister_WY = oldRegister_WY; + if (register_LY>oldRegister_WY) + gbWindowLine = 146; + else + gbWindowLine = 0; + } } else { for(int i = 0; i < 160; i++) { ! gbLineMix[i] = gbPalette[gbBgp[0]]; gbLineBuffer[i] = 0; } *************** *** 348,352 **** // int yLine = (y+gbBorderRowSkip) * gbBorderLineSkip; ! u8 *pal = gbObp0; --- 391,399 ---- // int yLine = (y+gbBorderRowSkip) * gbBorderLineSkip; ! for (int i = 0; i<4; i++) ! { ! gbObp0[i] = (gbObp0Line[x+7]>>(i<<1)) & 3; ! gbObp1[i] = (gbObp1Line[x+7]>>(i<<1)) & 3; ! } u8 *pal = gbObp0; *************** *** 367,371 **** int b = 0; ! if(gbCgbMode && flags & 0x08) { a = bank1[address++]; b = bank1[address++]; --- 414,418 ---- int b = 0; ! if(gbCgbMode && (flags & 0x08)) { a = bank1[address++]; b = bank1[address++]; *************** *** 443,453 **** } ! gbLineMix[xxx] = gbColorOption ? gbColorFilter[gbPalette[c]] : ! gbPalette[c]; } } ! void gbDrawSprites() { int x = 0; int y = 0; --- 490,501 ---- } ! gbLineMix[xxx] = gbColorOption ? gbColorFilter[gbPalette[c] & 0x7FFF] : ! gbPalette[c] & 0x7FFF; } } ! int gbDrawSprites(bool draw) { + int x = 0; int y = 0; *************** *** 457,463 **** if(!(register_LCDC & 0x80)) ! return; if((register_LCDC & 2) && (layerSettings & 0x1000)) { int yc = register_LY; --- 505,512 ---- if(!(register_LCDC & 0x80)) ! return 0; if((register_LCDC & 2) && (layerSettings & 0x1000)) { + int yc = register_LY; *************** *** 475,482 **** int t = yc -y + 16; if(size && t >=0 && t < 16) { ! gbDrawSpriteTile(tile,x-8,yc,t,flags,size,i); count++; } else if(!size && t >= 0 && t < 8) { ! gbDrawSpriteTile(tile, x-8, yc, t, flags,size,i); count++; } --- 524,533 ---- int t = yc -y + 16; if(size && t >=0 && t < 16) { ! if (draw) ! gbDrawSpriteTile(tile,x-8,yc,t,flags,size,i); count++; } else if(!size && t >= 0 && t < 8) { ! if (draw) ! gbDrawSpriteTile(tile, x-8, yc, t, flags,size,i); count++; } *************** *** 484,490 **** // sprite limit reached! if(count >= 10) break; ! } } } --- 535,544 ---- // sprite limit reached! if(count >= 10) + { break; ! } ! } } + return (count*3); } Index: gbSGB.cpp =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/gb/gbSGB.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** gbSGB.cpp 13 May 2004 22:30:30 -0000 1.11 --- gbSGB.cpp 4 Jan 2006 13:38:47 -0000 1.12 *************** *** 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 *************** *** 256,262 **** u16 c = gbPalette[palette + color]; ! if(!color) ! c = gbPalette[0]; ! if((yy < 40 || yy >= 184) || (xx < 48 || xx >= 208)) { switch(systemColorDepth) { case 16: --- 256,265 ---- u16 c = gbPalette[palette + color]; ! ! // Fix for Super Snaky ??? ! // (it allows SGB borders to not redraw on the GB screen) ! //if(!color) ! // c = gbPalette[0]; ! if(((yy < 40 || yy >= 184) || (xx < 48 || xx >= 208)) && (color)) { switch(systemColorDepth) { case 16: Index: GB.cpp =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/gb/GB.cpp,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** GB.cpp 13 May 2004 22:33:46 -0000 1.20 --- GB.cpp 4 Jan 2006 13:38:47 -0000 1.21 *************** *** 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 [...2830 lines suppressed...] + + // Used to apply the interrupt's execution time. + if (gbDmaTicks) + { + clockTicks = gbDmaTicks; + gbDmaTicks = 0; + + goto gbRedoLoop; } *************** *** 3186,3188 **** 1000, #endif ! }; --- 3947,3949 ---- 1000, #endif ! }; \ No newline at end of file Index: gbCheats.cpp =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/gb/gbCheats.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** gbCheats.cpp 3 Sep 2005 12:28:39 -0000 1.8 --- gbCheats.cpp 4 Jan 2006 13:38:47 -0000 1.9 *************** *** 51,55 **** { utilWriteInt(gzFile, gbCheatNumber); ! if(gbCheatNumber) utilGzWrite(gzFile, &gbCheatList[0], sizeof(gbCheat)*gbCheatNumber); } --- 51,55 ---- { utilWriteInt(gzFile, gbCheatNumber); ! if(gbCheatNumber>0) utilGzWrite(gzFile, &gbCheatList[0], sizeof(gbCheat)*gbCheatNumber); } *************** *** 82,86 **** gbCheatNumber = utilReadInt(gzFile); ! if(gbCheatNumber) { utilGzRead(gzFile, &gbCheatList[0], sizeof(gbCheat)*gbCheatNumber); } --- 82,86 ---- gbCheatNumber = utilReadInt(gzFile); ! if(gbCheatNumber>0) { utilGzRead(gzFile, &gbCheatList[0], sizeof(gbCheat)*gbCheatNumber); } |