Forums

Sega Master System / Mark III / Game Gear
SG-1000 / SC-3000 / SF-7000 / OMV
Home - Forums - Games - Scans - Maps - Cheats - Credits
Music - Videos - Development - Hacks - Translations - Homebrew

View topic - I need help with the palette

Reply to topic
Author Message
  • Joined: 06 Sep 2015
  • Posts: 268
  • Location: United States
Reply with quote
I need help with the palette
Post Posted: Tue Sep 24, 2019 7:59 pm
So I read this page:
http://www.smspower.org/Development/Palette
and got some code from it and put it in my program:

   ld hl, $C000       ; CRAM address $0000
    rst 10h            ; Assume this function sets the VDP address
    ld a, $00          ; Color data
    out ($BE), a       ; CRAM unchanged, latch = $00
    ld hl, $C021       ; CRAM address $0021
    rst 10h            ; Set the address again
    ld a, $0C          ; Color data
    out ($BE), a       ; CRAM word at $0020 is now $000C, and the data at $0000 is unchanged.

But all I can do is change the first color in the bg palette. What do I need to do to change the second sprite palette? I've tried changing values and nothing changes (well, I can change the color, I just can't change what color I want to change!)
  View user's profile Send private message Visit poster's website
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 14738
  • Location: London
Reply with quote
Post Posted: Tue Sep 24, 2019 8:37 pm
This code is telling you how to do something weird, not something useful.

To change palette address x, set the "address" to $c000 + x. Remember that there are two bytes per entry for the Game Gear.
  View user's profile Send private message Visit poster's website
Reply to topic



Back to the top of this page

Back to SMS Power!