Grame frozen on start [4.1]

Kasumi

New member
I'll risk sounding pedantic for maximum understanding. More or less! But it's pixel, not tile. On the right image, the bottom right TILE of the HUD is not totally transparent, but this doesn't matter because sprite 0 is not overlapping the parts of it that aren't transparent.

Secondarily, it's not the overlap or lack of it that causes the crash.

When an opaque pixel from sprite 0 overlaps an opaque pixel in the background, the PPU (NES' graphics rendering CPU) sets something that CPU can detect. If it never happens, that thing is never set but that doesn't make the CPU stop doing things on its own.

The crash happens if the game is specifically trying to detect that thing in a loop. It's doing a loop similar to, but not exactly this (to make it easier to understand):
Code:
lda #$0;Load Zero
sta variable;Store zero to RAM
loop:
lda variable;Load the value of variable
beq loop;If the value of variable was zero, go to loop
There's nothing between loop and that branch to loop that changes the value of variable. So unless something else changes that value of variable, the code is stuck there indefinitely.

The game crashes because it's waiting for a change like that that never happens. (The PPU can never change "variable" because the conditions it would do that under never occur.)

Shorter: It wouldn't crash if a waiting loop wasn't in the code regardless of the overlap, and it wouldn't crash if it had waiting loop, but overlap occurred.

The crash happens because it's waiting, AND the overlap it's waiting for never occurs.

Edit: Dale_Coop: Are the non corner parts of your reproduction color 0?
 

dale_coop

Moderator
Staff member
Sorry man I have to go to bed (1:00AM here I wake up early tomorrow morning).
If you don't find today... Could you share your HudTiles.bmp? I will try tomorrow morning.

PS: for my tests, my HUD zero sprite is set H-sync:1 X:246 Y:30 and it works even after changed the hud corner tiles.
 

Kasumi

New member
After changing them to what? The pixel content of the tiles themselves matters, as do the palette indices. You can even make a HUD that looks visually identical to the non working one that will work by using a different index (non color 0) for the "empty" part of the HUD.
 

dale_coop

Moderator
Staff member
Agree without, kasumi.
Its’ the reason I propose to do some tests with his tileset and try to give him a solution.
 
Thanks kasumi for explaining the technical part.
dale coop, i can no longer reproduce it myself, i dont remember what numbers i used and i saved over the original non working test project :C
also heres my HUD tiles https://i.imgur.com/hcp8Ewt.png

Anyway it was the zero pixel thing what was crashing my test project, but looks like my main project still crashes for some other reason, i will have to keep looking and will report what it is when i find it.
Thanks for help everyone, i really appreciate it, i would have gave up on nesmaker without you guys pointing me to right directions.
 

dale_coop

Moderator
Staff member
Glad your sprite0 is no longer a problem, SuperMar10Brothe :)
Don't worry I complety understand you... I've spent hours on that problem myself. The HUD and the Sprite0 are difficult to deal with, in the 4.1

I hope you will find out why your main project 's still crashing... (maybe monsters / game objects, or some incorrect screen collision data ---because not completly the same, now), ... Anyway, don't hesitate to tell if you need help (with a lot of screenshosts). With the everybody here, we can help you.
 
I have exported all the pallets, assets, monsters, maps and player and imported them into a new project and it all just works now

But i have a new problems, warp to screen is even more broken now than in previous version, before there was a bug where it would warp to underworld by default and you had to mark the "warp to underworld" checkbox to make it not warp to underworld, but in 4.1 it warps to whatever random screen that i cant find, no matter what i enter it still warps me to the wrong screen.

Edit: no matter what numbers i enter, it always warps me to x0 y15

Oh yeah and theres also this fun bug
https://www.youtube.com/watch?v=kXIsHLSHiCA&feature=youtu.be


Oh and scrolling breaks things made out of paths
AVMaxaa.png

picture on the left is how things are supposed to look like (made player start on that screen)
Picture on the right is how things look after scrolling for a bit
Also the HUD cant seem to make up its mind what pallet it wants to use
 

dale_coop

Moderator
Staff member
For the player clone... it might be game objects / monsters on the imported screens. I would suggest a right click in the screen "reset placements".... and then replace manually your monsters/game objects.
And if you use the paths... the scrolling have issues with that.
 
Reset all placements did the trick, thanks

Will the path and pallet bugs be fixed in upcoming versions? also what about the warping location bug?
 

dale_coop

Moderator
Staff member
Glad the "reset placements" worked ;)
About the paths and the palettes bugs... I hope it will. But I know that some members are trying to fix that too (... I mean, talking for myself, if can find some more free time ;))

A quick workaround for your hud palette: you could "paint" all your screen HUD's areas with the SubPalette#4 (holding the "R" key), it might do the trick.
 

LordFred

New member
The woraround for the palette bug works for me, you have to change to subpalette 4 your screen HUD's areas... I have the same problem with paths and scrolling... I'm analizing the code too...
 

dale_coop

Moderator
Staff member
Ok, I see where is the problem with the Warps... try replacing your WarpToScreen.asm script with this one:

Code:
; cpx player1_object
; BNE dontDoWarp_tile
; LDA warpMap
; sta currentMap
; clc
; ADC #$01
; STA temp
; GoToScreen warpToScreen, temp

; dontDoWarp_tile

LDA #$00
STA newGameState

 LDA warpMap
 sta currentMap
 clc
 ADC #$01
 STA temp
 GoToScreen warpToScreen, temp, #$02
 LDA #$00
 STA playerToSpawn
 ;; LDX player1_object
 ;; DeactivateCurrentObject
 ;; LDA #$01
 STA loadObjectFlag
 
LDA mapPosX
STA newX
LDA mapPosY
STA newY


Updated (2019/02/23): comment out some lines of code that made the player to respawn on warp... (so, was giving back his health).
 
Ok new problem, screens that dont scroll, going from one screen to the other causes the game to crash and the built in emulator to close, also tried running the game fceux but the game doesnt even run on it, i get the same exact frozen game bug from before when i try it on fceux, this is frustrating beyond words.

Edit: figured out whats crashing fcux and how to fix it but threes still the problem of going from a non scrolling screen into a scrolling or another non scrolling screen causing the game to crash
 

dale_coop

Moderator
Staff member
@Kingofthepirates Be careful, tutorials and scripts made for a particular version (here 4.1) won't work on a different NESmaker version (yours might be the most recent version 4.5.9).

You should make a new topic in the "Ask for help" section with all the necesary informations about your project, and your issue (with screenshots or videos...)
 
Top Bottom