; struct dungeon ; { ; name: *char (u24=bank+ptr), ; flags: 0b00CmTSFM, ; M = whether or not this dungeon has a pregenerated tilemap (0 means that it's randomly generated) ; F = whether or not the floors are counted ; S = whether or not enemies can spawn ; T = whether or not there is a top bar shown ; m = whether or not you can open the attack menu ; C = whether or not there is a custom function to be executed every frame ; tilemap: ptr (u24=bank+ptr) ; custom_function: ptr (u24=bank+ptr) ; generation_event_size: u8 (size of the generation_eents_structure ; generation_events: [x]struct (8 bytes) { ; ...see definitions ; } ; max_floor: u8 ; inverted_max_floor: u8 (1/max_floor) ; spawning_pattern: [8]struct (5 bytes){ ; entities_idx: [4]u8 ; spawn_frequencies: u8 ; } ; } .MACRODEF GEN_EVENT_DIALOGUE floor =dialogue $start: .DB low($floor), $01 .DB bank(=dialogue), high(ptr(=dialogue)), low(ptr(=dialogue)) .PADTO =$start+8 .END .MACRODEF GEN_EVENT_SPECIAL_ENTITY floor entity_idx $load: .DB low($floor), $03, $07, low($entity_idx) .PADTO =$load+8 $spawn: .DB low($floor), $04, $07 .PADTO =$spawn+8 .END .MACRODEF GEN_EVENT_LOAD_ENTITY floor loaded_entity_idx entity_idx $load: .DB low($floor), $03, low($loaded_entity_idx), low($entity_idx) .PADTO =$load+8 .END .MACRODEF GEN_EVENT_SPAWN_LOADED_ENTITY_XY floor loaded_entity_idx arg_x arg_y arg_d $spawn: .DB low($floor), $05, low($loaded_entity_idx), low($arg_x), low($arg_y), low($arg_d) .PADTO =$spawn+8 .END .MACRODEF GEN_EVENT_REMOVE_STAIRS floor $start: .DB low($floor), $02 .PADTO =$start+8 .END .INCLUDE "map/dungeons/morningforest.gbasm" .INCLUDE "map/dungeons/campsite.gbasm"