## Need Help Obtaining Mode 13h Default Palette RGB Values

General FreeBASIC programming questions.
Eclipzer
Posts: 432
Joined: Oct 01, 2005 10:50
Location: Maryland
Contact:

### Need Help Obtaining Mode 13h Default Palette RGB Values

I'm writing an iPhone program to load image files from some of my old QB/FB projects. What I need to do this, however, is a listing of all the RGB values for the default palette in mode 13h. Unfortunately, I'm on a mac, so I can't easily generate this listing myself through code, so I'm hoping someone here would be so kind. The output can be as simple as:

Code: Select all

`palette[0] = (R,G,B)palette[1] = (R,G,B)...palette[255] = (R,G,B)`

Thanks
counting_pine
Posts: 6190
Joined: Jul 05, 2005 17:32
Location: Manchester, Lancs
QB's Screen 13 256-color palette is the default in 8-bit screen modes, and you can get each color by using Palette Get:

Code: Select all

`dim as uinteger pal(0 to 255)dim as integer i, r, g, bscreenres 800, 600for i = 0 to 255    palette get i, r, g, b    pal(i) = rgb(r, g, b)nextfor i = 0 to 255    print hex(i, 2) & ":" & hex(pal(i), 6) & " ";nextsleep`
EDIT: But obviously you're on a Mac, so that's not much good to you.

Code: Select all

