Merge pull request #130 from Lorenzooone/Fix-big-merge-27-08-2020

Fix merge issue for 27/08/2020 big merge preventing .ips generation
This commit is contained in:
Lorenzooone 2020-08-27 03:49:57 +02:00 committed by GitHub
commit 55d47af239
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 28 additions and 28 deletions

View File

@ -50,11 +50,11 @@ void writeCastText(unsigned short *bg0Arrangements, unsigned short *bg1Arrangeme
//Setup
castText_curr_ptr = castText_curr_start;
length = 0;
setTilesToBlank(Tiles[0]);
setTilesToBlankCast(Tiles[0]);
//First things first, it calculates the total length of the text in pixels
while((*castText_curr_ptr) != END)
length += getCharWidth(*(castText_curr_ptr++));
length += getCharWidthCast(*(castText_curr_ptr++));
//Calculate the starting position of the text
int x = center_x - (length >> 1);
@ -154,7 +154,7 @@ int printCastCharacter(byte chr, int Tiles[SIDE_BUFFER_SIZE + 1][4], unsigned sh
if((currLen + chosenLen) >= 8)
{
for(int i = 0; i < SIDE_BUFFER_SIZE; i++)
setTilesToBlank(Tiles[i + 1]);
setTilesToBlankCast(Tiles[i + 1]);
if(renderedLen > 0)
printCastCharacterInMultiTiles(Tiles, glyphRows, renderedLen, currLen);
@ -167,7 +167,7 @@ int printCastCharacter(byte chr, int Tiles[SIDE_BUFFER_SIZE + 1][4], unsigned sh
printCastTiles(Tiles[i], baseArrangementsPointer + i, baseGraphicsPointer + (tileValue << 3), baseTileValue + tileValue);
}
copyTiles(Tiles, fullAlternatives);
copyTilesCast(Tiles, fullAlternatives);
}
else if(renderedLen > 0)
printCastCharacterInSingleTiles(Tiles, glyphRows, renderedLen, currLen);
@ -250,13 +250,13 @@ void printCastCharacterInSingleTiles(int Tiles[SIDE_BUFFER_SIZE + 1][4], byte *g
}
}
void copyTiles(int Tiles[SIDE_BUFFER_SIZE + 1][4], int indexMatrix)
void copyTilesCast(int Tiles[SIDE_BUFFER_SIZE + 1][4], int indexMatrix)
{
for(int i = 0; i < 4; i++)
Tiles[0][i] = Tiles[indexMatrix][i];
}
void setTilesToBlank(int *Tiles)
void setTilesToBlankCast(int *Tiles)
{
for(int i = 0; i < 4; i++)
Tiles[i] = 0;
@ -279,7 +279,7 @@ void printCastTiles(int Tiles[4], unsigned short *arrangements, int *graphics, u
}
}
int getCharWidth(byte chr)
int getCharWidthCast(byte chr)
{
//Gets the length for a character. Also handles special cases
switch(chr)
@ -290,15 +290,15 @@ int getCharWidth(byte chr)
case PC_START+1:
case PC_START+2:
case PC_START+3:
return getPCWidth(pc_names+(chr-PC_START)*(PC_NAME_SIZE + 2), PC_NAME_SIZE);
return getPCWidthCast(pc_names+(chr-PC_START)*(PC_NAME_SIZE + 2), PC_NAME_SIZE);
case PC_START+4:
return getPCWidth(pc_names+(chr-PC_START)*(PC_NAME_SIZE + 2), DOG_NAME_SIZE);
return getPCWidthCast(pc_names+(chr-PC_START)*(PC_NAME_SIZE + 2), DOG_NAME_SIZE);
default:
return m2_widths_table[CAST_FONT][chr] & 0xFF;
}
}
int getPCWidth(byte* pc_ptr, int max_size)
int getPCWidthCast(byte* pc_ptr, int max_size)
{
//Gets the length for a playable character's name.
//This is separate in order to avoid recursive issues caused by user's tinkering

View File

@ -20,15 +20,15 @@
void printPlayerNameCredits(unsigned short *arrangements);
void writeCastText(unsigned short *bg0Arrangements, unsigned short *bg1Arrangements);
int getCharWidth(byte chr);
int getPCWidth(byte* pc_ptr, int max_size);
void setTilesToBlank(int *Tiles);
int getCharWidthCast(byte chr);
int getPCWidthCast(byte* pc_ptr, int max_size);
void setTilesToBlankCast(int *Tiles);
void printCastTiles(int Tiles[4], unsigned short *arrangements, int *graphics, unsigned short tileValue);
int readCastCharacter(byte chr, int Tiles[SIDE_BUFFER_SIZE + 1][4], unsigned short *arrangements, int x, int tile_y, unsigned short *lastEdited);
int readCastCharacterName(byte* str, int Tiles[SIDE_BUFFER_SIZE + 1][4], unsigned short *arrangements, int x, int tile_y, int max_size, unsigned short *lastEdited);
void printCastCharacterInMultiTiles(int Tiles[SIDE_BUFFER_SIZE + 1][4], byte *glyphRows, int glyphLen, int currLen);
void printCastCharacterInSingleTiles(int Tiles[SIDE_BUFFER_SIZE + 1][4], byte *glyphRows, int glyphLen, int currLen);
void copyTiles(int Tiles[SIDE_BUFFER_SIZE + 1][4], int indexMatrix);
void copyTilesCast(int Tiles[SIDE_BUFFER_SIZE + 1][4], int indexMatrix);
int printCastCharacter(byte chr, int Tiles[SIDE_BUFFER_SIZE + 1][4], unsigned short *arrangements, int x, int tile_y, unsigned short *lastEdited);
extern byte m2_player1[];

View File

@ -11,11 +11,11 @@ void writeLumineHallText()
int currLenInTile = 0;
int currPos = 0;
int Tiles[4];
setTilesToBlank(Tiles);
setTilesToBlankLumine(Tiles);
//First things first, it calculates the total length of the text in pixels
while((*lumineText_curr_ptr) != END)
{
length += getCharWidth(*lumineText_curr_ptr);
length += getCharWidthLumine(*lumineText_curr_ptr);
lumineText_curr_ptr++;
}
//It then gets the length in arrangements. It also makes sure it's a number divisible by 8.
@ -81,7 +81,7 @@ void printLumineCharacter(byte chr, int *Tiles, int AlternativeTiles[SIDE_BUFFER
if(((*currLen) + chosenLen) >= 8)
{
for(int i = 0; i < SIDE_BUFFER_SIZE; i++)
setTilesToBlank(AlternativeTiles[i]);
setTilesToBlankLumine(AlternativeTiles[i]);
if(renderedLen > 0)
printLumineCharacterInMultiTiles(Tiles, AlternativeTiles, glyphRows, renderedLen, *currLen);
@ -96,7 +96,7 @@ void printLumineCharacter(byte chr, int *Tiles, int AlternativeTiles[SIDE_BUFFER
(*currPos)++;
}
copyTiles(Tiles, AlternativeTiles, fullAlternatives);
copyTilesLumine(Tiles, AlternativeTiles, fullAlternatives);
(*currLen) = ((*currLen) + chosenLen) & 7;
}
else
@ -115,7 +115,7 @@ void printEmptyLumineTile(int *Tiles, unsigned short *hallAddress, int length, i
else
{
printLumineTiles(Tiles, hallAddress, length, currPos);
setTilesToBlank(Tiles);
setTilesToBlankLumine(Tiles);
}
}
@ -213,13 +213,13 @@ void printLumineCharacterInSingleTiles(int *Tiles, byte *glyphRows, int glyphLen
}
}
void copyTiles(int *Tiles, int AlternativeTiles[SIDE_BUFFER_SIZE][4], int indexMatrix)
void copyTilesLumine(int *Tiles, int AlternativeTiles[SIDE_BUFFER_SIZE][4], int indexMatrix)
{
for(int i = 0; i < 4; i++)
Tiles[i] = AlternativeTiles[indexMatrix][i];
}
void setTilesToBlank(int *Tiles)
void setTilesToBlankLumine(int *Tiles)
{
for(int i = 0; i < 4; i++)
Tiles[i] = 0;
@ -264,7 +264,7 @@ void printVoidLumineTiles(unsigned short *hallAddress, int length, int currPos)
}
}
int getCharWidth(byte chr)
int getCharWidthLumine(byte chr)
{
//Gets the length for a character. Also handles special cases
switch(chr)
@ -277,13 +277,13 @@ int getCharWidth(byte chr)
case PC_START+1:
case PC_START+2:
case PC_START+3:
return getPCWidth(pc_names+(chr-PC_START)*(PC_NAME_SIZE + 2));
return getPCWidthLumine(pc_names+(chr-PC_START)*(PC_NAME_SIZE + 2));
default:
return m2_widths_table[LUMINE_FONT][chr] & 0xFF;
}
}
int getPCWidth(byte* pc_ptr)
int getPCWidthLumine(byte* pc_ptr)
{
//Gets the length for a playable character's name.
//This is separate in order to avoid recursive issues caused by user's tinkering

View File

@ -17,9 +17,9 @@
#define PC_NAME_SIZE 5
void writeLumineHallText();
int getCharWidth(byte chr);
int getPCWidth(byte* pc_ptr);
void setTilesToBlank(int *Tiles);
int getCharWidthLumine(byte chr);
int getPCWidthLumine(byte* pc_ptr);
void setTilesToBlankLumine(int *Tiles);
void printLumineTiles(int *Tiles, unsigned short *hallAddress, int length, int currPos);
void printVoidLumineTiles(unsigned short *hallAddress, int length, int currPos);
void printEmptyLumineTile(int *Tiles, unsigned short *hallAddress, int length, int currPos, int currLen);
@ -27,7 +27,7 @@ void readLumineCharacter(byte chr, int *Tiles, unsigned short *hallAddress, int
void readLumineCharacterName(byte* str, int *Tiles, int AlternativeTiles[SIDE_BUFFER_SIZE][4], unsigned short *hallAddress, int length, int *currPos, int *currLen);
void printLumineCharacterInMultiTiles(int *Tiles, int AlternativeTiles[SIDE_BUFFER_SIZE][4], byte *glyphRows, int glyphLen, int currLen);
void printLumineCharacterInSingleTiles(int *Tiles, byte *glyphRows, int glyphLen, int currLen);
void copyTiles(int *Tiles, int AlternativeTiles[SIDE_BUFFER_SIZE][4], int indexMatrix);
void copyTilesLumine(int *Tiles, int AlternativeTiles[SIDE_BUFFER_SIZE][4], int indexMatrix);
void printLumineCharacter(byte chr, int *Tiles, int AlternativeTiles[SIDE_BUFFER_SIZE][4], unsigned short *hallAddress, int length, int *currPos, int *currLen);