List of all attribute bytes

puppydrum64

Active member
So I've noticed that not every command or variable has the meaning of each of their bytes documented in NESmaker anywhere. For example, when I type "DrawSprite tempA, tempB, tempC, #%00000000" I can't find a detailed description of each bit and what it controls. I know that in this particular case bits 0 and 1 control the palette used but what about the rest? It would be handy if there was an instruction sheet for all variables that work like this explaining what each bit controls so I don't have to find out the hard way (by testing it myself).
 

TakuikaNinja

Active member
You can find the macro scripts in BASE_4_5\System\Macros. They should give you an idea of what they do and what the arguments mean.
The temp variables mean nothing otherwise - as the names imply, there are temporary variables.
 

puppydrum64

Active member
I understand that the temp variables are just temporary, but I don't always know what the #%00000000 means. Not every macro explains in the comments what each bit represents.

EDIT: I have discovered some of the bits for the DrawSprite macro through testing (again, I reiterate that I shouldn't have to waste my time doing this) and found the following so far:

;; ATTRIBUTE DATA INFO

;;AABBCCDD
; where
; A
;00 = NORMAL
;01 = FLIP V
;10 = FLIP H
;11 = FLIP V AND H
; B
;
; C
;
; D
; 00 = PALETTE 0
; 01 = PALETTE 1
; 02 = PALETTE 2
; 03 = PALETTE 3

Still don't know what B and C do. (They might not even be half-nibbles for all I know)
 
Last edited:

TakuikaNinja

Active member
It refers to the sprite's attributes, as documented here: Sprite Attributes - Nesdev Wiki
Here's what the bits mean in the context of NESmaker:

Code:
76543210
||||||||
||||||++- Monster palette (00, 01, 10, 11)
|||+++--- Unimplemented
||+------ Priority (0: in front of background; 1: behind background)
|+------- Horizontal flip (0: off, 1: on)
+-------- Vertical flip (0: off, 1: on)
 

puppydrum64

Active member
It refers to the sprite's attributes, as documented here: Sprite Attributes - Nesdev Wiki
Here's what the bits mean in the context of NESmaker:

Code:
76543210
||||||||
||||||++- Monster palette (00, 01, 10, 11)
|||+++--- Unimplemented
||+------ Priority (0: in front of background; 1: behind background)
|+------- Horizontal flip (0: off, 1: on)
+-------- Vertical flip (0: off, 1: on)
Thanks! I usually make a habit of adding these to the scripts but commented out.

EDIT: The whole reason I was doing this was to make certain objects be drawn behind background. How do I tell the game to do this? There's no check boxes in the NESmaker editor. I can't find the object attribute table in the code either.
 
Last edited:
Top Bottom