📄 ttinterp.c
字号:
CUR.GS.auto_flip = TRUE;#define DO_FLIPOFF \ CUR.GS.auto_flip = FALSE;#define DO_SDB \ CUR.GS.delta_base = (Short)args[0];#define DO_SDS \ CUR.GS.delta_shift = (Short)args[0];#define DO_MD /* nothing */#define DO_MPPEM \ args[0] = CURRENT_Ppem();#define DO_MPS \ args[0] = CUR.metrics.pointSize;#define DO_DUP \ args[1] = args[0];#define DO_CLEAR \ CUR.new_top = 0;#define DO_SWAP \ { \ Long L; \ \ L = args[0]; \ args[0] = args[1]; \ args[1] = L; \ }#define DO_DEPTH \ args[0] = CUR.top;#define DO_CINDEX \ { \ Long L; \ \ \ L = args[0]; \ \ if ( L <= 0 || L > CUR.args ) \ CUR.error = TT_Err_Invalid_Reference; \ else \ args[0] = CUR.stack[CUR.args - L]; \ }#define DO_JROT \ if ( args[1] != 0 ) \ { \ CUR.IP += args[0]; \ CUR.step_ins = FALSE; \ }#define DO_JMPR \ CUR.IP += args[0]; \ CUR.step_ins = FALSE;#define DO_JROF \ if ( args[1] == 0 ) \ { \ CUR.IP += args[0]; \ CUR.step_ins = FALSE; \ }#define DO_LT \ args[0] = (args[0] < args[1]);#define DO_LTEQ \ args[0] = (args[0] <= args[1]);#define DO_GT \ args[0] = (args[0] > args[1]);#define DO_GTEQ \ args[0] = (args[0] >= args[1]);#define DO_EQ \ args[0] = (args[0] == args[1]);#define DO_NEQ \ args[0] = (args[0] != args[1]);#define DO_ODD \ args[0] = ( (CUR_Func_round( args[0], 0 ) & 127) == 64 );#define DO_EVEN \ args[0] = ( (CUR_Func_round( args[0], 0 ) & 127) == 0 );#define DO_AND \ args[0] = ( args[0] && args[1] );#define DO_OR \ args[0] = ( args[0] || args[1] );#define DO_NOT \ args[0] = !args[0];#define DO_ADD \ args[0] += args[1];#define DO_SUB \ args[0] -= args[1];#define DO_DIV \ if ( args[1] == 0 ) \ CUR.error = TT_Err_Divide_By_Zero; \ else \ args[0] = TT_MulDiv( args[0], 64L, args[1] );#define DO_MUL \ args[0] = TT_MulDiv( args[0], args[1], 64L );#define DO_ABS \ args[0] = ABS( args[0] );#define DO_NEG \ args[0] = -args[0];#define DO_FLOOR \ args[0] &= -64;#define DO_CEILING \ args[0] = (args[0] + 63) & (-64);#define DO_RS \ { \ ULong I = (ULong)args[0]; \ if ( BOUNDS( I, CUR.storeSize ) ) \ { \ if ( CUR.pedantic_hinting ) \ { \ ARRAY_BOUND_ERROR; \ } \ else \ args[0] = 0; \ } \ else \ args[0] = CUR.storage[I]; \ }#define DO_WS \ { \ ULong I = (ULong)args[0]; \ if ( BOUNDS( I, CUR.storeSize ) ) \ { \ if ( CUR.pedantic_hinting ) \ { \ ARRAY_BOUND_ERROR; \ } \ } \ else \ CUR.storage[I] = args[1]; \ }#define DO_RCVT \ { \ ULong I = (ULong)args[0]; \ if ( BOUNDS( I, CUR.cvtSize ) ) \ { \ if ( CUR.pedantic_hinting ) \ { \ ARRAY_BOUND_ERROR; \ } \ else \ args[0] = 0; \ } \ else \ args[0] = CUR_Func_read_cvt(I); \ }#define DO_WCVTP \ { \ ULong I = (ULong)args[0]; \ if ( BOUNDS( I, CUR.cvtSize ) ) \ { \ if ( CUR.pedantic_hinting ) \ { \ ARRAY_BOUND_ERROR; \ } \ } \ else \ CUR_Func_write_cvt( I, args[1] ); \ }#define DO_WCVTF \ { \ ULong I = (ULong)args[0]; \ if ( BOUNDS( I, CUR.cvtSize ) ) \ { \ if ( CUR.pedantic_hinting ) \ { \ ARRAY_BOUND_ERROR; \ } \ } \ else \ CUR.cvt[I] = FUnits_To_Pixels( EXEC_ARGS (Short)args[1] ); \ }#define DO_DEBUG \ CUR.error = TT_Err_Debug_OpCode;#define DO_ROUND \ args[0] = CUR_Func_round( args[0], \ CUR.metrics.compensations[CUR.opcode-0x68] );#define DO_NROUND \ args[0] = Round_None( EXEC_ARGS \ args[0], \ CUR.metrics.compensations[CUR.opcode - 0x6C] );#define DO_MAX \ if ( args[1] > args[0] ) \ args[0] = args[1];#define DO_MIN \ if ( args[1] < args[0] ) \ args[0] = args[1];#ifndef TT_CONFIG_OPTION_INTERPRETER_SWITCH#undef ARRAY_BOUND_ERROR#define ARRAY_BOUND_ERROR \ { \ CUR.error = TT_Err_Invalid_Reference; \ return; \ }/*******************************************//* SVTCA[a] : Set F and P vectors to axis *//* CodeRange : $00-$01 *//* Stack : --> */ static void Ins_SVTCA( INS_ARG ) { DO_SVTCA }/*******************************************//* SPVTCA[a] : Set PVector to Axis *//* CodeRange : $02-$03 *//* Stack : --> */ static void Ins_SPVTCA( INS_ARG ) { DO_SPVTCA }/*******************************************//* SFVTCA[a] : Set FVector to Axis *//* CodeRange : $04-$05 *//* Stack : --> */ static void Ins_SFVTCA( INS_ARG ) { DO_SFVTCA }/*******************************************//* SPVTL[a] : Set PVector to Line *//* CodeRange : $06-$07 *//* Stack : uint32 uint32 --> */ static void Ins_SPVTL( INS_ARG ) { DO_SPVTL }/*******************************************//* SFVTL[a] : Set FVector to Line *//* CodeRange : $08-$09 *//* Stack : uint32 uint32 --> */ static void Ins_SFVTL( INS_ARG ) { DO_SFVTL }/*******************************************//* SFVTPV[] : Set FVector to PVector *//* CodeRange : $0E *//* Stack : --> */ static void Ins_SFVTPV( INS_ARG ) { DO_SFVTPV }/*******************************************//* SPVFS[] : Set PVector From Stack *//* CodeRange : $0A *//* Stack : f2.14 f2.14 --> */ static void Ins_SPVFS( INS_ARG ) { DO_SPVFS }/*******************************************//* SFVFS[] : Set FVector From Stack *//* CodeRange : $0B *//* Stack : f2.14 f2.14 --> */ static void Ins_SFVFS( INS_ARG ) { DO_SFVFS }/*******************************************//* GPV[] : Get Projection Vector *//* CodeRange : $0C *//* Stack : ef2.14 --> ef2.14 */ static void Ins_GPV( INS_ARG ) { DO_GPV }/*******************************************//* GFV[] : Get Freedom Vector *//* CodeRange : $0D *//* Stack : ef2.14 --> ef2.14 */ static void Ins_GFV( INS_ARG ) { DO_GFV }/*******************************************//* SRP0[] : Set Reference Point 0 *//* CodeRange : $10 *//* Stack : uint32 --> */ static void Ins_SRP0( INS_ARG ) { DO_SRP0 }/*******************************************//* SRP1[] : Set Reference Point 1 *//* CodeRange : $11 *//* Stack : uint32 --> */ static void Ins_SRP1( INS_ARG ) { DO_SRP1 }/*******************************************//* SRP2[] : Set Reference Point 2 *//* CodeRange : $12 *//* Stack : uint32 --> */ static void Ins_SRP2( INS_ARG ) { DO_SRP2 }/*******************************************//* RTHG[] : Round To Half Grid *//* CodeRange : $19 *//* Stack : --> */ static void Ins_RTHG( INS_ARG ) { DO_RTHG }/*******************************************//* RTG[] : Round To Grid *//* CodeRange : $18 *//* Stack : --> */ static void Ins_RTG( INS_ARG ) { DO_RTG }/*******************************************//* RTDG[] : Round To Double Grid *//* CodeRange : $3D *//* Stack : --> */ static void Ins_RTDG( INS_ARG ) { DO_RTDG }/*******************************************//* RUTG[] : Round Up To Grid *//* CodeRange : $7C *//* Stack : --> */ static void Ins_RUTG( INS_ARG ) { DO
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -