SHARE
TWEET

Yo dawg I herd u liek macros

ISSOtm Jun 17th, 2018 91 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. generate_map: MACRO
  2. MAP_ID_NAME equs STRCAT("MAP_ID_", STRUPR("\1"))
  3.  
  4. SECTION "\1 map blocks", ROMX[$4000],BANK[MAP_ID_NAME]
  5. \1MapChunks:
  6.  
  7.     PURGE MAP_ID_NAME
  8.  
  9.  
  10. MAP_FOLDER_PATH equs STRCAT(STRCAT("chunks/", STRLWR("\1")), "/chunk")
  11.  
  12. ROW_ID = 0
  13.     REPT 64
  14. CHUNK_ID = 0
  15.         REPT 128
  16. COORDS equs STRCAT(STRCAT(STRSUB("{ROW_ID}", 2, STRLEN("{ROW_ID}") - 1), "x"), STRSUB("{CHUNK_ID}", 2, STRLEN("{CHUNK_ID}")))
  17.  
  18.             PUSHS
  19. INCLUDE "{MAP_FOLDER_PATH}{COORDS}.blk"
  20.             POPS
  21.             IF DEF(CHUNK_NAME)
  22.                 db HIGH(CHUNK_NAME), BANK(CHUNK_NAME)
  23.                 PURGE CHUNK_NAME
  24.             ELSE
  25.                 ; Empty chunk
  26.                 dw 0
  27.             ENDC
  28.  
  29.             PURGE COORDS
  30. CHUNK_ID = CHUNK_ID + 1
  31.         ENDR
  32.  
  33.         PURGE CHUNK_ID
  34.     ENDR
  35.     PURGE ROW_ID
  36.     PURGE MAP_FOLDER_PATH
  37. ENDM
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top