-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.gd
More file actions
34 lines (28 loc) · 882 Bytes
/
main.gd
File metadata and controls
34 lines (28 loc) · 882 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
extends Node3D
func _ready():
"""
Main entry point for the application.
"""
print("[main] Entering _ready function")
if not RetroHost:
push_error("[main] RetroHost singleton not found!")
return
var rom_path = "res://roms/megadrive/Sonic the Hedgehog.bin"
var core_path = "genesis_plus_gx_libretro"
print("[main] Starting emulation with core: ", core_path, ", ROM: ", rom_path)
var success = RetroHost.load_core(core_path)
if success:
print("[main] Core loaded successfully.")
else:
print("[main] Failed to load core.")
return
var rom_file = FileAccess.open(rom_path, FileAccess.READ)
if not rom_file:
print("[main] Failed to open ROM file.")
return
var rom_data = rom_file.get_buffer(rom_file.get_length())
rom_file.close()
if RetroHost.load_game(rom_data):
print("[main] ROM loaded successfully.")
else:
print("[main] Failed to load ROM.")