From 8eb0796f8e3010a9e4449b0d2351e69bf9970778 Mon Sep 17 00:00:00 2001 From: ManDude <7569514+ManDude@users.noreply.github.com> Date: Sun, 24 Apr 2022 20:15:16 +0100 Subject: [PATCH 1/6] subtitle editing and text project compiler rework (#1331) * add a `subtitle` bucket and rename buckets 67 and 68 * automatic `heap-base` * subtitles editor * adjust default params * bug * Update subtitle.gc * fix blue color inconsistency in progress * void. * Update subtitle.gc * Update subtitle.gc * Extend `heap-base` detection to check for errors * sometimes it's actually manually set! * remove broken error check * rework how compiling text files works * try out subtitles source v2 * bugfix * oops * Update game_text_common.cpp --- common/type_system/Type.h | 1 + common/type_system/deftype.cpp | 30 +- common/util/FontUtils.cpp | 4 +- decompiler/config/all-types.gc | 13 +- game/assets/game_subtitle.gp | 4 +- game/assets/game_text.gp | 2 +- game/assets/jak1/subtitle/game_subtitle_en.gs | 222 +++++++ .../assets/jak1/subtitle/game_subtitle_en.txt | 111 ---- game/assets/jak1/subtitle/game_subtitle_es.gs | 6 + .../assets/jak1/subtitle/game_subtitle_es.txt | 6 - .../{game_text_en.txt => game_text_en.gs} | 0 .../opengl_renderer/OpenGLRenderer.cpp | 11 +- game/graphics/opengl_renderer/buckets.h | 9 +- goal_src/engine/ambient/ambient.gc | 10 +- goal_src/engine/camera/cam-debug.gc | 10 +- goal_src/engine/camera/cam-layout.gc | 2 +- goal_src/engine/camera/cam-states.gc | 2 +- goal_src/engine/camera/cam-update.gc | 2 +- goal_src/engine/collide/collide-cache.gc | 8 +- goal_src/engine/collide/collide-edge-grab.gc | 32 +- goal_src/engine/collide/collide-mesh.gc | 2 +- goal_src/engine/collide/collide-shape.gc | 20 +- goal_src/engine/collide/main-collide.gc | 2 +- goal_src/engine/debug/anim-tester.gc | 38 +- goal_src/engine/debug/debug.gc | 4 +- goal_src/engine/debug/menu.gc | 12 +- goal_src/engine/debug/part-tester.gc | 2 +- goal_src/engine/dma/dma-buffer.gc | 2 +- goal_src/engine/dma/dma-h.gc | 23 +- goal_src/engine/draw/drawable.gc | 32 +- goal_src/engine/draw/process-drawable.gc | 8 +- goal_src/engine/entity/entity.gc | 30 +- goal_src/engine/game/game-info.gc | 10 +- goal_src/engine/game/main.gc | 12 +- goal_src/engine/game/task/process-taskable.gc | 4 +- goal_src/engine/geometry/vol.gc | 2 +- goal_src/engine/gfx/ocean/ocean-mid.gc | 10 +- goal_src/engine/gfx/ripple.gc | 2 +- goal_src/engine/gfx/tfrag/tfrag-methods.gc | 6 +- goal_src/engine/level/load-boundary.gc | 6 +- goal_src/engine/nav/navigate.gc | 34 +- goal_src/engine/nav/path.gc | 8 +- goal_src/engine/physics/trajectory.gc | 2 +- .../engine/sparticle/sparticle-launcher.gc | 2 +- goal_src/engine/target/joint-mod-h.gc | 6 +- goal_src/engine/target/logic-target.gc | 44 +- goal_src/engine/target/sidekick.gc | 6 +- goal_src/engine/target/target-util.gc | 8 +- goal_src/engine/ui/hud-classes.gc | 10 +- goal_src/engine/ui/progress/progress-draw.gc | 4 +- goal_src/engine/ui/progress/progress.gc | 8 +- goal_src/engine/ui/text.gc | 417 ++++++------- goal_src/game.gp | 21 +- goal_src/goal-lib.gc | 13 +- goal_src/levels/beach/air-h.gc | 88 ++- goal_src/levels/common/ropebridge.gc | 2 +- goal_src/levels/jungle/fisher.gc | 2 +- goal_src/levels/misty/mistycannon.gc | 2 +- goal_src/levels/ogre/ogreboss.gc | 2 +- goal_src/levels/racer_common/target-racer.gc | 10 +- goal_src/levels/sunken/target-tube.gc | 12 +- goal_src/levels/swamp/swamp-rat-nest.gc | 2 +- goal_src/levels/village1/fishermans-boat.gc | 12 +- goal_src/pc/pckernel-h.gc | 6 - goal_src/pc/pckernel.gc | 9 +- goal_src/pc/progress-pc.gc | 8 +- goal_src/pc/subtitle.gc | 547 +++++++++++++++--- goalc/CMakeLists.txt | 3 +- goalc/compiler/Compiler.h | 3 +- .../compiler/compilation/CompilerControl.cpp | 50 +- goalc/data_compiler/game_subtitle.cpp | 192 ------ goalc/data_compiler/game_text.cpp | 210 ------- goalc/data_compiler/game_text.h | 62 -- goalc/data_compiler/game_text_common.cpp | 408 +++++++++++++ .../{game_subtitle.h => game_text_common.h} | 74 ++- goalc/make/Tools.cpp | 56 +- goalc/make/Tools.h | 1 - test/goalc/test_with_game.cpp | 2 +- test/test_data/test_game_text.gp | 2 + 79 files changed, 1739 insertions(+), 1321 deletions(-) create mode 100644 game/assets/jak1/subtitle/game_subtitle_en.gs delete mode 100644 game/assets/jak1/subtitle/game_subtitle_en.txt create mode 100644 game/assets/jak1/subtitle/game_subtitle_es.gs delete mode 100644 game/assets/jak1/subtitle/game_subtitle_es.txt rename game/assets/jak1/text/{game_text_en.txt => game_text_en.gs} (100%) delete mode 100644 goalc/data_compiler/game_subtitle.cpp delete mode 100644 goalc/data_compiler/game_text.cpp delete mode 100644 goalc/data_compiler/game_text.h create mode 100644 goalc/data_compiler/game_text_common.cpp rename goalc/data_compiler/{game_subtitle.h => game_text_common.h} (51%) create mode 100644 test/test_data/test_game_text.gp diff --git a/common/type_system/Type.h b/common/type_system/Type.h index 02a544bbe1..c5d8fdafdc 100644 --- a/common/type_system/Type.h +++ b/common/type_system/Type.h @@ -282,6 +282,7 @@ class StructureType : public ReferenceType { bool is_always_stack_singleton() const { return m_always_stack_singleton; } void set_allow_misalign(bool misalign) { m_allow_misalign = misalign; } void set_gen_inspect(bool gen_inspect) { m_generate_inspect = gen_inspect; } + int size() const { return m_size_in_mem; } protected: friend class TypeSystem; diff --git a/common/type_system/deftype.cpp b/common/type_system/deftype.cpp index 075a2077ec..053b189db5 100644 --- a/common/type_system/deftype.cpp +++ b/common/type_system/deftype.cpp @@ -316,6 +316,7 @@ StructureDefResult parse_structure_def( int method_count_assert = -1; uint64_t flag_assert = 0; bool flag_assert_set = false; + bool set_heapbase = false; while (!rest->is_empty_list()) { if (car(rest).is_pair()) { auto opt_list = &car(rest); @@ -366,6 +367,7 @@ StructureDefResult parse_structure_def( } rest = cdr(rest); flags.heap_base = hb; + set_heapbase = true; } else if (opt_name == ":allow-misaligned") { result.allow_misaligned = true; } else if (opt_name == ":final") { @@ -378,6 +380,25 @@ StructureDefResult parse_structure_def( } } + if (ts->fully_defined_type_exists(TypeSpec("process")) && + ts->tc(TypeSpec("process"), TypeSpec(type->get_parent()))) { + // check heap-base if this is a child of process. + auto process_type = ts->get_type_of_type("process"); + auto auto_hb = (flags.size - process_type->size() + 0xf) & ~0xf; + if (!set_heapbase) { + // wasnt set manually so set automatically. + flags.heap_base = auto_hb; + } else if (flags.heap_base < auto_hb) { + // was set manually so verify if that's correct. + throw std::runtime_error( + fmt::format("Process heap underflow in type {}: heap-base is {} vs. auto-detected {}", + type->get_name(), flags.heap_base, auto_hb)); + //} else if (flags.heap_base != auto_hb) { + // fmt::print("Type {} has manual heap-base ({} vs {}). This is fine. \n", type->get_name(), + // flags.heap_base, auto_hb); + } + } + if (size_assert != -1 && flags.size != u16(size_assert)) { throw std::runtime_error("Type " + type->get_name() + " came out to size " + std::to_string(int(flags.size)) + " but size-assert was set to " + @@ -398,15 +419,6 @@ StructureDefResult parse_structure_def( flags.flag, flag_assert)); } - if (result.flags.heap_base) { - int heap_start_1 = 112 + result.flags.heap_base; - int heap_start_2 = (result.flags.size + 15) & (~15); - if (heap_start_1 != heap_start_2) { - throw std::runtime_error(fmt::format("Heap base bad on {}: {} vs {}\n", type->get_name(), - heap_start_1, heap_start_2)); - } - } - result.flags = flags; return result; } diff --git a/common/util/FontUtils.cpp b/common/util/FontUtils.cpp index dc046fe059..a48c236995 100644 --- a/common/util/FontUtils.cpp +++ b/common/util/FontUtils.cpp @@ -387,8 +387,8 @@ static std::vector g_encode_info_jak1 = { }; static std::vector g_replace_info_jak1 = { - // \" -> " (confusing) - {"\\\"", "\""}, + // \" -> " (yeah it looks confusing) + {"\"", "\\\""}, // other {"A~Y~-21H~-5Vº~Z", "Å"}, diff --git a/decompiler/config/all-types.gc b/decompiler/config/all-types.gc index 611a26134d..d2c4169016 100644 --- a/decompiler/config/all-types.gc +++ b/decompiler/config/all-types.gc @@ -501,7 +501,7 @@ (gmerc-tfrag-tex1 18) ;; generic merc, with tfrag textures, level 1 (shrub-tex0 19) (shrub0 20) - + (shrub-tex1 25) (shrub1 26) @@ -557,9 +557,12 @@ (pre-sprite-textures 65) ;; common (sprite 66) ;; debug spheres? 67 - (debug-draw0 67) + (debug 67) ;; debug text 68 - (debug-draw1 68) + (debug-no-zbuf 68) + + ;; extra buckets for pc port + (subtitle 69) ) (define-extern sinteger type) @@ -10259,7 +10262,7 @@ (normal-attack 14) (strong-attack 15) (indestructible 16) - + (fop17 17) ;; unused (eco-blocked 18) (respawn 19) @@ -11365,7 +11368,7 @@ (target-attack 12) ;; all target attacks (mother-spider 13) (cak-14 14) ;; unused - (blue-eco-suck 15) ;; manipy, orb-cache-top, + (blue-eco-suck 15) ;; manipy, orb-cache-top, (unknown-16 16) (unknown-17 17) (unknown-18 18) diff --git a/game/assets/game_subtitle.gp b/game/assets/game_subtitle.gp index dedcad416b..d262da393f 100644 --- a/game/assets/game_subtitle.gp +++ b/game/assets/game_subtitle.gp @@ -4,8 +4,8 @@ ;; you can find the game-text-version parsing in .cpp and an enum in goal-lib.gc (subtitle - (jak1-v1 "game/assets/jak1/subtitle/game_subtitle_en.txt") - (jak1-v1 "game/assets/jak1/subtitle/game_subtitle_es.txt") + (jak1-v1 "game/assets/jak1/subtitle/game_subtitle_en.gs") + (jak1-v1 "game/assets/jak1/subtitle/game_subtitle_es.gs") ) diff --git a/game/assets/game_text.gp b/game/assets/game_text.gp index 728481ca1c..06c63a1b61 100644 --- a/game/assets/game_text.gp +++ b/game/assets/game_text.gp @@ -5,7 +5,7 @@ (text (jak1-v1 "assets/game_text.txt") - (jak1-v1 "game/assets/jak1/text/game_text_en.txt") + (jak1-v1 "game/assets/jak1/text/game_text_en.gs") ) diff --git a/game/assets/jak1/subtitle/game_subtitle_en.gs b/game/assets/jak1/subtitle/game_subtitle_en.gs new file mode 100644 index 0000000000..119193de2f --- /dev/null +++ b/game/assets/jak1/subtitle/game_subtitle_en.gs @@ -0,0 +1,222 @@ +(language-id 0 6) + +;; ----------------- +;; intro + +("sage-intro-sequence-a" + (24 "SAGE" "I HAVE SPENT MY LIFE SEARCHING FOR THE ANSWERS THAT MY FATHER, AND MY FATHER'S FATHERS FAILED TO FIND.") + (260 "SAGE" "WHO WERE THE PRECURSORS? WHY DID THEY CREATE THE VAST MONOLITHS THAT LITHER OUR PLANET?") + (454 "SAGE" "HOW DID THEY HARNESS ECO, THE LIFE ENERGY OF THE WORLD? WHAT WAS THEIR PURPOSE? AND WHY DID THEY VANISH?") + (708) + (720 "SAGE" "I HAVE ASKED THE PLANTS, BUT THEY DO NOT REMEMBER.") + (818 "SAGE" "THE PLANTS HAVE ASKED THE ROCKS, BUT THE ROCKS DO NOT RECALL.") + (957 "SAGE" "EVEN THE ROCKS DO NOT RECALL...") + (1064) + (1090 "SAGE" "EVERY BONE IN MY BODY TELLS ME THAT THE ANSWERS REST ON THE SHOULDERS OF A YOUNG BOY") + (1297 "SAGE" "OBLIVIOUS TO HIS DESTINY, UNINTERESTED IN THE SEARCH FOR TRUTH, AND REJECTING OF MY GUIDANCE!") + (1545 "SAGE" "AND WHY WOULD HE WANT TO LISTEN TO OLD SAMOS THE SAGE ANYWAY?") + (1689 "SAGE" "I'M ONLY THE MASTER OF GREEN ECO, ONE OF THE WISEST MEN ON THE PLANET!") + (1875) + (1958 "SAGE" "SO IT SEEMS THE ANSWER BEGINS NOT WITH CAREFUL RESEARCH, OR SENSIBLE THINKING.") + (2145 "SAGE" "NAY! AS WITH MANY OF FATE'S MYSTERIES") + (2281 "SAGE" "IT BEGINS WITH BUT A SMALL ACT OF DISOBEDIENCE.") + (2440 "DAXTER" "HEY! UH, JAK? OL' GREEN STUFF TOLD US NOT TO COME HERE!") + ) + +("sidekick-human-intro-sequence-b" + (547 "OLD MAN" "CONTINUE YOUR SEARCH FOR ARTIFACTS AND ECO.") + (674 "OLD MAN" "IF THE LOCALS POSSESS PRECURSOR ITEMS, YOU KNOW WHAT TO DO.") + (842 "WOMAN" "DEAL HARSHLY WITH ANYBODY WHO STRAYS FROM THE VILLAGE.") + (937 "WOMAN" "WE WILL ATTACK IT IN DUE TIME.") + (1027) + ) + +("sidekick-human-intro-sequence-c" + (12 "DAXTER" "WHAT ARE WE DOING HERE ANYWAY, JAK? THIS PLACE GIVES ME THE CREEPS!") + (151) + (369 "DAXTER" "HUH?") + (404 "DAXTER" "(GROAN) STUPID PRECURSOR JUNK!") + (496) + (577 "DAXTER" "EEK! WHAT IS THAT DARK OOZE? IT SURE DON'T LOOK FRIENDLY.") + (721) + (777 "DAXTER" "THE SAGE YAPS ON ABOUT THE PRECURSORS THAT BUILT THIS PLACE ALL THE TIME.") + (909 "DAXTER" "\"WHERE DID THEY GO? WHY DID THEY BUILD THIS CRAP?\"") + (1014 "DAXTER" "NOW I LIKE PRECURSOR ORBS AND POWER CELLS AS MUCH AS THE NEXT GUY") + (1124 "DAXTER" "BUT IF YOU ASK ME, THEY MUST HAVE BEEN REAL LOSERS.") + (1212 "DAXTER" "WHOA! HOW DID YOU DO THAT?") + (1271) + (1331 "DAXTER" "JAK, I THINK WE'RE IN TROUBLE!") + (1386) + (1857 "DAXTER" "MAN, THAT STUNG.") + (1919) + (1941 "DAXTER" "I TOLD YOU WE SHOULDN'T 'A' COME HERE, AND YOU LISTENED?") + (2034) + (2057 "DAXTER" "WHAAAT?") + (2101) + (2189 "DAXTER" "WAAAAAAAAHHHHHHHH!!") + (2307 "DAXTER" "OKAY, OKAY. I'M FINE, I'M FINE...") + (2431) + (2481 "DAXTER" "WAAAAAAAAHHHHHHHH!!") + ) + +("sage-intro-sequence-d1" + (137 "SAGE" "WHAT IN GREEN TARNATION DO YOU TWO WANT?") + (220 "DAXTER" "WE- WE- WE WAS- THEY WAS- I'M- I WAS-") + (283 "SAGE" "DON'T TELL ME! INSTEAD OF HEEDING MY WISDOM, THE TWO OF YOU WENT MUCKING AROUND") + (446 "SAGE" "IN THE ONLY PLACE THAT I TOLD YOU NOT TO GO: MISTY ISLAND!") + (550 "DAXTER" "THAT'S RIGHT! AND THEN-") + (579 "SAGE" "AND, DAXTER, YOU'VE FINALLY TOOK A MUCH-NEEDED BATH, BUT IN A BATHTUB FILLED WITH DARK ECO.") + (793 "DAXTER" "LOOK, OLD MAN, ARE YOU GONNA KEEP YAPPIN', OR YOU GONNA HELP ME OUTTA THIS MESS!?") + (920 "SAGE" "I'M GONNA KEEP YAPPIN'! BECAUSE IN MY PROFESSIONAL OPINION, THE CHANGE IS AN IMPROVEMENT.") + (1079 "SAGE" "AND BESIDES... I COULDN'T HELP YOU IF I WANTED TO.") + (1186 "DAXTER" "WHAT!?") + (1221 "SAGE" "THERE'S ONLY ONE PERSON WHO HAS STUDIED DARK ECO LONG ENOUGH") + (1329 "SAGE" "TO HAVE A CHANCE AT RETURNING YOU TO YOUR PREVIOUS FORM:") + (1431 "SAGE" "GOL ACHERON, THE SAGE.") + (1496 "SAGE" "BUT HE LIVES FAR TO THE NORTH. FAR, FAR TO NORTH. NOBODY HAS SPOKEN TO HIM IN AGES.") + (1718 "SAGE" "I WOULD TELEPORT YOU THERE, BUT I CAN'T DO THAT EITHER.") + (1831 "SAGE" "NONE OF THE THREE SAGES THAT MAINTAIN THE OTHER TELEPORTER GATES") + (1934 "SAGE" "HAVE SEEN FIT TO TURN THEIR ENDS ON FOR QUITE A WHILE!") + ) + +("sage-intro-sequence-d2" + (3 "SAGE" "THE ONLY OTHER WAY NORTH IS BY FOOT THROUGH THE FIRE CANYON") + (114 "SAGE" "BUT ITS VOLCANIC SOIL IS HOT ENOUGH TO MELT PRECURSOR METAL.") + (224 "SAGE" "YOU CAN'T JUST WALK THROUGH IT.") + (270 "KEIRA" "BUT YOU COULD FLY OVER IT, IF YOU HAD A ZOOMER EQUIPPED WITH A HEAT SHIELD.") + (396 "KEIRA" "I JUST HAPPEN TO BE WORKING ON SUCH A THING AT THIS VERY MOMENT.") + (515 "KEIRA" "ALL I WOULD NEED IS TWENTY POWER CELLS TO GIVE IT ENOUGH ENERGY") + (605 "KEIRA" "TO WITHSTAND THE CANYON'S HEAT. ISN'T THAT RIGHT, DADDY?") + (697) + (699 "SAGE" "YES, KEIRA, THAT MIGHT WORK. BUT WHERE ARE A BOY") + (826 "SAGE" "AND A HALF!") + (857 "SAGE" "GOING TO GET TWENTY POWER CELLS?") + (911 "KEIRA" "FROM THE VILLAGERS! MOST OF THEM HAVE A POWER CELL OR TWO STASHED AWAY SOMEWHERE.") + (1050 "KEIRA" "AND EVEN IF THEY AREN'T WILLING TO JUST GIVE THEM AWAY") + (1133 "KEIRA" "GREASING THEIR PALMS WITH A FEW PRECURSOR ORBS SHOULD DO THE TRICK.") + (1249 "KEIRA" "AND I BET THERE ARE EVEN MORE OF THEM OUT IN THE WILDS JUST WAITING FOR SOME") + (1364 "KEIRA" "BRAVE ADVENTURER TO FIND.") + (1435 "DAXTER" "WELL WE'VE GOT THE BRAVE ADVENTURER, AT LEAST.") + (1529) + (1532 "SAGE" "BRAVE ADVENTURER?") + (1582 "SAGE" "YOU TWO COULDN'T FIND YOUR WAY OUT OF THE VILLAGE WITHOUT TRAINING!") + (1685) + (1689 "SAGE" "BEFORE YOU DO ANYTHING ELSE, YOU BETTER GO THROUGH THE WARP GATE AND GET") + (1810 "SAGE" "SOME PRACTICE ON GEYSER ROCK.") + (1872) + (1878 "DAXTER" "EHH, WE WON'T FIND ANY MORE OF THAT DARK-OO AND ECO STUFF, WILL WE?") + (1993 "DAXTER" "'CAUSE I'D HATE TO FALL IN AGAIN AND TURN INTO YOU!") + (2072 "SAGE" "GET IN THERE! BEFORE I TURN YOU BOTH INTO FERNS!") + (2192) + ) + + +;; ----------------- +;; oracle + +("oracle-right-eye-1" (0 "ORACLE" "FOR YOUR GIFT, ANOTHER POWER CELL IS YOURS.")) +("oracle-left-eye-1" (0 "ORACLE" "YOU HAVE PROVEN YOURSELF WORTHY. HERE IS A POWER CELL.")) +("oracle-right-eye-2" (0 "ORACLE" "HERE IS ANOTHER POWER CELL FOR YOUR QUEST.")) +("oracle-left-eye-2" (0 "ORACLE" "FOR YOUR SACRIFICE, I OFFER YOU A POWER CELL.")) +("oracle-right-eye-3" (0 "ORACLE" "YOU HAVE OBTAINED ANOTHER POWER CELL.")) +("oracle-left-eye-3" (0 "ORACLE" "FOR YOUR EFFORT, A POWER CELL IS THE REWARD.")) + +;; ----------------- +;; swamp + +("billy-introduction" + (6 "BILLY" "HOWDY, FRIENDS! ENJOYIN' MY BEAUTIFUL SWAMP? I OWN THESE HERE PARTS. EVERYTHING THAT DOESN'T SINK INTO THE MUD, THAT IS! (LAUGHS)") + (349) + (369 "DAXTER" "JUDGING BY THE SMELL, I'D WAGER YOUR BATHTUB SANK IN THE MUD LONG AGO.") + (497) + (519 "BILLY" "WHAT'S A BATHTUB? ANYWAY I GOT BIGGER PROBLEMS NOW...") + (677) + (691 "BILLY" "SEEMS SOME NASTY LURKER VARMINTS ARE GROUSIN' ABOUTS SNATCHIN' EVERYTHING THEY CAN GET THEIR GRUBBY LITTLE PAWS ON.") + (910 "BILLY" "AND SCARED AWAY MY PET HIPHOG, FARTHY.") + (1000 "BILLY" "HE'S BEEN MISSIN' FOR NIGH ON TO A COON'S AGE.") + (1136 :offscreen "BILLY" "I'VE BEEN PUTTIN' OUT HIS FAVORITE SNACK, BUT THOSE ORNERY SWAMP RATS KEEP STEALIN' EM!") + (1318 :offscreen "BILLY" "IF YOU COULD KEEP THOSE PESKY CRITTERS AWAY LONG ENOUGH, I JUST KNOW FARTHY WOULD SMELL THEM VITTLES AND COME BACK!") + (1509) + (1527 "BILLY" "WILL YA HELP ME OUT?") + ) + +("billy-reject" + (7 "BILLY" "WELL, IF YOU CHANGE YOUR MIND, YOU KNOW WHERE TO FIND ME! (LAUGHS)") + ) + +("billy-accept" + (5 "BILLY" "GOOD! THOSE RATS WILL BE BACK ANYTIME.") + (109 "BILLY" "SHOOT ALL THEM RATS, AND KEEP 'EM FROM EATING AT LEAST ONE OF THEM SNACKS.") + ) + +("billy-resolution" + (1 "BILLY" "WELL FRY MY HIDE! YOU SURE KNOW HOW TO SHOOT! THANKS A HEAP FOR THE HELP.") + ) + +("billy-reminder-1" + (36 "BILLY" "AHH, Y'ALL BACK TO HELP STOP THEM RATS?") + ) + +;; ----------------- +;; citadel + +("green-sagecage-introduction" + (130 "SAGE" "IT'S ABOUT TIME YOU TWO DECIDED TO SHOW UP!") + (207 "DAXTER" "NICE TO SEE YOU TOO! DO THEY HAVE YOU MOPPING THE FLOORS NOW?") + (343 "SAGE" "THERE'S NO TIME FOR JOKES, DAXTER. GOL AND MAIA KIDNAPPED US TO SAP OUR ENERGIES TO POWER THEIR ABOMINABLE MACHINE.") + (574 :offscreen "SAGE" "IT APPEARS THEY HAVE COMBINED THE FUNCTIONAL REMAINS OF A PRECURSOR ROBOT WITH SCAVENGED ARTIFACTS FROM ACROSS THE LAND.") + (800 :offscreen "SAGE" "THEN THEY ADDED A FEW DIABOLICAL ADDITIONS OF THEIR OWN, CREATING THE ONE THING CAPABLE OF OPENING THE DARK ECO SILOS.") + (1060 "SAGE" "IF YOU CAN FREE THE FOUR OF US, WE CAN USE OUR COMBINED POWERS") + (1180 "SAGE" "TO BREAK THE FORCE SHIELD SURROUNDING THE ROBOT, BEFORE THEY USE IT TO DESTROY THE WORLD.") + ) + +("redsage-resolution" + (60 "RED SAGE" "(CHUCKLES) YOU'VE FINALLY COME TO RESCUE ME.") + (190 "RED SAGE" "DO YOU KNOW HOW LONG I'VE BEEN IN HERE? WHAT TOOK YOU SO LONG, YOU KNOW? (CHUCKLES) WHAT ARE YOUR NAMES?") + (429 "DAXTER" "I'M DAXTER! HE'S JAK, HE'S WITH ME.") + (540 :offscreen "RED SAGE" "GOOD JOB, DAXTER. YOU'RE A REAL HERO.") + (670) + (700 "RED SAGE" "YOU'VE GOT TO STOP GOL FROM LAUNCHING THE ROBOT. I'LL USE MY ECO POWER TO HELP OPEN THE SHIELD DOOR.") + ) + +("bluesage-resolution" + (60 "BLUE SAGE" "GOOD WORK, FELLOWS! OLD SAMOS WAS RIGHT ABOUT YOU!") + (165 "BLUE SAGE" "GREAT PILES OF PRECURSOR METAL! THAT INSIDIOUS MECHANICAL CREATION MUST NOT BE ALLOWED TO WREAK ITS TERRIBLE HAVOC!") + (420 "BLUE SAGE" "I WILL TRY TO ACTUATE THE SHIELD DOOR BY ELLICITING A CONDUIT OF ENERGY BETWEEN MYSELF AND THE VAST PORTAL BELOW!") + (666 "DAXTER" "UH... YEAH. YOU DO THAT. WE'LL UH... JUST GO FIND MORE HELP.") + (873) + (891 :offscreen "DAXTER" "WEIRDO!") + (980) + ) + +("yellowsage-resolution" + (50 "YELLOW SAGE" "WHO WOULDA THOUGHT I'D LIVE TO SEE THE DAY WHEN I NEEDED TO BE RESCUED BY A BOY AND HIS MUSKRAT!") + (271 "YELLOW SAGE" "(SIGHS) I'M GONNA GIVE GOL AND MAIA A LITTLE PAYBACK FOR THIS EMBARRASSMENT!") + (480 "YELLOW SAGE" "THEN WE'LL SEE ABOUT COOKING UP SOME MUSKRAT STEW...") + (606) + ) + +("green-sagecage-resolution" + (30 "SAGE" "GOOD WORK, BOYS! YOU'RE REAL HEROES NOW. I'LL COMBINE MY GREEN ECO POWER WITH THE OTHER THREE SAGES") + (284 "SAGE" "AND TOGETHER WE'LL OPEN THE SHIELD DOOR SURROUNDING THE PRECURSOR ROBOT.") + (405 "DAXTER" "YEAH YEAH THAT SOUNDS LIKE A GOOD START. AND THEN AFTER YOU GUYS OPEN THAT SHIELD, WHAT ARE YOU GONNA DO ABOUT THE ROBOT?") + (576 "SAGE" "NOTHING, DAXTER. WE HAVE TO KEEP THE SHIELD OPEN, IT'S UP TO YOU TWO TO FIGURE OUT HOW TO DESTROY THE ROBOT.") + (823 "DAXTER" "OH, GREAT. I GET TO HELP THE GUY THAT TURNED ME INTO A FURBALL DESTROY THE ONLY PERSON WHO CAN TURN ME BACK!") + (1111) + (1156 "SAGE" "FIRST, SAVE THE WORLD! THEN WE'LL TRY TO CONVINCE GOL TO HELP DAXTER.") + ) + +("green-sagecage-outro-preboss" + (50 "GOL" "YOU'RE TOO LATE, SAMOS. ONCE I POSSESS LIMITLESS DARK ECO, I WILL HAVE THE KEY TO CREATION ITSELF!") + (335 "SAGE" "THIS IS MADNESS! RELEASING THAT MUCH DARK ECO WILL DESTROY EVERYTHING WE KNOW!") + (485 "SAGE" "JUST LOOK WHAT IT'S DONE TO YOU!") + (581 "MAIA" "IT HAS GIVEN US A BEAUTY BEYOND ANYTHING YOU COULD UNDERSTAND.") + (696 "DAXTER" "BEAUTY? HAVE YOU TWO LOOKED IN A MIRROR LATELY?") + (828 "MAIA" "JUST WAIT UNTIL WE OPEN THE SILOS, LITTLE ONE. YOU THINK SHORT AND FUZZY IS BAD?") + (1017 "GOL" "AND TO THINK, YOU TWO TRAVELLED ALL THIS WAY FOR MY HELP.") + (1180 "GOL" "FOOLS! ENJOY YOUR FRONT ROW SEATS TO THE RECREATION OF THE WORLD!") + (1382) + (1605 "SAGE" "JAK! TAKE THE ELEVATOR UP AND STOP THAT ROBOT!") + ) + + diff --git a/game/assets/jak1/subtitle/game_subtitle_en.txt b/game/assets/jak1/subtitle/game_subtitle_en.txt deleted file mode 100644 index a42d6e1581..0000000000 --- a/game/assets/jak1/subtitle/game_subtitle_en.txt +++ /dev/null @@ -1,111 +0,0 @@ -(language-id 0 6) - -;; ----------------- -;; oracle - -("oracle-right-eye-1" (0 #f "ORACLE" "FOR YOUR GIFT, ANOTHER POWER CELL IS YOURS.")) -("oracle-left-eye-1" (0 #f "ORACLE" "YOU HAVE PROVEN YOURSELF WORTHY. HERE IS A POWER CELL.")) -("oracle-right-eye-2" (0 #f "ORACLE" "HERE IS ANOTHER POWER CELL FOR YOUR QUEST.")) -("oracle-left-eye-2" (0 #f "ORACLE" "FOR YOUR SACRIFICE, I OFFER YOU A POWER CELL.")) -("oracle-right-eye-3" (0 #f "ORACLE" "YOU HAVE OBTAINED ANOTHER POWER CELL.")) -("oracle-left-eye-3" (0 #f "ORACLE" "FOR YOUR EFFORT, A POWER CELL IS THE REWARD.")) - -;; ----------------- -;; swamp - -("billy-introduction" - (6 #f "BILLY" "HOWDY, FRIENDS! ENJOYIN' MY BEAUTIFUL SWAMP? I OWN THESE HERE PARTS. EVERYTHING THAT DOESN'T SINK INTO THE MUD, THAT IS! (LAUGHS)") - (349 #f "" "") - (369 #f "DAXTER" "JUDGING BY THE SMELL, I'D WAGER YOUR BATHTUB SANK IN THE MUD LONG AGO.") - (497 #f "" "") - (519 #f "BILLY" "WHAT'S A BATHTUB? ANYWAY I GOT BIGGER PROBLEMS NOW...") - (677 #f "" "") - (691 #f "BILLY" "SEEMS SOME NASTY LURKER VARMINTS ARE GROUSIN' ABOUTS SNATCHIN' EVERYTHING THEY CAN GET THEIR GRUBBY LITTLE PAWS ON.") - (910 #f "BILLY" "AND SCARED AWAY MY PET HIPHOG, FARTHY.") - (1000 #f "BILLY" "HE'S BEEN MISSIN' FOR NIGH ON TO A COON'S AGE.") - (1136 #t "BILLY" "I'VE BEEN PUTTIN' OUT HIS FAVORITE SNACK, BUT THOSE ORNERY SWAMP RATS KEEP STEALIN' EM!") - (1318 #t "BILLY" "IF YOU COULD KEEP THOSE PESKY CRITTERS AWAY LONG ENOUGH, I JUST KNOW FARTHY WOULD SMELL THEM VITTLES AND COME BACK!") - (1509 #f "" "") - (1527 #f "BILLY" "WILL YA HELP ME OUT?") - ) - -("billy-reject" - (7 #f "BILLY" "WELL, IF YOU CHANGE YOUR MIND, YOU KNOW WHERE TO FIND ME! (LAUGHS)") - ) - -("billy-accept" - (5 #f "BILLY" "GOOD! THOSE RATS WILL BE BACK ANYTIME.") - (109 #f "BILLY" "SHOOT ALL THEM RATS, AND KEEP 'EM FROM EATING AT LEAST ONE OF THEM SNACKS.") - ) - -("billy-resolution" - (1 #f "BILLY" "WELL FRY MY HIDE! YOU SURE KNOW HOW TO SHOOT! THANKS A HEAP FOR THE HELP.") - ) - -("billy-reminder-1" - (36 #f "BILLY" "AHH, Y'ALL BACK TO HELP STOP THEM RATS?") - ) - -;; ----------------- -;; citadel - -("green-sagecage-introduction" - (130 #f "SAGE" "IT'S ABOUT TIME YOU TWO DECIDED TO SHOW UP!") - (207 #f "DAXTER" "NICE TO SEE YOU TOO! DO THEY HAVE YOU MOPPING THE FLOORS NOW?") - (343 #f "SAGE" "THERE'S NO TIME FOR JOKES, DAXTER. GOL AND MAIA KIDNAPPED US TO SAP OUR ENERGIES TO POWER THEIR ABOMINABLE MACHINE.") - (574 #t "SAGE" "IT APPEARS THEY HAVE COMBINED THE FUNCTIONAL REMAINS OF A PRECURSOR ROBOT WITH SCAVENGED ARTIFACTS FROM ACROSS THE LAND.") - (800 #t "SAGE" "THEN THEY ADDED A FEW DIABOLICAL ADDITIONS OF THEIR OWN, CREATING THE ONE THING CAPABLE OF OPENING THE DARK ECO SILOS.") - (1060 #f "SAGE" "IF YOU CAN FREE THE FOUR OF US, WE CAN USE OUR COMBINED POWERS") - (1180 #f "SAGE" "TO BREAK THE FORCE SHIELD SURROUNDING THE ROBOT, BEFORE THEY USE IT TO DESTROY THE WORLD.") - ) - -("redsage-resolution" - (60 #f "RED SAGE" "(CHUCKLES) YOU'VE FINALLY COME TO RESCUE ME.") - (190 #f "RED SAGE" "DO YOU KNOW HOW LONG I'VE BEEN IN HERE? WHAT TOOK YOU SO LONG, YOU KNOW? (CHUCKLES) WHAT ARE YOUR NAMES?") - (429 #f "DAXTER" "I'M DAXTER! HE'S JAK, HE'S WITH ME.") - (540 #t "RED SAGE" "GOOD JOB, DAXTER. YOU'RE A REAL HERO.") - (670 #f "" "") - (700 #f "RED SAGE" "YOU'VE GOT TO STOP GOL FROM LAUNCHING THE ROBOT. I'LL USE MY ECO POWER TO HELP OPEN THE SHIELD DOOR.") - ) - -("bluesage-resolution" - (60 #f "BLUE SAGE" "GOOD WORK, FELLOWS! OLD SAMOS WAS RIGHT ABOUT YOU!") - (165 #f "BLUE SAGE" "GREAT PILES OF PRECURSOR METAL! THAT INSIDIOUS MECHANICAL CREATION MUST NOT BE ALLOWED TO WREAK ITS TERRIBLE HAVOC!") - (420 #f "BLUE SAGE" "I WILL TRY TO ACTUATE THE SHIELD DOOR BY ELLICITING A CONDUIT OF ENERGY BETWEEN MYSELF AND THE VAST PORTAL BELOW!") - (666 #f "DAXTER" "UH... YEAH. YOU DO THAT. WE'LL UH... JUST GO FIND MORE HELP.") - (873 #f "" "") - (891 #t "DAXTER" "WEIRDO!") - (980 #f "" "") - ) - -("yellowsage-resolution" - (50 #f "YELLOW SAGE" "WHO WOULDA THOUGHT I'D LIVE TO SEE THE DAY WHEN I NEEDED TO BE RESCUED BY A BOY AND HIS MUSKRAT!") - (271 #f "YELLOW SAGE" "(SIGHS) I'M GONNA GIVE GOL AND MAIA A LITTLE PAYBACK FOR THIS EMBARRASSMENT!") - (480 #f "YELLOW SAGE" "THEN WE'LL SEE ABOUT COOKING UP SOME MUSKRAT STEW...") - (606 #f "" "") - ) - -("green-sagecage-resolution" - (30 #f "SAGE" "GOOD WORK, BOYS! YOU'RE REAL HEROES NOW. I'LL COMBINE MY GREEN ECO POWER WITH THE OTHER THREE SAGES") - (284 #f "SAGE" "AND TOGETHER WE'LL OPEN THE SHIELD DOOR SURROUNDING THE PRECURSOR ROBOT.") - (405 #f "DAXTER" "YEAH YEAH THAT SOUNDS LIKE A GOOD START. AND THEN AFTER YOU GUYS OPEN THAT SHIELD, WHAT ARE YOU GONNA DO ABOUT THE ROBOT?") - (576 #f "SAGE" "NOTHING, DAXTER. WE HAVE TO KEEP THE SHIELD OPEN, IT'S UP TO YOU TWO TO FIGURE OUT HOW TO DESTROY THE ROBOT.") - (823 #f "DAXTER" "OH, GREAT. I GET TO HELP THE GUY THAT TURNED ME INTO A FURBALL DESTROY THE ONLY PERSON WHO CAN TURN ME BACK!") - (1111 #f "" "") - (1156 #f "SAGE" "FIRST, SAVE THE WORLD! THEN WE'LL TRY TO CONVINCE GOL TO HELP DAXTER.") - ) - -("green-sagecage-outro-preboss" - (50 #f "GOL" "YOU'RE TOO LATE, SAMOS. ONCE I POSSESS LIMITLESS DARK ECO, I WILL HAVE THE KEY TO CREATION ITSELF!") - (335 #f "SAGE" "THIS IS MADNESS! RELEASING THAT MUCH DARK ECO WILL DESTROY EVERYTHING WE KNOW!") - (485 #f "SAGE" "JUST LOOK WHAT IT'S DONE TO YOU!") - (581 #f "MAIA" "IT HAS GIVEN US A BEAUTY BEYOND ANYTHING YOU COULD UNDERSTAND.") - (696 #f "DAXTER" "BEAUTY? HAVE YOU TWO LOOKED IN A MIRROR LATELY?") - (828 #f "MAIA" "JUST WAIT UNTIL WE OPEN THE SILOS, LITTLE ONE. YOU THINK SHORT AND FUZZY IS BAD?") - (1017 #f "GOL" "AND TO THINK, YOU TWO TRAVELLED ALL THIS WAY FOR MY HELP.") - (1180 #f "GOL" "FOOLS! ENJOY YOUR FRONT ROW SEATS TO THE RECREATION OF THE WORLD!") - (1382 #f "" "") - (1605 #f "SAGE" "JAK! TAKE THE ELEVATOR UP AND STOP THAT ROBOT!") - ) - - diff --git a/game/assets/jak1/subtitle/game_subtitle_es.gs b/game/assets/jak1/subtitle/game_subtitle_es.gs new file mode 100644 index 0000000000..79196a3028 --- /dev/null +++ b/game/assets/jak1/subtitle/game_subtitle_es.gs @@ -0,0 +1,6 @@ +(language-id 3) + +;; ----------------- +;; oracle + +("oracle-left-eye-1" (0 "ORÁCULO" "HABÉIS DEMOSTRADO SER HONESTOS. É AQUÍ UNA BATERÍA.")) diff --git a/game/assets/jak1/subtitle/game_subtitle_es.txt b/game/assets/jak1/subtitle/game_subtitle_es.txt deleted file mode 100644 index 718a7af3ab..0000000000 --- a/game/assets/jak1/subtitle/game_subtitle_es.txt +++ /dev/null @@ -1,6 +0,0 @@ -(language-id 3) - -;; ----------------- -;; oracle - -("oracle-left-eye-1" (0 #f "ORÁCULO" "HABÉIS DEMOSTRADO SER HONESTOS. É AQUÍ UNA BATERÍA.")) diff --git a/game/assets/jak1/text/game_text_en.txt b/game/assets/jak1/text/game_text_en.gs similarity index 100% rename from game/assets/jak1/text/game_text_en.txt rename to game/assets/jak1/text/game_text_en.gs diff --git a/game/graphics/opengl_renderer/OpenGLRenderer.cpp b/game/graphics/opengl_renderer/OpenGLRenderer.cpp index e73ee673cd..7858b133ed 100644 --- a/game/graphics/opengl_renderer/OpenGLRenderer.cpp +++ b/game/graphics/opengl_renderer/OpenGLRenderer.cpp @@ -266,10 +266,11 @@ void OpenGLRenderer::init_bucket_renderers() { init_bucket_renderer("sprite", BucketCategory::SPRITE, BucketId::SPRITE, std::move(sprite_renderers)); // 66 - init_bucket_renderer("debug-draw-0", BucketCategory::OTHER, - BucketId::DEBUG_DRAW_0, 0x20000); - init_bucket_renderer("debug-draw-1", BucketCategory::OTHER, - BucketId::DEBUG_DRAW_1, 0x8000); + init_bucket_renderer("debug", BucketCategory::OTHER, BucketId::DEBUG, 0x20000); + init_bucket_renderer("debug-no-zbuf", BucketCategory::OTHER, + BucketId::DEBUG_NO_ZBUF, 0x8000); + init_bucket_renderer("subtitle", BucketCategory::OTHER, BucketId::SUBTITLE, + 0x2000); // for now, for any unset renderers, just set them to an EmptyBucketRenderer. for (size_t i = 0; i < m_bucket_renderers.size(); i++) { @@ -502,4 +503,4 @@ void OpenGLRenderer::do_pcrtc_effects(float alp, glEnable(GL_DEPTH_TEST); } -} \ No newline at end of file +} diff --git a/game/graphics/opengl_renderer/buckets.h b/game/graphics/opengl_renderer/buckets.h index de32c772c6..c6d762e556 100644 --- a/game/graphics/opengl_renderer/buckets.h +++ b/game/graphics/opengl_renderer/buckets.h @@ -70,9 +70,10 @@ enum class BucketId { // 64 PRE_SPRITE_TEX = 65, // maybe it's just common textures? SPRITE = 66, - DEBUG_DRAW_0 = 67, - DEBUG_DRAW_1 = 68, - MAX_BUCKETS = 69 + DEBUG = 67, + DEBUG_NO_ZBUF = 68, + SUBTITLE = 69, + MAX_BUCKETS = 70 }; enum class BucketCategory { @@ -89,4 +90,4 @@ enum class BucketCategory { }; constexpr const char* BUCKET_CATEGORY_NAMES[(int)BucketCategory::MAX_CATEGORIES] = { - "tfrag", "tie", "shrub", "tex", "merc", "mercneric", "sprite", "ocean", "other"}; \ No newline at end of file + "tfrag", "tie", "shrub", "tex", "merc", "mercneric", "sprite", "ocean", "other"}; diff --git a/goal_src/engine/ambient/ambient.gc b/goal_src/engine/ambient/ambient.gc index 1ebb0e8fe3..c8b286f46e 100644 --- a/goal_src/engine/ambient/ambient.gc +++ b/goal_src/engine/ambient/ambient.gc @@ -671,7 +671,7 @@ *temp-string* (add-debug-text-3d #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) *temp-string* (-> arg0 bsphere) (font-color orange-red) @@ -1119,7 +1119,7 @@ (when *display-ambient-sound-marks* (add-debug-text-3d #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (symbol->string (res-lump-struct obj 'effect-name symbol :time 0.0)) gp-0 (font-color white) @@ -1147,7 +1147,7 @@ (when (and (nonzero? a1-7) *common-text*) (add-debug-text-3d #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (lookup-text! *common-text* (the-as game-text-id a1-7) #f) gp-0 (font-color white) @@ -1213,7 +1213,7 @@ ) (add-debug-text-3d #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (res-lump-struct obj 'name string) gp-0 (font-color white) @@ -1221,7 +1221,7 @@ ) (add-debug-text-3d #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (symbol->string s5-0) gp-0 (font-color white) diff --git a/goal_src/engine/camera/cam-debug.gc b/goal_src/engine/camera/cam-debug.gc index 16d12c697e..ba8a958372 100644 --- a/goal_src/engine/camera/cam-debug.gc +++ b/goal_src/engine/camera/cam-debug.gc @@ -249,7 +249,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) a2-0 (the-as (pointer dma-tag) a3-16) ) @@ -1229,7 +1229,7 @@ (set! (-> a0-3 w) 1.0) (vector+! a1-2 v1-4 a0-3) ) - (add-debug-line #t (bucket-id debug-draw1) gp-0 s5-0 (new 'static 'rgba :r #xff :a #x80) #f (the-as rgba -1)) + (add-debug-line #t (bucket-id debug-no-zbuf) gp-0 s5-0 (new 'static 'rgba :r #xff :a #x80) #f (the-as rgba -1)) (let ((a1-5 s5-0) (v1-5 gp-0) (a0-5 s5-0) @@ -1240,7 +1240,7 @@ (set! (-> a0-5 w) 1.0) (vector+! a1-5 v1-5 a0-5) ) - (add-debug-line #t (bucket-id debug-draw1) gp-0 s5-0 (new 'static 'rgba :g #xff :a #x80) #f (the-as rgba -1)) + (add-debug-line #t (bucket-id debug-no-zbuf) gp-0 s5-0 (new 'static 'rgba :g #xff :a #x80) #f (the-as rgba -1)) (let ((a1-8 s5-0) (v1-6 gp-0) (a0-7 s5-0) @@ -1251,14 +1251,14 @@ (set! (-> a0-7 w) 1.0) (vector+! a1-8 v1-6 a0-7) ) - (add-debug-line #t (bucket-id debug-draw1) gp-0 s5-0 (new 'static 'rgba :b #xff :a #x80) #f (the-as rgba -1)) + (add-debug-line #t (bucket-id debug-no-zbuf) gp-0 s5-0 (new 'static 'rgba :b #xff :a #x80) #f (the-as rgba -1)) (when arg0 (set! (-> s5-0 quad) (-> arg0 quad)) (vector-normalize! s5-0 4096.0) (vector+! s5-0 gp-0 s5-0) (add-debug-line #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) gp-0 s5-0 (new 'static 'rgba :r #x7f :g #x7f :a #x80) diff --git a/goal_src/engine/camera/cam-layout.gc b/goal_src/engine/camera/cam-layout.gc index 8157886698..b8ad9ca93d 100644 --- a/goal_src/engine/camera/cam-layout.gc +++ b/goal_src/engine/camera/cam-layout.gc @@ -168,7 +168,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) + (bucket-id debug) gp-0 (the-as (pointer dma-tag) a3-4) ) diff --git a/goal_src/engine/camera/cam-states.gc b/goal_src/engine/camera/cam-states.gc index 10902117dc..b89c344686 100644 --- a/goal_src/engine/camera/cam-states.gc +++ b/goal_src/engine/camera/cam-states.gc @@ -1341,7 +1341,7 @@ (let ((t1-0 #x40000080)) (add-debug-flat-triangle #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (the-as vector (-> gp-0 0)) (-> gp-0 0 vertex 1) (-> gp-0 0 vertex 2) diff --git a/goal_src/engine/camera/cam-update.gc b/goal_src/engine/camera/cam-update.gc index 436eba96d3..b94afc7d6d 100644 --- a/goal_src/engine/camera/cam-update.gc +++ b/goal_src/engine/camera/cam-update.gc @@ -328,7 +328,7 @@ (when *display-level-spheres* (add-debug-sphere #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> s5-1 info bsphere) (-> s5-1 info bsphere w) (new 'static 'rgba :r #xff :a #x80) diff --git a/goal_src/engine/collide/collide-cache.gc b/goal_src/engine/collide/collide-cache.gc index b0ead97c4e..443637cbb4 100644 --- a/goal_src/engine/collide/collide-cache.gc +++ b/goal_src/engine/collide/collide-cache.gc @@ -12,14 +12,14 @@ (let ((t1-0 (copy-and-set-field (-> *pat-mode-info* (-> gp-0 pat mode) color) a 64))) (add-debug-flat-triangle #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (the-as vector (-> gp-0 vertex)) (-> gp-0 vertex 1) (-> gp-0 vertex 2) t1-0 ) (#when PC_PORT - (add-debug-outline-triangle #t (bucket-id debug-draw1) (-> gp-0 vertex 0) (-> gp-0 vertex 1) (-> gp-0 vertex 2) + (add-debug-outline-triangle #t (bucket-id debug-no-zbuf) (-> gp-0 vertex 0) (-> gp-0 vertex 1) (-> gp-0 vertex 2) (static-rgba 0 0 0 64) ) ) @@ -40,7 +40,7 @@ ) (add-debug-sphere #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (the-as vector (-> gp-1 prim-core)) (-> gp-1 prim-core world-sphere w) t0-1 @@ -2506,7 +2506,7 @@ ) (when v1-12 ;; uncomment to view the point that blocks you from exiting duck. - ;;(add-debug-point #t (bucket-id debug-draw1) (-> s5-0 closest-pt)) + ;;(add-debug-point #t (bucket-id debug-no-zbuf) (-> s5-0 closest-pt)) (return #t) ) ) diff --git a/goal_src/engine/collide/collide-edge-grab.gc b/goal_src/engine/collide/collide-edge-grab.gc index f3a0729204..91d09ea488 100644 --- a/goal_src/engine/collide/collide-edge-grab.gc +++ b/goal_src/engine/collide/collide-edge-grab.gc @@ -551,7 +551,7 @@ (defmethod debug-draw edge-grab-info ((obj edge-grab-info)) (add-debug-line #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (the-as vector (-> obj world-vertex)) (-> obj world-vertex 1) (new 'static 'rgba :r #xff :a #x60) @@ -560,28 +560,28 @@ ) (add-debug-sphere #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> obj center-hold) 204.8 (new 'static 'rgba :r #xff :g #xff :a #x80) ) (add-debug-sphere #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> obj left-hand-hold) 204.8 (new 'static 'rgba :r #xff :g #xff :a #x60) ) (add-debug-sphere #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> obj right-hand-hold) 204.8 (new 'static 'rgba :r #xff :g #xff :a #x60) ) (add-debug-outline-triangle #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (the-as vector (-> obj tri-vertex)) (-> obj world-vertex 4) (-> obj world-vertex 5) @@ -615,7 +615,7 @@ ((-> s3-0 ignore) (add-debug-line #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) a2-0 a3-0 (new 'static 'rgba :r #x7f :g #x7f :b #x7f :a #x50) @@ -627,7 +627,7 @@ (else (add-debug-line #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) a2-0 a3-0 (new 'static 'rgba :r #xff :g #xff :b #xff :a #x60) @@ -636,7 +636,7 @@ ) (add-debug-vector #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) s2-0 (-> s3-0 outward) (meters 0.3) @@ -654,7 +654,7 @@ (defmethod debug-draw-sphere collide-edge-work ((obj collide-edge-work)) (dotimes (s5-0 (the-as int (-> obj num-verts))) (let ((a2-0 (-> obj verts s5-0))) - (add-debug-sphere #t (bucket-id debug-draw1) a2-0 819.2 (new 'static 'rgba :r #xff :g #xff :a #x80)) + (add-debug-sphere #t (bucket-id debug-no-zbuf) a2-0 819.2 (new 'static 'rgba :r #xff :g #xff :a #x80)) ) ) #f @@ -671,28 +671,28 @@ (while s4-0 (+! s5-0 1) (set! (-> s3-0 y) (-> s4-0 center-pt y)) - (add-debug-sphere #t (bucket-id debug-draw1) s3-0 409.6 (new 'static 'rgba :a #x80)) + (add-debug-sphere #t (bucket-id debug-no-zbuf) s3-0 409.6 (new 'static 'rgba :a #x80)) (cond (s2-0 (set! s2-0 #f) (add-debug-sphere #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> s4-0 center-pt) 614.4 (new 'static 'rgba :r #xff :g #xff :a #x80) ) - (add-debug-sphere #t (bucket-id debug-draw1) (-> s4-0 outward-pt) 409.6 (new 'static 'rgba :r #xff :a #x80)) + (add-debug-sphere #t (bucket-id debug-no-zbuf) (-> s4-0 outward-pt) 409.6 (new 'static 'rgba :r #xff :a #x80)) ) (else (add-debug-sphere #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> s4-0 center-pt) 614.4 (new 'static 'rgba :r #x7f :g #x7f :a #x40) ) - (add-debug-sphere #t (bucket-id debug-draw1) (-> s4-0 outward-pt) 409.6 (new 'static 'rgba :r #x7f :a #x40)) + (add-debug-sphere #t (bucket-id debug-no-zbuf) (-> s4-0 outward-pt) 409.6 (new 'static 'rgba :r #x7f :a #x40)) ) ) (set! s4-0 (-> s4-0 next)) @@ -703,7 +703,7 @@ (dotimes (s5-1 (the-as int (-> obj num-attempts))) (add-debug-sphere #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (the-as vector (-> obj attempts s5-1)) 409.6 (new 'static 'rgba :a #x40) @@ -719,7 +719,7 @@ ) (add-debug-outline-triangle #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (the-as vector (-> v1-3 vertex)) (-> v1-3 vertex 1) (-> v1-3 vertex 2) diff --git a/goal_src/engine/collide/collide-mesh.gc b/goal_src/engine/collide/collide-mesh.gc index 04e87f675f..910882460c 100644 --- a/goal_src/engine/collide/collide-mesh.gc +++ b/goal_src/engine/collide/collide-mesh.gc @@ -73,7 +73,7 @@ (.svf (&-> a2-1 quad) vf1) (.svf (&-> a3-0 quad) vf2) (.svf (&-> t0-0 quad) vf3) - (add-debug-flat-triangle #t (bucket-id debug-draw1) a2-1 a3-0 t0-0 t1-0) + (add-debug-flat-triangle #t (bucket-id debug-no-zbuf) a2-1 a3-0 t0-0 t1-0) ) ) (set! s5-0 (-> (the-as (inline-array collide-mesh-tri) s5-0) 1)) diff --git a/goal_src/engine/collide/collide-shape.gc b/goal_src/engine/collide/collide-shape.gc index 7298b9e14a..0ba114210e 100644 --- a/goal_src/engine/collide/collide-shape.gc +++ b/goal_src/engine/collide/collide-shape.gc @@ -1183,7 +1183,7 @@ (let ((t1-0 (-> *pat-mode-info* (-> s5-0 best-tri pat mode) hilite-color))) (add-debug-outline-triangle #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (the-as vector (-> s5-0 best-tri)) (-> s5-0 best-tri vertex 1) (-> s5-0 best-tri vertex 2) @@ -1192,7 +1192,7 @@ ) (add-debug-vector #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> s5-0 best-tri intersect) s2-1 (meters 0.00007324219) @@ -1200,7 +1200,7 @@ ) (add-debug-vector #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> s5-0 best-tri intersect) arg0 (meters 0.00007324219) @@ -1209,7 +1209,7 @@ (if (= (-> obj process type) target) (add-debug-vector #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> s5-0 best-tri intersect) (-> obj surface-normal) (meters 0.5) @@ -1746,7 +1746,7 @@ (when (and *display-collide-cache* (= (-> obj process type) target)) (debug-draw *collide-cache*) ;; NOTE: added - (add-debug-box #t (bucket-id debug-draw0) (-> s5-0 min) (-> s5-0 max) (new 'static 'rgba :a #x80 :b #x70 :g #x70)) + (add-debug-box #t (bucket-id debug) (-> s5-0 min) (-> s5-0 max) (new 'static 'rgba :a #x80 :b #x70 :g #x70)) ) ) (else @@ -2030,7 +2030,7 @@ "Draw collision debug." (add-debug-sphere (or *display-collision-marks* *display-target-marks*) - (bucket-id debug-draw0) + (bucket-id debug) (target-pos 0) 819.2 (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) @@ -2439,7 +2439,7 @@ "Draw our sphere" (add-debug-sphere #t - (bucket-id debug-draw0) + (bucket-id debug) (the-as vector (-> obj prim-core)) (-> obj local-sphere w) (new 'static 'rgba :r #xff :g #xff :b #xff :a #x40) @@ -2450,7 +2450,7 @@ "Draw our sphere" (add-debug-sphere #t - (bucket-id debug-draw0) + (bucket-id debug) (the-as vector (-> obj prim-core)) (-> obj local-sphere w) (the-as rgba (cond @@ -2472,7 +2472,7 @@ "Draw our sphere" (add-debug-sphere #t - (bucket-id debug-draw0) + (bucket-id debug) (the-as vector (-> obj prim-core)) (-> obj local-sphere w) (new 'static 'rgba :b #xff :a #x40) @@ -2483,7 +2483,7 @@ "Draw our sphere" (add-debug-sphere #t - (bucket-id debug-draw0) + (bucket-id debug) (the-as vector (-> obj prim-core)) (-> obj local-sphere w) (new 'static 'rgba :g #xff :a #x10) diff --git a/goal_src/engine/collide/main-collide.gc b/goal_src/engine/collide/main-collide.gc index 24f28032d6..f677d2955e 100644 --- a/goal_src/engine/collide/main-collide.gc +++ b/goal_src/engine/collide/main-collide.gc @@ -209,7 +209,7 @@ (.svf (&-> a2-0 quad) vf9) (add-debug-sphere #t - (bucket-id debug-draw0) + (bucket-id debug) a2-0 a3-0 (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) diff --git a/goal_src/engine/debug/anim-tester.gc b/goal_src/engine/debug/anim-tester.gc index 1734d48e80..f11cb715b0 100644 --- a/goal_src/engine/debug/anim-tester.gc +++ b/goal_src/engine/debug/anim-tester.gc @@ -216,7 +216,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) + (bucket-id debug) s5-3 (the-as (pointer dma-tag) a3-6) ) @@ -345,7 +345,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) + (bucket-id debug) s5-6 (the-as (pointer dma-tag) a3-12) ) @@ -847,7 +847,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) + (bucket-id debug) gp-0 (the-as (pointer dma-tag) a3-2) ) @@ -942,7 +942,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) + (bucket-id debug) s4-0 (the-as (pointer dma-tag) a3-2) ) @@ -1017,7 +1017,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) + (bucket-id debug) s5-2 (the-as (pointer dma-tag) a3-4) ) @@ -1070,7 +1070,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) + (bucket-id debug) s4-0 (the-as (pointer dma-tag) a3-2) ) @@ -1189,7 +1189,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) + (bucket-id debug) s5-1 (the-as (pointer dma-tag) a3-4) ) @@ -1246,7 +1246,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) + (bucket-id debug) s4-0 (the-as (pointer dma-tag) a3-2) ) @@ -1360,7 +1360,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) + (bucket-id debug) s5-1 (the-as (pointer dma-tag) a3-4) ) @@ -1535,7 +1535,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) + (bucket-id debug) s1-0 (the-as (pointer dma-tag) a3-4) ) @@ -1586,7 +1586,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) + (bucket-id debug) s1-1 (the-as (pointer dma-tag) a3-8) ) @@ -1680,7 +1680,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) + (bucket-id debug) (the-as pointer s4-1) (the-as (pointer dma-tag) a3-15) ) @@ -1977,7 +1977,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) + (bucket-id debug) gp-2 (the-as (pointer dma-tag) a3-17) ) @@ -2008,7 +2008,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) + (bucket-id debug) gp-3 (the-as (pointer dma-tag) a3-21) ) @@ -2066,7 +2066,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) + (bucket-id debug) gp-1 (the-as (pointer dma-tag) a3-1) ) @@ -2108,7 +2108,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) + (bucket-id debug) gp-3 (the-as (pointer dma-tag) a3-3) ) @@ -2151,7 +2151,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) + (bucket-id debug) gp-4 (the-as (pointer dma-tag) a3-5) ) @@ -2182,7 +2182,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) + (bucket-id debug) gp-5 (the-as (pointer dma-tag) a3-7) ) @@ -2246,7 +2246,7 @@ (debug-print-channels (-> self skel) (the-as symbol *stdcon*)) (add-debug-x #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> self root trans) (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) ) diff --git a/goal_src/engine/debug/debug.gc b/goal_src/engine/debug/debug.gc index 5e1275b053..9d49a9b742 100644 --- a/goal_src/engine/debug/debug.gc +++ b/goal_src/engine/debug/debug.gc @@ -894,7 +894,7 @@ (set! (-> gp-0 0 x) (* (sin (-> arg0 stick0-dir)) (-> arg0 stick0-speed))) (set! (-> gp-0 0 y) (* (cos (-> arg0 stick0-dir)) (-> arg0 stick0-speed))) (dotimes (s5-1 32) - (with-dma-buffer-add-bucket ((s3-0 (-> (current-frame) debug-buf)) (bucket-id debug-draw0)) + (with-dma-buffer-add-bucket ((s3-0 (-> (current-frame) debug-buf)) (bucket-id debug)) (draw-sprite2d-xy s3-0 (the int (* 120.0 (-> gp-0 s5-1 x))) (the int (* 144.0 (-> gp-0 s5-1 y))) @@ -1010,7 +1010,7 @@ (when arg1 (dotimes (s5-1 (1- (-> arg0 num-points))) (if (!= (+ s5-1 1) (-> arg0 h-first)) - (add-debug-line #t (bucket-id debug-draw1) + (add-debug-line #t (bucket-id debug-no-zbuf) (-> arg0 points s5-1) (-> arg0 points (1+ s5-1)) (static-rgba #x80 #xc0 #x80 #x80) #f (the-as rgba -1)) diff --git a/goal_src/engine/debug/menu.gc b/goal_src/engine/debug/menu.gc index 15b66ef2e3..7fc1c32577 100644 --- a/goal_src/engine/debug/menu.gc +++ b/goal_src/engine/debug/menu.gc @@ -760,7 +760,7 @@ (else (font-color dim-gray)) ;; a parent, but not selected )) (with-dma-buffer-add-bucket ((s3-0 (-> (current-frame) debug-buf)) - (bucket-id debug-draw1)) + (bucket-id debug-no-zbuf)) ;; NOTE: the draw-string-adv advances too far on widescreen. ;; NOTE 2: should be fixed? (draw-string-adv (-> item name) s3-0 s5-0) @@ -797,7 +797,7 @@ ) ) (with-dma-buffer-add-bucket ((s4-0 (-> (current-frame) debug-buf)) - (bucket-id debug-draw1)) + (bucket-id debug-no-zbuf)) (draw-string (-> item name) s4-0 v1-2) ) ) @@ -828,7 +828,7 @@ ) ) (with-dma-buffer-add-bucket ((s4-0 (-> (current-frame) debug-buf)) - (bucket-id debug-draw1)) + (bucket-id debug-no-zbuf)) (draw-string (-> item name) s4-0 v1-2) ) ) @@ -856,7 +856,7 @@ ) ) (with-dma-buffer-add-bucket ((s1-0 (-> (current-frame) debug-buf)) - (bucket-id debug-draw1)) + (bucket-id debug-no-zbuf)) (draw-string-adv (-> item name) s1-0 s5-0) (draw-string-adv ":" s1-0 s5-0) (cond @@ -940,7 +940,7 @@ ) ) (with-dma-buffer-add-bucket ((s0-0 (-> (current-frame) debug-buf)) - (bucket-id debug-draw1)) + (bucket-id debug-no-zbuf)) ;; PC PORT : fixed for widescreen (draw-sprite2d-xy s0-0 (correct-x-int x-pos) y-pos (correct-x-int (-> menu pix-width)) (-> menu pix-height) (static-rgba #x00 #x00 #x00 #x40)) ) @@ -964,7 +964,7 @@ ) (set-origin! (-> menu context font) s3-1 s2-1) (with-dma-buffer-add-bucket ((sv-16 (-> (current-frame) debug-buf)) - (bucket-id debug-draw1)) + (bucket-id debug-no-zbuf)) (draw-string ">" sv-16 (-> menu context font)) ) ) diff --git a/goal_src/engine/debug/part-tester.gc b/goal_src/engine/debug/part-tester.gc index bd64b27b71..d1d9f7789e 100644 --- a/goal_src/engine/debug/part-tester.gc +++ b/goal_src/engine/debug/part-tester.gc @@ -54,7 +54,7 @@ ) (add-debug-x #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> self root trans) (the-as rgba (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80)) ) diff --git a/goal_src/engine/dma/dma-buffer.gc b/goal_src/engine/dma/dma-buffer.gc index 972f7afd53..54884fca5c 100644 --- a/goal_src/engine/dma/dma-buffer.gc +++ b/goal_src/engine/dma/dma-buffer.gc @@ -463,7 +463,7 @@ (defmacro with-dma-buffer-add-bucket (bindings &key (bucket-group (-> (current-frame) bucket-group)) &rest body) "Bind a dma-buffer to a variable and use it on a block to allow adding things to a new bucket. usage: (with-dma-buffer-add-bucket ((buffer-name buffer) bucket-id) &rest body) - example: (with-dma-buffer-add-bucket ((buf (-> (current-frame) debug-buf)) (bucket-id debug-draw1)) ...)" + example: (with-dma-buffer-add-bucket ((buf (-> (current-frame) debug-buf)) (bucket-id debug-no-zbuf)) ...)" `(let ((,(caar bindings) ,(cadar bindings))) (with-dma-bucket (,(caar bindings) ,bucket-group ,(cadr bindings)) diff --git a/goal_src/engine/dma/dma-h.gc b/goal_src/engine/dma/dma-h.gc index 1fea2597fd..0af37dbbbb 100644 --- a/goal_src/engine/dma/dma-h.gc +++ b/goal_src/engine/dma/dma-h.gc @@ -183,7 +183,7 @@ (next 2) ;; addr=after tag, next-tag=ADDR (ref 3) ;; addr=ADDR, next-tag=after tag (refs 4) ;; ref, but stall controled - (call 5) ;; + (call 5) ;; (ret 6) ;; (end 7) ;; next, but ends. ) @@ -208,11 +208,11 @@ ;; DMA data is divided into buckets. ;; At the end of a frame, the buckets are all connected together and sent. ;; the buckets are organized by renderer. - +(defconstant BUCKET_COUNT (#if PC_PORT 70 69)) (defenum bucket-id :type int32 :bitfield #f - + (bucket-0 0) ;; ? (bucket-1 1) ;; ? (bucket-2 2) ;; ? @@ -236,11 +236,11 @@ (gmerc-tfrag-tex1 18) ;; generic merc, with tfrag textures, level 1 (shrub-tex0 19) (shrub0 20) - - + + (shrub-tex1 25) (shrub1 26) - + (generic-foreground 30) ;; ? (alpha-tex0 31) @@ -258,11 +258,11 @@ (tfrag-dirt-near-1 42) (tfrag-ice-1 43) (tfrag-ice-near-1 44) - + (bucket-45 45) ;; merc (bucket-46 46) - + (shadow 47) (pris-tex0 48) @@ -296,9 +296,12 @@ (pre-sprite-textures 65) ;; common (sprite 66) ;; debug spheres? 67 - (debug-draw0 67) + (debug 67) ;; debug text 68 - (debug-draw1 68) + (debug-no-zbuf 68) + + ;; extra buckets for pc port + (subtitle 69) ) ;; A DMA bucket is a way of sorting data within a dma buffer. diff --git a/goal_src/engine/draw/drawable.gc b/goal_src/engine/draw/drawable.gc index 9dd7338f3a..ea291d61c9 100644 --- a/goal_src/engine/draw/drawable.gc +++ b/goal_src/engine/draw/drawable.gc @@ -134,12 +134,12 @@ (when (sphere-cull (-> arg0 bsphere)) (add-debug-sphere #t - (bucket-id debug-draw0) + (bucket-id debug) (-> arg0 bsphere) (-> arg0 bsphere w) (new 'static 'rgba :r #x80 :a #x80) ) - (add-debug-text-3d #t (bucket-id debug-draw1) arg1 (-> arg0 bsphere) (font-color white) (the-as vector2h #f)) + (add-debug-text-3d #t (bucket-id debug-no-zbuf) arg1 (-> arg0 bsphere) (font-color white) (the-as vector2h #f)) ) ) ) @@ -659,7 +659,7 @@ (if *display-lights* (add-debug-lights #t - (bucket-id debug-draw0) + (bucket-id debug) (the-as (inline-array light) (-> s3-0 light-group)) (-> arg1 origin) ) @@ -899,7 +899,6 @@ (none) ) -;; definition for symbol *debug-hook*, type (function none) (define *debug-hook* main-debug-hook) (define *add-sphere* #f) @@ -908,9 +907,9 @@ (defun real-main-draw-hook () "The main drawing function. This dispatches all renderers and is called directly from the display-loop - in main.gc." + in main.gc" (when *slow-frame-rate* - (dotimes (v1-2 40000000) ;; was 50000 + (dotimes (v1-2 50000000) ;; was 50000 (nop!) (nop!) (nop!) @@ -919,7 +918,7 @@ (nop!) ) ) - "Function to be executed to set up for engine dma" + "Function to be executed to set up for engine dma" ;; accidental docstring from the original game ;; update render enables from the debug menu (set! *vu1-enable-user* *vu1-enable-user-menu*) @@ -1333,7 +1332,7 @@ ;; get the increment in seconds unit. (let ((scaled-seconds (* (the int time-ratio) (the int (-> disp time-factor))))) ;; tell the sparticle system - (set-particle-frame-time (min 12 scaled-seconds)) + (set-particle-frame-time (min (seconds 0.04) scaled-seconds)) ;; the "not real" frame counters only count when unpaused (when (not (paused?)) @@ -1433,15 +1432,14 @@ ) ;; add the buckets - (set! (-> new-frame bucket-group)(dma-buffer-add-buckets (-> new-frame calc-buf) 69)) + (set! (-> new-frame bucket-group) (dma-buffer-add-buckets (-> new-frame calc-buf) BUCKET_COUNT)) ) ;; initialize the debug bucket - (debug-init-buffer - (bucket-id debug-draw1) - (new 'static 'gs-zbuf :zbp #x1c0 :psm (gs-psm ct24) :zmsk #x1) - (new 'static 'gs-test :zte #x1 :ztst (gs-ztest always)) - ) + (debug-init-buffer (bucket-id debug-no-zbuf) + (new 'static 'gs-zbuf :zbp #x1c0 :psm (gs-psm ct24) :zmsk #x1) + (new 'static 'gs-test :zte #x1 :ztst (gs-ztest always)) + ) ;; setup our drawing offset for even/odd offset (set-draw-env-offset (-> disp frames new-frame-idx draw) 2048 2048 odd-even) @@ -1465,7 +1463,7 @@ (*post-draw-hook* (-> disp frames (-> disp on-screen) frame calc-buf)) ;; iterate through all buckets and append a final GS state reset. - (dotimes (bucket-idx 69) + (dotimes (bucket-idx BUCKET_COUNT) (let* ((this-global-buf (-> this-frame global-buf)) (a2-0 (-> this-global-buf base)) ) @@ -1517,7 +1515,7 @@ (set! (-> v1-14 base) (&+ (the-as pointer a0-10) 16)) ) ;; patch the buckets. Now sending the calc buf will send everything! - (dma-buffer-patch-buckets (-> this-frame bucket-group) 69) + (dma-buffer-patch-buckets (-> this-frame bucket-group) BUCKET_COUNT) ;; append the final END. (let* ((v1-15 this-calc-buf) (a0-13 (the-as object (-> v1-15 base))) @@ -1574,7 +1572,7 @@ (>= (the-as int (-> *display* base-frame-counter)) (the-as int (-> *game-info* blackout-time))) ;; this is a hack. this is initialized to #x493e0. It prevents controller-loss pause from ;; triggering in the first few seconds of gameplay. - (< #x49764 (the-as int (-> *display* real-frame-counter))) + (< (seconds 1003) (-> *display* real-frame-counter)) ) (and (logtest? (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons r2)) ;; debug press (paused?) diff --git a/goal_src/engine/draw/process-drawable.gc b/goal_src/engine/draw/process-drawable.gc index 30d37cc3ef..14b70b8bae 100644 --- a/goal_src/engine/draw/process-drawable.gc +++ b/goal_src/engine/draw/process-drawable.gc @@ -271,7 +271,7 @@ (defun execute-math-engine () (#when PC_PORT (with-dma-buffer-add-bucket ((debug-buf (-> (current-frame) debug-buf)) - (bucket-id debug-draw1)) + (bucket-id debug-no-zbuf)) (when (-> *pc-settings* display-actor-counts) (draw-string-xy (string-format "M: ~D/~D A: ~D" (-> *matrix-engine* length) MATRIX_ENGINE_AMOUNT (process-count *active-pool*)) debug-buf 8 (- 224 18) (font-color default) (font-flags shadow kerning)) ) @@ -300,7 +300,7 @@ (when (and parent (nonzero? parent) (-> parent joint) (-> parent parent)) (let ((child (vector<-cspace! (new-stack-vector0) (-> obj node-list data i))) ) - (add-debug-line #t (bucket-id debug-draw0) child (vector<-cspace! (new-stack-vector0) parent) (new 'static 'rgba :g #xff :a #x40) #f (the rgba -1)) + (add-debug-line #t (bucket-id debug) child (vector<-cspace! (new-stack-vector0) parent) (new 'static 'rgba :g #xff :a #x40) #f (the rgba -1)) ) ) ) @@ -402,8 +402,8 @@ (defun draw-joint-spheres ((arg0 process-drawable)) (dotimes (s5-0 (-> arg0 node-list length)) (let ((a2-0 (vector<-cspace! (new-stack-vector0) (-> arg0 node-list data s5-0)))) - (add-debug-sphere #t (bucket-id debug-draw0) a2-0 819.2 (new 'static 'rgba :g #xff :a #x40)) - ;;(add-debug-text-sphere #t (bucket-id debug-draw0) a2-0 819.2 (the string (-> arg0 node-list data s5-0 joint name)) (new 'static 'rgba :g #xff :a #x40)) + (add-debug-sphere #t (bucket-id debug) a2-0 819.2 (new 'static 'rgba :g #xff :a #x40)) + ;;(add-debug-text-sphere #t (bucket-id debug) a2-0 819.2 (the string (-> arg0 node-list data s5-0 joint name)) (new 'static 'rgba :g #xff :a #x40)) ) ) #f diff --git a/goal_src/engine/entity/entity.gc b/goal_src/engine/entity/entity.gc index cfcf3d4a06..b45b0f3453 100644 --- a/goal_src/engine/entity/entity.gc +++ b/goal_src/engine/entity/entity.gc @@ -862,7 +862,7 @@ (let ((s1-1 (the-as process-drawable (-> s0-0 extra process)))) (add-debug-x #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> s1-1 root trans) (new 'static 'rgba :r #x80 :g #xff :b #x80 :a #x80) ) @@ -878,7 +878,7 @@ ) (add-debug-text-3d #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (symbol->string (-> s1-1 state name)) (-> s1-1 root trans) (font-color white) @@ -910,7 +910,7 @@ (if (and (the-as structure v0-10) (= (-> v0-10 type) symbol)) (add-debug-text-3d #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (symbol->string v0-10) (-> s1-1 root trans) (font-color white) @@ -921,7 +921,7 @@ ) ) ((or (= arg0 'full) (-> s0-0 extra process)) - (add-debug-x #t (bucket-id debug-draw1) s1-0 (the-as rgba (if (-> s0-0 extra process) + (add-debug-x #t (bucket-id debug-no-zbuf) s1-0 (the-as rgba (if (-> s0-0 extra process) (the-as uint #x8080ff80) (the-as uint #x800000ff) ) @@ -982,13 +982,13 @@ (when (and (type-type? (-> s0-3 type) process-drawable) (nonzero? (-> (the-as process-drawable s0-3) draw))) (add-debug-x #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> (the-as process-drawable s0-3) root trans) (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) ) (add-debug-sphere #t - (bucket-id debug-draw0) + (bucket-id debug) (vector+! (new 'stack-no-clear 'vector) (-> (the-as process-drawable s0-3) draw origin) @@ -1022,7 +1022,7 @@ (s4-2 (-> (the-as process-drawable s5-2) root trans)) ) (when s3-2 - (add-debug-x #t (bucket-id debug-draw1) s4-2 (the-as rgba (if (-> s3-2 extra process) + (add-debug-x #t (bucket-id debug-no-zbuf) s4-2 (the-as rgba (if (-> s3-2 extra process) (the-as uint #x8080ff80) (the-as uint #x800000ff) ) @@ -1030,7 +1030,7 @@ ) (add-debug-text-3d #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (res-lump-struct s3-2 'name string) s4-2 (the-as font-color (if (logtest? (-> s3-2 extra perm status) (entity-perm-status bit-0 bit-1)) @@ -1042,7 +1042,7 @@ ) (add-debug-text-3d #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (symbol->string (-> (the-as process-drawable s5-2) state name)) s4-2 (font-color white) @@ -1071,7 +1071,7 @@ ) (add-debug-sphere #t - (bucket-id debug-draw0) + (bucket-id debug) (vector+! (new 'stack-no-clear 'vector) (-> (the-as process-drawable s5-2) draw origin) @@ -1091,7 +1091,7 @@ (if v0-35 (add-debug-box #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (the-as vector (&+ v0-35 0)) (the-as vector (&+ v0-35 16)) (the-as rgba (if (is-object-visible? (-> s5-3 extra level) a1-31) @@ -1155,7 +1155,7 @@ (countdown (s2-4 (-> s3-4 length)) (add-debug-box #t - (bucket-id debug-draw0) + (bucket-id debug) (the-as vector (-> s3-4 data s2-4)) (the-as vector (+ (the-as uint (-> s3-4 data 0 max)) (* s2-4 32))) (the-as rgba (if (zero? (-> s4-4 index)) @@ -1936,14 +1936,14 @@ (let* ((e (-> inspect-info entity)) (name (res-lump-struct e 'name string))) (set! *display-actor-anim* (the string (and (-> inspect-info show-actor-info) name))) ;; draw trans - (add-debug-x #t (bucket-id debug-draw1) (-> e trans) (static-rgba 255 255 0 128)) + (add-debug-x #t (bucket-id debug-no-zbuf) (-> e trans) (static-rgba 255 255 0 128)) (if (or (not (-> inspect-info show-actor-info)) (!= (-> e type) entity-actor) (and (= (-> e type) entity-actor) (not (-> (the entity-actor e) extra process)))) - (add-debug-text-3d #t (bucket-id debug-draw1) name (-> e trans) (font-color red) (new 'static 'vector2h :y 8))) + (add-debug-text-3d #t (bucket-id debug-no-zbuf) name (-> e trans) (font-color red) (new 'static 'vector2h :y 8))) ;; start writing text (let* ((begin-y (- 16 (* (-> inspect-info scroll-y) 8))) (cur-y begin-y) (y-adv 8)) (with-dma-buffer-add-bucket ((debug-buf (-> (current-frame) debug-buf)) - (bucket-id debug-draw1)) + (bucket-id debug-no-zbuf)) ;; basic info, actor id, etc (draw-string-xy (string-format "~3L~A~0L ~A~%tags: ~D size: ~D aid: #x~x~%R1/L1 scroll L3 toggle display-actor-info~%--------------------" (-> e type) name (length e) (asize-of e) (-> e aid)) diff --git a/goal_src/engine/game/game-info.gc b/goal_src/engine/game/game-info.gc index 51b8f42a0a..a534efe216 100644 --- a/goal_src/engine/game/game-info.gc +++ b/goal_src/engine/game/game-info.gc @@ -29,8 +29,8 @@ ) ;; add text and vector - (add-debug-text-sphere #t (bucket-id debug-draw1) (-> obj trans) 819.2 (symbol->string (-> obj name)) s5-0) - (add-debug-vector #t (bucket-id debug-draw1) (-> obj trans) (-> obj normal) 8192.0 s5-0) + (add-debug-text-sphere #t (bucket-id debug-no-zbuf) (-> obj trans) 819.2 (symbol->string (-> obj name)) s5-0) + (add-debug-vector #t (bucket-id debug-no-zbuf) (-> obj trans) (-> obj normal) 8192.0 s5-0) ) 0 (none) @@ -929,12 +929,12 @@ (defmethod debug-draw! continue-point ((obj continue-point)) "Draw a continue point." (add-debug-x #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> obj trans) (new 'static 'rgba :r #xff :a #x80) ) (add-debug-text-3d #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> obj name) (-> obj trans) (font-color white) @@ -943,7 +943,7 @@ (let ((a3-2 (vector-z-quaternion! (new-stack-vector0) (-> obj quat)))) (add-debug-vector #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> obj trans) a3-2 8192.0 diff --git a/goal_src/engine/game/main.gc b/goal_src/engine/game/main.gc index b5904180ec..0a1669f62b 100644 --- a/goal_src/engine/game/main.gc +++ b/goal_src/engine/game/main.gc @@ -18,7 +18,7 @@ (defun letterbox () "Draw the letterbox black rectangles" (with-dma-buffer-add-bucket ((dma-buf (-> (current-frame) global-buf)) - (bucket-id debug-draw1)) ;; debug-draw1 is one of the last buckets + (bucket-id debug-no-zbuf)) ;; debug-no-zbuf is one of the last buckets ;; draw the two sprites (#cond ((not PC_PORT) @@ -75,7 +75,7 @@ (defun blackout () "Draw the blackout rectangle, convering the entire screen in darkness." (with-dma-buffer-add-bucket ((dma-buf (-> (current-frame) global-buf)) - (bucket-id debug-draw1)) ;; debug-draw1 is one of the last buckets + (bucket-id debug-no-zbuf)) ;; debug-no-zbuf is one of the last buckets (draw-sprite2d-xy dma-buf 0 0 512 224 (new 'static 'rgba :a #x80)) ) (none) @@ -330,7 +330,7 @@ ) (defmethod draw screen-filter ((obj screen-filter)) - (with-dma-buffer-add-bucket ((buf (-> (current-frame) global-buf)) (bucket-id debug-draw1)) + (with-dma-buffer-add-bucket ((buf (-> (current-frame) global-buf)) (bucket-id debug-no-zbuf)) (draw-sprite2d-xy buf -256 (- (-> *video-parms* screen-hy)) 512 (-> *video-parms* screen-sy) (-> obj color)) ) (none) @@ -467,7 +467,7 @@ (-> (current-frame) debug-buf) (-> (current-frame) global-buf) )) - (bucket-id debug-draw0)) + (bucket-id debug)) (show-iop-memory dma-buff) ) ) @@ -749,7 +749,7 @@ ;; debug dma (with-dma-buffer-add-bucket ((debug-buf (-> disp frames (-> disp on-screen) frame debug-buf)) - (bucket-id debug-draw1)) + (bucket-id debug-no-zbuf)) (when *display-profile* (dma-buffer-add-gs-set debug-buf (alpha-1 (new 'static 'gs-alpha :b 1 :d 1)) @@ -850,7 +850,7 @@ (-> disp frames (-> disp on-screen) frame debug-buf) (-> disp frames (-> disp on-screen) frame global-buf) )) - (bucket-id debug-draw0)) + (bucket-id debug)) (if (and (= *master-mode* 'pause) (!= *cheat-mode* 'camera)) (draw-string-xy (lookup-text! *common-text* (game-text-id pause) #f) s3-1 256 160 (font-color orange-red) (font-flags shadow kerning middle large)) diff --git a/goal_src/engine/game/task/process-taskable.gc b/goal_src/engine/game/task/process-taskable.gc index 3bab3a3c36..49307553cd 100644 --- a/goal_src/engine/game/task/process-taskable.gc +++ b/goal_src/engine/game/task/process-taskable.gc @@ -89,7 +89,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) + (bucket-id debug) s5-0 (the-as (pointer dma-tag) a3-4) ) @@ -118,7 +118,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) + (bucket-id debug) s5-1 (the-as (pointer dma-tag) a3-7) ) diff --git a/goal_src/engine/geometry/vol.gc b/goal_src/engine/geometry/vol.gc index 6e47a897eb..fd8863216a 100644 --- a/goal_src/engine/geometry/vol.gc +++ b/goal_src/engine/geometry/vol.gc @@ -192,7 +192,7 @@ (dotimes (s3-0 (/ (-> obj point-count) 2)) (add-debug-line #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (the-as vector s4-0) (the-as vector (&-> s4-0 4)) (the-as rgba s5-0) diff --git a/goal_src/engine/gfx/ocean/ocean-mid.gc b/goal_src/engine/gfx/ocean/ocean-mid.gc index 296d4eb98a..d34b1a7a27 100644 --- a/goal_src/engine/gfx/ocean/ocean-mid.gc +++ b/goal_src/engine/gfx/ocean/ocean-mid.gc @@ -1122,15 +1122,15 @@ (+! (-> p3 x) (+ x0 3145728.0)) (+! (-> p3 z) (+ y0 3145728.0)) - (add-debug-flat-triangle #t (bucket-id debug-draw1) p0 p1s p2s color0) - ;; (add-debug-flat-triangle #t (bucket-id debug-draw1) p3 p1 p2 color0) - (add-debug-outline-triangle #t (bucket-id debug-draw1) p0 p1 p2 color1) - (add-debug-outline-triangle #t (bucket-id debug-draw1) p3 p1 p2 color1) + (add-debug-flat-triangle #t (bucket-id debug-no-zbuf) p0 p1s p2s color0) + ;; (add-debug-flat-triangle #t (bucket-id debug-no-zbuf) p3 p1 p2 color0) + (add-debug-outline-triangle #t (bucket-id debug-no-zbuf) p0 p1 p2 color1) + (add-debug-outline-triangle #t (bucket-id debug-no-zbuf) p3 p1 p2 color1) (format (clear *temp-string*) "o: ~d ~d ~d ~b" x y (+ (* 6 y) x) masks) (add-debug-text-3d #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) *temp-string* p0 (font-color orange-red) diff --git a/goal_src/engine/gfx/ripple.gc b/goal_src/engine/gfx/ripple.gc index 4ccebbae04..251666ee76 100644 --- a/goal_src/engine/gfx/ripple.gc +++ b/goal_src/engine/gfx/ripple.gc @@ -122,7 +122,7 @@ (vector+! s5-0 s5-0 (-> arg0 root trans)) (add-debug-sphere #t - (bucket-id debug-draw0) + (bucket-id debug) s5-0 2048.0 (new 'static 'rgba :r #xff :g #xff :a #x80) diff --git a/goal_src/engine/gfx/tfrag/tfrag-methods.gc b/goal_src/engine/gfx/tfrag/tfrag-methods.gc index ab05075890..543be7f003 100644 --- a/goal_src/engine/gfx/tfrag/tfrag-methods.gc +++ b/goal_src/engine/gfx/tfrag/tfrag-methods.gc @@ -17,7 +17,7 @@ (dotimes (s3-0 (/ (-> s4-0 length) 2)) (add-debug-line #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> s4-0 data (* s3-0 2)) (-> s4-0 data (+ (* s3-0 2) 1)) (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) @@ -999,8 +999,8 @@ (-> arg1 global-buf) (edge-debug-lines (-> obj debug-data debug-lines)) - (add-debug-sphere #t (bucket-id debug-draw0) (-> obj bsphere) (-> obj bsphere w) (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80)) - ;;(add-debug-x #t (bucket-id debug-draw0) (-> obj bsphere) (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80)) + (add-debug-sphere #t (bucket-id debug) (-> obj bsphere) (-> obj bsphere w) (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80)) + ;;(add-debug-x #t (bucket-id debug) (-> obj bsphere) (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80)) (none) ) diff --git a/goal_src/engine/level/load-boundary.gc b/goal_src/engine/level/load-boundary.gc index cb5fd9c4bd..0744a536c5 100644 --- a/goal_src/engine/level/load-boundary.gc +++ b/goal_src/engine/level/load-boundary.gc @@ -382,7 +382,7 @@ (logtest? (-> *display* real-actual-frame-counter) 4) ) )) - (with-dma-buffer-add-bucket ((s5-0 (-> (current-frame) global-buf)) (bucket-id debug-draw0)) + (with-dma-buffer-add-bucket ((s5-0 (-> (current-frame) global-buf)) (bucket-id debug)) (dma-buffer-add-gs-set-flusha s5-0 (zbuf-1 (new 'static 'gs-zbuf :zbp #x1c0 :psm (gs-psm ct24))) (test-1 (new 'static 'gs-test :ate #x1 :atst (gs-atest greater-equal) :aref #x26 :zte #x1 :ztst (gs-ztest greater-equal))) @@ -501,7 +501,7 @@ (set! (-> s2-0 y) (-> s5-0 top-plane)) (add-debug-sphere #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) s2-0 8192.0 (new 'static 'rgba :a #x80) @@ -510,7 +510,7 @@ (set! (-> s2-0 y) (-> s5-0 bot-plane)) (add-debug-sphere #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) s2-0 8192.0 (new 'static 'rgba :a #x80) diff --git a/goal_src/engine/nav/navigate.gc b/goal_src/engine/nav/navigate.gc index 1c8c764afd..c1296cbf58 100644 --- a/goal_src/engine/nav/navigate.gc +++ b/goal_src/engine/nav/navigate.gc @@ -190,7 +190,7 @@ ) (add-debug-line #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (vector+! gp-0 s5-0 (the-as vector (-> s2-0 (-> arg0 vertex 0)))) (vector+! s4-0 s5-0 (the-as vector (-> s2-0 (-> arg0 vertex 1)))) arg1 @@ -199,7 +199,7 @@ ) (add-debug-line #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (vector+! gp-0 s5-0 (the-as vector (-> s2-0 (-> arg0 vertex 1)))) (vector+! s4-0 s5-0 (the-as vector (-> s2-0 (-> arg0 vertex 2)))) arg1 @@ -208,7 +208,7 @@ ) (add-debug-line #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (vector+! gp-0 s5-0 (the-as vector (-> s2-0 (-> arg0 vertex 2)))) (vector+! s4-0 s5-0 (the-as vector (-> s2-0 (-> arg0 vertex 0)))) arg1 @@ -1630,18 +1630,18 @@ (set! (-> s5-0 debug-time) (the-as uint (-> *display* actual-frame-counter))) (add-debug-sphere (logtest? (-> obj flags) (nav-control-flags navcf1)) - (bucket-id debug-draw0) + (bucket-id debug) (-> s5-0 bounds) (-> s5-0 bounds w) (new 'static 'rgba :r #xff :g #xff :a #x20) ) - (add-debug-vector #t (bucket-id debug-draw1) (-> s5-0 origin) *x-vector* (meters 1.0) *color-red*) - (add-debug-vector #t (bucket-id debug-draw1) (-> s5-0 origin) *z-vector* (meters 1.0) *color-blue*) + (add-debug-vector #t (bucket-id debug-no-zbuf) (-> s5-0 origin) *x-vector* (meters 1.0) *color-red*) + (add-debug-vector #t (bucket-id debug-no-zbuf) (-> s5-0 origin) *z-vector* (meters 1.0) *color-blue*) (when (logtest? (-> obj flags) (nav-control-flags navcf2)) (dotimes (s3-0 (-> s5-0 vertex-count)) (add-debug-x #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (vector+! s4-0 (-> s5-0 origin) (the-as vector (-> s5-0 vertex s3-0))) *color-green* ) @@ -1677,9 +1677,9 @@ (set! (-> s0-0 x) (- (-> a0-15 x) (-> v1-20 x))) (set! (-> s0-0 y) (+ (-> a0-15 y) (-> v1-20 y))) (set! (-> s0-0 z) (+ (-> a0-15 z) (-> v1-20 z))) - (add-debug-line #t (bucket-id debug-draw1) sv-192 s2-0 (the-as rgba sv-208) #f (the-as rgba -1)) - (add-debug-line #t (bucket-id debug-draw1) s2-0 s1-0 (the-as rgba sv-208) #f (the-as rgba -1)) - (add-debug-line #t (bucket-id debug-draw1) s1-0 s0-0 (the-as rgba sv-208) #f (the-as rgba -1)) + (add-debug-line #t (bucket-id debug-no-zbuf) sv-192 s2-0 (the-as rgba sv-208) #f (the-as rgba -1)) + (add-debug-line #t (bucket-id debug-no-zbuf) s2-0 s1-0 (the-as rgba sv-208) #f (the-as rgba -1)) + (add-debug-line #t (bucket-id debug-no-zbuf) s1-0 s0-0 (the-as rgba sv-208) #f (the-as rgba -1)) (let ((t9-7 add-debug-line) (a0-19 #t) (a1-13 68) @@ -1755,7 +1755,7 @@ (when (logtest? (-> obj flags) (nav-control-flags navcf7)) (dotimes (s3-3 (the-as int (-> s5-0 static-sphere-count))) (let ((s2-2 (-> s5-0 static-sphere s3-3))) - (add-debug-sphere #t (bucket-id debug-draw0) (the-as vector s2-2) (-> s2-2 trans w) *color-blue*) + (add-debug-sphere #t (bucket-id debug) (the-as vector s2-2) (-> s2-2 trans w) *color-blue*) (let ((s1-2 add-debug-text-3d) (s0-2 #t) ) @@ -1793,7 +1793,7 @@ ) (add-debug-line #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (vector+! a2-22 v1-80 (the-as vector (-> obj portal 0))) (vector+! a3-13 v1-80 (the-as vector (-> obj portal 1))) (new 'static 'rgba :r #xff :g #x80 :b #x40 :a #x80) @@ -1804,7 +1804,7 @@ ) (add-debug-vector #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> obj shape trans) (-> obj travel) (meters 0.00024414062) @@ -1812,7 +1812,7 @@ ) (add-debug-vector #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (vector+! (new 'stack-no-clear 'vector) (-> obj shape trans) (new 'static 'vector :y 4096.0 :w 1.0)) (-> obj old-travel) (meters 0.00024414062) @@ -1820,7 +1820,7 @@ ) (add-debug-x #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (vector+! (new 'stack-no-clear 'vector) (-> obj shape trans) (-> obj travel)) (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) ) @@ -1828,7 +1828,7 @@ (when (logtest? (-> obj flags) (nav-control-flags navcf7)) (add-debug-sphere #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (the-as vector (-> obj shape root-prim prim-core)) (-> obj shape nav-radius) (new 'static 'rgba :g #xff :b #xff :a #x20) @@ -1838,7 +1838,7 @@ (vector+! s4-0 (-> s5-0 origin) (the-as vector (&-> v1-95 x))) (add-debug-sphere #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) s4-0 (- (-> v1-95 w) (-> obj shape nav-radius)) (new 'static 'rgba :g #xff :b #xff :a #x20) diff --git a/goal_src/engine/nav/path.gc b/goal_src/engine/nav/path.gc index 18fd5902e9..5fa8a5a60f 100644 --- a/goal_src/engine/nav/path.gc +++ b/goal_src/engine/nav/path.gc @@ -35,7 +35,7 @@ (if (and (logtest? (-> obj flags) (path-control-flag draw-line)) (< s5-1 (+ (-> obj curve num-cverts) -1))) (add-debug-line #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) s4-1 (-> obj cverts (+ s5-1 1)) (new 'static 'rgba :r #xff :g #x80 :a #x80) @@ -44,7 +44,7 @@ ) ) (if (logtest? (-> obj flags) (path-control-flag draw-point)) - (add-debug-x #t (bucket-id debug-draw1) s4-1 (new 'static 'rgba :r #xff :a #x80)) + (add-debug-x #t (bucket-id debug-no-zbuf) s4-1 (new 'static 'rgba :r #xff :a #x80)) ) (when (logtest? (-> obj flags) (path-control-flag draw-text)) (let ((s3-1 add-debug-text-3d) @@ -292,7 +292,7 @@ (if (and (logtest? (-> obj flags) (path-control-flag draw-line)) (> (-> obj curve num-cverts) 0)) (add-debug-curve2 #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (the-as curve (&-> obj cverts)) (new 'static 'rgba :r #xff :g #x80 :a #x80) #f @@ -301,7 +301,7 @@ (dotimes (s5-1 (-> obj curve num-cverts)) (let ((s4-1 (-> obj cverts s5-1))) (if (logtest? (-> obj flags) (path-control-flag draw-point)) - (add-debug-x #t (bucket-id debug-draw1) s4-1 (new 'static 'rgba :r #xff :a #x80)) + (add-debug-x #t (bucket-id debug-no-zbuf) s4-1 (new 'static 'rgba :r #xff :a #x80)) ) (when (logtest? (-> obj flags) (path-control-flag draw-text)) (let ((s3-1 add-debug-text-3d) diff --git a/goal_src/engine/physics/trajectory.gc b/goal_src/engine/physics/trajectory.gc index 7258b10455..7af595444d 100644 --- a/goal_src/engine/physics/trajectory.gc +++ b/goal_src/engine/physics/trajectory.gc @@ -97,7 +97,7 @@ ) (add-debug-line #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) prev-pos pos (new 'static 'rgba :r #xff :a #x80) diff --git a/goal_src/engine/sparticle/sparticle-launcher.gc b/goal_src/engine/sparticle/sparticle-launcher.gc index 5edfd7139a..118d38ba56 100644 --- a/goal_src/engine/sparticle/sparticle-launcher.gc +++ b/goal_src/engine/sparticle/sparticle-launcher.gc @@ -925,7 +925,7 @@ ) (add-debug-sphere *display-actor-vis* - (bucket-id debug-draw0) + (bucket-id debug) gp-1 (-> gp-1 w) (new 'static 'rgba :g #xff :a #x80) diff --git a/goal_src/engine/target/joint-mod-h.gc b/goal_src/engine/target/joint-mod-h.gc index 8e8bceb5d5..bf53db9d33 100644 --- a/goal_src/engine/target/joint-mod-h.gc +++ b/goal_src/engine/target/joint-mod-h.gc @@ -70,7 +70,7 @@ (defun-debug joint-mod-debug-draw ((mod joint-mod)) "Draw a frame at the bone." ;; I believe this draws a set of coordinate axes that represent the transformation matrix. - (add-debug-matrix #t (bucket-id debug-draw1) (-> mod joint bone transform)) + (add-debug-matrix #t (bucket-id debug-no-zbuf) (-> mod joint bone transform)) (none) ) @@ -425,7 +425,7 @@ (if (and (= (-> gp-0 process type) target) (!= (-> gp-0 blend) 0.0)) (add-debug-text-sphere *display-target-marks* - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> gp-0 target) 819.2 "look" @@ -559,7 +559,7 @@ (if (and (= (-> gp-0 process type) target) (!= (-> gp-0 blend) 0.0)) (add-debug-text-sphere *display-target-marks* - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> gp-0 target) 819.2 "look" diff --git a/goal_src/engine/target/logic-target.gc b/goal_src/engine/target/logic-target.gc index b716175010..4e6f1d8d2f 100644 --- a/goal_src/engine/target/logic-target.gc +++ b/goal_src/engine/target/logic-target.gc @@ -93,7 +93,7 @@ (let ((s2-0 (-> arg0 history-data (logand (+ (-> arg0 unknown-halfword00) s4-0) 127)))) (add-debug-line (logtest? s5-0 2) - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> v1-19 trans) (-> s2-0 trans) (the-as rgba (+ #xffff00 (shl s4-0 24))) @@ -102,7 +102,7 @@ ) (add-debug-vector (logtest? s5-0 4) - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> s2-0 trans) (-> s2-0 transv) (meters 0.000024414063) @@ -111,7 +111,7 @@ (when (zero? (logand (-> s2-0 status) 256)) (add-debug-line (logtest? s5-0 1) - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> s1-0 intersect) (-> s2-0 intersect) (the-as rgba (+ #xffffff (shl s4-0 24))) @@ -124,7 +124,7 @@ ) (add-debug-vector (logtest? s5-0 32) - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> s2-0 intersect) (-> s2-0 surface-normal) (meters 1.0) @@ -132,7 +132,7 @@ ) (add-debug-vector (logtest? s5-0 16) - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> s2-0 intersect) (-> s2-0 local-normal) (meters 1.0) @@ -141,7 +141,7 @@ ) (add-debug-vector (logtest? s5-0 8) - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> s2-0 trans) (-> s2-0 transv-out) (meters 0.000024414063) @@ -633,7 +633,7 @@ (vector+! gp-1 gp-1 (-> self control trans)) (add-debug-text-sphere *display-target-marks* - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) gp-1 819.2 "target" @@ -809,7 +809,7 @@ (vector+! gp-1 gp-1 (-> self control trans)) (add-debug-text-sphere *display-target-marks* - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) gp-1 819.2 "ltransv" @@ -820,7 +820,7 @@ (vector+! gp-1 gp-1 (-> self control trans)) (add-debug-text-sphere *display-target-marks* - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) gp-1 819.2 "btransv" @@ -934,7 +934,7 @@ ) (add-debug-vector *display-target-marks* - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> self control trans) gp-0 (meters 2.0) @@ -942,7 +942,7 @@ ) (add-debug-vector *display-target-marks* - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> self control trans) s5-0 (meters 2.0) @@ -951,7 +951,7 @@ ) (add-debug-vector *display-target-marks* - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> self control trans) (-> self control unknown-matrix01 vector 2) (meters 2.0) @@ -1196,7 +1196,7 @@ ) (add-debug-vector *display-target-marks* - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> self control trans) (-> self control ground-poly-normal) (meters 2.0) @@ -1204,7 +1204,7 @@ ) (add-debug-vector *display-target-marks* - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> self control trans) (-> self control local-normal) (meters 2.0) @@ -1212,7 +1212,7 @@ ) (add-debug-vector *display-target-marks* - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> self control trans) (-> self control unknown-dynamics00 gravity-normal) (meters 2.5) @@ -1220,7 +1220,7 @@ ) (add-debug-vector *display-target-marks* - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> self control trans) (-> self control dynam gravity-normal) (meters 3.0) @@ -1344,7 +1344,7 @@ (when *display-edge-collision-marks* (add-debug-vector #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> (the-as swingpole s4-0) root trans) (the-as vector (&-> s4-0 stack 16)) (meters 3.0) @@ -1352,21 +1352,21 @@ ) (add-debug-sphere #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> (the-as swingpole s4-0) root trans) (-> (the-as swingpole s4-0) range) (new 'static 'rgba :r #xff :g #xff :a #x80) ) (add-debug-sphere #t - (bucket-id debug-draw0) + (bucket-id debug) (-> self control unknown-vector90) 819.2 (new 'static 'rgba :r #xff :a #x80) ) - (add-debug-sphere #t (bucket-id debug-draw1) s3-0 819.2 (new 'static 'rgba :g #xff :a #x80)) - (add-debug-sphere #t (bucket-id debug-draw1) s2-0 819.2 (new 'static 'rgba :g #xff :b #x40 :a #x80)) - (add-debug-sphere #t (bucket-id debug-draw1) s5-0 819.2 (new 'static 'rgba :b #xff :a #x80)) + (add-debug-sphere #t (bucket-id debug-no-zbuf) s3-0 819.2 (new 'static 'rgba :g #xff :a #x80)) + (add-debug-sphere #t (bucket-id debug-no-zbuf) s2-0 819.2 (new 'static 'rgba :g #xff :b #x40 :a #x80)) + (add-debug-sphere #t (bucket-id debug-no-zbuf) s5-0 819.2 (new 'static 'rgba :b #xff :a #x80)) ) ) (let ((s4-2 (vector-! (new-stack-vector0) s5-0 (-> self control unknown-vector90)))) diff --git a/goal_src/engine/target/sidekick.gc b/goal_src/engine/target/sidekick.gc index 173056acd9..6864fb5754 100644 --- a/goal_src/engine/target/sidekick.gc +++ b/goal_src/engine/target/sidekick.gc @@ -182,21 +182,21 @@ (debug-print-channels (-> self skel) (the-as symbol *stdcon*)) (add-debug-sphere *display-sidekick-stats* - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> self parent-override 0 control unknown-cspace10 parent bone transform vector 3) 409.6 (new 'static 'rgba :g #xff :a #x80) ) (add-debug-sphere *display-sidekick-stats* - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> self node-list data 3 bone transform vector 3) 409.6 (new 'static 'rgba :r #xff :g #xff :a #x80) ) (add-debug-sphere *display-sidekick-stats* - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> self draw origin) 409.6 (new 'static 'rgba :r #xff :g #x80 :a #x80) diff --git a/goal_src/engine/target/target-util.gc b/goal_src/engine/target/target-util.gc index 58a8256bdf..e7b82559d5 100644 --- a/goal_src/engine/target/target-util.gc +++ b/goal_src/engine/target/target-util.gc @@ -1166,7 +1166,7 @@ ((logtest? (-> gp-0 state-flags) 1024) (add-debug-sphere *display-camera-marks* - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> gp-0 alt-cam-pos) 819.2 (new 'static 'rgba :r #xff :a #x80) @@ -1176,7 +1176,7 @@ ((logtest? #x20000 (-> gp-0 state-flags)) (add-debug-sphere *display-camera-marks* - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> gp-0 alt-cam-pos) 819.2 (new 'static 'rgba :r #xff :a #x80) @@ -1189,7 +1189,7 @@ (set! (-> (the-as vector s5-0) y) (fmax (-> (the-as vector s5-0) y) (-> gp-0 alt-cam-pos y))) (add-debug-sphere *display-camera-marks* - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (the-as vector s5-0) 819.2 (new 'static 'rgba :r #xff :a #x80) @@ -1200,7 +1200,7 @@ (else (add-debug-sphere *display-camera-marks* - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (the-as vector (&-> (-> gp-0 control) unknown-qword00)) 819.2 (new 'static 'rgba :r #xff :a #x80) diff --git a/goal_src/engine/ui/hud-classes.gc b/goal_src/engine/ui/hud-classes.gc index 66eb5ae1c2..ac56f23766 100644 --- a/goal_src/engine/ui/hud-classes.gc +++ b/goal_src/engine/ui/hud-classes.gc @@ -170,7 +170,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) + (bucket-id debug) gp-0 (the-as (pointer dma-tag) a3-7) ) @@ -565,7 +565,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) + (bucket-id debug) s4-1 (the-as (pointer dma-tag) a3-12) ) @@ -789,7 +789,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) + (bucket-id debug) gp-0 (the-as (pointer dma-tag) a3-7) ) @@ -1192,7 +1192,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) + (bucket-id debug) gp-0 (the-as (pointer dma-tag) a3-7) ) @@ -1473,7 +1473,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) + (bucket-id debug) gp-0 (the-as (pointer dma-tag) a3-7) ) diff --git a/goal_src/engine/ui/progress/progress-draw.gc b/goal_src/engine/ui/progress/progress-draw.gc index bc9531d44d..23a0aaf725 100644 --- a/goal_src/engine/ui/progress/progress-draw.gc +++ b/goal_src/engine/ui/progress/progress-draw.gc @@ -1776,7 +1776,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) + (bucket-id debug) s4-0 (the-as (pointer dma-tag) a3-4) ) @@ -1885,7 +1885,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) + (bucket-id debug) s4-4 (the-as (pointer dma-tag) a3-9) ) diff --git a/goal_src/engine/ui/progress/progress.gc b/goal_src/engine/ui/progress/progress.gc index cb6ad9df13..ebe42e7418 100644 --- a/goal_src/engine/ui/progress/progress.gc +++ b/goal_src/engine/ui/progress/progress.gc @@ -2392,7 +2392,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) + (bucket-id debug) gp-0 (the-as (pointer dma-tag) a3-4) ) @@ -2414,7 +2414,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) + (bucket-id debug) gp-1 (the-as (pointer dma-tag) a3-6) ) @@ -2436,7 +2436,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) + (bucket-id debug) gp-2 (the-as (pointer dma-tag) a3-8) ) @@ -2458,7 +2458,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) + (bucket-id debug) gp-3 (the-as (pointer dma-tag) a3-10) ) diff --git a/goal_src/engine/ui/text.gc b/goal_src/engine/ui/text.gc index fa4e903234..574f9b7f82 100644 --- a/goal_src/engine/ui/text.gc +++ b/goal_src/engine/ui/text.gc @@ -233,9 +233,10 @@ ) (defun load-level-text-files ((arg0 int)) - "If needed, load text" + "Load the text files needed for level idx. + This function made more sense back when text files were split up, but in the end they put everything + in a single text group and file." - ;; just load common. These flags are not yet understood. (if (or *level-text-file-load-flag* (>= arg0 0)) (load-game-text-info "common" '*common-text* *common-text-heap*) ) @@ -323,28 +324,28 @@ (set-vector! s5-0 128 128 128 128) (add-debug-line2d #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (the-as vector (-> gp-0 vector)) (-> gp-0 vector 1) (the-as vector s5-0) ) (add-debug-line2d #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> gp-0 vector 1) (-> gp-0 vector 2) (the-as vector s5-0) ) (add-debug-line2d #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> gp-0 vector 2) (-> gp-0 vector 3) (the-as vector s5-0) ) (add-debug-line2d #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> gp-0 vector 3) (the-as vector (-> gp-0 vector)) (the-as vector s5-0) @@ -399,7 +400,7 @@ (none) ) -(defun print-game-text ((str string) (font-ctxt font-context) (alpha symbol) (offset-thing int) (arg4 int)) +(defun print-game-text ((str string) (font-ctxt font-context) (opaque symbol) (alpha int) (line-height int)) "Print text. Not worth commenting until we get stack variables in lets, I think" (local-vars (sv-112 float) @@ -424,238 +425,192 @@ (sv-208 symbol) (sv-212 symbol) ) - (let - ((gp-0 - (new - 'stack - 'font-context - *font-default-matrix* - (the int (-> font-ctxt origin x)) - (the int (-> font-ctxt origin y)) - 0.0 - (font-color default) - (font-flags shadow kerning) - ) - ) - ) - (when (< 0.1 (-> font-ctxt scale)) - (set! sv-112 (-> font-ctxt mat vector 0 x)) - (set! sv-116 (-> font-ctxt mat vector 1 y)) - (set! sv-120 (-> *video-parms* relative-x-scale)) - (set! sv-124 (-> *video-parms* relative-y-scale)) - (set! sv-128 (-> *video-parms* relative-x-scale-reciprical)) - (set! sv-132 (-> *video-parms* relative-y-scale-reciprical)) - (set! sv-136 (-> font-ctxt scale)) - (set! (-> gp-0 origin z) (-> font-ctxt origin z)) - (set! (-> gp-0 flags) (-> font-ctxt flags)) - (set! (-> gp-0 color) (-> font-ctxt color)) - (set! (-> gp-0 scale) sv-136) - (when (logtest? (-> gp-0 flags) (font-flags left)) - (logclear! (-> gp-0 flags) (font-flags left)) - (let ((f30-0 (-> gp-0 width)) - (f28-0 (-> gp-0 height)) - ) - (set! (-> gp-0 width) (-> font-ctxt width)) - (set! (-> gp-0 height) (-> font-ctxt height)) - (+! - (-> gp-0 origin y) - (the - float - (the - int - (* 0.5 (- (-> gp-0 height) (print-game-text str gp-0 #t 128 22))) - ) - ) - ) - (set! (-> gp-0 width) f30-0) - (set! (-> gp-0 height) f28-0) - ) - ) - (set! (-> gp-0 mat vector 0 x) (* (-> gp-0 mat vector 0 x) sv-136)) - (set! (-> gp-0 mat vector 1 y) (* (-> gp-0 mat vector 1 y) sv-136)) - (set! - (-> *video-parms* relative-x-scale) - (* (-> *video-parms* relative-x-scale) sv-136) - ) - (set! - (-> *video-parms* relative-y-scale) - (* (-> *video-parms* relative-y-scale) sv-136) - ) - (set! - (-> *video-parms* relative-x-scale-reciprical) - (/ 1.0 (-> *video-parms* relative-x-scale)) - ) - (set! (-> *video-parms* relative-y-scale-reciprical) (/ 1.0 sv-136)) - (set! sv-140 (-> str data)) - (set! sv-144 (-> gp-0 origin x)) - (set! sv-148 (-> gp-0 origin x)) - (set! sv-152 (+ (-> gp-0 origin x) (-> font-ctxt width))) - (set! sv-156 (+ (-> gp-0 origin y) (-> font-ctxt height))) - (set! - sv-160 - (* (get-string-length " " gp-0) (-> *video-parms* relative-x-scale)) - ) - (set! sv-164 (* (if (logtest? (-> gp-0 flags) 32) - (the float arg4) - 14.0 - ) - sv-136 - ) - ) - (set! sv-168 0) - (if (logtest? (-> gp-0 flags) 4) - (+! (-> gp-0 origin x) (* 0.5 (-> font-ctxt width))) - ) - (set! sv-176 (the-as int (-> sv-140 0))) ;; char - (set! sv-184 0) - (set! sv-192 0) - (set! sv-200 0) - (set! sv-208 (the-as symbol #f)) - (set! sv-212 (the-as symbol #f)) - (set! (-> *game-text-line* data 0) (the-as uint 0)) - (while - (or (not (and (zero? sv-176) (zero? sv-184) (zero? sv-192))) - (>= sv-156 (-> gp-0 origin y)) - ) - (cond - ((= sv-176 32) - (set! (-> *game-text-word* data sv-184) (the-as uint sv-176)) - (set! sv-184 (+ sv-184 1)) - (set! sv-208 #t) - ) - ((zero? sv-176) - (if (zero? sv-184) - (set! sv-212 #t) - (set! sv-208 #t) - ) - ) - (else - (if (= sv-176 95) - (set! sv-176 32) - ) - (set! (-> *game-text-word* data sv-184) (the-as uint sv-176)) - (set! sv-184 (+ sv-184 1)) - ) - ) - (when (= sv-208 #t) - (set! (-> *game-text-word* data sv-184) (the-as uint 0)) - (let* ((f30-1 sv-144) - (f0-49 - (* - (get-string-length *game-text-word* gp-0) - (-> *video-parms* relative-x-scale) - ) + (let ((gp-0 (new + 'stack + 'font-context + *font-default-matrix* + (the int (-> font-ctxt origin x)) + (the int (-> font-ctxt origin y)) + 0.0 + (font-color default) + (font-flags shadow kerning) + ) ) - (f1-14 (+ f30-1 f0-49)) - ) - (if (= (-> *game-text-word* data (+ sv-184 -1)) 32) - (set! f1-14 (- f1-14 sv-160)) ) - (cond - ((< sv-152 f1-14) - (set! sv-144 (+ sv-148 f0-49)) - (set! sv-212 #t) - ) - (else - (set! sv-144 (+ sv-144 f0-49)) - ) + (when (< 0.1 (-> font-ctxt scale)) + (set! sv-112 (-> font-ctxt mat vector 0 x)) + (set! sv-116 (-> font-ctxt mat vector 1 y)) + (set! sv-120 (-> *video-parms* relative-x-scale)) + (set! sv-124 (-> *video-parms* relative-y-scale)) + (set! sv-128 (-> *video-parms* relative-x-scale-reciprical)) + (set! sv-132 (-> *video-parms* relative-y-scale-reciprical)) + (set! sv-136 (-> font-ctxt scale)) + (set! (-> gp-0 origin z) (-> font-ctxt origin z)) + (set! (-> gp-0 flags) (-> font-ctxt flags)) + (set! (-> gp-0 color) (-> font-ctxt color)) + (set! (-> gp-0 scale) sv-136) + (when (logtest? (-> gp-0 flags) (font-flags left)) + (logclear! (-> gp-0 flags) (font-flags left)) + (let ((f30-0 (-> gp-0 width)) + (f28-0 (-> gp-0 height)) + ) + (set! (-> gp-0 width) (-> font-ctxt width)) + (set! (-> gp-0 height) (-> font-ctxt height)) + (+! (-> gp-0 origin y) + (the float (the int (* 0.5 (- (-> gp-0 height) (print-game-text str gp-0 #t 128 22))))) + ) + (set! (-> gp-0 width) f30-0) + (set! (-> gp-0 height) f28-0) + ) ) - ) - ) - (when (= sv-212 #t) - (when (>= sv-200 (the-as int (-> gp-0 start-line))) - (let ((f30-2 (+ (-> gp-0 origin y) sv-164))) - (when (>= sv-156 f30-2) - (when (= (-> *game-text-line* data (+ sv-192 -1)) 32) - (set! (-> *game-text-line* data (+ sv-192 -1)) (the-as uint 0)) - (when - (and - (= (-> *game-text-line* data (+ sv-192 -5)) 126) - (= (-> *game-text-line* data (+ sv-192 -2)) 72) + (set! (-> gp-0 mat vector 0 x) (* (-> gp-0 mat vector 0 x) sv-136)) + (set! (-> gp-0 mat vector 1 y) (* (-> gp-0 mat vector 1 y) sv-136)) + (set! (-> *video-parms* relative-x-scale) (* (-> *video-parms* relative-x-scale) sv-136)) + (set! (-> *video-parms* relative-y-scale) (* (-> *video-parms* relative-y-scale) sv-136)) + (set! (-> *video-parms* relative-x-scale-reciprical) (/ 1.0 (-> *video-parms* relative-x-scale))) + (set! (-> *video-parms* relative-y-scale-reciprical) (/ 1.0 sv-136)) + (set! sv-140 (-> str data)) + (set! sv-144 (-> gp-0 origin x)) + (set! sv-148 (-> gp-0 origin x)) + (set! sv-152 (+ (-> gp-0 origin x) (-> font-ctxt width))) + (set! sv-156 (+ (-> gp-0 origin y) (-> font-ctxt height))) + (set! sv-160 (* (get-string-length " " gp-0) (-> *video-parms* relative-x-scale))) + (set! sv-164 (* (if (logtest? (-> gp-0 flags) (font-flags large)) + (the float line-height) + 14.0 + ) + sv-136 + ) ) - (set! (-> *game-text-line* data (+ sv-192 -5)) (the-as uint 0)) - 0 - ) + (set! sv-168 0) + (if (logtest? (-> gp-0 flags) (font-flags middle)) + (+! (-> gp-0 origin x) (* 0.5 (-> font-ctxt width))) ) - ) - (when - (and - (= (-> *game-text-line* data (+ sv-192 -4)) 126) - (= (-> *game-text-line* data (+ sv-192 -1)) 72) - ) - (set! (-> *game-text-line* data (+ sv-192 -4)) (the-as uint 0)) - 0 - ) - (if (nonzero? (-> *game-text-line* data 0)) - (set! sv-168 (+ sv-168 1)) - ) - (when (not alpha) - (let* - ((s1-1 - (-> *display* frames (-> *display* on-screen) frame global-buf) - ) - (s2-1 (-> s1-1 base)) - ) - (set-font-color-alpha (-> font-ctxt color) offset-thing) - (draw-string *game-text-line* s1-1 gp-0) - (set-font-color-alpha (-> font-ctxt color) 128) - (set! (-> gp-0 color) (-> *font-work* last-color)) - (let ((a3-3 (-> s1-1 base))) - (let ((v1-127 (the-as object (-> s1-1 base)))) - (set! - (-> (the-as dma-packet v1-127) dma) - (new 'static 'dma-tag :id (dma-tag-id next)) - ) - (set! (-> (the-as dma-packet v1-127) vif0) (new 'static 'vif-tag)) - (set! (-> (the-as dma-packet v1-127) vif1) (new 'static 'vif-tag)) - (set! (-> s1-1 base) (&+ (the-as pointer v1-127) 16)) - ) - (dma-bucket-insert-tag - (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) - s2-1 - (the-as (pointer dma-tag) a3-3) - ) - ) - ) - ) - (set! (-> gp-0 origin y) f30-2) - ) - ) - (set! sv-200 (+ sv-200 1)) - (set! (-> *game-text-line* data 0) (the-as uint 0)) - (set! sv-192 0) - (set! sv-212 (the-as symbol #f)) - ) - (when (= sv-208 #t) - (copy-charp<-charp - (&-> *game-text-line* data sv-192) - (-> *game-text-word* data) - ) - (set! sv-192 (+ sv-192 sv-184)) - (set! sv-184 0) - (set! sv-208 (the-as symbol #f)) - ) - (when (nonzero? sv-176) - (set! sv-140 (&-> sv-140 1)) (set! sv-176 (the-as int (-> sv-140 0))) + (set! sv-184 0) + (set! sv-192 0) + (set! sv-200 0) + (set! sv-208 (the-as symbol #f)) + (set! sv-212 (the-as symbol #f)) + (set! (-> *game-text-line* data 0) (the-as uint 0)) + (while (or (not (and (zero? sv-176) (zero? sv-184) (zero? sv-192))) (>= sv-156 (-> gp-0 origin y))) + (cond + ((= sv-176 32) + (set! (-> *game-text-word* data sv-184) (the-as uint sv-176)) + (set! sv-184 (+ sv-184 1)) + (set! sv-208 #t) + ) + ((zero? sv-176) + (if (zero? sv-184) + (set! sv-212 #t) + (set! sv-208 #t) + ) + ) + (else + (if (= sv-176 95) + (set! sv-176 32) + ) + (set! (-> *game-text-word* data sv-184) (the-as uint sv-176)) + (set! sv-184 (+ sv-184 1)) + ) + ) + (when (= sv-208 #t) + (set! (-> *game-text-word* data sv-184) (the-as uint 0)) + (let* ((f30-1 sv-144) + (f0-49 (* (get-string-length *game-text-word* gp-0) (-> *video-parms* relative-x-scale))) + (f1-14 (+ f30-1 f0-49)) + ) + (if (= (-> *game-text-word* data (+ sv-184 -1)) 32) + (set! f1-14 (- f1-14 sv-160)) + ) + (cond + ((< sv-152 f1-14) + (set! sv-144 (+ sv-148 f0-49)) + (set! sv-212 #t) + ) + (else + (set! sv-144 (+ sv-144 f0-49)) + ) + ) + ) + ) + (when (= sv-212 #t) + (when (>= sv-200 (the-as int (-> gp-0 start-line))) + (let ((f30-2 (+ (-> gp-0 origin y) sv-164))) + (when (>= sv-156 f30-2) + (when (= (-> *game-text-line* data (+ sv-192 -1)) 32) + (set! (-> *game-text-line* data (+ sv-192 -1)) (the-as uint 0)) + (when (and (= (-> *game-text-line* data (+ sv-192 -5)) 126) (= (-> *game-text-line* data (+ sv-192 -2)) 72)) + (set! (-> *game-text-line* data (+ sv-192 -5)) (the-as uint 0)) + 0 + ) + ) + ) + (when (and (= (-> *game-text-line* data (+ sv-192 -4)) 126) (= (-> *game-text-line* data (+ sv-192 -1)) 72)) + (set! (-> *game-text-line* data (+ sv-192 -4)) (the-as uint 0)) + 0 + ) + (if (nonzero? (-> *game-text-line* data 0)) + (set! sv-168 (+ sv-168 1)) + ) + (when (not opaque) + (let* ((s1-1 (-> *display* frames (-> *display* on-screen) frame global-buf)) + (s2-1 (-> s1-1 base)) + ) + (set-font-color-alpha (-> font-ctxt color) alpha) + (draw-string *game-text-line* s1-1 gp-0) + (set-font-color-alpha (-> font-ctxt color) 128) + (set! (-> gp-0 color) (-> *font-work* last-color)) + (let ((a3-3 (-> s1-1 base))) + (let ((v1-127 (the-as object (-> s1-1 base)))) + (set! (-> (the-as dma-packet v1-127) dma) (new 'static 'dma-tag :id (dma-tag-id next))) + (set! (-> (the-as dma-packet v1-127) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet v1-127) vif1) (new 'static 'vif-tag)) + (set! (-> s1-1 base) (&+ (the-as pointer v1-127) 16)) + ) + (dma-bucket-insert-tag + (-> *display* frames (-> *display* on-screen) frame bucket-group) + (bucket-id debug) + s2-1 + (the-as (pointer dma-tag) a3-3) + ) + ) + ) + ) + (set! (-> gp-0 origin y) f30-2) + ) + ) + (set! sv-200 (+ sv-200 1)) + (set! (-> *game-text-line* data 0) (the-as uint 0)) + (set! sv-192 0) + (set! sv-212 (the-as symbol #f)) + ) + (when (= sv-208 #t) + (copy-charp<-charp (&-> *game-text-line* data sv-192) (-> *game-text-word* data)) + (set! sv-192 (+ sv-192 sv-184)) + (set! sv-184 0) + (set! sv-208 (the-as symbol #f)) + ) + (when (nonzero? sv-176) + (set! sv-140 (&-> sv-140 1)) + (set! sv-176 (the-as int (-> sv-140 0))) + ) + ) + (set! (-> gp-0 mat vector 0 x) sv-112) + (set! (-> gp-0 mat vector 1 y) sv-116) + (set! (-> *video-parms* relative-x-scale) sv-120) + (set! (-> *video-parms* relative-y-scale) sv-124) + (set! (-> *video-parms* relative-x-scale-reciprical) sv-128) + (set! (-> *video-parms* relative-y-scale-reciprical) sv-132) + (with-pc + (if (and *debug-segment* (-> *pc-settings* display-text-box)) + (draw-debug-text-box font-ctxt))) + (if (> sv-168 0) + (* sv-164 (the float sv-168)) + 0.0 + ) ) - ) - (set! (-> gp-0 mat vector 0 x) sv-112) - (set! (-> gp-0 mat vector 1 y) sv-116) - (set! (-> *video-parms* relative-x-scale) sv-120) - (set! (-> *video-parms* relative-y-scale) sv-124) - (set! (-> *video-parms* relative-x-scale-reciprical) sv-128) - (set! (-> *video-parms* relative-y-scale-reciprical) sv-132) - (with-pc - (if (and *debug-segment* (-> *pc-settings* display-text-box)) - (draw-debug-text-box font-ctxt))) - (if (> sv-168 0) - (* sv-164 (the float sv-168)) - 0.0 - ) ) - ) ) (defun disable-level-text-file-loading () diff --git a/goal_src/game.gp b/goal_src/game.gp index 4e3ca1bb3b..dca8cbd872 100644 --- a/goal_src/game.gp +++ b/goal_src/game.gp @@ -356,24 +356,6 @@ "out/iso/GAME.CGO" ) -;;;;;;;;;;;;;;;;;;;;; -;; hub1 Group -;;;;;;;;;;;;;;;;;;;;; -;; the hub1 group is a group of files required to play the first hub (village1, jungle, beach, misty, training, firecanyon) - -(group "hub1" - "out/iso/0COMMON.TXT" - "out/iso/0SUBTIT.TXT" - "out/iso/KERNEL.CGO" - "out/iso/GAME.CGO" - "out/iso/VI1.DGO" - "out/iso/TRA.DGO" - "out/iso/FIC.DGO" - "out/iso/JUN.DGO" - "out/iso/BEA.DGO" - "out/iso/MIS.DGO" - ) - ;;;;;;;;;;;;;;;;;;;;;;;; ;; Common Level Objects ;;;;;;;;;;;;;;;;;;;;;;;; @@ -1929,8 +1911,7 @@ ) (group-list "text" - `( - "out/iso/0COMMON.TXT" + `("out/iso/0COMMON.TXT" "out/iso/0SUBTIT.TXT" ) ) diff --git a/goal_src/goal-lib.gc b/goal_src/goal-lib.gc index ea27a67973..6e24346ad0 100644 --- a/goal_src/goal-lib.gc +++ b/goal_src/goal-lib.gc @@ -913,11 +913,6 @@ `(make-group "engine") ) -(defmacro mh1 () - "Make hub1" - `(make-group "hub1") - ) - ;;;;;;;;;;;;;;;;;;; ;; enum stuff ;;;;;;;;;;;;;;;;;;; @@ -983,6 +978,14 @@ (defconstant *user* (__get-user)) +(defmacro user? (&rest users) + (cond + ((null? users) #f) + ((eq? *user* (car users)) #t) + (#t `(user? ,@(cdr users))) + ) + ) + diff --git a/goal_src/levels/beach/air-h.gc b/goal_src/levels/beach/air-h.gc index 76da8e8d01..67f8ba65db 100644 --- a/goal_src/levels/beach/air-h.gc +++ b/goal_src/levels/beach/air-h.gc @@ -5,64 +5,58 @@ ;; name in dgo: air-h ;; dgos: BEA, L1 -;; definition of type air-box +;; DECOMP BEGINS + (deftype air-box (structure) - ((vecs vector 2 :inline :offset-assert 0) - (x-pos float :offset 0) - (height-level float :offset 4) - (z-pos float :offset 8) - (cos-angle float :offset 12) - (x-length float :offset 16) - (z-length float :offset 24) - (sin-angle float :offset 28) + ((vecs vector 2 :inline :offset-assert 0) + (x-pos float :offset 0) + (height-level float :offset 4) + (z-pos float :offset 8) + (cos-angle float :offset 12) + (x-length float :offset 16) + (z-length float :offset 24) + (sin-angle float :offset 28) ) :method-count-assert 9 :size-assert #x20 :flag-assert #x900000020 ) -;; definition for function point-in-air-box-area? + (defun point-in-air-box-area? ((arg0 float) (arg1 float) (arg2 air-box)) (let ((v0-0 #f)) - (let ((f0-2 (+ (* arg0 (-> arg2 vecs 0 w)) (* arg1 (-> arg2 vecs 1 w)))) - (f1-5 (- (* arg1 (-> arg2 vecs 0 w)) (* arg0 (-> arg2 vecs 1 w)))) - ) - (if - (and - (>= f0-2 0.0) - (>= f1-5 0.0) - (< f0-2 (-> arg2 vecs 1 x)) - (< f1-5 (-> arg2 vecs 1 z)) - ) - (set! v0-0 #t) - ) - ) - v0-0 - ) - ) - -;; definition for function point-in-air-box? -(defun point-in-air-box? ((arg0 vector) (arg1 air-box)) - (when (< (-> arg1 vecs 0 y) (-> arg0 y)) - (let ((f1-2 (- (-> arg0 x) (the-as float (-> arg1 vecs 0 x)))) - (f2-1 (- (-> arg0 z) (-> arg1 vecs 0 z))) - (v1-0 arg1) - (v0-0 #f) - ) - (let ((f0-5 (+ (* f1-2 (-> v1-0 vecs 0 w)) (* f2-1 (-> v1-0 vecs 1 w)))) - (f1-4 (- (* f2-1 (-> v1-0 vecs 0 w)) (* f1-2 (-> v1-0 vecs 1 w)))) + (let ((f0-2 (+ (* arg0 (-> arg2 cos-angle)) (* arg1 (-> arg2 sin-angle)))) + (f1-5 (- (* arg1 (-> arg2 cos-angle)) (* arg0 (-> arg2 sin-angle)))) + ) + (if (and (>= f0-2 0.0) (>= f1-5 0.0) (< f0-2 (-> arg2 x-length)) (< f1-5 (-> arg2 z-length))) + (set! v0-0 #t) ) - (if - (and - (>= f0-5 0.0) - (>= f1-4 0.0) - (< f0-5 (-> v1-0 vecs 1 x)) - (< f1-4 (-> v1-0 vecs 1 z)) - ) - (set! v0-0 #t) ) - ) v0-0 ) - ) ) + +(defun point-in-air-box? ((arg0 vector) (arg1 air-box)) + (when (< (-> arg1 height-level) (-> arg0 y)) + (let ((f1-2 (- (-> arg0 x) (the-as float (-> arg1 x-pos)))) + (f2-1 (- (-> arg0 z) (-> arg1 z-pos))) + (v1-0 arg1) + (v0-0 #f) + ) + (let ((f0-5 (+ (* f1-2 (-> v1-0 cos-angle)) (* f2-1 (-> v1-0 sin-angle)))) + (f1-4 (- (* f2-1 (-> v1-0 cos-angle)) (* f1-2 (-> v1-0 sin-angle)))) + ) + (if (and (>= f0-5 0.0) (>= f1-4 0.0) (< f0-5 (-> v1-0 x-length)) (< f1-4 (-> v1-0 z-length))) + (set! v0-0 #t) + ) + ) + v0-0 + ) + ) + ) + +0 + + + + diff --git a/goal_src/levels/common/ropebridge.gc b/goal_src/levels/common/ropebridge.gc index f27428899c..1870a0f924 100644 --- a/goal_src/levels/common/ropebridge.gc +++ b/goal_src/levels/common/ropebridge.gc @@ -698,7 +698,7 @@ ) (countdown (s3-0 (-> obj tuning num-spring-points)) (vector-matrix*! s4-0 (-> s5-0 local-pos) gp-0) - (add-debug-sphere #t (bucket-id debug-draw0) s4-0 2048.0 (new 'static 'rgba :r #xff :g #xff :b #xff :a #x40)) + (add-debug-sphere #t (bucket-id debug) s4-0 2048.0 (new 'static 'rgba :r #xff :g #xff :b #xff :a #x40)) (&+! s5-0 48) ) ) diff --git a/goal_src/levels/jungle/fisher.gc b/goal_src/levels/jungle/fisher.gc index 3c161dcada..9e7d3ebff2 100644 --- a/goal_src/levels/jungle/fisher.gc +++ b/goal_src/levels/jungle/fisher.gc @@ -1453,7 +1453,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) + (bucket-id debug) gp-0 (the-as (pointer dma-tag) a3-1) ) diff --git a/goal_src/levels/misty/mistycannon.gc b/goal_src/levels/misty/mistycannon.gc index 87ed8fe709..a3c9a7e2f5 100644 --- a/goal_src/levels/misty/mistycannon.gc +++ b/goal_src/levels/misty/mistycannon.gc @@ -1785,7 +1785,7 @@ (if (nonzero? gp-0) (debug-percent-bar #t - (bucket-id debug-draw0) + (bucket-id debug) 192 160 (* 0.0033333334 (the float gp-0)) diff --git a/goal_src/levels/ogre/ogreboss.gc b/goal_src/levels/ogre/ogreboss.gc index e7af4aaec2..2f84bd99c0 100644 --- a/goal_src/levels/ogre/ogreboss.gc +++ b/goal_src/levels/ogre/ogreboss.gc @@ -345,7 +345,7 @@ ) (add-debug-vector #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) s4-1 s3-0 (meters 0.00024414062) diff --git a/goal_src/levels/racer_common/target-racer.gc b/goal_src/levels/racer_common/target-racer.gc index 1f2bd21b08..47e7993148 100644 --- a/goal_src/levels/racer_common/target-racer.gc +++ b/goal_src/levels/racer_common/target-racer.gc @@ -199,7 +199,7 @@ (let ((f30-4 (* (deg-diff f30-3 0.0) (-> self racer slide-grip-mult)))) (add-debug-vector *display-target-marks* - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> self control trans) (-> self control transv) (meters 0.000061035156) @@ -226,7 +226,7 @@ (vector-float*! gp-1 gp-1 0.5) (add-debug-vector *display-target-marks* - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> self control trans) gp-1 (meters 0.00024414062) @@ -235,7 +235,7 @@ (vector+! gp-1 gp-1 (-> self control trans)) (add-debug-text-sphere *display-target-marks* - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) gp-1 819.2 "ltransv" @@ -246,7 +246,7 @@ (vector+! gp-1 gp-1 (-> self control trans)) (add-debug-text-sphere *display-target-marks* - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) gp-1 819.2 "nose" @@ -365,7 +365,7 @@ (+! (-> a2-1 y) (-> self racer cushion-bob)) (add-debug-sphere *display-target-marks* - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) a2-1 819.2 (new 'static 'rgba :r #xff :b #xff :a #x80) diff --git a/goal_src/levels/sunken/target-tube.gc b/goal_src/levels/sunken/target-tube.gc index 2a62e1054f..6b2052b2c4 100644 --- a/goal_src/levels/sunken/target-tube.gc +++ b/goal_src/levels/sunken/target-tube.gc @@ -184,7 +184,7 @@ (vector-flatten! s4-1 s4-1 (-> self control local-normal)) (add-debug-vector *display-target-marks* - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> self control trans) s4-1 (meters 0.00024414062) @@ -252,7 +252,7 @@ (vector-flatten! s3-1 s3-1 (-> self control local-normal)) (add-debug-vector *display-target-marks* - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> self control trans) s3-1 (meters 2.0) @@ -265,7 +265,7 @@ (vector-flatten! s4-2 s4-2 (-> self control local-normal)) (add-debug-vector *display-target-marks* - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> self control trans) s4-2 (meters 2.0) @@ -302,7 +302,7 @@ (vector-float*! gp-1 gp-1 0.5) (add-debug-vector *display-target-marks* - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> self control trans) gp-1 (meters 0.00024414062) @@ -311,7 +311,7 @@ (vector+! gp-1 gp-1 (-> self control trans)) (add-debug-text-sphere *display-target-marks* - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) gp-1 819.2 "ltransv" @@ -322,7 +322,7 @@ (vector+! gp-1 gp-1 (-> self control trans)) (add-debug-text-sphere *display-target-marks* - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) gp-1 819.2 "nose" diff --git a/goal_src/levels/swamp/swamp-rat-nest.gc b/goal_src/levels/swamp/swamp-rat-nest.gc index 1e9afbc147..aceeb54a89 100644 --- a/goal_src/levels/swamp/swamp-rat-nest.gc +++ b/goal_src/levels/swamp/swamp-rat-nest.gc @@ -687,7 +687,7 @@ (let* ((a0-0 (-> self spawn-joint-array gp-0)) (a2-0 (-> self node-list data a0-0 bone transform)) ) - (add-debug-matrix #t (bucket-id debug-draw1) a2-0) + (add-debug-matrix #t (bucket-id debug-no-zbuf) a2-0) ) ) #f diff --git a/goal_src/levels/village1/fishermans-boat.gc b/goal_src/levels/village1/fishermans-boat.gc index 76414a8cc2..a93be42b86 100644 --- a/goal_src/levels/village1/fishermans-boat.gc +++ b/goal_src/levels/village1/fishermans-boat.gc @@ -121,7 +121,7 @@ (set! (-> s3-0 w) 1.0) (add-debug-line #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) s4-0 s3-0 (new 'static 'rgba :r #xff :g #xff :a #x80) @@ -130,7 +130,7 @@ ) (add-debug-vector #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) s4-0 s5-0 (meters 0.00024414062) @@ -447,14 +447,14 @@ (debug-draw (-> obj path)) (add-debug-sphere #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> obj dest-circle) (-> obj dest-circle w) (new 'static 'rgba :g #xff :a #x80) ) (add-debug-x #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> obj target-point) (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) ) @@ -834,14 +834,14 @@ (dummy-16 (-> self controller)) (add-debug-sphere #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (the-as vector (-> self boat-path)) 614400.0 (new 'static 'rgba :b #xff :a #x80) ) (add-debug-sphere #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (the-as vector (&-> self stack 848)) 409600.0 (new 'static 'rgba :b #xff :a #x80) diff --git a/goal_src/pc/pckernel-h.gc b/goal_src/pc/pckernel-h.gc index fa5dd93bc3..00e1786f35 100644 --- a/goal_src/pc/pckernel-h.gc +++ b/goal_src/pc/pckernel-h.gc @@ -23,9 +23,6 @@ |# -(#when PC_PORT - - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;; constants ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -580,7 +577,4 @@ )) -) - - diff --git a/goal_src/pc/pckernel.gc b/goal_src/pc/pckernel.gc index 16b6fa19d1..c29a78c060 100644 --- a/goal_src/pc/pckernel.gc +++ b/goal_src/pc/pckernel.gc @@ -22,9 +22,6 @@ |# -;; is this necessary? -(#when PC_PORT - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;; updates @@ -796,15 +793,13 @@ (defun-debug draw-build-revision () (with-dma-buffer-add-bucket ((buf (-> (current-frame) debug-buf)) - (bucket-id debug-draw1)) + (bucket-id debug-no-zbuf)) (draw-string-xy *pc-settings-built-sha* buf 0 (* 10 (-> *video-parms* relative-y-scale)) (font-color flat-yellow) - (font-flags kerning)))) - -) ;; when PC_PORT + (font-flags shadow kerning)))) diff --git a/goal_src/pc/progress-pc.gc b/goal_src/pc/progress-pc.gc index 0da6d1c88e..1c912400fc 100644 --- a/goal_src/pc/progress-pc.gc +++ b/goal_src/pc/progress-pc.gc @@ -374,7 +374,7 @@ (set! (-> *progress-carousell* x-offset) 0) ) (set! (-> font origin y) (the float (+ y-off 3))) - ;(set-color! font (font-color lighter-lighter-blue)) + (set-color! font (font-color lighter-lighter-blue)) 0 (let ((next-lang (mod (+ old-lang 1) max-lang)) (prev-lang (mod (+ max-lang -1 old-lang) max-lang)) @@ -387,6 +387,7 @@ (let ((a2-22 (- 200 (+ (-> *progress-carousell* x-offset) 100)))) (print-string-in-carousell (-> options prev-lang) font a2-22 #f) ) + (set-color! font (font-color lighter-lighter-blue)) (let ((a2-23 (+ (-> *progress-carousell* x-offset) 100))) (cond ((< a2-23 150) @@ -413,6 +414,7 @@ ) ) ) + (set-color! font (font-color lighter-lighter-blue)) (let ((a2-27 (- 200 (+ (-> *progress-carousell* x-offset) 100)))) (print-string-in-carousell (-> options next-lang) font a2-27 #t) ) @@ -1218,7 +1220,7 @@ (set! (-> obj language-x-offset) 0) ) (set! (-> font origin y) (the float (+ y-off 3))) - ;(set-color! font (font-color lighter-lighter-blue)) + (set-color! font (font-color lighter-lighter-blue)) 0 (let ((next-lang (mod (+ old-lang 1) max-lang)) (prev-lang (mod (+ max-lang -1 old-lang) max-lang)) @@ -1231,6 +1233,7 @@ (let ((a2-22 (- 200 (+ (-> obj language-x-offset) 100)))) (print-language-name prev-lang font a2-22 #f) ) + (set-color! font (font-color lighter-lighter-blue)) (let ((a2-23 (+ (-> obj language-x-offset) 100))) (cond ((< a2-23 150) @@ -1257,6 +1260,7 @@ ) ) ) + (set-color! font (font-color lighter-lighter-blue)) (let ((a2-27 (- 200 (+ (-> obj language-x-offset) 100)))) (print-language-name (the int next-lang) font a2-27 #t) ) diff --git a/goal_src/pc/subtitle.gc b/goal_src/pc/subtitle.gc index aaad9e0997..9e25e81533 100644 --- a/goal_src/pc/subtitle.gc +++ b/goal_src/pc/subtitle.gc @@ -7,24 +7,21 @@ It automatically detects the currently playing cutscene and plays the subtitles for it on channel 0. Channel 1 and 2 are reserved for ambient sounds, which cannot be auto-detected, so the ambient-control needs to notify the subtitle process manually (TODO: verify this!) - + Similarly to the generic text file, only one subtitles text file is loaded at once, stored in a specific heap. - + In Jak 2, the subtitles are stored directly within the .STR files. We don't have that luxury here, unfortunately. |# -(#when PC_PORT - - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;; constants ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -(defconstant PC_SUBTITLE_FILE_SIZE (* 64 1024)) +(defconstant PC_SUBTITLE_FILE_SIZE (* 64 1024)) ;; 64K heap for subtitles. adjust later if necessary. (defconstant PC_SUBTITLE_FILE_NAME "subtit") (defglobalconstant PC_SUBTITLE_DEBUG #f) @@ -43,7 +40,13 @@ (defenum pc-subtitle-channel :type int16 (invalid -1) (movie 0) (ambient 1) (hint 2)) +(defconstant SUBTITLE_CHANNEL_COUNT 3) +(defenum pc-subtitle-flags + :bitfield #t + :type uint32 + (offscreen) ;; speaker is offscreen. + ) ;; information about a single line of subtitles (deftype subtitle-keyframe (structure) @@ -51,7 +54,7 @@ (frame int32) ;; the frame to play the subtitle line on (string string) ;; the text for the subtitle line (speaker string) ;; name of the speaker. leave blank for no speaker. - (offscreen symbol) ;; speaker is offscreen. + (flags pc-subtitle-flags) ;; flags ) :pack-me ) @@ -65,17 +68,17 @@ (length int16) ;; data (keyframes (inline-array subtitle-keyframe)) - + ;; now we store a way to identify and lookup the subtitles. - + ;; the game-text-id if this is for a hint (id game-text-id :offset 8) ;; the name of the spool-anim (name string :offset 8) ;; the 8-character name for an ambient or hint (hash uint64 :offset 8) - - + + ) :size-assert #x10 ;; compact! @@ -88,31 +91,60 @@ (dummy int32) (data subtitle-text :inline :dynamic) ) - + (:methods (get-scene-by-name (_type_ pc-subtitle-channel string) subtitle-text) ) ) +(defmacro subtitle-flags? (sub &rest flags) + `(logtest? (-> ,sub flags) (pc-subtitle-flags ,@flags))) + + + ;;;---------------------------------- ;; process type ;;;---------------------------------- +;; graphic parameters for subtitles +(deftype subtitle-bank (structure) + ( + (scale float) + (width float) + (height float) + (lines float) + ) + + ) + +(define *SUBTITLE-bank* + (new 'static 'subtitle-bank + :scale 0.49 + :width 0.85 + :height 0.8 + :lines 3.0 + )) + ;; the subtitle process! it lives on the PC actor pool and awaits for incoming subtitle messages, or a movie (deftype subtitle (process) ( - (font font-context) + (font font-context) ;; the font to use for the subtitles. + (bank-backup subtitle-bank :inline) ;; debug backup. + ( spool-name string) (old-spool-name string) (cur-channel pc-subtitle-channel) + + (want-subtitle subtitle-keyframe) ;; the subtitle we want to display ) - :heap-base #x10 - + (:methods (subtitle-format (_type_ subtitle-keyframe) string) ) + (:states + subtitle-debug) ) @@ -141,14 +173,14 @@ (defmethod get-scene-by-name subtitle-text-info ((obj subtitle-text-info) (kind pc-subtitle-channel) (name string)) "get a subtitle scene info with the corresponding name. #f = none found" - + (dotimes (i (-> obj length)) ;; name and kind matches, return that! (when (and (= kind (-> obj data i kind)) (string= (-> obj data i name) name)) (return (-> obj data i)) ) ) - + (the subtitle-text #f)) (defun load-subtitle-text-info ((txt-name string) (curr-text symbol) (heap kheap)) @@ -157,57 +189,77 @@ curr-text = a symbol to a subtitle-text-info to link the file to heap = the text heap to load the file onto" - (local-vars (v0-2 int) (heap-sym-heap subtitle-text-info) (lang pc-subtitle-lang) (load-status int) (heap-free int)) - (set! heap-sym-heap (the-as subtitle-text-info (-> curr-text value))) - (set! lang (-> *pc-settings* subtitle-language)) - (set! load-status 0) - (set! heap-free (&- (-> heap top) (the-as uint (-> heap base)))) - (when (or (= heap-sym-heap #f) - (!= (-> heap-sym-heap lang) lang) - ) - (kheap-reset heap) + (let ((heap-sym-heap (the-as subtitle-text-info (-> curr-text value))) + (lang (-> *pc-settings* subtitle-language)) + (load-status 0) + (heap-free (&- (-> heap top) (the-as uint (-> heap base))))) - (while (not (str-load (string-format "~D~S.TXT" lang txt-name) -1 (logand -64 (&+ (-> heap current) 63)) (&- (-> heap top) (-> heap current)))) - (return 0) - ) + ;; current text has nothing loaded, or language doesn't match. + (when (or (= heap-sym-heap #f) + (!= (-> heap-sym-heap lang) lang) + ) + ;; so reload. - (label retry) - (let ((v1-20 (str-load-status (the-as (pointer int32) (& load-status))))) - (when (= v1-20 'error) - (format 0 "Error loading subtitle~%") - (return 0) - (goto loaded) + ;; reset the text heap. + (kheap-reset heap) + + ;; try to load load... + (while (not (str-load (string-format "~D~S.TXT" lang txt-name) -1 (logand -64 (&+ (-> heap current) 63)) (&- (-> heap top) (-> heap current)))) + (return 0) + ) + ;; load succeeded. check status. + + (label retry) + (let ((status (str-load-status (the-as (pointer int32) (& load-status))))) + (when (= status 'error) + (format 0 "Error loading subtitle~%") + (return 0) + (goto loaded) + ) + (cond + ((>= load-status (+ heap-free -300)) + (format 0 "Game subtitle heap overrun!~%") + (return 0) + ) + ((= status 'busy) + ;; still loading. + (goto retry) + ) + ) ) - (cond - ((>= load-status (+ heap-free -300)) - (format 0 "Game subtitle heap overrun!~%") - (return 0) - ) - ((= v1-20 'busy) - (goto retry) - ) - ) - ) - (label loaded) - (let ((s2-1 (logand -64 (&+ (-> heap current) 63)))) - (flush-cache 0) - (set! (-> curr-text value) (link s2-1 (-> (string-format "~D~S.TXT" lang txt-name) data) load-status heap 0)) - ) - (if (<= (the-as int (-> curr-text value)) 0) - (set! (-> curr-text value) (the-as object #f)) - ) - ) + (label loaded) + + ;; link the text file! + (let ((new-mem (logand -64 (&+ (-> heap current) 63)))) + (flush-cache 0) + (set! (-> curr-text value) (link new-mem (-> (string-format "~D~S.TXT" lang txt-name) data) load-status heap 0)) + ) + ;; if linking failed just make the text invalid. + (if (<= (the-as int (-> curr-text value)) 0) + (set! (-> curr-text value) (the-as object #f)) + ) + )) 0) (defun load-level-subtitle-files ((idx int)) - "If needed, load subtitles" + "Load the subtitle files needed for level idx. + This function made more sense back when text files were split up, but in the end they put everything + in a single text group and file." - ;; just load common. These flags are not yet understood. + ;; just load common. (if (or *level-text-file-load-flag* (>= idx 0)) (load-subtitle-text-info PC_SUBTITLE_FILE_NAME '*subtitle-text* *subtitle-text-heap*) ) - (none) - ) + + (none)) + + +(defmacro reload-subtitles () + "rebuild and reload subtitles." + `(begin + (asm-text-file subtitle :files ("game/assets/game_subtitle.gp")) + (+! (-> *subtitle-text* lang) (the-as pc-subtitle-lang 1)))) + @@ -216,22 +268,237 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(defun-recursive print-game-subtitle float ((str string) (font-ctxt font-context) (opaque symbol) (alpha int) (line-height int)) + "Print text. Not worth commenting until we get stack variables in lets, I think" + (local-vars + (sv-112 float) + (sv-116 float) + (sv-120 float) + (sv-124 float) + (sv-128 float) + (sv-132 float) + (sv-136 float) + (sv-140 (pointer uint8)) + (sv-144 float) + (sv-148 float) + (sv-152 float) + (sv-156 float) + (sv-160 float) + (sv-164 float) + (sv-168 int) + (sv-176 int) + (sv-184 int) + (sv-192 int) + (sv-200 int) + (sv-208 symbol) + (sv-212 symbol) + ) + (let ((gp-0 (new + 'stack + 'font-context + *font-default-matrix* + (the int (-> font-ctxt origin x)) + (the int (-> font-ctxt origin y)) + 0.0 + (font-color default) + (font-flags shadow kerning) + ) + ) + ) + (when (< 0.1 (-> font-ctxt scale)) + (set! sv-112 (-> font-ctxt mat vector 0 x)) + (set! sv-116 (-> font-ctxt mat vector 1 y)) + (set! sv-120 (-> *video-parms* relative-x-scale)) + (set! sv-124 (-> *video-parms* relative-y-scale)) + (set! sv-128 (-> *video-parms* relative-x-scale-reciprical)) + (set! sv-132 (-> *video-parms* relative-y-scale-reciprical)) + (set! sv-136 (-> font-ctxt scale)) + (set! (-> gp-0 origin z) (-> font-ctxt origin z)) + (set! (-> gp-0 flags) (-> font-ctxt flags)) + (set! (-> gp-0 color) (-> font-ctxt color)) + (set! (-> gp-0 scale) sv-136) + (when (logtest? (-> gp-0 flags) (font-flags left)) + (logclear! (-> gp-0 flags) (font-flags left)) + (let ((f30-0 (-> gp-0 width)) + (f28-0 (-> gp-0 height)) + ) + (set! (-> gp-0 width) (-> font-ctxt width)) + (set! (-> gp-0 height) (-> font-ctxt height)) + (+! (-> gp-0 origin y) + (the float (the int (* 0.5 (- (-> gp-0 height) (print-game-subtitle str gp-0 #t 128 22))))) + ) + (set! (-> gp-0 width) f30-0) + (set! (-> gp-0 height) f28-0) + ) + ) + (set! (-> gp-0 mat vector 0 x) (* (-> gp-0 mat vector 0 x) sv-136)) + (set! (-> gp-0 mat vector 1 y) (* (-> gp-0 mat vector 1 y) sv-136)) + (set! (-> *video-parms* relative-x-scale) (* (-> *video-parms* relative-x-scale) sv-136)) + (set! (-> *video-parms* relative-y-scale) (* (-> *video-parms* relative-y-scale) sv-136)) + (set! (-> *video-parms* relative-x-scale-reciprical) (/ 1.0 (-> *video-parms* relative-x-scale))) + (set! (-> *video-parms* relative-y-scale-reciprical) (/ 1.0 sv-136)) + (set! sv-140 (-> str data)) + (set! sv-144 (-> gp-0 origin x)) + (set! sv-148 (-> gp-0 origin x)) + (set! sv-152 (+ (-> gp-0 origin x) (-> font-ctxt width))) + (set! sv-156 (+ (-> gp-0 origin y) (-> font-ctxt height))) + (set! sv-160 (* (get-string-length " " gp-0) (-> *video-parms* relative-x-scale))) + (set! sv-164 (* (if (logtest? (-> gp-0 flags) (font-flags large)) + (the float line-height) + 14.0 + ) + sv-136 + ) + ) + (set! sv-168 0) + (if (logtest? (-> gp-0 flags) (font-flags middle)) + (+! (-> gp-0 origin x) (* 0.5 (-> font-ctxt width))) + ) + (set! sv-176 (the-as int (-> sv-140 0))) + (set! sv-184 0) + (set! sv-192 0) + (set! sv-200 0) + (set! sv-208 (the-as symbol #f)) + (set! sv-212 (the-as symbol #f)) + (set! (-> *game-text-line* data 0) (the-as uint 0)) + (while (or (not (and (zero? sv-176) (zero? sv-184) (zero? sv-192))) (>= sv-156 (-> gp-0 origin y))) + (cond + ((= sv-176 32) + (set! (-> *game-text-word* data sv-184) (the-as uint sv-176)) + (set! sv-184 (+ sv-184 1)) + (set! sv-208 #t) + ) + ((zero? sv-176) + (if (zero? sv-184) + (set! sv-212 #t) + (set! sv-208 #t) + ) + ) + (else + (if (= sv-176 95) + (set! sv-176 32) + ) + (set! (-> *game-text-word* data sv-184) (the-as uint sv-176)) + (set! sv-184 (+ sv-184 1)) + ) + ) + (when (= sv-208 #t) + (set! (-> *game-text-word* data sv-184) (the-as uint 0)) + (let* ((f30-1 sv-144) + (f0-49 (* (get-string-length *game-text-word* gp-0) (-> *video-parms* relative-x-scale))) + (f1-14 (+ f30-1 f0-49)) + ) + (if (= (-> *game-text-word* data (+ sv-184 -1)) 32) + (set! f1-14 (- f1-14 sv-160)) + ) + (cond + ((< sv-152 f1-14) + (set! sv-144 (+ sv-148 f0-49)) + (set! sv-212 #t) + ) + (else + (set! sv-144 (+ sv-144 f0-49)) + ) + ) + ) + ) + (when (= sv-212 #t) + (when (>= sv-200 (the-as int (-> gp-0 start-line))) + (let ((f30-2 (+ (-> gp-0 origin y) sv-164))) + (when (>= sv-156 f30-2) + (when (= (-> *game-text-line* data (+ sv-192 -1)) 32) + (set! (-> *game-text-line* data (+ sv-192 -1)) (the-as uint 0)) + (when (and (= (-> *game-text-line* data (+ sv-192 -5)) 126) (= (-> *game-text-line* data (+ sv-192 -2)) 72)) + (set! (-> *game-text-line* data (+ sv-192 -5)) (the-as uint 0)) + 0 + ) + ) + ) + (when (and (= (-> *game-text-line* data (+ sv-192 -4)) 126) (= (-> *game-text-line* data (+ sv-192 -1)) 72)) + (set! (-> *game-text-line* data (+ sv-192 -4)) (the-as uint 0)) + 0 + ) + (if (nonzero? (-> *game-text-line* data 0)) + (set! sv-168 (+ sv-168 1)) + ) + (when (not opaque) + (let* ((s1-1 (-> *display* frames (-> *display* on-screen) frame global-buf)) + (s2-1 (-> s1-1 base)) + ) + (set-font-color-alpha (-> font-ctxt color) alpha) + (draw-string *game-text-line* s1-1 gp-0) + (set-font-color-alpha (-> font-ctxt color) 128) + (set! (-> gp-0 color) (-> *font-work* last-color)) + (let ((a3-3 (-> s1-1 base))) + (let ((v1-127 (the-as object (-> s1-1 base)))) + (set! (-> (the-as dma-packet v1-127) dma) (new 'static 'dma-tag :id (dma-tag-id next))) + (set! (-> (the-as dma-packet v1-127) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet v1-127) vif1) (new 'static 'vif-tag)) + (set! (-> s1-1 base) (&+ (the-as pointer v1-127) 16)) + ) + (dma-bucket-insert-tag + (-> *display* frames (-> *display* on-screen) frame bucket-group) + (bucket-id subtitle) + s2-1 + (the-as (pointer dma-tag) a3-3) + ) + ) + ) + ) + (set! (-> gp-0 origin y) f30-2) + ) + ) + (set! sv-200 (+ sv-200 1)) + (set! (-> *game-text-line* data 0) (the-as uint 0)) + (set! sv-192 0) + (set! sv-212 (the-as symbol #f)) + ) + (when (= sv-208 #t) + (copy-charp<-charp (&-> *game-text-line* data sv-192) (-> *game-text-word* data)) + (set! sv-192 (+ sv-192 sv-184)) + (set! sv-184 0) + (set! sv-208 (the-as symbol #f)) + ) + (when (nonzero? sv-176) + (set! sv-140 (&-> sv-140 1)) + (set! sv-176 (the-as int (-> sv-140 0))) + ) + ) + (set! (-> gp-0 mat vector 0 x) sv-112) + (set! (-> gp-0 mat vector 1 y) sv-116) + (set! (-> *video-parms* relative-x-scale) sv-120) + (set! (-> *video-parms* relative-y-scale) sv-124) + (set! (-> *video-parms* relative-x-scale-reciprical) sv-128) + (set! (-> *video-parms* relative-y-scale-reciprical) sv-132) + (if (> sv-168 0) + (* sv-164 (the float sv-168)) + 0.0 + ) + ) + ) + ) + + + (defmethod subtitle-format subtitle ((obj subtitle) (keyframe subtitle-keyframe)) "check settings and format subtitle accordingly." - + (cond ((= 0 (length (-> keyframe speaker))) + ;; there's no speaker so who cares. (string-format "~S" (-> keyframe string)) ) ((or (= #t (-> *pc-settings* subtitle-speaker?)) - (and (= 'auto (-> *pc-settings* subtitle-speaker?)) (-> keyframe offscreen))) + (and (= 'auto (-> *pc-settings* subtitle-speaker?)) (subtitle-flags? keyframe offscreen))) + ;; there is a speaker and we do want it. (string-format "~3L~S:~0L ~S" (-> keyframe speaker) (-> keyframe string)) ) (else (string-format "~S" (-> keyframe string)) ) ) - + ) (defun subtitle? () @@ -243,41 +510,47 @@ (defstate subtitle-process (subtitle) - + :event (behavior ((from process) (argc int) (msg symbol) (block event-message-block)) (case msg (('subtitle-start) 0 ) + (('debug) + (go subtitle-debug) + ) ) ) + :code (behavior () (loop (suspend)) ) + :trans (behavior () (load-level-subtitle-files 0) ;; reset params + (set! (-> self want-subtitle) (the subtitle-keyframe #f)) (set! (-> self spool-name) #f) (set! (-> self cur-channel) (pc-subtitle-channel invalid)) - (none)) - :post (behavior () + ;; check what kind of subtitles are running (when (and (movie?) (-> *art-control* spool-lock) (-> *art-control* active-stream)) ;; there's a cutscene happening and an active spool with a valid owner. (set! (-> self spool-name) (-> *art-control* active-stream)) (set! (-> self cur-channel) (pc-subtitle-channel movie)) (with-proc ((handle->process (-> *art-control* spool-lock))) - (format *stdcon* "current spool frame is ~D~%" (the int (ja-aframe-num 0))) + (format *stdcon* "movie spool detected~%current spool frame is ~D~%" (the int (ja-aframe-num 0))) ) ) - + ;; do subtitles (case (-> self cur-channel) (((pc-subtitle-channel movie)) ;; cutscenes, check if user toggled subtitles (if (and (= 'game *master-mode*) (cpad-pressed? 0 square)) (not! (-> *pc-settings* subtitles?))) + (when (subtitle?) ;; subtitles on! get a subtitle info that matches our current cutscene, and find at what point we're in. (let ((scene (get-scene-by-name *subtitle-text* (-> self cur-channel) (-> self spool-name)))) @@ -294,28 +567,121 @@ (when (>= pos (-> scene keyframes i frame)) (set! keyframe (-> scene keyframes i))) ) - (when keyframe - ;; we got the closest keyframe! finally just render the subtitles! - (print-game-text (subtitle-format self keyframe) (-> self font) #f 128 22) - (#when PC_SUBTITLE_DEBUG - (draw-debug-text-box (-> self font)) - ) - ) + ;; and save it! + (set! (-> self want-subtitle) keyframe) ) ) ) - + ;; keep this for later (set! (-> self old-spool-name) (-> self spool-name)) ) ) ) + + (when *debug-segment* + (when (and (cpad-hold? 0 l3) (cpad-pressed? 0 start)) + (cpad-clear! 0 start) + (send-event self 'debug) + ) + + ) + + (none)) + + :post (behavior () + + ;; set font settings. + (set! (-> self font origin x) (* (- 1.0 (-> *SUBTITLE-bank* width)) 256)) + (set! (-> self font origin y) (* (-> *SUBTITLE-bank* height) 224)) + (set-width! (-> self font) (the int (* (-> *SUBTITLE-bank* width) 512))) + (set-height! (-> self font) (the int (* (-> *SUBTITLE-bank* lines) 11))) + (set-scale! (-> self font) (-> *SUBTITLE-bank* scale)) + + (when (-> self want-subtitle) + ;; we got a valid subtitle! render it. + (print-game-subtitle (subtitle-format self (-> self want-subtitle)) (-> self font) #f 128 22) + (#when PC_SUBTITLE_DEBUG + (draw-debug-text-box (-> self font)) + ) + ) 0) - + ) +(defstate subtitle-debug (subtitle) + + + :event (behavior ((from process) (argc int) (msg symbol) (block event-message-block)) + (case msg + (('debug) + (go subtitle-process) + ) + ) + ) + + :enter (behavior () + (mem-copy! (the pointer (-> self bank-backup)) (the pointer *SUBTITLE-bank*) (size-of subtitle-bank)) + (set-master-mode 'pause) + ) + :exit (behavior () + (toggle-pause) (none)) ;; todo fuck + + :trans (behavior () + + (with-dma-buffer-add-bucket ((buf (-> (current-frame) debug-buf)) + (bucket-id debug)) + + (draw-string-xy "~3LSUBTITLE DEBUG!~0L" buf 16 40 (font-color default) (font-flags shadow kerning)) + (draw-string-xy "Square: reset" buf 16 48 (font-color default) (font-flags shadow kerning)) + (draw-string-xy "Up/down: Move vertically" buf 16 56 (font-color default) (font-flags shadow kerning)) + (draw-string-xy "Triangle+R1/L1: width" buf 16 64 (font-color default) (font-flags shadow kerning)) + (draw-string-xy "Triangle+R2/L2: height" buf 16 72 (font-color default) (font-flags shadow kerning)) + (draw-string-xy "Circle+R1/L1: scale" buf 16 80 (font-color default) (font-flags shadow kerning)) + (draw-string-xy "L3+Start: exit" buf 16 88 (font-color default) (font-flags shadow kerning)) + + ) + + (when (= 'pause *master-mode*) + (when (cpad-pressed? 0 square) + (mem-copy! (the pointer *SUBTITLE-bank*) (the pointer (-> self bank-backup)) (size-of subtitle-bank)) + ) + + (when (cpad-hold? 0 up) (+! (-> *SUBTITLE-bank* height) -0.01)) + (when (cpad-hold? 0 down) (+! (-> *SUBTITLE-bank* height) 0.01)) + + (cond + ((cpad-hold? 0 triangle) + (when (cpad-hold? 0 r1) (-! (-> *SUBTITLE-bank* width) 0.01)) + (when (cpad-hold? 0 l1) (+! (-> *SUBTITLE-bank* width) 0.01)) + (when (cpad-hold? 0 r2) (-! (-> *SUBTITLE-bank* lines) 0.05)) + (when (cpad-hold? 0 l2) (+! (-> *SUBTITLE-bank* lines) 0.05)) + ) + ((cpad-hold? 0 circle) + (when (cpad-hold? 0 r1) (+! (-> *SUBTITLE-bank* scale) 0.01)) + (when (cpad-hold? 0 l1) (-! (-> *SUBTITLE-bank* scale) 0.01)) + ) + ) + ) + + (when (and (cpad-hold? 0 l3) (cpad-pressed? 0 start)) + (cpad-clear! 0 start) + (send-event self 'debug) + ) + + (none)) + + :code (-> subtitle-process code) + :post (-> subtitle-process post) + + ) + + + + + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;; helper functions ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -333,11 +699,19 @@ ) +(defbehavior subtitle-init-by-other subtitle () + "external initializer for subtitle process" + + (set! (-> self font) (new 'process 'font-context *font-default-matrix* + 0 0 0.0 (font-color default) (font-flags shadow kerning middle large))) + (go subtitle-process) + ) + (defun subtitle-stop () "kill the subtitle process" - (kill-by-type subtitle *active-pool*) + (kill-by-type subtitle *display-pool*) (set! *subtitle* (the (pointer subtitle) #f))) (defun subtitle-start () @@ -346,20 +720,10 @@ (when *subtitle* (subtitle-stop) ) - - (set! *subtitle* (process-new subtitle - (lambda :behavior subtitle () - (set! (-> self font) (new 'process 'font-context *font-default-matrix* - (the int (* 0.12 256)) (+ 112 (* 11 5)) 0.0 - (font-color default) - (font-flags shadow kerning middle large))) - (set-scale! (-> self font) 0.5) - (set-width! (-> self font) (the int (* 0.88 256 2))) - (set-height! (-> self font) (* 11 3)) - (go subtitle-process) - ) - :from *pc-dead-pool* :to *active-pool* - :stack-size (* 1 1024))) + + (set! *subtitle* (process-new subtitle subtitle-init-by-other + :from *pc-dead-pool* :to *display-pool* + :stack-size (* 1 1024))) ) @@ -367,7 +731,4 @@ (subtitle-start) -) - - diff --git a/goalc/CMakeLists.txt b/goalc/CMakeLists.txt index 72dfd374f4..6d6e06f861 100644 --- a/goalc/CMakeLists.txt +++ b/goalc/CMakeLists.txt @@ -27,11 +27,10 @@ add_library(compiler compiler/compilation/State.cpp compiler/compilation/Static.cpp compiler/Util.cpp - data_compiler/game_text.cpp + data_compiler/game_text_common.cpp data_compiler/dir_tpages.cpp data_compiler/DataObjectGenerator.cpp data_compiler/game_count.cpp - data_compiler/game_subtitle.cpp debugger/Debugger.cpp debugger/DebugInfo.cpp listener/Listener.cpp diff --git a/goalc/compiler/Compiler.h b/goalc/compiler/Compiler.h index 081ab1d585..b8939f2842 100644 --- a/goalc/compiler/Compiler.h +++ b/goalc/compiler/Compiler.h @@ -18,8 +18,7 @@ #include "goalc/emitter/Register.h" #include "goalc/listener/Listener.h" #include "goalc/make/MakeSystem.h" -#include "goalc/data_compiler/game_text.h" -#include "goalc/data_compiler/game_subtitle.h" +#include "goalc/data_compiler/game_text_common.h" enum MathMode { MATH_INT, MATH_BINT, MATH_FLOAT, MATH_INVALID }; diff --git a/goalc/compiler/compilation/CompilerControl.cpp b/goalc/compiler/compilation/CompilerControl.cpp index 600bcbbf36..43560e910e 100644 --- a/goalc/compiler/compilation/CompilerControl.cpp +++ b/goalc/compiler/compilation/CompilerControl.cpp @@ -15,8 +15,7 @@ #include "goalc/compiler/IR.h" #include "goalc/data_compiler/dir_tpages.h" #include "goalc/data_compiler/game_count.h" -#include "goalc/data_compiler/game_text.h" -#include "goalc/data_compiler/game_subtitle.h" +#include "goalc/data_compiler/game_text_common.h" /*! * Exit the compiler. Disconnects the listener and tells the target to reset itself. @@ -82,29 +81,34 @@ Val* Compiler::compile_asm_data_file(const goos::Object& form, const goos::Objec Val* Compiler::compile_asm_text_file(const goos::Object& form, const goos::Object& rest, Env* env) { (void)env; auto args = get_va(form, rest); - va_check(form, args, {goos::ObjectType::SYMBOL, goos::ObjectType::INTEGER}, - {{"files", {true, goos::ObjectType::PAIR}}}); - auto kind = symbol_string(args.unnamed.at(0)); + va_check(form, args, {goos::ObjectType::SYMBOL}, {{"files", {true, goos::ObjectType::PAIR}}}); + + // list of files per text version. + std::unordered_map> inputs; + + // what kind of text file? + const auto kind = symbol_string(args.unnamed.at(0)); + + // open all project files specified (usually one). + for_each_in_list(args.named.at("files"), [this, &inputs, &form, &kind](const goos::Object& o) { + if (o.is_string()) { + open_text_project(kind, o.as_string()->data, inputs); + } else { + throw_compiler_error(form, "Invalid object {} in asm-text-file files list.", o.print()); + } + }); + + // compile files. if (kind == "subtitle") { - std::vector files; - for_each_in_list(args.named.at("files"), [this, &files, &form](const goos::Object& o) { - if (o.is_string()) { - files.push_back(o.as_string()->data); - } else { - throw_compiler_error(form, "Invalid object {} in asm-text-file files list.", o.print()); - } - }); - compile_game_subtitle(files, (GameTextVersion)args.unnamed.at(1).as_int()); + for (auto& [ver, in] : inputs) { + GameSubtitleDB db; + compile_game_subtitle(in, ver, db); + } } else if (kind == "text") { - std::vector files; - for_each_in_list(args.named.at("files"), [this, &files, &form](const goos::Object& o) { - if (o.is_string()) { - files.push_back(o.as_string()->data); - } else { - throw_compiler_error(form, "Invalid object {} in asm-text-file files list.", o.print()); - } - }); - compile_game_text(files, (GameTextVersion)args.unnamed.at(1).as_int()); + for (auto& [ver, in] : inputs) { + GameTextDB db; + compile_game_text(in, ver, db); + } } else { throw_compiler_error(form, "The option {} was not recognized for asm-text-file.", kind); } diff --git a/goalc/data_compiler/game_subtitle.cpp b/goalc/data_compiler/game_subtitle.cpp deleted file mode 100644 index 7e319fd260..0000000000 --- a/goalc/data_compiler/game_subtitle.cpp +++ /dev/null @@ -1,192 +0,0 @@ -/*! - * @file game_subtitle.cpp - * Builds the XSUBTIT.TXT text files. Each file contains all the strings used as subtitles for - * cutscenes, hints and ambient speech, along with the timings. - * - * This kind of file is completely custom. - */ - -#include -#include -#include -#include "game_subtitle.h" -#include "DataObjectGenerator.h" -#include "common/goos/Reader.h" -#include "common/util/FileUtil.h" -#include "common/goos/ParseHelpers.h" -#include "third-party/fmt/core.h" - -namespace { -int64_t get_int(const goos::Object& obj) { - if (obj.is_int()) { - return obj.integer_obj.value; - } - throw std::runtime_error(obj.print() + " was supposed to be an integer, but isn't"); -} - -const goos::Object& car(const goos::Object& x) { - if (!x.is_pair()) { - throw std::runtime_error("invalid pair"); - } - - return x.as_pair()->car; -} - -const goos::Object& cdr(const goos::Object& x) { - if (!x.is_pair()) { - throw std::runtime_error("invalid pair"); - } - - return x.as_pair()->cdr; -} - -std::string uppercase(const std::string& in) { - std::string result; - result.reserve(in.size()); - for (auto c : in) { - if (c >= 'a' && c <= 'z') { - c -= ('a' - 'A'); - } - result.push_back(c); - } - return result; -} - -/*! - * Parse a game subtitle file. - * Information is added to the game subtitles database. - * - * The file should begin with (language-id x y z...) with the given language IDs. - * Each entry should be (name (frame "line-text-0" "line-text-1") ... ) - * This adds the subtitle to each of the specified languages. - */ -void parse(const goos::Object& data, GameTextVersion text_ver, GameSubtitleDB& db) { - auto font = get_font_bank(text_ver); - std::map> banks; - - for_each_in_list(data.as_pair()->cdr, [&](const goos::Object& obj) { - if (obj.is_pair()) { - auto& head = car(obj); - if (head.is_symbol() && head.as_symbol()->name == "language-id") { - if (banks.size() != 0) { - throw std::runtime_error("Languages have been set multiple times."); - } - - if (cdr(obj).is_empty_list()) { - throw std::runtime_error("At least one language must be set."); - } - - for_each_in_list(cdr(obj), [&](const goos::Object& obj) { - auto lang = get_int(obj); - if (!db.bank_exists(lang)) { - // database has no lang yet - banks[lang] = db.add_bank(std::make_shared(lang)); - } else { - banks[lang] = db.bank_by_id(lang); - } - }); - } - - else if (head.is_string()) { - if (banks.size() == 0) { - throw std::runtime_error("At least one language must be set before defining entries."); - } - GameSubtitleSceneInfo scene(head.as_string()->data); - for_each_in_list(cdr(obj), [&](const goos::Object& entry) { - if (entry.is_pair()) { - if (!car(entry).is_int() || !car(cdr(entry)).is_symbol() || - !car(cdr(cdr(entry))).is_string() || !car(cdr(cdr(cdr(entry)))).is_string()) { - throw std::runtime_error( - "Each entry must be of format (number symbol \"string\" \"string\")"); - } - - auto line = font->convert_utf8_to_game(car(cdr(cdr(cdr(entry)))).as_string()->data); - auto speaker = font->convert_utf8_to_game(car(cdr(cdr(entry))).as_string()->data); - auto offscreen = car(cdr(entry)).as_symbol()->name != "#f"; - scene.add_line(car(entry).as_int(), line, speaker, offscreen); - } else { - throw std::runtime_error("Each entry must be a list"); - } - }); - for (auto& [lang, bank] : banks) { - if (!bank->scene_exists(scene.name())) { - bank->add_scene(scene); - } else { - // this should copy the data, so it's safe to delete the new one afterwards. - auto& old_scene = bank->scene_by_name(scene.name()); - old_scene.from_other_scene(scene); - } - } - } else { - throw std::runtime_error("Invalid game subtitles file entry: " + head.print()); - } - } else { - throw std::runtime_error("Invalid game subtitles file"); - } - }); - if (banks.size() == 0) { - throw std::runtime_error("At least one language must be set."); - } -} - -/*! - * Write game subtitle data to a file. Uses the V2 object format which is identical between GOAL and - * OpenGOAL. - */ -void compile(GameSubtitleDB& db) { - for (const auto& [lang, bank] : db.banks()) { - DataObjectGenerator gen; - gen.add_type_tag("subtitle-text-info"); // type - gen.add_word(bank->scenes().size()); // length - gen.add_word(lang); // lang - gen.add_word(0); // dummy - - // fifo queue for scene data arrays - std::queue array_link_sources; - // now add all the scene infos - for (auto& [name, scene] : bank->scenes()) { - gen.add_word(0 | - (scene.lines().size() << 16)); // kind (lower 16 bits), length (upper 16 bits) - - array_link_sources.push(gen.words()); - gen.add_word(0); // keyframes (linked later) - - gen.add_ref_to_string_in_pool(scene.name()); // name - - gen.add_word(0); // pad (string is 4 bytes but we have 8) - } - // now add all the scene *data!* (keyframes) - for (auto& [name, scene] : bank->scenes()) { - // link inline-array with reference from earlier - gen.link_word_to_word(array_link_sources.front(), gen.words()); - array_link_sources.pop(); - - for (auto& subtitle : scene.lines()) { - gen.add_word(subtitle.frame); // frame - gen.add_ref_to_string_in_pool(subtitle.line); // line - gen.add_ref_to_string_in_pool(subtitle.speaker); // speaker - gen.add_symbol_link(subtitle.offscreen ? "#t" : "#f"); // offscreen - } - } - - auto data = gen.generate_v2(); - - file_util::create_dir_if_needed(file_util::get_file_path({"out", "iso"})); - file_util::write_binary_file( - file_util::get_file_path( - {"out", "iso", fmt::format("{}{}.TXT", lang, uppercase("subtit"))}), - data.data(), data.size()); - } -} -} // namespace - -void compile_game_subtitle(const std::vector& filenames, GameTextVersion text_ver) { - GameSubtitleDB db; - goos::Reader reader; - for (auto& filename : filenames) { - fmt::print("[Build Game Subtitle] {}\n", filename.c_str()); - auto code = reader.read_from_file({filename}); - parse(code, text_ver, db); - } - compile(db); -} diff --git a/goalc/data_compiler/game_text.cpp b/goalc/data_compiler/game_text.cpp deleted file mode 100644 index 2cdb3d1dd0..0000000000 --- a/goalc/data_compiler/game_text.cpp +++ /dev/null @@ -1,210 +0,0 @@ -/*! - * @file game_text.cpp - * Builds the XCOMMON.TXT text files. Each file contains all the strings that appear in the game - * translated into a language. - * - * The decompiler/data/game_text.cpp file extracts text from the game and creates a file that - * can be read with these functions. - */ - -#include -#include "game_text.h" -#include "common/goos/Reader.h" -#include "DataObjectGenerator.h" -#include "common/util/FileUtil.h" -#include "common/util/FontUtils.h" -#include "common/goos/ParseHelpers.h" -#include "third-party/fmt/core.h" - -namespace { -int64_t get_int(const goos::Object& obj) { - if (obj.is_int()) { - return obj.integer_obj.value; - } - throw std::runtime_error(obj.print() + " was supposed to be an integer, but isn't"); -} - -const goos::Object& car(const goos::Object& x) { - if (!x.is_pair()) { - throw std::runtime_error("invalid pair"); - } - - return x.as_pair()->car; -} - -const goos::Object& cdr(const goos::Object& x) { - if (!x.is_pair()) { - throw std::runtime_error("invalid pair"); - } - - return x.as_pair()->cdr; -} - -std::string get_string(const goos::Object& x) { - if (x.is_string()) { - return x.as_string()->data; - } - throw std::runtime_error(x.print() + " was supposed to be a string, but isn't"); -} - -std::string uppercase(const std::string& in) { - std::string result; - result.reserve(in.size()); - for (auto c : in) { - if (c >= 'a' && c <= 'z') { - c -= ('a' - 'A'); - } - result.push_back(c); - } - return result; -} - -/*! - * Parse a game text file. - * Information is added to the game text database. - * - * The file should begin with (language-id x y z...) with the given language IDs. - * Each entry should be (id "line for 1st language" "line for 2nd language" ...) - * This adds the text line to each of the specified languages. - */ -void parse(const goos::Object& data, GameTextVersion text_ver, GameTextDB& db) { - auto font = get_font_bank(text_ver); - std::vector> banks; - bool group_name_set = false; - std::string possible_group_name; - - for_each_in_list(data.as_pair()->cdr, [&](const goos::Object& obj) { - if (obj.is_pair()) { - auto& head = car(obj); - if (head.is_symbol() && head.as_symbol()->name == "language-id") { - if (banks.size() != 0) { - throw std::runtime_error("Languages have been set multiple times."); - } - - if (cdr(obj).is_empty_list()) { - throw std::runtime_error("At least one language must be set."); - } - - if (!group_name_set) { - throw std::runtime_error("Text group must be set before languages."); - } - - for_each_in_list(cdr(obj), [&](const goos::Object& obj) { - auto lang = get_int(obj); - if (!db.bank_exists(possible_group_name, lang)) { - // database has no lang in this group yet - banks.push_back(db.add_bank(possible_group_name, std::make_shared(lang))); - } else { - banks.push_back(db.bank_by_id(possible_group_name, lang)); - } - }); - } else if (head.is_symbol() && head.as_symbol()->name == "group-name") { - if (group_name_set) { - throw std::runtime_error("group-name has been set multiple times."); - } - group_name_set = true; - - possible_group_name = get_string(car(cdr(obj))); - if (!cdr(cdr(obj)).is_empty_list()) { - throw std::runtime_error("group-name has too many arguments"); - } - } - - else if (head.is_int()) { - if (banks.size() == 0) { - throw std::runtime_error("At least one language must be set before defining entries."); - } - int i = 0; - int id = head.as_int(); - for_each_in_list(cdr(obj), [&](const goos::Object& entry) { - if (entry.is_string()) { - if (i >= int(banks.size())) { - throw std::runtime_error(fmt::format("Too many strings in text id #x{:x}", id)); - } - - auto line = font->convert_utf8_to_game(entry.as_string()->data); - banks[i++]->set_line(id, line); - } else { - throw std::runtime_error(fmt::format("Non-string value in text id #x{:x}", id)); - } - }); - if (i != int(banks.size())) { - throw std::runtime_error( - fmt::format("Not enough strings specified in text id #x{:x}", id)); - } - } else { - throw std::runtime_error("Invalid game text file entry: " + head.print()); - } - } else { - throw std::runtime_error("Invalid game text file"); - } - }); - if (banks.size() == 0) { - throw std::runtime_error("At least one language must be set."); - } -} - -/* -(deftype game-text (structure) - ((id uint32 :offset-assert 0) - (text basic :offset-assert 4) - ) - ) - -(deftype game-text-info (basic) - ((length int32 :offset-assert 4) - (language-id int32 :offset-assert 8) - (group-name basic :offset-assert 12) - (data game-text :dynamic :offset-assert 16) - ) - ) - */ - -/*! - * Write game text data to a file. Uses the V2 object format which is identical between GOAL and - * OpenGOAL, so this should produce exactly identical files to what is found in the game. - */ -void compile(GameTextDB& db) { - for (const auto& [group_name, banks] : db.groups()) { - for (const auto& [lang, bank] : banks) { - DataObjectGenerator gen; - gen.add_type_tag("game-text-info"); // type - gen.add_word(bank->lines().size()); // length - gen.add_word(lang); // language-id - // this string is found in the string pool. - gen.add_ref_to_string_in_pool(group_name); // group-name - - // now add all the datas: (the lines are already sorted by id) - for (auto& [id, line] : bank->lines()) { - gen.add_word(id); // id - // these strings must be in the string pool, as sometimes there are duplicate - // strings in a single language, and these strings should be stored once and have multiple - // references to them. - gen.add_ref_to_string_in_pool(line); // text - } - - auto data = gen.generate_v2(); - - file_util::create_dir_if_needed(file_util::get_file_path({"out", "iso"})); - file_util::write_binary_file( - file_util::get_file_path( - {"out", "iso", fmt::format("{}{}.TXT", lang, uppercase(group_name))}), - data.data(), data.size()); - } - } -} -} // namespace - -/*! - * Read a game text description file and generate GOAL objects. - */ -void compile_game_text(const std::vector& filenames, GameTextVersion text_ver) { - GameTextDB db; - goos::Reader reader; - for (auto& filename : filenames) { - fmt::print("[Build Game Text] {}\n", filename.c_str()); - auto code = reader.read_from_file({filename}); - parse(code, text_ver, db); - } - compile(db); -} diff --git a/goalc/data_compiler/game_text.h b/goalc/data_compiler/game_text.h deleted file mode 100644 index 4c419cbe3a..0000000000 --- a/goalc/data_compiler/game_text.h +++ /dev/null @@ -1,62 +0,0 @@ -#pragma once -#include "common/util/FontUtils.h" -#include "common/util/Assert.h" -#include -#include -#include -#include -#include - -class GameTextBank { - public: - GameTextBank(int lang_id) : m_lang_id(lang_id) {} - - int lang() const { return m_lang_id; } - const std::map& lines() const { return m_lines; } - - bool line_exists(int id) const { return m_lines.find(id) != m_lines.end(); } - std::string line(int id) { return m_lines.at(id); } - void set_line(int id, std::string line) { m_lines[id] = line; } - - private: - int m_lang_id; - std::map m_lines; -}; - -/*! - * The text database contains a text bank for each language for each text group. - * Each text bank contains a list of text lines. Very simple. - */ -class GameTextDB { - public: - const std::unordered_map>>& groups() - const { - return m_banks; - } - const std::map>& banks(std::string group) const { - return m_banks.at(group); - } - - bool bank_exists(std::string group, int id) const { - if (m_banks.find(group) == m_banks.end()) - return false; - return m_banks.at(group).find(id) != m_banks.at(group).end(); - } - - std::shared_ptr add_bank(std::string group, std::shared_ptr bank) { - ASSERT(!bank_exists(group, bank->lang())); - m_banks[group][bank->lang()] = bank; - return bank; - } - std::shared_ptr bank_by_id(std::string group, int id) { - if (!bank_exists(group, id)) { - return nullptr; - } - return m_banks.at(group).at(id); - } - - private: - std::unordered_map>> m_banks; -}; - -void compile_game_text(const std::vector& filenames, GameTextVersion text_ver); diff --git a/goalc/data_compiler/game_text_common.cpp b/goalc/data_compiler/game_text_common.cpp new file mode 100644 index 0000000000..1c939473f8 --- /dev/null +++ b/goalc/data_compiler/game_text_common.cpp @@ -0,0 +1,408 @@ +/*! + * @file game_text.cpp + * Builds the XCOMMON.TXT text files. Each file contains all the strings that appear in the game + * translated into a language. + * + * The decompiler/data/game_text.cpp file extracts text from the game and creates a file that + * can be read with these functions. + * + * Also builds the XSUBTIT.TXT text files. Each file contains all the strings used as subtitles for + * cutscenes, hints and ambient speech, along with the timings. + * This kind of file is completely custom. + */ + +#include +#include +#include "game_text_common.h" +#include "common/goos/Reader.h" +#include "DataObjectGenerator.h" +#include "common/util/FileUtil.h" +#include "common/util/FontUtils.h" +#include "common/goos/ParseHelpers.h" +#include "third-party/fmt/core.h" + +namespace { +int64_t get_int(const goos::Object& obj) { + if (obj.is_int()) { + return obj.integer_obj.value; + } + throw std::runtime_error(obj.print() + " was supposed to be an integer, but isn't"); +} + +const goos::Object& car(const goos::Object& x) { + if (!x.is_pair()) { + throw std::runtime_error("invalid pair"); + } + + return x.as_pair()->car; +} + +const goos::Object& cdr(const goos::Object& x) { + if (!x.is_pair()) { + throw std::runtime_error("invalid pair"); + } + + return x.as_pair()->cdr; +} + +std::string get_string(const goos::Object& x) { + if (x.is_string()) { + return x.as_string()->data; + } + throw std::runtime_error(x.print() + " was supposed to be a string, but isn't"); +} + +std::string uppercase(const std::string& in) { + std::string result; + result.reserve(in.size()); + for (auto c : in) { + if (c >= 'a' && c <= 'z') { + c -= ('a' - 'A'); + } + result.push_back(c); + } + return result; +} + +/*! + * Parse a game text file. + * Information is added to the game text database. + * + * The file should begin with (language-id x y z...) with the given language IDs. + * Each entry should be (id "line for 1st language" "line for 2nd language" ...) + * This adds the text line to each of the specified languages. + */ +void parse_text(const goos::Object& data, GameTextVersion text_ver, GameTextDB& db) { + auto font = get_font_bank(text_ver); + std::vector> banks; + std::string possible_group_name; + + for_each_in_list(data.as_pair()->cdr, [&](const goos::Object& obj) { + if (obj.is_pair()) { + auto& head = car(obj); + if (head.is_symbol() && head.as_symbol()->name == "language-id") { + if (banks.size() != 0) { + throw std::runtime_error("Languages have been set multiple times."); + } + + if (cdr(obj).is_empty_list()) { + throw std::runtime_error("At least one language must be set."); + } + + if (possible_group_name.empty()) { + throw std::runtime_error("Text group must be set before languages."); + } + + for_each_in_list(cdr(obj), [&](const goos::Object& obj) { + auto lang = get_int(obj); + if (!db.bank_exists(possible_group_name, lang)) { + // database has no lang in this group yet + banks.push_back(db.add_bank(possible_group_name, std::make_shared(lang))); + } else { + banks.push_back(db.bank_by_id(possible_group_name, lang)); + } + }); + } else if (head.is_symbol() && head.as_symbol()->name == "group-name") { + if (!possible_group_name.empty()) { + throw std::runtime_error("group-name has been set multiple times."); + } + + possible_group_name = get_string(car(cdr(obj))); + + if (possible_group_name.empty()) { + throw std::runtime_error("invalid group-name."); + } + + if (!cdr(cdr(obj)).is_empty_list()) { + throw std::runtime_error("group-name has too many arguments"); + } + } + + else if (head.is_int()) { + if (banks.size() == 0) { + throw std::runtime_error("At least one language must be set before defining entries."); + } + int i = 0; + int id = head.as_int(); + for_each_in_list(cdr(obj), [&](const goos::Object& entry) { + if (entry.is_string()) { + if (i >= int(banks.size())) { + throw std::runtime_error(fmt::format("Too many strings in text id #x{:x}", id)); + } + + auto line = font->convert_utf8_to_game(entry.as_string()->data); + banks[i++]->set_line(id, line); + } else { + throw std::runtime_error(fmt::format("Non-string value in text id #x{:x}", id)); + } + }); + if (i != int(banks.size())) { + throw std::runtime_error( + fmt::format("Not enough strings specified in text id #x{:x}", id)); + } + } else { + throw std::runtime_error("Invalid game text file entry: " + head.print()); + } + } else { + throw std::runtime_error("Invalid game text file"); + } + }); + if (banks.size() == 0) { + throw std::runtime_error("At least one language must be set."); + } +} + +/* +(deftype game-text (structure) + ((id uint32 :offset-assert 0) + (text basic :offset-assert 4) + ) + ) + +(deftype game-text-info (basic) + ((length int32 :offset-assert 4) + (language-id int32 :offset-assert 8) + (group-name basic :offset-assert 12) + (data game-text :dynamic :offset-assert 16) + ) + ) + */ + +/*! + * Write game text data to a file. Uses the V2 object format which is identical between GOAL and + * OpenGOAL, so this should produce exactly identical files to what is found in the game. + */ +void compile_text(GameTextDB& db) { + for (const auto& [group_name, banks] : db.groups()) { + for (const auto& [lang, bank] : banks) { + DataObjectGenerator gen; + gen.add_type_tag("game-text-info"); // type + gen.add_word(bank->lines().size()); // length + gen.add_word(lang); // language-id + // this string is found in the string pool. + gen.add_ref_to_string_in_pool(group_name); // group-name + + // now add all the datas: (the lines are already sorted by id) + for (auto& [id, line] : bank->lines()) { + gen.add_word(id); // id + // these strings must be in the string pool, as sometimes there are duplicate + // strings in a single language, and these strings should be stored once and have multiple + // references to them. + gen.add_ref_to_string_in_pool(line); // text + } + + auto data = gen.generate_v2(); + + file_util::create_dir_if_needed(file_util::get_file_path({"out", "iso"})); + file_util::write_binary_file( + file_util::get_file_path( + {"out", "iso", fmt::format("{}{}.TXT", lang, uppercase(group_name))}), + data.data(), data.size()); + } + } +} + +/*! + * Parse a game subtitle file. + * Information is added to the game subtitles database. + * + * The file should begin with (language-id x y z...) for the given language IDs. + * Each scene should be (scene-name ... ) + * This adds the subtitle to each of the specified languages. + */ +void parse_subtitle(const goos::Object& data, GameTextVersion text_ver, GameSubtitleDB& db) { + auto font = get_font_bank(text_ver); + std::map> banks; + + for_each_in_list(data.as_pair()->cdr, [&](const goos::Object& obj) { + if (obj.is_pair()) { + auto& head = car(obj); + if (head.is_symbol() && head.as_symbol()->name == "language-id") { + if (banks.size() != 0) { + throw std::runtime_error("Languages have been set multiple times."); + } + + if (cdr(obj).is_empty_list()) { + throw std::runtime_error("At least one language must be set."); + } + + for_each_in_list(cdr(obj), [&](const goos::Object& obj) { + auto lang = get_int(obj); + if (!db.bank_exists(lang)) { + // database has no lang yet + banks[lang] = db.add_bank(std::make_shared(lang)); + } else { + banks[lang] = db.bank_by_id(lang); + } + }); + } + + else if (head.is_string()) { + if (banks.size() == 0) { + throw std::runtime_error("At least one language must be set before defining entries."); + } + GameSubtitleSceneInfo scene(head.as_string()->data); + for_each_in_list(cdr(obj), [&](const goos::Object& entry) { + if (entry.is_pair()) { + // expected formats: + // (time ) + // all arguments have default values. the arguments are: + // "speaker" "line" - two strings. one for the speaker's name and one for the actual + // line. speaker can be empty. default is just empty string. + // :offscreen - speaker is offscreen. default is not offscreen. + + if (!car(entry).is_int()) { + throw std::runtime_error("Each entry must start with a timestamp (number)"); + } + + auto time = car(entry).as_int(); + goos::StringObject *speaker = nullptr, *line = nullptr; + bool offscreen = false; + for_each_in_list(cdr(entry), [&](const goos::Object& arg) { + if (arg.is_string()) { + if (!speaker) { + speaker = arg.as_string(); + } else if (!line) { + line = arg.as_string(); + } else { + throw std::runtime_error("Invalid string in subtitle entry"); + } + } else if (speaker && !line) { + throw std::runtime_error( + "Invalid object in subtitle entry, expecting actual line string after speaker"); + } else if (arg.is_symbol()) { + if (arg.as_symbol()->name == ":offscreen") { + offscreen = true; + } + } + }); + auto line_str = font->convert_utf8_to_game(line ? line->data : ""); + auto speaker_str = font->convert_utf8_to_game(speaker ? speaker->data : ""); + scene.add_line(time, line_str, speaker_str, offscreen); + } else { + throw std::runtime_error("Each entry must be a list"); + } + }); + for (auto& [lang, bank] : banks) { + if (!bank->scene_exists(scene.name())) { + bank->add_scene(scene); + } else { + // this should copy the data, so it's safe to delete the new one afterwards. + auto& old_scene = bank->scene_by_name(scene.name()); + old_scene.from_other_scene(scene); + } + } + } else { + throw std::runtime_error("Invalid game subtitles file entry: " + head.print()); + } + } else { + throw std::runtime_error("Invalid game subtitles file"); + } + }); + if (banks.size() == 0) { + throw std::runtime_error("At least one language must be set."); + } +} + +/*! + * Write game subtitle data to a file. Uses the V2 object format which is identical between GOAL and + * OpenGOAL. + */ +void compile_subtitle(GameSubtitleDB& db) { + for (const auto& [lang, bank] : db.banks()) { + DataObjectGenerator gen; + gen.add_type_tag("subtitle-text-info"); // type + gen.add_word(bank->scenes().size()); // length + gen.add_word(lang); // lang + gen.add_word(0); // dummy + + // fifo queue for scene data arrays + std::queue array_link_sources; + // now add all the scene infos + for (auto& [name, scene] : bank->scenes()) { + gen.add_word(0 | + (scene.lines().size() << 16)); // kind (lower 16 bits), length (upper 16 bits) + + array_link_sources.push(gen.words()); + gen.add_word(0); // keyframes (linked later) + + gen.add_ref_to_string_in_pool(scene.name()); // name + + gen.add_word(0); // pad (string is 4 bytes but we have 8) + } + // now add all the scene *data!* (keyframes) + for (auto& [name, scene] : bank->scenes()) { + // link inline-array with reference from earlier + gen.link_word_to_word(array_link_sources.front(), gen.words()); + array_link_sources.pop(); + + for (auto& subtitle : scene.lines()) { + gen.add_word(subtitle.frame); // frame + gen.add_ref_to_string_in_pool(subtitle.line); // line + gen.add_ref_to_string_in_pool(subtitle.speaker); // speaker + gen.add_word(subtitle.offscreen); // offscreen + } + } + + auto data = gen.generate_v2(); + + file_util::create_dir_if_needed(file_util::get_file_path({"out", "iso"})); + file_util::write_binary_file( + file_util::get_file_path( + {"out", "iso", fmt::format("{}{}.TXT", lang, uppercase("subtit"))}), + data.data(), data.size()); + } +} +} // namespace + +/*! + * Read a game text description file and generate GOAL objects. + */ +void compile_game_text(const std::vector& filenames, + GameTextVersion text_ver, + GameTextDB& db) { + goos::Reader reader; + for (auto& filename : filenames) { + fmt::print("[Build Game Text] {}\n", filename.c_str()); + auto code = reader.read_from_file({filename}); + parse_text(code, text_ver, db); + } + compile_text(db); +} + +void compile_game_subtitle(const std::vector& filenames, + GameTextVersion text_ver, + GameSubtitleDB& db) { + goos::Reader reader; + for (auto& filename : filenames) { + fmt::print("[Build Game Subtitle] {}\n", filename.c_str()); + auto code = reader.read_from_file({filename}); + parse_subtitle(code, text_ver, db); + } + compile_subtitle(db); +} + +static const std::unordered_map s_text_ver_enum_map = { + {"jak1-v1", GameTextVersion::JAK1_V1}}; + +void open_text_project(const std::string& kind, + const std::string& filename, + std::unordered_map>& inputs) { + goos::Reader reader; + auto& proj = reader.read_from_file({filename}).as_pair()->cdr.as_pair()->car; + if (!proj.is_pair() || !proj.as_pair()->car.is_symbol() || + proj.as_pair()->car.as_symbol()->name != kind) { + throw std::runtime_error(fmt::format("invalid {} project", kind)); + } + + goos::for_each_in_list(proj.as_pair()->cdr, [&](const goos::Object& o) { + if (!o.is_pair()) { + throw std::runtime_error(fmt::format("invalid entry in {} project", kind)); + } + + auto& ver = o.as_pair()->car.as_symbol()->name; + auto& in = o.as_pair()->cdr.as_pair()->car.as_string()->data; + + inputs[s_text_ver_enum_map.at(ver)].push_back(in); + }); +} diff --git a/goalc/data_compiler/game_subtitle.h b/goalc/data_compiler/game_text_common.h similarity index 51% rename from goalc/data_compiler/game_subtitle.h rename to goalc/data_compiler/game_text_common.h index 7f4e590745..ed11474a31 100644 --- a/goalc/data_compiler/game_subtitle.h +++ b/goalc/data_compiler/game_text_common.h @@ -3,9 +3,69 @@ #include "common/util/Assert.h" #include #include +#include #include #include +/*! + * The text bank contains all lines (accessed with an ID) for a language. + */ +class GameTextBank { + public: + GameTextBank(int lang_id) : m_lang_id(lang_id) {} + + int lang() const { return m_lang_id; } + const std::map& lines() const { return m_lines; } + + bool line_exists(int id) const { return m_lines.find(id) != m_lines.end(); } + std::string line(int id) { return m_lines.at(id); } + void set_line(int id, std::string line) { m_lines[id] = line; } + + private: + int m_lang_id; + std::map m_lines; +}; + +/*! + * The text database contains a text bank for each language for each text group. + * Each text bank contains a list of text lines. Very simple. + */ +class GameTextDB { + public: + const std::unordered_map>>& groups() + const { + return m_banks; + } + const std::map>& banks(std::string group) const { + return m_banks.at(group); + } + + bool bank_exists(std::string group, int id) const { + if (m_banks.find(group) == m_banks.end()) + return false; + return m_banks.at(group).find(id) != m_banks.at(group).end(); + } + + std::shared_ptr add_bank(std::string group, std::shared_ptr bank) { + ASSERT(!bank_exists(group, bank->lang())); + m_banks[group][bank->lang()] = bank; + return bank; + } + std::shared_ptr bank_by_id(std::string group, int id) { + if (!bank_exists(group, id)) { + return nullptr; + } + return m_banks.at(group).at(id); + } + + private: + std::unordered_map>> m_banks; +}; + +/*! + * The subtitle scene info (accessed through the scene name) contains all lines and their timestamps + * and other settings. + */ class GameSubtitleSceneInfo { public: GameSubtitleSceneInfo() {} @@ -38,6 +98,9 @@ class GameSubtitleSceneInfo { std::vector m_lines; }; +/*! + * The subtitle bank contains subtitles for all scenes in a language. + */ class GameSubtitleBank { public: GameSubtitleBank(int lang_id) : m_lang_id(lang_id) {} @@ -84,4 +147,13 @@ class GameSubtitleDB { std::map> m_banks; }; -void compile_game_subtitle(const std::vector& filenames, GameTextVersion text_ver); +void compile_game_text(const std::vector& filenames, + GameTextVersion text_ver, + GameTextDB& db); +void compile_game_subtitle(const std::vector& filenames, + GameTextVersion text_ver, + GameSubtitleDB& db); + +void open_text_project(const std::string& kind, + const std::string& filename, + std::unordered_map>& inputs); diff --git a/goalc/make/Tools.cpp b/goalc/make/Tools.cpp index e07dcd5b51..2c06214a14 100644 --- a/goalc/make/Tools.cpp +++ b/goalc/make/Tools.cpp @@ -10,7 +10,7 @@ #include "third-party/fmt/core.h" #include "goalc/data_compiler/dir_tpages.h" #include "goalc/data_compiler/game_count.h" -#include "goalc/data_compiler/game_text.h" +#include "goalc/data_compiler/game_text_common.h" CompilerTool::CompilerTool(Compiler* compiler) : Tool("goalc"), m_compiler(compiler) {} @@ -67,34 +67,6 @@ DgoDescription parse_desc_file(const std::string& filename, goos::Reader& reader }); return desc; } - -static const std::unordered_map s_text_ver_enum_map = { - {"jak1-v1", GameTextVersion::JAK1_V1}}; - -std::unordered_map> open_text_project( - const std::string& kind, - const std::string& filename) { - goos::Reader reader; - auto& proj = reader.read_from_file({filename}).as_pair()->cdr.as_pair()->car; - if (!proj.is_pair() || !proj.as_pair()->car.is_symbol() || - proj.as_pair()->car.as_symbol()->name != kind) { - throw std::runtime_error(fmt::format("invalid {} project", kind)); - } - - std::unordered_map> inputs; - goos::for_each_in_list(proj.as_pair()->cdr, [&](const goos::Object& o) { - if (!o.is_pair()) { - throw std::runtime_error(fmt::format("invalid entry in {} project", kind)); - } - - auto& ver = o.as_pair()->car.as_symbol()->name; - auto& in = o.as_pair()->cdr.as_pair()->car.as_string()->data; - - inputs[s_text_ver_enum_map.at(ver)].push_back(in); - }); - - return inputs; -} } // namespace DgoTool::DgoTool() : Tool("dgo") {} @@ -159,8 +131,10 @@ bool TextTool::needs_run(const ToolInput& task) { } std::vector deps; - for (auto& [ver, inputs] : open_text_project("text", task.input.at(0))) { - for (auto& in : inputs) { + std::unordered_map> inputs; + open_text_project("text", task.input.at(0), inputs); + for (auto& [ver, files] : inputs) { + for (auto& in : files) { deps.push_back(in); } } @@ -168,8 +142,11 @@ bool TextTool::needs_run(const ToolInput& task) { } bool TextTool::run(const ToolInput& task) { - for (auto& [ver, in] : open_text_project("text", task.input.at(0))) { - compile_game_text(in, ver); + GameTextDB db; + std::unordered_map> inputs; + open_text_project("text", task.input.at(0), inputs); + for (auto& [ver, in] : inputs) { + compile_game_text(in, ver, db); } return true; } @@ -188,8 +165,10 @@ bool SubtitleTool::needs_run(const ToolInput& task) { } std::vector deps; - for (auto& [ver, inputs] : open_text_project("subtitle", task.input.at(0))) { - for (auto& in : inputs) { + std::unordered_map> inputs; + open_text_project("subtitle", task.input.at(0), inputs); + for (auto& [ver, files] : inputs) { + for (auto& in : files) { deps.push_back(in); } } @@ -197,8 +176,11 @@ bool SubtitleTool::needs_run(const ToolInput& task) { } bool SubtitleTool::run(const ToolInput& task) { - for (auto& [ver, in] : open_text_project("subtitle", task.input.at(0))) { - compile_game_subtitle(in, ver); + GameSubtitleDB db; + std::unordered_map> inputs; + open_text_project("subtitle", task.input.at(0), inputs); + for (auto& [ver, in] : inputs) { + compile_game_subtitle(in, ver, db); } return true; } diff --git a/goalc/make/Tools.h b/goalc/make/Tools.h index f36df144f9..e6d61b2b04 100644 --- a/goalc/make/Tools.h +++ b/goalc/make/Tools.h @@ -2,7 +2,6 @@ #include "goalc/make/Tool.h" #include "common/goos/Reader.h" -#include "goalc/data_compiler/game_subtitle.h" class Compiler; diff --git a/test/goalc/test_with_game.cpp b/test/goalc/test_with_game.cpp index 32a43b1e24..1aae314f1e 100644 --- a/test/goalc/test_with_game.cpp +++ b/test/goalc/test_with_game.cpp @@ -30,7 +30,7 @@ class WithGameTests : public ::testing::Test { shared_compiler->compiler.run_test_no_load( "test/goalc/source_templates/with_game/test-build-game.gc"); shared_compiler->compiler.run_front_end_on_string( - "(asm-text-file text 10 :files (\"test/test_data/test_game_text.txt\"))"); + "(asm-text-file text :files (\"test/test_data/test_game_text.gp\"))"); } catch (std::exception& e) { fprintf(stderr, "caught exception %s\n", e.what()); EXPECT_TRUE(false); diff --git a/test/test_data/test_game_text.gp b/test/test_data/test_game_text.gp new file mode 100644 index 0000000000..b3bef689af --- /dev/null +++ b/test/test_data/test_game_text.gp @@ -0,0 +1,2 @@ +(text + (jak1-v1 "test/test_data/test_game_text.txt")) \ No newline at end of file From 5842081e4608184c4d01b8f287c81fb6cd86a0d5 Mon Sep 17 00:00:00 2001 From: OpenGOALBot Date: Mon, 25 Apr 2022 16:22:36 +0000 Subject: [PATCH 2/6] Updating Controller Database --- game/assets/sdl_controller_db.txt | 88 +++++++++++++++---------------- 1 file changed, 44 insertions(+), 44 deletions(-) diff --git a/game/assets/sdl_controller_db.txt b/game/assets/sdl_controller_db.txt index 4e3bf7f5cd..8fc69f055d 100644 --- a/game/assets/sdl_controller_db.txt +++ b/game/assets/sdl_controller_db.txt @@ -29,12 +29,12 @@ 03000000c82d00000190000000000000,8BitDo N30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b4,y:b3,platform:Windows, 03000000c82d00001590000000000000,8BitDo N30 Pro 2,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a5,start:b11,x:b4,y:b3,platform:Windows, 03000000c82d00006528000000000000,8BitDo N30 Pro 2,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b4,y:b3,platform:Windows, -03000000c82d00000290000000000000,8Bitdo N64,+rightx:b9,+righty:b3,-rightx:b4,-righty:b8,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,lefttrigger:b10,leftx:a0,lefty:a1,rightshoulder:b7,start:b11,platform:Windows, -03000000c82d00003038000000000000,8Bitdo N64,+rightx:b9,+righty:b3,-rightx:b4,-righty:b8,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,lefttrigger:b10,leftx:a0,lefty:a1,rightshoulder:b7,start:b11,platform:Windows, +03000000c82d00000290000000000000,8BitDo N64,+rightx:b9,+righty:b3,-rightx:b4,-righty:b8,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,lefttrigger:b10,leftx:a0,lefty:a1,rightshoulder:b7,start:b11,platform:Windows, +03000000c82d00003038000000000000,8BitDo N64,+rightx:b9,+righty:b3,-rightx:b4,-righty:b8,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,lefttrigger:b10,leftx:a0,lefty:a1,rightshoulder:b7,start:b11,platform:Windows, 03000000c82d000012ab000000000000,8BitDo NES30,a:b1,b:b0,back:b10,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b11,x:b4,y:b3,platform:Windows, -03000000022000000090000000000000,8Bitdo NES30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b4,y:b3,platform:Windows, -03000000203800000900000000000000,8Bitdo NES30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b4,y:b3,platform:Windows, -03000000c82d00002038000000000000,8Bitdo NES30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b4,y:b3,platform:Windows, +03000000022000000090000000000000,8BitDo NES30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b4,y:b3,platform:Windows, +03000000203800000900000000000000,8BitDo NES30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b4,y:b3,platform:Windows, +03000000c82d00002038000000000000,8BitDo NES30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b4,y:b3,platform:Windows, 03000000c82d00000751000000000000,8BitDo P30,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:b9,start:b11,x:b3,y:b4,platform:Windows, 03000000c82d00000360000000000000,8BitDo Pro 2,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b4,y:b3,platform:Windows, 03000000c82d00000361000000000000,8BitDo Pro 2,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b4,y:b3,platform:Windows, @@ -45,11 +45,11 @@ 03000000c82d00000431000000000000,8BitDo Receiver,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b4,y:b3,platform:Windows, 03000000c82d00002867000000000000,8BitDo S30 Modkit,a:b0,b:b1,dpdown:+a2,dpleft:-a0,dpright:+a0,dpup:-a2,leftshoulder:b8,lefttrigger:b9,rightshoulder:b6,righttrigger:b7,start:b11,x:b3,y:b4,platform:Windows, 03000000c82d00000130000000000000,8BitDo SF30,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a5,start:b11,x:b4,y:b3,platform:Windows, -03000000c82d00000060000000000000,8Bitdo SF30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Windows, -03000000c82d00000061000000000000,8Bitdo SF30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Windows, -03000000102800000900000000000000,8Bitdo SFC30,a:b1,b:b0,back:b10,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b11,x:b4,y:b3,platform:Windows, +03000000c82d00000060000000000000,8BitDo SF30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Windows, +03000000c82d00000061000000000000,8BitDo SF30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Windows, +03000000102800000900000000000000,8BitDo SFC30,a:b1,b:b0,back:b10,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b11,x:b4,y:b3,platform:Windows, 03000000c82d000021ab000000000000,8BitDo SFC30,a:b1,b:b0,back:b10,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b11,x:b4,y:b3,platform:Windows, -03000000c82d00003028000000000000,8Bitdo SFC30,a:b1,b:b0,back:b10,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b11,x:b4,y:b3,platform:Windows, +03000000c82d00003028000000000000,8BitDo SFC30,a:b1,b:b0,back:b10,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b11,x:b4,y:b3,platform:Windows, 03000000c82d00000030000000000000,8BitDo SN30,a:b1,b:b0,back:b10,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b11,x:b4,y:b3,platform:Windows, 03000000c82d00001290000000000000,8BitDo SN30,a:b1,b:b0,back:b10,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b6,rightshoulder:b7,start:b11,x:b4,y:b3,platform:Windows, 03000000c82d000020ab000000000000,8BitDo SN30,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a5,start:b11,x:b4,y:b3,platform:Windows, @@ -62,22 +62,22 @@ 03000000c82d00000121000000000000,8BitDo SN30 Pro for Android,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b3,y:b4,platform:Windows, 03000000c82d00000260000000000000,8BitDo SN30 Pro+,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Windows, 03000000c82d00000261000000000000,8BitDo SN30 Pro+,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Windows, -03000000a00500003232000000000000,8Bitdo Zero,a:b0,b:b1,back:b10,dpdown:+a2,dpleft:-a0,dpright:+a0,dpup:-a2,leftshoulder:b6,rightshoulder:b7,start:b11,x:b3,y:b4,platform:Windows, +03000000a00500003232000000000000,8BitDo Zero,a:b0,b:b1,back:b10,dpdown:+a2,dpleft:-a0,dpright:+a0,dpup:-a2,leftshoulder:b6,rightshoulder:b7,start:b11,x:b3,y:b4,platform:Windows, 03000000c82d00001890000000000000,8BitDo Zero 2,a:b1,b:b0,back:b10,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b11,x:b4,y:b3,platform:Windows, 03000000c82d00003032000000000000,8BitDo Zero 2,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Windows, -03000000d81d00000e00000000000000,AC02,a:b0,b:b1,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b10,lefttrigger:b7,leftx:a0,lefty:a1,rightshoulder:b2,rightstick:b11,righttrigger:b3,rightx:a2,righty:a5,start:b8,x:b4,y:b5,platform:Windows, +03000000d81d00000e00000000000000,iBuffalo AC02 Arcade Joystick,a:b0,b:b1,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b10,lefttrigger:b7,leftx:a0,lefty:a1,rightshoulder:b2,rightstick:b11,righttrigger:b3,rightx:a2,righty:a5,start:b8,x:b4,y:b5,platform:Windows, 030000008f0e00001200000000000000,Acme GA02,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b11,righttrigger:b7,rightx:a3,righty:a2,start:b9,x:b2,y:b3,platform:Windows, 03000000c01100000355000000000000,Acrux,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, 03000000fa190000f0ff000000000000,Acteck AGJ 3200,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows, 030000006d0400000bc2000000000000,Action,a:b0,b:b1,back:b2,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b8,lefttrigger:a5~,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b5,righttrigger:a2~,start:b8,x:b3,y:b4,platform:Windows, 03000000d1180000402c000000000000,ADT1,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a3,rightx:a2,righty:a5,x:b3,y:b4,platform:Windows, -030000006f0e00001301000000000000,Afterglow,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows, -030000006f0e00001302000000000000,Afterglow,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows, -030000006f0e00001304000000000000,Afterglow,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows, -030000006f0e00001413000000000000,Afterglow,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, -030000006f0e00003901000000000000,Afterglow,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows, -03000000ab1200000103000000000000,Afterglow,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a2,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows, -03000000ad1b000000f9000000000000,Afterglow,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:b10,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:b11,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows, +030000006f0e00001301000000000000,Afterglow Xbox Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows, +030000006f0e00001302000000000000,Afterglow Xbox Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows, +030000006f0e00001304000000000000,Afterglow Xbox Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows, +030000006f0e00001413000000000000,Afterglow Xbox Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +030000006f0e00003901000000000000,Afterglow Xbox Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows, +03000000ab1200000103000000000000,Afterglow Xbox Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a2,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows, +03000000ad1b000000f9000000000000,Afterglow Xbox Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:b10,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:b11,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows, 03000000341a00003608000000000000,Afterglow PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, 030000006f0e00000263000000000000,Afterglow PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, 030000006f0e00001101000000000000,Afterglow PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, @@ -164,8 +164,8 @@ 03000000101c0000181c000000000000,Essential,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b4,leftx:a1,lefty:a0,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a3,righty:a2,start:b9,x:b3,y:b0,platform:Windows, 030000008f0e00000f31000000000000,EXEQ,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b2,platform:Windows, 03000000341a00000108000000000000,EXEQ RF Gamepad,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Windows, -03000000790000003018000000000000,F300,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Windows, -03000000242f00003900000000000000,F300 Elite,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows, +03000000790000003018000000000000,Mayflash F300 Arcade Joystick,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Windows, +03000000242f00003900000000000000,Mayflash F300 Elite Arcade Joystick,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows, 030000006f0e00008401000000000000,Faceoff Deluxe Nintendo Switch Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, 030000006f0e00008001000000000000,Faceoff Pro Nintendo Switch Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, 03000000021000000090000000000000,FC30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b8,leftstick:b13,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b9,rightstick:b14,righttrigger:b7,rightx:a3,righty:a4,start:b11,x:b4,y:b3,platform:Windows, @@ -732,24 +732,24 @@ xinput,XInput Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2, 030000003512000012ab000001000000,8BitDo NES30,a:b1,b:b0,back:b10,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b6,rightshoulder:b7,start:b11,x:b4,y:b3,platform:Mac OS X, 03000000c82d000012ab000001000000,8BitDo NES30,a:b0,b:b1,back:b10,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b6,rightshoulder:b7,start:b11,x:b3,y:b4,platform:Mac OS X, 03000000c82d00002028000000010000,8BitDo NES30,a:b0,b:b1,back:b10,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b6,rightshoulder:b7,start:b11,x:b3,y:b4,platform:Mac OS X, -03000000022000000090000001000000,8Bitdo NES30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Mac OS X, -03000000203800000900000000010000,8Bitdo NES30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Mac OS X, -03000000c82d00000190000001000000,8Bitdo NES30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Mac OS X, +03000000022000000090000001000000,8BitDo NES30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Mac OS X, +03000000203800000900000000010000,8BitDo NES30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Mac OS X, +03000000c82d00000190000001000000,8BitDo NES30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Mac OS X, 03000000c82d00000660000000010000,8BitDo Pro 2,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Mac OS X, 03000000c82d00000660000000020000,8BitDo Pro 2,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Mac OS X, 03000000c82d00000131000001000000,8BitDo Receiver,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Mac OS X, 03000000c82d00000231000001000000,8BitDo Receiver,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Mac OS X, 03000000c82d00000331000001000000,8BitDo Receiver,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Mac OS X, 03000000c82d00000431000001000000,8BitDo Receiver,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Mac OS X, -03000000102800000900000000000000,8Bitdo SFC30 Joystick,a:b1,b:b0,back:b10,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b11,x:b4,y:b3,platform:Mac OS X, +03000000102800000900000000000000,8BitDo SFC30 Joystick,a:b1,b:b0,back:b10,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b11,x:b4,y:b3,platform:Mac OS X, 03000000c82d00001290000001000000,8BitDo SN30,a:b1,b:b0,back:b10,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b11,x:b4,y:b3,platform:Mac OS X, -03000000c82d00004028000000010000,8Bitdo SN30,a:b1,b:b0,back:b10,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b6,rightshoulder:b7,start:b11,x:b4,y:b3,platform:Mac OS X, +03000000c82d00004028000000010000,8BitDo SN30,a:b1,b:b0,back:b10,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b6,rightshoulder:b7,start:b11,x:b4,y:b3,platform:Mac OS X, 03000000c82d00000160000001000000,8BitDo SN30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a5,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Mac OS X, 03000000c82d00000161000000010000,8BitDo SN30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a5,start:b11,x:b4,y:b3,platform:Mac OS X, 03000000c82d00000260000001000000,8BitDo SN30 Pro+,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Mac OS X, 03000000c82d00000261000000010000,8BitDo SN30 Pro+,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Mac OS X, -03000000a00500003232000008010000,8Bitdo Zero,a:b0,b:b1,back:b10,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b6,rightshoulder:b7,start:b11,x:b3,y:b4,platform:Mac OS X, -03000000a00500003232000009010000,8Bitdo Zero,a:b0,b:b1,back:b10,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b6,rightshoulder:b7,start:b11,x:b3,y:b4,platform:Mac OS X, +03000000a00500003232000008010000,8BitDo Zero,a:b0,b:b1,back:b10,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b6,rightshoulder:b7,start:b11,x:b3,y:b4,platform:Mac OS X, +03000000a00500003232000009010000,8BitDo Zero,a:b0,b:b1,back:b10,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b6,rightshoulder:b7,start:b11,x:b3,y:b4,platform:Mac OS X, 03000000c82d00001890000001000000,8BitDo Zero 2,a:b1,b:b0,back:b10,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b11,x:b4,y:b3,platform:Mac OS X, 03000000c82d00003032000000010000,8BitDo Zero 2,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,rightx:a2,righty:a31,start:b11,x:b4,y:b3,platform:Mac OS X, 03000000491900001904000001010000,Amazon Luna Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,misc1:b9,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b7,x:b2,y:b3,platform:Mac OS X, @@ -811,7 +811,7 @@ xinput,XInput Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2, 03000000380700008483000000010000,Mad Catz PS4 Fightstick TE S+,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Mac OS X, 03000000790000000600000007010000,Marvo GT-004,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Mac OS X, 03000000790000004418000000010000,Mayflash GameCube Controller,a:b1,b:b2,dpdown:b14,dpleft:b15,dpright:b13,dpup:b12,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:a4,rightx:a5,righty:a2,start:b9,x:b0,y:b3,platform:Mac OS X, -03000000790000004318000000010000,MayFlash GameCube Adapter,a:b4,b:b0,x:b8,y:b12,start:b36,rightshoulder:b28,dpup:h0.1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,leftx:a0,lefty:a4,rightx:a20,righty:a8,lefttrigger:a12,righttrigger:a16,platform:Mac OS X, +03000000790000004318000000010000,Mayflash GameCube Adapter,a:b4,b:b0,x:b8,y:b12,start:b36,rightshoulder:b28,dpup:h0.1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,leftx:a0,lefty:a4,rightx:a20,righty:a8,lefttrigger:a12,righttrigger:a16,platform:Mac OS X, 03000000242f00007300000000020000,Mayflash Magic NS,a:b1,b:b4,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:b8,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b0,y:b3,platform:Mac OS X, 0300000079000000d218000026010000,Mayflash Magic NS,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Mac OS X, 03000000d620000010a7000003010000,Mayflash Magic NS,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Mac OS X, @@ -868,7 +868,7 @@ xinput,XInput Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2, 03000000b40400000a01000000000000,Sega Saturn,a:b0,b:b1,back:b5,guide:b2,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b8,x:b3,y:b4,platform:Mac OS X, 030000003512000021ab000000000000,SFC30 Joystick,a:b1,b:b0,back:b10,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b11,x:b4,y:b3,platform:Mac OS X, 0300000000f00000f100000000000000,SNES RetroPort,a:b2,b:b3,back:b4,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b5,rightshoulder:b7,start:b6,x:b0,y:b1,platform:Mac OS X, -030000004c050000e60c000000010000,Sony DualSense,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Mac OS X, +030000004c050000e60c000000010000,PS5 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Mac OS X, 030000004c050000a00b000000000000,Sony DualShock 4 Adapter,a:b1,b:b2,back:b13,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Mac OS X, 030000004c050000cc09000000000000,Sony DualShock 4 V2,a:b1,b:b2,back:b13,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Mac OS X, 03000000d11800000094000000010000,Stadia Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a4,rightx:a2,righty:a3,start:b7,x:b2,y:b3,platform:Mac OS X, @@ -920,7 +920,7 @@ xinput,XInput Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2, 03000000c82d00000031000011010000,8BitDo Adapter,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux, 03000000021000000090000011010000,8BitDo FC30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Linux, 03000000c82d00000090000011010000,8BitDo FC30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a5,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Linux, -05000000c82d00001038000000010000,8Bitdo FC30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Linux, +05000000c82d00001038000000010000,8BitDo FC30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Linux, 03000000c82d00000650000011010000,8BitDo M30,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:b9,start:b11,x:b3,y:b4,platform:Linux, 05000000c82d00005106000000010000,8BitDo M30,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b8,lefttrigger:b9,leftx:a0,lefty:a1,rightshoulder:b6,righttrigger:b7,start:b11,x:b3,y:b4,platform:Linux, 03000000c82d00001590000011010000,8BitDo N30 Pro 2,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Linux, @@ -928,10 +928,10 @@ xinput,XInput Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2, 03000000008000000210000011010000,8BitDo NES30,a:b1,b:b2,back:b8,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Linux, 03000000c82d00000310000011010000,8BitDo NES30,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b7,lefttrigger:b6,rightshoulder:b9,righttrigger:b8,start:b11,x:b3,y:b4,platform:Linux, 05000000c82d00008010000000010000,8BitDo NES30,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b7,lefttrigger:b6,rightshoulder:b9,righttrigger:b8,start:b11,x:b3,y:b4,platform:Linux, -03000000022000000090000011010000,8Bitdo NES30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Linux, -03000000c82d00000190000011010000,8Bitdo NES30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a5,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Linux, -05000000203800000900000000010000,8Bitdo NES30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Linux, -05000000c82d00002038000000010000,8Bitdo NES30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Linux, +03000000022000000090000011010000,8BitDo NES30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Linux, +03000000c82d00000190000011010000,8BitDo NES30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a5,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Linux, +05000000203800000900000000010000,8BitDo NES30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Linux, +05000000c82d00002038000000010000,8BitDo NES30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Linux, 03000000c82d00000660000011010000,8BitDo Pro 2,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Linux, 05000000c82d00000660000000010000,8BitDo Pro 2,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Linux, 03000000c82d00000131000011010000,8BitDo Receiver,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Linux, @@ -939,12 +939,12 @@ xinput,XInput Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2, 03000000c82d00000331000011010000,8BitDo Receiver,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Linux, 03000000c82d00000431000011010000,8BitDo Receiver,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Linux, 05000000c82d00000060000000010000,8BitDo SF30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Linux, -05000000c82d00000061000000010000,8Bitdo SF30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Linux, -030000003512000012ab000010010000,8Bitdo SFC30,a:b2,b:b1,back:b6,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b4,rightshoulder:b5,start:b7,x:b3,y:b0,platform:Linux, +05000000c82d00000061000000010000,8BitDo SF30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Linux, +030000003512000012ab000010010000,8BitDo SFC30,a:b2,b:b1,back:b6,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b4,rightshoulder:b5,start:b7,x:b3,y:b0,platform:Linux, 030000003512000021ab000010010000,8BitDo SFC30,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b11,x:b4,y:b3,platform:Linux, 03000000c82d000021ab000010010000,8BitDo SFC30,a:b1,b:b0,back:b10,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b11,x:b4,y:b3,platform:Linux, -05000000102800000900000000010000,8Bitdo SFC30,a:b1,b:b0,back:b10,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b11,x:b4,y:b3,platform:Linux, -05000000c82d00003028000000010000,8Bitdo SFC30,a:b1,b:b0,back:b10,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b11,x:b4,y:b3,platform:Linux, +05000000102800000900000000010000,8BitDo SFC30,a:b1,b:b0,back:b10,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b11,x:b4,y:b3,platform:Linux, +05000000c82d00003028000000010000,8BitDo SFC30,a:b1,b:b0,back:b10,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b11,x:b4,y:b3,platform:Linux, 03000000c82d00000160000000000000,8BitDo SN30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b4,y:b3,platform:Linux, 03000000c82d00000160000011010000,8BitDo SN30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Linux, 03000000c82d00000161000000000000,8BitDo SN30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b4,y:b3,platform:Linux, @@ -954,8 +954,8 @@ xinput,XInput Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2, 03000000c82d00000260000011010000,8BitDo SN30 Pro+,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Linux, 05000000c82d00000261000000010000,8BitDo SN30 Pro+,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Linux, 05000000202800000900000000010000,8BitDo SNES30,a:b1,b:b0,back:b10,dpdown:b122,dpleft:b119,dpright:b120,dpup:b117,leftshoulder:b6,rightshoulder:b7,start:b11,x:b4,y:b3,platform:Linux, -05000000a00500003232000001000000,8Bitdo Zero,a:b0,b:b1,back:b10,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b11,x:b3,y:b4,platform:Linux, -05000000a00500003232000008010000,8Bitdo Zero,a:b0,b:b1,back:b10,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b6,rightshoulder:b7,start:b11,x:b3,y:b4,platform:Linux, +05000000a00500003232000001000000,8BitDo Zero,a:b0,b:b1,back:b10,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b11,x:b3,y:b4,platform:Linux, +05000000a00500003232000008010000,8BitDo Zero,a:b0,b:b1,back:b10,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b6,rightshoulder:b7,start:b11,x:b3,y:b4,platform:Linux, 03000000c82d00001890000011010000,8BitDo Zero 2,a:b1,b:b0,back:b10,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b11,x:b4,y:b3,platform:Linux, 050000005e040000e002000030110000,8BitDo Zero 2,a:b0,b:b1,back:b6,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b4,rightshoulder:b5,start:b7,x:b2,y:b3,platform:Linux, 05000000c82d00003032000000010000,8BitDo Zero 2,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Linux, @@ -1292,8 +1292,8 @@ xinput,XInput Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2, 03000000bc2000000055000010010000,Shanwan PS3 PC ,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux, 030000005f140000c501000010010000,Shanwan Trust,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Linux, 03000000341a00000908000010010000,SL6566,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Linux, -030000004c050000e60c000011810000,Sony DualSense,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b11,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b12,righttrigger:a5,rightx:a3,righty:a4,start:b9,x:b3,y:b2,platform:Linux, -050000004c050000e60c000000810000,Sony DualSense,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b11,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b12,righttrigger:a5,rightx:a3,righty:a4,start:b9,x:b3,y:b2,platform:Linux, +030000004c050000e60c000011810000,PS5 Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b11,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b12,righttrigger:a5,rightx:a3,righty:a4,start:b9,x:b3,y:b2,platform:Linux, +050000004c050000e60c000000810000,PS5 Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b11,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b12,righttrigger:a5,rightx:a3,righty:a4,start:b9,x:b3,y:b2,platform:Linux, 050000004c050000cc09000001000000,Sony DualShock 4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux, 03000000ff000000cb01000010010000,Sony PlayStation Portable,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftx:a0,lefty:a1,rightshoulder:b5,start:b7,x:b2,y:b3,platform:Linux, 03000000250900000500000000010000,Sony PS2 pad with SmartJoy Adapter,a:b2,b:b1,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a2,righty:a3,start:b8,x:b3,y:b0,platform:Linux, @@ -1564,8 +1564,8 @@ xinput,XInput Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2, 38376662666661636265313264613039,SNES,a:b0,b:b1,back:b9,leftshoulder:b3,leftx:a0,lefty:a1,rightshoulder:b20,start:b10,x:b19,y:b2,platform:Android, 5346432f555342205061640000000000,SNES Adapter,a:b0,b:b1,back:b9,leftshoulder:b3,leftx:a0,lefty:a1,rightshoulder:b20,start:b10,x:b19,y:b2,platform:Android, 5553422047616d657061642000000000,SNES Controller,a:b1,b:b0,back:b15,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b9,rightshoulder:b10,start:b6,x:b3,y:b2,platform:Android, -32633532643734376632656664383733,Sony DualSense,a:b1,b:b19,back:b17,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b3,leftstick:b15,lefttrigger:b9,leftx:a0,lefty:a1,rightshoulder:b20,rightstick:b6,righttrigger:b10,rightx:a2,righty:a5,start:b18,x:b0,y:b2,platform:Android, -61303162353165316365336436343139,Sony DualSense,a:b1,b:b19,back:b17,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b3,leftstick:b15,lefttrigger:b9,leftx:a0,lefty:a1,rightshoulder:b20,rightstick:b6,righttrigger:b10,rightx:a2,righty:a5,start:b18,x:b0,y:b2,platform:Android, +32633532643734376632656664383733,PS5 Controller,a:b1,b:b19,back:b17,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b3,leftstick:b15,lefttrigger:b9,leftx:a0,lefty:a1,rightshoulder:b20,rightstick:b6,righttrigger:b10,rightx:a2,righty:a5,start:b18,x:b0,y:b2,platform:Android, +61303162353165316365336436343139,PS5 Controller,a:b1,b:b19,back:b17,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b3,leftstick:b15,lefttrigger:b9,leftx:a0,lefty:a1,rightshoulder:b20,rightstick:b6,righttrigger:b10,rightx:a2,righty:a5,start:b18,x:b0,y:b2,platform:Android, 63303964303462366136616266653561,Sony PSP,a:b21,b:b22,back:b27,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b25,leftx:a0,lefty:a1,rightshoulder:b26,start:b28,x:b23,y:b24,platform:Android, 63376637643462343766333462383235,Sony Vita,a:b1,b:b19,back:b17,leftshoulder:b3,leftx:a0,lefty:a1,rightshoulder:b20,rightx:a3,righty:a4,start:b18,x:b0,y:b2,platform:Android, 476f6f676c65204c4c43205374616469,Stadia Controller,a:b0,b:b1,back:b15,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b5,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android, From 1bede6954db34506a0e23154c9af1d8e05d7fe55 Mon Sep 17 00:00:00 2001 From: ManDude <7569514+ManDude@users.noreply.github.com> Date: Tue, 26 Apr 2022 01:01:39 +0100 Subject: [PATCH 3/6] ambient & hint subtitles and subtitles for `citadel` + `training` (#1337) * hint & ambient subtitle support + `training` & `village1` subs * update refs * Update game_subtitle_en.gs * Update game_subtitle_en.gs * update source * more subtitles * Update game_subtitle_en.gs * Update game_subtitle_en.gs * tests * typo. --- decompiler/config/all-types.gc | 27 +- game/assets/jak1/subtitle/game_subtitle_en.gs | 378 +++++++++++++++--- goal_src/build/all_files.gc | 2 +- goal_src/dgos/engine.gd | 2 +- goal_src/dgos/game.gd | 2 +- goal_src/engine/ambient/ambient.gc | 3 + goal_src/engine/camera/pov-camera-h.gc | 18 +- goal_src/engine/camera/pov-camera.gc | 4 +- goal_src/engine/game/generic-obs-h.gc | 30 +- goal_src/engine/game/generic-obs.gc | 4 +- goal_src/engine/game/task/process-taskable.gc | 9 +- goal_src/engine/ui/text-h.gc | 8 +- goal_src/game.gp | 2 +- goal_src/pc/subtitle.gc | 148 +++++-- goalc/data_compiler/game_text_common.cpp | 51 ++- goalc/data_compiler/game_text_common.h | 16 +- .../reference/engine/ambient/ambient_REF.gc | 10 +- .../reference/engine/camera/cam-layout_REF.gc | 2 +- .../reference/engine/camera/cam-states_REF.gc | 2 +- .../reference/engine/camera/cam-update_REF.gc | 2 +- .../engine/camera/pov-camera-h_REF.gc | 2 +- .../reference/engine/camera/pov-camera_REF.gc | 4 +- .../engine/collide/collide-mesh_REF.gc | 6 +- .../engine/collide/main-collide_REF.gc | 6 +- .../reference/engine/debug/anim-tester_REF.gc | 38 +- .../reference/engine/debug/debug_REF.gc | 4 +- .../reference/engine/debug/menu_REF.gc | 12 +- .../reference/engine/debug/part-tester_REF.gc | 2 +- .../reference/engine/draw/drawable_REF.gc | 20 +- .../engine/draw/process-drawable_REF.gc | 2 +- .../reference/engine/entity/entity_REF.gc | 40 +- .../reference/engine/game/game-info_REF.gc | 10 +- .../engine/game/generic-obs-h_REF.gc | 30 +- .../reference/engine/game/generic-obs_REF.gc | 4 +- .../reference/engine/game/main_REF.gc | 12 +- .../engine/game/task/process-taskable_REF.gc | 8 +- .../reference/engine/geometry/vol_REF.gc | 2 +- .../reference/engine/gfx/ripple_REF.gc | 2 +- .../engine/gfx/tfrag/tfrag-methods_REF.gc | 2 +- .../engine/level/load-boundary_REF.gc | 6 +- .../reference/engine/nav/navigate_REF.gc | 34 +- .../reference/engine/nav/path_REF.gc | 8 +- .../engine/physics/trajectory_REF.gc | 2 +- .../sparticle/sparticle-launcher_REF.gc | 8 +- .../engine/target/joint-mod-h_REF.gc | 6 +- .../engine/target/logic-target_REF.gc | 44 +- .../reference/engine/target/sidekick_REF.gc | 6 +- .../engine/target/target-util_REF.gc | 8 +- .../reference/engine/ui/hud-classes_REF.gc | 10 +- .../engine/ui/progress/progress-draw_REF.gc | 4 +- .../engine/ui/progress/progress_REF.gc | 8 +- .../reference/engine/ui/text_REF.gc | 10 +- .../reference/levels/common/ropebridge_REF.gc | 2 +- .../reference/levels/jungle/fisher_REF.gc | 2 +- .../reference/levels/misty/mistycannon_REF.gc | 2 +- .../reference/levels/ogre/ogreboss_REF.gc | 2 +- .../levels/racer_common/target-racer_REF.gc | 10 +- .../levels/sunken/target-tube_REF.gc | 12 +- .../levels/swamp/swamp-rat-nest_REF.gc | 2 +- .../levels/village1/fishermans-boat_REF.gc | 12 +- 60 files changed, 748 insertions(+), 376 deletions(-) diff --git a/decompiler/config/all-types.gc b/decompiler/config/all-types.gc index d2c4169016..c1a3065734 100644 --- a/decompiler/config/all-types.gc +++ b/decompiler/config/all-types.gc @@ -1039,13 +1039,16 @@ (misty-daxter-hit-lurkers-not-mines #x27f) (sidekick-speech-hint-crate-darkeco1 #x281) + (sidekick-speech-crate-steel-break1 #x283) (sidekick-speech-hint-crate-iron #x284) (sidekick-speech-hint-crate-steel #x285) + (beach-collectors-unblocked #x288) + (jungleb-eco-vents-opened #x289) (misty-stopped-lurkers-at-silo #x28a) (misty-stopped-balloon-lurkers #x28b) - (jungleb-eco-vents-opened #x289) + (sidekick-speech-crate-steel-break2 #x28e) (sidekick-speech-hint-crate-darkeco2 #x28f) @@ -1064,13 +1067,10 @@ (misty-teetertotter-bonk-dax-tutorial #x2a4) (sidekick-hint-misty-get-red-eco #x2a5) - (red-eco-tutorial #x2a6) - (daxter-blue-eco-plat-tutorial #x2a7) (fish? #x2a9) - (misty-bone-bridge-hint #x2aa) (beach-grottopole-increment #x2af) @@ -10549,7 +10549,6 @@ ;; - Types -;; NOTE - root can also be a collide-shape (declare-type joint-mod basic) (deftype manipy (process-drawable) ((new-trans-hook (function none) :offset-assert 176) ;; TODO - no idea on these types @@ -10622,9 +10621,9 @@ (grab-target handle :offset 120) (grab-event symbol :offset-assert 128) (release-event symbol :offset-assert 132) - (old-global-mask uint32 :offset-assert 136) - (old-self-mask uint32 :offset-assert 140) - (old-parent-mask uint32 :offset-assert 144) + (old-global-mask process-mask :offset-assert 136) + (old-self-mask process-mask :offset-assert 140) + (old-parent-mask process-mask :offset-assert 144) (look-at-target handle :offset-assert 152) (pov-target handle :offset-assert 160) (work-process handle :offset-assert 168) @@ -10634,7 +10633,7 @@ (userdata basic :offset-assert 196) (message basic :offset-assert 200) (border-value basic :offset-assert 204) - (mask-to-clear uint32 :offset-assert 208) + (mask-to-clear process-mask :offset-assert 208) (script pair :offset-assert 212) (script-line pair :offset-assert 216) (script-func (function none) :offset-assert 220) ;; TODO - unconfirmed, see generic-obs::lambda::33 @@ -10704,16 +10703,16 @@ (deftype othercam (process) ((hand handle :offset-assert 112) - (old-global-mask uint32 :offset-assert 120) - (mask-to-clear uint32 :offset-assert 124) + (old-global-mask process-mask :offset-assert 120) + (mask-to-clear process-mask :offset-assert 124) (cam-joint-index int32 :offset-assert 128) (old-pos vector :inline :offset-assert 144) (old-mat-z vector :inline :offset-assert 160) (had-valid-frame basic :offset-assert 176) (border-value basic :offset-assert 180) - (die? symbol :offset-assert 184) + (die? symbol :offset-assert 184) (survive-anim-end? symbol :offset-assert 188) - (spooling? symbol :offset-assert 192) + (spooling? symbol :offset-assert 192) ) :heap-base #x60 :method-count-assert 14 @@ -10757,7 +10756,7 @@ (notify-handle handle :offset-assert 192) (anim-name string :offset-assert 200) (command-list pair :offset-assert 204) - (mask-to-clear uint32 :offset-assert 208) + (mask-to-clear process-mask :offset-assert 208) (music-volume-movie float :offset-assert 212) (sfx-volume-movie float :offset-assert 216) ) diff --git a/game/assets/jak1/subtitle/game_subtitle_en.gs b/game/assets/jak1/subtitle/game_subtitle_en.gs index 119193de2f..f5b4076fba 100644 --- a/game/assets/jak1/subtitle/game_subtitle_en.gs +++ b/game/assets/jak1/subtitle/game_subtitle_en.gs @@ -4,22 +4,26 @@ ;; intro ("sage-intro-sequence-a" - (24 "SAGE" "I HAVE SPENT MY LIFE SEARCHING FOR THE ANSWERS THAT MY FATHER, AND MY FATHER'S FATHERS FAILED TO FIND.") - (260 "SAGE" "WHO WERE THE PRECURSORS? WHY DID THEY CREATE THE VAST MONOLITHS THAT LITHER OUR PLANET?") - (454 "SAGE" "HOW DID THEY HARNESS ECO, THE LIFE ENERGY OF THE WORLD? WHAT WAS THEIR PURPOSE? AND WHY DID THEY VANISH?") + (24 :offscreen "SAGE" "I HAVE SPENT MY LIFE SEARCHING FOR THE ANSWERS THAT MY FATHER, AND MY FATHER'S FATHERS FAILED TO FIND.") + (260 :offscreen "SAGE" "WHO WERE THE PRECURSORS? WHY DID THEY CREATE THE VAST MONOLITHS THAT LITHER OUR PLANET?") + (454 :offscreen "SAGE" "HOW DID THEY HARNESS ECO, THE LIFE ENERGY OF THE WORLD?") + (581 :offscreen "SAGE" "WHAT WAS THEIR PURPOSE? AND WHY DID THEY VANISH?") (708) - (720 "SAGE" "I HAVE ASKED THE PLANTS, BUT THEY DO NOT REMEMBER.") - (818 "SAGE" "THE PLANTS HAVE ASKED THE ROCKS, BUT THE ROCKS DO NOT RECALL.") - (957 "SAGE" "EVEN THE ROCKS DO NOT RECALL...") + (720 :offscreen "SAGE" "I HAVE ASKED THE PLANTS, BUT THEY DO NOT REMEMBER.") + (818 :offscreen "SAGE" "THE PLANTS HAVE ASKED THE ROCKS, BUT THE ROCKS DO NOT RECALL.") + (955 :offscreen "SAGE" "EVEN THE ROCKS DO NOT RECALL...") (1064) - (1090 "SAGE" "EVERY BONE IN MY BODY TELLS ME THAT THE ANSWERS REST ON THE SHOULDERS OF A YOUNG BOY") - (1297 "SAGE" "OBLIVIOUS TO HIS DESTINY, UNINTERESTED IN THE SEARCH FOR TRUTH, AND REJECTING OF MY GUIDANCE!") - (1545 "SAGE" "AND WHY WOULD HE WANT TO LISTEN TO OLD SAMOS THE SAGE ANYWAY?") - (1689 "SAGE" "I'M ONLY THE MASTER OF GREEN ECO, ONE OF THE WISEST MEN ON THE PLANET!") + (1090 :offscreen "SAGE" "EVERY BONE IN MY BODY TELLS ME THAT THE ANSWERS REST ON THE SHOULDERS OF A YOUNG BOY") + (1297 :offscreen "SAGE" "OBLIVIOUS TO HIS DESTINY, UNINTERESTED IN THE SEARCH FOR TRUTH, AND REJECTING OF MY GUIDANCE!") + (1536) + (1545 :offscreen "SAGE" "AND WHY WOULD HE WANT TO LISTEN TO OLD SAMOS THE SAGE ANYWAY?") + (1680) + (1686 :offscreen "SAGE" "I'M ONLY THE MASTER OF GREEN ECO, ONE OF THE WISEST MEN ON THE PLANET!") (1875) - (1958 "SAGE" "SO IT SEEMS THE ANSWER BEGINS NOT WITH CAREFUL RESEARCH, OR SENSIBLE THINKING.") - (2145 "SAGE" "NAY! AS WITH MANY OF FATE'S MYSTERIES") - (2281 "SAGE" "IT BEGINS WITH BUT A SMALL ACT OF DISOBEDIENCE.") + (1958 :offscreen "SAGE" "SO IT SEEMS THE ANSWER BEGINS NOT WITH CAREFUL RESEARCH, OR SENSIBLE THINKING.") + (2141) + (2145 :offscreen "SAGE" "NAY! AS WITH MANY OF FATE'S MYSTERIES") + (2281 :offscreen "SAGE" "IT BEGINS WITH BUT A SMALL ACT OF DISOBEDIENCE.") (2440 "DAXTER" "HEY! UH, JAK? OL' GREEN STUFF TOLD US NOT TO COME HERE!") ) @@ -48,9 +52,9 @@ (1331 "DAXTER" "JAK, I THINK WE'RE IN TROUBLE!") (1386) (1857 "DAXTER" "MAN, THAT STUNG.") - (1919) - (1941 "DAXTER" "I TOLD YOU WE SHOULDN'T 'A' COME HERE, AND YOU LISTENED?") - (2034) + (1913) + (1941 "DAXTER" "I TOLD YOU WE SHOULDN'T HAVE COME HERE, AND YOU LISTENED?") + (2028) (2057 "DAXTER" "WHAAAT?") (2101) (2189 "DAXTER" "WAAAAAAAAHHHHHHHH!!") @@ -63,17 +67,18 @@ (137 "SAGE" "WHAT IN GREEN TARNATION DO YOU TWO WANT?") (220 "DAXTER" "WE- WE- WE WAS- THEY WAS- I'M- I WAS-") (283 "SAGE" "DON'T TELL ME! INSTEAD OF HEEDING MY WISDOM, THE TWO OF YOU WENT MUCKING AROUND") - (446 "SAGE" "IN THE ONLY PLACE THAT I TOLD YOU NOT TO GO: MISTY ISLAND!") + (440 "SAGE" "IN THE ONLY PLACE THAT I TOLD YOU NOT TO GO: MISTY ISLAND!") (550 "DAXTER" "THAT'S RIGHT! AND THEN-") - (579 "SAGE" "AND, DAXTER, YOU'VE FINALLY TOOK A MUCH-NEEDED BATH, BUT IN A BATHTUB FILLED WITH DARK ECO.") + (579 "SAGE" "AND, DAXTER, YOU FINALLY TOOK A MUCH-NEEDED BATH, BUT IN A BATHTUB FILLED WITH DARK ECO.") (793 "DAXTER" "LOOK, OLD MAN, ARE YOU GONNA KEEP YAPPIN', OR YOU GONNA HELP ME OUTTA THIS MESS!?") (920 "SAGE" "I'M GONNA KEEP YAPPIN'! BECAUSE IN MY PROFESSIONAL OPINION, THE CHANGE IS AN IMPROVEMENT.") (1079 "SAGE" "AND BESIDES... I COULDN'T HELP YOU IF I WANTED TO.") (1186 "DAXTER" "WHAT!?") - (1221 "SAGE" "THERE'S ONLY ONE PERSON WHO HAS STUDIED DARK ECO LONG ENOUGH") + (1220 "SAGE" "THERE'S ONLY ONE PERSON WHO HAS STUDIED DARK ECO LONG ENOUGH") (1329 "SAGE" "TO HAVE A CHANCE AT RETURNING YOU TO YOUR PREVIOUS FORM:") (1431 "SAGE" "GOL ACHERON, THE SAGE.") - (1496 "SAGE" "BUT HE LIVES FAR TO THE NORTH. FAR, FAR TO NORTH. NOBODY HAS SPOKEN TO HIM IN AGES.") + (1493) + (1496 :offscreen "SAGE" "BUT HE LIVES FAR TO THE NORTH. FAR, FAR TO NORTH. NOBODY HAS SPOKEN TO HIM IN AGES.") (1718 "SAGE" "I WOULD TELEPORT YOU THERE, BUT I CAN'T DO THAT EITHER.") (1831 "SAGE" "NONE OF THE THREE SAGES THAT MAINTAIN THE OTHER TELEPORTER GATES") (1934 "SAGE" "HAVE SEEN FIT TO TURN THEIR ENDS ON FOR QUITE A WHILE!") @@ -81,20 +86,23 @@ ("sage-intro-sequence-d2" (3 "SAGE" "THE ONLY OTHER WAY NORTH IS BY FOOT THROUGH THE FIRE CANYON") - (114 "SAGE" "BUT ITS VOLCANIC SOIL IS HOT ENOUGH TO MELT PRECURSOR METAL.") + (114 :offscreen "SAGE" "BUT ITS VOLCANIC SOIL IS HOT ENOUGH TO MELT PRECURSOR METAL.") (224 "SAGE" "YOU CAN'T JUST WALK THROUGH IT.") (270 "KEIRA" "BUT YOU COULD FLY OVER IT, IF YOU HAD A ZOOMER EQUIPPED WITH A HEAT SHIELD.") + (393) (396 "KEIRA" "I JUST HAPPEN TO BE WORKING ON SUCH A THING AT THIS VERY MOMENT.") + (512) (515 "KEIRA" "ALL I WOULD NEED IS TWENTY POWER CELLS TO GIVE IT ENOUGH ENERGY") (605 "KEIRA" "TO WITHSTAND THE CANYON'S HEAT. ISN'T THAT RIGHT, DADDY?") - (697) + (696) (699 "SAGE" "YES, KEIRA, THAT MIGHT WORK. BUT WHERE ARE A BOY") - (826 "SAGE" "AND A HALF!") + (826 :offscreen "SAGE" "AND A HALF!") (857 "SAGE" "GOING TO GET TWENTY POWER CELLS?") - (911 "KEIRA" "FROM THE VILLAGERS! MOST OF THEM HAVE A POWER CELL OR TWO STASHED AWAY SOMEWHERE.") - (1050 "KEIRA" "AND EVEN IF THEY AREN'T WILLING TO JUST GIVE THEM AWAY") + (910 "KEIRA" "FROM THE VILLAGERS! MOST OF THEM HAVE A POWER CELL OR TWO STASHED AWAY SOMEWHERE.") + (1050 :offscreen "KEIRA" "AND EVEN IF THEY AREN'T WILLING TO JUST GIVE THEM AWAY") (1133 "KEIRA" "GREASING THEIR PALMS WITH A FEW PRECURSOR ORBS SHOULD DO THE TRICK.") - (1249 "KEIRA" "AND I BET THERE ARE EVEN MORE OF THEM OUT IN THE WILDS JUST WAITING FOR SOME") + (1243) + (1246 :offscreen "KEIRA" "AND I BET THERE ARE EVEN MORE OF THEM OUT IN THE WILDS JUST WAITING FOR SOME") (1364 "KEIRA" "BRAVE ADVENTURER TO FIND.") (1435 "DAXTER" "WELL WE'VE GOT THE BRAVE ADVENTURER, AT LEAST.") (1529) @@ -104,12 +112,123 @@ (1689 "SAGE" "BEFORE YOU DO ANYTHING ELSE, YOU BETTER GO THROUGH THE WARP GATE AND GET") (1810 "SAGE" "SOME PRACTICE ON GEYSER ROCK.") (1872) - (1878 "DAXTER" "EHH, WE WON'T FIND ANY MORE OF THAT DARK-OO AND ECO STUFF, WILL WE?") + (1878 "DAXTER" "UH, WE WON'T FIND ANY MORE OF THAT DARK GOOEY ECO STUFF, WILL WE?") (1993 "DAXTER" "'CAUSE I'D HATE TO FALL IN AGAIN AND TURN INTO YOU!") + (2069) (2072 "SAGE" "GET IN THERE! BEFORE I TURN YOU BOTH INTO FERNS!") - (2192) + (2189) ) +("sage-intro-sequence-e" + (200 "SAGE" "GOOD TRAINING, BOYS, BUT THAT'S NOTHING COMPARED TO THE CHALLENGES THAT LIE AHEAD.") + (359 "DAXTER" "AH, THEY'RE NO PROBLEM. WE GOT THE MOVES, EH JAK?") + (496 "DAXTER" "WE'D LOVE TO STAY AND CHAT, BIG GREEN, BUT WE'RE UH... ITCHING TO GET ON WITH OUR ADVENTURES.") + (660 "SAGE" "FINE, FINE, \"ADVENTURE\" AWAY THEN.") + (787 "SAGE" "AND WHILE YOU'RE OUT \"ADVENTURING,\" WHY DON'T YOU MAKE YOURSELF USEFUL?") + (940) + (952 :offscreen "SAGE" "MY DARN GREEN ECO COLLECTORS ARE CLOGGED UP AGAIN.") + (1043) + (1046 :offscreen "SAGE" "HEAD OUT TO THE FAR SIDE OF THE BEACH AND CLEAR THEM OUT WHY DON'T YOU.") + (1160) + (1169 :offscreen "SAGE" "FOLLOW THE LAMPS, THEY'LL TAKE YOU RIGHT THERE.") + (1310) + (1313 :offscreen "SAGE" "NOW, ALL OF YOU...") + (1415) + (1439 :offscreen "SAGE" "GET OUT OF HERE!") + ) + + +;; ----------------- +;; sidekick + + +("sksp0014" :hint #x233 + (0 "DAXTER" "WE SCROUNGED ENOUGH ORBS TO TRADE FOR A POWER CELL.") + (215 "DAXTER" "LET'S GET BACK AND MAKE THE SWITCH ALREADY!") + ) +("sksp0009" :hint #x251 + (0 "DAXTER" "WHAT A WEIRD-LOOKING THING! I'LL BET WE CAN GET THIS OPEN") + (207 "DAXTER" "IF YOU'RE POWERED UP WITH THAT ZAPPY BLUE ECO STUFF.") + ) +("sksp0035" :hint #x25c + (0 "DAXTER" "YEAH, SO WE GOT A PRECURSOR LAUNCHER HERE") + (117 "DAXTER" "BUT YOU AREN'T POWERED UP WITH THE BLUE STUFF. SO IT AIN'T GONNA HELP US!") + ) +("sksp0001" :hint #x280 (0 "DAXTER" "HEY! THAT SWEET-LOOKING BABE KEIRA WAS RIGHT! THERE ARE TRANS-PADS OUT HERE.")) +("sksp0002" :hint #x281 (0 "DAXTER" "TRUST ME, THOSE DARK ECO BOXES ARE BAD NEWS!")) +("sksp0003" :hint #x282 + (0 "DAXTER" "I BET IF WE FOUND ALL OF THOSE SICKLY CUTE SCOUT FLIES ON EACH LEVEL") + (215 "DAXTER" "AT LEAST ONE WILL HAVE A POWER CELL!") + ) +("sksp0004" :hint #x283 (0 "DAXTER" "ALL RIGHT, TREASURE!")) +("sksp0005" :hint #x284 + (0 "DAXTER" "THESE WOOD AND METAL BOXES DON'T LOOK THAT TOUGH!") + (166 "DAXTER" "I'LL BET THEY'LL BREAK IF YOU JUMP DIVE ONTO THEM.") + ) +("sksp0006" :hint #x285 + (0 "DAXTER" "THOSE ALL-METAL BOXES ARE THICKER THAN A YAKOW SKULL!") + (188 "DAXTER" "BUT THERE MUST BE SOMETHING THAT CAN BUST 'EM OPEN.") + ) +("sksp0007" :hint #x286 (0 "DAXTER" "TWO WORDS: POWER CELLS. WE NEED TO FIND 'EM AND WE AREN'T LOOKIN' SO GOOD RIGHT NOW.")) +("sksp0008" :hint #x287 (0 "DAXTER" "WE NEED ORBS. ORBS, JAK! HOW ARE EVER GONNA BUY POWER CELLS IF WE DON'T COLLECT ORBS!")) +("sksp009a" :hint 0 (0 "DAXTER" "HA HA! WE SHOWED HIM A THING OR TWO.")) +("sksp009b" :hint #x28e (0 "DAXTER" "ALL RIGHT, MORE ORBS!")) +("sksp009c" :hint #x28f (0 "DAXTER" "DO ME A FAVOR AND KEEP AWAY FROM THOSE DARK ECO BOXES!")) +("sksp009d" :hint #x290 (0 "DAXTER" "YEAH-HA-HA-HA!")) +("sksp009e" :hint #x291 (0 "DAXTER" "WA-HOO!")) +("sksp009f" :hint #x292 (0 "DAXTER" "GET SOME, GET SOME! HA HA HA!")) +("sksp009g" :hint #x293 (0 "DAXTER" "RIGHT BEHIND YA, JAK!")) +("sksp009i" :hint #x294 (0 "DAXTER" "DID WE FIND ALL THE SCOUT FLIES IN THIS AREA?")) +("sksp009j" :hint #x295 (0 "DAXTER" "HEY! IT LOOKS LIKE SCOUT FLIES ARE ALWAYS IN RED BOXES.")) +("sksp009k" :hint #x296 (0 "DAXTER" "ALRIGHT! YOU FOUND ALL THE SCOUT FLIES IN THIS AREA!")) +("sksp0071" :hint #x2a5 (0 "DAXTER" "GET THE RED ECO!")) +("sksp0072" :hint #x2a6 (0 "DAXTER" "RED ECO MAKES YOUR ATTACKS STRONGER.")) +("sksp0073" :hint #x2a7 (0 "DAXTER" "WE NEED BLUE ECO TO CHARGE THIS PLATFORM UP!")) + +("sksp0145" :hint #x359 (0 "DAXTER" "WOW! YOU CAN SHOOT FIRE BALLS WHEN YOU'RE POWERED UP WITH YELLOW ECO.")) + + + +;; ----------------- +;; village1 + + +("SAGELP03" :hint 0 (0 "SAGE" "THESE TWO COULDN'T UNBLOCK THEIR EARS...")) +("SAGELP04" :hint 0 + (0 "SAGE" "HE'LL JUST NEVER BE LIKE HIS UNCLE...") + (221 "SAGE" "I DON'T CARE WHAT THE OTHERS SAY.") + ) +("SAGELP05" :hint 0 (0 "SAGE" "HELLO, BLUE SAGE? HELLO? WHERE IN THE BLUE BLAZES COULD HE BE...")) +("SAGELP06" :hint 0 (0 "SAGE" "MY, MY, MY...")) +("SAGELP11" :hint 0 (0 "SAGE" "ANYONE? ANYONE AT ALL? COME IN?")) +("ASSTLP01" :hint 0 (0 "KEIRA" "HMM...")) +("ASSTLP02" :hint 0 (0 "KEIRA" "GOTTA GET THIS HEAT SHIELD WORKING...")) +("ASSTLP03" :hint 0 (0 "KEIRA" "WE NEED POWER CELLS TO FUEL THE HEAT SHIELD...")) +("ASSTLP04" :hint 0 (0 "KEIRA" "WHERE'S MY SPANNER?")) +("ASSTLP05" :hint 0 (0 "KEIRA" "FIRE CANYON IS SO HOT...")) + + +("sage-introduction-misty-cannon" + (24 "SAGE" "OH, IT'S THE CONQUERING HEROES.") + (136 "SAGE" "GOOD, I WANTED TO TALK WITH YOU TWO ABOUT SOMETHING SERIOUS.") + (258) + (261 :offscreen "SAGE" "THERE APPEARS TO BE QUITE A BIT OF LURKER ACTIVITY ON MISTY ISLAND.") + (387) + (393 :offscreen "SAGE" "I CAN SEE THEM BOMBARDING THE PRECURSOR SILO FROM MY LOOKOUT TOWER.") + (525) + (528 "SAGE" "IF THE LURKERS OPEN IT UP AND RELEASE THE DARK ECO, WE COULD ALL END UP") + (663 "SAGE" "RUNNING AROUND LOOKING AS RIDICULOUS AS THIS ANNOYING LITTLE SPECIMEN.") + (788) + (807 "SAGE" "JAK, IT'S TIME FOR YOU TO PROVE YOUR WORTH.") + (906 "SAGE" "GET THE FISHERMAN TO LET YOU TAKE HIS BOAT BACK TO MISTY ISLAND") + (1018 "SAGE" "GET TO THE TOP OF THE PRECURSOR SILO AND TAKE OUT THAT CANNON.") + (1071) + (1177 "DAXTER" "AND... WHAT ABOUT ME?") + (1232) + (1235 "SAGE" "YOU? WHY DON'T YOU MOP MY FLOORS? THEY SEEM TO HAVE LOST THEIR SHINE LATELY.") + ) + + ;; ----------------- ;; oracle @@ -121,11 +240,34 @@ ("oracle-right-eye-3" (0 "ORACLE" "YOU HAVE OBTAINED ANOTHER POWER CELL.")) ("oracle-left-eye-3" (0 "ORACLE" "FOR YOUR EFFORT, A POWER CELL IS THE REWARD.")) + +;; ----------------- +;; misty + + +("sksp0031" :hint #x23a (0 "DAXTER" "OOH! LET'S USE THE CANNON TO BLOW THINGS UP!")) +("sksp0067" :hint #x249 (0 "DAXTER" "DON'T FALL INTO THE MIST BELOW US! 'CAUSE I DON'T THINK WE'LL MAKE IT BACK.")) +("sksp0059" :hint #x26e (0 "DAXTER" "THIS PLACE GIVES ME THE WILLIES! LET'S KEEP YOU OUT OF THE OOZE, OKAY?")) +("sksp0056" :hint #x27b (0 "DAXTER" "HEY! I SEE THE SCULPTOR'S MUSE!")) +("sagevb02" :hint #x28a + (6 "SAGE" "I HAVE TO ADMIT, I'M IMPRESSED. YOU TWO DIDN'T SCREW UP!") + (385) + (399 "SAGE" "NOW THAT THE LURKERS CAN'T OPEN THAT SILO, THEY CAN'T FLOOD THE WORLD WITH DARK ECO") + (720 "SAGE" "AND CAUSE UNTOLD DESTRUCTION.") + (863) + (880 "SAGE" "WIPE THAT RIDICULOUS GRIN OFF YOUR FACE, DAXTER! THE TWO OF YOU HAVE PLENTY TO DO.") + (1191 "SAGE" "GET ON WITH IT!") + ) +("sksp0069" :hint #x2a3 (0 "DAXTER" "IT'S AN AMBUSH, JAK! IT'S AN AMBUSH!")) +("sksp0070" :hint #x2a4 (0 "DAXTER" "JUMP, THEN DIVE ONTO THE TEETER-TOTTER.")) +("sksp0435" :hint #x2aa (0 "DAXTER" "KNOCK OVER THOSE BONES!")) + + ;; ----------------- ;; swamp ("billy-introduction" - (6 "BILLY" "HOWDY, FRIENDS! ENJOYIN' MY BEAUTIFUL SWAMP? I OWN THESE HERE PARTS. EVERYTHING THAT DOESN'T SINK INTO THE MUD, THAT IS! (LAUGHS)") + (6 "BILLY" "HOWDY, FRIENDS! ENJOYIN' MY BEAUTIFUL SWAMP? I OWN THESE HERE PARTS. EVERYTHING THAT DOESN'T SINK INTO THE MUD, THAT IS! HA HA HA...") (349) (369 "DAXTER" "JUDGING BY THE SMELL, I'D WAGER YOUR BATHTUB SANK IN THE MUD LONG AGO.") (497) @@ -160,29 +302,41 @@ ;; ----------------- ;; citadel + ("green-sagecage-introduction" (130 "SAGE" "IT'S ABOUT TIME YOU TWO DECIDED TO SHOW UP!") (207 "DAXTER" "NICE TO SEE YOU TOO! DO THEY HAVE YOU MOPPING THE FLOORS NOW?") - (343 "SAGE" "THERE'S NO TIME FOR JOKES, DAXTER. GOL AND MAIA KIDNAPPED US TO SAP OUR ENERGIES TO POWER THEIR ABOMINABLE MACHINE.") - (574 :offscreen "SAGE" "IT APPEARS THEY HAVE COMBINED THE FUNCTIONAL REMAINS OF A PRECURSOR ROBOT WITH SCAVENGED ARTIFACTS FROM ACROSS THE LAND.") - (800 :offscreen "SAGE" "THEN THEY ADDED A FEW DIABOLICAL ADDITIONS OF THEIR OWN, CREATING THE ONE THING CAPABLE OF OPENING THE DARK ECO SILOS.") + (343 "SAGE" "THERE'S NO TIME FOR JOKES, DAXTER. GOL AND MAIA KIDNAPPED US") + (477 "SAGE" "TO SAP OUR ENERGIES TO POWER THEIR ABOMINABLE MACHINE.") + (574) + (577 :offscreen "SAGE" "IT APPEARS THEY HAVE COMBINED THE FUNCTIONAL REMAINS OF A PRECURSOR ROBOT") + (710 :offscreen "SAGE" "WITH SCAVENGED ARTIFACTS FROM ACROSS THE LAND.") + (800) + (803 :offscreen "SAGE" "THEN THEY ADDED A FEW DIABOLICAL ADDITIONS OF THEIR OWN,") + (921 :offscreen "SAGE" "CREATING THE ONE THING CAPABLE OF OPENING THE DARK ECO SILOS.") (1060 "SAGE" "IF YOU CAN FREE THE FOUR OF US, WE CAN USE OUR COMBINED POWERS") (1180 "SAGE" "TO BREAK THE FORCE SHIELD SURROUNDING THE ROBOT, BEFORE THEY USE IT TO DESTROY THE WORLD.") ) ("redsage-resolution" - (60 "RED SAGE" "(CHUCKLES) YOU'VE FINALLY COME TO RESCUE ME.") - (190 "RED SAGE" "DO YOU KNOW HOW LONG I'VE BEEN IN HERE? WHAT TOOK YOU SO LONG, YOU KNOW? (CHUCKLES) WHAT ARE YOUR NAMES?") - (429 "DAXTER" "I'M DAXTER! HE'S JAK, HE'S WITH ME.") + (58 "RED SAGE" "(CHUCKLES) YOU'VE FINALLY COME TO RESCUE ME.") + (190 "RED SAGE" "DO YOU KNOW HOW LONG I'VE BEEN IN HERE? WHAT TOOK YOU SO LONG? AND UH... (CHUCKLES)") + (381 "RED SAGE" "WHAT ARE YOUR NAMES?") + (429) + (432 "DAXTER" "I'M DAXTER! HE'S JAK, HE'S WITH ME.") (540 :offscreen "RED SAGE" "GOOD JOB, DAXTER. YOU'RE A REAL HERO.") - (670) - (700 "RED SAGE" "YOU'VE GOT TO STOP GOL FROM LAUNCHING THE ROBOT. I'LL USE MY ECO POWER TO HELP OPEN THE SHIELD DOOR.") + (674) + (700 "RED SAGE" "YOU'VE GOT TO STOP GOL FROM LAUNCHING THE ROBOT.") + (837 "RED SAGE" "I'LL USE MY ECO POWER TO HELP OPEN THE SHIELD DOOR.") ) ("bluesage-resolution" - (60 "BLUE SAGE" "GOOD WORK, FELLOWS! OLD SAMOS WAS RIGHT ABOUT YOU!") - (165 "BLUE SAGE" "GREAT PILES OF PRECURSOR METAL! THAT INSIDIOUS MECHANICAL CREATION MUST NOT BE ALLOWED TO WREAK ITS TERRIBLE HAVOC!") - (420 "BLUE SAGE" "I WILL TRY TO ACTUATE THE SHIELD DOOR BY ELLICITING A CONDUIT OF ENERGY BETWEEN MYSELF AND THE VAST PORTAL BELOW!") + (63 "BLUE SAGE" "GOOD WORK, FELLOWS! OLD SAMOS WAS RIGHT ABOUT YOU!") + (162) + (165 "BLUE SAGE" "GREAT PILES OF PRECURSOR METAL!") + (253 "BLUE SAGE" "THAT INSIDIOUS MECHANICAL CREATION MUST NOT BE ALLOWED TO WREAK ITS TERRIBLE HAVOC!") + (420 "BLUE SAGE" "I WILL TRY TO ACTUATE THE SHIELD DOOR BY ELLICITING A CONDUIT OF ENERGY") + (563 "BLUE SAGE" "BETWEEN MYSELF AND THE VAST PORTAL BELOW!") (666 "DAXTER" "UH... YEAH. YOU DO THAT. WE'LL UH... JUST GO FIND MORE HELP.") (873) (891 :offscreen "DAXTER" "WEIRDO!") @@ -190,33 +344,153 @@ ) ("yellowsage-resolution" - (50 "YELLOW SAGE" "WHO WOULDA THOUGHT I'D LIVE TO SEE THE DAY WHEN I NEEDED TO BE RESCUED BY A BOY AND HIS MUSKRAT!") + (57 "YELLOW SAGE" "WHO WOULDA THOUGHT I'D LIVE TO SEE THE DAY") + (137 "YELLOW SAGE" "WHEN I NEEDED TO BE RESCUED BY A BOY AND HIS MUSKRAT!") (271 "YELLOW SAGE" "(SIGHS) I'M GONNA GIVE GOL AND MAIA A LITTLE PAYBACK FOR THIS EMBARRASSMENT!") + (471) (480 "YELLOW SAGE" "THEN WE'LL SEE ABOUT COOKING UP SOME MUSKRAT STEW...") - (606) + (605) ) ("green-sagecage-resolution" - (30 "SAGE" "GOOD WORK, BOYS! YOU'RE REAL HEROES NOW. I'LL COMBINE MY GREEN ECO POWER WITH THE OTHER THREE SAGES") - (284 "SAGE" "AND TOGETHER WE'LL OPEN THE SHIELD DOOR SURROUNDING THE PRECURSOR ROBOT.") - (405 "DAXTER" "YEAH YEAH THAT SOUNDS LIKE A GOOD START. AND THEN AFTER YOU GUYS OPEN THAT SHIELD, WHAT ARE YOU GONNA DO ABOUT THE ROBOT?") - (576 "SAGE" "NOTHING, DAXTER. WE HAVE TO KEEP THE SHIELD OPEN, IT'S UP TO YOU TWO TO FIGURE OUT HOW TO DESTROY THE ROBOT.") - (823 "DAXTER" "OH, GREAT. I GET TO HELP THE GUY THAT TURNED ME INTO A FURBALL DESTROY THE ONLY PERSON WHO CAN TURN ME BACK!") + (35 "SAGE" "GOOD WORK, BOYS! YOU'RE REAL HEROES NOW.") + (158 "SAGE" "I'LL COMBINE MY GREEN ECO POWER WITH THE OTHER THREE SAGES") + (280 "SAGE" "AND TOGETHER WE'LL OPEN THE SHIELD DOOR SURROUNDING THE PRECURSOR ROBOT.") + (405 "DAXTER" "YEAH YEAH THAT SOUNDS LIKE A GOOD START.") + (457 "DAXTER" "AND THEN AFTER YOU GUYS OPEN THAT SHIELD, WHAT ARE YOU GONNA DO ABOUT THE ROBOT?") + (576 "SAGE" "NOTHING, DAXTER. WE HAVE TO KEEP THE SHIELD OPEN.") + (704 "SAGE" "IT'S UP TO YOU TWO TO FIGURE OUT HOW TO DESTROY THE ROBOT.") + (823 "DAXTER" "OH, GREAT. I GET TO HELP THE GUY THAT TURNED ME INTO A FURBALL") + (983 "DAXTER" "DESTROY THE ONLY PERSON WHO CAN TURN ME BACK!") (1111) - (1156 "SAGE" "FIRST, SAVE THE WORLD! THEN WE'LL TRY TO CONVINCE GOL TO HELP DAXTER.") + (1161 "SAGE" "FIRST, SAVE THE WORLD! THEN WE'LL TRY TO CONVINCE GOL TO HELP DAXTER.") ) ("green-sagecage-outro-preboss" - (50 "GOL" "YOU'RE TOO LATE, SAMOS. ONCE I POSSESS LIMITLESS DARK ECO, I WILL HAVE THE KEY TO CREATION ITSELF!") + (56 "GOL" "YOU'RE TOO LATE, SAMOS.") + (125 "GOL" "ONCE I POSSESS LIMITLESS DARK ECO, I WILL HAVE THE KEY TO CREATION ITSELF!") (335 "SAGE" "THIS IS MADNESS! RELEASING THAT MUCH DARK ECO WILL DESTROY EVERYTHING WE KNOW!") - (485 "SAGE" "JUST LOOK WHAT IT'S DONE TO YOU!") + (504 "SAGE" "JUST LOOK WHAT IT'S DONE TO YOU!") + (578) (581 "MAIA" "IT HAS GIVEN US A BEAUTY BEYOND ANYTHING YOU COULD UNDERSTAND.") + (693) (696 "DAXTER" "BEAUTY? HAVE YOU TWO LOOKED IN A MIRROR LATELY?") + (825) (828 "MAIA" "JUST WAIT UNTIL WE OPEN THE SILOS, LITTLE ONE. YOU THINK SHORT AND FUZZY IS BAD?") - (1017 "GOL" "AND TO THINK, YOU TWO TRAVELLED ALL THIS WAY FOR MY HELP.") + (1030 "GOL" "AND TO THINK, YOU TWO TRAVELLED ALL THIS WAY FOR MY HELP.") (1180 "GOL" "FOOLS! ENJOY YOUR FRONT ROW SEATS TO THE RECREATION OF THE WORLD!") - (1382) + (1391) (1605 "SAGE" "JAK! TAKE THE ELEVATOR UP AND STOP THAT ROBOT!") ) +("BLU-AM01" :hint 0 (0 "BLUE SAGE" "A LITTLE BIT OF HELP WOULD BE GOOD!")) +("BLU-AM02" :hint 0 (0 "BLUE SAGE" "OH, THIS IS A FINE MESS.")) +("BLU-AM03" :hint 0 (0 "BLUE SAGE" "HMM, QUITE AN ENIGMA WE'RE FACING.")) +("RED-AM01" :hint 0 (0 "RED SAGE" "IS ANYBODY THERE?")) +("RED-AM02" :hint 0 (0 "RED SAGE" "WELL...")) +("RED-AM03" :hint 0 (0 "RED SAGE" "WHAT KEPT YOU?")) +("YEL-AM01" :hint 0 (0 "RED SAGE" "TIME IS RUNNIN' OUT!")) +("YEL-AM02" :hint 0 (0 "RED SAGE" "HEY! GET ME OUTTA HERE!")) +("YEL-AM03" :hint 0 (0 "RED SAGE" "WHEN I GET OUTTA HERE, SOME SHOOTIN'S GONNA START!")) + +("sksp0381" :hint #x806 (0 "DAXTER" "BREAK THE GENERATOR TO FREE THE SAGE!")) +("sksp0382" :hint #x807 (0 "DAXTER" "JUST HANG ON TO THE EDGE!")) +("sksp0383" :hint #x808 (0 "DAXTER" "WE GOT COMPANY, JAK. LOOOTS OF LURKERS!")) +("sksp0384" :hint #x809 (0 "DAXTER" "DESTROY THOSE GENERATORS!")) +("sksp0385" :hint #x80a (0 "DAXTER" "PUSH THE BUTTON!")) +("sksp0386" :hint #x80b (0 "DAXTER" "THAT ROBOT DOESN'T SCARE ME!")) +("sksp0387" :hint #x80c (0 "DAXTER" "LET'S GO CLIMB UP THOSE PLATFORMS!")) +("sksp0388" :hint #x80d (0 "DAXTER" "DON'T MISS THE NEXT LAUNCHER!")) +("sksp0389" :hint #x80e (0 "DAXTER" "WATCH IT!")) +("sksp0390" :hint #x80f (0 "DAXTER" "WE HAVE TO RESCUE ALL THE SAGES!")) +("sksp0391" :hint #x810 (0 "DAXTER" "DO YOU THINK GOL WILL STILL CHANGE ME BACK?")) +("sksp0392" :hint #x811 (0 "DAXTER" "SO THIS IS GOL AND MAIA'S CITADEL. NICE AND COZY.")) +("sksp0393" :hint #x812 (0 "DAXTER" "LAND ON THE NEXT LAUNCHER!")) +("sksp0378" :hint #x813 (0 "DAXTER" "THE DOOR'S OPEN, LET'S GET GOING!")) + + +;; ----------------- +;; training + + +("asstvb40" :hint #x900 + (0 "KEIRA" "THIS DEVICE IS A COMMUNICATOR. WITH IT, MY FATHER AND I") + (181 "KEIRA" "CAN GIVE YOU ADVICE AT ANY TIME DURING YOUR QUEST.") + ) +("asstvb41" :hint #x901 + (0 "KEIRA" "THESE FLOATING EGG-SHAPED THINGS ARE PRECURSOR ORBS.") + (176) + (180 "KEIRA" "COLLECT ENOUGH OF THEM, AND SOME OF THE VILLAGERS WILL GIVE YOU") + (315 "KEIRA" "A POWER CELL IN EXCHANGE.") + ) +("asstvb42" :hint #x902 + (0 "KEIRA" "THIS IS A POWER CELL, THE MOST IMPORTANT PRECURSOR ARTIFACT YOU CAN FIND!") + (327) + (333 "KEIRA" "YOU NEED TO COLLECT 20 OF THESE SO I CAN POWER THE HEAT SHIELD") + (507 "KEIRA" "FOR YOUR A-GRAV ZOOMER.") + ) +("asstvb44" :hint #x903 + (0 "KEIRA" "HEY, YOU FOUND ONE OF MY SCOUT FLIES!") + (160 "KEIRA" "I SENT 7 OF THEM TO EACH AREA TO LOOK FOR POWER CELLS") + (343 "KEIRA" "BUT THE LURKERS MUST HAVE CAPTURED THEM ALL!") + ) +("asstvb45" :hint #x904 + (0 "KEIRA" "WOW! THAT LAST SCOUT FLY HAD A POWER CELL!") + (219 "KEIRA" "I'LL BET IF YOU COLLECT ALL 7 IN EACH AREA YOU CAN FIND EVEN MORE POWER CELLS.") + ) +("asstvb46" :hint #x905 + (0 "KEIRA" "BE CAREFUL IN THE OCEAN, THE WATERS ARE CHOCK-FULL OF LURKER SHARKS") + (258 "KEIRA" "AND I'VE NEVER SEEN ANYONE DEFEAT ONE.") + (419) + (426 "KEIRA" "STAY CLEAR OF THEM IF YOU KNOW WHAT'S GOOD FOR YOU!") + ) +("asstvb47" :hint #x906 (0 "KEIRA" "REMEMBER, THAT'S A POWER CELL. YOU NEED TO COLLECT AS MANY OF THOSE AS YOU CAN.")) +("asstvb48" :hint #x907 + (0 "KEIRA" "THAT'S A BLUE ECO VENT! MORE CONCENTRATED THAN THE FLOATING CLUSTERS,") + (253 "KEIRA" "THIS VENT WILL GIVE YOU A FULL CHARGE OF BLUE ECO,") + (419 "KEIRA" "LETTING YOU USE IT FOR THE MAXIMUM TIME.") + ) +("sagevb21" :hint #x908 + (3 "SAGE" "THOSE LITTLE GREEN BALLS OF ENERGY ON THE GROUND ARE A TYPE OF ECO.") + (280 "SAGE" "PICK UP 50 SMALL GREEN ECOES, OR ONE BIG GREEN ONE TO INCREASE YOUR HEALTH.") + ) +("sagevb22" :hint #x909 + (0 "SAGE" "THAT'S BLUE ECO, WHICH CONTAINS THE ENERGY OF MOTION.") + (291 "SAGE" "BLUE ECO ALLOWS YOU TO RUN FAST, BREAK BOXES, AND EVEN ACTIVATE SOME PRECURSOR") + (640 "SAGE" "ARTIFACTS WHEN YOU GET NEAR THEM.") + ) +("sagevb23" :hint #x90a (0 "SAGE" "NOTICE HOW EACH BLUE ECO CLUSTER YOU PICK UP INCREASES THE TIME YOU CAN USE ITS POWER.")) +("sagevb24" :hint #x90b + (3 "SAGE" "THIS IS A PRECURSOR DOOR. IT CAN ONLY BE OPENED BY APPROACHING THE DOOR") + (357 "SAGE" "WHILE CHANNELING BLUE ECO THROUGH YOUR BODY.") + ) +("sagevb25" :hint #x90c + (3 "SAGE" "GOOD WORK, THE BLUE ECO CAUSED THE DOOR TO OPEN. WITH BLUE ECO, YOU CAN BREATHE") + (365 "SAGE" "ENERGY INTO ALL KINDS OF PRECURSOR ARTIFACTS THAT HAVE LAIN DORMANT FOR YEARS.") + ) +("sagevb26" :hint #x90d (0 "SAGE" "USE YOUR GOGGLES TO VIEW YOUR PROGRESS DURING THE ADVENTURE.")) +("sagevb27" :hint #x90e (1 "SAGE" "YOU CAN JUMP ONCE, THEN JUMP AGAIN IN THE AIR TO REACH EVEN HIGHER LEDGES.")) +("sagevb28" :hint #x90f (0 "SAGE" "WHEN YOU'RE SURROUNDED BY ENEMIES, USE YOUR SPIN KICK.")) +("sagevb29" :hint #x910 (0 "SAGE" "THAT'S NOT A SPIN KICK! TRY AGAIN.")) +("sagevb30" :hint #x911 (0 "SAGE" "COME ON, JAK! DO A SPIN KICK.")) +("sagevb31" :hint #x912 (0 "SAGE" "GOOD WORK. USE THE SPIN KICK WHEN YOU WANT A GOOD ALL-ROUND ATTACK.")) +("sagevb32" :hint #x913 (0 "SAGE" "FOR A STRAIGHT LINE, MOVING ATTACK, USE YOUR FIST TO PUNCH.")) +("sagevb33" :hint #x914 (0 "SAGE" "THAT'S NOT A PUNCH ATTACK! LET'S SEE YOU PUNCH ALREADY.")) +("sagevb34" :hint #x915 (0 "SAGE" "JAK! USE A PUNCH.")) +("sagevb35" :hint #x916 (0 "SAGE" "GREAT JOB. USE THE PUNCH TO CLOSE DISTANCE QUICKLY IN A TOUGH SPOT.")) +("sagevb36" :hint #x917 + (0 "SAGE" "SOMETIMES YOU'LL WANT TO HIT THINGS WITH A GREATER FORCE.") + (218 "SAGE" "TO BREAK ONE OF THESE BOXES, YOU SHOULD JUMP IN THE AIR") + (420 "SAGE" "AND THEN DIVE DOWN ONTO IT, HANDS FIRST.") + ) +("sagevb37" :hint #x918 (0 "SAGE" "WHEN YOU GET SOME CONFIDENCE, TRY USING SOME OF YOUR MOVES IN COMBINATIONS.")) +("sagevb38" :hint #x919 + (0 "SAGE" "YOU CAN'T COME BACK THROUGH THE WARP GATE UNTIL YOU FIND") + (168 "SAGE" "ALL 4 POWER CELLS ON THIS ISLAND.") + ) +("sagevb39" :hint #x91a + (0 "SAGE" "GREAT! YOU FOUND ALL OF THE POWER CELLS ON THE ISLAND.") + (269 "SAGE" "COME BACK TO THE WARP GATE SO I CAN BRING YOU BACK TO THE LAB. HURRY UP!") + ) + diff --git a/goal_src/build/all_files.gc b/goal_src/build/all_files.gc index 1cfabb873c..1bd182af8e 100644 --- a/goal_src/build/all_files.gc +++ b/goal_src/build/all_files.gc @@ -217,7 +217,6 @@ "goal_src/engine/level/level-info.gc" "goal_src/engine/level/level.gc" "goal_src/engine/ui/text.gc" - "goal_src/pc/subtitle.gc" ;; added "goal_src/engine/collide/collide-probe.gc" "goal_src/engine/collide/collide-frag.gc" "goal_src/engine/collide/collide-mesh.gc" @@ -303,6 +302,7 @@ "goal_src/engine/debug/viewer.gc" "goal_src/engine/debug/part-tester.gc" "goal_src/engine/debug/default-menu.gc" + "goal_src/pc/subtitle.gc" ;; added "goal_src/levels/common/texture-upload.gc" "goal_src/levels/common/rigid-body-h.gc" "goal_src/levels/common/water-anim.gc" diff --git a/goal_src/dgos/engine.gd b/goal_src/dgos/engine.gd index c00085d8f9..418f45feda 100644 --- a/goal_src/dgos/engine.gd +++ b/goal_src/dgos/engine.gd @@ -209,7 +209,6 @@ ("level-info.o" "level-info") ("level.o" "level") ("text.o" "text") - ("subtitle.o" "subtitle") ;; added ("collide-probe.o" "collide-probe") ("collide-frag.o" "collide-frag") ("collide-mesh.o" "collide-mesh") @@ -296,5 +295,6 @@ ("viewer.o" "viewer") ("part-tester.o" "part-tester") ("default-menu.o" "default-menu") + ("subtitle.o" "subtitle") ;; added ) diff --git a/goal_src/dgos/game.gd b/goal_src/dgos/game.gd index 44feb49583..5ccd07c25d 100644 --- a/goal_src/dgos/game.gd +++ b/goal_src/dgos/game.gd @@ -205,7 +205,6 @@ ("level-info.o" "level-info") ("level.o" "level") ("text.o" "text") - ("subtitle.o" "subtitle") ;; added ("collide-probe.o" "collide-probe") ("collide-frag.o" "collide-frag") ("collide-mesh.o" "collide-mesh") @@ -292,6 +291,7 @@ ("viewer.o" "viewer") ("part-tester.o" "part-tester") ("default-menu.o" "default-menu") + ("subtitle.o" "subtitle") ;; added ("dir-tpages.go" "dir-tpages") ("tpage-463.go" "tpage-463") ("tpage-2.go" "tpage-2") diff --git a/goal_src/engine/ambient/ambient.gc b/goal_src/engine/ambient/ambient.gc index c8b286f46e..1ddb7b512e 100644 --- a/goal_src/engine/ambient/ambient.gc +++ b/goal_src/engine/ambient/ambient.gc @@ -308,6 +308,7 @@ (none) ) +(#when PC_PORT (define *level-hint-spool-name* (the string #f))) (defbehavior level-hint-init-by-other level-hint ((arg0 game-text-id) (arg1 string) (arg2 entity)) (mark-text-as-seen *game-info* arg0) (set! (-> self text-id-to-display) arg0) @@ -489,6 +490,7 @@ ) :exit (behavior () + (#when PC_PORT (set! *level-hint-spool-name* (the string #f))) (if (nonzero? (-> self sound-id)) (sound-stop (-> self sound-id)) ) @@ -503,6 +505,7 @@ ) :code (behavior ((arg0 string)) + (#when PC_PORT (set! *level-hint-spool-name* arg0)) (when (and (-> *setting-control* current play-hints) (< 0.0 (-> *setting-control* current dialog-volume))) (case (-> self mode) (('voicebox) diff --git a/goal_src/engine/camera/pov-camera-h.gc b/goal_src/engine/camera/pov-camera-h.gc index 6b70f5aa5b..19bcdbf7f5 100644 --- a/goal_src/engine/camera/pov-camera-h.gc +++ b/goal_src/engine/camera/pov-camera-h.gc @@ -22,15 +22,15 @@ ;; for example, the introduction to orbs in geyser, or the camera that shows you where the steps to fire canyon ;; are. (deftype pov-camera (process-drawable) - ((cspace-array cspace-array :offset 112) - (flags pov-camera-flag :offset-assert 176) - (debounce-start-time time-frame :offset-assert 184) - (notify-handle handle :offset-assert 192) - (anim-name string :offset-assert 200) - (command-list pair :offset-assert 204) - (mask-to-clear uint32 :offset-assert 208) - (music-volume-movie float :offset-assert 212) - (sfx-volume-movie float :offset-assert 216) + ((cspace-array cspace-array :offset 112) + (flags pov-camera-flag :offset-assert 176) + (debounce-start-time time-frame :offset-assert 184) + (notify-handle handle :offset-assert 192) + (anim-name string :offset-assert 200) + (command-list pair :offset-assert 204) + (mask-to-clear process-mask :offset-assert 208) + (music-volume-movie float :offset-assert 212) + (sfx-volume-movie float :offset-assert 216) ) :heap-base #x70 :method-count-assert 30 diff --git a/goal_src/engine/camera/pov-camera.gc b/goal_src/engine/camera/pov-camera.gc index 21b79fc919..99b9401165 100644 --- a/goal_src/engine/camera/pov-camera.gc +++ b/goal_src/engine/camera/pov-camera.gc @@ -293,14 +293,14 @@ ((= (-> arg2 type) spool-anim) ) ) - (set! (-> self mask-to-clear) (the-as uint #x4a0800)) + (set! (-> self mask-to-clear) (process-mask movie enemy platform projectile)) (set! (-> self event-hook) (lambda :behavior pov-camera ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (cond ((= v1-0 'mask) (let ((v0-0 (the-as number (-> arg3 param 0)))) - (set! (-> self mask-to-clear) (the-as uint v0-0)) + (set! (-> self mask-to-clear) (the-as process-mask v0-0)) v0-0 ) ) diff --git a/goal_src/engine/game/generic-obs-h.gc b/goal_src/engine/game/generic-obs-h.gc index b3ae76c9a0..b3eb83d260 100644 --- a/goal_src/engine/game/generic-obs-h.gc +++ b/goal_src/engine/game/generic-obs-h.gc @@ -112,9 +112,9 @@ (grab-target handle :offset 120) (grab-event symbol :offset-assert 128) (release-event symbol :offset-assert 132) - (old-global-mask uint32 :offset-assert 136) - (old-self-mask uint32 :offset-assert 140) - (old-parent-mask uint32 :offset-assert 144) + (old-global-mask process-mask :offset-assert 136) + (old-self-mask process-mask :offset-assert 140) + (old-parent-mask process-mask :offset-assert 144) (look-at-target handle :offset-assert 152) (pov-target handle :offset-assert 160) (work-process handle :offset-assert 168) @@ -124,7 +124,7 @@ (userdata basic :offset-assert 196) (message basic :offset-assert 200) (border-value basic :offset-assert 204) - (mask-to-clear uint32 :offset-assert 208) + (mask-to-clear process-mask :offset-assert 208) (script pair :offset-assert 212) (script-line pair :offset-assert 216) (script-func (function none) :offset-assert 220) @@ -199,17 +199,17 @@ ;; control the camera from something else (an animation) (deftype othercam (process) - ((hand handle :offset-assert 112) - (old-global-mask uint32 :offset-assert 120) - (mask-to-clear uint32 :offset-assert 124) - (cam-joint-index int32 :offset-assert 128) - (old-pos vector :inline :offset-assert 144) - (old-mat-z vector :inline :offset-assert 160) - (had-valid-frame basic :offset-assert 176) - (border-value basic :offset-assert 180) - (die? symbol :offset-assert 184) - (survive-anim-end? symbol :offset-assert 188) - (spooling? symbol :offset-assert 192) + ((hand handle :offset-assert 112) + (old-global-mask process-mask :offset-assert 120) + (mask-to-clear process-mask :offset-assert 124) + (cam-joint-index int32 :offset-assert 128) + (old-pos vector :inline :offset-assert 144) + (old-mat-z vector :inline :offset-assert 160) + (had-valid-frame basic :offset-assert 176) + (border-value basic :offset-assert 180) + (die? symbol :offset-assert 184) + (survive-anim-end? symbol :offset-assert 188) + (spooling? symbol :offset-assert 192) ) :heap-base #x60 :method-count-assert 14 diff --git a/goal_src/engine/game/generic-obs.gc b/goal_src/engine/game/generic-obs.gc index 29b7ccd943..a5f77bdc15 100644 --- a/goal_src/engine/game/generic-obs.gc +++ b/goal_src/engine/game/generic-obs.gc @@ -1144,7 +1144,7 @@ ) ((= v1-0 'mask) (set! v0-0 (-> arg3 param 0)) - (set! (-> self mask-to-clear) v0-0) + (set! (-> self mask-to-clear) (the-as process-mask v0-0)) v0-0 ) ((= v1-0 'border) @@ -1203,7 +1203,7 @@ (defbehavior camera-tracker-init camera-tracker ((arg0 object)) (stack-size-set! (-> self main-thread) 512) (logclear! (-> self mask) (process-mask actor-pause movie enemy platform projectile)) - (set! (-> self mask-to-clear) (the-as uint #x4a0800)) + (set! (-> self mask-to-clear) (process-mask movie enemy platform projectile)) (set! (-> self grab-target) (the-as handle #f)) (set! (-> self grab-event) 'grab) (set! (-> self release-event) 'end-mode) diff --git a/goal_src/engine/game/task/process-taskable.gc b/goal_src/engine/game/task/process-taskable.gc index 49307553cd..8eb01b603f 100644 --- a/goal_src/engine/game/task/process-taskable.gc +++ b/goal_src/engine/game/task/process-taskable.gc @@ -1304,7 +1304,7 @@ ) (('mask) (set! v0-0 (-> arg3 param 0)) - (set! (-> self mask-to-clear) (the-as uint v0-0)) + (set! (-> self mask-to-clear) (the-as process-mask v0-0)) v0-0 ) ) @@ -1424,7 +1424,7 @@ (set! (-> self border-value) #f) (set! (-> self die?) #f) (set! (-> self survive-anim-end?) arg2) - (set! (-> self mask-to-clear) (the-as uint #x4a0800)) + (set! (-> self mask-to-clear) (process-mask movie enemy platform projectile)) (set! (-> self event-hook) (-> othercam-running event)) (go othercam-running) 0 @@ -1434,7 +1434,10 @@ (defmethod draw-npc-shadow process-taskable ((obj process-taskable)) (let ((gp-0 (-> obj draw shadow-ctrl))) (cond - ((and (-> obj draw shadow) (zero? (-> obj draw cur-lod)) (logtest? (-> obj draw status) (draw-status was-drawn))) + ((and (-> obj draw shadow) + (zero? (-> obj draw cur-lod)) + (logtest? (-> obj draw status) (draw-status was-drawn)) + ) (collide-to-find-planes gp-0 (-> obj draw origin) -4096.0 4096.0 32768.0) (update-direction-from-time-of-day gp-0) ) diff --git a/goal_src/engine/ui/text-h.gc b/goal_src/engine/ui/text-h.gc index 3e444f6c2f..6480f2e165 100644 --- a/goal_src/engine/ui/text-h.gc +++ b/goal_src/engine/ui/text-h.gc @@ -191,13 +191,16 @@ (misty-daxter-hit-lurkers-not-mines #x27f) (sidekick-speech-hint-crate-darkeco1 #x281) + (sidekick-speech-crate-steel-break1 #x283) (sidekick-speech-hint-crate-iron #x284) (sidekick-speech-hint-crate-steel #x285) + (beach-collectors-unblocked #x288) + (jungleb-eco-vents-opened #x289) (misty-stopped-lurkers-at-silo #x28a) (misty-stopped-balloon-lurkers #x28b) - (jungleb-eco-vents-opened #x289) + (sidekick-speech-crate-steel-break2 #x28e) (sidekick-speech-hint-crate-darkeco2 #x28f) @@ -216,13 +219,10 @@ (misty-teetertotter-bonk-dax-tutorial #x2a4) (sidekick-hint-misty-get-red-eco #x2a5) - (red-eco-tutorial #x2a6) - (daxter-blue-eco-plat-tutorial #x2a7) (fish? #x2a9) - (misty-bone-bridge-hint #x2aa) (beach-grottopole-increment #x2af) diff --git a/goal_src/game.gp b/goal_src/game.gp index dca8cbd872..24e04e9217 100644 --- a/goal_src/game.gp +++ b/goal_src/game.gp @@ -1920,7 +1920,7 @@ ;; Custom or Modified Code (goal-src "pc/pckernel-h.gc" "dma-disasm") (goal-src "pc/pckernel.gc" "settings") -(goal-src "pc/subtitle.gc" "text") +(goal-src "pc/subtitle.gc" "text" "pckernel" "hint-control" "loader-h" "gsound" "ambient") (goal-src "pc/progress-pc.gc" "progress" "pckernel") diff --git a/goal_src/pc/subtitle.gc b/goal_src/pc/subtitle.gc index 9e25e81533..c5b37f37ea 100644 --- a/goal_src/pc/subtitle.gc +++ b/goal_src/pc/subtitle.gc @@ -5,8 +5,8 @@ Code for subtitles for the PC port. A PC actor pool is provided, and the subtitle process lives there. It automatically detects the currently playing cutscene and plays the subtitles for it on channel 0. - Channel 1 and 2 are reserved for ambient sounds, which cannot be auto-detected, so the ambient-control needs to - notify the subtitle process manually (TODO: verify this!) + The other two channels are for hints, first checked automatically by name, then by text ID. + There is a hack in ambient.gc to store the name of the last ambient hint vag played to aid in this. Similarly to the generic text file, only one subtitles text file is loaded at once, stored in a specific heap. @@ -23,6 +23,7 @@ (defconstant PC_SUBTITLE_FILE_SIZE (* 64 1024)) ;; 64K heap for subtitles. adjust later if necessary. (defconstant PC_SUBTITLE_FILE_NAME "subtit") +(defconstant PC_SUBTITLE_STR_ADJUST 17) (defglobalconstant PC_SUBTITLE_DEBUG #f) @@ -39,7 +40,7 @@ ;; enum for the subtitle channels, no more than 2 bytes! (defenum pc-subtitle-channel :type int16 - (invalid -1) (movie 0) (ambient 1) (hint 2)) + (invalid -1) (movie 0) (hint 1) (hint-named 2)) (defconstant SUBTITLE_CHANNEL_COUNT 3) (defenum pc-subtitle-flags @@ -71,10 +72,10 @@ ;; now we store a way to identify and lookup the subtitles. - ;; the game-text-id if this is for a hint - (id game-text-id :offset 8) ;; the name of the spool-anim (name string :offset 8) + ;; the game-text-id if this is for a hint + (id game-text-id :offset 12) ;; the 8-character name for an ambient or hint (hash uint64 :offset 8) @@ -94,6 +95,7 @@ (:methods (get-scene-by-name (_type_ pc-subtitle-channel string) subtitle-text) + (get-scene-by-text-id (_type_ pc-subtitle-channel game-text-id) subtitle-text) ) ) @@ -122,9 +124,9 @@ (define *SUBTITLE-bank* (new 'static 'subtitle-bank :scale 0.49 - :width 0.85 - :height 0.8 - :lines 3.0 + :width 0.87 + :height 0.82 + :lines 2.0 )) ;; the subtitle process! it lives on the PC actor pool and awaits for incoming subtitle messages, or a movie @@ -135,6 +137,7 @@ ( spool-name string) (old-spool-name string) + (text-id game-text-id) (cur-channel pc-subtitle-channel) (want-subtitle subtitle-keyframe) ;; the subtitle we want to display @@ -174,6 +177,10 @@ (defmethod get-scene-by-name subtitle-text-info ((obj subtitle-text-info) (kind pc-subtitle-channel) (name string)) "get a subtitle scene info with the corresponding name. #f = none found" + ;; invalid kind so return invalid scene. + (if (or (not name) (= kind (pc-subtitle-channel invalid))) + (return (the subtitle-text #f))) + (dotimes (i (-> obj length)) ;; name and kind matches, return that! (when (and (= kind (-> obj data i kind)) (string= (-> obj data i name) name)) @@ -183,6 +190,22 @@ (the subtitle-text #f)) +(defmethod get-scene-by-text-id subtitle-text-info ((obj subtitle-text-info) (kind pc-subtitle-channel) (id game-text-id)) + "get a subtitle scene info with the corresponding name. #f = none found" + + ;; invalid kind so return invalid scene. + (if (= kind (pc-subtitle-channel invalid)) + (return (the subtitle-text #f))) + + (dotimes (i (-> obj length)) + ;; name and kind matches, return that! + (when (and (= kind (-> obj data i kind)) (= (-> obj data i id) id)) + (return (-> obj data i)) + ) + ) + + (the subtitle-text #f)) + (defun load-subtitle-text-info ((txt-name string) (curr-text symbol) (heap kheap)) "load a subtitles text file onto a heap. txt-name = language-agnostic file name @@ -505,9 +528,13 @@ "can a subtitle be displayed right now?" (and (-> *pc-settings* subtitles?) ;; subtitles enabled (or *debug-segment* (= *master-mode* 'game)) ;; current mode is game, OR we are just debugging + (not *progress-process*) ;; no progress open ) ) +(defun subtitle-str-adjust ((pos int)) + (if (< pos 0) -1 (/ pos PC_SUBTITLE_STR_ADJUST))) + (defstate subtitle-process (subtitle) @@ -535,49 +562,85 @@ (set! (-> self cur-channel) (pc-subtitle-channel invalid)) ;; check what kind of subtitles are running - (when (and (movie?) (-> *art-control* spool-lock) (-> *art-control* active-stream)) - ;; there's a cutscene happening and an active spool with a valid owner. - (set! (-> self spool-name) (-> *art-control* active-stream)) - (set! (-> self cur-channel) (pc-subtitle-channel movie)) - (with-proc ((handle->process (-> *art-control* spool-lock))) - (format *stdcon* "movie spool detected~%current spool frame is ~D~%" (the int (ja-aframe-num 0))) - ) + (cond + ((and (movie?) (-> *art-control* spool-lock) (-> *art-control* active-stream)) + ;; there's a cutscene happening and an active spool with a valid owner. + (set! (-> self spool-name) (-> *art-control* active-stream)) + (set! (-> self cur-channel) (pc-subtitle-channel movie)) + (with-proc ((handle->process (-> *art-control* spool-lock))) + (format *stdcon* "movie spool detected:~%~3L~A~0L~%current spool frame is ~3L~D~0L~%" + (-> *art-control* active-stream) (the int (ja-aframe-num 0))) + ) + ) + (*hint-semaphore* + ;; there's a hint playing + (set! (-> self spool-name) (-> *hint-semaphore* 0 sound-to-play)) + (unless (-> self spool-name) + (set! (-> self spool-name) *level-hint-spool-name*)) + (set! (-> self text-id) (-> *hint-semaphore* 0 text-id-to-display)) + (set! (-> self cur-channel) (if (-> self spool-name) + (pc-subtitle-channel hint-named) + (pc-subtitle-channel hint))) + (format *stdcon* "hint detected!~%~3L~A~0L/~3L#x~X~0L~%current str pos is ~D (~3L~D~0L)~%" + (-> self spool-name) (-> self text-id) + (current-str-pos (-> *hint-semaphore* 0 sound-id)) + (subtitle-str-adjust (current-str-pos (-> *hint-semaphore* 0 sound-id)))) + ) ) ;; do subtitles - (case (-> self cur-channel) - (((pc-subtitle-channel movie)) - ;; cutscenes, check if user toggled subtitles - (if (and (= 'game *master-mode*) (cpad-pressed? 0 square)) - (not! (-> *pc-settings* subtitles?))) - - (when (subtitle?) - ;; subtitles on! get a subtitle info that matches our current cutscene, and find at what point we're in. - (let ((scene (get-scene-by-name *subtitle-text* (-> self cur-channel) (-> self spool-name)))) - (when scene - ;; got a scene! get closest subtitle now. - (let ((pos 0) - (keyframe (the subtitle-keyframe #f))) - ;; get frame num - (with-proc ((handle->process (-> *art-control* spool-lock))) - (set! pos (the int (ja-aframe-num 0))) - ) - ;; find closest keyframe - (dotimes (i (-> scene length)) - (when (>= pos (-> scene keyframes i frame)) - (set! keyframe (-> scene keyframes i))) - ) - ;; and save it! - (set! (-> self want-subtitle) keyframe) - ) + + ;; get a subtitle info that matches our current status + (let ((keyframe (the subtitle-keyframe #f))) + (case (-> self cur-channel) + (((pc-subtitle-channel movie)) + ;; cutscenes. get our cutscene. + (awhen (get-scene-by-name *subtitle-text* (-> self cur-channel) (-> self spool-name)) + + ;; find out position in the scene. + (let ((pos 0)) + ;; get frame num + (with-proc ((handle->process (-> *art-control* spool-lock))) + (set! pos (the int (ja-aframe-num 0))) + ) + ;; find closest keyframe + (dotimes (i (-> it length)) + (when (>= pos (-> it keyframes i frame)) + (set! keyframe (-> it keyframes i))) + ) ) ) ;; keep this for later (set! (-> self old-spool-name) (-> self spool-name)) ) + (((pc-subtitle-channel hint) (pc-subtitle-channel hint-named)) + ;; hint! find it. or else. + (awhen (if (= (-> self cur-channel) (pc-subtitle-channel hint-named)) + (get-scene-by-name *subtitle-text* (-> self cur-channel) (-> self spool-name)) + (get-scene-by-text-id *subtitle-text* (-> self cur-channel) (-> self text-id)) + ) + + (let ((pos (subtitle-str-adjust (current-str-pos (-> *hint-semaphore* 0 sound-id))))) + ;; find closest keyframe + (dotimes (i (-> it length)) + (when (>= pos (-> it keyframes i frame)) + (set! keyframe (-> it keyframes i))) + ) + ) + ) + ) ) - ) + + ;; save whatever subtitle we got. + (set! (-> self want-subtitle) keyframe)) + + ;; during a cutscene, check if user toggled subtitles + (if (and (= (pc-subtitle-channel movie) (-> self cur-channel)) + (= 'game *master-mode*) + (-> self want-subtitle) + (cpad-pressed? 0 square)) + (not! (-> *pc-settings* subtitles?))) (when *debug-segment* (when (and (cpad-hold? 0 l3) (cpad-pressed? 0 start)) @@ -598,8 +661,9 @@ (set-height! (-> self font) (the int (* (-> *SUBTITLE-bank* lines) 11))) (set-scale! (-> self font) (-> *SUBTITLE-bank* scale)) - (when (-> self want-subtitle) + (when (and (-> self want-subtitle) (subtitle?)) ;; we got a valid subtitle! render it. + (hide-bottom-hud) (print-game-subtitle (subtitle-format self (-> self want-subtitle)) (-> self font) #f 128 22) (#when PC_SUBTITLE_DEBUG (draw-debug-text-box (-> self font)) diff --git a/goalc/data_compiler/game_text_common.cpp b/goalc/data_compiler/game_text_common.cpp index 1c939473f8..812cc354d9 100644 --- a/goalc/data_compiler/game_text_common.cpp +++ b/goalc/data_compiler/game_text_common.cpp @@ -237,12 +237,36 @@ void parse_subtitle(const goos::Object& data, GameTextVersion text_ver, GameSubt }); } - else if (head.is_string()) { + else if (head.is_string() || head.is_int()) { if (banks.size() == 0) { - throw std::runtime_error("At least one language must be set before defining entries."); + throw std::runtime_error("At least one language must be set before defining scenes."); } - GameSubtitleSceneInfo scene(head.as_string()->data); - for_each_in_list(cdr(obj), [&](const goos::Object& entry) { + auto kind = SubtitleSceneKind::Movie; + int id = 0; + auto entries = cdr(obj); + if (head.is_int()) { + kind = SubtitleSceneKind::Hint; + } else if (car(entries).is_symbol()) { + const auto& parm = car(entries).as_symbol()->name; + if (parm == ":hint") { + entries = cdr(entries); + id = car(entries).as_int(); + kind = SubtitleSceneKind::HintNamed; + } else { + throw std::runtime_error("Unknown parameter for subtitle scene"); + } + entries = cdr(entries); + } + + GameSubtitleSceneInfo scene(kind); + if (kind == SubtitleSceneKind::Movie || kind == SubtitleSceneKind::HintNamed) { + scene.set_name(head.as_string()->data); + } else if (kind == SubtitleSceneKind::Hint) { + id = head.as_int(); + } + scene.set_id(id); + + for_each_in_list(entries, [&](const goos::Object& entry) { if (entry.is_pair()) { // expected formats: // (time ) @@ -271,8 +295,12 @@ void parse_subtitle(const goos::Object& data, GameTextVersion text_ver, GameSubt throw std::runtime_error( "Invalid object in subtitle entry, expecting actual line string after speaker"); } else if (arg.is_symbol()) { - if (arg.as_symbol()->name == ":offscreen") { + if (scene.kind() == SubtitleSceneKind::Movie && + arg.as_symbol()->name == ":offscreen") { offscreen = true; + } else { + throw std::runtime_error( + fmt::format("Unknown parameter {} in subtitle", arg.as_symbol()->name)); } } }); @@ -287,7 +315,6 @@ void parse_subtitle(const goos::Object& data, GameTextVersion text_ver, GameSubt if (!bank->scene_exists(scene.name())) { bank->add_scene(scene); } else { - // this should copy the data, so it's safe to delete the new one afterwards. auto& old_scene = bank->scene_by_name(scene.name()); old_scene.from_other_scene(scene); } @@ -320,15 +347,19 @@ void compile_subtitle(GameSubtitleDB& db) { std::queue array_link_sources; // now add all the scene infos for (auto& [name, scene] : bank->scenes()) { - gen.add_word(0 | + gen.add_word((u16)scene.kind() | (scene.lines().size() << 16)); // kind (lower 16 bits), length (upper 16 bits) array_link_sources.push(gen.words()); gen.add_word(0); // keyframes (linked later) - gen.add_ref_to_string_in_pool(scene.name()); // name - - gen.add_word(0); // pad (string is 4 bytes but we have 8) + if (scene.kind() == SubtitleSceneKind::Movie || + scene.kind() == SubtitleSceneKind::HintNamed) { + gen.add_ref_to_string_in_pool(scene.name()); // name + } else if (scene.kind() == SubtitleSceneKind::Hint) { + gen.add_word(0); // nothing + } + gen.add_word(scene.id()); } // now add all the scene *data!* (keyframes) for (auto& [name, scene] : bank->scenes()) { diff --git a/goalc/data_compiler/game_text_common.h b/goalc/data_compiler/game_text_common.h index ed11474a31..24f528ced6 100644 --- a/goalc/data_compiler/game_text_common.h +++ b/goalc/data_compiler/game_text_common.h @@ -66,11 +66,9 @@ class GameTextDB { * The subtitle scene info (accessed through the scene name) contains all lines and their timestamps * and other settings. */ +enum class SubtitleSceneKind { Invalid = -1, Movie = 0, Hint = 1, HintNamed = 2 }; class GameSubtitleSceneInfo { public: - GameSubtitleSceneInfo() {} - GameSubtitleSceneInfo(std::string name) : m_name(name) {} - struct SubtitleLine { SubtitleLine(int frame, std::string line, std::string speaker, bool offscreen) : frame(frame), line(line), speaker(speaker), offscreen(offscreen) {} @@ -81,12 +79,22 @@ class GameSubtitleSceneInfo { bool offscreen; }; + GameSubtitleSceneInfo() {} + GameSubtitleSceneInfo(SubtitleSceneKind kind) : m_kind(kind) {} + const std::string& name() const { return m_name; } const std::vector& lines() const { return m_lines; } + int id() const { return m_id; } + SubtitleSceneKind kind() const { return m_kind; } + void clear_lines() { m_lines.clear(); } + void set_name(const std::string& new_name) { m_name = new_name; } + void set_id(int new_id) { m_id = new_id; } void from_other_scene(GameSubtitleSceneInfo& scene) { m_name = scene.name(); m_lines = scene.lines(); + m_kind = scene.kind(); + m_id = scene.id(); } void add_line(int frame, std::string line, std::string speaker, bool offscreen) { @@ -95,7 +103,9 @@ class GameSubtitleSceneInfo { private: std::string m_name; + int m_id; std::vector m_lines; + SubtitleSceneKind m_kind; }; /*! diff --git a/test/decompiler/reference/engine/ambient/ambient_REF.gc b/test/decompiler/reference/engine/ambient/ambient_REF.gc index 5eca687627..112bc03f17 100644 --- a/test/decompiler/reference/engine/ambient/ambient_REF.gc +++ b/test/decompiler/reference/engine/ambient/ambient_REF.gc @@ -695,7 +695,7 @@ *temp-string* (add-debug-text-3d #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) *temp-string* (-> arg0 bsphere) (font-color orange-red) @@ -1183,7 +1183,7 @@ (when *display-ambient-sound-marks* (add-debug-text-3d #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (symbol->string (res-lump-struct obj 'effect-name symbol :time 0.0)) gp-0 (font-color white) @@ -1211,7 +1211,7 @@ (when (and (nonzero? a1-7) *common-text*) (add-debug-text-3d #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (lookup-text! *common-text* (the-as game-text-id a1-7) #f) gp-0 (font-color white) @@ -1277,7 +1277,7 @@ ) (add-debug-text-3d #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (res-lump-struct obj 'name string) gp-0 (font-color white) @@ -1285,7 +1285,7 @@ ) (add-debug-text-3d #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (symbol->string s5-0) gp-0 (font-color white) diff --git a/test/decompiler/reference/engine/camera/cam-layout_REF.gc b/test/decompiler/reference/engine/camera/cam-layout_REF.gc index 094c80c371..58f4dc76d0 100644 --- a/test/decompiler/reference/engine/camera/cam-layout_REF.gc +++ b/test/decompiler/reference/engine/camera/cam-layout_REF.gc @@ -263,7 +263,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) + (bucket-id debug) gp-0 (the-as (pointer dma-tag) a3-4) ) diff --git a/test/decompiler/reference/engine/camera/cam-states_REF.gc b/test/decompiler/reference/engine/camera/cam-states_REF.gc index d3417d2e15..59f9336524 100644 --- a/test/decompiler/reference/engine/camera/cam-states_REF.gc +++ b/test/decompiler/reference/engine/camera/cam-states_REF.gc @@ -1392,7 +1392,7 @@ (let ((t1-0 #x40000080)) (add-debug-flat-triangle #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (the-as vector (-> gp-0 0)) (-> gp-0 0 vertex 1) (-> gp-0 0 vertex 2) diff --git a/test/decompiler/reference/engine/camera/cam-update_REF.gc b/test/decompiler/reference/engine/camera/cam-update_REF.gc index 8ab8eefb9c..0a994a3250 100644 --- a/test/decompiler/reference/engine/camera/cam-update_REF.gc +++ b/test/decompiler/reference/engine/camera/cam-update_REF.gc @@ -299,7 +299,7 @@ (when *display-level-spheres* (add-debug-sphere #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> s5-1 info bsphere) (-> s5-1 info bsphere w) (new 'static 'rgba :r #xff :a #x80) diff --git a/test/decompiler/reference/engine/camera/pov-camera-h_REF.gc b/test/decompiler/reference/engine/camera/pov-camera-h_REF.gc index e3c29f5e56..2650d5558c 100644 --- a/test/decompiler/reference/engine/camera/pov-camera-h_REF.gc +++ b/test/decompiler/reference/engine/camera/pov-camera-h_REF.gc @@ -9,7 +9,7 @@ (notify-handle handle :offset-assert 192) (anim-name string :offset-assert 200) (command-list pair :offset-assert 204) - (mask-to-clear uint32 :offset-assert 208) + (mask-to-clear process-mask :offset-assert 208) (music-volume-movie float :offset-assert 212) (sfx-volume-movie float :offset-assert 216) ) diff --git a/test/decompiler/reference/engine/camera/pov-camera_REF.gc b/test/decompiler/reference/engine/camera/pov-camera_REF.gc index 44d3e8e561..bfb66f2e1e 100644 --- a/test/decompiler/reference/engine/camera/pov-camera_REF.gc +++ b/test/decompiler/reference/engine/camera/pov-camera_REF.gc @@ -304,14 +304,14 @@ ((= (-> arg2 type) spool-anim) ) ) - (set! (-> self mask-to-clear) (the-as uint #x4a0800)) + (set! (-> self mask-to-clear) (process-mask movie enemy platform projectile)) (set! (-> self event-hook) (lambda :behavior pov-camera ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) (the-as object (cond ((= v1-0 'mask) (let ((v0-0 (the-as number (-> arg3 param 0)))) - (set! (-> self mask-to-clear) (the-as uint v0-0)) + (set! (-> self mask-to-clear) (the-as process-mask v0-0)) v0-0 ) ) diff --git a/test/decompiler/reference/engine/collide/collide-mesh_REF.gc b/test/decompiler/reference/engine/collide/collide-mesh_REF.gc index d2fb22962f..6f3b1fdffa 100644 --- a/test/decompiler/reference/engine/collide/collide-mesh_REF.gc +++ b/test/decompiler/reference/engine/collide/collide-mesh_REF.gc @@ -72,7 +72,7 @@ (.svf (&-> a2-1 quad) vf1) (.svf (&-> a3-0 quad) vf2) (.svf (&-> t0-0 quad) vf3) - (add-debug-flat-triangle #t (bucket-id debug-draw1) a2-1 a3-0 t0-0 t1-0) + (add-debug-flat-triangle #t (bucket-id debug-no-zbuf) a2-1 a3-0 t0-0 t1-0) ) ) (set! s5-0 (-> (the-as (inline-array collide-mesh-tri) s5-0) 1)) @@ -445,7 +445,3 @@ ) ) ) - - - - diff --git a/test/decompiler/reference/engine/collide/main-collide_REF.gc b/test/decompiler/reference/engine/collide/main-collide_REF.gc index 445c408522..d560e1dba7 100644 --- a/test/decompiler/reference/engine/collide/main-collide_REF.gc +++ b/test/decompiler/reference/engine/collide/main-collide_REF.gc @@ -212,11 +212,7 @@ (nop!) (let ((a2-0 (new-stack-vector0))) (.svf (&-> a2-0 quad) vf9) - (add-debug-sphere #t (bucket-id debug-draw0) a2-0 a3-0 (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80)) + (add-debug-sphere #t (bucket-id debug) a2-0 a3-0 (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80)) ) ) ) - - - - diff --git a/test/decompiler/reference/engine/debug/anim-tester_REF.gc b/test/decompiler/reference/engine/debug/anim-tester_REF.gc index c4f632bd54..21d3ac3b47 100644 --- a/test/decompiler/reference/engine/debug/anim-tester_REF.gc +++ b/test/decompiler/reference/engine/debug/anim-tester_REF.gc @@ -242,7 +242,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) + (bucket-id debug) s5-3 (the-as (pointer dma-tag) a3-6) ) @@ -371,7 +371,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) + (bucket-id debug) s5-6 (the-as (pointer dma-tag) a3-12) ) @@ -1081,7 +1081,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) + (bucket-id debug) gp-0 (the-as (pointer dma-tag) a3-2) ) @@ -1178,7 +1178,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) + (bucket-id debug) s4-0 (the-as (pointer dma-tag) a3-2) ) @@ -1253,7 +1253,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) + (bucket-id debug) s5-2 (the-as (pointer dma-tag) a3-4) ) @@ -1307,7 +1307,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) + (bucket-id debug) s4-0 (the-as (pointer dma-tag) a3-2) ) @@ -1426,7 +1426,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) + (bucket-id debug) s5-1 (the-as (pointer dma-tag) a3-4) ) @@ -1484,7 +1484,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) + (bucket-id debug) s4-0 (the-as (pointer dma-tag) a3-2) ) @@ -1598,7 +1598,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) + (bucket-id debug) s5-1 (the-as (pointer dma-tag) a3-4) ) @@ -1784,7 +1784,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) + (bucket-id debug) s1-0 (the-as (pointer dma-tag) a3-4) ) @@ -1835,7 +1835,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) + (bucket-id debug) s1-1 (the-as (pointer dma-tag) a3-8) ) @@ -1929,7 +1929,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) + (bucket-id debug) (the-as pointer s4-1) (the-as (pointer dma-tag) a3-15) ) @@ -2226,7 +2226,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) + (bucket-id debug) gp-2 (the-as (pointer dma-tag) a3-17) ) @@ -2257,7 +2257,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) + (bucket-id debug) gp-3 (the-as (pointer dma-tag) a3-21) ) @@ -2317,7 +2317,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) + (bucket-id debug) gp-1 (the-as (pointer dma-tag) a3-1) ) @@ -2359,7 +2359,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) + (bucket-id debug) gp-3 (the-as (pointer dma-tag) a3-3) ) @@ -2402,7 +2402,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) + (bucket-id debug) gp-4 (the-as (pointer dma-tag) a3-5) ) @@ -2433,7 +2433,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) + (bucket-id debug) gp-5 (the-as (pointer dma-tag) a3-7) ) @@ -2499,7 +2499,7 @@ (debug-print-channels (-> self skel) (the-as symbol *stdcon*)) (add-debug-x #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> self root trans) (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) ) diff --git a/test/decompiler/reference/engine/debug/debug_REF.gc b/test/decompiler/reference/engine/debug/debug_REF.gc index e79dedefe5..879a9863e7 100644 --- a/test/decompiler/reference/engine/debug/debug_REF.gc +++ b/test/decompiler/reference/engine/debug/debug_REF.gc @@ -1276,7 +1276,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) + (bucket-id debug) s4-0 (the-as (pointer dma-tag) a3-1) ) @@ -1410,7 +1410,7 @@ (if (!= (+ s5-1 1) (-> arg0 h-first)) (add-debug-line #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> arg0 points s5-1) (-> arg0 points (+ s5-1 1)) (new 'static 'rgba :r #x80 :g #xc0 :b #x80 :a #x80) diff --git a/test/decompiler/reference/engine/debug/menu_REF.gc b/test/decompiler/reference/engine/debug/menu_REF.gc index 10862eae61..59c1e1f9e5 100644 --- a/test/decompiler/reference/engine/debug/menu_REF.gc +++ b/test/decompiler/reference/engine/debug/menu_REF.gc @@ -877,7 +877,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) s4-0 (the-as (pointer dma-tag) a3-1) ) @@ -927,7 +927,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) s5-0 (the-as (pointer dma-tag) a3-1) ) @@ -978,7 +978,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) s5-0 (the-as (pointer dma-tag) a3-1) ) @@ -1048,7 +1048,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) s4-0 (the-as (pointer dma-tag) a3-1) ) @@ -1119,7 +1119,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) s1-0 (the-as (pointer dma-tag) a3-2) ) @@ -1157,7 +1157,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) sv-32 (the-as (pointer dma-tag) a3-3) ) diff --git a/test/decompiler/reference/engine/debug/part-tester_REF.gc b/test/decompiler/reference/engine/debug/part-tester_REF.gc index 74c9e316c2..daa70d3d34 100644 --- a/test/decompiler/reference/engine/debug/part-tester_REF.gc +++ b/test/decompiler/reference/engine/debug/part-tester_REF.gc @@ -59,7 +59,7 @@ ) (add-debug-x #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> self root trans) (the-as rgba (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80)) ) diff --git a/test/decompiler/reference/engine/draw/drawable_REF.gc b/test/decompiler/reference/engine/draw/drawable_REF.gc index 330beb78f1..6f5e89b8f2 100644 --- a/test/decompiler/reference/engine/draw/drawable_REF.gc +++ b/test/decompiler/reference/engine/draw/drawable_REF.gc @@ -157,12 +157,19 @@ (when (sphere-cull (-> arg0 bsphere)) (add-debug-sphere #t - (bucket-id debug-draw0) + (bucket-id debug) (-> arg0 bsphere) (-> arg0 bsphere w) (new 'static 'rgba :r #x80 :a #x80) ) - (add-debug-text-3d #t (bucket-id debug-draw1) arg1 (-> arg0 bsphere) (font-color white) (the-as vector2h #f)) + (add-debug-text-3d + #t + (bucket-id debug-no-zbuf) + arg1 + (-> arg0 bsphere) + (font-color white) + (the-as vector2h #f) + ) ) ) ) @@ -708,12 +715,7 @@ ) ) (if *display-lights* - (add-debug-lights - #t - (bucket-id debug-draw0) - (the-as (inline-array light) (-> s3-0 light-group)) - (-> arg1 origin) - ) + (add-debug-lights #t (bucket-id debug) (the-as (inline-array light) (-> s3-0 light-group)) (-> arg1 origin)) ) (let ((at-0 *math-camera*)) (.lvf vf16 (&-> at-0 plane 0 quad)) @@ -1533,7 +1535,7 @@ (set! (-> new-frame bucket-group) (dma-buffer-add-buckets (-> new-frame calc-buf) 69)) ) (debug-init-buffer - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (new 'static 'gs-zbuf :zbp #x1c0 :psm (gs-psm ct24) :zmsk #x1) (new 'static 'gs-test :zte #x1 :ztst (gs-ztest always)) ) diff --git a/test/decompiler/reference/engine/draw/process-drawable_REF.gc b/test/decompiler/reference/engine/draw/process-drawable_REF.gc index 8f6d47ab8f..df3a15fd77 100644 --- a/test/decompiler/reference/engine/draw/process-drawable_REF.gc +++ b/test/decompiler/reference/engine/draw/process-drawable_REF.gc @@ -381,7 +381,7 @@ (defun draw-joint-spheres ((arg0 process-drawable)) (dotimes (s5-0 (-> arg0 node-list length)) (let ((a2-0 (vector<-cspace! (new-stack-vector0) (-> arg0 node-list data s5-0)))) - (add-debug-sphere #t (bucket-id debug-draw0) a2-0 819.2 (new 'static 'rgba :g #xff :a #x40)) + (add-debug-sphere #t (bucket-id debug) a2-0 819.2 (new 'static 'rgba :g #xff :a #x40)) ) ) #f diff --git a/test/decompiler/reference/engine/entity/entity_REF.gc b/test/decompiler/reference/engine/entity/entity_REF.gc index 06e300f06c..989503c4ad 100644 --- a/test/decompiler/reference/engine/entity/entity_REF.gc +++ b/test/decompiler/reference/engine/entity/entity_REF.gc @@ -841,7 +841,7 @@ (let ((s1-1 (the-as process-drawable (-> s0-0 extra process)))) (add-debug-x #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> s1-1 root trans) (new 'static 'rgba :r #x80 :g #xff :b #x80 :a #x80) ) @@ -857,7 +857,7 @@ ) (add-debug-text-3d #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (symbol->string (-> s1-1 state name)) (-> s1-1 root trans) (font-color white) @@ -889,7 +889,7 @@ (if (and (the-as structure v0-10) (= (-> v0-10 type) symbol)) (add-debug-text-3d #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (symbol->string v0-10) (-> s1-1 root trans) (font-color white) @@ -900,11 +900,11 @@ ) ) ((or (= arg0 'full) (-> s0-0 extra process)) - (add-debug-x #t (bucket-id debug-draw1) s1-0 (the-as rgba (if (-> s0-0 extra process) - (the-as uint #x8080ff80) - (the-as uint #x800000ff) - ) - ) + (add-debug-x #t (bucket-id debug-no-zbuf) s1-0 (the-as rgba (if (-> s0-0 extra process) + (the-as uint #x8080ff80) + (the-as uint #x800000ff) + ) + ) ) (set! sv-192 add-debug-text-3d) (set! sv-208 #t) @@ -961,13 +961,13 @@ (when (and (type-type? (-> s0-3 type) process-drawable) (nonzero? (-> (the-as process-drawable s0-3) draw))) (add-debug-x #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> (the-as process-drawable s0-3) root trans) (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) ) (add-debug-sphere #t - (bucket-id debug-draw0) + (bucket-id debug) (vector+! (new 'stack-no-clear 'vector) (-> (the-as process-drawable s0-3) draw origin) @@ -1001,15 +1001,15 @@ (s4-2 (-> (the-as process-drawable s5-2) root trans)) ) (when s3-2 - (add-debug-x #t (bucket-id debug-draw1) s4-2 (the-as rgba (if (-> s3-2 extra process) - (the-as uint #x8080ff80) - (the-as uint #x800000ff) - ) - ) + (add-debug-x #t (bucket-id debug-no-zbuf) s4-2 (the-as rgba (if (-> s3-2 extra process) + (the-as uint #x8080ff80) + (the-as uint #x800000ff) + ) + ) ) (add-debug-text-3d #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (res-lump-struct s3-2 'name string) s4-2 (the-as font-color (if (logtest? (-> s3-2 extra perm status) (entity-perm-status bit-0 bit-1)) @@ -1021,7 +1021,7 @@ ) (add-debug-text-3d #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (symbol->string (-> (the-as process-drawable s5-2) state name)) s4-2 (font-color white) @@ -1049,7 +1049,7 @@ ) (add-debug-sphere #t - (bucket-id debug-draw0) + (bucket-id debug) (vector+! (new 'stack-no-clear 'vector) (-> (the-as process-drawable s5-2) draw origin) @@ -1069,7 +1069,7 @@ (if v0-35 (add-debug-box #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (the-as vector (&+ v0-35 0)) (the-as vector (&+ v0-35 16)) (the-as rgba (if (is-object-visible? (-> s5-3 extra level) a1-31) @@ -1165,7 +1165,7 @@ (countdown (s2-4 (-> s3-4 length)) (add-debug-box #t - (bucket-id debug-draw0) + (bucket-id debug) (the-as vector (-> s3-4 data s2-4)) (the-as vector (+ (the-as uint (-> s3-4 data 0 max)) (* s2-4 32))) (the-as rgba (if (zero? (-> s4-4 index)) diff --git a/test/decompiler/reference/engine/game/game-info_REF.gc b/test/decompiler/reference/engine/game/game-info_REF.gc index 69fbef0f4b..1d5c53ee7e 100644 --- a/test/decompiler/reference/engine/game/game-info_REF.gc +++ b/test/decompiler/reference/engine/game/game-info_REF.gc @@ -11,8 +11,8 @@ ) ) ) - (add-debug-text-sphere #t (bucket-id debug-draw1) (-> obj trans) 819.2 (symbol->string (-> obj name)) s5-0) - (add-debug-vector #t (bucket-id debug-draw1) (-> obj trans) (-> obj normal) (meters 2.0) s5-0) + (add-debug-text-sphere #t (bucket-id debug-no-zbuf) (-> obj trans) 819.2 (symbol->string (-> obj name)) s5-0) + (add-debug-vector #t (bucket-id debug-no-zbuf) (-> obj trans) (-> obj normal) (meters 2.0) s5-0) ) 0 (none) @@ -734,10 +734,10 @@ ;; INFO: Return type mismatch int vs none. ;; Used lq/sq (defmethod debug-draw! continue-point ((obj continue-point)) - (add-debug-x #t (bucket-id debug-draw1) (-> obj trans) (new 'static 'rgba :r #xff :a #x80)) + (add-debug-x #t (bucket-id debug-no-zbuf) (-> obj trans) (new 'static 'rgba :r #xff :a #x80)) (add-debug-text-3d #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> obj name) (-> obj trans) (font-color white) @@ -746,7 +746,7 @@ (let ((a3-2 (vector-z-quaternion! (new-stack-vector0) (-> obj quat)))) (add-debug-vector #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> obj trans) a3-2 (meters 2.0) diff --git a/test/decompiler/reference/engine/game/generic-obs-h_REF.gc b/test/decompiler/reference/engine/game/generic-obs-h_REF.gc index a7ed5cd29b..198df89ed9 100644 --- a/test/decompiler/reference/engine/game/generic-obs-h_REF.gc +++ b/test/decompiler/reference/engine/game/generic-obs-h_REF.gc @@ -134,9 +134,9 @@ (grab-target handle :offset 120) (grab-event symbol :offset-assert 128) (release-event symbol :offset-assert 132) - (old-global-mask uint32 :offset-assert 136) - (old-self-mask uint32 :offset-assert 140) - (old-parent-mask uint32 :offset-assert 144) + (old-global-mask process-mask :offset-assert 136) + (old-self-mask process-mask :offset-assert 140) + (old-parent-mask process-mask :offset-assert 144) (look-at-target handle :offset-assert 152) (pov-target handle :offset-assert 160) (work-process handle :offset-assert 168) @@ -146,7 +146,7 @@ (userdata basic :offset-assert 196) (message basic :offset-assert 200) (border-value basic :offset-assert 204) - (mask-to-clear uint32 :offset-assert 208) + (mask-to-clear process-mask :offset-assert 208) (script pair :offset-assert 212) (script-line pair :offset-assert 216) (script-func (function none) :offset-assert 220) @@ -288,17 +288,17 @@ ;; definition of type othercam (deftype othercam (process) - ((hand handle :offset-assert 112) - (old-global-mask uint32 :offset-assert 120) - (mask-to-clear uint32 :offset-assert 124) - (cam-joint-index int32 :offset-assert 128) - (old-pos vector :inline :offset-assert 144) - (old-mat-z vector :inline :offset-assert 160) - (had-valid-frame basic :offset-assert 176) - (border-value basic :offset-assert 180) - (die? symbol :offset-assert 184) - (survive-anim-end? symbol :offset-assert 188) - (spooling? symbol :offset-assert 192) + ((hand handle :offset-assert 112) + (old-global-mask process-mask :offset-assert 120) + (mask-to-clear process-mask :offset-assert 124) + (cam-joint-index int32 :offset-assert 128) + (old-pos vector :inline :offset-assert 144) + (old-mat-z vector :inline :offset-assert 160) + (had-valid-frame basic :offset-assert 176) + (border-value basic :offset-assert 180) + (die? symbol :offset-assert 184) + (survive-anim-end? symbol :offset-assert 188) + (spooling? symbol :offset-assert 192) ) :heap-base #x60 :method-count-assert 14 diff --git a/test/decompiler/reference/engine/game/generic-obs_REF.gc b/test/decompiler/reference/engine/game/generic-obs_REF.gc index 2054c63bac..a299617fdb 100644 --- a/test/decompiler/reference/engine/game/generic-obs_REF.gc +++ b/test/decompiler/reference/engine/game/generic-obs_REF.gc @@ -1223,7 +1223,7 @@ ) ((= v1-0 'mask) (set! v0-0 (-> arg3 param 0)) - (set! (-> self mask-to-clear) v0-0) + (set! (-> self mask-to-clear) (the-as process-mask v0-0)) v0-0 ) ((= v1-0 'border) @@ -1283,7 +1283,7 @@ (defbehavior camera-tracker-init camera-tracker ((arg0 object)) (stack-size-set! (-> self main-thread) 512) (logclear! (-> self mask) (process-mask actor-pause movie enemy platform projectile)) - (set! (-> self mask-to-clear) (the-as uint #x4a0800)) + (set! (-> self mask-to-clear) (process-mask movie enemy platform projectile)) (set! (-> self grab-target) (the-as handle #f)) (set! (-> self grab-event) 'grab) (set! (-> self release-event) 'end-mode) diff --git a/test/decompiler/reference/engine/game/main_REF.gc b/test/decompiler/reference/engine/game/main_REF.gc index b6a0bc64a0..39d4320923 100644 --- a/test/decompiler/reference/engine/game/main_REF.gc +++ b/test/decompiler/reference/engine/game/main_REF.gc @@ -25,7 +25,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) gp-0 (the-as (pointer dma-tag) a3-2) ) @@ -62,7 +62,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) sprite-dma-data (the-as (pointer dma-tag) a3-1) ) @@ -265,7 +265,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) gp-0 (the-as (pointer dma-tag) a3-1) ) @@ -878,7 +878,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) + (bucket-id debug) dma-start (the-as (pointer dma-tag) a3-9) ) @@ -1271,7 +1271,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) s4-3 (the-as (pointer dma-tag) a3-6) ) @@ -1320,7 +1320,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) + (bucket-id debug) s4-4 (the-as (pointer dma-tag) a3-9) ) diff --git a/test/decompiler/reference/engine/game/task/process-taskable_REF.gc b/test/decompiler/reference/engine/game/task/process-taskable_REF.gc index b8fa020658..060ee414a3 100644 --- a/test/decompiler/reference/engine/game/task/process-taskable_REF.gc +++ b/test/decompiler/reference/engine/game/task/process-taskable_REF.gc @@ -88,7 +88,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) + (bucket-id debug) s5-0 (the-as (pointer dma-tag) a3-4) ) @@ -117,7 +117,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) + (bucket-id debug) s5-1 (the-as (pointer dma-tag) a3-7) ) @@ -1356,7 +1356,7 @@ ) (('mask) (set! v0-0 (-> arg3 param 0)) - (set! (-> self mask-to-clear) (the-as uint v0-0)) + (set! (-> self mask-to-clear) (the-as process-mask v0-0)) v0-0 ) ) @@ -1478,7 +1478,7 @@ (set! (-> self border-value) #f) (set! (-> self die?) #f) (set! (-> self survive-anim-end?) arg2) - (set! (-> self mask-to-clear) (the-as uint #x4a0800)) + (set! (-> self mask-to-clear) (process-mask movie enemy platform projectile)) (set! (-> self event-hook) (-> othercam-running event)) (go othercam-running) 0 diff --git a/test/decompiler/reference/engine/geometry/vol_REF.gc b/test/decompiler/reference/engine/geometry/vol_REF.gc index e1c8992617..b51228f5e8 100644 --- a/test/decompiler/reference/engine/geometry/vol_REF.gc +++ b/test/decompiler/reference/engine/geometry/vol_REF.gc @@ -191,7 +191,7 @@ (dotimes (s3-0 (/ (-> obj point-count) 2)) (add-debug-line #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (the-as vector s4-0) (the-as vector (&-> s4-0 4)) (the-as rgba s5-0) diff --git a/test/decompiler/reference/engine/gfx/ripple_REF.gc b/test/decompiler/reference/engine/gfx/ripple_REF.gc index d6dd9e535f..66da0a07ca 100644 --- a/test/decompiler/reference/engine/gfx/ripple_REF.gc +++ b/test/decompiler/reference/engine/gfx/ripple_REF.gc @@ -144,7 +144,7 @@ ) (set! (-> s5-0 w) 0.0) (vector+! s5-0 s5-0 (-> arg0 root trans)) - (add-debug-sphere #t (bucket-id debug-draw0) s5-0 2048.0 (new 'static 'rgba :r #xff :g #xff :a #x80)) + (add-debug-sphere #t (bucket-id debug) s5-0 2048.0 (new 'static 'rgba :r #xff :g #xff :a #x80)) ) (none) ) diff --git a/test/decompiler/reference/engine/gfx/tfrag/tfrag-methods_REF.gc b/test/decompiler/reference/engine/gfx/tfrag/tfrag-methods_REF.gc index 2f47ddb2be..ec4f991765 100644 --- a/test/decompiler/reference/engine/gfx/tfrag/tfrag-methods_REF.gc +++ b/test/decompiler/reference/engine/gfx/tfrag/tfrag-methods_REF.gc @@ -11,7 +11,7 @@ (dotimes (s3-0 (/ (-> s4-0 length) 2)) (add-debug-line #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> s4-0 data (* s3-0 2)) (-> s4-0 data (+ (* s3-0 2) 1)) (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) diff --git a/test/decompiler/reference/engine/level/load-boundary_REF.gc b/test/decompiler/reference/engine/level/load-boundary_REF.gc index b5b75d2057..e4df254011 100644 --- a/test/decompiler/reference/engine/level/load-boundary_REF.gc +++ b/test/decompiler/reference/engine/level/load-boundary_REF.gc @@ -418,7 +418,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) + (bucket-id debug) gp-0 (the-as (pointer dma-tag) a3-2) ) @@ -494,10 +494,10 @@ (let ((s2-0 (new 'stack-no-clear 'vector))) (set! (-> s2-0 quad) (-> s5-0 data (-> gp-0 vertex) quad)) (set! (-> s2-0 y) (-> s5-0 top-plane)) - (add-debug-sphere #t (bucket-id debug-draw1) s2-0 8192.0 (new 'static 'rgba :a #x80)) + (add-debug-sphere #t (bucket-id debug-no-zbuf) s2-0 8192.0 (new 'static 'rgba :a #x80)) (when (zero? (logand (-> s5-0 flags) (load-boundary-flags closed))) (set! (-> s2-0 y) (-> s5-0 bot-plane)) - (add-debug-sphere #t (bucket-id debug-draw1) s2-0 8192.0 (new 'static 'rgba :a #x80)) + (add-debug-sphere #t (bucket-id debug-no-zbuf) s2-0 8192.0 (new 'static 'rgba :a #x80)) ) ) ) diff --git a/test/decompiler/reference/engine/nav/navigate_REF.gc b/test/decompiler/reference/engine/nav/navigate_REF.gc index cf55cf20f8..3f06085620 100644 --- a/test/decompiler/reference/engine/nav/navigate_REF.gc +++ b/test/decompiler/reference/engine/nav/navigate_REF.gc @@ -236,7 +236,7 @@ ) (add-debug-line #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (vector+! gp-0 s5-0 (the-as vector (-> s2-0 (-> arg0 vertex 0)))) (vector+! s4-0 s5-0 (the-as vector (-> s2-0 (-> arg0 vertex 1)))) arg1 @@ -245,7 +245,7 @@ ) (add-debug-line #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (vector+! gp-0 s5-0 (the-as vector (-> s2-0 (-> arg0 vertex 1)))) (vector+! s4-0 s5-0 (the-as vector (-> s2-0 (-> arg0 vertex 2)))) arg1 @@ -254,7 +254,7 @@ ) (add-debug-line #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (vector+! gp-0 s5-0 (the-as vector (-> s2-0 (-> arg0 vertex 2)))) (vector+! s4-0 s5-0 (the-as vector (-> s2-0 (-> arg0 vertex 0)))) arg1 @@ -1748,18 +1748,18 @@ (set! (-> s5-0 debug-time) (the-as uint (-> *display* actual-frame-counter))) (add-debug-sphere (logtest? (-> obj flags) (nav-control-flags navcf1)) - (bucket-id debug-draw0) + (bucket-id debug) (-> s5-0 bounds) (-> s5-0 bounds w) (new 'static 'rgba :r #xff :g #xff :a #x20) ) - (add-debug-vector #t (bucket-id debug-draw1) (-> s5-0 origin) *x-vector* (meters 1.0) *color-red*) - (add-debug-vector #t (bucket-id debug-draw1) (-> s5-0 origin) *z-vector* (meters 1.0) *color-blue*) + (add-debug-vector #t (bucket-id debug-no-zbuf) (-> s5-0 origin) *x-vector* (meters 1.0) *color-red*) + (add-debug-vector #t (bucket-id debug-no-zbuf) (-> s5-0 origin) *z-vector* (meters 1.0) *color-blue*) (when (logtest? (-> obj flags) (nav-control-flags navcf2)) (dotimes (s3-0 (-> s5-0 vertex-count)) (add-debug-x #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (vector+! s4-0 (-> s5-0 origin) (the-as vector (-> s5-0 vertex s3-0))) *color-green* ) @@ -1795,9 +1795,9 @@ (set! (-> s0-0 x) (- (-> a0-15 x) (-> v1-20 x))) (set! (-> s0-0 y) (+ (-> a0-15 y) (-> v1-20 y))) (set! (-> s0-0 z) (+ (-> a0-15 z) (-> v1-20 z))) - (add-debug-line #t (bucket-id debug-draw1) sv-192 s2-0 (the-as rgba sv-208) #f (the-as rgba -1)) - (add-debug-line #t (bucket-id debug-draw1) s2-0 s1-0 (the-as rgba sv-208) #f (the-as rgba -1)) - (add-debug-line #t (bucket-id debug-draw1) s1-0 s0-0 (the-as rgba sv-208) #f (the-as rgba -1)) + (add-debug-line #t (bucket-id debug-no-zbuf) sv-192 s2-0 (the-as rgba sv-208) #f (the-as rgba -1)) + (add-debug-line #t (bucket-id debug-no-zbuf) s2-0 s1-0 (the-as rgba sv-208) #f (the-as rgba -1)) + (add-debug-line #t (bucket-id debug-no-zbuf) s1-0 s0-0 (the-as rgba sv-208) #f (the-as rgba -1)) (let ((t9-7 add-debug-line) (a0-19 #t) (a1-13 68) @@ -1873,7 +1873,7 @@ (when (logtest? (-> obj flags) (nav-control-flags navcf7)) (dotimes (s3-3 (the-as int (-> s5-0 static-sphere-count))) (let ((s2-2 (-> s5-0 static-sphere s3-3))) - (add-debug-sphere #t (bucket-id debug-draw0) (the-as vector s2-2) (-> s2-2 trans w) *color-blue*) + (add-debug-sphere #t (bucket-id debug) (the-as vector s2-2) (-> s2-2 trans w) *color-blue*) (let ((s1-2 add-debug-text-3d) (s0-2 #t) ) @@ -1911,7 +1911,7 @@ ) (add-debug-line #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (vector+! a2-22 v1-80 (the-as vector (-> obj portal 0))) (vector+! a3-13 v1-80 (the-as vector (-> obj portal 1))) (new 'static 'rgba :r #xff :g #x80 :b #x40 :a #x80) @@ -1922,7 +1922,7 @@ ) (add-debug-vector #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> obj shape trans) (-> obj travel) (meters 0.00024414062) @@ -1930,7 +1930,7 @@ ) (add-debug-vector #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (vector+! (new 'stack-no-clear 'vector) (-> obj shape trans) (new 'static 'vector :y 4096.0 :w 1.0)) (-> obj old-travel) (meters 0.00024414062) @@ -1938,7 +1938,7 @@ ) (add-debug-x #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (vector+! (new 'stack-no-clear 'vector) (-> obj shape trans) (-> obj travel)) (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) ) @@ -1946,7 +1946,7 @@ (when (logtest? (-> obj flags) (nav-control-flags navcf7)) (add-debug-sphere #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (the-as vector (-> obj shape root-prim prim-core)) (-> obj shape nav-radius) (new 'static 'rgba :g #xff :b #xff :a #x20) @@ -1956,7 +1956,7 @@ (vector+! s4-0 (-> s5-0 origin) (the-as vector (&-> v1-95 x))) (add-debug-sphere #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) s4-0 (- (-> v1-95 w) (-> obj shape nav-radius)) (new 'static 'rgba :g #xff :b #xff :a #x20) diff --git a/test/decompiler/reference/engine/nav/path_REF.gc b/test/decompiler/reference/engine/nav/path_REF.gc index 50a6f7e52d..502a980024 100644 --- a/test/decompiler/reference/engine/nav/path_REF.gc +++ b/test/decompiler/reference/engine/nav/path_REF.gc @@ -31,7 +31,7 @@ (if (and (logtest? (-> obj flags) (path-control-flag draw-line)) (< s5-1 (+ (-> obj curve num-cverts) -1))) (add-debug-line #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) s4-1 (-> obj cverts (+ s5-1 1)) (new 'static 'rgba :r #xff :g #x80 :a #x80) @@ -40,7 +40,7 @@ ) ) (if (logtest? (-> obj flags) (path-control-flag draw-point)) - (add-debug-x #t (bucket-id debug-draw1) s4-1 (new 'static 'rgba :r #xff :a #x80)) + (add-debug-x #t (bucket-id debug-no-zbuf) s4-1 (new 'static 'rgba :r #xff :a #x80)) ) (when (logtest? (-> obj flags) (path-control-flag draw-text)) (let ((s3-1 add-debug-text-3d) @@ -308,7 +308,7 @@ (if (and (logtest? (-> obj flags) (path-control-flag draw-line)) (> (-> obj curve num-cverts) 0)) (add-debug-curve2 #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (the-as curve (&-> obj cverts)) (new 'static 'rgba :r #xff :g #x80 :a #x80) #f @@ -317,7 +317,7 @@ (dotimes (s5-1 (-> obj curve num-cverts)) (let ((s4-1 (-> obj cverts s5-1))) (if (logtest? (-> obj flags) (path-control-flag draw-point)) - (add-debug-x #t (bucket-id debug-draw1) s4-1 (new 'static 'rgba :r #xff :a #x80)) + (add-debug-x #t (bucket-id debug-no-zbuf) s4-1 (new 'static 'rgba :r #xff :a #x80)) ) (when (logtest? (-> obj flags) (path-control-flag draw-text)) (let ((s3-1 add-debug-text-3d) diff --git a/test/decompiler/reference/engine/physics/trajectory_REF.gc b/test/decompiler/reference/engine/physics/trajectory_REF.gc index c92a12838c..9ec801bf4e 100644 --- a/test/decompiler/reference/engine/physics/trajectory_REF.gc +++ b/test/decompiler/reference/engine/physics/trajectory_REF.gc @@ -99,7 +99,7 @@ ) (add-debug-line #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) prev-pos pos (new 'static 'rgba :r #xff :a #x80) diff --git a/test/decompiler/reference/engine/sparticle/sparticle-launcher_REF.gc b/test/decompiler/reference/engine/sparticle/sparticle-launcher_REF.gc index d4d67e2776..7ae64adac6 100644 --- a/test/decompiler/reference/engine/sparticle/sparticle-launcher_REF.gc +++ b/test/decompiler/reference/engine/sparticle/sparticle-launcher_REF.gc @@ -1025,13 +1025,7 @@ (let ((gp-1 (vector+! (new 'stack-no-clear 'vector) arg0 (the-as vector (-> v1-0 bounds))))) (set! (-> gp-1 w) f0-0) (if (and *display-actor-vis* (or (not *display-actor-anim*) (name= *display-actor-anim* (-> obj proc name)))) - (add-debug-sphere - *display-actor-vis* - (bucket-id debug-draw0) - gp-1 - (-> gp-1 w) - (new 'static 'rgba :g #xff :a #x80) - ) + (add-debug-sphere *display-actor-vis* (bucket-id debug) gp-1 (-> gp-1 w) (new 'static 'rgba :g #xff :a #x80)) ) (sphere-in-view-frustum? (the-as sphere gp-1)) ) diff --git a/test/decompiler/reference/engine/target/joint-mod-h_REF.gc b/test/decompiler/reference/engine/target/joint-mod-h_REF.gc index b01bc96353..8528058592 100644 --- a/test/decompiler/reference/engine/target/joint-mod-h_REF.gc +++ b/test/decompiler/reference/engine/target/joint-mod-h_REF.gc @@ -66,7 +66,7 @@ ;; definition (debug) for function joint-mod-debug-draw ;; INFO: Return type mismatch int vs none. (defun-debug joint-mod-debug-draw ((mod joint-mod)) - (add-debug-matrix #t (bucket-id debug-draw1) (-> mod joint bone transform)) + (add-debug-matrix #t (bucket-id debug-no-zbuf) (-> mod joint bone transform)) 0 (none) ) @@ -381,7 +381,7 @@ (if (and (= (-> gp-0 process type) target) (!= (-> gp-0 blend) 0.0)) (add-debug-text-sphere *display-target-marks* - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> gp-0 target) 819.2 "look" @@ -486,7 +486,7 @@ (if (and (= (-> gp-0 process type) target) (!= (-> gp-0 blend) 0.0)) (add-debug-text-sphere *display-target-marks* - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> gp-0 target) 819.2 "look" diff --git a/test/decompiler/reference/engine/target/logic-target_REF.gc b/test/decompiler/reference/engine/target/logic-target_REF.gc index 773460b8cc..c742e7d50a 100644 --- a/test/decompiler/reference/engine/target/logic-target_REF.gc +++ b/test/decompiler/reference/engine/target/logic-target_REF.gc @@ -93,7 +93,7 @@ (let ((s2-0 (-> arg0 history-data (logand (+ (-> arg0 unknown-halfword00) s4-0) 127)))) (add-debug-line (logtest? s5-0 2) - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> v1-19 trans) (-> s2-0 trans) (the-as rgba (+ #xffff00 (shl s4-0 24))) @@ -102,7 +102,7 @@ ) (add-debug-vector (logtest? s5-0 4) - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> s2-0 trans) (-> s2-0 transv) (meters 0.000024414063) @@ -111,7 +111,7 @@ (when (zero? (logand (-> s2-0 status) 256)) (add-debug-line (logtest? s5-0 1) - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> s1-0 intersect) (-> s2-0 intersect) (the-as rgba (+ #xffffff (shl s4-0 24))) @@ -124,7 +124,7 @@ ) (add-debug-vector (logtest? s5-0 32) - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> s2-0 intersect) (-> s2-0 surface-normal) (meters 1.0) @@ -132,7 +132,7 @@ ) (add-debug-vector (logtest? s5-0 16) - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> s2-0 intersect) (-> s2-0 local-normal) (meters 1.0) @@ -141,7 +141,7 @@ ) (add-debug-vector (logtest? s5-0 8) - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> s2-0 trans) (-> s2-0 transv-out) (meters 0.000024414063) @@ -651,7 +651,7 @@ (vector+! gp-1 gp-1 (-> self control trans)) (add-debug-text-sphere *display-target-marks* - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) gp-1 819.2 "target" @@ -829,7 +829,7 @@ (vector+! gp-1 gp-1 (-> self control trans)) (add-debug-text-sphere *display-target-marks* - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) gp-1 819.2 "ltransv" @@ -840,7 +840,7 @@ (vector+! gp-1 gp-1 (-> self control trans)) (add-debug-text-sphere *display-target-marks* - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) gp-1 819.2 "btransv" @@ -961,7 +961,7 @@ ) (add-debug-vector *display-target-marks* - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> self control trans) gp-0 (meters 2.0) @@ -969,7 +969,7 @@ ) (add-debug-vector *display-target-marks* - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> self control trans) s5-0 (meters 2.0) @@ -978,7 +978,7 @@ ) (add-debug-vector *display-target-marks* - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> self control trans) (-> self control unknown-matrix01 vector 2) (meters 2.0) @@ -1232,7 +1232,7 @@ ) (add-debug-vector *display-target-marks* - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> self control trans) (-> self control ground-poly-normal) (meters 2.0) @@ -1240,7 +1240,7 @@ ) (add-debug-vector *display-target-marks* - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> self control trans) (-> self control local-normal) (meters 2.0) @@ -1248,7 +1248,7 @@ ) (add-debug-vector *display-target-marks* - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> self control trans) (-> self control unknown-dynamics00 gravity-normal) (meters 2.5) @@ -1256,7 +1256,7 @@ ) (add-debug-vector *display-target-marks* - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> self control trans) (-> self control dynam gravity-normal) (meters 3.0) @@ -1387,7 +1387,7 @@ (when *display-edge-collision-marks* (add-debug-vector #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> (the-as swingpole s4-0) root trans) (the-as vector (&-> s4-0 stack 16)) (meters 3.0) @@ -1395,21 +1395,21 @@ ) (add-debug-sphere #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> (the-as swingpole s4-0) root trans) (-> (the-as swingpole s4-0) range) (new 'static 'rgba :r #xff :g #xff :a #x80) ) (add-debug-sphere #t - (bucket-id debug-draw0) + (bucket-id debug) (-> self control unknown-vector90) 819.2 (new 'static 'rgba :r #xff :a #x80) ) - (add-debug-sphere #t (bucket-id debug-draw1) s3-0 819.2 (new 'static 'rgba :g #xff :a #x80)) - (add-debug-sphere #t (bucket-id debug-draw1) s2-0 819.2 (new 'static 'rgba :g #xff :b #x40 :a #x80)) - (add-debug-sphere #t (bucket-id debug-draw1) s5-0 819.2 (new 'static 'rgba :b #xff :a #x80)) + (add-debug-sphere #t (bucket-id debug-no-zbuf) s3-0 819.2 (new 'static 'rgba :g #xff :a #x80)) + (add-debug-sphere #t (bucket-id debug-no-zbuf) s2-0 819.2 (new 'static 'rgba :g #xff :b #x40 :a #x80)) + (add-debug-sphere #t (bucket-id debug-no-zbuf) s5-0 819.2 (new 'static 'rgba :b #xff :a #x80)) ) ) (let ((s4-2 (vector-! (new-stack-vector0) s5-0 (-> self control unknown-vector90)))) diff --git a/test/decompiler/reference/engine/target/sidekick_REF.gc b/test/decompiler/reference/engine/target/sidekick_REF.gc index 313b95d8fa..1a35242b1d 100644 --- a/test/decompiler/reference/engine/target/sidekick_REF.gc +++ b/test/decompiler/reference/engine/target/sidekick_REF.gc @@ -173,21 +173,21 @@ (debug-print-channels (-> self skel) (the-as symbol *stdcon*)) (add-debug-sphere *display-sidekick-stats* - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> self parent-override 0 control unknown-cspace10 parent bone transform vector 3) 409.6 (new 'static 'rgba :g #xff :a #x80) ) (add-debug-sphere *display-sidekick-stats* - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> self node-list data 3 bone transform vector 3) 409.6 (new 'static 'rgba :r #xff :g #xff :a #x80) ) (add-debug-sphere *display-sidekick-stats* - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> self draw origin) 409.6 (new 'static 'rgba :r #xff :g #x80 :a #x80) diff --git a/test/decompiler/reference/engine/target/target-util_REF.gc b/test/decompiler/reference/engine/target/target-util_REF.gc index 4bbea07c94..88c9eb5b44 100644 --- a/test/decompiler/reference/engine/target/target-util_REF.gc +++ b/test/decompiler/reference/engine/target/target-util_REF.gc @@ -1299,7 +1299,7 @@ ((logtest? (-> gp-0 state-flags) 1024) (add-debug-sphere *display-camera-marks* - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> gp-0 alt-cam-pos) 819.2 (new 'static 'rgba :r #xff :a #x80) @@ -1309,7 +1309,7 @@ ((logtest? #x20000 (-> gp-0 state-flags)) (add-debug-sphere *display-camera-marks* - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> gp-0 alt-cam-pos) 819.2 (new 'static 'rgba :r #xff :a #x80) @@ -1322,7 +1322,7 @@ (set! (-> (the-as vector s5-0) y) (fmax (-> (the-as vector s5-0) y) (-> gp-0 alt-cam-pos y))) (add-debug-sphere *display-camera-marks* - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (the-as vector s5-0) 819.2 (new 'static 'rgba :r #xff :a #x80) @@ -1333,7 +1333,7 @@ (else (add-debug-sphere *display-camera-marks* - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (the-as vector (&-> (-> gp-0 control) unknown-qword00)) 819.2 (new 'static 'rgba :r #xff :a #x80) diff --git a/test/decompiler/reference/engine/ui/hud-classes_REF.gc b/test/decompiler/reference/engine/ui/hud-classes_REF.gc index bd0a1d035e..e07d1ad421 100644 --- a/test/decompiler/reference/engine/ui/hud-classes_REF.gc +++ b/test/decompiler/reference/engine/ui/hud-classes_REF.gc @@ -181,7 +181,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) + (bucket-id debug) gp-0 (the-as (pointer dma-tag) a3-7) ) @@ -619,7 +619,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) + (bucket-id debug) s4-1 (the-as (pointer dma-tag) a3-12) ) @@ -864,7 +864,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) + (bucket-id debug) gp-0 (the-as (pointer dma-tag) a3-7) ) @@ -1307,7 +1307,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) + (bucket-id debug) gp-0 (the-as (pointer dma-tag) a3-7) ) @@ -1619,7 +1619,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) + (bucket-id debug) gp-0 (the-as (pointer dma-tag) a3-7) ) diff --git a/test/decompiler/reference/engine/ui/progress/progress-draw_REF.gc b/test/decompiler/reference/engine/ui/progress/progress-draw_REF.gc index de02532bef..ae827af4cc 100644 --- a/test/decompiler/reference/engine/ui/progress/progress-draw_REF.gc +++ b/test/decompiler/reference/engine/ui/progress/progress-draw_REF.gc @@ -2045,7 +2045,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) + (bucket-id debug) s4-0 (the-as (pointer dma-tag) a3-4) ) @@ -2154,7 +2154,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) + (bucket-id debug) s4-4 (the-as (pointer dma-tag) a3-9) ) diff --git a/test/decompiler/reference/engine/ui/progress/progress_REF.gc b/test/decompiler/reference/engine/ui/progress/progress_REF.gc index bad5a971c3..4e13924def 100644 --- a/test/decompiler/reference/engine/ui/progress/progress_REF.gc +++ b/test/decompiler/reference/engine/ui/progress/progress_REF.gc @@ -2624,7 +2624,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) + (bucket-id debug) gp-0 (the-as (pointer dma-tag) a3-4) ) @@ -2646,7 +2646,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) + (bucket-id debug) gp-1 (the-as (pointer dma-tag) a3-6) ) @@ -2668,7 +2668,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) + (bucket-id debug) gp-2 (the-as (pointer dma-tag) a3-8) ) @@ -2690,7 +2690,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) + (bucket-id debug) gp-3 (the-as (pointer dma-tag) a3-10) ) diff --git a/test/decompiler/reference/engine/ui/text_REF.gc b/test/decompiler/reference/engine/ui/text_REF.gc index 283a948276..53c27f079e 100644 --- a/test/decompiler/reference/engine/ui/text_REF.gc +++ b/test/decompiler/reference/engine/ui/text_REF.gc @@ -243,16 +243,16 @@ (set-vector! s5-0 128 128 128 128) (add-debug-line2d #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (the-as vector (-> gp-0 vector)) (-> gp-0 vector 1) (the-as vector s5-0) ) - (add-debug-line2d #t (bucket-id debug-draw1) (-> gp-0 vector 1) (-> gp-0 vector 2) (the-as vector s5-0)) - (add-debug-line2d #t (bucket-id debug-draw1) (-> gp-0 vector 2) (-> gp-0 vector 3) (the-as vector s5-0)) + (add-debug-line2d #t (bucket-id debug-no-zbuf) (-> gp-0 vector 1) (-> gp-0 vector 2) (the-as vector s5-0)) + (add-debug-line2d #t (bucket-id debug-no-zbuf) (-> gp-0 vector 2) (-> gp-0 vector 3) (the-as vector s5-0)) (add-debug-line2d #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> gp-0 vector 3) (the-as vector (-> gp-0 vector)) (the-as vector s5-0) @@ -522,7 +522,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) + (bucket-id debug) s2-1 (the-as (pointer dma-tag) a3-3) ) diff --git a/test/decompiler/reference/levels/common/ropebridge_REF.gc b/test/decompiler/reference/levels/common/ropebridge_REF.gc index 246acc7165..3aa2df9b28 100644 --- a/test/decompiler/reference/levels/common/ropebridge_REF.gc +++ b/test/decompiler/reference/levels/common/ropebridge_REF.gc @@ -934,7 +934,7 @@ ) (countdown (s3-0 (-> obj tuning num-spring-points)) (vector-matrix*! s4-0 (-> s5-0 local-pos) gp-0) - (add-debug-sphere #t (bucket-id debug-draw0) s4-0 2048.0 (new 'static 'rgba :r #xff :g #xff :b #xff :a #x40)) + (add-debug-sphere #t (bucket-id debug) s4-0 2048.0 (new 'static 'rgba :r #xff :g #xff :b #xff :a #x40)) (&+! s5-0 48) ) ) diff --git a/test/decompiler/reference/levels/jungle/fisher_REF.gc b/test/decompiler/reference/levels/jungle/fisher_REF.gc index a2c7941bc1..7994410cac 100644 --- a/test/decompiler/reference/levels/jungle/fisher_REF.gc +++ b/test/decompiler/reference/levels/jungle/fisher_REF.gc @@ -1554,7 +1554,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) + (bucket-id debug) gp-0 (the-as (pointer dma-tag) a3-1) ) diff --git a/test/decompiler/reference/levels/misty/mistycannon_REF.gc b/test/decompiler/reference/levels/misty/mistycannon_REF.gc index ca1fbfc9fa..5cfe64f04d 100644 --- a/test/decompiler/reference/levels/misty/mistycannon_REF.gc +++ b/test/decompiler/reference/levels/misty/mistycannon_REF.gc @@ -1936,7 +1936,7 @@ (if (nonzero? gp-0) (debug-percent-bar #t - (bucket-id debug-draw0) + (bucket-id debug) 192 160 (* 0.0033333334 (the float gp-0)) diff --git a/test/decompiler/reference/levels/ogre/ogreboss_REF.gc b/test/decompiler/reference/levels/ogre/ogreboss_REF.gc index f2b8c11002..ae4d5bf769 100644 --- a/test/decompiler/reference/levels/ogre/ogreboss_REF.gc +++ b/test/decompiler/reference/levels/ogre/ogreboss_REF.gc @@ -322,7 +322,7 @@ ) (add-debug-vector #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) s4-1 s3-0 (meters 0.00024414062) diff --git a/test/decompiler/reference/levels/racer_common/target-racer_REF.gc b/test/decompiler/reference/levels/racer_common/target-racer_REF.gc index edf60f2b8d..87bc1a8a13 100644 --- a/test/decompiler/reference/levels/racer_common/target-racer_REF.gc +++ b/test/decompiler/reference/levels/racer_common/target-racer_REF.gc @@ -203,7 +203,7 @@ (let ((f30-4 (* (deg-diff f30-3 0.0) (-> self racer slide-grip-mult)))) (add-debug-vector *display-target-marks* - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> self control trans) (-> self control transv) (meters 0.000061035156) @@ -230,7 +230,7 @@ (vector-float*! gp-1 gp-1 0.5) (add-debug-vector *display-target-marks* - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> self control trans) gp-1 (meters 0.00024414062) @@ -239,7 +239,7 @@ (vector+! gp-1 gp-1 (-> self control trans)) (add-debug-text-sphere *display-target-marks* - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) gp-1 819.2 "ltransv" @@ -250,7 +250,7 @@ (vector+! gp-1 gp-1 (-> self control trans)) (add-debug-text-sphere *display-target-marks* - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) gp-1 819.2 "nose" @@ -374,7 +374,7 @@ (+! (-> a2-1 y) (-> self racer cushion-bob)) (add-debug-sphere *display-target-marks* - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) a2-1 819.2 (new 'static 'rgba :r #xff :b #xff :a #x80) diff --git a/test/decompiler/reference/levels/sunken/target-tube_REF.gc b/test/decompiler/reference/levels/sunken/target-tube_REF.gc index 65fd7623d1..ca020148ce 100644 --- a/test/decompiler/reference/levels/sunken/target-tube_REF.gc +++ b/test/decompiler/reference/levels/sunken/target-tube_REF.gc @@ -212,7 +212,7 @@ (vector-flatten! s4-1 s4-1 (-> self control local-normal)) (add-debug-vector *display-target-marks* - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> self control trans) s4-1 (meters 0.00024414062) @@ -280,7 +280,7 @@ (vector-flatten! s3-1 s3-1 (-> self control local-normal)) (add-debug-vector *display-target-marks* - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> self control trans) s3-1 (meters 2.0) @@ -293,7 +293,7 @@ (vector-flatten! s4-2 s4-2 (-> self control local-normal)) (add-debug-vector *display-target-marks* - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> self control trans) s4-2 (meters 2.0) @@ -330,7 +330,7 @@ (vector-float*! gp-1 gp-1 0.5) (add-debug-vector *display-target-marks* - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> self control trans) gp-1 (meters 0.00024414062) @@ -339,7 +339,7 @@ (vector+! gp-1 gp-1 (-> self control trans)) (add-debug-text-sphere *display-target-marks* - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) gp-1 819.2 "ltransv" @@ -350,7 +350,7 @@ (vector+! gp-1 gp-1 (-> self control trans)) (add-debug-text-sphere *display-target-marks* - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) gp-1 819.2 "nose" diff --git a/test/decompiler/reference/levels/swamp/swamp-rat-nest_REF.gc b/test/decompiler/reference/levels/swamp/swamp-rat-nest_REF.gc index b04b1721cb..db980df3cf 100644 --- a/test/decompiler/reference/levels/swamp/swamp-rat-nest_REF.gc +++ b/test/decompiler/reference/levels/swamp/swamp-rat-nest_REF.gc @@ -761,7 +761,7 @@ (let* ((a0-0 (-> self spawn-joint-array gp-0)) (a2-0 (-> self node-list data a0-0 bone transform)) ) - (add-debug-matrix #t (bucket-id debug-draw1) a2-0) + (add-debug-matrix #t (bucket-id debug-no-zbuf) a2-0) ) ) #f diff --git a/test/decompiler/reference/levels/village1/fishermans-boat_REF.gc b/test/decompiler/reference/levels/village1/fishermans-boat_REF.gc index 7bdcba49f4..6c32329184 100644 --- a/test/decompiler/reference/levels/village1/fishermans-boat_REF.gc +++ b/test/decompiler/reference/levels/village1/fishermans-boat_REF.gc @@ -138,7 +138,7 @@ (set! (-> s3-0 w) 1.0) (add-debug-line #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) s4-0 s3-0 (new 'static 'rgba :r #xff :g #xff :a #x80) @@ -147,7 +147,7 @@ ) (add-debug-vector #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) s4-0 s5-0 (meters 0.00024414062) @@ -509,14 +509,14 @@ (debug-draw (-> obj path)) (add-debug-sphere #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> obj dest-circle) (-> obj dest-circle w) (new 'static 'rgba :g #xff :a #x80) ) (add-debug-x #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (-> obj target-point) (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) ) @@ -955,14 +955,14 @@ (dummy-16 (-> self controller)) (add-debug-sphere #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (the-as vector (-> self boat-path)) 614400.0 (new 'static 'rgba :b #xff :a #x80) ) (add-debug-sphere #t - (bucket-id debug-draw1) + (bucket-id debug-no-zbuf) (the-as vector (&-> self stack 848)) 409600.0 (new 'static 'rgba :b #xff :a #x80) From 61766d2d2288a718fdd16a9d2fd7bd9e66134d33 Mon Sep 17 00:00:00 2001 From: water111 <48171810+water111@users.noreply.github.com> Date: Mon, 25 Apr 2022 21:53:23 -0400 Subject: [PATCH 4/6] Collision mesh extraction (#1330) * temp * extract collision mesh * temp * improve * toggle, cleanup --- common/custom_data/TFrag3Data.cpp | 9 + common/custom_data/Tfrag3Data.h | 18 +- common/math/Vector.h | 7 + decompiler/CMakeLists.txt | 3 +- decompiler/config.cpp | 1 + decompiler/config.h | 1 + decompiler/config/jak1_ntsc_black_label.jsonc | 5 +- decompiler/extractor/main.cpp | 2 +- decompiler/level_extractor/BspHeader.cpp | 138 +++++++++ decompiler/level_extractor/BspHeader.h | 70 ++++- .../level_extractor/extract_collide_frags.cpp | 280 ++++++++++++++++++ .../level_extractor/extract_collide_frags.h | 14 + decompiler/level_extractor/extract_level.cpp | 37 ++- decompiler/level_extractor/extract_level.h | 6 +- decompiler/main.cpp | 2 +- decompiler/util/goal_data_reader.cpp | 6 +- game/CMakeLists.txt | 1 + .../opengl_renderer/BucketRenderer.cpp | 2 +- .../graphics/opengl_renderer/BucketRenderer.h | 8 +- .../opengl_renderer/CollideMeshRenderer.cpp | 97 ++++++ .../opengl_renderer/CollideMeshRenderer.h | 12 + game/graphics/opengl_renderer/Loader.cpp | 38 ++- game/graphics/opengl_renderer/Loader.h | 3 + .../opengl_renderer/OpenGLRenderer.cpp | 9 +- .../graphics/opengl_renderer/OpenGLRenderer.h | 12 + game/graphics/opengl_renderer/Shader.cpp | 5 + game/graphics/opengl_renderer/Shader.h | 1 + game/graphics/opengl_renderer/Sprite3.cpp | 2 +- .../opengl_renderer/SpriteRenderer.cpp | 2 +- .../opengl_renderer/background/Shrub.cpp | 4 +- .../opengl_renderer/background/TFragment.cpp | 4 +- .../opengl_renderer/background/Tie3.cpp | 4 +- .../background/background_common.cpp | 13 + .../background/background_common.h | 24 +- .../opengl_renderer/shaders/collision.frag | 9 + .../opengl_renderer/shaders/collision.vert | 67 +++++ goal_src/engine/gfx/tfrag/tfrag.gc | 7 +- 37 files changed, 877 insertions(+), 46 deletions(-) create mode 100644 decompiler/level_extractor/extract_collide_frags.cpp create mode 100644 decompiler/level_extractor/extract_collide_frags.h create mode 100644 game/graphics/opengl_renderer/CollideMeshRenderer.cpp create mode 100644 game/graphics/opengl_renderer/CollideMeshRenderer.h create mode 100644 game/graphics/opengl_renderer/shaders/collision.frag create mode 100644 game/graphics/opengl_renderer/shaders/collision.vert diff --git a/common/custom_data/TFrag3Data.cpp b/common/custom_data/TFrag3Data.cpp index cd46ba29ec..d850dd720b 100644 --- a/common/custom_data/TFrag3Data.cpp +++ b/common/custom_data/TFrag3Data.cpp @@ -233,6 +233,10 @@ void Texture::serialize(Serializer& ser) { ser.from_ptr(&load_to_pool); } +void CollisionMesh::serialize(Serializer& ser) { + ser.from_pod_vector(&vertices); +} + void Level::serialize(Serializer& ser) { ser.from_ptr(&version); if (ser.is_loading() && version != TFRAG3_VERSION) { @@ -282,6 +286,8 @@ void Level::serialize(Serializer& ser) { tree.serialize(ser); } + collision.serialize(ser); + ser.from_ptr(&version2); if (ser.is_loading() && version2 != TFRAG3_VERSION) { ASSERT_MSG(false, fmt::format( @@ -352,6 +358,9 @@ std::array Level::get_memory_usage() c result[SHRUB_IND] += sizeof(u32) * shrub_tree.indices.size(); } + // collision + result[COLLISION] += sizeof(CollisionMesh::Vertex) * collision.vertices.size(); + return result; } diff --git a/common/custom_data/Tfrag3Data.h b/common/custom_data/Tfrag3Data.h index 50a895a555..a22a1dbd1f 100644 --- a/common/custom_data/Tfrag3Data.h +++ b/common/custom_data/Tfrag3Data.h @@ -44,10 +44,13 @@ enum MemoryUsageCategory { SHRUB_TIME_OF_DAY, SHRUB_VERT, SHRUB_IND, + + COLLISION, + NUM_CATEGORIES }; -constexpr int TFRAG3_VERSION = 14; +constexpr int TFRAG3_VERSION = 15; // These vertices should be uploaded to the GPU at load time and don't change struct PreloadedVertex { @@ -306,6 +309,18 @@ struct ShrubTree { void unpack(); }; +struct CollisionMesh { + struct Vertex { + float x, y, z; + u32 flags; + s16 nx, ny, nz; + u16 pad; + }; + static_assert(sizeof(Vertex) == 24); + std::vector vertices; + void serialize(Serializer& ser); +}; + constexpr int TFRAG_GEOS = 3; constexpr int TIE_GEOS = 4; @@ -316,6 +331,7 @@ struct Level { std::array, TFRAG_GEOS> tfrag_trees; std::array, TIE_GEOS> tie_trees; std::vector shrub_trees; + CollisionMesh collision; u16 version2 = TFRAG3_VERSION; void serialize(Serializer& ser); diff --git a/common/math/Vector.h b/common/math/Vector.h index 6774f64bbf..bb0ba31a1c 100644 --- a/common/math/Vector.h +++ b/common/math/Vector.h @@ -96,6 +96,13 @@ class Vector { return *this; } + Vector& operator-=(const Vector& other) { + for (int i = 0; i < Size; i++) { + m_data[i] -= other[i]; + } + return *this; + } + Vector elementwise_multiply(const Vector& other) const { Vector result; for (int i = 0; i < Size; i++) { diff --git a/decompiler/CMakeLists.txt b/decompiler/CMakeLists.txt index 1f64eabc24..c623693a4c 100644 --- a/decompiler/CMakeLists.txt +++ b/decompiler/CMakeLists.txt @@ -51,10 +51,11 @@ add_library( IR2/LabelDB.cpp IR2/OpenGoalMapping.cpp + level_extractor/BspHeader.cpp + level_extractor/extract_collide_frags.cpp level_extractor/extract_level.cpp level_extractor/extract_tfrag.cpp level_extractor/extract_tie.cpp - level_extractor/BspHeader.cpp level_extractor/extract_shrub.cpp ObjectFile/LinkedObjectFile.cpp diff --git a/decompiler/config.cpp b/decompiler/config.cpp index 9654568f21..75324c5b2f 100644 --- a/decompiler/config.cpp +++ b/decompiler/config.cpp @@ -67,6 +67,7 @@ Config read_config_file(const std::string& path_to_config_file, config.generate_symbol_definition_map = cfg.at("generate_symbol_definition_map").get(); config.is_pal = cfg.at("is_pal").get(); config.rip_levels = cfg.at("levels_convert_to_obj").get(); + config.extract_collision = cfg.at("extract_collision").get(); auto allowed = cfg.at("allowed_objects").get>(); for (const auto& x : allowed) { diff --git a/decompiler/config.h b/decompiler/config.h index 52a61c6e23..876ade06b7 100644 --- a/decompiler/config.h +++ b/decompiler/config.h @@ -100,6 +100,7 @@ struct Config { bool process_game_text = false; bool process_game_count = false; bool rip_levels = false; + bool extract_collision = false; bool write_hex_near_instructions = false; bool hexdump_code = false; diff --git a/decompiler/config/jak1_ntsc_black_label.jsonc b/decompiler/config/jak1_ntsc_black_label.jsonc index 2c90382797..5171316999 100644 --- a/decompiler/config/jak1_ntsc_black_label.jsonc +++ b/decompiler/config/jak1_ntsc_black_label.jsonc @@ -86,5 +86,8 @@ // turn this on to extract level background graphics data "levels_extract": true, // turn this on if you want extracted levels to be saved out as .obj files - "levels_convert_to_obj": false + "levels_convert_to_obj": false, + // should we extract collision meshes? + // these can be displayed in game, but makes the .fr3 files slightly larger + "extract_collision": true } diff --git a/decompiler/extractor/main.cpp b/decompiler/extractor/main.cpp index 943352becc..702155bdbe 100644 --- a/decompiler/extractor/main.cpp +++ b/decompiler/extractor/main.cpp @@ -290,7 +290,7 @@ void decompile(std::filesystem::path jak1_input_files) { // levels { extract_all_levels(db, tex_db, config.levels_to_extract, "GAME.CGO", config.hacks, - config.rip_levels); + config.rip_levels, config.extract_collision); } } diff --git a/decompiler/level_extractor/BspHeader.cpp b/decompiler/level_extractor/BspHeader.cpp index e27016785e..1247c3218a 100644 --- a/decompiler/level_extractor/BspHeader.cpp +++ b/decompiler/level_extractor/BspHeader.cpp @@ -59,6 +59,14 @@ std::string Vector::print_meters(int indent) const { return result; } +std::string Vector::print_decimal(int indent) const { + s32 d[4]; + memcpy(d, data, 16); + std::string is(indent, ' '); + std::string result; + result += fmt::format("{}\n", is, d[0], d[1], d[2], d[3]); + return result; +} void FileInfo::read_from_file(TypedRef ref, const decompiler::DecompilerTypeSystem& dts) { file_type = read_type_field(ref, "file-type", dts, true); file_name = read_string_field(ref, "file-name", dts, true); @@ -887,6 +895,15 @@ void PrototypeBucketTie::read_from_file(TypedRef ref, dists.read_from_file(get_field_ref(ref, "dists", dts)); rdists.read_from_file(get_field_ref(ref, "rdists", dts)); stiffness = read_plain_data_field(ref, "stiffness", dts); + auto fr = get_field_ref(ref, "collide-frag", dts); + { + const auto& word = fr.data->words_by_seg.at(fr.seg).at(fr.byte_offset / 4); + if (word.kind() == decompiler::LinkedWord::PTR) { + auto p = deref_label(fr); + p.byte_offset -= 4; + collide_frag.read_from_file(typed_ref_from_basic(p, dts), dts, stats); + } + } auto next_slot = get_field_ref(ref, "next", dts); for (int i = 0; i < 4; i++) { @@ -1117,6 +1134,120 @@ std::string DrawableTreeInstanceTie::my_type() const { return "drawable-tree-instance-tie"; } +void DrawableTreeCollideFragment::read_from_file(TypedRef ref, + const decompiler::DecompilerTypeSystem& dts, + DrawStats* stats) { + s16 length = read_plain_data_field(ref, "length", dts); + auto data_ref = get_field_ref(ref, "data", dts); + if ((data_ref.byte_offset % 4) != 0) { + throw Error("misaligned data array"); + } + + Ref array_slot_ref = data_ref; + array_slot_ref.byte_offset += (length - 1) * 4; + + Ref object_ref = deref_label(array_slot_ref); + object_ref.byte_offset -= 4; + last_array.read_from_file(typed_ref_from_basic(object_ref, dts), dts, stats); +} + +std::string DrawableTreeCollideFragment::print(const PrintSettings& settings, int indent) const { + return last_array.print(settings, indent); +} + +std::string DrawableTreeCollideFragment::my_type() const { + return "drawable-tree-collide-fragment"; +} + +void DrawableInlineArrayCollideFragment::read_from_file(TypedRef ref, + const decompiler::DecompilerTypeSystem& dts, + DrawStats* stats) { + ASSERT(ref.type->get_name() == "drawable-inline-array-collide-fragment"); + id = read_plain_data_field(ref, "id", dts); + length = read_plain_data_field(ref, "length", dts); + bsphere.read_from_file(get_field_ref(ref, "bsphere", dts)); + + auto data_ref = get_field_ref(ref, "data", dts); + for (int i = 0; i < length; i++) { + Ref obj_ref = data_ref; + obj_ref.byte_offset += 32 * i; // todo not a constant here + auto type = get_type_of_basic(obj_ref); + if (type != "collide-fragment") { + throw Error("bad collide fragment type: {}", type); + } + collide_fragments.emplace_back(); + collide_fragments.back().read_from_file(typed_ref_from_basic(obj_ref, dts), dts, stats); + } +} + +std::string DrawableInlineArrayCollideFragment::print(const PrintSettings& settings, + int indent) const { + std::string is(indent, ' '); + std::string result; + int next_indent = indent + 4; + result += fmt::format("{}id: {}\n", is, id); + result += fmt::format("{}length: {}\n", is, length); + result += fmt::format("{}bsphere: {}", is, bsphere.print_meters()); + + if (settings.expand_collide) { + for (u32 i = 0; i < collide_fragments.size(); i++) { + result += fmt::format("{}data [{}]:\n", is, i); + result += collide_fragments[i].print(settings, next_indent); + } + } + return result; +} + +std::string DrawableInlineArrayCollideFragment::my_type() const { + return "drawable-inline-array-collide-fragment"; +} + +void CollideFragment::read_from_file(TypedRef ref, + const decompiler::DecompilerTypeSystem& dts, + DrawStats* stats) { + bsphere.read_from_file(get_field_ref(ref, "bsphere", dts)); + auto r = deref_label(get_field_ref(ref, "mesh", dts)); + r.byte_offset -= 4; + mesh.read_from_file(typed_ref_from_basic(r, dts), dts, stats); +} + +std::string CollideFragment::print(const PrintSettings& settings, int indent) const { + std::string is(indent, ' '); + std::string result; + result += fmt::format("{}bsphere: {}", is, bsphere.print_meters()); + result += mesh.print(settings, indent); + + return result; +} + +void CollideFragMesh::read_from_file(TypedRef ref, + const decompiler::DecompilerTypeSystem& dts, + DrawStats* stats) { + strip_data_len = read_plain_data_field(ref, "strip-data-len", dts); + poly_count = read_plain_data_field(ref, "poly-count", dts); + vertex_count = read_plain_data_field(ref, "vertex-count", dts); + vertex_data_qwc = read_plain_data_field(ref, "vertex-data-qwc", dts); + total_qwc = read_plain_data_field(ref, "total-qwc", dts); + base_trans.read_from_file(get_field_ref(ref, "base-trans", dts)); + base_trans.data[3] = 0; + + packed_data = deref_label(get_field_ref(ref, "packed-data", dts)); + pat_array = deref_label(get_field_ref(ref, "pat-array", dts)); +} + +std::string CollideFragMesh::print(const PrintSettings& settings, int indent) const { + std::string is(indent, ' '); + std::string result; + result += fmt::format("{}strip-data-len: {}\n", is, strip_data_len); + result += fmt::format("{}poly-count: {}\n", is, poly_count); + result += fmt::format("{}vertex-count: {}\n", is, vertex_count); + result += fmt::format("{}vertex-data-qwc: {}\n", is, vertex_data_qwc); + result += fmt::format("{}total-qwc: {}\n", is, total_qwc); + result += fmt::format("{}base-trans: {}", is, base_trans.print_decimal()); + + return result; +} + ////////////////////////// // shrub ////////////////////////// @@ -1584,6 +1715,13 @@ std::unique_ptr make_drawable_tree(TypedRef ref, tree->read_from_file(ref, dts, stats); return tree; } + + if (ref.type->get_name() == "drawable-tree-collide-fragment") { + auto tree = std::make_unique(); + tree->read_from_file(ref, dts, stats); + return tree; + } + auto tree = std::make_unique(); tree->read_from_file(ref, dts, stats); return tree; diff --git a/decompiler/level_extractor/BspHeader.h b/decompiler/level_extractor/BspHeader.h index 1aae78f489..815c78e9b1 100644 --- a/decompiler/level_extractor/BspHeader.h +++ b/decompiler/level_extractor/BspHeader.h @@ -14,6 +14,9 @@ class DecompilerTypeSystem; } // namespace decompiler namespace level_tools { + +u32 deref_u32(const Ref& ref, int word_offset); + struct PrintSettings { bool print_tfrag = false; bool expand_draw_node = false; @@ -23,7 +26,8 @@ struct PrintSettings { bool expand_drawable_tree_tie_proto_data = false; bool expand_drawable_tree_instance_tie = false; bool expand_drawable_tree_actor = false; - bool expand_shrub = true; + bool expand_shrub = false; + bool expand_collide = false; }; struct DrawStats { @@ -50,6 +54,7 @@ struct Vector { std::string print(int indent = 0) const; std::string print_meters(int indent = 0) const; + std::string print_decimal(int indent = 0) const; }; // a matrix with 16-bit integers. @@ -181,6 +186,68 @@ struct DrawableTreeActor : public DrawableTree { std::vector> arrays; }; +///////////////////// +// Collision +///////////////////// + +struct CollideFragMesh { + /* + ((packed-data uint32 :offset-assert 4) + (pat-array uint32 :offset-assert 8) + (strip-data-len uint16 :offset-assert 12) + (poly-count uint16 :offset-assert 14) + (base-trans vector :inline :offset-assert 16) + ;; these go in the w of the vector above. + (vertex-count uint8 :offset 28) + (vertex-data-qwc uint8 :offset 29) + (total-qwc uint8 :offset 30) + (unused uint8 :offset 31) + ) + */ + void read_from_file(TypedRef ref, const decompiler::DecompilerTypeSystem& dts, DrawStats* stats); + std::string print(const PrintSettings& settings, int indent) const; + + u16 strip_data_len; + u16 poly_count; + // appears to be integers... + Vector base_trans; + u8 vertex_count; + u8 vertex_data_qwc; + u8 total_qwc; + + Ref packed_data; + Ref pat_array; +}; + +struct CollideFragment { + void read_from_file(TypedRef ref, const decompiler::DecompilerTypeSystem& dts, DrawStats* stats); + std::string print(const PrintSettings& settings, int indent) const; + Vector bsphere; + CollideFragMesh mesh; +}; + +struct DrawableInlineArrayCollideFragment : public DrawableInlineArray { + void read_from_file(TypedRef ref, + const decompiler::DecompilerTypeSystem& dts, + DrawStats* stats) override; + std::string print(const PrintSettings& settings, int indent) const override; + std::string my_type() const override; + std::vector collide_fragments; + s16 id; + s16 length; + Vector bsphere; +}; + +struct DrawableTreeCollideFragment : public DrawableTree { + void read_from_file(TypedRef ref, + const decompiler::DecompilerTypeSystem& dts, + DrawStats* stats) override; + std::string print(const PrintSettings& settings, int indent) const override; + std::string my_type() const override; + + DrawableInlineArrayCollideFragment last_array; +}; + ///////////////////// // TFRAG ///////////////////// @@ -382,6 +449,7 @@ struct PrototypeBucketTie { // todo envmap shader // todo collide-frag + DrawableInlineArrayCollideFragment collide_frag; // todo tie-colors // todo data diff --git a/decompiler/level_extractor/extract_collide_frags.cpp b/decompiler/level_extractor/extract_collide_frags.cpp new file mode 100644 index 0000000000..17bd995dc5 --- /dev/null +++ b/decompiler/level_extractor/extract_collide_frags.cpp @@ -0,0 +1,280 @@ +#include "extract_collide_frags.h" + +#include "common/util/FileUtil.h" + +namespace decompiler { + +struct CollideListItem { + const level_tools::CollideFragMesh* mesh = nullptr; + const level_tools::InstanceTie* inst = nullptr; + + struct { + std::vector vu0_buffer; + std::vector> faces; + } unpacked; +}; + +/*! + * Get all collide frags. + */ +std::vector build_all_frags_list( + const level_tools::DrawableTreeCollideFragment* tree, + const std::vector& ties) { + std::vector list; + for (auto& cf : tree->last_array.collide_fragments) { + auto& elt = list.emplace_back(); + elt.mesh = &cf.mesh; + elt.inst = nullptr; + } + + for (auto tt : ties) { + auto last_array = tt->arrays.back().get(); + auto as_instance_array = dynamic_cast(last_array); + ASSERT(as_instance_array); + for (auto& inst : as_instance_array->instances) { + auto& frags = tt->prototypes.prototype_array_tie.data.at(inst.bucket_index) + .collide_frag.collide_fragments; + for (auto& frag : frags) { + auto& elt = list.emplace_back(); + elt.inst = &inst; + elt.mesh = &frag.mesh; + } + } + } + return list; +} + +float u32_to_float(u32 in) { + float r; + memcpy(&r, &in, sizeof(float)); + return r; +} + +u16 deref_u16(const Ref& ref, int array_idx) { + u32 u32_offset = array_idx / 2; + u32 u32_val = level_tools::deref_u32(ref, u32_offset); + if (array_idx & 1) { + return u32_val >> 16; + } else { + return (u16)u32_val; + } +} + +s8 deref_s8(const Ref& ref, int byte) { + u32 u32_offset = byte / 4; + u32 u32_val = level_tools::deref_u32(ref, u32_offset); + s8 vals[4]; + memcpy(vals, &u32_val, 4); + return vals[byte & 3]; +} + +void unpack_part1_collide_list_item(CollideListItem& item) { + int in_idx = 0; + int out_idx = 0; + int qw_to_write = item.mesh->vertex_count; + + while (out_idx < qw_to_write * 4) { + auto& vert = item.unpacked.vu0_buffer.emplace_back(); + vert[0] = u32_to_float(0x4d000000 + deref_u16(item.mesh->packed_data, in_idx++)); + vert[1] = u32_to_float(0x4d000000 + deref_u16(item.mesh->packed_data, in_idx++)); + vert[2] = u32_to_float(0x4d000000 + deref_u16(item.mesh->packed_data, in_idx++)); + vert[3] = u32_to_float(0x3f800000); + out_idx += 4; + } +} + +math::Vector transform_tie(const std::array mat, + const math::Vector4f& pt) { + auto temp = mat[0] * pt.x() + mat[1] * pt.y() + mat[2] * pt.z() + mat[3]; + math::Vector4f result; + result.x() = temp.x(); + result.y() = temp.y(); + result.z() = temp.z(); + result.w() = 1.f; + return result; +} + +namespace { +// todo dedup +std::array extract_tie_matrix(const u16* data) { + std::array result; + for (int i = 0; i < 4; i++) { + s32 x = data[12 + i]; + x <<= 16; + x >>= 10; + result[3][i] = x; + } + + for (int vec = 0; vec < 3; vec++) { + for (int i = 0; i < 4; i++) { + s32 x = data[vec * 4 + i]; + x <<= 16; + x >>= 16; + result[vec][i] = (float)x / 4096.f; + } + } + + return result; +} +} // namespace + +void unpack_part2_collide_list_item(CollideListItem& item) { + float base_offset = u32_to_float(0x4d000000); + + math::Vector4f vf13_combo_offset(base_offset, base_offset, base_offset, 0); + s32 base_trans_int[4]; + memcpy(base_trans_int, item.mesh->base_trans.data, 16); + math::Vector4f vf14_base_trans_float(base_trans_int[0], base_trans_int[1], base_trans_int[2], + base_trans_int[3]); + vf13_combo_offset -= vf14_base_trans_float; + std::array mat; + if (item.inst) { + mat = extract_tie_matrix(item.inst->origin.data); + mat[3][0] += item.inst->bsphere.data[0]; + mat[3][1] += item.inst->bsphere.data[1]; + mat[3][2] += item.inst->bsphere.data[2]; + } + + for (auto& ver : item.unpacked.vu0_buffer) { + ver -= vf13_combo_offset; + if (item.inst) { + ver = transform_tie(mat, ver); + } + } +} + +void find_faces(CollideListItem& item) { + u32 byte_offset = 16 * item.mesh->vertex_data_qwc; + + while (true) { + s8 t7_start_idx = deref_s8(item.mesh->packed_data, byte_offset++); + if (t7_start_idx < 0) { + return; + } + s8 t8_start_idx = deref_s8(item.mesh->packed_data, byte_offset++); + s8 t6_start_idx = deref_s8(item.mesh->packed_data, byte_offset++); + + s8 t6_run_idx = t7_start_idx; + s8 t7_run_idx = t8_start_idx; + s8 ra_run_idx = t6_start_idx; + + item.unpacked.faces.emplace_back(t6_run_idx, t7_run_idx, ra_run_idx); + s8 s5 = 1; + while (true) { + s8 next = deref_s8(item.mesh->packed_data, byte_offset++); + if (!next) { + break; + } + if (next < 0) { + next = -((s32)next); + } else { + t6_run_idx = t7_run_idx; + s5 = -s5; + } + next--; + t7_run_idx = ra_run_idx; + ra_run_idx = next; + u8 result[3]; + result[1] = t7_run_idx; + result[1 + s5] = ra_run_idx; + result[1 - s5] = t6_run_idx; + item.unpacked.faces.emplace_back(result[0], result[1], result[2]); + ASSERT((u32)next < item.unpacked.vu0_buffer.size()); + } + } +} + +std::string debug_dump_to_obj(const std::vector& list) { + std::vector verts; + std::vector> faces; + + for (auto& item : list) { + u32 f_off = verts.size() + 1; + for (auto& f : item.unpacked.faces) { + faces.emplace_back(f[0] + f_off, f[1] + f_off, f[2] + f_off); + } + for (u32 t = 0; t < item.unpacked.vu0_buffer.size(); t++) { + verts.push_back(item.unpacked.vu0_buffer[t] / 65536); + } + } + + std::string result; + for (auto& vert : verts) { + result += fmt::format("v {} {} {}\n", vert.x(), vert.y(), vert.z()); + } + + for (auto& face : faces) { + result += fmt::format("f {}/{} {}/{} {}/{}\n", face.x(), face.x(), face.y(), face.y(), face.z(), + face.z()); + } + + return result; +} + +void set_vertices_for_tri(tfrag3::CollisionMesh::Vertex* out, const math::Vector4f* in) { + math::Vector3f v10 = in[1].xyz() - in[0].xyz(); + math::Vector3f v20 = in[2].xyz() - in[0].xyz(); + auto normal = (v10.cross(v20).normalized() * INT16_MAX).cast(); + + for (int i = 0; i < 3; i++) { + out[i].x = in[i].x(); + out[i].y = in[i].y(); + out[i].z = in[i].z(); + out[i].nx = normal.x(); + out[i].ny = normal.y(); + out[i].nz = normal.z(); + out[i].flags = 0; // todo + out[i].pad = 0; + } +} + +void extract_collide_frags(const level_tools::DrawableTreeCollideFragment* tree, + const std::vector& ties, + const std::string& debug_name, + tfrag3::Level& out, + bool dump_level) { + // in-game, the broad-phase collision builds a list of fragments, then unpacks them with: + /* + *(dotimes (i (-> *collide-list* num-items)) + (let ((frag (-> *collide-list* items i))) + ;; to VU0 memory + (__pc-upload-collide-frag (-> frag mesh packed-data) (-> frag mesh vertex-data-qwc) (-> + frag mesh vertex-count)) + ;; from VU0 memory to scratchpad + (unpack-background-collide-mesh obj (-> frag mesh) (-> frag inst) 0) + ;; from scratchpad to collide-cache memory. + (import-mesh-func obj (-> frag mesh)) + ) + ) + */ + + auto all_frags = build_all_frags_list(tree, ties); + u32 total_faces = 0; + for (auto& frag : all_frags) { + unpack_part1_collide_list_item(frag); + unpack_part2_collide_list_item(frag); + find_faces(frag); + total_faces += frag.unpacked.faces.size(); + } + + if (dump_level) { + auto debug_out = debug_dump_to_obj(all_frags); + file_util::write_text_file( + file_util::get_file_path({"debug_out", fmt::format("collide-{}.obj", debug_name)}), + debug_out); + } + + for (auto& item : all_frags) { + for (auto& f : item.unpacked.faces) { + math::Vector4f verts[3] = {item.unpacked.vu0_buffer[f[0]], item.unpacked.vu0_buffer[f[1]], + item.unpacked.vu0_buffer[f[2]]}; + tfrag3::CollisionMesh::Vertex out_verts[3]; + set_vertices_for_tri(out_verts, verts); + for (int i = 0; i < 3; i++) { + out.collision.vertices.push_back(out_verts[i]); + } + } + } +} + +} // namespace decompiler \ No newline at end of file diff --git a/decompiler/level_extractor/extract_collide_frags.h b/decompiler/level_extractor/extract_collide_frags.h new file mode 100644 index 0000000000..44fc2bf44d --- /dev/null +++ b/decompiler/level_extractor/extract_collide_frags.h @@ -0,0 +1,14 @@ +#pragma once + +#include "BspHeader.h" +#include "common/custom_data/Tfrag3Data.h" + +namespace decompiler { + +void extract_collide_frags(const level_tools::DrawableTreeCollideFragment* tree, + const std::vector& ties, + const std::string& debug_name, + tfrag3::Level& out, + bool dump_level); + +} // namespace decompiler \ No newline at end of file diff --git a/decompiler/level_extractor/extract_level.cpp b/decompiler/level_extractor/extract_level.cpp index 3889fa2598..a43f028ef0 100644 --- a/decompiler/level_extractor/extract_level.cpp +++ b/decompiler/level_extractor/extract_level.cpp @@ -6,6 +6,7 @@ #include "decompiler/level_extractor/extract_tfrag.h" #include "decompiler/level_extractor/extract_tie.h" #include "decompiler/level_extractor/extract_shrub.h" +#include "decompiler/level_extractor/extract_collide_frags.h" #include "common/util/compress.h" #include "common/util/FileUtil.h" #include "common/util/SimpleThreadGroup.h" @@ -77,7 +78,8 @@ void print_memory_usage(const tfrag3::Level& lev, int uncompressed_data_size) { {"tfrag-bvh", memory_use_by_category[tfrag3::MemoryUsageCategory::TFRAG_BVH]}, {"shrub-colors", memory_use_by_category[tfrag3::MemoryUsageCategory::SHRUB_TIME_OF_DAY]}, {"shrub-vert", memory_use_by_category[tfrag3::MemoryUsageCategory::SHRUB_VERT]}, - {"shrub-ind", memory_use_by_category[tfrag3::MemoryUsageCategory::SHRUB_IND]}}; + {"shrub-ind", memory_use_by_category[tfrag3::MemoryUsageCategory::SHRUB_IND]}, + {"collision", memory_use_by_category[tfrag3::MemoryUsageCategory::COLLISION]}}; for (auto& known : known_categories) { total_accounted += known.second; } @@ -166,7 +168,8 @@ void extract_from_level(const ObjectFileDB& db, const TextureDB& tex_db, const std::string& dgo_name, const DecompileHacks& hacks, - bool dump_level) { + bool dump_level, + bool extract_collision) { if (db.obj_files_by_dgo.count(dgo_name) == 0) { lg::warn("Skipping extract for {} because the DGO was not part of the input", dgo_name); return; @@ -192,9 +195,9 @@ void extract_from_level(const ObjectFileDB& db, /* level_tools::PrintSettings settings; - settings.expand_shrub = true; + settings.expand_collide = true; fmt::print("{}\n", bsp_header.print(settings)); - */ + */ const std::set tfrag_trees = { "drawable-tree-tfrag", "drawable-tree-trans-tfrag", "drawable-tree-dirt-tfrag", @@ -204,6 +207,15 @@ void extract_from_level(const ObjectFileDB& db, add_all_textures_from_level(tfrag_level, dgo_name, tex_db); + std::vector all_ties; + for (auto& draw_tree : bsp_header.drawable_tree_array.trees) { + auto as_tie_tree = dynamic_cast(draw_tree.get()); + if (as_tie_tree) { + all_ties.push_back(as_tie_tree); + } + } + + bool got_collide = false; for (auto& draw_tree : bsp_header.drawable_tree_array.trees) { if (tfrag_trees.count(draw_tree->my_type())) { auto as_tfrag_tree = dynamic_cast(draw_tree.get()); @@ -227,11 +239,21 @@ void extract_from_level(const ObjectFileDB& db, ASSERT(as_shrub_tree); extract_shrub(as_shrub_tree, fmt::format("{}-{}-shrub", dgo_name, i++), bsp_header.texture_remap_table, tex_db, {}, tfrag_level, dump_level); + } else if (draw_tree->my_type() == "drawable-tree-collide-fragment" && extract_collision) { + auto as_collide_frags = + dynamic_cast(draw_tree.get()); + ASSERT(as_collide_frags); + ASSERT(!got_collide); + got_collide = true; + extract_collide_frags(as_collide_frags, all_ties, fmt::format("{}-{}-collide", dgo_name, i++), + tfrag_level, dump_level); } else { // fmt::print(" unsupported tree {}\n", draw_tree->my_type()); } } + tfrag_level.level_name = level_name; + Serializer ser; tfrag_level.serialize(ser); auto compressed = @@ -249,11 +271,14 @@ void extract_all_levels(const ObjectFileDB& db, const std::vector& dgo_names, const std::string& common_name, const DecompileHacks& hacks, - bool debug_dump_level) { + bool debug_dump_level, + bool extract_collision) { extract_common(db, tex_db, common_name); SimpleThreadGroup threads; threads.run( - [&](int idx) { extract_from_level(db, tex_db, dgo_names[idx], hacks, debug_dump_level); }, + [&](int idx) { + extract_from_level(db, tex_db, dgo_names[idx], hacks, debug_dump_level, extract_collision); + }, dgo_names.size()); threads.join(); } diff --git a/decompiler/level_extractor/extract_level.h b/decompiler/level_extractor/extract_level.h index a97fcf37d3..d09da915d5 100644 --- a/decompiler/level_extractor/extract_level.h +++ b/decompiler/level_extractor/extract_level.h @@ -10,7 +10,8 @@ void extract_from_level(const ObjectFileDB& db, const TextureDB& tex_db, const std::string& dgo_name, const DecompileHacks& hacks, - bool dump_level); + bool dump_level, + bool extract_collision); void extract_common(const ObjectFileDB& db, const TextureDB& tex_db, const std::string& dgo_name); // extract everything @@ -19,5 +20,6 @@ void extract_all_levels(const ObjectFileDB& db, const std::vector& dgo_names, const std::string& common_name, const DecompileHacks& hacks, - bool debug_dump_level); + bool debug_dump_level, + bool extract_collision); } // namespace decompiler diff --git a/decompiler/main.cpp b/decompiler/main.cpp index 99b49c73ec..f7ce060dac 100644 --- a/decompiler/main.cpp +++ b/decompiler/main.cpp @@ -210,7 +210,7 @@ int main(int argc, char** argv) { if (config.levels_extract) { extract_all_levels(db, tex_db, config.levels_to_extract, "GAME.CGO", config.hacks, - config.rip_levels); + config.rip_levels, config.extract_collision); } fmt::print("[Mem] After extraction: {} MB\n", get_peak_rss() / (1024 * 1024)); diff --git a/decompiler/util/goal_data_reader.cpp b/decompiler/util/goal_data_reader.cpp index 9b216e28d8..de4b7d64bc 100644 --- a/decompiler/util/goal_data_reader.cpp +++ b/decompiler/util/goal_data_reader.cpp @@ -234,7 +234,8 @@ TypedRef typed_ref_from_basic(const Ref& object, const decompiler::DecompilerTyp const auto& word = object.data->words_by_seg.at(object.seg).at(byte_in_words / 4); if (word.kind() != decompiler::LinkedWord::TYPE_PTR) { - throw Error("typed_ref_from_basic did not get a type tag (offset {} words)", byte_in_words / 4); + throw Error("typed_ref_from_basic did not get a type tag (offset {} words). Got {}", + byte_in_words / 4, (int)word.kind()); } TypedRef result; @@ -252,7 +253,8 @@ Ref deref_label(const Ref& object) { const auto& word = object.data->words_by_seg.at(object.seg).at(byte_in_words / 4); if (word.kind() != decompiler::LinkedWord::PTR) { - throw Error("deref_label did not get a label (offset {} words)", byte_in_words / 4); + throw Error("deref_label did not get a label (offset {} words). Got {} {}", byte_in_words / 4, + (int)word.kind(), word.data); } const auto& lab = object.data->labels.at(word.label_id()); diff --git a/game/CMakeLists.txt b/game/CMakeLists.txt index 52487f5569..9105737830 100644 --- a/game/CMakeLists.txt +++ b/game/CMakeLists.txt @@ -96,6 +96,7 @@ set(RUNTIME_SOURCE graphics/opengl_renderer/ocean/OceanTexture.cpp graphics/opengl_renderer/ocean/OceanTexture_PC.cpp graphics/opengl_renderer/BucketRenderer.cpp + graphics/opengl_renderer/CollideMeshRenderer.cpp graphics/opengl_renderer/debug_gui.cpp graphics/opengl_renderer/DirectRenderer.cpp graphics/opengl_renderer/DirectRenderer2.cpp diff --git a/game/graphics/opengl_renderer/BucketRenderer.cpp b/game/graphics/opengl_renderer/BucketRenderer.cpp index 7edc882e65..3a1d7bd568 100644 --- a/game/graphics/opengl_renderer/BucketRenderer.cpp +++ b/game/graphics/opengl_renderer/BucketRenderer.cpp @@ -59,7 +59,7 @@ void SkipRenderer::render(DmaFollower& dma, } void SharedRenderState::reset() { - has_camera_planes = false; + has_pc_data = false; for (auto& x : occlusion_vis) { x.valid = false; } diff --git a/game/graphics/opengl_renderer/BucketRenderer.h b/game/graphics/opengl_renderer/BucketRenderer.h index 77d9aea1f6..a87f79fdfe 100644 --- a/game/graphics/opengl_renderer/BucketRenderer.h +++ b/game/graphics/opengl_renderer/BucketRenderer.h @@ -43,11 +43,17 @@ struct SharedRenderState { math::Vector fog_color; float fog_intensity = 1.f; bool no_multidraw = false; + bool render_collision_mesh = false; void reset(); - bool has_camera_planes = false; + bool has_pc_data = false; LevelVis occlusion_vis[2]; + math::Vector4f camera_planes[4]; + math::Vector4f camera_matrix[4]; + math::Vector4f camera_hvdf_off; + math::Vector4f camera_fog; + math::Vector4f camera_pos; EyeRenderer* eye_renderer = nullptr; diff --git a/game/graphics/opengl_renderer/CollideMeshRenderer.cpp b/game/graphics/opengl_renderer/CollideMeshRenderer.cpp new file mode 100644 index 0000000000..ac3b5fcfc6 --- /dev/null +++ b/game/graphics/opengl_renderer/CollideMeshRenderer.cpp @@ -0,0 +1,97 @@ +#include "CollideMeshRenderer.h" + +#include "game/graphics/opengl_renderer/background/background_common.h" + +CollideMeshRenderer::CollideMeshRenderer() { + glGenVertexArrays(1, &m_vao); +} + +CollideMeshRenderer::~CollideMeshRenderer() { + glDeleteVertexArrays(1, &m_vao); +} + +void CollideMeshRenderer::render(SharedRenderState* render_state, ScopedProfilerNode& prof) { + if (!render_state->has_pc_data) { + return; + } + + auto levels = render_state->loader->get_in_use_levels(); + if (levels.empty()) { + return; + } + render_state->shaders[ShaderId::COLLISION].activate(); + + glBindVertexArray(m_vao); + TfragRenderSettings settings; + memcpy(settings.math_camera.data(), render_state->camera_matrix[0].data(), 64); + settings.hvdf_offset = render_state->camera_hvdf_off; + settings.fog = render_state->camera_fog; + settings.tree_idx = 0; + for (int i = 0; i < 4; i++) { + settings.planes[i] = render_state->camera_planes[i]; + } + glUniformMatrix4fv( + glGetUniformLocation(render_state->shaders[ShaderId::COLLISION].id(), "camera"), 1, GL_FALSE, + settings.math_camera.data()); + glUniform4f(glGetUniformLocation(render_state->shaders[ShaderId::COLLISION].id(), "hvdf_offset"), + settings.hvdf_offset[0], settings.hvdf_offset[1], settings.hvdf_offset[2], + settings.hvdf_offset[3]); + const auto& trans = render_state->camera_pos; + glUniform4f( + glGetUniformLocation(render_state->shaders[ShaderId::COLLISION].id(), "camera_position"), + trans[0], trans[1], trans[2], trans[3]); + glUniform1f(glGetUniformLocation(render_state->shaders[ShaderId::COLLISION].id(), "fog_constant"), + settings.fog.x()); + glUniform1f(glGetUniformLocation(render_state->shaders[ShaderId::COLLISION].id(), "fog_min"), + settings.fog.y()); + glUniform1f(glGetUniformLocation(render_state->shaders[ShaderId::COLLISION].id(), "fog_max"), + settings.fog.z()); + glUniform1i(glGetUniformLocation(render_state->shaders[ShaderId::COLLISION].id(), "mode"), 0); + glEnable(GL_DEPTH_TEST); + glDepthFunc(GL_GEQUAL); + glEnable(GL_BLEND); + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); // ? + glDepthMask(GL_TRUE); + + for (auto lev : levels) { + glBindBuffer(GL_ARRAY_BUFFER, lev->collide_vertices); + glEnableVertexAttribArray(0); + glEnableVertexAttribArray(1); + glEnableVertexAttribArray(2); + glVertexAttribPointer(0, // location 0 in the shader + 3, // 3 values per vert + GL_FLOAT, // floats + GL_FALSE, // normalized + sizeof(tfrag3::CollisionMesh::Vertex), // stride + 0 // offset (0) + ); + glVertexAttribIPointer(1, // location 1 in the shader + 1, // 3 values per vert + GL_UNSIGNED_INT, // u32 + sizeof(tfrag3::CollisionMesh::Vertex), // stride + (void*)offsetof(tfrag3::CollisionMesh::Vertex, flags) // offset + ); + glVertexAttribPointer(2, // location 2 in the shader + 3, // 3 values per vert + GL_SHORT, // floats + GL_TRUE, // normalized + sizeof(tfrag3::CollisionMesh::Vertex), // stride + (void*)offsetof(tfrag3::CollisionMesh::Vertex, nx) // offset (0) + ); + glUniform1i(glGetUniformLocation(render_state->shaders[ShaderId::COLLISION].id(), "mode"), 0); + glDrawArrays(GL_TRIANGLES, 0, lev->level->collision.vertices.size()); + + bool kDrawWireframe = false; + if (kDrawWireframe) { + glUniform1i(glGetUniformLocation(render_state->shaders[ShaderId::COLLISION].id(), "mode"), 1); + glDisable(GL_BLEND); + glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); + glDrawArrays(GL_TRIANGLES, 0, lev->level->collision.vertices.size()); + glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); + glEnable(GL_BLEND); + } + + prof.add_draw_call(); + prof.add_tri(lev->level->collision.vertices.size() / 3); + } +} \ No newline at end of file diff --git a/game/graphics/opengl_renderer/CollideMeshRenderer.h b/game/graphics/opengl_renderer/CollideMeshRenderer.h new file mode 100644 index 0000000000..13bb1c4202 --- /dev/null +++ b/game/graphics/opengl_renderer/CollideMeshRenderer.h @@ -0,0 +1,12 @@ +#pragma once +#include "game/graphics/opengl_renderer/BucketRenderer.h" + +class CollideMeshRenderer { + public: + CollideMeshRenderer(); + void render(SharedRenderState* render_state, ScopedProfilerNode& prof); + ~CollideMeshRenderer(); + + private: + GLuint m_vao; +}; diff --git a/game/graphics/opengl_renderer/Loader.cpp b/game/graphics/opengl_renderer/Loader.cpp index 71b99cdc8a..70dd3a0ccc 100644 --- a/game/graphics/opengl_renderer/Loader.cpp +++ b/game/graphics/opengl_renderer/Loader.cpp @@ -75,6 +75,21 @@ void Loader::set_want_levels(const std::vector& levels) { } } +/*! + * Get all levels that are in memory and used very recently. + */ +std::vector Loader::get_in_use_levels() { + std::vector result; + std::unique_lock lk(m_loader_mutex); + + for (auto& lev : m_loaded_tfrag3_levels) { + if (lev.second.frames_since_last_used < 5) { + result.push_back(&lev.second.data); + } + } + return result; +} + /*! * Loader function that runs in a completely separate thread. * This is used for file I/O and unpacking. @@ -474,6 +489,15 @@ bool Loader::init_tie(Timer& timer, LevelData& data) { return false; } +bool Loader::init_collide(Timer& /*timer*/, LevelData& data) { + glGenBuffers(1, &data.collide_vertices); + glBindBuffer(GL_ARRAY_BUFFER, data.collide_vertices); + glBufferData(GL_ARRAY_BUFFER, + data.level->collision.vertices.size() * sizeof(tfrag3::CollisionMesh::Vertex), + data.level->collision.vertices.data(), GL_STATIC_DRAW); + return true; +} + bool Loader::upload_textures(Timer& timer, LevelData& data, TexturePool& texture_pool) { // try to move level from initializing to initialized: @@ -583,12 +607,14 @@ void Loader::update(TexturePool& texture_pool) { if (init_tie(loader_timer, lev.data)) { if (init_tfrag(loader_timer, lev.data)) { if (init_shrub(loader_timer, lev.data)) { - // we're done! lock before removing from loaded. - lk.lock(); - it->second.data.load_id = m_id++; + if (init_collide(loader_timer, lev.data)) { + // we're done! lock before removing from loaded. + lk.lock(); + it->second.data.load_id = m_id++; - m_loaded_tfrag3_levels[name] = std::move(lev); - m_initializing_tfrag3_levels.erase(it); + m_loaded_tfrag3_levels[name] = std::move(lev); + m_initializing_tfrag3_levels.erase(it); + } } } } @@ -640,6 +666,8 @@ void Loader::update(TexturePool& texture_pool) { } } + glDeleteBuffers(1, &lev.second.data.collide_vertices); + m_loaded_tfrag3_levels.erase(lev.first); break; } diff --git a/game/graphics/opengl_renderer/Loader.h b/game/graphics/opengl_renderer/Loader.h index b03f31c30e..70577752b0 100644 --- a/game/graphics/opengl_renderer/Loader.h +++ b/game/graphics/opengl_renderer/Loader.h @@ -31,6 +31,7 @@ class Loader { std::array, tfrag3::TIE_GEOS> tie_data; std::array, tfrag3::TIE_GEOS> tfrag_vertex_data; std::vector shrub_vertex_data; + GLuint collide_vertices; // internal load state bool tie_opengl_created = false; @@ -56,6 +57,7 @@ class Loader { const LevelData* get_tfrag3_level(const std::string& level_name); void load_common(TexturePool& tex_pool, const std::string& name); void set_want_levels(const std::vector& levels); + std::vector get_in_use_levels(); private: struct Level { @@ -70,6 +72,7 @@ class Loader { bool init_tie(Timer& timer, LevelData& data); bool init_tfrag(Timer& timer, LevelData& data); bool init_shrub(Timer& timer, LevelData& data); + bool init_collide(Timer& timer, LevelData& data); // used by game and loader thread std::unordered_map m_initializing_tfrag3_levels; diff --git a/game/graphics/opengl_renderer/OpenGLRenderer.cpp b/game/graphics/opengl_renderer/OpenGLRenderer.cpp index 7858b133ed..c715169eec 100644 --- a/game/graphics/opengl_renderer/OpenGLRenderer.cpp +++ b/game/graphics/opengl_renderer/OpenGLRenderer.cpp @@ -55,7 +55,6 @@ OpenGLRenderer::OpenGLRenderer(std::shared_ptr texture_pool, std::shared_ptr loader) : m_render_state(texture_pool, loader) { // setup OpenGL errors - glEnable(GL_DEBUG_OUTPUT); glDebugMessageCallback(opengl_error_callback, nullptr); // disable specific errors @@ -295,7 +294,6 @@ void OpenGLRenderer::render(DmaFollower dma, const RenderOptions& settings) { m_render_state.reset(); m_render_state.ee_main_memory = g_ee_main_mem; m_render_state.offset_of_s7 = offset_of_s7(); - m_render_state.has_camera_planes = false; { auto prof = m_profiler.root()->make_scoped_child("frame-setup"); @@ -368,6 +366,7 @@ void OpenGLRenderer::draw_renderer_selection_window() { ImGui::Begin("Renderer Debug"); ImGui::Checkbox("Use old single-draw", &m_render_state.no_multidraw); + ImGui::Checkbox("Render collision mesh", &m_render_state.render_collision_mesh); ImGui::SliderFloat("Fog Adjust", &m_render_state.fog_intensity, 0, 10); ImGui::Checkbox("Sky CPU", &m_render_state.use_sky_cpu); ImGui::Checkbox("Occlusion Cull", &m_render_state.use_occlusion_culling); @@ -458,6 +457,12 @@ void OpenGLRenderer::dispatch_buckets(DmaFollower dma, ScopedProfilerNode& prof) m_render_state.next_bucket += 16; vif_interrupt_callback(); m_category_times[(int)m_bucket_categories[bucket_id]] += bucket_prof.get_elapsed_time(); + + // hack to draw the collision mesh in the middle the drawing + if (bucket_id == (int)BucketId::ALPHA_TEX_LEVEL0 - 1 && m_render_state.render_collision_mesh) { + auto p = prof.make_scoped_child("collision-draw"); + m_collide_renderer.render(&m_render_state, p); + } } g_current_render = ""; diff --git a/game/graphics/opengl_renderer/OpenGLRenderer.h b/game/graphics/opengl_renderer/OpenGLRenderer.h index bc2e5e98b9..b73c286223 100644 --- a/game/graphics/opengl_renderer/OpenGLRenderer.h +++ b/game/graphics/opengl_renderer/OpenGLRenderer.h @@ -8,6 +8,7 @@ #include "game/graphics/opengl_renderer/BucketRenderer.h" #include "game/graphics/opengl_renderer/Profiler.h" #include "game/graphics/opengl_renderer/opengl_utils.h" +#include "game/graphics/opengl_renderer/CollideMeshRenderer.h" struct RenderOptions { int window_height_px = 0; @@ -24,9 +25,19 @@ struct RenderOptions { float pmode_alp_register = 0.f; }; +/*! + * Main OpenGL renderer. + * This handles the glClear and all game rendering, but not actual setup, synchronization or imgui + * stuff. + * + * It is simply a collection of bucket renderers, and a few special case ones. + */ class OpenGLRenderer { public: OpenGLRenderer(std::shared_ptr texture_pool, std::shared_ptr loader); + + // rendering interface: takes the dma chain from the game, and some size/debug settings from + // the graphics system. void render(DmaFollower dma, const RenderOptions& settings); private: @@ -58,6 +69,7 @@ class OpenGLRenderer { std::array m_category_times; FullScreenDraw m_blackout_renderer; + CollideMeshRenderer m_collide_renderer; float m_last_pmode_alp = 1.; bool m_enable_fast_blackout_loads = true; diff --git a/game/graphics/opengl_renderer/Shader.cpp b/game/graphics/opengl_renderer/Shader.cpp index 022c23718c..f92992d450 100644 --- a/game/graphics/opengl_renderer/Shader.cpp +++ b/game/graphics/opengl_renderer/Shader.cpp @@ -83,4 +83,9 @@ ShaderLibrary::ShaderLibrary() { at(ShaderId::OCEAN_COMMON) = {"ocean_common"}; at(ShaderId::SHRUB) = {"shrub"}; at(ShaderId::SHADOW) = {"shadow"}; + at(ShaderId::COLLISION) = {"collision"}; + + for (auto& shader : m_shaders) { + ASSERT_MSG(shader.okay(), "Shader compiled"); + } } diff --git a/game/graphics/opengl_renderer/Shader.h b/game/graphics/opengl_renderer/Shader.h index 52d013928d..622aae73fb 100644 --- a/game/graphics/opengl_renderer/Shader.h +++ b/game/graphics/opengl_renderer/Shader.h @@ -40,6 +40,7 @@ enum class ShaderId { OCEAN_COMMON = 15, SHADOW = 16, SHRUB = 17, + COLLISION = 18, MAX_SHADERS }; diff --git a/game/graphics/opengl_renderer/Sprite3.cpp b/game/graphics/opengl_renderer/Sprite3.cpp index 0dd2fc4666..0e41da2f13 100644 --- a/game/graphics/opengl_renderer/Sprite3.cpp +++ b/game/graphics/opengl_renderer/Sprite3.cpp @@ -649,7 +649,7 @@ void Sprite3::do_block_common(SpriteMode mode, flush_sprites(render_state, prof, mode == ModeHUD); } - if (mode == Mode2D && render_state->has_camera_planes && m_enable_culling) { + if (mode == Mode2D && render_state->has_pc_data && m_enable_culling) { // we can skip sprites that are out of view // it's probably possible to do this for 3D as well. auto bsphere = m_vec_data_2d[sprite_idx].xyz_sx; diff --git a/game/graphics/opengl_renderer/SpriteRenderer.cpp b/game/graphics/opengl_renderer/SpriteRenderer.cpp index 4e26d69511..0bbe697a6b 100644 --- a/game/graphics/opengl_renderer/SpriteRenderer.cpp +++ b/game/graphics/opengl_renderer/SpriteRenderer.cpp @@ -653,7 +653,7 @@ void SpriteRenderer::do_block_common(SpriteMode mode, flush_sprites(render_state, prof); } - if (mode == Mode2D && render_state->has_camera_planes && m_enable_culling) { + if (mode == Mode2D && render_state->has_pc_data && m_enable_culling) { // we can skip sprites that are out of view // it's probably possible to do this for 3D as well. auto bsphere = m_vec_data_2d[sprite_idx].xyz_sx; diff --git a/game/graphics/opengl_renderer/background/Shrub.cpp b/game/graphics/opengl_renderer/background/Shrub.cpp index 38f5d06d40..980c306323 100644 --- a/game/graphics/opengl_renderer/background/Shrub.cpp +++ b/game/graphics/opengl_renderer/background/Shrub.cpp @@ -51,11 +51,11 @@ void Shrub::render(DmaFollower& dma, SharedRenderState* render_state, ScopedProf 2 * (0xff & m_pc_port_data.itimes[i / 2].data()[2 * (i % 2)]) / 127.f; } + update_render_state_from_pc_settings(render_state, m_pc_port_data); + for (int i = 0; i < 4; i++) { settings.planes[i] = m_pc_port_data.planes[i]; - render_state->camera_planes[i] = m_pc_port_data.planes[i]; } - render_state->has_camera_planes = true; m_has_level = setup_for_level(m_pc_port_data.level_name, render_state); render_all_trees(settings, render_state, prof); diff --git a/game/graphics/opengl_renderer/background/TFragment.cpp b/game/graphics/opengl_renderer/background/TFragment.cpp index d6833c1a96..20273b5717 100644 --- a/game/graphics/opengl_renderer/background/TFragment.cpp +++ b/game/graphics/opengl_renderer/background/TFragment.cpp @@ -125,11 +125,11 @@ void TFragment::render(DmaFollower& dma, settings.occlusion_culling = render_state->occlusion_vis[m_level_id].data; } + update_render_state_from_pc_settings(render_state, m_pc_port_data); + for (int i = 0; i < 4; i++) { settings.planes[i] = m_pc_port_data.planes[i]; - render_state->camera_planes[i] = m_pc_port_data.planes[i]; } - render_state->has_camera_planes = true; if (m_override_time_of_day) { for (int i = 0; i < 8; i++) { diff --git a/game/graphics/opengl_renderer/background/Tie3.cpp b/game/graphics/opengl_renderer/background/Tie3.cpp index 5590bf6577..47d18b4189 100644 --- a/game/graphics/opengl_renderer/background/Tie3.cpp +++ b/game/graphics/opengl_renderer/background/Tie3.cpp @@ -353,11 +353,11 @@ void Tie3::render(DmaFollower& dma, SharedRenderState* render_state, ScopedProfi settings.occlusion_culling = render_state->occlusion_vis[m_level_id].data; } + update_render_state_from_pc_settings(render_state, m_pc_port_data); + for (int i = 0; i < 4; i++) { settings.planes[i] = m_pc_port_data.planes[i]; - render_state->camera_planes[i] = m_pc_port_data.planes[i]; } - render_state->has_camera_planes = true; if (false) { // for (int i = 0; i < 8; i++) { diff --git a/game/graphics/opengl_renderer/background/background_common.cpp b/game/graphics/opengl_renderer/background/background_common.cpp index 7326d9863f..343f3294cd 100644 --- a/game/graphics/opengl_renderer/background/background_common.cpp +++ b/game/graphics/opengl_renderer/background/background_common.cpp @@ -658,4 +658,17 @@ u32 make_all_visible_index_list(std::pair* group_out, } *num_tris_out = num_tris; return idx_buffer_ptr; +} + +void update_render_state_from_pc_settings(SharedRenderState* state, const TfragPcPortData& data) { + if (!state->has_pc_data) { + for (int i = 0; i < 4; i++) { + state->camera_planes[i] = data.planes[i]; + state->camera_matrix[i] = data.camera[i]; + } + state->camera_pos = data.cam_trans; + state->camera_hvdf_off = data.hvdf_off; + state->camera_fog = data.fog; + state->has_pc_data = true; + } } \ No newline at end of file diff --git a/game/graphics/opengl_renderer/background/background_common.h b/game/graphics/opengl_renderer/background/background_common.h index 908386dc3f..d48a37a13c 100644 --- a/game/graphics/opengl_renderer/background/background_common.h +++ b/game/graphics/opengl_renderer/background/background_common.h @@ -3,6 +3,19 @@ #include "common/math/Vector.h" #include "game/graphics/opengl_renderer/BucketRenderer.h" +// data passed from game to PC renderers +// the GOAL code assumes this memory layout. +struct TfragPcPortData { + math::Vector4f planes[4]; + math::Vector itimes[4]; + math::Vector4f camera[4]; + math::Vector4f hvdf_off; + math::Vector4f fog; + math::Vector4f cam_trans; + char level_name[16]; +}; + +// inputs to background renderers. struct TfragRenderSettings { math::Matrix4f math_camera; math::Vector4f hvdf_offset; @@ -12,7 +25,6 @@ struct TfragRenderSettings { math::Vector4f planes[4]; bool debug_culling = false; const u8* occlusion_culling = nullptr; - // todo occlusion culling string. }; enum class DoubleDrawKind { NONE, AFAIL_NO_DEPTH_WRITE }; @@ -50,15 +62,7 @@ void cull_check_all_slow(const math::Vector4f* planes, u8* out); bool sphere_in_view_ref(const math::Vector4f& sphere, const math::Vector4f* planes); -struct TfragPcPortData { - math::Vector4f planes[4]; - math::Vector itimes[4]; - math::Vector4f camera[4]; - math::Vector4f hvdf_off; - math::Vector4f fog; - char level_name[12]; - u32 tree_idx; -}; +void update_render_state_from_pc_settings(SharedRenderState* state, const TfragPcPortData& data); void make_all_visible_multidraws(std::pair* draw_ptrs_out, GLsizei* counts_out, diff --git a/game/graphics/opengl_renderer/shaders/collision.frag b/game/graphics/opengl_renderer/shaders/collision.frag new file mode 100644 index 0000000000..635a50c276 --- /dev/null +++ b/game/graphics/opengl_renderer/shaders/collision.frag @@ -0,0 +1,9 @@ +#version 430 core + +out vec4 color; + +in vec4 fragment_color; + +void main() { + color = fragment_color; +} diff --git a/game/graphics/opengl_renderer/shaders/collision.vert b/game/graphics/opengl_renderer/shaders/collision.vert new file mode 100644 index 0000000000..b95fc892f7 --- /dev/null +++ b/game/graphics/opengl_renderer/shaders/collision.vert @@ -0,0 +1,67 @@ +#version 430 core + +layout (location = 0) in vec3 position_in; +layout (location = 1) in uint flags; +layout (location = 2) in vec3 normal_in; + +uniform vec4 hvdf_offset; +uniform mat4 camera; +uniform vec4 camera_position; +uniform float fog_constant; +uniform float fog_min; +uniform float fog_max; +uniform int mode; + +out vec4 fragment_color; + +void main() { + // Step 3, the camera transform + vec4 transformed = -camera[3].xyzw; + transformed += -camera[0] * position_in.x; + transformed += -camera[1] * position_in.y; + transformed += -camera[2] * position_in.z; + + // compute Q + float Q = fog_constant / transformed[3]; + + // perspective divide! + transformed.xyz *= Q; + + // offset + transformed.xyz += hvdf_offset.xyz; + + // ftoi4 + //transformed.xyzw *= 16; + + // correct xy offset + transformed.xy -= (2048.); + + // correct z scale + transformed.z /= (8388608); + transformed.z -= 1; + + // correct xy scale + transformed.x /= (256); + transformed.y /= -(128); + + // hack + transformed.xyz *= transformed.w; + + gl_Position = transformed; + // scissoring area adjust + gl_Position.y *= 512.0/448.0; + + vec3 to_cam = camera_position.xyz - position_in; + float dist_from_cam = length(to_cam); + vec3 to_cam_n = to_cam / dist_from_cam; + float cam_dot = abs(dot(to_cam_n, normal_in)); + + // color + if (mode == 0) { + fragment_color = vec4(0.4, 0.5, 0.5, 1); + fragment_color.xyz *= (pow(cam_dot, 3) + 0.3); + } else { + fragment_color = vec4(0.0, 0.3, 0.3, 1); + } + +} diff --git a/goal_src/engine/gfx/tfrag/tfrag.gc b/goal_src/engine/gfx/tfrag/tfrag.gc index 901602761d..e44fbdea95 100644 --- a/goal_src/engine/gfx/tfrag/tfrag.gc +++ b/goal_src/engine/gfx/tfrag/tfrag.gc @@ -322,7 +322,7 @@ (defun add-pc-tfrag3-data ((dma-buf dma-buffer) (lev level)) "Add PC-port specific tfrag data" (let ((packet (the-as dma-packet (-> dma-buf base)))) - (set! (-> packet dma) (new 'static 'dma-tag :id (dma-tag-id cnt) :qwc 15)) + (set! (-> packet dma) (new 'static 'dma-tag :id (dma-tag-id cnt) :qwc 16)) (set! (-> packet vif0) (new 'static 'vif-tag)) (set! (-> packet vif1) (new 'static 'vif-tag :cmd (vif-cmd pc-port))) (set! (-> dma-buf base) (the pointer (&+ packet 16))) @@ -348,9 +348,10 @@ (set! (-> vec y) (-> *math-camera* fog-min)) (set! (-> vec z) (-> *math-camera* fog-max)) ) - (charp<-string (the (pointer uint8) (&-> data-ptr 14)) (symbol->string (-> lev nickname))) + (set! (-> data-ptr 14) (-> (math-camera-pos) quad)) + (charp<-string (the (pointer uint8) (&-> data-ptr 15)) (symbol->string (-> lev nickname))) ) - (&+! (-> dma-buf base) (* 16 15)) + (&+! (-> dma-buf base) (* 16 16)) ) ;;;;;;;;;;;;;;;;;;;;; From 5203e6e8a6553a343fcee718a34da5dab8d09fc6 Mon Sep 17 00:00:00 2001 From: water111 <48171810+water111@users.noreply.github.com> Date: Mon, 25 Apr 2022 22:36:28 -0400 Subject: [PATCH 5/6] [extractor] extract iso to a better spot (#1339) * t * extract iso to iso_data --- decompiler/extractor/main.cpp | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/decompiler/extractor/main.cpp b/decompiler/extractor/main.cpp index 702155bdbe..8db5cfe3ec 100644 --- a/decompiler/extractor/main.cpp +++ b/decompiler/extractor/main.cpp @@ -317,6 +317,7 @@ int main(int argc, char** argv) { bool flag_decompile = false; bool flag_compile = false; bool flag_play = false; + bool flag_folder = false; lg::initialize(); @@ -334,6 +335,7 @@ int main(int argc, char** argv) { app.add_flag("-d,--decompile", flag_decompile, "Decompile the game data"); app.add_flag("-c,--compile", flag_compile, "Compile the game"); app.add_flag("-p,--play", flag_play, "Play the game"); + app.add_flag("-f,--folder", flag_folder, "Extract from folder"); app.validate_positionals(); CLI11_PARSE(app, argc, argv); @@ -353,16 +355,18 @@ int main(int argc, char** argv) { setup_global_decompiler_stuff(std::nullopt); } - auto path_to_iso_files = file_util::get_jak_project_dir() / "extracted_iso"; + std::filesystem::path path_to_iso_files = file_util::get_jak_project_dir() / "iso_data" / "jak1"; + std::filesystem::create_directories(path_to_iso_files); // make sure the input looks right if (!std::filesystem::exists(data_dir_path)) { - fmt::print("Error: input folder {} does not exist\n", data_dir_path.string()); + fmt::print("Error: input data path {} does not exist\n", data_dir_path.string()); return 1; } if (flag_runall || flag_extract) { - if (!std::filesystem::is_directory(data_dir_path)) { + if (std::filesystem::is_regular_file(data_dir_path)) { + // it's a file, treat it as an ISO auto iso_file = extract_files(data_dir_path, path_to_iso_files); auto validation_res = validate(iso_file, path_to_iso_files); if (validation_res == ExtractorErrorCode::VALIDATION_BAD_EXTRACTION) { @@ -371,6 +375,13 @@ int main(int argc, char** argv) { } else if (flag_fail_on_validation && validation_res != ExtractorErrorCode::SUCCESS) { return static_cast(validation_res); } + } else if (std::filesystem::is_directory(data_dir_path)) { + if (!flag_folder) { + // if we didn't request a folder explicitly, but we got one, assume something went wrong. + fmt::print("Error: got a folder, but didn't get folder flag\n"); + return static_cast(ExtractorErrorCode::VALIDATION_BAD_ISO_CONTENTS); + } + path_to_iso_files = data_dir_path; } } From f9313d8260b3d0ef4eed90ed582585bdecf46569 Mon Sep 17 00:00:00 2001 From: ManDude <7569514+ManDude@users.noreply.github.com> Date: Tue, 26 Apr 2022 23:21:20 +0100 Subject: [PATCH 6/6] subtitles for 3 more levels (#1340) * rework "all actors" option a bit * update mistycannon * `vi1`, `mis`, `fin` subtitles * two pov-camera ones i missed! --- decompiler/config/all-types.gc | 4 +- game/assets/jak1/subtitle/game_subtitle_en.gs | 265 +++++++++++++++++- goal_src/engine/entity/entity.gc | 192 ++++++------- goal_src/engine/level/level.gc | 9 +- .../engine/ui/progress/progress-static.gc | 2 +- goal_src/levels/misty/mistycannon.gc | 24 +- goal_src/pc/pckernel-h.gc | 9 +- goal_src/pc/pckernel.gc | 2 +- .../reference/levels/misty/mistycannon_REF.gc | 25 +- 9 files changed, 369 insertions(+), 163 deletions(-) diff --git a/decompiler/config/all-types.gc b/decompiler/config/all-types.gc index c1a3065734..0820408265 100644 --- a/decompiler/config/all-types.gc +++ b/decompiler/config/all-types.gc @@ -23784,10 +23784,10 @@ ;; - Functions -(define-extern mistycannon-prebind-function (function mistycannon int mistycannon none)) +(define-extern mistycannon-prebind-function (function pointer int mistycannon none)) (define-extern mistycannon-postbind-function (function mistycannon none)) (define-extern angle-tracker-init-range! (function angle-tracker float float float none)) -(define-extern mistycannon-pick-random-target-point (function float :behavior mistycannon)) +(define-extern mistycannon-pick-random-target-point (function none :behavior mistycannon)) (define-extern angle-tracker-seek! (function angle-tracker float symbol)) (define-extern mistycannon-do-aim (function vector vector none :behavior mistycannon)) ;; can return a #f is postbindinfo-ok is false (define-extern mistycannon-find-trajectory (function trajectory-params none :behavior mistycannon)) diff --git a/game/assets/jak1/subtitle/game_subtitle_en.gs b/game/assets/jak1/subtitle/game_subtitle_en.gs index f5b4076fba..fdd6281b5a 100644 --- a/game/assets/jak1/subtitle/game_subtitle_en.gs +++ b/game/assets/jak1/subtitle/game_subtitle_en.gs @@ -206,7 +206,42 @@ ("ASSTLP03" :hint 0 (0 "KEIRA" "WE NEED POWER CELLS TO FUEL THE HEAT SHIELD...")) ("ASSTLP04" :hint 0 (0 "KEIRA" "WHERE'S MY SPANNER?")) ("ASSTLP05" :hint 0 (0 "KEIRA" "FIRE CANYON IS SO HOT...")) +("EXP-AM01" :hint 0 (0 "JAK'S UNCLE" "I NEED TO SET OFF ON MY JOURNEY SOON. I NEED PRECURSOR ORBS!")) +("EXP-AM02" :hint 0 (0 "JAK'S UNCLE" "LET'S SEE, NOW WHERE SHALL I GO FIRST? EH...")) +("EXP-AM03" :hint 0 (0 "JAK'S UNCLE" "OH I DO MISS THE OPEN ROAD.")) +("EXP-AM04" :hint 0 (0 "JAK'S UNCLE" "SO MANY PLACES TO SEE, AND SO LITTLE TIME.")) +("EXP-AM05" :hint 0 (0 "JAK'S UNCLE" "WELL IN MY DAY, YOU COULD WALK THE LANDS WITHOUT BEING ASSAULTED BY MONSTERS!")) +("EXP-LO02" :hint 0 (0 "JAK'S UNCLE" "I NEED MORE PRECURSOR ORBS.")) +("FAR-AM01" :hint 0 (0 "FARMER" "(SNORES) HERE, BESSIE... HERE, BESSIE BESSIE... THAT'S A GOOD GIRL...")) +("FAR-AM02" :hint 0 (0 "FARMER" "GOTTA BRING IN THE CROPS 'FORE THE JUNE BUGS...")) +("FAR-AM2A" :hint 0 (0 "FARMER" "GOTTA BRING IN THE CROPS 'FORE THE JUNE BUGS GET...")) +("FAR-LO01" :hint 0 (0 "FARMER" "(SNORES)")) +("FAR-LO1A" :hint 0 (0 "FARMER" "(SNORES)")) +("sksp0010" :hint #x231 (0 "DAXTER" "HEY! LET'S GO CHECK OUT OL' FISH BREATH'S SPEED-BOAT AT THE DOCK!")) +("sksp0013" :hint #x232 + (0 "DAXTER" "DID YOU SEE THE SIZE OF THE BITE THAT LURKER SHARK TOOK OUT OF THE FISHERMAN'S BOAT?") + (315) + (337 "DAXTER" "WE BEST STAY WAY CLEAR OF THEM! I DON'T THINK WE CAN TACKLE A CREATURE THAT DAG NASTY.") + ) +("sksp0015" :hint #x234 + (0 "DAXTER" "THIS MUST BE A PRECURSOR ORACLE LIKE THE SAGE ALWAYS GOES ON ABOUT.") + (228 "DAXTER" "I HOPE THEY WEREN'T AS UGLY IN PERSON!") + ) +("sksp0017" :hint #x235 (0 "DAXTER" "WHOA! CHECK OUT THAT FUNKY SCULPTURE SITTIN' ON THE ROCKS OVER THERE!")) +("sksp0043" :hint #x24e + (0 "DAXTER" "MAYBE WE SHOULD GO ROOT OUT THE FISHERMAN.") + (106 "DAXTER" "I HEARD HE WAS IN THE JUNGLE FISHING BY THE LOWER RIVER!") + ) +("asstvb04" :hint #x2b1 + (0 "KEIRA" "GOOD, YOU'VE COLLECTED ENOUGH POWER CELLS TO FUEL MY HEAT SHIELD!") + (235 "KEIRA" "MEET ME BY THE ENTRANCE TO THE FIRE CANYON BY CLIMBING THE CLIFF BEHIND THE FARMER'S HOUSE.") + (559 "KEIRA" "BRING THE POWER CELLS, AND HURRY! MY FATHER SAYS HE'S SEEN MORE LURKERS AROUND!") + ) +("asstvb08" :hint #x2b2 + (0 "KEIRA" "HURRY UP WITH THOSE POWER CELLS. I'M WAITING AT THE HEAD OF FIRE CANYON") + (260 "KEIRA" "AT THE TOP OF THE CLIFF BEHIND THE FARMER'S HOUSE!") + ) ("sage-introduction-misty-cannon" (24 "SAGE" "OH, IT'S THE CONQUERING HEROES.") @@ -222,12 +257,123 @@ (807 "SAGE" "JAK, IT'S TIME FOR YOU TO PROVE YOUR WORTH.") (906 "SAGE" "GET THE FISHERMAN TO LET YOU TAKE HIS BOAT BACK TO MISTY ISLAND") (1018 "SAGE" "GET TO THE TOP OF THE PRECURSOR SILO AND TAKE OUT THAT CANNON.") - (1071) + (1171) (1177 "DAXTER" "AND... WHAT ABOUT ME?") (1232) (1235 "SAGE" "YOU? WHY DON'T YOU MOP MY FLOORS? THEY SEEM TO HAVE LOST THEIR SHINE LATELY.") ) +("sage-reminder-1-misty-cannon" + (24 "SAGE" "THE BOMBARDMENT IS GETTING WORSE!") + (86 :offscreen "SAGE" "FIND THE FISHERMAN IN THE JUNGLE, GET PERMISSION TO USE HIS BOAT") + (215 :offscreen "SAGE" "AND GET OVER TO MISTY ISLAND TO STOP THE CANNON.") + (317) + (320 "SAGE" "AND YOU DAXTER, YOU NEED TO GET MOPPING. THIS PLACE IS A MESS!") + ) + +("sage-reminder-1-ecorocks" + (28 "SAGE" "SOME \"BRAVE ADVENTURERS\" YOU TWO ARE.") + (132 "SAGE" "BACK ALREADY AND WITHOUT CLEARING MY BLOCKED ECO HARVESTERS!") + (244) + (252 :offscreen "SAGE" "THEY'RE ON THE FAR SIDE OF THE BEACH, BOYS.") + (365) + (366 :offscreen "SAGE" "NOW...") + (412 :offscreen "SAGE" "GET MOVING!") + ) + +("sage-reminder-1-generic" + (54 "SAGE" "WHAT ARE YOU TWO DOING HERE? YOU HAVE POWER CELLS TO COLLECT!") + (178) + (181 "SAGE" "LEAVE ME ALONE... UNTIL YOU HAVE THEM!") + ) + +("sage-reminder-2-generic" + (27 "SAGE" "YOU TWO JUST DON'T UNDERSTAND THE GRAVITY OF THE SITUATION.") + (137 "SAGE" "THIS IS ABOUT MORE THAN A SINGLE BOY GONE FUZZY. THIS IS ABOUT LIFE AS WE KNOW IT.") + (320) + (323 "SAGE" "NOW, GET OUT THERE AND FULFILL YOUR DESTINY.") + (455) + ) + +("assistant-introduction-blue-eco-switch" + (23 "DAXTER" "HEY BABY. WHAT DO YOU SAY YOU AND I GO CRUISIN' ON THIS A-GRAV ZOOMER?") + (175) + (193 "KEIRA" "RULE NUMBER ONE: I DON'T DATE ANIMALS.") + (308) + (312 "DAXTER" "OH YOU DON'T KNOW WHAT YOU'RE MISSING, HE HEH.") + (430) + (505 "KEIRA" "LISTEN, IF YOU NEED SOMETHING TO KEEP YOU BUSY, MY FATHER ALWAYS TALKED") + (635 "KEIRA" "ABOUT AN ANCIENT PRECURSOR PIPELINE HIDDEN DEEP UNDERGROUND.") + (739) + (742 :offscreen "KEIRA" "SOME OF THESE PIPES END IN VENTS FROM WHICH ECO FLOWS FREELY,") + (842 :offscreen "KEIRA" "AND SOME HAVE BEEN CAPPED OFF SO THAT THE ECO IS SEALED BACK.") + (945) + (954 "KEIRA" "THERE MUST BE A WAY TO TURN THE CAPPED VENTS ON.") + (1052 :offscreen "KEIRA" "I TRACED PART OF THE PIPELINE BACK TO THE FORBIDDEN TEMPLE.") + (1138 "KEIRA" "MAYBE YOU SHOULD LOOK THERE FOR SOME TYPE OF SWITCH.") + (1246) + ) + +("assistant-reminder-1-blue-eco-switch" + (23 "KEIRA" "I'M SURE IF YOU LOOKED INSIDE THE PRECURSOR FORBIDDEN TEMPLE") + (143 "KEIRA" "YOU'LL FIND A WAY TO TURN ON THAT CAPPED BLUE ECO VENT ON SENTINEL BEACH.") + (295) + ) + +("farmer-introduction" + (1 "FARMER" "GOTTA MILK THOSE YAKOWS, GOTTA MILK THOSE YAKOWS...") + (113 "FARMER" "OH! IT'S YOU... JUST RESTIN' MY TRIED BONES. I'VE BEEN TRYING TO GET THOSE ORNERY YAKOWS") + (317 "FARMER" "BACK INTO THE PEN ALL DAY! SOME STRANGE CREATURES TRIED TO STEAL 'EM EARLIER.") + (454) + (456 "FARMER" "YOU THINK YOU CAN HELP AN OLD MAN TRY TO GET 'EM BACK INTO THE CORRAL?") + ) + +("farmer-reminder-1" + (0 "FARMER" "HEY! MY YAKOWS ARE STILL ON THE LOOSE! EH, COULD YOU BRING 'EM BACK FOR ME ALREADY?") + ) + +("farmer-reminder-2" + (0 "FARMER" "THOSE DARN YAKOWS ARE STILL ROAMIN' FREE.") + (85 "FARMER" "AIN'T YOU GONNA CHASE 'EM INTO THE CORRAL ALREADY?") + ) + +("farmer-resolution" + (0 "FARMER" "AH, WELL DONE MY BOY. YOU ACTUALLY GOT THOSE FLEABAGS PACK INTO THE PEN.") + (134 "FARMER" "NOW I CAN SLEEP IN PEACE. TAKE THIS POWER CELL FOR YOUR TROUBLE.") + (340) + ) + +("explorer-introduction" + (23 "JAK'S UNCLE" "WELL, HELLO THERE MY DEAR BOY. YOU'VE CAUGHT AT A MOST INOPPORTUNE MOMENT.") + (197 "JAK'S UNCLE" "I WAS TO SET OFF ON MY JOURNEYS YESTERDAY") + (288 "JAK'S UNCLE" "BUT I SEEM TO BE A SPOT SHORT ON THE OLD PRECURSOR ORBS.") + (426) + (430 "JAK'S UNCLE" "I WOULD'VE PLEDGED MY WORD THAT I HAD 90 OF THEM,") + (538 "JAK'S UNCLE" "BUT I GATHER THAT YOUR YOUNG FRIEND, YOU KNOW, THE LITTLE ANNOYING MISERABLY UGLY ONE") + (716 "JAK'S UNCLE" "MIGHT HAVE JUST PILFERED THEM AS A SORT OF A SPOT OF FUN.") + (829) + (865 "JAK'S UNCLE" "ANYWAY, WOULD YOU BE KIND ENOUGH TO LOAN YOUR DEAR OLD UNCLE 90 PRECURSOR ORBS") + (1043 "JAK'S UNCLE" "SO HE CAN GET UNDERWAY? I WOULD OFFER YOU A POWER CELL IN RETURN.") + ) + +("explorer-reminder-1" + (25 "JAK'S UNCLE" "WHAT? YOU DON'T HAVE THE FULL STASH? HARUMPH!") + (148 "JAK'S UNCLE" "WELL, ANY LESS THAN 90 PRECURSOR ORBS") + (251 "JAK'S UNCLE" "AND I SHAN'T HAVE A CHANCE TO GET UNDERWAY, DEAR BOY.") + (387) + ) + +("explorer-reminder-2" + (33 "JAK'S UNCLE" "OH SEE HERE, THE DEAL IS FOR 90 PRECURSOR ORBS FOR A POWER CELL.") + (187 "JAK'S UNCLE" "A DOWNRIGHT EVEN TRADE.") + ) + +("explorer-resolution" + (28 "JAK'S UNCLE" "I SEE YOU TWO ARE BACK TO MAKE THE TRADE. GOOD, GOOD, JOLLY GOOD!") + (179 "JAK'S UNCLE" "EH, YOU HAVE THE UH, PRECURSOR ORBS THAT WE AGREED ON?") + (310) + (324 "JAK'S UNCLE" "I HOPE YOU PUT THIS HARD-EARNED POWER CELL TO GOOD USE. CHEERIO, TA TA, BYE BYE!") + ) ;; ----------------- @@ -246,9 +392,16 @@ ("sksp0031" :hint #x23a (0 "DAXTER" "OOH! LET'S USE THE CANNON TO BLOW THINGS UP!")) +("sksp0064" :hint #x245 (0 "DAXTER" "WATCH YOUR BACK! YOU REMEMBER WHAT HAPPENED THE LAST TIME WE WERE HERE.")) ("sksp0067" :hint #x249 (0 "DAXTER" "DON'T FALL INTO THE MIST BELOW US! 'CAUSE I DON'T THINK WE'LL MAKE IT BACK.")) ("sksp0059" :hint #x26e (0 "DAXTER" "THIS PLACE GIVES ME THE WILLIES! LET'S KEEP YOU OUT OF THE OOZE, OKAY?")) ("sksp0056" :hint #x27b (0 "DAXTER" "HEY! I SEE THE SCULPTOR'S MUSE!")) +("sksp0062" :hint #x27e (0 "DAXTER" "LET'S PLOW INTO THOSE BALLOON LURKERS AND SHRED 'EM!")) +("sksp0063" :hint #x27f + (0 "DAXTER" "I SAID \"SHRED THE LURKERS,\" JAK. NOT THE MINES!") + (332) + (344 "DAXTER" "RULE NUMBER ONE: ALWAYS AVOID THE MINES!") + ) ("sagevb02" :hint #x28a (6 "SAGE" "I HAVE TO ADMIT, I'M IMPRESSED. YOU TWO DIDN'T SCREW UP!") (385) @@ -258,6 +411,11 @@ (880 "SAGE" "WIPE THAT RIDICULOUS GRIN OFF YOUR FACE, DAXTER! THE TWO OF YOU HAVE PLENTY TO DO.") (1191 "SAGE" "GET ON WITH IT!") ) +("asstvb03" :hint #x28b + (0 "KEIRA" "GOOD! YOU STOPPED ALL THE MINE-DROPPING LURKERS!") + (190 "KEIRA" "THEY'VE BEEN THREATENING THE WATERS AROUND OUR VILLAGE FOR WEEKS.") + (391 "KEIRA" "BRING YOUR ZOOMER BACK TO THE TRANS-PAD AND I'LL TELEPORT IT BACK.") + ) ("sksp0069" :hint #x2a3 (0 "DAXTER" "IT'S AN AMBUSH, JAK! IT'S AN AMBUSH!")) ("sksp0070" :hint #x2a4 (0 "DAXTER" "JUMP, THEN DIVE ONTO THE TEETER-TOTTER.")) ("sksp0435" :hint #x2aa (0 "DAXTER" "KNOCK OVER THOSE BONES!")) @@ -409,6 +567,111 @@ ("sksp0378" :hint #x813 (0 "DAXTER" "THE DOOR'S OPEN, LET'S GET GOING!")) +;; ----------------- +;; finalboss + + +("GOL-AM01" :hint 0 (0 "GOL" "YOU JUST WON'T GIVE UP, WILL YOU?")) +("GOL-AM02" :hint 0 (0 "GOL" "SOON, THE DARK ECO WILL BE OURS!")) +("GOL-AM03" :hint 0 (0 "GOL" "FINISH THEM!")) +("GOL-AM04" :hint 0 (0 "GOL" "FIRE!")) +("GOL-AM05" :hint 0 (0 "GOL" "BLAST THEM!")) +("GOL-AM06" :hint 0 (0 "GOL" "WHAT? THEM AGAIN!")) +("GOL-AM07" :hint 0 (0 "GOL" "IT'S TOO LATE!")) +("GOL-AM08" :hint 0 (0 "GOL" "YOU ARE MINE!")) +("GOL-AM09" :hint 0 (0 "GOL" "I HAVE YOU NOW!")) +("GOL-AM10" :hint 0 (0 "GOL" "AH HA HA HA HA!")) +("GOL-AM11" :hint 0 (0 "GOL" "NO MERCY!")) +("GOL-AM12" :hint 0 (0 "GOL" "TAKE THAT!")) +("GOL-AM13" :hint 0 (0 "GOL" "NICE TRY!")) +("GOL-AM14" :hint 0 (0 "GOL" "STAND STILL!")) +("GOL-AM15" :hint 0 (0 "GOL" "PATHETIC!")) +("GOL-AM16" :hint 0 (0 "GOL" "NOOO!")) +("GOL-AM17" :hint 0 (0 "GOL" "AHHH!")) +("GOL-AM18" :hint 0 (0 "GOL" "WE'LL OPEN THE SILO ALL THE WAY AND DESTROY YOU TWO!")) +("GOL-AM19" :hint 0 (0 "GOL" "LIGHT ECO! IT DOES EXIST!")) +("GOL-AM20" :hint 0 (0 "GOL" "WE'RE NOT GONNA TAKE IT!")) +("MAI-AM01" :hint 0 (0 "MAIA" "FINISH THEM BOTH OFF ONCE AND FOR ALL!")) +("MAI-AM02" :hint 0 (0 "MAIA" "TAKE THEM OUT!")) +("MAI-AM03" :hint 0 (0 "MAIA" "HA HA HA!")) +("MAI-AM04" :hint 0 (0 "MAIA" "ECO WON'T PROTECT YOU NOW!")) +("MAI-AM05" :hint 0 (0 "MAIA" "DO SOMETHING!")) +("MAI-AM06" :hint 0 (0 "MAIA" "AGH!")) +("MAI-AM07" :hint 0 (0 "MAIA" "NOOOOO!")) +("MAI-AM08" :hint 0 (0 "MAIA" "WE'LL OPEN THE SILO ALL THE WAY AND DESTROY YOU TWO!")) +("MAI-AM09" :hint 0 (0 "MAIA" "THEY MUST NOT BE ALLOWED TO GET IT!")) + +("finalbosscam-white-eco" + (163 :offscreen "GOL" "LIGHT ECO! IT DOES EXIST!") + (268 :offscreen "MAIA" "THEY MUST NOT BE ALLOWED TO GET IT!") + ) + +("green-sagecage-daxter-sacrifice" + (0 "DAXTER" "LIGHT ECO! THAT COULD BE THE STUFF TO CHANGE ME BACK!") + (114) + (123 "DAXTER" "OR... IT MIGHT STOP THAT ROBOT.") + (235) + (274 "DAXTER" "STAY FUZZY, SAVE THE WORLD... CHOICES...") + (404) + (437 "DAXTER" "OKAY FINE WE'LL SAVE THE WORLD, BUT DO IT QUICKLY BEFORE I CHANGE MY MIND!") + (634) + ) + +("green-sagecage-outro-beat-boss-a" + (165 :offscreen "MAIA" "DO SOMETHING!") + (216) + (596 :offscreen "GOL" "NOOO!") + ) + +("green-sagecage-outro-beat-boss-b" + (522 "SAGE" "WELL IT LOOKS LIKE I MAY HAVE BEEN TOO HARD ON YOU BOYS.") + (640 "SAGE" "YOU DO HAVE WHAT IT TAKES TO BE HEROES!") + (745) + (751 "KEIRA" "BUT, DAXTER, NOW WE CAN'T CHANGE YOU BACK.") + (845) + (847 "DAXTER" "DON'T WORRY ABOUT ME, BABY. YOU KNOW WHAT THEY SAY: BIG THINGS COME IN SMALL PACKAGES.") + (1096) + (1100 "BLUE SAGE" "JAK, YOU HAVE AN INCREDIBLE TALENT FOR CHANNELING ECO!") + (1219) + (1222 "BLUE SAGE" "SAMOS, YOU MAY HAVE BEEN RIGHT ABOUT THIS ONE AFTER ALL!") + (1321) + (1323 "RED SAGE" "AND KEIRA, WITHOUT YOUR HELP AND INGENUITY NONE OF THIS WOULD HAVE BEEN POSSIBLE.") + (1515 "RED SAGE" "HM-HM-HM. PERHAPS WE FOUND ANOTHER SAGE NOW THAT GOL AND MAIA ARE LOST...") + (1728) + (1731 "SAGE" "YES, GOL AND MAIA... THE DARK ECO PROBABLY DESTROYED THEM.") + (1916 :offscreen "SAGE" "EH, PROBABLY...") + (1999) + (2003 "DAXTER" "AH WHO CARES? BRING 'EM ON WE CAN TAKE 'EM AGAIN, RIGHT JAK?") + (2168) + (2172 "DAXTER" "I SAID, RIGHT, JAK?") + (2256) + (2302 "DAXTER" "WHOA! PUT IT ON ICE, BIG GUY!") + ) + +("green-sagecage-outro-beat-boss-need-cells" + (151 "SAGE" "HOLY YAKOW! WHAT COULD THAT BE?") + (247 "KEIRA" "WOW, IT'S AN ANCIENT PRECURSOR DOOR!") + (342 :offscreen "KEIRA" "IT LOOKS LIKE IT WILL ONLY OPEN IF WE FILL ALL 100 HOLES WITH POWER CELLS!") + (485 "DAXTER" "OH BOY... HERE WE GO AGAIN!") + ) + +("green-sagecage-outro-beat-boss-enough-cells" + (151 "SAGE" "HOLY YAKOW! WHAT COULD THAT BE?") + (247 "KEIRA" "WOW, IT'S AN ANCIENT PRECURSOR DOOR!") + (342 :offscreen "KEIRA" "IT LOOKS LIKE IT WILL ONLY OPEN IF WE FILL ALL 100 HOLES WITH POWER CELLS!") + (485 "DAXTER" "UH, WE'RE HEROES, REMEMBER? WE HAVE 100 POWER CELLS!") + ) + +("green-sagecage-outro-big-finish" + (322 "DAXTER" "WOW! WHAT IS IT?") + (425) + (428 "KEIRA" "IT'S SO BEAUTIFUL...") + (516) + (519 "SAGE" "BY THE PRECURSORS...") + (602) + ) + + ;; ----------------- ;; training diff --git a/goal_src/engine/entity/entity.gc b/goal_src/engine/entity/entity.gc index b45b0f3453..3e9850f526 100644 --- a/goal_src/engine/entity/entity.gc +++ b/goal_src/engine/entity/entity.gc @@ -167,9 +167,7 @@ (when (nonzero? s4-0) (dotimes (s3-0 (-> s4-0 length)) (let ((s2-0 (-> s4-0 data s3-0 actor))) - (if (and (type-type? (-> s2-0 type) entity-actor) - (= (-> s2-0 etype) arg0) - ) + (if (and (type-type? (-> s2-0 type) entity-actor) (= (-> s2-0 etype) arg0)) (return s2-0) ) ) @@ -232,11 +230,10 @@ (let* ((t1-3 (-> a3-5 data t0-4 actor)) (t2-1 (-> t1-3 extra trans)) ) - (if (and - (= (the float (the int (-> t2-1 x))) arg0) - (= (the float (the int (-> t2-1 y))) arg1) - (= (the float (the int (-> t2-1 z))) arg2) - ) + (if (and (= (the float (the int (-> t2-1 x))) arg0) + (= (the float (the int (-> t2-1 y))) arg1) + (= (the float (the int (-> t2-1 z))) arg2) + ) (return t1-3) ) ) @@ -347,10 +344,9 @@ The second is a d, if we draw (only if we are process-drawable) The third is the LOD of the drawing. (also only for process-drawable)" (let* ((s5-0 arg0) - (proc-draw (the-as process-drawable - (if (and (nonzero? s5-0) (type-type? (-> s5-0 type) process-drawable)) - s5-0 - ) + (proc-draw (the-as process-drawable (if (and (nonzero? s5-0) (type-type? (-> s5-0 type) process-drawable)) + (the-as process-drawable s5-0) + ) ) ) ) @@ -458,8 +454,8 @@ ) (if (-> obj extra process) (* (- (-> obj extra process allocated-length) - (&- (-> obj extra process heap-top) (the-as uint (-> obj extra process heap-cur))) - ) + (&- (-> obj extra process heap-top) (the-as uint (-> obj extra process heap-cur))) + ) 8 ) "" @@ -922,10 +918,10 @@ ) ((or (= arg0 'full) (-> s0-0 extra process)) (add-debug-x #t (bucket-id debug-no-zbuf) s1-0 (the-as rgba (if (-> s0-0 extra process) - (the-as uint #x8080ff80) - (the-as uint #x800000ff) - ) - ) + (the-as uint #x8080ff80) + (the-as uint #x800000ff) + ) + ) ) (set! sv-192 add-debug-text-3d) (set! sv-208 #t) @@ -1023,10 +1019,10 @@ ) (when s3-2 (add-debug-x #t (bucket-id debug-no-zbuf) s4-2 (the-as rgba (if (-> s3-2 extra process) - (the-as uint #x8080ff80) - (the-as uint #x800000ff) - ) - ) + (the-as uint #x8080ff80) + (the-as uint #x800000ff) + ) + ) ) (add-debug-text-3d #t @@ -1063,12 +1059,11 @@ (dummy-9 (-> (the-as process-drawable s5-2) vol)) ) ) - (if (and - (the-as process-drawable s5-2) - (type-type? (-> (the-as process-drawable s5-2) type) process-drawable) - (nonzero? (-> (the-as process-drawable s5-2) draw)) - *display-actor-vis* - ) + (if (and (the-as process-drawable s5-2) + (type-type? (-> (the-as process-drawable s5-2) type) process-drawable) + (nonzero? (-> (the-as process-drawable s5-2) draw)) + *display-actor-vis* + ) (add-debug-sphere #t (bucket-id debug) @@ -1083,7 +1078,7 @@ ) ) (when (and *display-actor-vis* *display-actor-anim*) - (let ((s5-3 (entity-by-name (the-as string *display-actor-anim*)))) + (let ((s5-3 (entity-by-name *display-actor-anim*))) (when s5-3 (let ((v0-35 (res-lump-data s5-3 'visvol pointer)) (a1-31 (-> s5-3 extra vis-id)) @@ -1106,10 +1101,9 @@ ) ) ) - (if (and - (or *display-nav-marks* *display-path-marks* *display-vol-marks*) - (not (or *display-actor-anim* *display-process-anim*)) - ) + (if (and (or *display-nav-marks* *display-path-marks* *display-vol-marks*) + (not (or *display-actor-anim* *display-process-anim*)) + ) (iterate-process-tree *active-pool* (the-as (function object object) (lambda ((arg0 process-drawable)) @@ -1171,17 +1165,16 @@ ) ) ) - (when (or - *display-ambient-hint-marks* - *display-ambient-sound-marks* - *display-ambient-poi-marks* - *display-ambient-light-marks* - *display-ambient-dark-marks* - *display-ambient-weather-off-marks* - *display-ambient-ocean-off-marks* - *display-ambient-ocean-near-off-marks* - *display-ambient-music-marks* - ) + (when (or *display-ambient-hint-marks* + *display-ambient-sound-marks* + *display-ambient-poi-marks* + *display-ambient-light-marks* + *display-ambient-dark-marks* + *display-ambient-weather-off-marks* + *display-ambient-ocean-off-marks* + *display-ambient-ocean-near-off-marks* + *display-ambient-music-marks* + ) (dotimes (s5-5 (-> obj length)) (let ((v1-214 (-> obj level s5-5))) (when (= (-> v1-214 status) 'active) @@ -1254,21 +1247,6 @@ `(or ,@(apply (lambda (x) `(begin (define-extern ,x type) (type-type? (-> obj etype) ,x))) types)) ) -(defmacro heap-size-hack (info entity-type) - ; `(cond - ; ((type-type? ,entity-type collectable) - ; #x1000 - ; ) - ; (else - `(if ,info - (-> ,info heap-size) - #x4000 - ) - ; ) - ; ) - ; #x8000 - ) - (defmethod birth! entity-actor ((obj entity-actor)) "Create a process for this entity and start it." @@ -1288,7 +1266,10 @@ (let* ((entity-type (-> obj etype)) (info (entity-info-lookup entity-type)) - (entity-process (get-process *default-dead-pool* entity-type (heap-size-hack info entity-type) ;; hack, modified this. + (entity-process (get-process *default-dead-pool* entity-type (if info + (-> info heap-size) + #x4000 + ) ) ) ) @@ -1306,7 +1287,6 @@ (init-entity entity-process obj) ) (else - (birth-log "could not birth ~A because there was an issue.~%" obj) (when (not (birth-viewer entity-process obj)) (format 0 "ERROR: no proper process type named ~A exists in the code, could not start ~A~%" entity-type obj) (logior! (-> obj extra perm status) (entity-perm-status bit-0)) @@ -1372,12 +1352,10 @@ ;; NOTE: we don't actually birth the actors. It is too slow. ;; so it gets spread over multiple frames later. (when (nonzero? (-> obj actors)) - ;;(birth-log "add-to-level! for ~D actors for ~A~%" (-> obj actors length) obj) (dotimes (birth-idx (-> obj actors length)) (let* ((idx-to-birth (-> obj actor-birth-order birth-idx)) (actor-to-birth (-> obj actors data (logand idx-to-birth #xffff) actor)) ) - ;;(birth-log "now adding to level: ~D ~D ~A~%" birth-idx idx-to-birth actor-to-birth) (add-to-level! actor-to-birth *level* (-> obj level) (the-as actor-id (-> actor-to-birth aid))) ) ) @@ -1423,7 +1401,6 @@ (let ((cams (-> obj cameras))) (when (nonzero? cams) (dotimes (s3-1 (-> cams length)) - ;;(birth-log "birth cam: ~A~%" (-> cams s3-1)) (birth! (-> cams s3-1)) ) ) @@ -1471,11 +1448,10 @@ ) ((= (-> s2-0 type) part-tracker) (let ((v1-28 (the-as part-tracker s2-0))) - (if (and - (nonzero? (-> v1-28 part)) - (>= (the-as int (-> v1-28 part group)) (the-as int s4-2)) - (< (the-as int (-> v1-28 part group)) (the-as int s3-1)) - ) + (if (and (nonzero? (-> v1-28 part)) + (>= (the-as int (-> v1-28 part group)) (the-as int s4-2)) + (< (the-as int (-> v1-28 part group)) (the-as int s3-1)) + ) (deactivate s2-0) ) ) @@ -1489,11 +1465,10 @@ ) (when v1-34 (cond - ((and - (nonzero? (-> (the-as process-drawable v1-34) part)) - (>= (the-as int (-> (the-as process-drawable v1-34) part group)) (the-as int s4-2)) - (< (the-as int (-> (the-as process-drawable v1-34) part group)) (the-as int s3-1)) - ) + ((and (nonzero? (-> (the-as process-drawable v1-34) part)) + (>= (the-as int (-> (the-as process-drawable v1-34) part group)) (the-as int s4-2)) + (< (the-as int (-> (the-as process-drawable v1-34) part group)) (the-as int s3-1)) + ) (format #t "NOTICE: rogue null level entity (using part ~A) ~A~% still alive~%" @@ -1502,11 +1477,10 @@ ) (deactivate s2-0) ) - ((and - (nonzero? (-> (the-as process-drawable v1-34) draw)) - (>= (the-as int (-> (the-as process-drawable v1-34) draw art-group)) (the-as int s4-2)) - (< (the-as int (-> (the-as process-drawable v1-34) draw art-group)) (the-as int s3-1)) - ) + ((and (nonzero? (-> (the-as process-drawable v1-34) draw)) + (>= (the-as int (-> (the-as process-drawable v1-34) draw art-group)) (the-as int s4-2)) + (< (the-as int (-> (the-as process-drawable v1-34) draw art-group)) (the-as int s3-1)) + ) (format #t "NOTICE: rogue null level entity (using art ~A) ~A~% still alive~%" @@ -1540,13 +1514,12 @@ (logclear! (-> obj status) arg1) ) ((nonzero? (-> obj task)) - (logclear! (-> obj status) (logior - (if (logtest? (-> obj status) (entity-perm-status bit-4)) - 524 - 0 - ) - 515 - ) + (logclear! (-> obj status) (logior (if (logtest? (-> obj status) (entity-perm-status bit-4)) + 524 + 0 + ) + 515 + ) ) ) (else @@ -1644,23 +1617,20 @@ ) (defmethod run-logic? process-drawable ((obj process-drawable)) - (or - (zero? (logand (-> obj mask) (process-mask actor-pause))) - (or - (>= (+ (-> *ACTOR-bank* pause-dist) (-> obj root pause-adjust-distance)) - (vector-vector-distance (-> obj root trans) (math-camera-pos)) + (or (zero? (logand (-> obj mask) (process-mask actor-pause))) + (or (>= (+ (-> *ACTOR-bank* pause-dist) (-> obj root pause-adjust-distance)) + (vector-vector-distance (-> obj root trans) (math-camera-pos)) + ) + (and (nonzero? (-> obj skel)) (!= (-> obj skel root-channel 0) (-> obj skel channel))) + (and (nonzero? (-> obj draw)) (logtest? (-> obj draw status) (draw-status no-skeleton-update))) ) - (and (nonzero? (-> obj skel)) (!= (-> obj skel root-channel 0) (-> obj skel channel))) - (and (nonzero? (-> obj draw)) (logtest? (-> obj draw status) (draw-status no-skeleton-update))) ) - ) ) (defmethod birth? entity-links ((obj entity-links) (arg0 vector)) - (and - (zero? (logand (-> obj perm status) (entity-perm-status bit-0 dead))) - (< (vector-vector-distance (-> obj trans) arg0) (-> *ACTOR-bank* birth-dist)) - ) + (and (zero? (logand (-> obj perm status) (entity-perm-status bit-0 dead))) + (< (vector-vector-distance (-> obj trans) arg0) (-> *ACTOR-bank* birth-dist)) + ) ) (defmethod actors-update level-group ((obj level-group)) @@ -1681,13 +1651,7 @@ ) (when (not (paused?)) (let ((s5-1 (-> *display* frames (-> *display* last-screen) frame run-time))) - (let ((f0-5 - (fmax - 327680.0 - (fmin (+ 327680.0 (* 204.8 (the float (- 7000 (the-as int s5-1))))) (-> *ACTOR-bank* birth-dist)) - ) - ) - ) + (let ((f0-5 (fmax 327680.0 (fmin (+ 327680.0 (* 204.8 (the float (- 7000 s5-1)))) (-> *ACTOR-bank* birth-dist))))) (seek! (-> *ACTOR-bank* pause-dist) f0-5 (* 81920.0 (-> *display* seconds-per-frame))) ) (seekl! (-> *ACTOR-bank* birth-max) (the int (lerp-scale 25.0 1.0 (the float s5-1) 2000.0 7000.0)) 10) @@ -1756,7 +1720,9 @@ ) ) ) - ((= (-> s4-2 display?) 'actor) + ((#if PC_PORT + (or (= (-> s4-2 display?) 'actor) (with-pc (-> *pc-settings* force-actors?))) + (= (-> s4-2 display?) 'actor)) (let* ((s4-4 (-> s4-2 entity)) (s3-3 (-> s4-4 length)) ) @@ -1789,10 +1755,9 @@ (dotimes (s2-3 s3-4) (let ((s1-1 (-> s4-5 data s2-3))) (cond - ((and - (< (vector-vector-distance (-> s1-1 trans) sv-16) (-> *ACTOR-bank* birth-dist)) - (zero? (logand (-> s1-1 perm status) (entity-perm-status bit-9 bit-10))) - ) + ((and (< (vector-vector-distance (-> s1-1 trans) sv-16) (-> *ACTOR-bank* birth-dist)) + (zero? (logand (-> s1-1 perm status) (entity-perm-status bit-9 bit-10))) + ) (when (not (or (-> s1-1 process) (logtest? (-> s1-1 perm status) (entity-perm-status bit-0 dead)))) (birth! (-> s1-1 entity)) (set! sv-24 (+ sv-24 1)) @@ -1820,10 +1785,9 @@ (dotimes (s1-2 s2-4) (set! sv-32 (-> s3-5 data s1-2)) (cond - ((and - (is-object-visible? s4-2 (-> sv-32 vis-id)) - (zero? (logand (-> sv-32 perm status) (entity-perm-status bit-9 bit-10))) - ) + ((and (is-object-visible? s4-2 (-> sv-32 vis-id)) + (zero? (logand (-> sv-32 perm status) (entity-perm-status bit-9 bit-10))) + ) (when (not (or (-> sv-32 process) (logtest? (-> sv-32 perm status) (entity-perm-status bit-0 dead)) s0-1)) (birth! (-> sv-32 entity)) (set! sv-24 (+ sv-24 1)) diff --git a/goal_src/engine/level/level.gc b/goal_src/engine/level/level.gc index 3f23b434ff..95757856b8 100644 --- a/goal_src/engine/level/level.gc +++ b/goal_src/engine/level/level.gc @@ -1047,10 +1047,7 @@ "Is arg0 visible? Note that this will return #f if the visibility data is not loaded." ;; note : pc port added option to show every actor regardless - (#when PC_PORT - (cond - ((actor-force-visible? *pc-settings*) #t) - (else + (with-pc (if (-> *pc-settings* force-actors?) (return #t))) ;; check the vis bits! (let* (;; lwu v1, 388(a0) @@ -1072,10 +1069,6 @@ ;; movz v0, s7, v1 if (csw >= 0) result = false ;;(format 0 "vis check ~D ~X ~X ~A~%" arg0 vis-byte check-sign-word (>= check-sign-word 0)) (< check-sign-word 0) - ) - - ) - ) ) ) diff --git a/goal_src/engine/ui/progress/progress-static.gc b/goal_src/engine/ui/progress/progress-static.gc index 045963a549..7cb59f65bc 100644 --- a/goal_src/engine/ui/progress/progress-static.gc +++ b/goal_src/engine/ui/progress/progress-static.gc @@ -154,7 +154,7 @@ (define *options-remap* (new 'static 'boxed-array :type (array game-option) :length 0 :allocated-length (#if (not PC_PORT) 35 50))) ;; TODO probably an enum. -;; maps "levels" to the appropriate offset in *level-task-data* +;; maps level-info indices to the appropriate offset in *level-task-data* (define *level-task-data-remap* (new 'static 'boxed-array :type int32 :length 23 :allocated-length 23 0 diff --git a/goal_src/levels/misty/mistycannon.gc b/goal_src/levels/misty/mistycannon.gc index a3c9a7e2f5..0d919ac776 100644 --- a/goal_src/levels/misty/mistycannon.gc +++ b/goal_src/levels/misty/mistycannon.gc @@ -1190,10 +1190,8 @@ (set! (-> self at-point z) (+ (-> self center-point z) (* f30-0 (sin f28-1)))) ) (set! (-> self at-point w) 1.0) - (let ((f0-11 (rand-vu-float-range 2730.6667 12743.111))) - (set! (-> self target-theta) f0-11) - f0-11 - ) + (set! (-> self target-theta) (rand-vu-float-range 2730.6667 12743.111)) + (none) ) (defmethod rotate! mistycannon ((obj mistycannon) (arg0 float)) @@ -1290,9 +1288,9 @@ :longest-edge (meters 4) ) -(defun mistycannon-prebind-function ((arg0 mistycannon) (arg1 int) (arg2 mistycannon)) +(defun mistycannon-prebind-function ((arg0 pointer) (arg1 int) (arg2 mistycannon)) (let ((t9-0 quaternion-axis-angle!) - (a0-1 (&-> arg0 link)) + (a0-1 (&+ arg0 144)) (a1-1 0.0) (a2-1 1.0) (a3-0 0.0) @@ -1307,7 +1305,7 @@ ) ) (let ((t9-1 quaternion-axis-angle!) - (a0-2 (&-> arg0 tilt min)) + (a0-2 (&+ arg0 192)) (a1-2 -1.0) (a2-2 0.0) (a3-1 0.0) @@ -1334,10 +1332,10 @@ (the float (sar (shl (the int (+ (-> v1-19 min) (-> v1-19 value))) 48) 48)) ) ) - (quaternion-axis-angle! (the-as quaternion (&-> arg0 stack 324)) -1.0 0.0 0.0 (-> arg2 front-wheel)) - (quaternion-axis-angle! (the-as quaternion (&-> arg0 stack 276)) 1.0 0.0 0.0 (-> arg2 front-wheel)) - (quaternion-axis-angle! (the-as quaternion (&-> arg0 goggles y)) -1.0 0.0 0.0 (-> arg2 rear-wheel)) - (quaternion-axis-angle! (the-as quaternion (&-> arg0 at-point y)) 1.0 0.0 0.0 (-> arg2 rear-wheel)) + (quaternion-axis-angle! (the-as quaternion (&+ arg0 432)) -1.0 0.0 0.0 (-> arg2 front-wheel)) + (quaternion-axis-angle! (the-as quaternion (&+ arg0 384)) 1.0 0.0 0.0 (-> arg2 front-wheel)) + (quaternion-axis-angle! (the-as quaternion (&+ arg0 288)) -1.0 0.0 0.0 (-> arg2 rear-wheel)) + (quaternion-axis-angle! (the-as quaternion (&+ arg0 336)) 1.0 0.0 0.0 (-> arg2 rear-wheel)) 0 (none) ) @@ -1891,9 +1889,7 @@ (initialize-skeleton obj *mistycannon-sg* '()) (logior! (-> obj skel status) (janim-status inited)) (update-transforms! (-> obj root-override)) - (set! (-> obj skel prebind-function) - (the-as (function pointer int process-drawable none) mistycannon-prebind-function) - ) + (set! (-> obj skel prebind-function) mistycannon-prebind-function) (set! (-> obj skel postbind-function) mistycannon-postbind-function) (set! (-> obj fact-info-override) (new 'process 'fact-info-enemy obj (pickup-type eco-pill-random) (-> *FACT-bank* default-pill-inc)) diff --git a/goal_src/pc/pckernel-h.gc b/goal_src/pc/pckernel-h.gc index 00e1786f35..5beba5c5eb 100644 --- a/goal_src/pc/pckernel-h.gc +++ b/goal_src/pc/pckernel-h.gc @@ -261,7 +261,7 @@ (lod-force-actor int8) ;; merc lod tier override ;; misc settings - (force-actors? symbol) ;; see actor-force-visible? + (force-actors? symbol) ;; skips vis check for actor entity (music-fade? symbol) ;; if off, music has no fade in (use-vis? symbol) ;; if off, don't use vis trees. this MUST be off for custom (non-cropping) aspect ratios. (skip-movies? symbol) ;; if on, enable cutscene skipping @@ -308,7 +308,6 @@ (set-aspect-ratio! (_type_ float) none) (read-from-file (_type_ string) symbol) (write-to-file (_type_ string) symbol) - (actor-force-visible? (_type_) symbol) (update-cheats (_type_) int) (commit-to-file (_type_) none) (load-settings (_type_) int) @@ -486,12 +485,6 @@ (set! (-> obj secrets watch-12hr?) #f) (none)) -(defmethod actor-force-visible? pc-settings ((obj pc-settings)) - "return #t if actors should be visible regardless of vis." - (declare (inline)) - (and (not (-> obj use-vis?)) (-> obj force-actors?)) - ) - (defmacro with-pc (&rest body) "encapsulates the code around PC-specific checks" `(#when PC_PORT (when (and *pc-settings*) diff --git a/goal_src/pc/pckernel.gc b/goal_src/pc/pckernel.gc index c29a78c060..78b4c9b45f 100644 --- a/goal_src/pc/pckernel.gc +++ b/goal_src/pc/pckernel.gc @@ -195,7 +195,7 @@ ) ) (cond - ((actor-force-visible? obj) + ((-> obj force-actors?) ;; kinda overkill. (set! (-> *ACTOR-bank* birth-dist) (meters 10000)) (set! (-> *ACTOR-bank* pause-dist) (meters 10000)) diff --git a/test/decompiler/reference/levels/misty/mistycannon_REF.gc b/test/decompiler/reference/levels/misty/mistycannon_REF.gc index 5cfe64f04d..9e3bfd2d7b 100644 --- a/test/decompiler/reference/levels/misty/mistycannon_REF.gc +++ b/test/decompiler/reference/levels/misty/mistycannon_REF.gc @@ -1286,6 +1286,7 @@ ) ;; definition for function mistycannon-pick-random-target-point +;; INFO: Return type mismatch float vs none. (defbehavior mistycannon-pick-random-target-point mistycannon () (let ((f30-0 (* (sqrtf (rand-vu)) (-> self center-point w))) (f28-1 (* 65536.0 (rand-vu))) @@ -1295,10 +1296,8 @@ (set! (-> self at-point z) (+ (-> self center-point z) (* f30-0 (sin f28-1)))) ) (set! (-> self at-point w) 1.0) - (let ((f0-11 (rand-vu-float-range 2730.6667 12743.111))) - (set! (-> self target-theta) f0-11) - f0-11 - ) + (set! (-> self target-theta) (rand-vu-float-range 2730.6667 12743.111)) + (none) ) ;; definition for method 20 of type mistycannon @@ -1406,9 +1405,9 @@ ;; definition for function mistycannon-prebind-function ;; INFO: Return type mismatch int vs none. -(defun mistycannon-prebind-function ((arg0 mistycannon) (arg1 int) (arg2 mistycannon)) +(defun mistycannon-prebind-function ((arg0 pointer) (arg1 int) (arg2 mistycannon)) (let ((t9-0 quaternion-axis-angle!) - (a0-1 (&-> arg0 link)) + (a0-1 (&+ arg0 144)) (a1-1 0.0) (a2-1 1.0) (a3-0 0.0) @@ -1423,7 +1422,7 @@ ) ) (let ((t9-1 quaternion-axis-angle!) - (a0-2 (&-> arg0 tilt min)) + (a0-2 (&+ arg0 192)) (a1-2 -1.0) (a2-2 0.0) (a3-1 0.0) @@ -1450,10 +1449,10 @@ (the float (sar (shl (the int (+ (-> v1-19 min) (-> v1-19 value))) 48) 48)) ) ) - (quaternion-axis-angle! (the-as quaternion (&-> arg0 stack 324)) -1.0 0.0 0.0 (-> arg2 front-wheel)) - (quaternion-axis-angle! (the-as quaternion (&-> arg0 stack 276)) 1.0 0.0 0.0 (-> arg2 front-wheel)) - (quaternion-axis-angle! (the-as quaternion (&-> arg0 goggles y)) -1.0 0.0 0.0 (-> arg2 rear-wheel)) - (quaternion-axis-angle! (the-as quaternion (&-> arg0 at-point y)) 1.0 0.0 0.0 (-> arg2 rear-wheel)) + (quaternion-axis-angle! (the-as quaternion (&+ arg0 432)) -1.0 0.0 0.0 (-> arg2 front-wheel)) + (quaternion-axis-angle! (the-as quaternion (&+ arg0 384)) 1.0 0.0 0.0 (-> arg2 front-wheel)) + (quaternion-axis-angle! (the-as quaternion (&+ arg0 288)) -1.0 0.0 0.0 (-> arg2 rear-wheel)) + (quaternion-axis-angle! (the-as quaternion (&+ arg0 336)) 1.0 0.0 0.0 (-> arg2 rear-wheel)) 0 (none) ) @@ -2046,9 +2045,7 @@ (initialize-skeleton obj *mistycannon-sg* '()) (logior! (-> obj skel status) (janim-status inited)) (update-transforms! (-> obj root-override)) - (set! (-> obj skel prebind-function) - (the-as (function pointer int process-drawable none) mistycannon-prebind-function) - ) + (set! (-> obj skel prebind-function) mistycannon-prebind-function) (set! (-> obj skel postbind-function) mistycannon-postbind-function) (set! (-> obj fact-info-override) (new 'process 'fact-info-enemy obj (pickup-type eco-pill-random) (-> *FACT-bank* default-pill-inc))