G2 support

This commit is contained in:
bryanthaboi
2026-08-11 11:52:56 -04:00
parent 79ed37699e
commit ae6cac89e1
489 changed files with 226677 additions and 1798 deletions
+20
View File
@@ -413,6 +413,18 @@ function Music.oneShotPlaying()
return state.pendingRestore == true
end
-- The label of the song that is current, or nil. A read-only window on the
-- state, for drivers and tests that need to assert what is playing.
function Music.current()
return state.current
end
-- The remembered map song (wMapMusic), the same read-only window: what a
-- battle's restore will replay. setMapSong below is the write half.
function Music.mapSong()
return state.mapSong
end
function Music.restoreMap(data)
state.current = nil
state.pendingRestore = nil
@@ -420,6 +432,14 @@ function Music.restoreMap(data)
if play then Music.play(data, play, nil, { reason = "map" }) end
end
-- Overwrite the remembered map song without playing anything: the wMapMusic
-- write in pokegold engine/pokegear/pokegear.asm RadioMusicRestartDE. A radio
-- station's song becomes the map music itself, so a battle's restoreMap brings
-- the STATION back and only the next playMap (a map change) replaces it.
function Music.setMapSong(song)
state.mapSong = song
end
-- 0-7 music volume (0 mutes), applied to the playing song and the
-- queued loop body as well as everything played later
function Music.setVolumeLevel(level)