15#define SHRUNK_TABLE_PROP_SIZE 0x2fe
96 spriteInfo *spriteInfo,
97 paletteInfo *paletteInfo
102 spriteInfo *spriteInfo,
103 paletteInfo *paletteInfo,
106 short box_width_offset,
107 short box_height_offset
112 pictureInfo *pictureInfo,
113 paletteInfo *paletteInfo
122 short box_width_offset,
123 short box_height_offset,
129 scrollerInfo *scrollerInfo,
130 paletteInfo *paletteInfo
161 spriteInfo *spriteInfo,
162 paletteInfo *paletteInfo,
170 spriteInfo *spriteInfo,
171 paletteInfo *paletteInfo,
176 short box_width_offset,
177 short box_height_offset,
183 pictureInfo *pictureInfo,
184 paletteInfo *paletteInfo,
191 pictureInfo *pictureInfo,
192 paletteInfo *paletteInfo,
197 short box_width_offset,
198 short box_height_offset,
204 scrollerInfo *scrollerInfo,
205 paletteInfo *paletteInfo,
278#define nc_shrunk_extract_x(value) value >> 8
279#define nc_shrunk_extract_y(value) (BYTE)value
327#define nc_wait_vbl() waitVBlank();
350#define nc_rgb16_to_packed_color16(color) \
351 ((((color.dark) & 0xF) << 12) | (((color.r) & 0xF) << 8) | (((color.g) & 0xF) << 4) | ((color.b) & 0xF))
353#define nc_set_palette_by_packed_color16(palette_number, palette_index, color) \
355 int address = 0x400000 | ((palette_number) << 5) | ((palette_index) << 1); \
356 volMEMWORD(address) = (color); \
359#define nc_set_palette_by_rgb16(palette_number, palette_index, color) \
361 WORD packed_color = nc_rgb16_to_packed_color16(color); \
362 nc_set_palette_by_packed_color16(palette_number, palette_index, packed_color); \
365#define nc_get_palette_packed_color16(palette_number, palette_index) \
367 int address = 0x400000 | ((palette_number) << 5) | ((palette_index) << 1); \
368 volMEMWORD(address); \
371#define nc_set_palette_backdrop_by_packed_color16(packed_color) \
373 int address = 0x401FFE; \
374 volMEMWORD(address) = (packed_color); \
377#define nc_set_palette_backdrop_by_rgb16(color) \
379 WORD packed_color = nc_rgb16_to_packed_color16(color); \
380 nc_set_palette_backdrop_by_packed_color16(packed_color); \
390void nc_shrunk(WORD base_sprite, WORD max_width, WORD value);
399#define nc_bitwise_division_2(value) (value >> 1)
400#define nc_bitwise_division_4(value) (value >> 2)
401#define nc_bitwise_division_8(value) (value >> 3)
402#define nc_bitwise_division_16(value) (value >> 4)
403#define nc_bitwise_division_32(value) (value >> 5)
404#define nc_bitwise_division_64(value) (value >> 6)
405#define nc_bitwise_division_128(value) (value >> 7)
406#define nc_bitwise_division_256(value) (value >> 8)
408#define nc_bitwise_multiplication_2(value) (value << 1)
409#define nc_bitwise_multiplication_4(value) (value << 2)
410#define nc_bitwise_multiplication_8(value) (value << 3)
411#define nc_bitwise_multiplication_16(value) (value << 4)
412#define nc_bitwise_multiplication_32(value) (value << 5)
413#define nc_bitwise_multiplication_64(value) (value << 6)
414#define nc_bitwise_multiplication_128(value) (value << 7)
415#define nc_bitwise_multiplication_256(value) (value << 8)
417#define nc_random(range) rand() % range
419#define nc_min(a,b) ((a) < (b) ? (a) : (b))
420#define nc_max(a,b) ((a) > (b) ? (a) : (b))
422#define nc_abs(num) ((num) < 0 ? ~(num) + 1 : (num))
423#define nc_negative(num) -num
425#define nc_fix(num) num * 65536
426#define nc_fix_to_int(num) fixtoi(num)
427#define nc_int_to_fix(num) itofix(num)
428#define nc_fix_add(num1, num2) fadd(num1, num2)
429#define nc_fix_sub(num1, num2) fsub(num1, num2)
430#define nc_fix_mul(num1, num2) fmul(num1, num2)
431#define nc_cos(num) fcos(num)
432#define nc_tan(num) ftan(num)
442#define nc_copy_box(box_src, box_dest) memcpy(box_dest, box_src, sizeof(Box))
446void nc_init_box(
Box *box,
short width,
short height,
short widthOffset,
short heightOffset);
466#define nc_stop_cdda() nc_pause_cdda()
508#define nc_get_frame_counter() DAT_frameCounter
void nc_word_to_hex(WORD value, char *hexchar)
void nc_init_gfx_animated_sprite(GFX_Animated_Sprite *gfx_animated_sprite, spriteInfo *spriteInfo, paletteInfo *paletteInfo)
void nc_display_gfx_picture(GFX_Picture *gfx_picture, short x, short y)
void nc_init_display_gfx_scroller(GFX_Scroller *gfx_scroller, scrollerInfo *scrollerInfo, paletteInfo *paletteInfo, short x, short y)
void nc_hide_gfx_picture_physic(GFX_Picture_Physic *gfx_picture_physic)
BOOL nc_joypad_is_down(BYTE id)
void nc_log_int(char *label, int value)
BOOL nc_vector_is_left(short x, short y, short v1x, short v1y, short v2x, short v2y)
void nc_init_display_gfx_picture(GFX_Picture *gfx_picture, pictureInfo *pictureInfo, paletteInfo *paletteInfo, short x, short y)
void nc_display_gfx_picture_physic(GFX_Picture_Physic *gfx_picture_physic, short x, short y)
void nc_set_auto_next_line_log(BOOL auto_next_line)
void nc_log_rgb16(RGB16 *color)
void nc_update_animation_gfx_animated_sprite_physic(GFX_Animated_Sprite_Physic *gfx_animated_sprite_physic)
void nc_init_gfx_picture_physic(GFX_Picture_Physic *gfx_picture_physic, pictureInfo *pi, paletteInfo *pali, short box_witdh, short box_height, short box_width_offset, short box_height_offset, BOOL autobox_enabled)
void nc_log_vec2short(char *label, Vec2short vec2short)
void nc_init_box(Box *box, short width, short height, short widthOffset, short heightOffset)
void nc_pause(BOOL(*exitFunc)())
void nc_show_gfx_animated_sprite_physic(GFX_Animated_Sprite_Physic *gfx_animated_sprite_physic)
BOOL nc_each_frame(DWORD frame)
void nc_move_gfx_animated_sprite(GFX_Animated_Sprite *gfx_animated_sprite, short x_offset, short y_offset)
BOOL nc_joypad_is_a(BYTE id)
void nc_shrunk_addr(WORD addr, WORD shrunk_value)
void nc_destroy_gfx_animated_sprite_physic(GFX_Animated_Sprite_Physic *gfx_animated_sprite_physic)
void nc_log_palette_info(paletteInfo *paletteInfo)
void nc_sleep(DWORD frame)
void nc_init_display_gfx_animated_sprite_physic(GFX_Animated_Sprite_Physic *gfx_animated_sprite_physic, spriteInfo *spriteInfo, paletteInfo *paletteInfo, short x, short y, short box_witdh, short box_height, short box_width_offset, short box_height_offset, WORD anim)
void nc_set_animation_gfx_animated_sprite(GFX_Animated_Sprite *gfx_animated_sprite, WORD anim)
Vec2short nc_get_relative_position(Box box, Vec2short world_coord)
BYTE nc_collide_boxes(Box *box, Box *boxes[], BYTE box_max)
void nc_move_gfx_picture_physic(GFX_Picture_Physic *gfx_picture_physic, short x_offset, short y_offset)
void nc_update_mask(short x, short y, Vec2short vec[], Vec2short offset[], BYTE vector_max)
void nc_read_palette_rgb16(BYTE palette_number, BYTE palette_index, RGB16 *rgb_color)
void nc_push_remaining_frame_adpcm_player(DWORD frame)
int nc_shrunk_centroid_get_translated_x(short centerPosX, WORD tileWidth, BYTE shrunkX)
DWORD nc_wait_vbl_max(WORD nb)
WORD nc_shrunk_forge(BYTE xc, BYTE yc)
void nc_log_pictureInfo(char *label, pictureInfo *pi)
void nc_debug_joypad(BYTE id)
Adpcm_player * nc_get_adpcm_player()
WORD nc_get_max_sprite_index_used()
WORD nc_get_max_free_palette_index()
Vec2short nc_get_position_gfx_animated_sprite_physic(GFX_Animated_Sprite_Physic gfx_animated_sprite_physic)
void nc_set_position_gfx_picture(GFX_Picture *gfx_picture, short x, short y)
void nc_show_gfx_picture(GFX_Picture *gfx_picture)
void nc_log_word(char *label, WORD value)
void nc_init_display_gfx_animated_sprite(GFX_Animated_Sprite *gfx_animated_sprite, spriteInfo *spriteInfo, paletteInfo *paletteInfo, short x, short y, WORD anim)
BOOL nc_joypad_is_up(BYTE id)
void nc_show_gfx_picture_physic(GFX_Picture_Physic *gfx_picture_physic)
Vec2short nc_get_position_gfx_scroller(GFX_Scroller gfx_scroller)
void nc_set_position_gfx_picture_physic(GFX_Picture_Physic *gfx_picture_physic, short x, short y)
void nc_destroy_gfx_picture(GFX_Picture *gfx_picture)
BOOL nc_collide_box(Box *box1, Box *box2)
void nc_init_gfx_picture(GFX_Picture *gfx_picture, pictureInfo *pictureInfo, paletteInfo *paletteInfo)
WORD nc_get_max_palette_index_used()
void nc_log_short(char *label, short value)
WORD nc_get_max_free_sprite_index()
void nc_shrunk_centroid_gfx_picture(GFX_Picture *gfx_picture, short center_x, short center_y, WORD shrunk_value)
void nc_init_gfx_scroller(GFX_Scroller *gfx_scroller, scrollerInfo *scrollerInfo, paletteInfo *paletteInfo)
WORD nc_get_position_y_log()
WORD nc_get_position_x_log()
void nc_set_position_gfx_scroller(GFX_Scroller *gfx_scroller, short x, short y)
void nc_log_bool(char *label, BOOL value)
void nc_move_gfx_scroller(GFX_Scroller *gfx_scroller, short x, short y)
WORD nc_log_info(char *txt,...)
BOOL nc_joypad_is_right(BYTE id)
void nc_hide_gfx_picture(GFX_Picture *gfx_picture)
void nc_packet_color16_to_rgb16(WORD packed_color, RGB16 *rgb_color)
void nc_log_dword(char *label, DWORD value)
void nc_set_joypad_edge_mode(BOOL actived)
BOOL nc_vectors_collide(Box *box, Vec2short vec[], BYTE vector_max)
void nc_play_cdda(BYTE track)
void nc_init_display_gfx_picture_physic(GFX_Picture_Physic *gfx_picture_physic, pictureInfo *pictureInfo, paletteInfo *paletteInfo, short x, short y, short box_witdh, short box_height, short box_width_offset, short box_height_offset, BOOL autobox_enabled)
void nc_move_gfx_animated_sprite_physic(GFX_Animated_Sprite_Physic *gfx_animated_sprite_physic, short x_offset, short y_offset)
void nc_clear_palette_index_table()
void nc_destroy_gfx_picture_physic(GFX_Picture_Physic *gfx_picture_physic)
void nc_display_gfx_animated_sprite(GFX_Animated_Sprite *gfx_animated_sprite, short x, short y, WORD anim)
void nc_move_gfx_picture(GFX_Picture *gfx_picture, short x, short y)
BOOL nc_joypad_is_start(BYTE id)
void nc_set_animation_gfx_animated_sprite_physic(GFX_Animated_Sprite_Physic *gfx_animated_sprite_physic, WORD anim)
void nc_display_gfx_scroller(GFX_Scroller *gfx_scroller, short x, short y)
void nc_log_packed_color16(WORD packed_color)
BOOL nc_joypad_is_c(BYTE id)
BOOL nc_joypad_is_b(BYTE id)
BOOL nc_joypad_is_left(BYTE id)
void nc_shrunk_box(Box *box, Box *bOrigin, WORD shrunkValue)
void nc_log_box(char *label, Box *b)
DWORD nc_frame_to_second(DWORD frame)
void nc_byte_to_hex(BYTE value, char *hexchar)
void nc_hide_gfx_animated_sprite(GFX_Animated_Sprite *gfx_animated_sprite)
void nc_update_adpcm_player()
WORD nc_shrunk_range(WORD addr_start, WORD addr_end, WORD shrunk_value)
Vec2short nc_get_position_gfx_picture_physic(GFX_Picture_Physic gfx_picture_physic)
void nc_destroy_palette(paletteInfo *paletteInfo)
void nc_destroy_gfx_scroller(GFX_Scroller *gfx_scroller)
WORD nc_get_shrunk_proportional_table(WORD index)
void nc_log_byte(char *label, BYTE value)
void nc_log_spriteInfo(char *label, spriteInfo *si)
void nc_set_position_log(WORD _x, WORD _y)
void nc_init_gfx_animated_sprite_physic(GFX_Animated_Sprite_Physic *gfx_animated_sprite_physic, spriteInfo *spriteInfo, paletteInfo *paletteInfo, short box_witdh, short box_height, short box_width_offset, short box_height_offset)
void nc_set_position_gfx_animated_sprite(GFX_Animated_Sprite *gfx_animated_sprite, short x, short y)
void nc_set_position_gfx_animated_sprite_physic(GFX_Animated_Sprite_Physic *gfx_animated_sprite_physic, short x, short y)
void nc_update_joypad(BYTE id)
Vec2short nc_get_position_gfx_animated_sprite(GFX_Animated_Sprite gfx_animated_sprite)
DWORD nc_second_to_frame(DWORD second)
void nc_print(int x, int y, char *label)
void nc_resize_box(Box *Box, short edge)
void nc_update_animation_gfx_animated_sprite(GFX_Animated_Sprite *gfx_animated_sprite)
void nc_log(char *message)
void nc_display_gfx_animated_sprite_physic(GFX_Animated_Sprite_Physic *gfx_animated_sprite_physic, short x, short y, WORD anim)
void nc_joypad_update(BYTE id)
void nc_hide_gfx_animated_sprite_physic(GFX_Animated_Sprite_Physic *gfx_animated_sprite_physic)
Vec2short nc_get_position_gfx_picture(GFX_Picture gfx_picture)
void nc_destroy_gfx_animated_sprite(GFX_Animated_Sprite *gfx_animated_sprite)
void nc_clear_sprite_index_table()
BOOL nc_joypad_is_d(BYTE id)
void nc_update_box(Box *box, short x, short y)
void nc_show_gfx_animated_sprite(GFX_Animated_Sprite *gfx_animated_sprite)
int nc_shrunk_centroid_get_translated_y(short centerPosY, WORD tileHeight, BYTE shrunkY)
void nc_shrunk(WORD base_sprite, WORD max_width, WORD value)
GFX_Animated_Sprite gfx_animated_sprite
paletteInfo * paletteInfoDAT
spriteInfo * spriteInfoDAT
pictureInfo * pictureInfoDAT
paletteInfo * paletteInfoDAT