Files
4kintro/timings_and_texts.inc
2024-05-25 01:35:09 +03:00

63 lines
2.8 KiB
PHP

; timings_and_texts.inc
; Compofiller Studio project text strings and timings
section .textstr0 data
%ifdef USE_WIDECHAR_TEXTS
%define DEFINE_STRING dw
%else
%define DEFINE_STRING db
%endif
%define END_STRING , 0
%define SHADER_SOURCE_TEXT
; each timing entry is a bunch of dwords
%define DEFINE_TIMING dd
%ifndef TIME_DIVIDER_INT
error! TIME_DIVIDER_INT MUST BE DEFINED!!!
%endif
; Kludge Construction Kit: x and y are floating point values used by the IDE's timings and texts editor,
; and z is the final integer value that has x, y and TIME_DIVIDER_INT baked into it. :/ This is needed
; because NASM is apparently unable to do the calculation and float-to-int conversion at compile time.
%define TIMING_TIME(x,y,z) (z)
REC_TIMINGS_TIME_FIELD_SIZE equ 4
; alias is only used by the IDE, not actually assembled into any sort of data
%define TIMING_ALIAS(x)
%ifdef USE_CUSTOM_UNIFORM
%define TIMING_CUSTOM(x) , x
REC_TIMINGS_CUSTOM_FIELD_SIZE equ 4
%else
%define TIMING_CUSTOM(x)
REC_TIMINGS_CUSTOM_FIELD_SIZE equ 0
%endif
%define TIMING_STRING(x, y) , y
REC_TIMINGS_STRING_PTR_FIELD_SIZE equ 4
TIMINGS_REC_SIZE equ (REC_TIMINGS_TIME_FIELD_SIZE + REC_TIMINGS_CUSTOM_FIELD_SIZE + REC_TIMINGS_STRING_PTR_FIELD_SIZE)
TIMINGS_REC_STRING_PTR_FIELD_OFS equ (REC_TIMINGS_TIME_FIELD_SIZE + REC_TIMINGS_CUSTOM_FIELD_SIZE)
; Separating the timings and actual string data enables us to do things
section .textstr1 data
;______STRINGS_START______
_string0: DEFINE_STRING 32, 72, 101, 108, 108, 111, 32, 119, 111, 114, 108, 100, 33, 32, 32, 32, 32, 87, 101, 39, 114, 101, 32, 98, 97, 99, 107, 32, 97, 116, 32, 65, 115, 115, 101, 109, 98, 108, 121, 32, 50, 48, 50, 52, 32, 119, 105, 116, 104, 32, 97, 32, 32, 110, 101, 119, 32, 112, 114, 111, 100, 117, 99, 116, 105, 111, 110, 33 END_STRING
_string1: DEFINE_STRING 84, 104, 105, 115, 32, 116, 101, 120, 116, 32, 115, 104, 111, 117, 108, 100, 32, 99, 111, 110, 116, 105, 110, 117, 101, 32, 110, 105, 99, 101, 108, 121, 32, 119, 105, 116, 104, 32, 115, 99, 114, 111, 108, 108, 101, 114, 33, 32, 119, 104, 105, 99, 104, 32, 105, 115, 32, 97, 103, 97, 105, 110, 32, 118, 101, 114, 121, 32, 110, 105, 99, 101, 32, 105, 110, 100, 101, 101, 100, 33 END_STRING
_string2: DEFINE_STRING 32 END_STRING
;______STRINGS_END______
section .textstr2 data
text_string_timings:
;______TIMINGS_START______
DEFINE_TIMING TIMING_TIME(0,0.00000,0) TIMING_ALIAS('') TIMING_CUSTOM(0) TIMING_STRING(0,_string0) ;
DEFINE_TIMING TIMING_TIME(5,0.00000,397894) TIMING_ALIAS('') TIMING_CUSTOM(0) TIMING_STRING(0,_string1) ;
DEFINE_TIMING TIMING_TIME(10,0.00000,795789) TIMING_ALIAS('') TIMING_CUSTOM(0) TIMING_STRING(0,_string2) ;
DEFINE_TIMING TIMING_TIME(20,0.00000,1591578) TIMING_ALIAS('END_TIME') TIMING_CUSTOM(0) TIMING_STRING(0,_string2) ;
;______TIMINGS_END______
dd 0xFFFFFFFF ; end-of-time