Gameboy Development Forum

Discussion about software development for the old-school Gameboys, ranging from the "Gray brick" to Gameboy Color
(Launched in 2008)

You are not logged in.

Ads

#1 2022-02-13 23:04:16

Bobyrman123
New member
Registered: 2022-02-07
Posts: 7

Game Crashes after 20 Seconds... what's the issue?

I'm attempting to write a shmup for the GBC that uses as many sprites for bullets that the Game Boy will allow. I'm writing it in C with GBDK 2020, and everything was going smoothly until I changed the list containing all of the bullet-structs to a linked-list. Now, the game runs a lot faster, however after about 20 seconds, the game crashes.

I have absolutely no clue why it's doing this - I've checked all of my code and figured out that the problem lies somewhere within the edge-collision detection for each bullet, but from there I'm lost as to why. I assume it's a problem with the way I add/delete from my linked-lists, but I can't exactly pinpoint the problem I'm running into.

I know this is super vague, but I don't really know how to debug this problem or where to even look. Would anyone be willing to help me? If you'd need any other files, I'm willing to share them.

Thank you for trying!!

Here's the link:
https://drive.google.com/drive/folders/ … sp=sharing

UPDATE: I still have the problem, however, I've discovered that the problem really only happens when two bullets hit the wall at the same time.

Last edited by Bobyrman123 (2022-02-14 03:08:23)

Offline

 

#2 2022-02-14 06:23:22

tmk
Member
Registered: 2017-05-01
Posts: 63
Website

Re: Game Crashes after 20 Seconds... what's the issue?

Just when I almost forgot how ugly is the code GBDK produces...  You have some buffer overflow here. Game stops because IE gets overwritten with 0 which disables interrupts. This is caused by enabledToDisabled function after some time, so it's probably due to lastNode content. Or just place access breakpoint (write) on $FFFF and try yourself. smile

Offline

 

#3 2022-02-14 12:04:57

Bobyrman123
New member
Registered: 2022-02-07
Posts: 7

Re: Game Crashes after 20 Seconds... what's the issue?

tmk wrote:

Just when I almost forgot how ugly is the code GBDK produces...  You have some buffer overflow here. Game stops because IE gets overwritten with 0 which disables interrupts. This is caused by enabledToDisabled function after some time, so it's probably due to lastNode content. Or just place access breakpoint (write) on $FFFF and try yourself. smile

Fantastic, thank you! I had no clue you could set breakpoints on Gameboys, I'll have to learn more about debugging Thank you!

Offline

 

#4 2022-03-16 18:05:13

bbbbbr
Member
Registered: 2019-03-04
Posts: 126

Re: Game Crashes after 20 Seconds... what's the issue?

A little late to this, but there is also C source debugging with Emulicious:
https://emulicious.net/a-major-update-o … ailable-4/

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2005 Rickard Andersson