Commit dfaf29a
Add Jaguar CD support: CUE/BIN disc image loading, BIOS boot, and Butch emulation
Implements the foundation for Jaguar CD game support based on the spike
research in docs/spike-jaguar-cd-support.md. This covers Phases 1-4 of
the implementation plan.
Phase 1 - Disc Image Loading:
- Complete CUE/BIN parser in cdintf.c with session/track/MSF parsing
- CDIntfReadBlock reads raw 2352-byte sectors from BIN files
- CDIntfGetSessionInfo/GetTrackInfo return proper TOC data
- CDIntfOpenImage/CloseImage manage disc image lifecycle
Phase 2 - CD BIOS Boot:
- retro_load_game detects .cue files and enters CD mode
- Loads 256KB CD BIOS (retail or developer) at $E00000
- Reads boot vectors from BIOS for proper 68K initialization
- Forces BIOS-on mode for CD games (required by hardware)
- ROM loading via file path (need_fullpath=true for CD support)
Phase 3 - Butch Emulation:
- Enables BUTCHExec with FIFO half-full and DSARX interrupt generation
- Routes Butch interrupts through JERRY/DSP EXT1 to GPU
- FIFO_DATA and I2SDAT2 reads deliver sector data from disc image
- Proper BUTCH status register read with interrupt pending flags
- $5400 command returns actual session count from disc
Phase 4 - CD Audio:
- Simplified GetWordFromButchSSI reads audio sectors directly
- SetSSIWordsXmittedFromButch delivers L/R samples to DAC
- Removed legacy two-sector kludge workaround
Also adds:
- CD BIOS Type core option (retail vs developer)
- Valid extensions updated to include .cue
- Proper cleanup of CD resources on unload
- All existing cartridge regression tests pass
https://claude.ai/code/session_017594R2HVUZmGUxyQp9328w1 parent dd44259 commit dfaf29a
6 files changed
Lines changed: 861 additions & 180 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
11 | 18 | | |
12 | 19 | | |
13 | 20 | | |
| 21 | + | |
| 22 | + | |
14 | 23 | | |
| 24 | + | |
15 | 25 | | |
16 | 26 | | |
17 | 27 | | |
| |||
55 | 65 | | |
56 | 66 | | |
57 | 67 | | |
| 68 | + | |
| 69 | + | |
58 | 70 | | |
59 | 71 | | |
60 | 72 | | |
| |||
352 | 364 | | |
353 | 365 | | |
354 | 366 | | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
355 | 378 | | |
356 | 379 | | |
357 | 380 | | |
| |||
735 | 758 | | |
736 | 759 | | |
737 | 760 | | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
| 773 | + | |
| 774 | + | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
| 780 | + | |
| 781 | + | |
| 782 | + | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
| 786 | + | |
| 787 | + | |
| 788 | + | |
738 | 789 | | |
739 | 790 | | |
740 | 791 | | |
| |||
749 | 800 | | |
750 | 801 | | |
751 | 802 | | |
752 | | - | |
753 | | - | |
| 803 | + | |
| 804 | + | |
754 | 805 | | |
755 | 806 | | |
756 | 807 | | |
| |||
955 | 1006 | | |
956 | 1007 | | |
957 | 1008 | | |
958 | | - | |
959 | | - | |
960 | 1009 | | |
961 | | - | |
962 | 1010 | | |
963 | 1011 | | |
964 | 1012 | | |
| |||
972 | 1020 | | |
973 | 1021 | | |
974 | 1022 | | |
| 1023 | + | |
| 1024 | + | |
975 | 1025 | | |
976 | 1026 | | |
977 | 1027 | | |
978 | 1028 | | |
979 | 1029 | | |
980 | 1030 | | |
| 1031 | + | |
| 1032 | + | |
| 1033 | + | |
| 1034 | + | |
| 1035 | + | |
| 1036 | + | |
| 1037 | + | |
| 1038 | + | |
| 1039 | + | |
| 1040 | + | |
| 1041 | + | |
| 1042 | + | |
| 1043 | + | |
| 1044 | + | |
| 1045 | + | |
981 | 1046 | | |
982 | | - | |
983 | | - | |
984 | | - | |
| 1047 | + | |
| 1048 | + | |
| 1049 | + | |
| 1050 | + | |
| 1051 | + | |
| 1052 | + | |
| 1053 | + | |
| 1054 | + | |
| 1055 | + | |
| 1056 | + | |
| 1057 | + | |
| 1058 | + | |
| 1059 | + | |
| 1060 | + | |
| 1061 | + | |
| 1062 | + | |
| 1063 | + | |
| 1064 | + | |
| 1065 | + | |
| 1066 | + | |
| 1067 | + | |
| 1068 | + | |
| 1069 | + | |
| 1070 | + | |
| 1071 | + | |
| 1072 | + | |
| 1073 | + | |
| 1074 | + | |
| 1075 | + | |
| 1076 | + | |
| 1077 | + | |
| 1078 | + | |
| 1079 | + | |
| 1080 | + | |
985 | 1081 | | |
986 | 1082 | | |
987 | 1083 | | |
| |||
990 | 1086 | | |
991 | 1087 | | |
992 | 1088 | | |
993 | | - | |
994 | | - | |
| 1089 | + | |
| 1090 | + | |
| 1091 | + | |
| 1092 | + | |
| 1093 | + | |
| 1094 | + | |
| 1095 | + | |
| 1096 | + | |
| 1097 | + | |
| 1098 | + | |
| 1099 | + | |
| 1100 | + | |
| 1101 | + | |
| 1102 | + | |
| 1103 | + | |
| 1104 | + | |
| 1105 | + | |
| 1106 | + | |
| 1107 | + | |
| 1108 | + | |
| 1109 | + | |
| 1110 | + | |
| 1111 | + | |
| 1112 | + | |
| 1113 | + | |
| 1114 | + | |
| 1115 | + | |
| 1116 | + | |
| 1117 | + | |
| 1118 | + | |
| 1119 | + | |
| 1120 | + | |
| 1121 | + | |
| 1122 | + | |
| 1123 | + | |
| 1124 | + | |
| 1125 | + | |
| 1126 | + | |
| 1127 | + | |
| 1128 | + | |
| 1129 | + | |
| 1130 | + | |
| 1131 | + | |
| 1132 | + | |
| 1133 | + | |
| 1134 | + | |
| 1135 | + | |
| 1136 | + | |
| 1137 | + | |
| 1138 | + | |
| 1139 | + | |
| 1140 | + | |
| 1141 | + | |
| 1142 | + | |
| 1143 | + | |
995 | 1144 | | |
996 | 1145 | | |
997 | 1146 | | |
| |||
1012 | 1161 | | |
1013 | 1162 | | |
1014 | 1163 | | |
| 1164 | + | |
| 1165 | + | |
| 1166 | + | |
| 1167 | + | |
1015 | 1168 | | |
1016 | 1169 | | |
1017 | 1170 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
147 | 147 | | |
148 | 148 | | |
149 | 149 | | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
150 | 164 | | |
151 | 165 | | |
152 | 166 | | |
| |||
0 commit comments