2 // modelsBIOS.cpp - Models and BIOS handler
6 // JPM = Jean-Paul Mari <djipi.mari@gmail.com>
9 // --- ---------- -----------------------------------------------------------
10 // JPM 09/04/2018 Created this file
18 #include "jagcdbios.h"
19 #include "jagstub1bios.h"
20 #include "jagstub2bios.h"
24 typedef struct InfosBIOS
33 S_InfosBIOS TabInfosBIOS
[] =
36 { jaguarBootROM
, 0x20000, BT_K_SERIES
},
37 { jaguarBootROM2
, 0x20000, BT_M_SERIES
},
38 { jaguarDevBootROM1
, 0x20000, BT_STUBULATOR_1
},
39 { jaguarDevBootROM2
, 0x20000, BT_STUBULATOR_2
}
44 // A valid default BIOS will be selected in case of no valid BIOS has been requested
45 bool SelectBIOS(int indexbios
)
50 // Get the BIOS selected in the configuration tab
53 indexbios
= vjs
.biosType
;
59 // Check if a default BIOS is required
62 // Get default BIOS based on the Jaguar model
63 switch (vjs
.jaguarModel
)
66 indexbios
= BT_K_SERIES
;
70 indexbios
= BT_M_SERIES
;
78 // look for the requested BIOS
79 IndexBIOS
= (sizeof(TabInfosBIOS
) / sizeof(S_InfosBIOS
));
80 while (TabInfosBIOS
[--IndexBIOS
].intBIOS
&& (TabInfosBIOS
[IndexBIOS
].intBIOS
!= indexbios
));
82 // Put BIOS in memory or return if no BIOS exist (but it should never happen)
85 memcpy(jagMemSpace
+ 0xE00000, TabInfosBIOS
[IndexBIOS
].ptrBIOS
, TabInfosBIOS
[IndexBIOS
].sizeBIOS
);
98 memcpy(jaguarMainRAM
, jagMemSpace
+ 0xE00000, 8);