Commit ccc30c7
committed
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 6b282a2 commit ccc30c7
6 files changed
Lines changed: 842 additions & 181 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 | | |
| |||
38 | 48 | | |
39 | 49 | | |
40 | 50 | | |
| 51 | + | |
| 52 | + | |
41 | 53 | | |
42 | 54 | | |
43 | 55 | | |
| |||
335 | 347 | | |
336 | 348 | | |
337 | 349 | | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
338 | 361 | | |
339 | 362 | | |
340 | 363 | | |
| |||
712 | 735 | | |
713 | 736 | | |
714 | 737 | | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
715 | 746 | | |
716 | 747 | | |
717 | 748 | | |
| |||
746 | 777 | | |
747 | 778 | | |
748 | 779 | | |
749 | | - | |
750 | | - | |
| 780 | + | |
| 781 | + | |
751 | 782 | | |
752 | 783 | | |
753 | 784 | | |
| |||
852 | 883 | | |
853 | 884 | | |
854 | 885 | | |
855 | | - | |
856 | | - | |
857 | 886 | | |
858 | | - | |
859 | 887 | | |
860 | 888 | | |
861 | 889 | | |
| |||
869 | 897 | | |
870 | 898 | | |
871 | 899 | | |
| 900 | + | |
| 901 | + | |
872 | 902 | | |
873 | 903 | | |
874 | 904 | | |
| 905 | + | |
| 906 | + | |
| 907 | + | |
| 908 | + | |
| 909 | + | |
| 910 | + | |
| 911 | + | |
| 912 | + | |
| 913 | + | |
| 914 | + | |
| 915 | + | |
| 916 | + | |
| 917 | + | |
| 918 | + | |
| 919 | + | |
875 | 920 | | |
876 | 921 | | |
877 | 922 | | |
| |||
899 | 944 | | |
900 | 945 | | |
901 | 946 | | |
902 | | - | |
903 | | - | |
904 | | - | |
| 947 | + | |
| 948 | + | |
| 949 | + | |
| 950 | + | |
| 951 | + | |
| 952 | + | |
| 953 | + | |
| 954 | + | |
| 955 | + | |
| 956 | + | |
| 957 | + | |
| 958 | + | |
| 959 | + | |
| 960 | + | |
| 961 | + | |
| 962 | + | |
| 963 | + | |
| 964 | + | |
| 965 | + | |
| 966 | + | |
| 967 | + | |
| 968 | + | |
| 969 | + | |
| 970 | + | |
| 971 | + | |
| 972 | + | |
| 973 | + | |
| 974 | + | |
| 975 | + | |
| 976 | + | |
| 977 | + | |
| 978 | + | |
| 979 | + | |
| 980 | + | |
905 | 981 | | |
906 | 982 | | |
907 | 983 | | |
| |||
910 | 986 | | |
911 | 987 | | |
912 | 988 | | |
913 | | - | |
914 | | - | |
| 989 | + | |
| 990 | + | |
| 991 | + | |
| 992 | + | |
| 993 | + | |
| 994 | + | |
| 995 | + | |
| 996 | + | |
| 997 | + | |
| 998 | + | |
| 999 | + | |
| 1000 | + | |
| 1001 | + | |
| 1002 | + | |
| 1003 | + | |
| 1004 | + | |
| 1005 | + | |
| 1006 | + | |
| 1007 | + | |
| 1008 | + | |
| 1009 | + | |
| 1010 | + | |
| 1011 | + | |
| 1012 | + | |
| 1013 | + | |
| 1014 | + | |
| 1015 | + | |
| 1016 | + | |
| 1017 | + | |
| 1018 | + | |
| 1019 | + | |
| 1020 | + | |
| 1021 | + | |
| 1022 | + | |
| 1023 | + | |
| 1024 | + | |
| 1025 | + | |
| 1026 | + | |
| 1027 | + | |
| 1028 | + | |
| 1029 | + | |
| 1030 | + | |
| 1031 | + | |
| 1032 | + | |
| 1033 | + | |
| 1034 | + | |
| 1035 | + | |
| 1036 | + | |
| 1037 | + | |
| 1038 | + | |
| 1039 | + | |
| 1040 | + | |
| 1041 | + | |
| 1042 | + | |
| 1043 | + | |
915 | 1044 | | |
916 | 1045 | | |
917 | 1046 | | |
| |||
927 | 1056 | | |
928 | 1057 | | |
929 | 1058 | | |
| 1059 | + | |
| 1060 | + | |
| 1061 | + | |
| 1062 | + | |
930 | 1063 | | |
931 | 1064 | | |
932 | 1065 | | |
| |||
| 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