1
Scripting / Re: Signal handling removing key repeat
« on: March 29, 2020, 12:00:37 PM »
Perfect, thank you!
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
fe.add_signal_handler( this, "on_signal" );
function on_signal( sig ) {
if(sig == "left"){
fe.list.index--;
return true;
}
else if(sig == "right"){
fe.list.index++;
return true;
}
else return false;
}
1 3 5 7
2 4 6 8
<-- (scrolling horizontally) -->
1 2 3 4 ^
5 6 7 8 v
(scrolling vertically)
I want to be perfectly honest with you. I started rewritting the theme, but in the meantime I got distracted and started experimenting with asynchronous loading of images for AttractMode. I’ve underestimated the complexity of the task and it’s taking longer as I thought it would.
Here’s a little demo and as you can see I load almost 300 snaps in 100ms while preserving smooth 60fps.
https://youtu.be/xYKcS_rrjpM
I can drop it and finish Ambience, but you have to answer it for yourself, what is more important, finishing my theme, or async image loading for AM
[INFO] Loading dynamic libretro core from: "D:\Arcade\RetroArch\cores\fbneo_libretro.dll"
[INFO] [Overrides] no core-specific overrides found at D:\Arcade\RetroArch\config\FinalBurn Neo\FinalBurn Neo.cfg.
[INFO] [Overrides] no content-dir-specific overrides found at D:\Arcade\RetroArch\config\FinalBurn Neo\Arcade.cfg.
[INFO] [Overrides] no game-specific overrides found at D:\Arcade\RetroArch\config\FinalBurn Neo\galaga.cfg.
[INFO] [Shaders]: preset directory: D:\Arcade\RetroArch\shaders\presets
[INFO] [Remaps]: remap directory: D:\Arcade\RetroArch\config\remaps
[INFO] [Remaps]: no game-specific remap found at D:\Arcade\RetroArch\config\remaps\FinalBurn Neo\galaga.rmp.
[INFO] [Remaps]: no content-dir-specific remap found at D:\Arcade\RetroArch\config\remaps\FinalBurn Neo\Arcade.rmp.
[INFO] [Remaps]: no core-specific remap found at D:\Arcade\RetroArch\config\remaps\FinalBurn Neo\FinalBurn Neo.rmp.
[INFO] Redirecting save file to "D:\Arcade\RetroArch\saves\galaga.srm".
[INFO] Redirecting savestate to "D:\Arcade\RetroArch\states\galaga.state".
[INFO] Environ GET_LOG_INTERFACE.
[INFO] Content loading skipped. Implementation will load it on its own.
[INFO] CRC32: 0x25a4b18e .
[INFO] Environ SYSTEM_DIRECTORY: "D:\Arcade\RetroArch\system".
[INFO] Environ SET_CONTROLLER_INFO.
[libretro ERROR] [FBNEO] Couldn't locate the galaga archive anywhere, this game probably won't boot.
[libretro ERROR] [FBNEO] ROM at index 0 with CRC 0xab036c9f is required ...
[libretro ERROR] [FBNEO] Can't launch this game, some files are missing.
[ERROR] Failed to load content.
[INFO] Content ran for a total of: 00 hours, 00 minutes, 00 seconds.
[INFO] Unloading game..
[INFO] Unloading core..
[INFO] Unloading core symbols..this.
# Generated by Attract-Mode v2.5.1
#
executable "D:\Arcade\RetroArch\retroarch.exe"
args -L "D:\Arcade\RetroArch\cores\fbneo_libretro.dll" "[romfilename]"
rompath "D:\Arcade\games\Arcade"
romext .zip
system Arcade
artwork flyer ..\media\boxart\arcade
artwork marquee
artwork snap ..\media\video\arcade
artwork wheel ..\media\logos\arcade
local has_moved = false;
local load_timer_max = 50;
local load_timer = load_timer_max;
////////
// Video
////////
local video = fe.add_image("snap.mp4", 0, 800, 600);
video.preserve_aspect_ratio = true;
////////
// Transitions
///////
fe.add_transition_callback( "my_transition" );
function my_transition( ttype, var, ttime )
{
switch ( ttype )
{
case Transition.ToNewSelection:
has_moved = true;
load_timer = load_timer_max;
break;
case Transition.ToNewList:
case Transition.FromGame:
updateMedia();
break;
}
return false;
}
///////////
//Custom Load Timer
///////////
fe.add_ticks_callback( "updateTick" );
function updateTick( ttime )
{
load_timer = max(0, load_timer-1);
//Update game media after delay
if( has_moved && load_timer == 0)
{
updateMedia();
has_moved = false;
}
}
////////
// Functions
////////
function max(a,b){
if(a > b) return a;
else return b;
}
function updateMedia(){
video.file_name = fe.get_art("snap");
}
executable ..\RetroArch\retroarch.exe
args -L ..\RetroArch\cores\fbneo_libretro.dll "[romfilename]"
rompath ..\games\Arcade
romext .zip
system Arcade
artwork flyer ..\media\boxart\arcade
artwork marquee
artwork snap ..\media\video\arcade
artwork wheel ..\media\logos\arcade