| 1 |
// |
| 2 |
// Simple program that touches all the existing cores to help ensure |
| 3 |
// that everything builds cleanly. |
| 4 |
// |
| 5 |
// Compile with: |
| 6 |
// |
| 7 |
// g++ --std=c++14 -I../../src buildall.cpp ../../src/ymfm_misc.cpp ../../src/ymfm_opl.cpp ../../src/ymfm_opm.cpp ../../src/ymfm_opn.cpp ../../src/ymfm_opq.cpp ../../src/ymfm_opz.cpp ../../src/ymfm_adpcm.cpp ../../src/ymfm_pcm.cpp ../../src/ymfm_ssg.cpp -o buildall.exe |
| 8 |
// |
| 9 |
// or: |
| 10 |
// |
| 11 |
// clang --std=c++14 -I../../src buildall.cpp ../../src/ymfm_misc.cpp ../../src/ymfm_opl.cpp ../../src/ymfm_opm.cpp ../../src/ymfm_opn.cpp ../../src/ymfm_opq.cpp ../../src/ymfm_opz.cpp ../../src/ymfm_adpcm.cpp ../../src/ymfm_pcm.cpp ../../src/ymfm_ssg.cpp -o buildall.exe |
| 12 |
// |
| 13 |
// or: |
| 14 |
// |
| 15 |
// cl -I..\..\src buildall.cpp ..\..\src\ymfm_misc.cpp ..\..\src\ymfm_opl.cpp ..\..\src\ymfm_opm.cpp ..\..\src\ymfm_opn.cpp ..\..\src\ymfm_opq.cpp ..\..\src\ymfm_opz.cpp ..\..\src\ymfm_adpcm.cpp ..\..\src\ymfm_pcm.cpp ..\..\src\ymfm_ssg.cpp /Od /Zi /std:c++14 /EHsc |
| 16 |
// |
| 17 |
|
| 18 |
#include <vector> |
| 19 |
|
| 20 |
#include "ymfm_misc.h" |
| 21 |
#include "ymfm_opl.h" |
| 22 |
#include "ymfm_opm.h" |
| 23 |
#include "ymfm_opn.h" |
| 24 |
#include "ymfm_opq.h" |
| 25 |
#include "ymfm_opz.h" |
| 26 |
|
| 27 |
|
| 28 |
//------------------------------------------------- |
| 29 |
// main - program entry point |
| 30 |
//------------------------------------------------- |
| 31 |
|
| 32 |
template<typename ChipType> |
| 33 |
class chip_wrapper : public ymfm::ymfm_interface |
| 34 |
{ |
| 35 |
public: |
| 36 |
chip_wrapper() : |
| 37 |
m_chip(*this) |
| 38 |
{ |
| 39 |
// reset |
| 40 |
m_chip.reset(); |
| 41 |
|
| 42 |
// save/restore |
| 43 |
std::vector<uint8_t> buffer; |
| 44 |
{ |
| 45 |
ymfm::ymfm_saved_state saver(buffer, true); |
| 46 |
m_chip.save_restore(saver); |
| 47 |
} |
| 48 |
{ |
| 49 |
ymfm::ymfm_saved_state restorer(buffer, false); |
| 50 |
m_chip.save_restore(restorer); |
| 51 |
} |
| 52 |
|
| 53 |
// dummy read/write |
| 54 |
m_chip.read(0); |
| 55 |
m_chip.write(0, 0); |
| 56 |
|
| 57 |
// generate |
| 58 |
typename ChipType::output_data output[20]; |
| 59 |
m_chip.generate(&output[0], ymfm::array_size(output)); |
| 60 |
} |
| 61 |
|
| 62 |
private: |
| 63 |
ChipType m_chip; |
| 64 |
}; |
| 65 |
|
| 66 |
|
| 67 |
//------------------------------------------------- |
| 68 |
// main - program entry point |
| 69 |
//------------------------------------------------- |
| 70 |
|
| 71 |
int main(int argc, char *argv[]) |
| 72 |
{ |
| 73 |
// just keep adding chip variants here as they are implemented |
| 74 |
|
| 75 |
// ymfm_misc.h: |
| 76 |
chip_wrapper<ymfm::ym2149> test2149; |
| 77 |
|
| 78 |
// ymfm_opl.h: |
| 79 |
chip_wrapper<ymfm::ym3526> test3526; |
| 80 |
chip_wrapper<ymfm::y8950> test8950; |
| 81 |
chip_wrapper<ymfm::ym3812> test3812; |
| 82 |
chip_wrapper<ymfm::ymf262> test262; |
| 83 |
chip_wrapper<ymfm::ymf289b> test289b; |
| 84 |
chip_wrapper<ymfm::ymf278b> test278b; |
| 85 |
chip_wrapper<ymfm::ym2413> test2413; |
| 86 |
chip_wrapper<ymfm::ym2423> test2423; |
| 87 |
chip_wrapper<ymfm::ymf281> test281; |
| 88 |
chip_wrapper<ymfm::ds1001> test1001; |
| 89 |
|
| 90 |
// ymfm_opm.h: |
| 91 |
chip_wrapper<ymfm::ym2151> test2151; |
| 92 |
chip_wrapper<ymfm::ym2164> test2164; |
| 93 |
|
| 94 |
// ymfm_opn.h: |
| 95 |
chip_wrapper<ymfm::ym2203> test2203; |
| 96 |
chip_wrapper<ymfm::ym2608> test2608; |
| 97 |
chip_wrapper<ymfm::ymf288> test288; |
| 98 |
chip_wrapper<ymfm::ym2610> test2610; |
| 99 |
chip_wrapper<ymfm::ym2610b> test2610b; |
| 100 |
chip_wrapper<ymfm::ym2612> test2612; |
| 101 |
chip_wrapper<ymfm::ym3438> test3438; |
| 102 |
chip_wrapper<ymfm::ymf276> test276; |
| 103 |
|
| 104 |
// ymfm_opq.h: |
| 105 |
chip_wrapper<ymfm::ym3806> test3806; |
| 106 |
chip_wrapper<ymfm::ym3533> test3533; |
| 107 |
|
| 108 |
// ymfm_opz.h: |
| 109 |
chip_wrapper<ymfm::ym2414> test2414; |
| 110 |
|
| 111 |
printf("Done\n"); |
| 112 |
|
| 113 |
return 0; |
| 114 |
} |