Page 1 of 1
ROM Bugs after delete 1 line [SOLVED]
Posted: Thu Apr 04, 2019 4:11 pm
by cloudstrifer
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!
Re: ROM Bugs after delete 1 line
Posted: Thu Apr 04, 2019 4:50 pm
by Stef
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 :
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);
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).
Re: ROM Bugs after delete 1 line
Posted: Thu Apr 04, 2019 5:14 pm
by cloudstrifer
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.
Re: ROM Bugs after delete 1 line
Posted: Thu Apr 04, 2019 5:22 pm
by cloudstrifer
Sorry about wasting your time, but now it don't crashes anymore.
Maybe Im crazy
For now, I will investigate that issue.
Thank you!
Re: ROM Bugs after delete 1 line [SOLVED]
Posted: Thu Apr 04, 2019 5:35 pm
by hotrodx
(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.
Re: ROM Bugs after delete 1 line [SOLVED]
Posted: Thu Apr 04, 2019 7:06 pm
by cloudstrifer
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.
I'm looking for mistakes.
Thank you.
Re: ROM Bugs after delete 1 line
Posted: Fri Apr 05, 2019 11:31 am
by nemezes
Stef wrote: Thu Apr 04, 2019 4:50 pm
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 :
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);
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 use everything in one file and the game works fine.
I get confused when working with several files.
Re: ROM Bugs after delete 1 line
Posted: Fri Apr 05, 2019 11:53 am
by cloudstrifer
nemezes wrote: Fri Apr 05, 2019 11:31 am
Stef wrote: Thu Apr 04, 2019 4:50 pm
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 :
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);
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 use everything in one file and the game works fine.
I get confused when working with several files.
2 enemies are not moving on New rom.
Maybe its a not initialized variable.
Re: ROM Bugs after delete 1 line [SOLVED]
Posted: Fri Apr 05, 2019 3:52 pm
by cloudstrifer
Confirmed, variable initialization, now enemies only allowed to move after screen creation is complete.
Thank you!
Re: ROM Bugs after delete 1 line [SOLVED]
Posted: Sat Apr 13, 2019 9:56 pm
by cloudstrifer
I found another error, index out of bounds.
S8 array [6];
...
Array [6] = 0;
Thank you!