From c426d0e9295a99564fb0bb76ce4789017d0e71ad Mon Sep 17 00:00:00 2001 From: Dominic Masters Date: Sat, 8 Jan 2022 21:44:02 -0800 Subject: [PATCH] =?UTF-8?q?Bruh=3F=20=F0=9F=98=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/strings.js | 4 +- package.json | 4 +- src/conversation/pause.c | 24 +++++ src/conversation/pause.h | 17 ++++ src/conversation/queue.c | 36 ++++++++ src/conversation/queue.h | 16 ++++ src/{ => conversation}/textbox.c | 30 +++++-- src/{ => conversation}/textbox.h | 16 ++-- src/{common_tiles.c => display/common.c} | 2 +- src/{common_tiles.h => display/common.h} | 2 +- src/{memory.h => display/tilemap.h} | 0 src/{tiles.h => input.c} | 5 +- src/libs.h | 4 +- src/main.c | 52 ++++++----- src/main.h | 23 +++++ src/poker/card.h | 107 +++++++++++++++++++++++ src/poker/player.h | 29 ++++++ src/poker/poker.c | 88 +++++++++++++++++++ src/poker/poker.h | 27 ++++++ src/time.c | 2 +- src/time.h | 3 +- 21 files changed, 445 insertions(+), 46 deletions(-) create mode 100644 src/conversation/pause.c create mode 100644 src/conversation/pause.h create mode 100644 src/conversation/queue.c create mode 100644 src/conversation/queue.h rename src/{ => conversation}/textbox.c (77%) rename src/{ => conversation}/textbox.h (82%) rename src/{common_tiles.c => display/common.c} (95%) rename src/{common_tiles.h => display/common.h} (94%) rename src/{memory.h => display/tilemap.h} (100%) rename src/{tiles.h => input.c} (74%) create mode 100644 src/main.h create mode 100644 src/poker/card.h create mode 100644 src/poker/player.h create mode 100644 src/poker/poker.c create mode 100644 src/poker/poker.h diff --git a/assets/strings.js b/assets/strings.js index 26e6386..015504d 100644 --- a/assets/strings.js +++ b/assets/strings.js @@ -1,5 +1,7 @@ const GAME_STRINGS = { - 'HELLO': 'Hello World!\nHow are you today?\nThank god!' + 'HELLO': 'Hello World!\nHow are you today?\nThank god!', + + 'POKER_GAME_START': 'Poker game started!' }; module.exports = { GAME_STRINGS }; \ No newline at end of file diff --git a/package.json b/package.json index 76a77be..1c04100 100644 --- a/package.json +++ b/package.json @@ -7,8 +7,8 @@ "license": "MIT", "scripts": { "clean": "node ./scripts/clean", - "build": "node ./scripts/build", - "start": "bgb64.exe ./build/Penny.gb" + "build": "npm run clean && node ./scripts/build", + "start": "npm run build && bgb64.exe ./build/Penny.gb" }, "dependencies": { "pngjs": "^6.0.0", diff --git a/src/conversation/pause.c b/src/conversation/pause.c new file mode 100644 index 0000000..01e3412 --- /dev/null +++ b/src/conversation/pause.c @@ -0,0 +1,24 @@ +/** + * Copyright (c) 2022 Dominic Masters + * + * This software is released under the MIT License. + * https://opensource.org/licenses/MIT + */ + +#include "pause.h" + +uint16_t PAUSE_END; + +void conversationPauseInit() { + PAUSE_END = 0; +} + +void conversationPause(uint16_t duration) { + PAUSE_END = TIME_CURRENT + (duration * TIME_PER_SECOND); +} + +void conversationPauseUpdate() { + if(PAUSE_END == 0 || TIME_CURRENT != PAUSE_END) return; + conversationQueueNext(); + PAUSE_END = 0; +} \ No newline at end of file diff --git a/src/conversation/pause.h b/src/conversation/pause.h new file mode 100644 index 0000000..d3668a4 --- /dev/null +++ b/src/conversation/pause.h @@ -0,0 +1,17 @@ +/** + * Copyright (c) 2022 Dominic Masters + * + * This software is released under the MIT License. + * https://opensource.org/licenses/MIT + */ + +#pragma once +#include "../libs.h" +#include "../time.h" +#include "queue.h" + +extern uint16_t PAUSE_END; + +void conversationPauseInit(); +void conversationPause(uint16_t duration); +void conversationPauseUpdate(); \ No newline at end of file diff --git a/src/conversation/queue.c b/src/conversation/queue.c new file mode 100644 index 0000000..da99829 --- /dev/null +++ b/src/conversation/queue.c @@ -0,0 +1,36 @@ +/** + * Copyright (c) 2022 Dominic Masters + * + * This software is released under the MIT License. + * https://opensource.org/licenses/MIT + */ + +#include "queue.h" +#include "pause.h" +#include "textbox.h" + +uint16_t QUEUE_ITEM; + +void conversationQueueInit() { + QUEUE_ITEM = 0; +} + +void conversationQueueNext() { + BGB_printf("Queue item: %d\n", QUEUE_ITEM); + + switch(QUEUE_ITEM) { + case 0: + conversationTextboxSetText(STR_POKER_GAME_START_DATA, STR_POKER_GAME_START_LENGTH); + QUEUE_ITEM++; + break; + + case 1: + conversationPause(3); + QUEUE_ITEM++; + break; + + case 2: + conversationTextboxSetText(STR_POKER_GAME_START_DATA, STR_POKER_GAME_START_LENGTH); + break; + } +} \ No newline at end of file diff --git a/src/conversation/queue.h b/src/conversation/queue.h new file mode 100644 index 0000000..efad1ad --- /dev/null +++ b/src/conversation/queue.h @@ -0,0 +1,16 @@ +/** + * Copyright (c) 2022 Dominic Masters + * + * This software is released under the MIT License. + * https://opensource.org/licenses/MIT + */ + +#pragma once +#include "../libs.h" +#include "HELLO.h" +#include "POKER_GAME_START.h" + +extern uint16_t QUEUE_ITEM; + +void conversationQueueInit(); +void conversationQueueNext(); \ No newline at end of file diff --git a/src/textbox.c b/src/conversation/textbox.c similarity index 77% rename from src/textbox.c rename to src/conversation/textbox.c index b9660e3..6f37a04 100644 --- a/src/textbox.c +++ b/src/conversation/textbox.c @@ -13,7 +13,7 @@ uint8_t TEXTBOX_STATE; uint8_t TEXTBOX_SCROLL; uint8_t TEXTBOX_TILES[TEXTBOX_TILES_MAX]; -void textboxInit() { +void conversationTextboxInit() { uint8_t i; // Reset textbox state @@ -44,13 +44,14 @@ void textboxInit() { } } -void textboxSetText(char *text, uint8_t length) { +void conversationTextboxSetText(char *text, uint8_t length) { uint8_t i, j; // Reset textbox state TEXTBOX_TEXT = text; TEXTBOX_TEXT_LENGTH = length; TEXTBOX_STATE = TEXTBOX_STATE_VISIBLE; + TEXTBOX_SCROLL = 0; // Fill blank characters for(j = 0; j < TEXTBOX_CHAR_ROWS; j++) { @@ -69,36 +70,47 @@ void textboxSetText(char *text, uint8_t length) { SHOW_WIN; } -void textboxClose() { - TEXTBOX_STATE &= ~TEXTBOX_STATE_VISIBLE; - HIDE_WIN; -} - -void textboxUpdate() { +void conversationTextboxUpdate() { uint8_t i, j; + // Is the textbox visible? if(!(TEXTBOX_STATE & TEXTBOX_STATE_VISIBLE)) return; + + // Has the textbox finished scrolling? if(TEXTBOX_STATE & TEXTBOX_STATE_SCROLLED) { + // Is the player attempting to close the textbox? + if(INPUT_STATE & J_A) { + TEXTBOX_STATE &= ~TEXTBOX_STATE_VISIBLE; + HIDE_WIN; + conversationQueueNext(); + } return; } + // Move to the next character. TEXTBOX_SCROLL++; j = TEXTBOX_WIDTH_IN_TILES + 1; for(i = 0; i < TEXTBOX_SCROLL; i++) { + // Whitespace, do nothing. if(TEXTBOX_TEXT[i] == ' ') { j++; continue; } + + // Newline character, move the next tile to the next row. if(TEXTBOX_TEXT[i] == '\n') { j = ( (j / TEXTBOX_WIDTH_IN_TILES)*TEXTBOX_WIDTH_IN_TILES ) + TEXTBOX_WIDTH_IN_TILES + 1; continue; } + + // Reveal the next character TEXTBOX_TILES[j] = TEXTBOX_TEXT[i]; j++; } + // Update the window tilemap set_win_tiles( 0, 0, TEXTBOX_WIDTH_IN_TILES, @@ -106,6 +118,8 @@ void textboxUpdate() { TEXTBOX_TILES ); + // Update state. TODO: I actually don't really need this state, it's just here + // incase I want to check if the state has scrolled later on? Doubt it though. if(TEXTBOX_SCROLL == TEXTBOX_TEXT_LENGTH) { TEXTBOX_STATE |= TEXTBOX_STATE_SCROLLED; } diff --git a/src/textbox.h b/src/conversation/textbox.h similarity index 82% rename from src/textbox.h rename to src/conversation/textbox.h index dcd5d9f..1402bbd 100644 --- a/src/textbox.h +++ b/src/conversation/textbox.h @@ -6,10 +6,12 @@ */ #pragma once -#include "libs.h" -#include "util.h" -#include "common_tiles.h" -#include "memory.h" +#include "../libs.h" +#include "../util.h" +#include "../input.h" +#include "../display/common.h" +#include "../display/tilemap.h" +#include "queue.h" #define BORDER_TILE_TOP_LEFT BORDER_DATA_POSITION #define BORDER_TILE_TOP_CENTER BORDER_TILE_TOP_LEFT + 1 @@ -41,6 +43,6 @@ extern uint8_t TEXTBOX_STATE; extern uint8_t TEXTBOX_SCROLL; extern uint8_t TEXTBOX_TILES[]; -void textboxInit(); -void textboxSetText(char *text, uint8_t length); -void textboxUpdate(); \ No newline at end of file +void conversationTextboxInit(); +void conversationTextboxSetText(char *text, uint8_t length); +void conversationTextboxUpdate(); \ No newline at end of file diff --git a/src/common_tiles.c b/src/display/common.c similarity index 95% rename from src/common_tiles.c rename to src/display/common.c index 47a43b0..1d3c93a 100644 --- a/src/common_tiles.c +++ b/src/display/common.c @@ -5,7 +5,7 @@ * https://opensource.org/licenses/MIT */ -#include "common_tiles.h" +#include "common.h" const uint8_t COMMON_TILES[] = { 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, diff --git a/src/common_tiles.h b/src/display/common.h similarity index 94% rename from src/common_tiles.h rename to src/display/common.h index 8d61f9d..037c10d 100644 --- a/src/common_tiles.h +++ b/src/display/common.h @@ -6,7 +6,7 @@ */ #pragma once -#include "libs.h" +#include "../libs.h" #define COMMON_TILE_COUNT 0x04 diff --git a/src/memory.h b/src/display/tilemap.h similarity index 100% rename from src/memory.h rename to src/display/tilemap.h diff --git a/src/tiles.h b/src/input.c similarity index 74% rename from src/tiles.h rename to src/input.c index e5affd8..6e2f10f 100644 --- a/src/tiles.h +++ b/src/input.c @@ -5,5 +5,6 @@ * https://opensource.org/licenses/MIT */ -#pragma once -#include "libs.h" \ No newline at end of file +#include "input.h" + +uint8_t INPUT_STATE = 0x00; diff --git a/src/libs.h b/src/libs.h index 22bfa03..ee46485 100644 --- a/src/libs.h +++ b/src/libs.h @@ -7,6 +7,8 @@ #pragma once #include +#include #include #include -#include \ No newline at end of file +#include +#include \ No newline at end of file diff --git a/src/main.c b/src/main.c index b3ce78f..c816835 100644 --- a/src/main.c +++ b/src/main.c @@ -5,48 +5,58 @@ * https://opensource.org/licenses/MIT */ -#include "libs.h" -#include "textbox.h" -#include "time.h" -#include "common_tiles.h" -#include "memory.h" -#include "HELLO.h" +#include "main.h" void main() { int16_t j; - uint8_t filled[0x20*0x20]; + uint8_t filled[GB_BACKGROUND_COLUMNS*GB_BACKGROUND_ROWS]; + // Set up the GAMEBOY's registers. disable_interrupts(); DISPLAY_OFF; LCDC_REG = LCDCF_OFF | LCDCF_WIN9C00 | LCDCF_BG8800 | LCDCF_BG9800 | LCDCF_BGON; - BGP_REG = OBP0_REG = OBP1_REG = 0xE4U; + BGP_REG = 0xE4U; - // Prepare tiles. + // Init the random seed + initarand(DIV_REG); + + // Prepare time and input + TIME_CURRENT = 0; + INPUT_STATE = joypad(); + + // Init things commonTilesInit(); - textboxInit(); - set_bkg_data(SM_DATA_POSITION, SM_IMAGE_TILES, SM_IMAGE); + conversationTextboxInit(); + conversationPauseInit(); + conversationQueueInit(); + pokerInit(); // Fill screen white for(j = 0; j < 0x20*0x20; j++) filled[j] = COMMON_TILE_3; - set_bkg_tiles(0x00, 0x00, 0x20, 0x20, filled); - - uint8_t sm[SM_IMAGE_TILES]; - for(j = 0; j < SM_IMAGE_TILES; j++) sm[j] = j + SM_DATA_POSITION; - set_bkg_tiles(0x00, 0x00, SM_IMAGE_COLUMNS, SM_IMAGE_ROWS, sm); - + set_bkg_tiles(0x00, 0x00, GB_BACKGROUND_COLUMNS, GB_BACKGROUND_ROWS, filled); SCX_REG = 0x00; SCY_REG = 0x00; + // Now turn the screen on DISPLAY_ON; enable_interrupts(); wait_vbl_done(); - // Testing. - textboxSetText(STR_HELLO_DATA, STR_HELLO_LENGTH); + // Alright begin the game logic here. + conversationQueueNext(); + // Begin the loop while(1) { + // Wait for VSYNC wait_vbl_done(); - textboxUpdate(); - time++; + + // Update the input state + INPUT_STATE = joypad(); + + conversationTextboxUpdate(); + conversationPauseUpdate(); + + // Tick time. + TIME_CURRENT++; } } diff --git a/src/main.h b/src/main.h new file mode 100644 index 0000000..0b0914d --- /dev/null +++ b/src/main.h @@ -0,0 +1,23 @@ +/** + * Copyright (c) 2022 Dominic Masters + * + * This software is released under the MIT License. + * https://opensource.org/licenses/MIT + */ + +#pragma once + +#include "libs.h" +#include "time.h" + +#include "display/common.h" +#include "display/tilemap.h" +#include "poker/poker.h" +#include "conversation/pause.h" +#include "conversation/queue.h" +#include "conversation/textbox.h" + +#define GB_BACKGROUND_COLUMNS 0x20 +#define GB_BACKGROUND_ROWS 0x20 + +void main(); \ No newline at end of file diff --git a/src/poker/card.h b/src/poker/card.h new file mode 100644 index 0000000..7bfdf05 --- /dev/null +++ b/src/poker/card.h @@ -0,0 +1,107 @@ +/** + * Copyright (c) 2022 Dominic Masters + * + * This software is released under the MIT License. + * https://opensource.org/licenses/MIT + */ + +#pragma once +#include "../libs.h" + +//////////////////////////////////////////////////////////////////////////////// +// Cards +//////////////////////////////////////////////////////////////////////////////// + +// Aces +#define CARD_CLUBS_TWO 0x00 +#define CARD_CLUBS_THREE 0x01 +#define CARD_CLUBS_FOUR 0x02 +#define CARD_CLUBS_FIVE 0x03 +#define CARD_CLUBS_SIX 0x04 +#define CARD_CLUBS_SEVEN 0x05 +#define CARD_CLUBS_EIGHT 0x06 +#define CARD_CLUBS_NINE 0x07 +#define CARD_CLUBS_TEN 0x08 +#define CARD_CLUBS_JACK 0x09 +#define CARD_CLUBS_QUEEN 0x0A +#define CARD_CLUBS_KING 0x0B +#define CARD_CLUBS_ACE 0x0C + +// Diamonds +#define CARD_DIAMONDS_TWO 0x0D +#define CARD_DIAMONDS_THREE 0x0E +#define CARD_DIAMONDS_FOUR 0x0F +#define CARD_DIAMONDS_FIVE 0x10 +#define CARD_DIAMONDS_SIX 0x11 +#define CARD_DIAMONDS_SEVEN 0x12 +#define CARD_DIAMONDS_EIGHT 0x13 +#define CARD_DIAMONDS_NINE 0x14 +#define CARD_DIAMONDS_TEN 0x15 +#define CARD_DIAMONDS_JACK 0x16 +#define CARD_DIAMONDS_QUEEN 0x17 +#define CARD_DIAMONDS_KING 0x18 +#define CARD_DIAMONDS_ACE 0x19 + +// Hearts +#define CARD_HEARTS_TWO 0x1A +#define CARD_HEARTS_THREE 0x1B +#define CARD_HEARTS_FOUR 0x1C +#define CARD_HEARTS_FIVE 0x1D +#define CARD_HEARTS_SIX 0x1E +#define CARD_HEARTS_SEVEN 0x1F +#define CARD_HEARTS_EIGHT 0x20 +#define CARD_HEARTS_NINE 0x21 +#define CARD_HEARTS_TEN 0x22 +#define CARD_HEARTS_JACK 0x23 +#define CARD_HEARTS_QUEEN 0x24 +#define CARD_HEARTS_KING 0x25 +#define CARD_HEARTS_ACE 0x26 + +// Spades +#define CARD_SPADES_TWO 0x27 +#define CARD_SPADES_THREE 0x28 +#define CARD_SPADES_FOUR 0x29 +#define CARD_SPADES_FIVE 0x2A +#define CARD_SPADES_SIX 0x2B +#define CARD_SPADES_SEVEN 0x2C +#define CARD_SPADES_EIGHT 0x2D +#define CARD_SPADES_NINE 0x2E +#define CARD_SPADES_TEN 0x2F +#define CARD_SPADES_JACK 0x30 +#define CARD_SPADES_QUEEN 0x31 +#define CARD_SPADES_KING 0x32 +#define CARD_SPADES_ACE 0x33 + +//////////////////////////////////////////////////////////////////////////////// +// Suits +//////////////////////////////////////////////////////////////////////////////// +#define CARD_SUIT_CLUBS 0x00 +#define CARD_SUIT_DIAMONDS 0x01 +#define CARD_SUIT_HEARTS 0x02 +#define CARD_SUIT_SPADES 0x03 + +//////////////////////////////////////////////////////////////////////////////// +// Card numbers +//////////////////////////////////////////////////////////////////////////////// +#define CARD_TWO 0x00 +#define CARD_THREE 0x01 +#define CARD_FOUR 0x02 +#define CARD_FIVE 0x03 +#define CARD_SIX 0x04 +#define CARD_SEVEN 0x05 +#define CARD_EIGHT 0x06 +#define CARD_NINE 0x07 +#define CARD_TEN 0x08 +#define CARD_JACK 0x09 +#define CARD_QUEEN 0x0A +#define CARD_KING 0x0B +#define CARD_ACE 0x0C + +/** Count of cards in each suit */ +#define CARD_COUNT_PER_SUIT 13 + +/** Count of suits */ +#define CARD_SUIT_COUNT 4 + +/** Standard Card Deck Size */ +#define CARD_DECK_SIZE 52 \ No newline at end of file diff --git a/src/poker/player.h b/src/poker/player.h new file mode 100644 index 0000000..2da0f9a --- /dev/null +++ b/src/poker/player.h @@ -0,0 +1,29 @@ +/** + * Copyright (c) 2022 Dominic Masters + * + * This software is released under the MIT License. + * https://opensource.org/licenses/MIT + */ + +#pragma once +#include "../libs.h" +#include "card.h" + +#define POKER_PLAYER_COUNT_MAX 4 +#define POKER_PLAYER_HAND_SIZE_MAX 2 + +#define POKER_PLAYER_STATE_FOLDED 1 << 0 +#define POKER_PLAYER_STATE_OUT 1 << 1 +#define POKER_PLAYER_STATE_HAS_BET_THIS_ROUND 1 << 2 +// #define POKER_PLAYER_STATE_SHOWING 1 << 3 + +typedef struct { + uint16_t chips; + uint8_t hand[POKER_PLAYER_HAND_SIZE_MAX]; + uint8_t state; + + // int32_t currentBet; + // uint8_t timesRaised; +} pokerplayer_t; + +extern pokerplayer_t POKER_PLAYERS[]; \ No newline at end of file diff --git a/src/poker/poker.c b/src/poker/poker.c new file mode 100644 index 0000000..8db9d00 --- /dev/null +++ b/src/poker/poker.c @@ -0,0 +1,88 @@ +/** + * Copyright (c) 2022 Dominic Masters + * + * This software is released under the MIT License. + * https://opensource.org/licenses/MIT + */ + +#include "poker.h" + +pokerplayer_t POKER_PLAYERS[POKER_PLAYER_COUNT_MAX]; +uint8_t POKER_DECK[CARD_DECK_SIZE]; +uint8_t POKER_DECK_SIZE; + +uint8_t POKER_COMMUNITY[POKER_COMMUNITY_SIZE_MAX]; +uint8_t POKER_COMMUNITY_SIZE; + +uint8_t POKER_PLAYER_DEALER; +uint8_t POKER_PLAYER_SMALL_BLIND; +uint8_t POKER_PLAYER_BIG_BLIND; + +void pokerInit() { + uint8_t i; + + // Set up players + for(i = 0; i < POKER_PLAYER_COUNT_MAX; i++) { + POKER_PLAYERS[i].chips = 10000; + POKER_PLAYERS[i].state = 0; + } + + // Set up the initial state. + // TODO: Should this be randomized? + POKER_PLAYER_DEALER = 0; + + // Reset the round state (For the first round) + pokerNewRound(); +} + +void pokerNewRound() { + uint8_t i, j, k; + uint8_t found; + + // Reset round state + POKER_COMMUNITY_SIZE = 0; + + // Fill deck + for(i = 0; i < CARD_DECK_SIZE; i++) POKER_DECK[i] = i; + POKER_DECK_SIZE = CARD_DECK_SIZE; + + // Shuffle Deck + for(i = CARD_DECK_SIZE-1; i > 0; i--) { + k = POKER_DECK[i]; + j = rand() % (i+1); + POKER_DECK[i] = POKER_DECK[j]; + POKER_DECK[j] = k; + } + + // Reset Players and decide new blinds. + found = 0; + POKER_PLAYER_DEALER++; + + for(i = 0; i < POKER_PLAYER_COUNT_MAX; i++) { + POKER_PLAYERS[i].state &= ~( + POKER_PLAYER_STATE_FOLDED | + POKER_PLAYER_STATE_HAS_BET_THIS_ROUND + ); + + // Have we found the dealer, small blind, and big blind players? + if(found != 3 && (POKER_PLAYERS[i].state & POKER_PLAYER_STATE_OUT) == 0){ + k = (POKER_PLAYER_DEALER + i) % POKER_PLAYER_COUNT_MAX; + + if(found == 0) {// Have we found the dealer? + POKER_PLAYER_DEALER = i; + found++; + } else if(found == 1) {// Have we found the small blind? + POKER_PLAYER_SMALL_BLIND = i; + found++; + } else if(found == 2) {// Have we found the big blind? + POKER_PLAYER_BIG_BLIND = i; + found++; + } + } + + // Deal two cards to the player. + for(j = 0; j < POKER_PLAYER_HAND_SIZE_MAX; j++) { + POKER_PLAYERS[i].hand[j] = POKER_DECK[POKER_DECK_SIZE--]; + } + } +} \ No newline at end of file diff --git a/src/poker/poker.h b/src/poker/poker.h new file mode 100644 index 0000000..0ca9902 --- /dev/null +++ b/src/poker/poker.h @@ -0,0 +1,27 @@ +/** + * Copyright (c) 2022 Dominic Masters + * + * This software is released under the MIT License. + * https://opensource.org/licenses/MIT + */ + +#pragma once +#include "../libs.h" +#include "card.h" +#include "player.h" + +#define POKER_COMMUNITY_SIZE_MAX 5 + +extern uint8_t POKER_DECK[]; +extern uint8_t POKER_DECK_SIZE; + +extern uint8_t POKER_COMMUNITY[]; +extern uint8_t POKER_COMMUNITY_SIZE; + +extern uint8_t POKER_PLAYER_DEALER; +extern uint8_t POKER_PLAYER_SMALL_BLIND; +extern uint8_t POKER_PLAYER_BIG_BLIND; + +void pokerInit(); + +void pokerNewRound(); \ No newline at end of file diff --git a/src/time.c b/src/time.c index dde632a..0dd0f29 100644 --- a/src/time.c +++ b/src/time.c @@ -7,4 +7,4 @@ #include "time.h" -uint8_t time = 0; \ No newline at end of file +uint16_t TIME_CURRENT; \ No newline at end of file diff --git a/src/time.h b/src/time.h index 9a2e498..2c4f6d3 100644 --- a/src/time.h +++ b/src/time.h @@ -8,4 +8,5 @@ #pragma once #include "libs.h" -extern uint8_t time; \ No newline at end of file +#define TIME_PER_SECOND 60 +extern uint16_t TIME_CURRENT; \ No newline at end of file