nds-bootstrap icon indicating copy to clipboard operation
nds-bootstrap copied to clipboard

Gen 5 Pokémon games experience severe slowdown if the "C-Gear" is enabled when running in DSi Mode.

Open real-F-00 opened this issue 9 months ago • 7 comments

Game Console(s) used

  • [ ] Nintendo DS
  • [ ] Nintendo DS Lite
  • [X] Nintendo DSi
  • [ ] Nintendo DSi XL/LL
  • [ ] Nintendo 3DS
  • [ ] Nintendo 3DS XL/LL
  • [ ] New Nintendo 3DS XL/LL
  • [ ] Nintendo 2DS
  • [ ] New Nintendo 2DS XL/LL

Launch Method

The game is being launched via the SD Card, using TWiLightMenu++ v27.1.2

Version used

Release v1.5.0

Game tested/used/applicable

TWL-IRBO-USA md5: 37bff1431eda9b3a525737c7f59a432d , TWL-IRDI-ITA md5: 143304fd40e3d536d30542142165a7b1 , TWL-IRAI-ITA md5: 80821ad5ea8eab99dc5db8ab1e0fa0e0

Expected Behavior

the game should run normally and without excruciatingly long wait times when opening your bag, moving through items in your bag and exiting the bag, battles should be of normal speed.

Actual Behavior

the game has unusually long wait times when transitioning between menus and increased slowdowns in battles.

Steps to reproduce

