-
Notifications
You must be signed in to change notification settings - Fork 13
DX Song Search DTAFunction #40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Realized there already helpfully exists MusicLibrarySelectHeading artist_header.mp4 |
ExecuteDTA(PORT_ROCKCENTRALGATEWAY, "{{music_library get view_settings_provider} select_setting 1}"); | ||
{ | ||
char buf[64]; | ||
sprintf(buf, "{{music_library get view_settings_provider} select_setting_option %d}", matchedByTitle); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this line of code can potentially blow up the stack
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added more to buffer as per your rec
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm now
int *start; | ||
int *end; | ||
int unk1; | ||
} song_list_vector; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This struct layout might cause issues on Wii, as Backbone's modifications to STLPort define a different layout for std::vector's members.
int unk1; | ||
} song_list_vector; | ||
|
||
static song_list_vector dta_song_list = { 0 }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should probably go on the stack and be recreated every time. as of right now deleting a song will cause a use-after-free next time you search.
i'm not familiar enough with this codebase to give any specific guidance here so im deferring to @InvoxiPlayGames
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
turns out this isnt a uaf since its just a vector of song ids, but it should prob be fixed anyway as it'll have song ids that no longer exist after deleting a song
This adds a new DTAFunction for use by a new commit of rb3dx hmxmilohax/rock-band-3-deluxe#1180
This takes a string input given by the on screen virtual keyboard
String can be for song name, or artist name
The function does as the current rb3e web html song jumping function does
First, dx jumps to the top of the list and resorts to song name
Then each song in the song cache is probed for song name and artist metadata
We prioritize exact matches first, and if no exact matches are found, we search if the string is contained in the metadata
there is no "fuzzy" matching, strictly exact match, or contains.
once we find a match, we resort the song list to either be by song name, or by artist, and jump to the song that was found.
It is MUCH faster than what DX previously did. Let me know thoughts. Thanks.
Here is a preview of the function in action:
dx_song_search.mp4