Skip to content

Commit

Permalink
jak1: put the auto-splitting marker in C++ so it can be quickly found (
Browse files Browse the repository at this point in the history
  • Loading branch information
xTVaser authored Aug 23, 2022
1 parent a1b5935 commit 3dd10d0
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 3 deletions.
6 changes: 6 additions & 0 deletions game/kernel/jak1/kmachine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,8 @@ void InitIOP() {
}
}

AutoSplitterBlock gAutoSplitterBlock;

/*!
* Initialize GOAL Runtime. This is the main initialization which is called before entering
* the GOAL kernel dispatch loop (KernelCheckAndDispatch).
Expand Down Expand Up @@ -354,6 +356,10 @@ int InitMachine() {
return goal_status;
}

// TODO - better place to put this?
gAutoSplitterBlock.pointer_to_symbol =
(u64)g_ee_main_mem + intern_from_c("*autosplit-info-jak1*")->value;

lg::info("InitListenerConnect");
InitListenerConnect();
lg::info("InitCheckListener");
Expand Down
9 changes: 9 additions & 0 deletions game/kernel/jak1/kmachine.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,13 @@ struct DiscordInfo {
u32 flutflut; // are we riding on flut flut?
u32 time_of_day;
};

// To speedup finding the auto-splitter block in GOAL memory
// all this has is a marker for LiveSplit to find, and then the pointer
// to the symbol
struct AutoSplitterBlock {
const char marker[20] = "UnLiStEdStRaTs_JaK1";
u64 pointer_to_symbol = 0;
};
extern AutoSplitterBlock gAutoSplitterBlock;
} // namespace jak1
3 changes: 1 addition & 2 deletions goal_src/jak1/pc/features/autosplit-h.gc
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
;;
;; DO NOT change the order, appending to the end is safe!
(deftype autosplit-info-jak1 (structure)
((marker uint8 20) ;; UnLiStEdStRaTs_JaK1 - DONT EVER CHANGE THIS
;; General stats
(;; General stats
(num-power-cells uint32)
(num-orbs uint32)
(num-scout-flies uint32)
Expand Down
1 change: 0 additions & 1 deletion goal_src/jak1/pc/features/autosplit.gc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

(define *autosplit-info-jak1* (new 'static 'autosplit-info-jak1))
;; Setup markers
(charp<-string (-> *autosplit-info-jak1* marker) "UnLiStEdStRaTs_JaK1")
(charp<-string (-> *autosplit-info-jak1* end-marker) "end")
;; Setup Padding
(charp<-string (-> *autosplit-info-jak1* padding-stats) "padding-stats!")
Expand Down

0 comments on commit 3dd10d0

Please sign in to comment.