`palette[  0] = rgb(  0,  0,  0)palette[  1] = rgb(  0,  0,170)palette[  2] = rgb(  0,170,  0)palette[  3] = rgb(  0,170,170)palette[  4] = rgb(170,  0,  0)palette[  5] = rgb(170,  0,170)palette[  6] = rgb(170, 85,  0)palette[  7] = rgb(170,170,170)palette[  8] = rgb( 85, 85, 85)palette[  9] = rgb( 85, 85,255)palette[ 10] = rgb( 85,255, 85)palette[ 11] = rgb( 85,255,255)palette[ 12] = rgb(255, 85, 85)palette[ 13] = rgb(255, 85,255)palette[ 14] = rgb(255,255, 85)palette[ 15] = rgb(255,255,255)palette[ 16] = rgb(  0,  0,  0)palette[ 17] = rgb( 20, 20, 20)palette[ 18] = rgb( 32, 32, 32)palette[ 19] = rgb( 44, 44, 44)palette[ 20] = rgb( 56, 56, 56)palette[ 21] = rgb( 68, 68, 68)palette[ 22] = rgb( 80, 80, 80)palette[ 23] = rgb( 97, 97, 97)palette[ 24] = rgb(113,113,113)palette[ 25] = rgb(129,129,129)palette[ 26] = rgb(145,145,145)palette[ 27] = rgb(161,161,161)palette[ 28] = rgb(182,182,182)palette[ 29] = rgb(202,202,202)palette[ 30] = rgb(226,226,226)palette[ 31] = rgb(255,255,255)palette[ 32] = rgb(  0,  0,255)palette[ 33] = rgb( 64,  0,255)palette[ 34] = rgb(125,  0,255)palette[ 35] = rgb(190,  0,255)palette[ 36] = rgb(255,  0,255)palette[ 37] = rgb(255,  0,190)palette[ 38] = rgb(255,  0,125)palette[ 39] = rgb(255,  0, 64)palette[ 40] = rgb(255,  0,  0)palette[ 41] = rgb(255, 64,  0)palette[ 42] = rgb(255,125,  0)palette[ 43] = rgb(255,190,  0)palette[ 44] = rgb(255,255,  0)palette[ 45] = rgb(190,255,  0)palette[ 46] = rgb(125,255,  0)palette[ 47] = rgb( 64,255,  0)palette[ 48] = rgb(  0,255,  0)palette[ 49] = rgb(  0,255, 64)palette[ 50] = rgb(  0,255,125)palette[ 51] = rgb(  0,255,190)palette[ 52] = rgb(  0,255,255)palette[ 53] = rgb(  0,190,255)palette[ 54] = rgb(  0,125,255)palette[ 55] = rgb(  0, 64,255)palette[ 56] = rgb(125,125,255)palette[ 57] = rgb(157,125,255)palette[ 58] = rgb(190,125,255)palette[ 59] = rgb(222,125,255)palette[ 60] = rgb(255,125,255)palette[ 61] = rgb(255,125,222)palette[ 62] = rgb(255,125,190)palette[ 63] = rgb(255,125,157)palette[ 64] = rgb(255,125,125)palette[ 65] = rgb(255,157,125)palette[ 66] = rgb(255,190,125)palette[ 67] = rgb(255,222,125)palette[ 68] = rgb(255,255,125)palette[ 69] = rgb(222,255,125)palette[ 70] = rgb(190,255,125)palette[ 71] = rgb(157,255,125)palette[ 72] = rgb(125,255,125)palette[ 73] = rgb(125,255,157)palette[ 74] = rgb(125,255,190)palette[ 75] = rgb(125,255,222)palette[ 76] = rgb(125,255,255)palette[ 77] = rgb(125,222,255)palette[ 78] = rgb(125,190,255)palette[ 79] = rgb(125,157,255)palette[ 80] = rgb(182,182,255)palette[ 81] = rgb(198,182,255)palette[ 82] = rgb(218,182,255)palette[ 83] = rgb(234,182,255)palette[ 84] = rgb(255,182,255)palette[ 85] = rgb(255,182,234)palette[ 86] = rgb(255,182,218)palette[ 87] = rgb(255,182,198)palette[ 88] = rgb(255,182,182)palette[ 89] = rgb(255,198,182)palette[ 90] = rgb(255,218,182)palette[ 91] = rgb(255,234,182)palette[ 92] = rgb(255,255,182)palette[ 93] = rgb(234,255,182)palette[ 94] = rgb(218,255,182)palette[ 95] = rgb(198,255,182)palette[ 96] = rgb(182,255,182)palette[ 97] = rgb(182,255,198)palette[ 98] = rgb(182,255,218)palette[ 99] = rgb(182,255,234)palette[100] = rgb(182,255,255)palette[101] = rgb(182,234,255)palette[102] = rgb(182,218,255)palette[103] = rgb(182,198,255)palette[104] = rgb(  0,  0,113)palette[105] = rgb( 28,  0,113)palette[106] = rgb( 56,  0,113)palette[107] = rgb( 85,  0,113)palette[108] = rgb(113,  0,113)palette[109] = rgb(113,  0, 85)palette[110] = rgb(113,  0, 56)palette[111] = rgb(113,  0, 28)palette[112] = rgb(113,  0,  0)palette[113] = rgb(113, 28,  0)palette[114] = rgb(113, 56,  0)palette[115] = rgb(113, 85,  0)palette[116] = rgb(113,113,  0)palette[117] = rgb( 85,113,  0)palette[118] = rgb( 56,113,  0)palette[119] = rgb( 28,113,  0)palette[120] = rgb(  0,113,  0)palette[121] = rgb(  0,113, 28)palette[122] = rgb(  0,113, 56)palette[123] = rgb(  0,113, 85)palette[124] = rgb(  0,113,113)palette[125] = rgb(  0, 85,113)palette[126] = rgb(  0, 56,113)palette[127] = rgb(  0, 28,113)palette[128] = rgb( 56, 56,113)palette[129] = rgb( 68, 56,113)palette[130] = rgb( 85, 56,113)palette[131] = rgb( 97, 56,113)palette[132] = rgb(113, 56,113)palette[133] = rgb(113, 56, 97)palette[134] = rgb(113, 56, 85)palette[135] = rgb(113, 56, 68)palette[136] = rgb(113, 56, 56)palette[137] = rgb(113, 68, 56)palette[138] = rgb(113, 85, 56)palette[139] = rgb(113, 97, 56)palette[140] = rgb(113,113, 56)palette[141] = rgb( 97,113, 56)palette[142] = rgb( 85,113, 56)palette[143] = rgb( 68,113, 56)palette[144] = rgb( 56,113, 56)palette[145] = rgb( 56,113, 68)palette[146] = rgb( 56,113, 85)palette[147] = rgb( 56,113, 97)palette[148] = rgb( 56,113,113)palette[149] = rgb( 56, 97,113)palette[150] = rgb( 56, 85,113)palette[151] = rgb( 56, 68,113)palette[152] = rgb( 80, 80,113)palette[153] = rgb( 89, 80,113)palette[154] = rgb( 97, 80,113)palette[155] = rgb(105, 80,113)palette[156] = rgb(113, 80,113)palette[157] = rgb(113, 80,105)palette[158] = rgb(113, 80, 97)palette[159] = rgb(113, 80, 89)palette[160] = rgb(113, 80, 80)palette[161] = rgb(113, 89, 80)palette[162] = rgb(113, 97, 80)palette[163] = rgb(113,105, 80)palette[164] = rgb(113,113, 80)palette[165] = rgb(105,113, 80)palette[166] = rgb( 97,113, 80)palette[167] = rgb( 89,113, 80)palette[168] = rgb( 80,113, 80)palette[169] = rgb( 80,113, 89)palette[170] = rgb( 80,113, 97)palette[171] = rgb( 80,113,105)palette[172] = rgb( 80,113,113)palette[173] = rgb( 80,105,113)palette[174] = rgb( 80, 97,113)palette[175] = rgb( 80, 89,113)palette[176] = rgb(  0,  0, 64)palette[177] = rgb( 16,  0, 64)palette[178] = rgb( 32,  0, 64)palette[179] = rgb( 48,  0, 64)palette[180] = rgb( 64,  0, 64)palette[181] = rgb( 64,  0, 48)palette[182] = rgb( 64,  0, 32)palette[183] = rgb( 64,  0, 16)palette[184] = rgb( 64,  0,  0)palette[185] = rgb( 64, 16,  0)palette[186] = rgb( 64, 32,  0)palette[187] = rgb( 64, 48,  0)palette[188] = rgb( 64, 64,  0)palette[189] = rgb( 48, 64,  0)palette[190] = rgb( 32, 64,  0)palette[191] = rgb( 16, 64,  0)palette[192] = rgb(  0, 64,  0)palette[193] = rgb(  0, 64, 16)palette[194] = rgb(  0, 64, 32)palette[195] = rgb(  0, 64, 48)palette[196] = rgb(  0, 64, 64)palette[197] = rgb(  0, 48, 64)palette[198] = rgb(  0, 32, 64)palette[199] = rgb(  0, 16, 64)palette[200] = rgb( 32, 32, 64)palette[201] = rgb( 40, 32, 64)palette[202] = rgb( 48, 32, 64)palette[203] = rgb( 56, 32, 64)palette[204] = rgb( 64, 32, 64)palette[205] = rgb( 64, 32, 56)palette[206] = rgb( 64, 32, 48)palette[207] = rgb( 64, 32, 40)palette[208] = rgb( 64, 32, 32)palette[209] = rgb( 64, 40, 32)palette[210] = rgb( 64, 48, 32)palette[211] = rgb( 64, 56, 32)palette[212] = rgb( 64, 64, 32)palette[213] = rgb( 56, 64, 32)palette[214] = rgb( 48, 64, 32)palette[215] = rgb( 40, 64, 32)palette[216] = rgb( 32, 64, 32)palette[217] = rgb( 32, 64, 40)palette[218] = rgb( 32, 64, 48)palette[219] = rgb( 32, 64, 56)palette[220] = rgb( 32, 64, 64)palette[221] = rgb( 32, 56, 64)palette[222] = rgb( 32, 48, 64)palette[223] = rgb( 32, 40, 64)palette[224] = rgb( 44, 44, 64)palette[225] = rgb( 48, 44, 64)palette[226] = rgb( 52, 44, 64)palette[227] = rgb( 60, 44, 64)palette[228] = rgb( 64, 44, 64)palette[229] = rgb( 64, 44, 60)palette[230] = rgb( 64, 44, 52)palette[231] = rgb( 64, 44, 48)palette[232] = rgb( 64, 44, 44)palette[233] = rgb( 64, 48, 44)palette[234] = rgb( 64, 52, 44)palette[235] = rgb( 64, 60, 44)palette[236] = rgb( 64, 64, 44)palette[237] = rgb( 60, 64, 44)palette[238] = rgb( 52, 64, 44)palette[239] = rgb( 48, 64, 44)palette[240] = rgb( 44, 64, 44)palette[241] = rgb( 44, 64, 48)palette[242] = rgb( 44, 64, 52)palette[243] = rgb( 44, 64, 60)palette[244] = rgb( 44, 64, 64)palette[245] = rgb( 44, 60, 64)palette[246] = rgb( 44, 52, 64)palette[247] = rgb( 44, 48, 64)palette[248] = rgb(  0,  0,  0)palette[249] = rgb(  0,  0,  0)palette[250] = rgb(  0,  0,  0)palette[251] = rgb(  0,  0,  0)palette[252] = rgb(  0,  0,  0)palette[253] = rgb(  0,  0,  0)palette[254] = rgb(  0,  0,  0)palette[255] = rgb(  0,  0,  0)`
PS. You can find more info on the palette, and an image of it, at www.freebasic.net/wiki/GfxDefPalettes
kiyotewolf
Posts: 1009
Joined: Oct 11, 2008 7:42
Location: ABQ, NM
Contact:
I was using DOSBOX on a Mac, and creating text files from QBasic with ease.
Eclipzer
Posts: 432
Joined: Oct 01, 2005 10:50
Location: Maryland
Contact:
@kiyotewolf: I'll def have to take a look at that. Thanks.

