|
KallistiOS git master
Independent SDK for the Sega Dreamcast
|
#include <kos.h>#include <stdlib.h>#include <assert.h>#include "sintab.h"#include "s3mplay.h"#include "gfx/font14_256.h"Macros | |
| #define | msin(angle) |
| #define | mcos(angle) |
| #define | NS 1024 |
| #define | zk 64 |
| #define | MAXX ((640*(zk+640))/zk) |
| #define | MAXY ((480*(zk+480))/zk) |
| #define | NUM_FACES 6 |
| #define | zkonst 128 |
| #define | mult 64 |
| #define | bound(A) |
| #define | FONT_NAME font14_256_pcx |
| #define | FONT_WIDTH 8 |
| #define | FONT_HEIGHT 9 |
| #define | FONT_PIC_WIDTH 256 |
| #define | FONT_PIC_HEIGHT 256 |
| #define | FONT_DOUBLE 2.2 |
| #define | FONT_HAS_LC |
| #define | FONT_PERROW (FONT_PIC_WIDTH / FONT_WIDTH) |
| #define | FONT_ROWS (480 / FONT_HEIGHT) |
Functions | |
| int | randnum (int limit) |
| void | play_s3m (char *fn) |
| void | stars_init (void) |
| void | poly_pnt (int x, int y, float z, float size, int color) |
| void | stars_one_frame (void) |
| void | draw_cube (int which) |
| void | cube_one_frame (void) |
| void | cubes_one_frame (void) |
| int | load_pcx (char *pcxdata) |
| void | font_draw_char (int x1, int y1, float color, int ch) |
| void | font_draw_string (int x1, int y1, float color, char *str) |
| void | font_next_screen (void) |
| void | font_one_frame (void) |
| void | font_init (void) |
| void | draw_one_frame (void) |
| KOS_INIT_FLAGS (INIT_DEFAULT) | |
| int | main (int argc, const char *argv[]) |
Variables | |
| pvr_ptr_t | txr_font = NULL |
| volatile unsigned long * | snd_dbg = (unsigned long*)0xa080ffc0 |
| int * | star_x = NULL |
| int * | star_y |
| int * | star_z |
| pvr_poly_hdr_t | stars_header |
| int | cube_points [] |
| int | rotang = 0 |
| float | cubesizes [6] = { 0.0f } |
| int | tmpframe = 0 |
| int | zooming = 1 |
| int | cubes_have_header = 0 |
| pvr_poly_hdr_t | cubes_header |
| short | imageWidth |
| short | imageHeight |
| uint8_t * | image |
| uint8_t * | pcxpal |
| char * | charmap |
| char | font_map [] |
| fontrow_t | font_rows [FONT_ROWS] |
| char * | scrollypos = NULL |
| char | scrolly [] |
| int | active_lines = 0 |
| int | pause_count = 0 |
| int | mode = 0 |
| pvr_poly_hdr_t | font_header |
| int | framecnt = 0 |
| pvr_init_params_t | params |
| #define bound | ( | A | ) |
Referenced by draw_cube().
| #define FONT_DOUBLE 2.2 |
Referenced by font_draw_char(), font_draw_string(), and font_next_screen().
| #define FONT_HAS_LC |
| #define FONT_HEIGHT 9 |
Referenced by font_draw_char(), and font_next_screen().
| #define FONT_NAME font14_256_pcx |
Referenced by font_init().
| #define FONT_PERROW (FONT_PIC_WIDTH / FONT_WIDTH) |
Referenced by font_draw_char().
| #define FONT_PIC_HEIGHT 256 |
Referenced by font_draw_char(), and font_init().
| #define FONT_PIC_WIDTH 256 |
Referenced by font_draw_char(), and font_init().
| #define FONT_ROWS (480 / FONT_HEIGHT) |
Referenced by font_one_frame().
| #define FONT_WIDTH 8 |
Referenced by font_draw_char(), font_draw_string(), and font_next_screen().
Referenced by stars_init().
Referenced by stars_init().
| #define mcos | ( | angle | ) |
Referenced by draw_cube(), and rotate().
| #define msin | ( | angle | ) |
Referenced by draw_cube(), and rotate().
| #define mult 64 |
Referenced by draw_cube().
| #define NS 1024 |
Referenced by stars_init(), and stars_one_frame().
| #define NUM_FACES 6 |
Referenced by draw_cube().
| #define zk 64 |
Referenced by stars_one_frame().
| #define zkonst 128 |
Referenced by draw_cube().
| void cube_one_frame | ( | void | ) |
References cubesizes, draw_cube(), rotang, and zooming.
Referenced by cubes_one_frame().
| void cubes_one_frame | ( | void | ) |
References cube_one_frame(), cubes_have_header, cubes_header, PVR_LIST_TR_POLY, pvr_poly_compile(), pvr_poly_cxt_col(), pvr_prim(), and tmp.
Referenced by draw_one_frame().
| void draw_cube | ( | int | which | ) |
References pvr_vertex_t::argb, assert, bound, cube_points, cubesizes, pvr_vertex_t::flags, mcos, msin, mult, NUM_FACES, pvr_vertex_t::oargb, PVR_CMD_VERTEX, PVR_CMD_VERTEX_EOL, PVR_PACK_COLOR, pvr_prim(), r, rotang, pvr_vertex_t::u, pvr_vertex_t::v, vert, pvr_vertex_t::x, x, pvr_vertex_t::y, y, pvr_vertex_t::z, z, and zkonst.
Referenced by cube_one_frame().
| void draw_one_frame | ( | void | ) |
References cubes_one_frame(), font_one_frame(), framecnt, pvr_list_begin(), pvr_list_finish(), PVR_LIST_OP_POLY, PVR_LIST_TR_POLY, pvr_scene_begin(), pvr_scene_finish(), pvr_wait_ready(), and stars_one_frame().
Referenced by main().
| void font_draw_char | ( | int | x1, |
| int | y1, | ||
| float | color, | ||
| int | ch ) |
References pvr_vertex_t::argb, charmap, color, pvr_vertex_t::flags, FONT_DOUBLE, FONT_HEIGHT, FONT_PERROW, FONT_PIC_HEIGHT, FONT_PIC_WIDTH, FONT_WIDTH, pvr_vertex_t::oargb, PVR_CMD_VERTEX, PVR_CMD_VERTEX_EOL, PVR_PACK_COLOR, pvr_prim(), pvr_vertex_t::u, pvr_vertex_t::v, vert, pvr_vertex_t::x, pvr_vertex_t::y, and pvr_vertex_t::z.
Referenced by font_draw_string().
| void font_draw_string | ( | int | x1, |
| int | y1, | ||
| float | color, | ||
| char * | str ) |
References color, FONT_DOUBLE, font_draw_char(), and FONT_WIDTH.
Referenced by font_one_frame().
| void font_init | ( | void | ) |
References charmap, font_header, font_map, FONT_NAME, font_next_screen(), FONT_PIC_HEIGHT, FONT_PIC_WIDTH, font_rows, free(), image, load_pcx(), malloc(), pcxpal, printf, PVR_FILTER_NONE, PVR_LIST_TR_POLY, pvr_mem_malloc(), pvr_poly_compile(), pvr_poly_cxt_txr(), PVR_TXRFMT_ARGB4444, PVR_TXRFMT_NONTWIDDLED, tmp, txr_font, uint32_t(), x, and y.
Referenced by main().
| void font_next_screen | ( | void | ) |
References active_lines, FONT_DOUBLE, FONT_HEIGHT, font_rows, FONT_WIDTH, scrolly, scrollypos, x, and y.
Referenced by font_init(), and font_one_frame().
| void font_one_frame | ( | void | ) |
References done, font_draw_string(), font_header, font_next_screen(), FONT_ROWS, font_rows, mode, NULL, pause_count, pvr_prim(), x, and y.
Referenced by draw_one_frame().
| KOS_INIT_FLAGS | ( | INIT_DEFAULT | ) |
| int load_pcx | ( | char * | pcxdata | ) |
References image, imageHeight, imageWidth, NULL, pcxpal, and printf.
Referenced by font_init().
| int main | ( | int | argc, |
| const char * | argv[] ) |
References cont_state_t::buttons, charmap, CONT_START, draw_one_frame(), font_init(), free(), maple_dev_status(), maple_enum_type(), MAPLE_FUNC_CONTROLLER, NULL, params, play_s3m(), printf, pvr_init(), star_x, star_y, star_z, and stars_init().
| void play_s3m | ( | char * | fn | ) |
References buffer, fs_close(), fs_open(), fs_read(), printf, r, s3mplay, snd_dbg, spu_disable(), spu_enable(), spu_memload(), and uint32_t().
Referenced by main().
| void poly_pnt | ( | int | x, |
| int | y, | ||
| float | z, | ||
| float | size, | ||
| int | color ) |
References pvr_vertex_t::argb, color, pvr_vertex_t::flags, pvr_vertex_t::oargb, PVR_CMD_VERTEX, PVR_CMD_VERTEX_EOL, PVR_PACK_COLOR, pvr_prim(), pvr_vertex_t::u, pvr_vertex_t::v, vert, pvr_vertex_t::x, x, pvr_vertex_t::y, y, pvr_vertex_t::z, and z.
Referenced by stars_one_frame().
| int randnum | ( | int | limit | ) |
References limit.
Referenced by stars_init().
| void stars_init | ( | void | ) |
References malloc(), MAXX, MAXY, NS, NULL, PVR_LIST_OP_POLY, pvr_poly_compile(), pvr_poly_cxt_col(), randnum(), star_x, star_y, star_z, stars_header, and tmp.
Referenced by main().
| void stars_one_frame | ( | void | ) |
References NS, poly_pnt(), pvr_prim(), star_x, star_y, star_z, stars_header, and zk.
Referenced by draw_one_frame().
| int active_lines = 0 |
Referenced by font_next_screen().
| char* charmap |
Referenced by font_draw_char(), font_init(), and main().
| int cube_points[] |
Referenced by draw_cube().
| int cubes_have_header = 0 |
Referenced by cubes_one_frame().
| pvr_poly_hdr_t cubes_header |
Referenced by cubes_one_frame().
| float cubesizes[6] = { 0.0f } |
Referenced by cube_one_frame(), and draw_cube().
| pvr_poly_hdr_t font_header |
Referenced by font_init(), and font_one_frame().
| char font_map[] |
Referenced by font_init().
| fontrow_t font_rows[FONT_ROWS] |
Referenced by font_init(), font_next_screen(), and font_one_frame().
| int framecnt = 0 |
Referenced by draw_one_frame().
| uint8_t* image |
Referenced by font_init(), and load_pcx().
| short imageHeight |
Referenced by load_pcx().
| short imageWidth |
Referenced by load_pcx().
| int mode = 0 |
Referenced by cd_stream_test(), do_sphere_test(), font_one_frame(), and main().
| pvr_init_params_t params |
Referenced by main(), main(), and run_speed_test().
| int pause_count = 0 |
Referenced by font_one_frame().
| uint8_t* pcxpal |
Referenced by font_init(), and load_pcx().
| int rotang = 0 |
Referenced by cube_one_frame(), and draw_cube().
| char scrolly[] |
Referenced by font_next_screen().
| char* scrollypos = NULL |
Referenced by font_next_screen().
| volatile unsigned long* snd_dbg = (unsigned long*)0xa080ffc0 |
Referenced by play_s3m().
| int* star_x = NULL |
Referenced by main(), stars_init(), and stars_one_frame().
| int * star_y |
Referenced by main(), stars_init(), and stars_one_frame().
| int * star_z |
Referenced by main(), stars_init(), and stars_one_frame().
| pvr_poly_hdr_t stars_header |
Referenced by stars_init(), and stars_one_frame().
| int tmpframe = 0 |
Referenced by font_init().
| int zooming = 1 |
Referenced by cube_one_frame().