mm icon indicating copy to clipboard operation
mm copied to clipboard

Macros for `weekEventReg` and `eventInf`

Open AngheloAlf opened this issue 3 years ago • 7 comments

I made macros for accessing both weekEventReg and eventInf, this will allow us to name those flags. Scripts to automatically convert most uses were made too. I also tweaked the schedule macros to use the WEEKEVENTREG defines. I updated scheduledis.py to use those macros too.

There are some special accesses to weekEventReg and eventInf in which the new macros won't work. Those probably will need their own custom macros, which should be made on documentation passes on their respective systems.

AngheloAlf avatar Jul 24 '22 22:07 AngheloAlf

Looks good overall. Probably need to take a look at RaceDog. It doesn't get touched by this PR, but it as WEEKEVENTREGs, I think it is another special case like HORSE_RACE_FLAGS.

There are a few files with special kinds of weekEventReg accesses which don't fit the new macros. I was thinking on leaving those to documentation passes of their corresponding systems. The files are the following:

  • z_demo.c
  • z_sram_NES.c: there's a fun array here
  • z_dm_ravine.c: https://decomp.me/scratch/98Qv8
  • z_en_aob_01.c, z_en_dg.c and z_en_racedog.c
  • z_en_elfgrp.c

If you think we should try to address those cases in this PR then I'm open to discuss them

AngheloAlf avatar Jul 25 '22 17:07 AngheloAlf

Aob01 and the two dog files are the same system, so I can cook up some defines when I'm documenting Aob1

tom-overton avatar Jul 25 '22 19:07 tom-overton

Do you prefer I leave them untouched in this PR then?

AngheloAlf avatar Jul 25 '22 19:07 AngheloAlf

It doesn't really matter to me either way. If you don't do it, I'll do it later.

tom-overton avatar Jul 25 '22 19:07 tom-overton

Personally I think we should add a todo to these special cases in this PR. Documenting them later is fine.

hensldm avatar Jul 25 '22 19:07 hensldm

I discovered the context of several WeekEventReg values in the context of ovl_En_Go (Link to discussion). The defines are to be removed from ovl_En_Go, due to the work going on here but to avoid losing the information, I can copy them somewhere (spreadsheet?), demote them to comments in ovl_En_Go, add them as suggestions to z64save.h in this PR, etc... whatever is desired. Please let me know if there's any preference.

StickyThwomp avatar Sep 18 '22 15:09 StickyThwomp

I discovered the context of several WeekEventReg values in the context of ovl_En_Go (Link to discussion). The defines are to be removed from ovl_En_Go, due to the work going on here but to avoid losing the information, I can copy them somewhere (spreadsheet?), demote them to comments in ovl_En_Go, add them as suggestions to z64save.h in this PR, etc... whatever is desired. Please let me know if there's any preference.

@StickyThwomp sorry it has taken so long, but personally I would say just demote them to comments next to where they are used for now. If this PR gets in before, than it would be better to move them to the central header file.

hensldm avatar Sep 22 '22 03:09 hensldm

I've probably missed a few extra and missing ().

EllipticEllipsis avatar Nov 05 '22 15:11 EllipticEllipsis

It's not perfect, but they're all going to be looked at again anyway.

EllipticEllipsis avatar Nov 05 '22 18:11 EllipticEllipsis