ROM Bugs after delete 1 line [SOLVED]
Moderator: Stef
-
- Very interested
- Posts: 118
- Joined: Mon Feb 19, 2018 7:31 pm
ROM Bugs after delete 1 line [SOLVED]
Hi, please help me, my rom not works correctly after I remove or comment 1 line.
My main.c have 7447 lines.
//SPR_setVisibility(lifes_p1, VISIBLE);
Works
After remove line not works Using "New rom" 2 enemies don't move, and after 1 minute game crashes.
Thank you!
My main.c have 7447 lines.
//SPR_setVisibility(lifes_p1, VISIBLE);
Works
After remove line not works Using "New rom" 2 enemies don't move, and after 1 minute game crashes.
Thank you!
Last edited by cloudstrifer on Thu Apr 04, 2019 5:24 pm, edited 2 times in total.
-
- Very interested
- Posts: 3131
- Joined: Thu Nov 30, 2006 9:46 pm
- Location: France - Sevres
- Contact:
Re: ROM Bugs after delete 1 line
I don't understand what you expect from us..
I tested both ROM, and both appears to work. You didn't tell us what is not working anymore in the new ROM.
Also you only provide the ROM so we cannot do anything from just :
At least i can say this, your main file is 7447 lines.. that is definitely insane. Try to modularize and split your code in several file, you will never be able to maintain your code putting everything in a single file (well it's possible but terribly painful).
I tested both ROM, and both appears to work. You didn't tell us what is not working anymore in the new ROM.
Also you only provide the ROM so we cannot do anything from just :
Code: Select all
Hi, please help me, my rom not works correctly after I remove or comment 1 line.
My main.c have 7447 lines.
//SPR_setVisibility(lifes_p1, VISIBLE);
-
- Very interested
- Posts: 118
- Joined: Mon Feb 19, 2018 7:31 pm
Re: ROM Bugs after delete 1 line
Thank you for reply.
Using "New rom" 2 enemies don't move, and after 1 minute game crashes.
I will solve the problem with my code, splitting and cleaning, I'm just writing code, but it became too big.
Using "New rom" 2 enemies don't move, and after 1 minute game crashes.
I will solve the problem with my code, splitting and cleaning, I'm just writing code, but it became too big.
-
- Very interested
- Posts: 118
- Joined: Mon Feb 19, 2018 7:31 pm
Re: ROM Bugs after delete 1 line
Sorry about wasting your time, but now it don't crashes anymore.
Maybe Im crazy
For now, I will investigate that issue.
Thank you!
Maybe Im crazy
For now, I will investigate that issue.
Thank you!
Re: ROM Bugs after delete 1 line [SOLVED]
(Running on an emulator)
I just noticed that when you first load up "Goof NEW.bin", the two sprites do not move. If you do a soft reset, they'd move. If you do a hard reset, they won't move again. So I'm guessing it has something to do with variable initialization failing to account soft resets.
EDIT: Or, some of the variables were used before being initialized, and was initialized AFTER the offending line. When you do a soft reset, it would have value now. But with a hard reset, it's uninitialized again.
I just noticed that when you first load up "Goof NEW.bin", the two sprites do not move. If you do a soft reset, they'd move. If you do a hard reset, they won't move again. So I'm guessing it has something to do with variable initialization failing to account soft resets.
EDIT: Or, some of the variables were used before being initialized, and was initialized AFTER the offending line. When you do a soft reset, it would have value now. But with a hard reset, it's uninitialized again.
-
- Very interested
- Posts: 118
- Joined: Mon Feb 19, 2018 7:31 pm
Re: ROM Bugs after delete 1 line [SOLVED]
I'm looking for mistakes.hotrodx wrote: ↑Thu Apr 04, 2019 5:35 pm(Running on an emulator)
I just noticed that when you first load up "Goof NEW.bin", the two sprites do not move. If you do a soft reset, they'd move. If you do a hard reset, they won't move again. So I'm guessing it has something to do with variable initialization failing to account soft resets.
EDIT: Or, some of the variables were used before being initialized, and was initialized AFTER the offending line. When you do a soft reset, it would have value now. But with a hard reset, it's uninitialized again.
Thank you.
Re: ROM Bugs after delete 1 line
I use everything in one file and the game works fine.Stef wrote: ↑Thu Apr 04, 2019 4:50 pmI don't understand what you expect from us..
I tested both ROM, and both appears to work. You didn't tell us what is not working anymore in the new ROM.
Also you only provide the ROM so we cannot do anything from just :
At least i can say this, your main file is 7447 lines.. that is definitely insane. Try to modularize and split your code in several file, you will never be able to maintain your code putting everything in a single file (well it's possible but terribly painful).Code: Select all
Hi, please help me, my rom not works correctly after I remove or comment 1 line. My main.c have 7447 lines. //SPR_setVisibility(lifes_p1, VISIBLE);
I get confused when working with several files.
-
- Very interested
- Posts: 118
- Joined: Mon Feb 19, 2018 7:31 pm
Re: ROM Bugs after delete 1 line
2 enemies are not moving on New rom.nemezes wrote: ↑Fri Apr 05, 2019 11:31 amI use everything in one file and the game works fine.Stef wrote: ↑Thu Apr 04, 2019 4:50 pmI don't understand what you expect from us..
I tested both ROM, and both appears to work. You didn't tell us what is not working anymore in the new ROM.
Also you only provide the ROM so we cannot do anything from just :
At least i can say this, your main file is 7447 lines.. that is definitely insane. Try to modularize and split your code in several file, you will never be able to maintain your code putting everything in a single file (well it's possible but terribly painful).Code: Select all
Hi, please help me, my rom not works correctly after I remove or comment 1 line. My main.c have 7447 lines. //SPR_setVisibility(lifes_p1, VISIBLE);
I get confused when working with several files.
Maybe its a not initialized variable.
-
- Very interested
- Posts: 118
- Joined: Mon Feb 19, 2018 7:31 pm
Re: ROM Bugs after delete 1 line [SOLVED]
Confirmed, variable initialization, now enemies only allowed to move after screen creation is complete.
Thank you!
Thank you!
-
- Very interested
- Posts: 118
- Joined: Mon Feb 19, 2018 7:31 pm
Re: ROM Bugs after delete 1 line [SOLVED]
I found another error, index out of bounds.
S8 array [6];
...
Array [6] = 0;
Thank you!
S8 array [6];
...
Array [6] = 0;
Thank you!