Embedded ASCII strings

This commit is contained in:
Koji Ikarashi 2015-11-18 09:45:44 -08:00
parent ac6a547cdd
commit 5e493a5015
4 changed files with 29 additions and 66 deletions

View File

@ -12,10 +12,6 @@ Install [cc65](ftp://ftp.musoftware.de/pub/uz/cc65/cc65-sources-2.13.3.tar.bz2)
Assets were created in NESST and Famitracker.
### Updating Strings
Strings in SplatooD are formatted as nul-terminated tileset IDs. There is a tool in `util/string.py` to generate C arrays from input text.
### Updating Nametable Headers
There is a tool to convert binary nametables into C headers in `util/bin-to-h.py`.

56
game.c
View File

@ -88,36 +88,38 @@ const unsigned char palCharacters[8]={ 0x0f,0x04,0x30,0x0f,0x0f,0x19,0x30,0x0f }
const unsigned char palCharPaused[8] = {0x0f,0x00,0x2d,0x0f,0x0f,0x00,0x2d,0x0f};
const unsigned char palJudd[]={ 0x0f,0x26,0x27,0x30,0x0f,0x14,0x27,0x30,0x0f,0x2a,0x27,0x30,0x0f,0x26,0x27,0x30 };
const unsigned char victoryMsg[]={ 0xd6,0xe9,0xe3,0xf4,0xef,0xf2,0xf9,0xa1,0x00 };
const unsigned char fourSpaces[]={ 0xa0,0xa0,0xa0,0x00 };
const unsigned char tieMsg[]={ 0xc9,0xf4,0xa7,0xf3,0xa0,0xe1,0xa0,0xf4,0xe9,0xe5,0xa1,0x00 };
const unsigned char victoryMsg[] = "Victory!";
const unsigned char fourSpaces[] = " ";
const unsigned char tieMsg[] = "It's a tie!";
const unsigned char selector[] = "*";
const unsigned char zero[]={0};
const unsigned char selector[]={0xaa,0x0};
const unsigned char credits_0[] = { 0xa0,0xa0,0xa0,0xa0,0xa0,0xa0,0xa0,0xa0,0xa0,0xa0,0xd3,0xf0,0xec,0xe1,0xf4,0xef,0xef,0xc4,0x00 };
const unsigned char credits_1[] = { 0xa0,0xa0,0xa0,0xa0,0xa0,0xa0,0xe1,0xa0,0xd3,0xf0,0xec,0xe1,0xf4,0xef,0xef,0xee,0xa0,0xe4,0xe5,0xed,0xe1,0xeb,0xe5,0x00 };
const unsigned char credits_2[] = { 0xa0,0xa0,0xa0,0xa0,0xa0,0xa0,0xa0,0xa0,0xd0,0xf2,0xef,0xea,0xe5,0xe3,0xf4,0xa0,0xcc,0xe5,0xe1,0xe4,0x00 };
const unsigned char credits_3[] = { 0xa0,0xa0,0xa0,0xa0,0xa0,0xa0,0xca,0xef,0xe8,0xee,0xa0,0xc3,0xe1,0xf2,0xed,0xe1,0xe3,0xeb,0xe5,0xf2,0xe1,0xec,0x00 };
const unsigned char credits_4[] = { 0xa0,0xa0,0xa0,0xa0,0xa0,0xa0,0xa0,0xa0,0xa0,0xa0,0xa0,0xcd,0xf5,0xf3,0xe9,0xe3,0x00 };
const unsigned char credits_5[] = { 0xa0,0xa0,0xa0,0xa0,0xa0,0xa0,0xce,0xef,0xe2,0xf5,0xef,0xa0,0xd3,0xf1,0xf5,0xe9,0xe4,0xe9,0xed,0xe1,0xf4,0xf3,0xf5,0x00 };
const unsigned char credits_6[] = { 0xa0,0xa0,0xa0,0xa0,0xa0,0xa0,0xd4,0xe9,0xf4,0xec,0xe5,0xa0,0xa6,0xa0,0xd0,0xef,0xf3,0xf4,0xe7,0xe1,0xed,0xe5,0x00 };
const unsigned char credits_7[] = { 0xa0,0xa0,0xa0,0xa0,0xa0,0xa0,0xa0,0xa0,0xcb,0xef,0xea,0xe9,0xa0,0xc9,0xeb,0xe1,0xf2,0xe1,0xf3,0xe8,0xe9,0x00 };
const unsigned char credits_8[] = { 0xa0,0xa0,0xa0,0xa0,0xa0,0xa0,0xa0,0xa0,0xc7,0xe1,0xed,0xe5,0xa0,0xc4,0xe5,0xf3,0xe9,0xe7,0xee,0x00 };
const unsigned char credits_9[] = { 0xa0,0xa0,0xa0,0xa0,0xa0,0xa0,0xa0,0xd3,0xf1,0xf5,0xe9,0xe4,0xe5,0xef,0xa0,0xcb,0xef,0xea,0xe9,0xed,0xe1,0x00 };
const unsigned char credits_10[] = { 0xa0,0xa0,0xa0,0xa0,0xa0,0xa0,0xa0,0xa0,0xa0,0xa0,0xc7,0xf2,0xe1,0xf0,0xe8,0xe9,0xe3,0xf3,0x00 };
const unsigned char credits_11[] = { 0xa0,0xa0,0xa0,0xa0,0xa0,0xa0,0xa0,0xa0,0xa0,0xd3,0xf1,0xf5,0xe9,0xe4,0xa0,0xcd,0xe5,0xe9,0xe5,0xf2,0x00 };
const unsigned char credits_12[] = { 0xa0,0xa0,0xa0,0xa0,0xa0,0xa0,0xa0,0xa0,0xc7,0xe1,0xed,0xe5,0xa0,0xcd,0xe5,0xe3,0xe8,0xe1,0xee,0xe9,0xe3,0xf3,0x00 };
const unsigned char credits_13[] = { 0xa0,0xa0,0xa0,0xa0,0xa0,0xa0,0xa0,0xa0,0xc1,0xed,0xe5,0xf2,0xe9,0xe3,0xe1,0xee,0xa0,0xcd,0xe3,0xc7,0xe9,0xec,0xec,0x00 };
const unsigned char credits_14[] = { 0xa0,0xa0,0xa0,0xa0,0xa0,0xa0,0xd3,0xf0,0xec,0xe1,0xf4,0xef,0xef,0xee,0xa0,0xa8,0xc3,0xa9,0xa0,0xb2,0xb0,0xb1,0xb5,0x00 };
const unsigned char credits_15[] = { 0xa0,0xa0,0xa0,0xa0,0xa0,0xa0,0xa0,0xa0,0xa0,0xa0,0xce,0xe9,0xee,0xf4,0xe5,0xee,0xe4,0xef,0x00 };
const unsigned char credits_16[] = { 0xa0,0xa0,0xa0,0xa0,0xa0,0xd4,0xe8,0xe1,0xee,0xeb,0xf3,0xa0,0xe6,0xef,0xf2,0xa0,0xf0,0xec,0xe1,0xf9,0xe9,0xee,0xe7,0xa1,0x00 };
const unsigned char credits_0[] = " SplatooD";
const unsigned char credits_1[] = " a Splatoon demake";
const unsigned char credits_2[] = " Project Lead";
const unsigned char credits_3[] = " John Carmackeral";
const unsigned char credits_4[] = " Music";
const unsigned char credits_5[] = " Nobuo Squidimatsu";
const unsigned char credits_6[] = " Title & Postgame";
const unsigned char credits_7[] = " Koji Ikarashi";
const unsigned char credits_8[] = " Game Design";
const unsigned char credits_9[] = " Squideo Kojima";
const unsigned char credits_10[] = " Graphics";
const unsigned char credits_11[] = " Squid Meier";
const unsigned char credits_12[] = " Game Mechanics";
const unsigned char credits_13[] = " American McGill";
const unsigned char credits_14[] = " Splatoon (C) 2015";
const unsigned char credits_15[] = " Nintendo";
const unsigned char credits_16[] = " Thanks for playing!";
const unsigned char * credits[] = { credits_0, credits_1, credits_2, credits_3, credits_4, credits_5, credits_6, credits_7, credits_8, credits_9, credits_10, credits_11, credits_12, credits_13, credits_14, credits_15, credits_16, zero, zero, zero };
const unsigned char select_map[] = { 0xd3,0xe5,0xec,0xe5,0xe3,0xf4,0xa0,0xcd,0xe1,0xf0,0x00 };
const unsigned char level_kelpdome[] = { 0xcb,0xe5,0xec,0xf0,0xa0,0xc4,0xef,0xed,0xe5,0x00 };
const unsigned char level_bluefin_depot[] ={ 0xc2,0xec,0xf5,0xe5,0xe6,0xe9,0xee,0xa0,0xc4,0xe5,0xf0,0xef,0xf4,0x00 };
const unsigned char level_saltspray[] = { 0xd3,0xe1,0xec,0xf4,0xf3,0xf0,0xf2,0xe1,0xf9,0xa0,0xd2,0xe9,0xe7,0x00 };
const unsigned char level_twofish[] = { 0xd4,0xf7,0xef,0xa0,0xc6,0xe9,0xf3,0xe8,0x00 };
const unsigned char select_map[] = "Select Map";
const unsigned char level_kelpdome[] = "Kelp Dome";
const unsigned char level_bluefin_depot[] = "Bluefin Depot";
const unsigned char level_saltspray[] = "Saltspray Rig";
const unsigned char level_twofish[] = "Two Fish";
/* Meta sprites for players */
/* DOWN, LEFT, RIGHT, UP */
@ -634,7 +636,7 @@ void put_num(unsigned int adr,unsigned int num,unsigned char len) {
void print_str(unsigned int adr, const unsigned char * str) {
vram_adr(adr);
while (*str) {
vram_put(*str);
vram_put((*str)+0x80);
str++;
}
}

View File

@ -1,26 +0,0 @@
function credit_line() {
echo -n "const unsigned char credits_$1[] = ";
echo "$2" | python string.py
}
# " "
credit_line 0 " SplatooD"
credit_line 1 " a Splatoon demake"
credit_line 2 " Project Lead"
credit_line 3 " John Carmackeral"
credit_line 4 " Music"
credit_line 5 " Nobuo Squidimatsu"
credit_line 6 " Title & Postgame"
credit_line 7 " Koji Ikarashi"
credit_line 8 " Game Design"
credit_line 9 " Squideo Kojima"
credit_line 10 " Graphics"
credit_line 11 " Squid Meier"
credit_line 12 " Game Mechanics"
credit_line 13 " American McGill"
credit_line 14 " Splatoon (C) 2015"
credit_line 15 " Nintendo"
credit_line 16 " Thanks for playing!"
echo "const unsigned char * credits[] = {" credits_{0..16}, zero, zero, zero "};"

View File

@ -1,9 +0,0 @@
import codecs
out = []
for i in codecs.encode(raw_input()):
out.append(hex(ord(i)+0x80))
out.append("0x00");
print "{",",".join(out),"};"