00001
00019
00020
00021
00022 #define PAL_TARGET_CLOCK_RATE 25175000
00023
00024
00025 #include "pal_master.hch"
00026
00027
00028 #include "configuration.hch"
00029 #include "audio.hch"
00030 #include "mouse_shared.hch"
00031 #include "mouse.hch"
00032 #include "eventhandler_shared.hch"
00033 #include "eventhandler.hch"
00034 #include "display_shared.hch"
00035 #include "display.hch"
00036 #include "smartmedia.hch"
00037
00038 #include "fft.hch"
00039 #include "runfft.hch"
00040
00041 #if HAVE_DEBUG
00042 #include "debug.hch"
00043 #endif
00044
00051 void main(void) {
00052
00053
00054
00055 macro expr ClockRate = PAL_ACTUAL_CLOCK_RATE;
00056 macro expr VideoOut = PalVideoOutOptimalCT(ClockRate);
00057 macro expr AudioIn = PalAudioInCT(0);
00058 macro expr AudioOut = PalAudioOutCT(0);
00059 macro expr RAM_BANK0 = PalPL2RAMCT(0);
00060
00061 mousedata_t mousedata;
00062 events_t events;
00063 audiodata_t audiodata;
00064 skindata_t skindata;
00065 unsigned 1 result;
00066
00067
00068
00069
00070
00071
00072 PalVersionRequire(1, 2);
00073 PalVideoOutRequire(1);
00074 PalAudioInRequire(1);
00075 PalAudioOutRequire(1);
00076
00077
00078
00079
00080
00081 assert (PalVideoOutGetColorWidthCT(VideoOut) == 24, 0,
00082 "We need a 24-bit color Display.");
00083 assert (PalPL2RAMGetDataWidthCT(RAM_BANK0) >= 32, 0,
00084 "We can't work with anything less then 32 bits wide ram.");
00085
00086
00087
00088
00089 par {
00090
00091
00092
00093 PalVideoOutRun(VideoOut, ClockRate);
00094 MouseRun(ClockRate);
00095 PalAudioInRun(AudioIn, ClockRate);
00096 PalAudioOutRun(AudioOut, ClockRate);
00097 PalPL2RAMRun(RAM_BANK0, ClockRate);
00098 #if HAVE_SMARTMEDIA
00099
00100
00101
00102 CPLDRun(ClockRate);
00103 SmartMediaRun(ClockRate);
00104 #endif
00105 #if HAVE_DEBUG
00106 RC200RS232Run(RC200RS232_115200Baud, RC200RS232ParityNone,
00107 RC200RS232FlowControlNone, ClockRate);
00108 #endif
00109
00110
00111
00112
00113 seq {
00114
00115
00116
00117
00118
00119 #if HAVE_DEBUG
00120 print_cls();
00121 print_string("Graphic Equalizer 2");
00122 print_eol();
00123 #endif
00124 PalVideoOutEnable(VideoOut);
00125 PalAudioInEnable(AudioIn);
00126 PalAudioOutEnable(AudioOut);
00127 audio_init(6, LINE_IN, SR_44100, AudioIn, AudioOut);
00128 #if HAVE_SMARTMEDIA
00129
00130
00131
00132
00133 result = smartmedia_init();
00134 if (!result) {
00135 #endif
00136 smartmedia_loaddata(&skindata);
00137
00138
00139
00140
00141 par {
00142
00143
00144
00145
00146
00147 mouse_main(&mousedata);
00148 display_main(&skindata, &audiodata, &events, &mousedata);
00149 eventhandler_main(&audiodata, &events, &mousedata);
00150 audio_main(audiodata, AudioIn, AudioOut);
00151 }
00152 #if HAVE_SMARTMEDIA
00153 } else {
00154 #if HAVE_DEBUG
00155 print_string("Error Initializing SmartMedia");
00156 #endif
00157 }
00158 #endif
00159 }
00160 }
00161
00162 }