Added more stuff to the end round, made the blind token a sprite and toned dow n the background animation a bit.

This commit is contained in:
cellos51
2025-06-30 03:18:04 -04:00
parent 869cec0ecf
commit c58b569516
10 changed files with 98 additions and 18 deletions
+18 -15
View File
@@ -5,12 +5,13 @@
#include "sprite.h"
#include "card.h"
#include "game.h"
#include "blind.h"
// Graphics
#include "deck_gfx.h"
#include "background_gfx.h"
#include "background_play_gfx.h"
#include "nums.h"
#include "affine_background_gfx.h"
// Audio
#include "soundbank.h"
@@ -25,16 +26,16 @@ void init_map() // Temp function ripped from libtonc example
{
// Grit is fucking garbage and doesn't allow you to have a palette offset, they all get loaded at 0x0000. I have no manually change each tile's palette bank
unsigned int correctedTiles[numsTilesLen / 4];
for (int i = 0; i < numsTilesLen / 4; i++)
unsigned int correctedTiles[affine_background_gfxTilesLen / 4];
for (int i = 0; i < affine_background_gfxTilesLen / 4; i++)
{
correctedTiles[i] = numsTiles[i] | 0xF0F0F0F0; // I brute forced this. I have no idea how this would and does work, but it does. We'll just leave this here for now.
correctedTiles[i] = affine_background_gfxTiles[i] | 0xF0F0F0F0; // I brute forced this. I have no idea how this would and does work, but it does. We'll just leave this here for now.
// Actually for future reference, each number seems to equate to an XY on the palette, so 0xF0F0F0F0 would just push everything down 15 colors, since the second number isn't set.
}
memcpy(&tile8_mem[2], correctedTiles, numsTilesLen);
GRIT_CPY(&se_mem[2], numsMap);
memcpy16(&pal_bg_mem[16 * 15], numsPal, 5);
memcpy(&tile8_mem[2], correctedTiles, affine_background_gfxTilesLen);
GRIT_CPY(&se_mem[2], affine_background_gfxMap);
memcpy16(&pal_bg_mem[16 * 15], affine_background_gfxPal, 5);
bgaff = bg_aff_default;
}
@@ -62,12 +63,12 @@ void init()
// Load the tiles and palette
// Background
memcpy(pal_bg_mem, background_gfxPal, 64); // This '64" isn't a specific number, I'm just using it to prevent the text colors from being overridden
memcpy(&tile8_mem[1], background_gfxTiles, background_gfxTilesLen); // Deadass i have no clue how any of these memory things work but I just messed with them until stuff worked
memcpy(&se_mem[31], background_gfxMap, background_gfxMapLen);
GRIT_CPY(&tile8_mem[1], background_gfxTiles); // Deadass i have no clue how any of these memory things work but I just messed with them until stuff worked
GRIT_CPY(&se_mem[31], background_gfxMap);
// Deck graphics
memcpy(&tile_mem[4], deck_gfxTiles, deck_gfxTilesLen);
memcpy(pal_obj_mem, deck_gfxPal, deck_gfxPalLen);
GRIT_CPY(&tile_mem[4], deck_gfxTiles);
GRIT_CPY(pal_obj_mem, deck_gfxPal);
// Set up the video mode
REG_BG0CNT = BG_PRIO(0) | BG_CBB(0) | BG_SBB(30) | BG_4BPP;
@@ -103,6 +104,7 @@ void init()
// Initialize subsystems
sprite_init();
blinds_init();
game_init();
}
@@ -110,12 +112,13 @@ void background_update() // This needs to be called before update() and draw() b
{
static uint timer = 0;
timer++;
asx.alpha += 30;
asx.tex_x += 78;
// These values are not permament, just the current configuration for the affine background
asx.tex_x += 5;
asx.tex_y += 12;
asx.sx = (lu_sin(timer * 100) * 4 ) >> 8; // Scale the sine value to fit in a s16
asx.sx = (lu_sin(timer * 100)) >> 8; // Scale the sine value to fit in a s16
asx.sx += 256; // Add 256 to the sine value to make it positive
asx.sy = (lu_sin(timer * 100 + 0x4000) * 4 ) >> 8; // Scale the sine value to fit in a s16
asx.sy = (lu_sin(timer * 100 + 0x4000)) >> 8; // Scale the sine value to fit in a s16
asx.sy += 256; // Add 256 to the sine value to make it positive
bg_rotscale_ex(&bgaff, &asx);
REG_BG_AFFINE[2]= bgaff;