Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
obj/
bin/BLOCKS.bin
bin/BLOCKS.map

.vscode/
Binary file modified bin/BLOCKS.8xp
Binary file not shown.
Binary file added icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ is an artifact of the emulator, and doesn't show up when running on real hardwar
2. Download the [CE C Standard Libraries](https://github.com/CE-Programming/libraries/releases/tag/v11.2).
3. Load both onto your calculator using the [TI Connect™ CE software](https://education.ti.com/en/products/computer-software/ti-connect-ce-sw).
4. Run the ASM program either with `Asm(prgmBLOCKS)` or your favorite graphical shell.
5. The world select menu should appear. Select an empty save slot and press enter to generate a new world.
5. The main menu should appear. Then press "Play!" and the world select menu will appear. Select an empty save slot and press enter to generate a new world.

**Warning:** This program takes up a lot of RAM on the calculator, and doesn't always do so gracefully. It doesn't happen very often, but in the case where you get it to crash **you will need to reset your calculator**, which will clear any unarchived data in RAM. It's best to just archive anything you wouldn't want to lose before running this. Not only does it protect that data from crashes, but it frees up more memory for the game.
**Warning:** This program takes up a lot of RAM on the calculator, and doesn't always do so gracefully. It doesn't happen very often, but in the case where you get it to crash **you will need to reset your calculator**, which will clear any unarchived data in RAM. It's best to just archive anything you wouldn't want to lose before running this. Not only does it protect that data from crashes, but it frees up more memory for the game. Archiving the program(prgmBLOCKS) as well may be necessary to run it.

## Controls

Expand Down
76 changes: 75 additions & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,79 @@ void world_select() {
}
}

void home_menu() {
uint8_t selection = 4;

while(true) {
gfx_SetDrawScreen();

gfx_SetColor(4);
gfx_FillRectangle(UI_BORDER, UI_BORDER, LCD_WIDTH - 2 * UI_BORDER, LCD_HEIGHT - 2 * UI_BORDER);

init_palette();

draw_block((int24_t) ( ( LCD_WIDTH - 2 * UI_BORDER ) / 2 ) + BLOCK_WIDTH / 2, (int24_t) ( LCD_HEIGHT - 2 * UI_BORDER ) / 3, (uint8_t*)textures[1]);

init_ui_palette();

gfx_SetTextFGColor(0);
gfx_PrintStringXY("Isometric Block Game", ( ( LCD_WIDTH - 2 * UI_BORDER ) / 2 ) - 55, ( ( LCD_HEIGHT - 2 * UI_BORDER ) / 3 ) + BLOCK_HEIGHT + 8);

gfx_SetTextFGColor(0);
gfx_PrintStringXY("Play!", ( LCD_WIDTH - 2 * UI_BORDER ) / 2, LCD_HEIGHT - UI_BORDER - 16 - 8 - 32);

gfx_SetTextFGColor(0);
gfx_PrintStringXY("Quit", ( LCD_WIDTH - 2 * UI_BORDER ) / 2, LCD_HEIGHT - UI_BORDER - 16 - 8);


uint8_t selection_old = selection ^ 1;

sk_key_t key;

do
{

if(selection != selection_old) {
gfx_SetColor(4);
gfx_Rectangle(UI_BORDER + 8,
UI_BORDER + 12 + selection_old * 32,
LCD_WIDTH - UI_BORDER - UI_BORDER - 8 - 8, 24);

gfx_SetColor(3);
gfx_Rectangle(UI_BORDER + 8,
UI_BORDER + 12 + selection * 32,
LCD_WIDTH - UI_BORDER - UI_BORDER - 8 - 8, 24);
}

selection_old = selection;

key = os_GetCSC();

switch (key)
{
case sk_Down:
if(selection < SAVE_CNT)
selection++;
break;
case sk_Up:
if(selection > 4)
selection--;
break;
case sk_Enter:
// Break from the program when the last option (quit) is selected
if(selection == SAVE_CNT) return;
world_select();
break;

default:
break;
}

// Exit the inner loop every time something gets selected
} while (key != sk_Enter && key != sk_Del);
}
}

void init () {
// Set right face textures to always to be in shadow
for(int i = 0; i < TEX_CNT; i++) {
Expand All @@ -350,7 +423,8 @@ void init () {

init_ui_palette();

world_select();
//world_select();
home_menu();
}

int main(void)
Expand Down