chronosv2
New member
This issue has been solved. Solution: http://nesmakers.com/viewtopic.php?f=3&t=767
Ugh. I hate having to ask this. My plan was to learn ASM and figure this stuff out on my own.
Buuuut as some of you may have seen on Facebook, I kinda' broke it.
Okay, so I know what I did here. I was messing with the update code and accidentally took out the part that limits how far the HUD updates will go, and then it overwrote the attribute table.
So what I'm trying to do is this:
I'm working on a piece of ASM code that everyone will be able to use to have HUD objects that consists of multiple HUD items. Say, for example, a max health of 16 that can show as Var Tiles rather than numbers.
So I went on about coding it, and I've got the arithmetic part of the code finished, which is the easy part because it doesn't require much direct talking with the NES hardware bits. The problem I'm having is that, after looking at the Health Update Code, I'm not sure how to update two components, preferably in one pass. You can't double up the update code because there are values that get modified along the way and that makes only one element or the other update. But rather than ask for a direct solution I'd just like to know how the HUD updates work, and if there's a way to trigger part of the HUD to update two elements at once.
The above code, interestingly, draws the value for the myHealthHi element over where myHealth should be.
I'm not sure what I should be doing to change this. I know part of what the problem is and why it doesn't work -- the myHealthHi update is overwriting most of the data stored for myHealth. So it seems like I need to hold the second update for a second HUD update, or I need to somehow combine the data from both updates into one. I'm not quite sure which of those is possible. Hmmm...
Ugh. I hate having to ask this. My plan was to learn ASM and figure this stuff out on my own.
Buuuut as some of you may have seen on Facebook, I kinda' broke it.
Okay, so I know what I did here. I was messing with the update code and accidentally took out the part that limits how far the HUD updates will go, and then it overwrote the attribute table.
So what I'm trying to do is this:
I'm working on a piece of ASM code that everyone will be able to use to have HUD objects that consists of multiple HUD items. Say, for example, a max health of 16 that can show as Var Tiles rather than numbers.
So I went on about coding it, and I've got the arithmetic part of the code finished, which is the easy part because it doesn't require much direct talking with the NES hardware bits. The problem I'm having is that, after looking at the Health Update Code, I'm not sure how to update two components, preferably in one pass. You can't double up the update code because there are values that get modified along the way and that makes only one element or the other update. But rather than ask for a direct solution I'd just like to know how the HUD updates work, and if there's a way to trigger part of the HUD to update two elements at once.
Code:
LDA myHealth
STA hudElementTilesToLoad
LDA #$00
STA hudElementTilesMax
LDA DrawHudBytes
ORA #HUD_myHealth
STA DrawHudBytes
LDA myHealthHi
STA hudElementTilesToLoad
LDA #$00
STA hudElementTilesMax
LDA DrawHudBytes
ORA #HUD_myHealthHi
STA DrawHudBytes
The above code, interestingly, draws the value for the myHealthHi element over where myHealth should be.
I'm not sure what I should be doing to change this. I know part of what the problem is and why it doesn't work -- the myHealthHi update is overwriting most of the data stored for myHealth. So it seems like I need to hold the second update for a second HUD update, or I need to somehow combine the data from both updates into one. I'm not quite sure which of those is possible. Hmmm...