summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBryan Bishop <kanzure@gmail.com>2013-01-12 22:22:00 -0800
committerBryan Bishop <kanzure@gmail.com>2013-01-12 22:22:00 -0800
commitfb9fdd038d4ab94eab276585c7a8a46d8f9e33ad (patch)
treeb2b713e1e2e67ff95debf0409d7a3bb89e3fbf93
parentd2fabc3b157528bd4d5d76665e27b960f7a08b60 (diff)
parent9fbe7ea42390e7a0d6a1288f076d7951ce66b5eb (diff)
Merge pull request #80 from yenatch/master
rgb macro for palettes
-rw-r--r--constants.asm4
-rw-r--r--extras/gfx.py34
-rw-r--r--main.asm96
3 files changed, 114 insertions, 20 deletions
diff --git a/constants.asm b/constants.asm
index c60d4a044..cc9e55474 100644
--- a/constants.asm
+++ b/constants.asm
@@ -31,6 +31,10 @@ TX_FAR: MACRO
db BANK(\1)
ENDM
+RGB: MACRO
+ dw ((\3 << 10) | (\2 << 5) | (\1))
+ ENDM
+
; eventually replace with python macro
note: MACRO
db \1
diff --git a/extras/gfx.py b/extras/gfx.py
index f36b944d7..70c657c15 100644
--- a/extras/gfx.py
+++ b/extras/gfx.py
@@ -1283,6 +1283,28 @@ def get_uncompressed_gfx(start, num_tiles, filename):
+def hex_to_rgb(word):
+ red = word & 0b11111
+ word >>= 5
+ green = word & 0b11111
+ word >>= 5
+ blue = word & 0b11111
+ return (red, green, blue)
+
+def grab_palettes(address, length = 0x80):
+ output = ''
+ for word in range(length/2):
+ color = ord(rom[address+1])*0x100 + ord(rom[address])
+ address += 2
+ color = hex_to_rgb(color)
+ red = str(color[0]).zfill(2)
+ green = str(color[1]).zfill(2)
+ blue = str(color[2]).zfill(2)
+ output += '\tRGB '+red+', '+green+', '+blue
+ output += '\n'
+ return output
+
+
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument('cmd', nargs='?', metavar='cmd', type=str)
@@ -1317,7 +1339,11 @@ if __name__ == "__main__":
# python gfx.py un [address] [num_tiles] [filename]
get_uncompressed_gfx(int(args.arg1,16), int(args.arg2), args.arg3)
- else:
- # python gfx.py
- decompress_all()
- if debug: print 'decompressed known gfx to ../gfx/!'
+ elif args.cmd == 'pal':
+ # python gfx.py pal [address] [length]
+ print grab_palettes(int(args.arg1,16), int(args.arg2))
+
+ #else:
+ ## python gfx.py
+ #decompress_all()
+ #if debug: print 'decompressed known gfx to ../gfx/!'
diff --git a/main.asm b/main.asm
index 84084828e..dfa6cf80c 100644
--- a/main.asm
+++ b/main.asm
@@ -89646,23 +89646,87 @@ INCBIN "baserom.gbc", $10fed7, $10fede - $10fed7
TitleScreenPalettes:
; BG
- dw $0000, $0013, $7D0F, $7D0F
- dw $0000, $7FFF, $7E0F, $343F
- dw $0000, $1CE7, $7FFF, $7862
- dw $0000, $35AD, $4BFF, $7862
- dw $0000, $4E73, $339D, $7862
- dw $0000, $6739, $1B3C, $7862
- dw $0000, $7FFF, $02BA, $7862
- dw $0000, $4D6B, $7FFF, $0000
+ RGB 00, 00, 00
+ RGB 19, 00, 00
+ RGB 15, 08, 31
+ RGB 15, 08, 31
+
+ RGB 00, 00, 00
+ RGB 31, 31, 31
+ RGB 15, 16, 31
+ RGB 31, 01, 13
+
+ RGB 00, 00, 00
+ RGB 07, 07, 07
+ RGB 31, 31, 31
+ RGB 02, 03, 30
+
+ RGB 00, 00, 00
+ RGB 13, 13, 13
+ RGB 31, 31, 18
+ RGB 02, 03, 30
+
+ RGB 00, 00, 00
+ RGB 19, 19, 19
+ RGB 29, 28, 12
+ RGB 02, 03, 30
+
+ RGB 00, 00, 00
+ RGB 25, 25, 25
+ RGB 28, 25, 06
+ RGB 02, 03, 30
+
+ RGB 00, 00, 00
+ RGB 31, 31, 31
+ RGB 26, 21, 00
+ RGB 02, 03, 30
+
+ RGB 00, 00, 00
+ RGB 11, 11, 19
+ RGB 31, 31, 31
+ RGB 00, 00, 00
+
; OBJ
- dw $0000, $3C0A, $58B1, $7D33
- dw $7FFF, $0000, $0000, $0000
- dw $7FFF, $0000, $0000, $0000
- dw $7FFF, $0000, $0000, $0000
- dw $7FFF, $0000, $0000, $0000
- dw $7FFF, $0000, $0000, $0000
- dw $7FFF, $0000, $0000, $0000
- dw $7FFF, $0000, $0000, $0000
+ RGB 00, 00, 00
+ RGB 10, 00, 15
+ RGB 17, 05, 22
+ RGB 19, 09, 31
+
+ RGB 31, 31, 31
+ RGB 00, 00, 00
+ RGB 00, 00, 00
+ RGB 00, 00, 00
+
+ RGB 31, 31, 31
+ RGB 00, 00, 00
+ RGB 00, 00, 00
+ RGB 00, 00, 00
+
+ RGB 31, 31, 31
+ RGB 00, 00, 00
+ RGB 00, 00, 00
+ RGB 00, 00, 00
+
+ RGB 31, 31, 31
+ RGB 00, 00, 00
+ RGB 00, 00, 00
+ RGB 00, 00, 00
+
+ RGB 31, 31, 31
+ RGB 00, 00, 00
+ RGB 00, 00, 00
+ RGB 00, 00, 00
+
+ RGB 31, 31, 31
+ RGB 00, 00, 00
+ RGB 00, 00, 00
+ RGB 00, 00, 00
+
+ RGB 31, 31, 31
+ RGB 00, 00, 00
+ RGB 00, 00, 00
+ RGB 00, 00, 00
+
INCBIN "baserom.gbc", $10ff5e, $110000 - $10ff5e