Run the game in DSi Mode, in the main menu, when you are asked if you want to enable the "C-Gear" functionality select "Yes" (note: if you haven't obtained a C-Gear yet the prompt may not appear), once in-game, press 'X' to open a selection menu, select "Bag" and once loaded press 'Up' and 'Down' to move through the items in the Bag, then press 'B' to exit the Bag, you will notice and unusually long wait time.

Here's a save file so that you don't have to play the game up to a certain point in order to reproduce the issue: Pokémon Black Version.sav.zip

nds-bootstrap.ini

NDS_PATH = sd:/Pokémon Black Version.nds
SAV_PATH = sd:/saves/Pokémon Black Version.sav
RAM_DRIVE_PATH = sd:/null.img
GUI_LANGUAGE = en
LANGUAGE = -1
REGION = -1
USE_ROM_REGION = 1
DSI_MODE = 1
BOOST_CPU = 0
BOOST_VRAM = 0
CARD_READ_DMA = 1
ASYNC_CARD_READ = 0
DONOR_SDK_VER = 0
PATCH_MPU_REGION = 0
PATCH_MPU_SIZE = 0
FORCE_SLEEP_PATCH = 0
CACHE_FAT_TABLE = 0
SWI_HALT_HOOK = 1
EXTENDED_MEMORY = 0
CONSOLE_MODEL = 0
AP_FIX_PATH = sd:/_nds/nds-bootstrap/apFix.ips
DEBUG = 0
LOGGING = 1
B4DS_MODE = 0
ROMREAD_LED = 0
DMA_ROMREAD_LED = -1
PRECISE_VOLUME_CONTROL = 0
SDNAND = 0
MACRO_MODE = 0
SLEEP_MODE = 1
SOUND_FREQ = 0
HOTKEY = 284
HOMEBREW_ARG =

Logs

Header CRC is valid!
findModuleParamsOffset:
Module params offset found
Module params offset: 02004FCC
findLtdModuleParamsOffset:
Ltd module params offset found
Ltd module params offset: 02004F7C
sdk_version: 0503757C
arm9 is compressed
arm9i is compressed
Secure area already decrypted
AP-fix found
findHeapPointer2Offset:
020865C8
hi heap end: 020865C8

old hi heap value: 13A007BE

hi heap end: 02086678

new hi heap value: 02F60000

Hi Heap Shrink Successful

patchCardNds

[SDK 5]

findCardIrqEnableOffset:
irq enable found

cardIrqEnable location : 02084968

startOffset : 02004000

findMpuStartOffset:
Mpu init found

Mpu start 2: 02004AD4

findMpuDataOffset:
Mpu data found

Mpu data 2: 02004B90

Mpu init 2: 02004B20

findMpuChange:
Mpu change found

Mpu change: 0208653C

findMpuInitTwlEnd:
Mpu init TWL end found

Mpu init end TWL: 0208656C

findWaitSysCyclesOffset:
Wait system cycles found

waitSysCycles location : 02087A04

findCardReadEndOffsetThumb5Type1:
ARM9 Card read end SDK 5 thumb (type 1) not found

findCardReadEndOffsetThumb5Type0:
ARM9 Card read end SDK 5 thumb alt 1 (type 0) not found

findCardReadEndOffsetThumb:
ARM9 Card read end thumb not found

findCardReadEndOffsetType0:
ARM9 Card read end (type 0) short found: 02076F5C

findCardReadStartOffsetThumb5Type0:
ARM9 Card read start SDK 5 thumb (type 0) not found

findCardReadStartOffsetThumb:
ARM9 Card read start thumb not found
ARM9 Card read start thumb alt not found

findCardReadStartOffset5:
ARM9 Card read start SDK 5 found

cardRead location : 02076E4C
02FD6800

findSwi12Offset:
swi 0x12 call found

swi12 location : 0200407E

findDsiModeCheckOffset
DSi mode check found

findDsiModeCheck2Offset
DSi mode check 2 found

dsiModeCheck location : 02004EB4

dsiModeCheck2 location : 02085D3C

findCardHashInitOffset
Card hash init found

cardHashInit location : 0242EA78

findCardPullOutOffset:
Card pull out handler SDK 5 not found
Card pull out handler SDK 5 alt found

cardPullOut location : 02077410

findCardIdEndOffset:
Card ID end SDK 5 not found
Card ID end SDK 5 alt found: 02076D2C

findCardIdStartOffset:
Card ID start SDK 5 found

cardId location : 02076CD0

findCardReadDmaEndOffset:
Card read DMA end found: 02077160

findCardReadDmaStartOffset:
Card read DMA start SDK 5 found

cardReadDma location : 020770B4

findResetOffset
Reset found: 02087BCC
Reset constant found: 02087C68
Reset found

reset location : 02087BCC

ERR_NONE

a7_findScfgExtOffset:
SCFG_EXT found

SCFG_EXT location : 02380258

findSleepPatchOffset:
Sleep patch found

findRamClearIOffset:
RAM clear I found

RAM clear I location : 02E9700C

findRamClearI2Offset:
RAM clear I 2 found

RAM clear I 2 location : 02E96F2C

findCardIrqEnableOffset:
irq enable not found
irq enable alt found

cardIrqEnable location : 023848C4

findCardCheckPullOutOffset:
Card check pull out not found

Relocation src: 02380644

Arm7 (patch v5)
JumpTableFunc: 0238FB14
card id:	0238FAFC
card read:	0238FB0C
Eeprom read:	0238FB20
Eeprom page write:	0238FB38
Eeprom page prog:	0238FB50
Eeprom verify:	0238FB68
Eeprom page erase:	0238FB7C
findSwi12Offset:
swi 0x12 call found

findSwiGetPitchTableOffset:
swiGetPitchTable call SDK 5 found

swi12 location : 02383BA4

swiGetPitchTable location : 02383BB8

findSdCardResetOffset:
SD Card reset found

sdCardReset location : 02EB3824

ERR_NONE

Card patch successful

hookNdsRetailArm7
hookLocation arm7: 02391918

Cheats found and applied
ERR_NONE
handlerStartSig
020A9F70
handlerEndSig
020A9FB0
tableAddr
02FE0020
returnAddr
01FF8148
hookLocation arm9: 02FE0020

AP-fix applied
chipID: C001FFC2                                                                                                                           

Other notes

the cheat codes applied have no impact whatsoever on the issue. also, I'm not sure but the SD Card shouldn't be at fault here.

Will you be available for future issues and/or replies?

Yes

real-F-00 avatar Apr 27 '24 14:04 real-F-00

also confirmed for Nintendo DSi XL/LL

MidyGamy avatar Apr 29 '24 17:04 MidyGamy

To add to this, it also prevents you from accesssing bootloader settings. This issue also appears in normal ds mode. Happens on v1.4.0 & 1.5.2 nds bootloader versions for the following systems *DSI XL *O3DS *O2DS

Ninja070903 avatar May 16 '24 19:05 Ninja070903

Is it way worse than it was on older versions of nds bootstrap? (1.2.1-1.3.2)

Also

To add to this, it also prevents you from accesssing bootloader settings. This issue also appears in normal ds mode.

Fairly certain that would be intentional behavior; wireless and multiplayer need very strict timing to keep the connection in sync and functional, which originally is the reason why these games had slowdown when c-gear is enabled. Though it sounds like the slowdown got way worse in newer version of nds bootstrap?

Opening the in-game menu while wireless functionality is in use would desync and break it, so when wireless functionality is in use I guess they intentionally disable the in-game menu from opening.

It's just unfortunate that gen 5 pokemon keep a wireless connection open in the background when the c-gear is enabled, because it ends up making it so you can never use the in-game menu at all, and forces the entire game to slow itself down at all times.

I wonder if it would be possible to detect when a connection is being made to another ds, and only slowdown gameplay/block in-game menu when a connection actually exists between two or more players.

Ammako avatar Jun 16 '24 10:06 Ammako

which originally is the reason why these games had slowdown when c-gear is enabled

@Ammako except that the original games DO NOT have a slowdown when the C-Gear is enabled; or if they do, it's so small that it's unnoticeable during normal gameplay. although i didn't specify it in the issue, this slowdown doesn't occur in DS Mode (or if it does happen, it's no way near the unforgivable slowness of DSi Mode) implying something is wrong with the DSi Mode, this problem should be carefully looked at because it probably affects other DSi Mode Software other than these specific games.

real-F-00 avatar Jun 23 '24 09:06 real-F-00

except that the original games DO NOT have a slowdown when the C-Gear is enabled; or if they do, it's so small that it's unnoticeable during normal gameplay

But you're not playing from a retail cartridge, are you?

https://github.com/DS-Homebrew/nds-bootstrap/issues/1454#issuecomment-1247315206

Again: is this slowdown worse now on 1.5.0-1.5.2 than it was on older nds-bootstrap?

Ammako avatar Jun 23 '24 09:06 Ammako

But you're not playing from a retail cartridge, are you?

i don't understand what this question is trying to achieve as the issue stands with the fact that there is a slowdown that shouldn't be there, because it doesn't exist on the retail cartridges.

#1454 (comment)

that makes sense but it still doesn't justify the IMMENSE slowdown compared to retail cartridges.

Again: is this slowdown worse now on 1.5.0-1.5.2 than it was on older nds-bootstrap?

i just tested with nds-bootstrap v1.3.2 and the slowdown is the same as v1.5.0

real-F-00 avatar Jun 23 '24 14:06 real-F-00

I don't know what else to tell you. The slowdown is there on purpose because otherwise the wireless communications wouldn't be able to function. That the Gen 5 games behave like this is already known, and if it could be fixed without breaking the wireless functionality, it would have been.

Ammako avatar Jun 23 '24 14:06 Ammako

Try 1.6.0, it should be 99.5% fixed

https://github.com/DS-Homebrew/nds-bootstrap/releases/tag/v1.6.0

Ammako avatar Aug 25 '24 12:08 Ammako

Try 1.6.0, it should be 99.5% fixed

v1.6.0 (release)

i just tested with this version, as the release information suggests, there appears to be a minor slowdown, only on B/W2 (not 1) main menu, at the end of the main menu cycle, the animation progresses past the intended stop where the animation of when you press a button to continue is shown, before going back to the cinematic intro, as for the main issue:

i'm happy to say that the slowdown is almost entirely gone, the worst offender right now is scrolling between items in your bag, as for the loading times, it looks solved, battles, also solved, i'd like to note that for some odd reason running the games in DS Mode is always faster, almost killing the slowdown entirely.

this issue should be looked into, but as for the "severe slowdown" the problem is solved.

real-F-00 avatar Aug 26 '24 21:08 real-F-00