diff --git a/joker_8c_source.html b/joker_8c_source.html
index b275917a..77064842 100644
--- a/joker_8c_source.html
+++ b/joker_8c_source.html
@@ -399,240 +399,239 @@ $(document).ready(function(){initNavTree('joker_8c_source.html',''); initResizab
-
- 261 card_object_update(card_object);
-
-
- 264void joker_object_shake(
JokerObject* joker_object, mm_word sound_id)
-
-
-
-
- 269void set_and_shift_text(
char* str,
int* cursor_pos_x,
int* cursor_pos_y,
int color_pb)
-
- 271 tte_set_pos(*cursor_pos_x, *cursor_pos_y);
- 272 tte_set_special(color_pb * TTE_SPECIAL_PB_MULT_OFFSET);
-
-
-
- 276 const int joker_score_display_offset_px = (MAX_CARD_SCORE_STR_LEN + 1) *
TTE_CHAR_SIZE;
- 277 *cursor_pos_x += joker_score_display_offset_px;
-
-
- 280bool joker_object_score(
-
-
- 283 enum JokerEvent joker_event
-
-
- 286 if (joker_object == NULL)
-
-
-
-
-
- 292 u32 effect_flags_ret =
- 293 joker_get_score_effect(joker_object->joker, card_object->card, joker_event, &joker_effect);
-
- 295 if (effect_flags_ret == JOKER_EFFECT_FLAG_NONE)
-
-
-
-
- 300 u32 chips = get_chips();
- 301 u32 mult = get_mult();
- 302 int money = g_game_vars.money;
-
- 304 if (effect_flags_ret & JOKER_EFFECT_FLAG_RETRIGGER)
-
- 306 set_retrigger(joker_effect->retrigger);
-
-
-
-
-
-
- 313 if (joker_event == JOKER_EVENT_ON_CARD_HELD)
-
-
-
- 317 cursorPosX += fx2int(card_object->sprite_object->
x);
- 318 cursorPosY = HELD_CARD_SCORE_TEXT_Y;
-
-
-
- 322 cursorPosX += fx2int(joker_object->sprite_object->
x);
- 323 cursorPosY = JOKER_SCORE_TEXT_Y;
-
-
-
- 327 if (effect_flags_ret & JOKER_EFFECT_FLAG_CHIPS)
-
-
- 330 char score_buffer[INT_MAX_DIGITS + 2];
- 331 snprintf(score_buffer,
sizeof(score_buffer),
"+%lu", joker_effect->chips);
- 332 set_and_shift_text(score_buffer, &cursorPosX, &cursorPosY, TTE_BLUE_PB);
- 333 sfx_id = SFX_CHIPS_GENERIC;
-
- 335 if (effect_flags_ret & JOKER_EFFECT_FLAG_MULT)
-
-
- 338 char score_buffer[INT_MAX_DIGITS + 2];
- 339 snprintf(score_buffer,
sizeof(score_buffer),
"+%lu", joker_effect->mult);
- 340 set_and_shift_text(score_buffer, &cursorPosX, &cursorPosY, TTE_RED_PB);
-
-
-
- 344 if (effect_flags_ret & JOKER_EFFECT_FLAG_XMULT && joker_effect->xmult > 0)
-
-
- 347 char score_buffer[INT_MAX_DIGITS + 2];
- 348 snprintf(score_buffer,
sizeof(score_buffer),
"X%lu", joker_effect->xmult);
- 349 set_and_shift_text(score_buffer, &cursorPosX, &cursorPosY, TTE_RED_PB);
-
-
- 352 if (effect_flags_ret & JOKER_EFFECT_FLAG_MONEY)
-
- 354 money += joker_effect->money;
- 355 char score_buffer[INT_MAX_DIGITS + 2];
- 356 snprintf(score_buffer,
sizeof(score_buffer),
"%d$", joker_effect->money);
- 357 set_and_shift_text(score_buffer, &cursorPosX, &cursorPosY, TTE_YELLOW_PB);
-
-
-
-
- 362 if (effect_flags_ret & JOKER_EFFECT_FLAG_MESSAGE)
-
- 364 set_and_shift_text(joker_effect->message, &cursorPosX, &cursorPosY, TTE_WHITE_PB);
-
-
- 367 if (effect_flags_ret & JOKER_EFFECT_FLAG_EXPIRE && joker_effect->expire)
-
- 369 joker_object_shake(joker_object, UNDEFINED);
-
-
-
-
-
-
- 376 g_game_vars.money = money;
-
-
-
-
-
-
- 383 joker_object_shake(joker_object, sfx_id);
-
-
-
-
-
-
- 390 if (joker_object == NULL)
-
-
-
-
- 395int joker_get_random_rarity()
-
- 397 int joker_rarity = 0;
-
- 399 if (rarity_roll < COMMON_JOKER_CHANCE)
-
- 401 joker_rarity = COMMON_JOKER;
-
- 403 else if (rarity_roll < COMMON_JOKER_CHANCE + UNCOMMON_JOKER_CHANCE)
-
- 405 joker_rarity = UNCOMMON_JOKER;
-
- 407 else if (rarity_roll < COMMON_JOKER_CHANCE + UNCOMMON_JOKER_CHANCE + RARE_JOKER_CHANCE)
-
- 409 joker_rarity = RARE_JOKER;
-
- 411 else if (rarity_roll < COMMON_JOKER_CHANCE + UNCOMMON_JOKER_CHANCE + RARE_JOKER_CHANCE +
- 412 LEGENDARY_JOKER_CHANCE)
-
- 414 joker_rarity = LEGENDARY_JOKER;
-
-
-
-
-
- 420static int s_get_num_spritesheets()
-
- 422 return MAX_NUM_JOKERS_SPRITESHEETS;
-
-
- 425static int s_joker_get_spritesheet_idx(u8 joker_id)
-
- 427 return joker_id_to_sprite_map[joker_id];
-
-
- 430static int s_joker_get_sprite_idx_in_sheet(u8 joker_id,
int spritesheet_idx)
-
- 432 return joker_id - spritesheet_idx_to_starting_joker_id[joker_id_to_sprite_map[joker_id]];
-
-
- 435static void s_joker_pb_add_sprite_user(
int pb)
-
- 437 joker_pb_num_sprite_users[pb - JOKER_BASE_PB]++;
-
-
- 440static void s_joker_pb_remove_sprite_user(
int pb)
-
- 442 int num_sprite_users = joker_pb_num_sprite_users[pb - JOKER_BASE_PB];
- 443 joker_pb_num_sprite_users[pb - JOKER_BASE_PB] = max(0, num_sprite_users - 1);
-
-
- 446static int s_joker_pb_get_num_sprite_users(
int joker_pb)
-
- 448 return joker_pb_num_sprite_users[joker_pb - JOKER_BASE_PB];
-
-
- 451static int s_get_unused_joker_pb()
-
-
-
- 455 if (joker_pb_num_sprite_users[i] == 0)
-
- 457 return (i + JOKER_BASE_PB);
-
-
-
-
-
-
- 464static int s_allocate_pb_if_needed(u8 joker_id)
-
- 466 int joker_spritesheet_idx = s_joker_get_spritesheet_idx(joker_id);
- 467 int joker_pb = joker_spritesheet_pb_map[joker_spritesheet_idx];
- 468 if (joker_pb != UNDEFINED)
-
-
-
-
-
-
- 475 joker_pb = s_get_unused_joker_pb();
-
- 477 if (joker_pb == UNDEFINED)
-
-
- 480 joker_pb = JOKER_BASE_PB;
-
-
-
- 484 joker_spritesheet_pb_map[joker_spritesheet_idx] = joker_pb;
-
- 486 &pal_obj_mem[PAL_ROW_LEN * joker_pb],
- 487 joker_gfxPal[joker_spritesheet_idx],
-
-
-
-
-
-
+
+
+
+ 263void joker_object_shake(
JokerObject* joker_object, mm_word sound_id)
+
+
+
+
+ 268void set_and_shift_text(
char* str,
int* cursor_pos_x,
int* cursor_pos_y,
int color_pb)
+
+ 270 tte_set_pos(*cursor_pos_x, *cursor_pos_y);
+ 271 tte_set_special(color_pb * TTE_SPECIAL_PB_MULT_OFFSET);
+
+
+
+ 275 const int joker_score_display_offset_px = (MAX_CARD_SCORE_STR_LEN + 1) *
TTE_CHAR_SIZE;
+ 276 *cursor_pos_x += joker_score_display_offset_px;
+
+
+ 279bool joker_object_score(
+
+
+ 282 enum JokerEvent joker_event
+
+
+ 285 if (joker_object == NULL)
+
+
+
+
+
+ 291 u32 effect_flags_ret =
+ 292 joker_get_score_effect(joker_object->joker, card_object->card, joker_event, &joker_effect);
+
+ 294 if (effect_flags_ret == JOKER_EFFECT_FLAG_NONE)
+
+
+
+
+ 299 u32 chips = get_chips();
+ 300 u32 mult = get_mult();
+ 301 int money = g_game_vars.money;
+
+ 303 if (effect_flags_ret & JOKER_EFFECT_FLAG_RETRIGGER)
+
+ 305 set_retrigger(joker_effect->retrigger);
+
+
+
+
+
+
+ 312 if (joker_event == JOKER_EVENT_ON_CARD_HELD)
+
+
+
+ 316 cursorPosX += fx2int(card_object->sprite_object->
x);
+ 317 cursorPosY = HELD_CARD_SCORE_TEXT_Y;
+
+
+
+ 321 cursorPosX += fx2int(joker_object->sprite_object->
x);
+ 322 cursorPosY = JOKER_SCORE_TEXT_Y;
+
+
+
+ 326 if (effect_flags_ret & JOKER_EFFECT_FLAG_CHIPS)
+
+
+ 329 char score_buffer[INT_MAX_DIGITS + 2];
+ 330 snprintf(score_buffer,
sizeof(score_buffer),
"+%lu", joker_effect->chips);
+ 331 set_and_shift_text(score_buffer, &cursorPosX, &cursorPosY, TTE_BLUE_PB);
+ 332 sfx_id = SFX_CHIPS_GENERIC;
+
+ 334 if (effect_flags_ret & JOKER_EFFECT_FLAG_MULT)
+
+
+ 337 char score_buffer[INT_MAX_DIGITS + 2];
+ 338 snprintf(score_buffer,
sizeof(score_buffer),
"+%lu", joker_effect->mult);
+ 339 set_and_shift_text(score_buffer, &cursorPosX, &cursorPosY, TTE_RED_PB);
+
+
+
+ 343 if (effect_flags_ret & JOKER_EFFECT_FLAG_XMULT && joker_effect->xmult > 0)
+
+
+ 346 char score_buffer[INT_MAX_DIGITS + 2];
+ 347 snprintf(score_buffer,
sizeof(score_buffer),
"X%lu", joker_effect->xmult);
+ 348 set_and_shift_text(score_buffer, &cursorPosX, &cursorPosY, TTE_RED_PB);
+
+
+ 351 if (effect_flags_ret & JOKER_EFFECT_FLAG_MONEY)
+
+ 353 money += joker_effect->money;
+ 354 char score_buffer[INT_MAX_DIGITS + 2];
+ 355 snprintf(score_buffer,
sizeof(score_buffer),
"%d$", joker_effect->money);
+ 356 set_and_shift_text(score_buffer, &cursorPosX, &cursorPosY, TTE_YELLOW_PB);
+
+
+
+
+ 361 if (effect_flags_ret & JOKER_EFFECT_FLAG_MESSAGE)
+
+ 363 set_and_shift_text(joker_effect->message, &cursorPosX, &cursorPosY, TTE_WHITE_PB);
+
+
+ 366 if (effect_flags_ret & JOKER_EFFECT_FLAG_EXPIRE && joker_effect->expire)
+
+ 368 joker_object_shake(joker_object, UNDEFINED);
+
+
+
+
+
+
+ 375 g_game_vars.money = money;
+
+
+
+
+
+
+ 382 joker_object_shake(joker_object, sfx_id);
+
+
+
+
+
+
+ 389 if (joker_object == NULL)
+
+
+
+
+ 394int joker_get_random_rarity()
+
+ 396 int joker_rarity = 0;
+
+ 398 if (rarity_roll < COMMON_JOKER_CHANCE)
+
+ 400 joker_rarity = COMMON_JOKER;
+
+ 402 else if (rarity_roll < COMMON_JOKER_CHANCE + UNCOMMON_JOKER_CHANCE)
+
+ 404 joker_rarity = UNCOMMON_JOKER;
+
+ 406 else if (rarity_roll < COMMON_JOKER_CHANCE + UNCOMMON_JOKER_CHANCE + RARE_JOKER_CHANCE)
+
+ 408 joker_rarity = RARE_JOKER;
+
+ 410 else if (rarity_roll < COMMON_JOKER_CHANCE + UNCOMMON_JOKER_CHANCE + RARE_JOKER_CHANCE +
+ 411 LEGENDARY_JOKER_CHANCE)
+
+ 413 joker_rarity = LEGENDARY_JOKER;
+
+
+
+
+
+ 419static int s_get_num_spritesheets()
+
+ 421 return MAX_NUM_JOKERS_SPRITESHEETS;
+
+
+ 424static int s_joker_get_spritesheet_idx(u8 joker_id)
+
+ 426 return joker_id_to_sprite_map[joker_id];
+
+
+ 429static int s_joker_get_sprite_idx_in_sheet(u8 joker_id,
int spritesheet_idx)
+
+ 431 return joker_id - spritesheet_idx_to_starting_joker_id[joker_id_to_sprite_map[joker_id]];
+
+
+ 434static void s_joker_pb_add_sprite_user(
int pb)
+
+ 436 joker_pb_num_sprite_users[pb - JOKER_BASE_PB]++;
+
+
+ 439static void s_joker_pb_remove_sprite_user(
int pb)
+
+ 441 int num_sprite_users = joker_pb_num_sprite_users[pb - JOKER_BASE_PB];
+ 442 joker_pb_num_sprite_users[pb - JOKER_BASE_PB] = max(0, num_sprite_users - 1);
+
+
+ 445static int s_joker_pb_get_num_sprite_users(
int joker_pb)
+
+ 447 return joker_pb_num_sprite_users[joker_pb - JOKER_BASE_PB];
+
+
+ 450static int s_get_unused_joker_pb()
+
+
+
+ 454 if (joker_pb_num_sprite_users[i] == 0)
+
+ 456 return (i + JOKER_BASE_PB);
+
+
+
+
+
+
+ 463static int s_allocate_pb_if_needed(u8 joker_id)
+
+ 465 int joker_spritesheet_idx = s_joker_get_spritesheet_idx(joker_id);
+ 466 int joker_pb = joker_spritesheet_pb_map[joker_spritesheet_idx];
+ 467 if (joker_pb != UNDEFINED)
+
+
+
+
+
+
+ 474 joker_pb = s_get_unused_joker_pb();
+
+ 476 if (joker_pb == UNDEFINED)
+
+
+ 479 joker_pb = JOKER_BASE_PB;
+
+
+
+ 483 joker_spritesheet_pb_map[joker_spritesheet_idx] = joker_pb;
+
+ 485 &pal_obj_mem[PAL_ROW_LEN * joker_pb],
+ 486 joker_gfxPal[joker_spritesheet_idx],
+
+
+
+
+
+
Game global game variables struct definition.
Graphic utility functions.
#define TILE_SIZE
Tile size in pixels, both height and width as tiles are square.
@@ -651,6 +650,7 @@ $(document).ready(function(){initNavTree('joker_8c_source.html',''); initResizab
void sprite_object_shake(SpriteObject *sprite_object, mm_word sound_id)
Shake SpriteObject on screen and play a sound.
int sprite_get_layer(Sprite *sprite)
Get index of Sprite in the GBA object buffer.
Sprite * sprite_object_get_sprite(SpriteObject *sprite_object)
Get a SpriteObject's registered Sprite.
+IWRAM_CODE void sprite_object_update(SpriteObject *sprite_object)
Update a SpriteObject, to be called once per frame per active SpriteObject.
diff --git a/joker_8h.html b/joker_8h.html
index f774f0a3..dabe9a85 100644
--- a/joker_8h.html
+++ b/joker_8h.html
@@ -1026,7 +1026,7 @@ Functions
@@ -1237,7 +1237,7 @@ Functions
@@ -1293,7 +1293,7 @@ Functions
@@ -1323,7 +1323,7 @@ Functions