; ; Raw Game Engine ; Copyright (C) 2023 Ernest Deak ; ; This program is free software: you can redistribute it and/or modify ; it under the terms of the GNU General Public License as published by ; the Free Software Foundation, either version 3 of the License, or ; (at your option) any later version. ; ; This program is distributed in the hope that it will be useful, ; but WITHOUT ANY WARRANTY; without even the implied warranty of ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ; GNU General Public License for more details. ; ; You should have received a copy of the GNU General Public License ; along with this program. If not, see . ; %ifndef RGE_INC %define RGE_INC section .bss ; Raw Game Engine specific structures and memory defines ; These ought to be configured before the first include of rge.inc ; so that we can customize it at assembly time %define __MEM_CHUNK_UNDEFINED_ERRMSG__ WARNING Memory chunk size has not been calculated. \ Please use the calc_mem_chunk macro to set it up correctly %define __MEM_SLOT_NUM_UNDEFINED_ERRMSG__ WARNING The number of slots \ to use for memory has not been set up. Please use the set_slot_num macro \ to define it %ifndef RGE_MAX_LAYERS %define RGE_MAX_LAYERS 3 %endif %ifndef RG_OBJECT_LIST_SIZE %warning __MEM_SLOT_NUM_UNDEFINED_ERRMSG__ %define RG_OBJECT_LIST_SIZE 128 %endif %ifndef RG_OBJECT_SIZE %warning __MEM_CHUNK_UNDEFINED_ERRMSG__ %define RG_OBJECT_SIZE 128 %endif %ifndef RG_ANIM_SPRITE_OFFSET %error RG_ANIM_SPRITE_OFFSET has not been set! %endif ; Memory locations ;; Bitmask for the objects that are allocated and need ;; to be updated per frame. ;; Each bit represents an index of the RG_Objects structures RG_OList_Bitmask: resq ((RG_OBJECT_LIST_SIZE*RGE_MAX_LAYERS)/64) .end: %define RG_BITMASK_LAYER_SIZE 64 global RG_OList_Bitmask ;; Actual place for objects with their data for the update ;; function. RG_Objects: resb (RG_OBJECT_LIST_SIZE*RG_OBJECT_SIZE*RGE_MAX_LAYERS) .end: global RG_Objects %define RG_STRIDE (RG_OBJECT_SIZE * RGE_MAX_LAYERS) section .data ;; TODO: disable bss preallocation in case of library? ;; In case of library usage, the address stored here is used instead ;; to allow for mmap and other runtime allocation schemes ;; NOTE: This is only a preparation for the feature RG_Addr_Objects: dq 0 section .bss endif %endif .