Adding new textbox stuff
This commit is contained in:
114
src/main.c
114
src/main.c
@@ -7,11 +7,11 @@
|
||||
|
||||
#include "main.h"
|
||||
|
||||
uint8_t mainGetChar(char c) {
|
||||
inline uint8_t mainGetChar(char c) {
|
||||
return c - 33 + 4;
|
||||
}
|
||||
|
||||
void mainBufferChar(uint8_t card, uint8_t *tiles) {
|
||||
inline void mainBufferChar(uint8_t card, uint8_t *tiles) {
|
||||
uint8_t suit, number;
|
||||
|
||||
if(card >= CARD_DECK_SIZE) {
|
||||
@@ -81,6 +81,55 @@ void mainBufferChar(uint8_t card, uint8_t *tiles) {
|
||||
}
|
||||
}
|
||||
|
||||
inline void mainDebugDraw() {
|
||||
uint8_t j;
|
||||
|
||||
// DEBUG DRAW
|
||||
uint8_t tiles[10];
|
||||
for(j = 0; j < POKER_PLAYER_COUNT; j++) {
|
||||
mainBufferChar(POKER_PLAYERS[j].hand[0], tiles);
|
||||
mainBufferChar(POKER_PLAYERS[j].hand[1], tiles + 2);
|
||||
|
||||
tiles[4] = COMMON_TILE_3;
|
||||
|
||||
if((POKER_PLAYERS[j].state & POKER_PLAYER_STATE_FOLDED) == 0) {
|
||||
tiles[5] = COMMON_TILE_3;
|
||||
} else {
|
||||
tiles[5] = mainGetChar('F');
|
||||
}
|
||||
|
||||
if((POKER_PLAYERS[j].state & POKER_PLAYER_STATE_HAS_BET_THIS_ROUND) == 0) {
|
||||
tiles[6] = COMMON_TILE_3;
|
||||
} else {
|
||||
tiles[6] = mainGetChar('H');
|
||||
}
|
||||
|
||||
if((POKER_PLAYERS[j].state & POKER_PLAYER_STATE_OUT) == 0) {
|
||||
tiles[7] = COMMON_TILE_3;
|
||||
} else {
|
||||
tiles[7] = mainGetChar('O');
|
||||
}
|
||||
|
||||
if(j == POKER_PLAYER_BETTER) {
|
||||
tiles[8] = mainGetChar('<');
|
||||
} else {
|
||||
tiles[8] = COMMON_TILE_3;
|
||||
}
|
||||
set_bkg_tiles(0x00, j, 9, 1, tiles);
|
||||
}
|
||||
|
||||
for(j = 0; j < POKER_COMMUNITY_SIZE_MAX; j++) {
|
||||
if(j >= POKER_COMMUNITY_SIZE) {
|
||||
tiles[j*2] = COMMON_TILE_3;
|
||||
tiles[(j*2) + 1] = COMMON_TILE_3;
|
||||
} else {
|
||||
mainBufferChar(POKER_COMMUNITY[j], tiles + (j * 2));
|
||||
}
|
||||
}
|
||||
|
||||
set_bkg_tiles(0x00, POKER_PLAYER_COUNT + 1, 10, 1, tiles);
|
||||
}
|
||||
|
||||
void main() {
|
||||
int16_t j;
|
||||
uint8_t filled[GB_BACKGROUND_COLUMNS*GB_BACKGROUND_ROWS];
|
||||
@@ -101,8 +150,8 @@ void main() {
|
||||
timeInit();
|
||||
commonTilesInit();
|
||||
conversationTextboxInit();
|
||||
conversationQueueInit();
|
||||
pokerInit();
|
||||
// conversationQueueInit();
|
||||
// pokerInit();
|
||||
|
||||
// Fill screen white
|
||||
for(j = 0; j < 0x20*0x20; j++) filled[j] = COMMON_TILE_3;
|
||||
@@ -116,7 +165,11 @@ void main() {
|
||||
wait_vbl_done();
|
||||
|
||||
// Alright begin the game logic here.
|
||||
conversationQueueNext();
|
||||
// conversationQueueNext();
|
||||
char DEBUG_TEXT[] = "HEY";
|
||||
uint8_t DEBUG_TEXT_LENGTH = 3;
|
||||
for(j = 0; j < DEBUG_TEXT_LENGTH; j++) DEBUG_TEXT[j] = DEBUG_TEXT[j] - 33 + 4;
|
||||
conversationTextboxSetText(DEBUG_TEXT, DEBUG_TEXT_LENGTH);
|
||||
|
||||
// Begin the loop
|
||||
while(1) {
|
||||
@@ -127,55 +180,10 @@ void main() {
|
||||
INPUT_STATE = joypad();
|
||||
|
||||
conversationTextboxUpdate();
|
||||
conversationPauseUpdate();
|
||||
conversationFadeUpdate();
|
||||
// conversationPauseUpdate();
|
||||
// conversationFadeUpdate();
|
||||
|
||||
|
||||
|
||||
// DEBUG DRAW
|
||||
uint8_t tiles[10];
|
||||
for(j = 0; j < POKER_PLAYER_COUNT; j++) {
|
||||
mainBufferChar(POKER_PLAYERS[j].hand[0], tiles);
|
||||
mainBufferChar(POKER_PLAYERS[j].hand[1], tiles + 2);
|
||||
|
||||
tiles[4] = COMMON_TILE_3;
|
||||
|
||||
if((POKER_PLAYERS[j].state & POKER_PLAYER_STATE_FOLDED) == 0) {
|
||||
tiles[5] = COMMON_TILE_3;
|
||||
} else {
|
||||
tiles[5] = mainGetChar('F');
|
||||
}
|
||||
|
||||
if((POKER_PLAYERS[j].state & POKER_PLAYER_STATE_HAS_BET_THIS_ROUND) == 0) {
|
||||
tiles[6] = COMMON_TILE_3;
|
||||
} else {
|
||||
tiles[6] = mainGetChar('H');
|
||||
}
|
||||
|
||||
if((POKER_PLAYERS[j].state & POKER_PLAYER_STATE_OUT) == 0) {
|
||||
tiles[7] = COMMON_TILE_3;
|
||||
} else {
|
||||
tiles[7] = mainGetChar('O');
|
||||
}
|
||||
|
||||
if(j == POKER_PLAYER_BETTER) {
|
||||
tiles[8] = mainGetChar('<');
|
||||
} else {
|
||||
tiles[8] = COMMON_TILE_3;
|
||||
}
|
||||
set_bkg_tiles(0x00, j, 9, 1, tiles);
|
||||
}
|
||||
|
||||
for(j = 0; j < POKER_COMMUNITY_SIZE_MAX; j++) {
|
||||
if(j >= POKER_COMMUNITY_SIZE) {
|
||||
tiles[j*2] = COMMON_TILE_3;
|
||||
tiles[(j*2) + 1] = COMMON_TILE_3;
|
||||
} else {
|
||||
mainBufferChar(POKER_COMMUNITY[j], tiles + (j * 2));
|
||||
}
|
||||
}
|
||||
|
||||
set_bkg_tiles(0x00, POKER_PLAYER_COUNT + 1, 10, 1, tiles);
|
||||
// mainDebugDraw():
|
||||
|
||||
// Tick time.
|
||||
timeUpdate();
|
||||
|
Reference in New Issue
Block a user