Gameboy Development Forum

Discussion about software development for the old-school Gameboys, ranging from the "Gray brick" to Gameboy Color
(Launched in 2008)

You are not logged in.

Ads

#1 2021-12-26 14:34:24

kfmush
New member
Registered: 2021-12-25
Posts: 9

Edit DMG Sprite Palettes with GBDK

Hello!  I'd like to be able to change the palette order of sprites in my game.  From reading dozens of articles on the internet, I see that there are two registries that are constant values for the sprite palettes that the Game Boy can assign to sprites: OBJ0PAL and OBJ1PAL. I have not been able to find any info on how to edit or even call these registries.

I am a complete novice when it comes to coding, so I apologize for my ignorance.  I really wanna learn and I picked game boy games as a way to give myself satisfying and motivating projects. I've been using GBDK and writing in C.  I know almost no Assembly.  I can read a little and kinda make out how it works.  I'm not opposed to modifying the assembly file GBDK's compiler outputs, but I'd rather be able to do this in C, to better keep myself organized (and not have to manually edit the assembly file every time I wanna test something else out).

My goal is to have another color, besides white -- specifically black -- be the transparency color for sprites so that I can use white in their design.

Anyway.  What are my options for doing this?  I've tried my best to figure it out on my own, but my brain has stopped working and it's time to ask for help. Thanks!

(I just wish it was as easy as swapping the BG palette).

Last edited by kfmush (2021-12-26 14:49:48)

Offline

 

#2 2021-12-27 03:52:20

0x7f
Member
Registered: 2019-11-24
Posts: 65

Re: Edit DMG Sprite Palettes with GBDK

Offline

 

#3 2021-12-27 11:38:23

kfmush
New member
Registered: 2021-12-25
Posts: 9

Re: Edit DMG Sprite Palettes with GBDK

Thanks again! I don't know how I missed that... I read through that post a bunch of times.  I blame my dyslexia and being a little hectic trying to figure stuff out.  I didn't realize it was as simple as "set OBP0_REG" because I didn't know that value existed since it's not in the GBDK docs anywhere.  I figured if there was one for background values, there had to be for palettes, I just didn't know what it was.

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2005 Rickard Andersson