newspr.c

来自「十七种模拟器源代码 非常有用的作课程设计不可缺少的」· C语言 代码 · 共 836 行 · 第 1/5 页

C
836
字号
/******************************************************************************//*                                                                            *//*                RAINE TILE FLIPPING AND ROTATION SUPPORT                    *//*                                                                            *//******************************************************************************/#include "raine.h"#include "games.h"#include "newspr.h"#include "tilemod.h"#include "spz16x16.h"#include "lspr16x16.h"static int disp_x;static int disp_y;static int disp_x_8;static int disp_y_8;static int disp_x_16,disp_x_32;static int disp_y_16,disp_y_32;static int disp_x_64; // What is the precise goal of these variables ???static int disp_y_64;/*rotation support, using jumptables and precomputing as much as we canit's a real macro overload, but rotation overhead is now *very small**/#define MAKE_ROT_JUMP( FUNC, XOFS, YOFS )                                      \                                                                               \                                                                               \static void FUNC##_R090(UINT8 *SPR, int x, int y, ARGS)                        \{                                                                              \   FUNC##(SPR, YOFS## - y, x,          ARGS_2);                                \}                                                                              \                                                                               \static void FUNC##_R180(UINT8 *SPR, int x, int y, ARGS)                        \{                                                                              \   FUNC##(SPR, XOFS## - x, YOFS## - y, ARGS_1);                                \}                                                                              \                                                                               \static void FUNC##_R270(UINT8 *SPR, int x, int y, ARGS)                        \{                                                                              \   FUNC##(SPR, y,          XOFS## - x, ARGS_2);                                \}                                                                              \                                                                               \                                                                               \static void FUNC##_R090_X(UINT8 *SPR, int x, int y, ARGS)                      \{                                                                              \   FUNC##_FlipY(SPR, YOFS## - y, x,          ARGS_2);                          \}                                                                              \                                                                               \static void FUNC##_R180_X(UINT8 *SPR, int x, int y, ARGS)                      \{                                                                              \   FUNC##_FlipX(SPR, XOFS## - x, YOFS## - y, ARGS_1);                          \}                                                                              \                                                                               \static void FUNC##_R270_X(UINT8 *SPR, int x, int y, ARGS)                      \{                                                                              \   FUNC##_FlipY(SPR, y,          XOFS## - x, ARGS_2);                          \}                                                                              \                                                                               \                                                                               \static void FUNC##_R090_Y(UINT8 *SPR, int x, int y, ARGS)                      \{                                                                              \   FUNC##_FlipX(SPR, YOFS## - y, x,          ARGS_2);                          \}                                                                              \                                                                               \static void FUNC##_R180_Y(UINT8 *SPR, int x, int y, ARGS)                      \{                                                                              \   FUNC##_FlipY(SPR, XOFS## - x, YOFS## - y, ARGS_1);                          \}                                                                              \                                                                               \static void FUNC##_R270_Y(UINT8 *SPR, int x, int y, ARGS)                      \{                                                                              \   FUNC##_FlipX(SPR, y,          XOFS## - x, ARGS_2);                          \}                                                                              \                                                                               \                                                                               \static void FUNC##_R090_XY(UINT8 *SPR, int x, int y, ARGS)                     \{                                                                              \   FUNC##_FlipXY(SPR, YOFS## - y, x,          ARGS_2);                         \}                                                                              \                                                                               \static void FUNC##_R180_XY(UINT8 *SPR, int x, int y, ARGS)                     \{                                                                              \   FUNC##_FlipXY(SPR, XOFS## - x, YOFS## - y, ARGS_1);                         \}                                                                              \                                                                               \static void FUNC##_R270_XY(UINT8 *SPR, int x, int y, ARGS)                     \{                                                                              \   FUNC##_FlipXY(SPR, y,          XOFS## - x, ARGS_2);                         \}                                                                              \                                                                               \                                                                               \static void FUNC##_R000_FX(UINT8 *SPR, int x, int y, ARGS)                     \{                                                                              \   FUNC##(SPR, XOFS## - x, y,          ARGS_1);                                \}                                                                              \                                                                               \static void FUNC##_R090_FX(UINT8 *SPR, int x, int y, ARGS)                     \{                                                                              \   FUNC##(SPR, y,          x,          ARGS_2);                                \}                                                                              \                                                                               \static void FUNC##_R180_FX(UINT8 *SPR, int x, int y, ARGS)                     \{                                                                              \   FUNC##(SPR, x,          YOFS## - y, ARGS_1);                                \}                                                                              \                                                                               \static void FUNC##_R270_FX(UINT8 *SPR, int x, int y, ARGS)                     \{                                                                              \   FUNC##(SPR, YOFS## - y, XOFS## - x, ARGS_2);                                \}                                                                              \                                                                               \                                                                               \static void FUNC##_R000_X_FX(UINT8 *SPR, int x, int y, ARGS)                   \{                                                                              \   FUNC##_FlipX(SPR, XOFS## - x, y,          ARGS_1);                          \}                                                                              \                                                                               \static void FUNC##_R090_X_FX(UINT8 *SPR, int x, int y, ARGS)                   \{                                                                              \   FUNC##_FlipY(SPR, y,          x,          ARGS_2);                          \}                                                                              \                                                                               \static void FUNC##_R180_X_FX(UINT8 *SPR, int x, int y, ARGS)                   \{                                                                              \   FUNC##_FlipX(SPR, x,          YOFS## - y, ARGS_1);                          \}                                                                              \                                                                               \static void FUNC##_R270_X_FX(UINT8 *SPR, int x, int y, ARGS)                   \{                                                                              \   FUNC##_FlipY(SPR, YOFS## - y, XOFS## - x, ARGS_2);                          \}                                                                              \                                                                               \                                                                               \static void FUNC##_R000_Y_FX(UINT8 *SPR, int x, int y, ARGS)                   \{                                                                              \   FUNC##_FlipY(SPR, XOFS## - x, y,          ARGS_1);                          \}                                                                              \                                                                               \static void FUNC##_R090_Y_FX(UINT8 *SPR, int x, int y, ARGS)                   \{                                                                              \   FUNC##_FlipX(SPR, y,          x,          ARGS_2);                          \}                                                                              \                                                                               \static void FUNC##_R180_Y_FX(UINT8 *SPR, int x, int y, ARGS)                   \{                                                                              \   FUNC##_FlipY(SPR, x,          YOFS## - y, ARGS_1);                          \}                                                                              \                                                                               \static void FUNC##_R270_Y_FX(UINT8 *SPR, int x, int y, ARGS)                   \{                                                                              \   FUNC##_FlipX(SPR, YOFS## - y, XOFS## - x, ARGS_2);                          \}                                                                              \                                                                               \                                                                               \static void FUNC##_R000_XY_FX(UINT8 *SPR, int x, int y, ARGS)                  \{                                                                              \   FUNC##_FlipXY(SPR, XOFS## - x, y,          ARGS_1);                         \}                                                                              \                                                                               \static void FUNC##_R090_XY_FX(UINT8 *SPR, int x, int y, ARGS)                  \{                                                                              \   FUNC##_FlipXY(SPR, y,          x,          ARGS_2);                         \

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?