@counting_pine: Thanks for your help. It's much appreciated. Come to find out though that these gfx were actually created using SCREEN 7 and a custom palette. If you could be so kind and give me the same RGB dump for this code I'd really appreciate it:

Code: Select all

`CONST VISPAGE = 0 SCREEN 7, , VISPAGE, VISPAGE CLS OUT &H3C8, 0 FOR I = 0 TO 23     '- modified palette -   OUT &H3C9, VAL(MID\$("250009270918451800000000000000006363545509544563", I * 2 + 1, 2))   OUT &H3C9, VAL(MID\$("260054630927095400000000000000000921545436184563", I * 2 + 1, 2))   OUT &H3C9, VAL(MID\$("270009276363096300000000000000000921093609454563", I * 2 + 1, 2)) NEXT`
ChangeV
Posts: 29
Joined: Mar 19, 2006 4:07
Location: Southern Mississippi
I just x4 them.
here is list.

Code: Select all

`palette[  0] = rgb(100,104,108)palette[  1] = rgb(  0,  0,  0)palette[  2] = rgb( 36,216, 36)palette[  3] = rgb(108,252,108)palette[  4] = rgb( 36, 36,252)palette[  5] = rgb( 72,108,252)palette[  6] = rgb(180, 36, 36)palette[  7] = rgb( 72,216,252)palette[  8] = rgb(252, 36, 36)palette[  9] = rgb(252, 84, 84)palette[ 10] = rgb(216,216, 36)palette[ 11] = rgb(220,216,144)palette[ 12] = rgb( 36,144, 36)palette[ 13] = rgb(216, 72,180)palette[ 14] = rgb(180,180,180)palette[ 15] = rgb(252,252,252)`

I made tile-dump program around 2006 with FreeBasic.
I converted all graphics from screen 7 projects into BMP format.
If you want these tiles, I can combine them into zip and send it to you.
Eclipzer
Posts: 432
Joined: Oct 01, 2005 10:50
Location: Maryland
Contact:
@ChangeV: Nice to still see you here on the boards. I'd love a *.zip of those tiles. As for the screen 7 palette I ended up getting the colors from a screenshot you had on your site, then I individually isolated them and matched them to the source image. Tedious, but it got the job done.
kiyotewolf
Posts: 1009
Joined: Oct 11, 2008 7:42
Location: ABQ, NM
Contact:
o.o you don't have a color matching routine?

### Who is online

Users browsing this forum: No registered users and 6 guests