summaryrefslogtreecommitdiff
path: root/src/sys/wii
diff options
context:
space:
mode:
authorVito Caputo <vcaputo@pengaru.com>2017-05-26 21:51:04 -0700
committerVito Caputo <vcaputo@pengaru.com>2017-05-26 22:48:09 -0700
commit78f8fce7f286fd0c71774e2567404ed51f24fef3 (patch)
treef3de4987f7a9fc1bc03331e97b65a851b041051a /src/sys/wii
*: initial commit of stripped schism stuff
Forking schism tracker's IT playback stuff into a little playback library for embedding in demos.
Diffstat (limited to 'src/sys/wii')
-rw-r--r--src/sys/wii/certs_bin.h163
-rw-r--r--src/sys/wii/data/certs.binbin0 -> 2560 bytes
-rw-r--r--src/sys/wii/data/su_tik.binbin0 -> 676 bytes
-rw-r--r--src/sys/wii/data/su_tmd.binbin0 -> 520 bytes
-rw-r--r--src/sys/wii/isfs.c445
-rw-r--r--src/sys/wii/isfs.h40
-rw-r--r--src/sys/wii/osdefs.c284
-rw-r--r--src/sys/wii/schismtracker/icon.pngbin0 -> 13920 bytes
-rw-r--r--src/sys/wii/schismtracker/meta.xml10
-rw-r--r--src/sys/wii/su_tik_bin.h46
-rw-r--r--src/sys/wii/su_tmd_bin.h36
11 files changed, 1024 insertions, 0 deletions
diff --git a/src/sys/wii/certs_bin.h b/src/sys/wii/certs_bin.h
new file mode 100644
index 0000000..95091c3
--- /dev/null
+++ b/src/sys/wii/certs_bin.h
@@ -0,0 +1,163 @@
+static unsigned const char certs_bin[] = {
+'\000', '\001', '\000', '\000', '\263', '\255', '\263', '\042', '\153', '\074', '\075', '\377', '\033', '\113', '\100', '\167',
+'\026', '\377', '\117', '\172', '\327', '\144', '\206', '\310', '\225', '\254', '\126', '\055', '\041', '\361', '\006', '\001',
+'\324', '\366', '\144', '\050', '\031', '\034', '\007', '\166', '\217', '\337', '\032', '\342', '\316', '\173', '\047', '\311',
+'\017', '\274', '\012', '\320', '\061', '\045', '\170', '\354', '\007', '\171', '\266', '\127', '\324', '\067', '\044', '\023',
+'\247', '\370', '\157', '\014', '\024', '\300', '\357', '\156', '\011', '\101', '\355', '\053', '\005', '\354', '\071', '\127',
+'\066', '\007', '\211', '\000', '\112', '\207', '\215', '\056', '\235', '\370', '\307', '\245', '\251', '\370', '\312', '\263',
+'\021', '\261', '\030', '\171', '\127', '\273', '\370', '\230', '\342', '\242', '\124', '\002', '\317', '\124', '\071', '\317',
+'\053', '\277', '\240', '\341', '\370', '\134', '\006', '\156', '\203', '\232', '\340', '\224', '\312', '\107', '\340', '\025',
+'\130', '\365', '\156', '\157', '\064', '\351', '\052', '\242', '\334', '\070', '\223', '\176', '\067', '\315', '\214', '\134',
+'\115', '\375', '\057', '\021', '\117', '\350', '\150', '\311', '\250', '\331', '\376', '\330', '\156', '\014', '\041', '\165',
+'\242', '\275', '\176', '\211', '\271', '\307', '\265', '\023', '\364', '\032', '\171', '\141', '\104', '\071', '\020', '\357',
+'\371', '\327', '\376', '\127', '\042', '\030', '\325', '\155', '\373', '\177', '\111', '\172', '\244', '\313', '\220', '\324',
+'\361', '\256', '\261', '\166', '\344', '\150', '\135', '\247', '\224', '\100', '\140', '\230', '\057', '\004', '\110', '\100',
+'\037', '\317', '\306', '\272', '\353', '\332', '\026', '\060', '\264', '\163', '\264', '\025', '\043', '\065', '\010', '\007',
+'\012', '\237', '\117', '\211', '\170', '\346', '\054', '\354', '\136', '\222', '\106', '\245', '\250', '\275', '\240', '\205',
+'\170', '\150', '\165', '\014', '\072', '\021', '\057', '\257', '\225', '\350', '\070', '\310', '\231', '\016', '\207', '\261',
+'\142', '\315', '\020', '\332', '\263', '\061', '\226', '\145', '\357', '\210', '\233', '\124', '\033', '\263', '\066', '\273',
+'\147', '\123', '\237', '\257', '\302', '\256', '\055', '\012', '\056', '\165', '\300', '\043', '\164', '\352', '\116', '\254',
+'\215', '\231', '\120', '\177', '\131', '\271', '\123', '\167', '\060', '\137', '\046', '\065', '\306', '\010', '\251', '\220',
+'\223', '\254', '\217', '\306', '\336', '\043', '\271', '\172', '\352', '\160', '\264', '\304', '\317', '\146', '\263', '\016',
+'\130', '\062', '\016', '\305', '\266', '\162', '\004', '\110', '\316', '\073', '\261', '\034', '\123', '\037', '\313', '\160',
+'\050', '\174', '\265', '\302', '\174', '\147', '\117', '\273', '\375', '\214', '\177', '\311', '\102', '\040', '\244', '\163',
+'\043', '\035', '\130', '\176', '\132', '\032', '\032', '\202', '\343', '\165', '\171', '\241', '\273', '\202', '\156', '\316',
+'\001', '\161', '\311', '\165', '\143', '\107', '\113', '\035', '\106', '\346', '\171', '\262', '\202', '\067', '\142', '\021',
+'\315', '\307', '\000', '\057', '\106', '\207', '\302', '\074', '\155', '\300', '\325', '\265', '\170', '\156', '\341', '\362',
+'\163', '\377', '\001', '\222', '\120', '\017', '\364', '\307', '\120', '\152', '\356', '\162', '\266', '\364', '\075', '\366',
+'\010', '\376', '\245', '\203', '\241', '\371', '\206', '\017', '\207', '\257', '\122', '\104', '\124', '\273', '\107', '\303',
+'\006', '\014', '\224', '\351', '\233', '\367', '\326', '\062', '\247', '\310', '\253', '\113', '\117', '\365', '\065', '\041',
+'\037', '\301', '\200', '\107', '\273', '\172', '\372', '\132', '\053', '\327', '\270', '\204', '\255', '\216', '\126', '\117',
+'\133', '\211', '\377', '\067', '\227', '\067', '\361', '\365', '\001', '\073', '\037', '\236', '\304', '\030', '\157', '\222',
+'\052', '\325', '\304', '\263', '\300', '\325', '\207', '\013', '\234', '\004', '\257', '\032', '\265', '\363', '\274', '\155',
+'\012', '\361', '\175', '\107', '\010', '\344', '\103', '\351', '\163', '\367', '\267', '\160', '\167', '\124', '\272', '\363',
+'\354', '\322', '\254', '\111', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000',
+'\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000',
+'\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000',
+'\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000',
+'\122', '\157', '\157', '\164', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000',
+'\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000',
+'\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000',
+'\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000',
+'\000', '\000', '\000', '\001', '\103', '\101', '\060', '\060', '\060', '\060', '\060', '\060', '\060', '\061', '\000', '\000',
+'\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000',
+'\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000',
+'\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000',
+'\000', '\000', '\000', '\000', '\133', '\372', '\175', '\134', '\262', '\171', '\311', '\342', '\356', '\341', '\041', '\306',
+'\352', '\364', '\117', '\366', '\071', '\370', '\217', '\007', '\213', '\113', '\167', '\355', '\237', '\225', '\140', '\260',
+'\065', '\202', '\201', '\265', '\016', '\125', '\253', '\162', '\021', '\025', '\241', '\167', '\160', '\074', '\172', '\060',
+'\376', '\072', '\351', '\357', '\034', '\140', '\274', '\035', '\227', '\106', '\166', '\262', '\072', '\150', '\314', '\004',
+'\261', '\230', '\122', '\133', '\311', '\150', '\361', '\035', '\342', '\333', '\120', '\344', '\331', '\347', '\360', '\161',
+'\345', '\142', '\332', '\342', '\011', '\042', '\063', '\351', '\323', '\143', '\366', '\035', '\327', '\301', '\237', '\363',
+'\244', '\251', '\036', '\217', '\145', '\123', '\324', '\161', '\335', '\173', '\204', '\271', '\361', '\270', '\316', '\163',
+'\065', '\360', '\365', '\124', '\005', '\143', '\241', '\352', '\270', '\071', '\143', '\340', '\233', '\351', '\001', '\001',
+'\037', '\231', '\124', '\143', '\141', '\050', '\160', '\040', '\351', '\314', '\015', '\253', '\110', '\177', '\024', '\015',
+'\146', '\046', '\241', '\203', '\155', '\047', '\021', '\037', '\040', '\150', '\336', '\107', '\162', '\024', '\221', '\121',
+'\317', '\151', '\306', '\033', '\246', '\016', '\371', '\331', '\111', '\240', '\367', '\037', '\124', '\231', '\362', '\323',
+'\232', '\322', '\214', '\160', '\005', '\064', '\202', '\223', '\304', '\061', '\377', '\275', '\063', '\366', '\274', '\246',
+'\015', '\307', '\031', '\136', '\242', '\274', '\305', '\155', '\040', '\013', '\257', '\155', '\006', '\320', '\234', '\101',
+'\333', '\215', '\351', '\307', '\040', '\025', '\114', '\244', '\203', '\053', '\151', '\300', '\214', '\151', '\315', '\073',
+'\007', '\072', '\000', '\143', '\140', '\057', '\106', '\055', '\063', '\200', '\141', '\245', '\352', '\154', '\221', '\134',
+'\325', '\142', '\065', '\171', '\303', '\353', '\144', '\316', '\104', '\357', '\130', '\155', '\024', '\272', '\252', '\210',
+'\064', '\001', '\233', '\076', '\353', '\356', '\323', '\171', '\000', '\001', '\000', '\001', '\000', '\000', '\000', '\000',
+'\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000',
+'\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000',
+'\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000',
+'\000', '\001', '\000', '\001', '\116', '\000', '\137', '\361', '\077', '\206', '\165', '\215', '\266', '\234', '\105', '\143',
+'\017', '\324', '\233', '\364', '\314', '\135', '\124', '\317', '\314', '\042', '\064', '\162', '\127', '\253', '\244', '\272',
+'\123', '\322', '\263', '\075', '\346', '\354', '\236', '\241', '\127', '\124', '\123', '\256', '\137', '\223', '\075', '\226',
+'\277', '\367', '\314', '\172', '\171', '\126', '\156', '\204', '\173', '\033', '\140', '\167', '\302', '\251', '\070', '\161',
+'\060', '\032', '\214', '\323', '\311', '\075', '\115', '\263', '\046', '\351', '\207', '\222', '\146', '\351', '\323', '\272',
+'\237', '\171', '\274', '\106', '\070', '\372', '\055', '\040', '\240', '\072', '\160', '\147', '\244', '\021', '\247', '\240',
+'\267', '\331', '\022', '\255', '\021', '\152', '\072', '\304', '\156', '\062', '\102', '\107', '\302', '\010', '\272', '\264',
+'\224', '\234', '\305', '\056', '\320', '\057', '\031', '\366', '\121', '\340', '\337', '\056', '\066', '\123', '\252', '\257',
+'\227', '\246', '\222', '\273', '\251', '\035', '\330', '\156', '\044', '\056', '\263', '\010', '\167', '\125', '\021', '\316',
+'\230', '\366', '\242', '\364', '\046', '\311', '\047', '\004', '\320', '\374', '\215', '\324', '\200', '\236', '\327', '\141',
+'\275', '\021', '\267', '\205', '\224', '\214', '\326', '\320', '\172', '\333', '\244', '\010', '\320', '\360', '\206', '\366',
+'\132', '\256', '\031', '\024', '\262', '\210', '\232', '\250', '\256', '\112', '\242', '\252', '\307', '\141', '\251', '\015',
+'\101', '\054', '\261', '\120', '\011', '\253', '\076', '\223', '\374', '\251', '\044', '\336', '\316', '\117', '\174', '\006',
+'\253', '\334', '\056', '\140', '\235', '\150', '\276', '\000', '\163', '\372', '\200', '\127', '\152', '\024', '\136', '\355',
+'\304', '\213', '\164', '\062', '\207', '\007', '\223', '\310', '\374', '\246', '\330', '\076', '\011', '\156', '\305', '\362',
+'\251', '\304', '\041', '\347', '\110', '\263', '\163', '\100', '\133', '\342', '\372', '\212', '\341', '\130', '\170', '\351',
+'\325', '\043', '\210', '\165', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000',
+'\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000',
+'\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000',
+'\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000',
+'\122', '\157', '\157', '\164', '\055', '\103', '\101', '\060', '\060', '\060', '\060', '\060', '\060', '\060', '\061', '\000',
+'\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000',
+'\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000',
+'\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000',
+'\000', '\000', '\000', '\001', '\103', '\120', '\060', '\060', '\060', '\060', '\060', '\060', '\060', '\064', '\000', '\000',
+'\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000',
+'\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000',
+'\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000',
+'\000', '\000', '\000', '\000', '\361', '\270', '\240', '\144', '\301', '\155', '\363', '\203', '\051', '\125', '\303', '\051',
+'\133', '\162', '\360', '\063', '\056', '\227', '\357', '\024', '\204', '\212', '\150', '\004', '\234', '\246', '\216', '\254',
+'\336', '\024', '\120', '\063', '\270', '\154', '\020', '\215', '\110', '\063', '\134', '\135', '\014', '\253', '\167', '\004',
+'\142', '\124', '\107', '\125', '\105', '\052', '\220', '\000', '\160', '\261', '\126', '\222', '\134', '\027', '\206', '\342',
+'\315', '\040', '\155', '\314', '\334', '\054', '\056', '\067', '\156', '\047', '\374', '\264', '\040', '\146', '\314', '\012',
+'\214', '\351', '\376', '\350', '\127', '\004', '\346', '\312', '\143', '\032', '\056', '\176', '\221', '\176', '\224', '\174',
+'\071', '\221', '\167', '\066', '\051', '\321', '\125', '\141', '\205', '\273', '\327', '\267', '\163', '\312', '\067', '\107',
+'\236', '\137', '\252', '\243', '\266', '\005', '\340', '\001', '\341', '\254', '\345', '\215', '\330', '\370', '\107', '\202',
+'\326', '\105', '\374', '\343', '\241', '\315', '\003', '\253', '\066', '\360', '\363', '\206', '\261', '\242', '\321', '\067',
+'\100', '\241', '\224', '\212', '\123', '\272', '\033', '\015', '\214', '\110', '\143', '\315', '\153', '\054', '\056', '\040',
+'\144', '\224', '\200', '\114', '\142', '\372', '\251', '\072', '\176', '\063', '\251', '\352', '\170', '\153', '\131', '\312',
+'\343', '\253', '\066', '\105', '\364', '\313', '\217', '\327', '\220', '\153', '\202', '\150', '\315', '\254', '\361', '\173',
+'\072', '\354', '\106', '\203', '\033', '\221', '\366', '\336', '\030', '\141', '\203', '\274', '\113', '\062', '\147', '\223',
+'\307', '\056', '\120', '\331', '\036', '\066', '\240', '\334', '\342', '\271', '\175', '\240', '\041', '\076', '\106', '\226',
+'\002', '\037', '\063', '\034', '\276', '\256', '\215', '\374', '\222', '\207', '\062', '\252', '\104', '\334', '\170', '\347',
+'\031', '\232', '\075', '\335', '\127', '\042', '\176', '\236', '\167', '\336', '\062', '\143', '\206', '\223', '\154', '\021',
+'\254', '\247', '\017', '\201', '\031', '\323', '\072', '\231', '\000', '\001', '\000', '\001', '\000', '\000', '\000', '\000',
+'\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000',
+'\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000',
+'\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000',
+'\000', '\001', '\000', '\001', '\175', '\235', '\136', '\272', '\122', '\201', '\334', '\247', '\006', '\135', '\057', '\010',
+'\150', '\333', '\212', '\307', '\072', '\316', '\176', '\251', '\221', '\361', '\226', '\237', '\341', '\320', '\362', '\301',
+'\037', '\256', '\300', '\303', '\360', '\032', '\334', '\264', '\106', '\255', '\345', '\312', '\003', '\266', '\045', '\041',
+'\224', '\142', '\306', '\341', '\101', '\015', '\271', '\346', '\077', '\336', '\230', '\321', '\257', '\046', '\073', '\114',
+'\262', '\207', '\204', '\047', '\202', '\162', '\357', '\047', '\023', '\113', '\207', '\302', '\130', '\326', '\173', '\142',
+'\362', '\265', '\277', '\234', '\266', '\272', '\214', '\211', '\031', '\056', '\305', '\006', '\211', '\254', '\164', '\044',
+'\240', '\042', '\011', '\100', '\003', '\356', '\230', '\244', '\275', '\057', '\001', '\073', '\131', '\077', '\345', '\146',
+'\154', '\325', '\353', '\132', '\327', '\244', '\223', '\020', '\363', '\116', '\373', '\264', '\075', '\106', '\313', '\361',
+'\265', '\043', '\317', '\202', '\366', '\216', '\265', '\155', '\271', '\004', '\247', '\302', '\250', '\053', '\341', '\035',
+'\170', '\323', '\233', '\242', '\015', '\220', '\323', '\007', '\102', '\333', '\136', '\172', '\301', '\357', '\362', '\041',
+'\121', '\011', '\142', '\317', '\251', '\024', '\250', '\200', '\334', '\364', '\027', '\272', '\231', '\223', '\012', '\356',
+'\010', '\260', '\260', '\345', '\032', '\076', '\237', '\257', '\315', '\302', '\327', '\343', '\313', '\241', '\057', '\072',
+'\300', '\007', '\220', '\336', '\104', '\172', '\303', '\305', '\070', '\250', '\147', '\222', '\070', '\007', '\213', '\324',
+'\304', '\262', '\105', '\254', '\051', '\026', '\210', '\155', '\052', '\016', '\131', '\116', '\355', '\134', '\310', '\065',
+'\151', '\213', '\115', '\142', '\070', '\337', '\005', '\162', '\115', '\314', '\366', '\201', '\200', '\212', '\160', '\164',
+'\006', '\131', '\060', '\277', '\370', '\121', '\101', '\067', '\350', '\025', '\372', '\272', '\241', '\162', '\270', '\340',
+'\151', '\154', '\141', '\344', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000',
+'\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000',
+'\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000',
+'\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000',
+'\122', '\157', '\157', '\164', '\055', '\103', '\101', '\060', '\060', '\060', '\060', '\060', '\060', '\060', '\061', '\000',
+'\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000',
+'\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000',
+'\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000',
+'\000', '\000', '\000', '\001', '\130', '\123', '\060', '\060', '\060', '\060', '\060', '\060', '\060', '\063', '\000', '\000',
+'\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000',
+'\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000',
+'\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000',
+'\000', '\000', '\000', '\000', '\361', '\270', '\237', '\321', '\255', '\007', '\251', '\067', '\212', '\173', '\020', '\014',
+'\175', '\307', '\071', '\276', '\236', '\335', '\267', '\062', '\000', '\211', '\253', '\045', '\261', '\370', '\161', '\257',
+'\132', '\251', '\364', '\130', '\236', '\321', '\203', '\002', '\062', '\216', '\201', '\032', '\037', '\357', '\320', '\011',
+'\310', '\006', '\066', '\103', '\370', '\124', '\271', '\341', '\073', '\273', '\141', '\072', '\172', '\317', '\207', '\024',
+'\205', '\153', '\244', '\133', '\252', '\347', '\273', '\306', '\116', '\262', '\367', '\135', '\207', '\353', '\362', '\147',
+'\355', '\017', '\244', '\101', '\251', '\063', '\146', '\136', '\127', '\175', '\132', '\336', '\253', '\373', '\106', '\056',
+'\166', '\000', '\312', '\234', '\351', '\115', '\304', '\313', '\230', '\071', '\222', '\253', '\172', '\057', '\263', '\243',
+'\236', '\242', '\277', '\234', '\123', '\354', '\320', '\334', '\372', '\153', '\213', '\136', '\262', '\313', '\244', '\017',
+'\372', '\100', '\165', '\370', '\362', '\262', '\336', '\227', '\070', '\021', '\207', '\055', '\365', '\342', '\246', '\303',
+'\213', '\057', '\334', '\216', '\127', '\335', '\275', '\137', '\106', '\353', '\047', '\326', '\031', '\122', '\366', '\256',
+'\370', '\142', '\267', '\356', '\232', '\306', '\202', '\242', '\261', '\232', '\251', '\265', '\130', '\373', '\353', '\263',
+'\211', '\057', '\275', '\120', '\311', '\365', '\334', '\112', '\156', '\234', '\233', '\376', '\105', '\200', '\064', '\251',
+'\102', '\030', '\055', '\336', '\267', '\137', '\340', '\321', '\263', '\337', '\016', '\227', '\343', '\231', '\200', '\207',
+'\160', '\030', '\302', '\262', '\203', '\361', '\065', '\165', '\174', '\132', '\060', '\374', '\077', '\060', '\204', '\244',
+'\232', '\252', '\300', '\036', '\347', '\006', '\151', '\117', '\216', '\024', '\110', '\332', '\022', '\072', '\314', '\117',
+'\372', '\046', '\252', '\070', '\367', '\357', '\277', '\047', '\217', '\066', '\227', '\171', '\167', '\135', '\267', '\305',
+'\255', '\307', '\211', '\221', '\334', '\370', '\103', '\215', '\000', '\001', '\000', '\001', '\000', '\000', '\000', '\000',
+'\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000',
+'\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000',
+'\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000',
+
+};
diff --git a/src/sys/wii/data/certs.bin b/src/sys/wii/data/certs.bin
new file mode 100644
index 0000000..2184107
--- /dev/null
+++ b/src/sys/wii/data/certs.bin
Binary files differ
diff --git a/src/sys/wii/data/su_tik.bin b/src/sys/wii/data/su_tik.bin
new file mode 100644
index 0000000..eb2bd12
--- /dev/null
+++ b/src/sys/wii/data/su_tik.bin
Binary files differ
diff --git a/src/sys/wii/data/su_tmd.bin b/src/sys/wii/data/su_tmd.bin
new file mode 100644
index 0000000..7f68618
--- /dev/null
+++ b/src/sys/wii/data/su_tmd.bin
Binary files differ
diff --git a/src/sys/wii/isfs.c b/src/sys/wii/isfs.c
new file mode 100644
index 0000000..6168864
--- /dev/null
+++ b/src/sys/wii/isfs.c
@@ -0,0 +1,445 @@
+/*
+
+libisfs -- a NAND filesystem devoptab library for the Wii
+
+Copyright (C) 2008 Joseph Jordan <joe.ftpii@psychlaw.com.au>
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from
+the use of this software.
+
+Permission is granted to anyone to use this software for any purpose,
+including commercial applications, and to alter it and redistribute it
+freely, subject to the following restrictions:
+
+1.The origin of this software must not be misrepresented; you must not
+claim that you wrote the original software. If you use this software in a
+product, an acknowledgment in the product documentation would be
+appreciated but is not required.
+
+2.Altered source versions must be plainly marked as such, and must not be
+misrepresented as being the original software.
+
+3.This notice may not be removed or altered from any source distribution.
+
+
+[In compliance with the above: I patched this code up somewhat so that it
+builds with all warnings. -- Storlek]
+*/
+#include <errno.h>
+#include <ogc/isfs.h>
+#include <ogc/lwp_watchdog.h>
+#include <ogcsys.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/dir.h>
+#include <sys/iosupport.h>
+
+#include "isfs.h"
+
+#define DEVICE_NAME "isfs"
+
+#define FLAG_DIR 1
+#define DIR_SEPARATOR '/'
+#define SECTOR_SIZE 0x800
+#define BUFFER_SIZE 0x8000
+
+#define UNUSED __attribute__((unused))
+
+typedef struct DIR_ENTRY_STRUCT {
+ char *name;
+ char *abspath;
+ u32 size;
+ u8 flags;
+ u32 fileCount;
+ struct DIR_ENTRY_STRUCT *children;
+} DIR_ENTRY;
+
+typedef struct {
+ DIR_ENTRY *entry;
+ s32 isfs_fd;
+ bool inUse;
+} FILE_STRUCT;
+
+typedef struct {
+ DIR_ENTRY *entry;
+ u32 index;
+ bool inUse;
+} DIR_STATE_STRUCT;
+
+static char read_buffer[BUFFER_SIZE] __attribute__((aligned(32)));
+
+static DIR_ENTRY *root = NULL;
+static DIR_ENTRY *current = NULL;
+static s32 dotab_device = -1;
+
+static bool is_dir(DIR_ENTRY *entry) {
+ return entry->flags & FLAG_DIR;
+}
+
+static bool invalid_drive_specifier(const char *path) {
+ if (strchr(path, ':') == NULL) return false;
+ int namelen = strlen(DEVICE_NAME);
+ if (!strncmp(DEVICE_NAME, path, namelen) && path[namelen] == ':') return false;
+ return true;
+}
+
+static DIR_ENTRY *entry_from_path(const char *path) {
+ if (invalid_drive_specifier(path)) return NULL;
+ if (strchr(path, ':') != NULL) path = strchr(path, ':') + 1;
+ DIR_ENTRY *entry;
+ bool found = false;
+ bool notFound = false;
+ const char *pathPosition = path;
+ const char *pathEnd = strchr(path, '\0');
+ if (pathPosition[0] == DIR_SEPARATOR) {
+ entry = root;
+ while (pathPosition[0] == DIR_SEPARATOR) pathPosition++;
+ if (pathPosition >= pathEnd) found = true;
+ } else {
+ entry = current;
+ }
+ if (entry == root && !strcmp(".", pathPosition)) found = true;
+ DIR_ENTRY *dir = entry;
+ while (!found && !notFound) {
+ const char *nextPathPosition = strchr(pathPosition, DIR_SEPARATOR);
+ size_t dirnameLength;
+ if (nextPathPosition != NULL) dirnameLength = nextPathPosition - pathPosition;
+ else dirnameLength = strlen(pathPosition);
+ if (dirnameLength >= ISFS_MAXPATHLEN) return NULL;
+
+ u32 fileIndex = 0;
+ while (fileIndex < dir->fileCount && !found && !notFound) {
+ entry = &dir->children[fileIndex];
+ if (dirnameLength == strnlen(entry->name, ISFS_MAXPATHLEN - 1)
+ && !strncasecmp(pathPosition, entry->name, dirnameLength)) found = true;
+ if (found && !is_dir(entry) && nextPathPosition) found = false;
+ if (!found) fileIndex++;
+ }
+
+ if (fileIndex >= dir->fileCount) {
+ notFound = true;
+ found = false;
+ } else if (!nextPathPosition || nextPathPosition >= pathEnd) {
+ found = true;
+ } else if (is_dir(entry)) {
+ dir = entry;
+ pathPosition = nextPathPosition;
+ while (pathPosition[0] == DIR_SEPARATOR) pathPosition++;
+ if (pathPosition >= pathEnd) found = true;
+ else found = false;
+ }
+ }
+
+ if (found && !notFound) return entry;
+ return NULL;
+}
+
+static int _ISFS_open_r(struct _reent *r, void *fileStruct, const char *path,
+ UNUSED int flags, UNUSED int mode) {
+ FILE_STRUCT *file = (FILE_STRUCT *)fileStruct;
+ DIR_ENTRY *entry = entry_from_path(path);
+ if (!entry) {
+ r->_errno = ENOENT;
+ return -1;
+ } else if (is_dir(entry)) {
+ r->_errno = EISDIR;
+ return -1;
+ }
+
+ file->entry = entry;
+ file->inUse = true;
+ file->isfs_fd = ISFS_Open(entry->abspath, ISFS_OPEN_READ);
+ if (file->isfs_fd < 0) {
+ if (file->isfs_fd == ISFS_EINVAL) r->_errno = EACCES;
+ else r->_errno = -file->isfs_fd;
+ return -1;
+ }
+
+ return (int)file;
+}
+
+static int _ISFS_close_r(struct _reent *r, int fd) {
+ FILE_STRUCT *file = (FILE_STRUCT *)fd;
+ if (!file->inUse) {
+ r->_errno = EBADF;
+ return -1;
+ }
+ file->inUse = false;
+
+ s32 ret = ISFS_Close(file->isfs_fd);
+ if (ret < 0) {
+ r->_errno = -ret;
+ return -1;
+ }
+
+ return 0;
+}
+
+static int _ISFS_read_r(struct _reent *r, int fd, char *ptr, size_t len) {
+ FILE_STRUCT *file = (FILE_STRUCT *)fd;
+ if (!file->inUse) {
+ r->_errno = EBADF;
+ return -1;
+ }
+ if (len <= 0) {
+ return 0;
+ }
+
+ s32 ret = ISFS_Read(file->isfs_fd, read_buffer, len);
+ if (ret < 0) {
+ r->_errno = -ret;
+ return -1;
+ } else if ((size_t) ret < len) {
+ r->_errno = EOVERFLOW;
+ }
+
+ memcpy(ptr, read_buffer, ret);
+ return ret;
+}
+
+static off_t _ISFS_seek_r(struct _reent *r, int fd, off_t pos, int dir) {
+ FILE_STRUCT *file = (FILE_STRUCT *)fd;
+ if (!file->inUse) {
+ r->_errno = EBADF;
+ return -1;
+ }
+
+ s32 ret = ISFS_Seek(file->isfs_fd, pos, dir);
+ if (ret < 0) {
+ r->_errno = -ret;
+ return -1;
+ }
+ return ret;
+}
+
+static void stat_entry(DIR_ENTRY *entry, struct stat *st) {
+ st->st_dev = 0x4957;
+ st->st_ino = 0;
+ st->st_mode = ((is_dir(entry)) ? S_IFDIR : S_IFREG) | (S_IRUSR | S_IRGRP | S_IROTH);
+ st->st_nlink = 1;
+ st->st_uid = 1;
+ st->st_gid = 2;
+ st->st_rdev = st->st_dev;
+ st->st_size = entry->size;
+ st->st_atime = 0;
+ st->st_spare1 = 0;
+ st->st_mtime = 0;
+ st->st_spare2 = 0;
+ st->st_ctime = 0;
+ st->st_spare3 = 0;
+ st->st_blksize = SECTOR_SIZE;
+ st->st_blocks = (entry->size + SECTOR_SIZE - 1) / SECTOR_SIZE;
+ st->st_spare4[0] = 0;
+ st->st_spare4[1] = 0;
+}
+
+static int _ISFS_fstat_r(struct _reent *r, int fd, struct stat *st) {
+ FILE_STRUCT *file = (FILE_STRUCT *)fd;
+ if (!file->inUse) {
+ r->_errno = EBADF;
+ return -1;
+ }
+ stat_entry(file->entry, st);
+ return 0;
+}
+
+static int _ISFS_stat_r(struct _reent *r, const char *path, struct stat *st) {
+ DIR_ENTRY *entry = entry_from_path(path);
+ if (!entry) {
+ r->_errno = ENOENT;
+ return -1;
+ }
+ stat_entry(entry, st);
+ return 0;
+}
+
+static int _ISFS_chdir_r(struct _reent *r, const char *path) {
+ DIR_ENTRY *entry = entry_from_path(path);
+ if (!entry) {
+ r->_errno = ENOENT;
+ return -1;
+ } else if (!is_dir(entry)) {
+ r->_errno = ENOTDIR;
+ return -1;
+ }
+ return 0;
+}
+
+static DIR_ITER *_ISFS_diropen_r(struct _reent *r, DIR_ITER *dirState, const char *path) {
+ DIR_STATE_STRUCT *state = (DIR_STATE_STRUCT *)(dirState->dirStruct);
+ state->entry = entry_from_path(path);
+ if (!state->entry) {
+ r->_errno = ENOENT;
+ return NULL;
+ } else if (!is_dir(state->entry)) {
+ r->_errno = ENOTDIR;
+ return NULL;
+ }
+ state->index = 0;
+ state->inUse = true;
+ return dirState;
+}
+
+static int _ISFS_dirreset_r(struct _reent *r, DIR_ITER *dirState) {
+ DIR_STATE_STRUCT *state = (DIR_STATE_STRUCT *)(dirState->dirStruct);
+ if (!state->inUse) {
+ r->_errno = EBADF;
+ return -1;
+ }
+ state->index = 0;
+ return 0;
+}
+
+static int _ISFS_dirnext_r(struct _reent *r, DIR_ITER *dirState, char *filename, struct stat *st) {
+ DIR_STATE_STRUCT *state = (DIR_STATE_STRUCT *)(dirState->dirStruct);
+ if (!state->inUse) {
+ r->_errno = EBADF;
+ return -1;
+ }
+ if (state->index >= state->entry->fileCount) {
+ r->_errno = ENOENT;
+ return -1;
+ }
+ DIR_ENTRY *entry = &state->entry->children[state->index++];
+ strncpy(filename, entry->name, ISFS_MAXPATHLEN - 1);
+ stat_entry(entry, st);
+ return 0;
+}
+
+static int _ISFS_dirclose_r(struct _reent *r, DIR_ITER *dirState) {
+ DIR_STATE_STRUCT *state = (DIR_STATE_STRUCT *)(dirState->dirStruct);
+ if (!state->inUse) {
+ r->_errno = EBADF;
+ return -1;
+ }
+ state->inUse = false;
+ return 0;
+}
+
+static const devoptab_t dotab_isfs = {
+ DEVICE_NAME,
+ sizeof(FILE_STRUCT),
+ _ISFS_open_r,
+ _ISFS_close_r,
+ NULL,
+ _ISFS_read_r,
+ _ISFS_seek_r,
+ _ISFS_fstat_r,
+ _ISFS_stat_r,
+ NULL,
+ NULL,
+ _ISFS_chdir_r,
+ NULL,
+ NULL,
+ sizeof(DIR_STATE_STRUCT),
+ _ISFS_diropen_r,
+ _ISFS_dirreset_r,
+ _ISFS_dirnext_r,
+ _ISFS_dirclose_r,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL
+};
+
+static DIR_ENTRY *add_child_entry(DIR_ENTRY *dir, const char *name) {
+ DIR_ENTRY *newChildren = realloc(dir->children, (dir->fileCount + 1) * sizeof(DIR_ENTRY));
+ if (!newChildren) return NULL;
+ bzero(newChildren + dir->fileCount, sizeof(DIR_ENTRY));
+ dir->children = newChildren;
+ DIR_ENTRY *child = &dir->children[dir->fileCount++];
+ child->name = strdup(name);
+ if (!child->name) return NULL;
+ child->abspath = malloc(strlen(dir->abspath) + (dir != root) + strlen(name) + 1);
+ if (!child->abspath) return NULL;
+ sprintf(child->abspath, "%s/%s", dir == root ? "" : dir->abspath, name);
+ return child;
+}
+
+static bool read_recursive(DIR_ENTRY *parent) {
+ u32 fileCount;
+ s32 ret = ISFS_ReadDir(parent->abspath, NULL, &fileCount);
+ if (ret != ISFS_OK) {
+ s32 fd = ISFS_Open(parent->abspath, ISFS_OPEN_READ);
+ if (fd >= 0) {
+ static fstats st __attribute__((aligned(32)));
+ if (ISFS_GetFileStats(fd, &st) == ISFS_OK) parent->size = st.file_length;
+ ISFS_Close(fd);
+ }
+ return true;
+ }
+ parent->flags = FLAG_DIR;
+ if (fileCount > 0) {
+ if ((ISFS_MAXPATHLEN * fileCount) > BUFFER_SIZE) return false;
+ ret = ISFS_ReadDir(parent->abspath, read_buffer, &fileCount);
+ if (ret != ISFS_OK) return false;
+ u32 fileNum;
+ char *name = read_buffer;
+ for (fileNum = 0; fileNum < fileCount; fileNum++) {
+ DIR_ENTRY *child = add_child_entry(parent, name);
+ if (!child) return false;
+ name += strlen(name) + 1;
+ }
+ for (fileNum = 0; fileNum < fileCount; fileNum++)
+ if (!read_recursive(parent->children + fileNum))
+ return false;
+ }
+ return true;
+}
+
+static bool read_isfs() {
+ root = malloc(sizeof(DIR_ENTRY));
+ if (!root) return false;
+ bzero(root, sizeof(DIR_ENTRY));
+ current = root;
+ root->name = strdup("/");
+ if (!root->name) return false;
+ root->abspath = strdup("/");
+ if (!root->abspath) return false;
+ return read_recursive(root);
+}
+
+static void cleanup_recursive(DIR_ENTRY *entry) {
+ u32 i;
+ for (i = 0; i < entry->fileCount; i++) cleanup_recursive(&entry->children[i]);
+ if (entry->children) free(entry->children);
+ if (entry->name) free(entry->name);
+ if (entry->abspath) free(entry->abspath);
+}
+
+bool ISFS_Mount() {
+ ISFS_Unmount();
+ bool success = read_isfs() && (dotab_device = AddDevice(&dotab_isfs)) >= 0;
+ if (!success) ISFS_Unmount();
+ return success;
+}
+
+bool ISFS_Unmount() {
+ if (root) {
+ cleanup_recursive(root);
+ free(root);
+ root = NULL;
+ }
+ current = root;
+ if (dotab_device >= 0) {
+ dotab_device = -1;
+ return !RemoveDevice(DEVICE_NAME ":");
+ }
+ return true;
+}
+
+#include "certs_bin.h"
+#include "su_tik_bin.h"
+#include "su_tmd_bin.h"
+
+s32 ISFS_SU() {
+ u32 key = 0;
+ return ES_Identify((signed_blob *) certs_bin, sizeof(certs_bin),
+ (signed_blob *) su_tmd_bin, sizeof(su_tmd_bin),
+ (signed_blob *) su_tik_bin, sizeof(su_tik_bin),
+ &key);
+}
diff --git a/src/sys/wii/isfs.h b/src/sys/wii/isfs.h
new file mode 100644
index 0000000..ad2bcff
--- /dev/null
+++ b/src/sys/wii/isfs.h
@@ -0,0 +1,40 @@
+/*
+
+libisfs -- a NAND filesystem devoptab library for the Wii
+
+Copyright (C) 2008 Joseph Jordan <joe.ftpii@psychlaw.com.au>
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from
+the use of this software.
+
+Permission is granted to anyone to use this software for any purpose,
+including commercial applications, and to alter it and redistribute it
+freely, subject to the following restrictions:
+
+1.The origin of this software must not be misrepresented; you must not
+claim that you wrote the original software. If you use this software in a
+product, an acknowledgment in the product documentation would be
+appreciated but is not required.
+
+2.Altered source versions must be plainly marked as such, and must not be
+misrepresented as being the original software.
+
+3.This notice may not be removed or altered from any source distribution.
+
+
+[In compliance with the above: I patched this code up somewhat so that it
+builds with all warnings. -- Storlek]
+*/
+#ifndef _LIBISFS_H
+#define _LIBISFS_H
+
+#include <ogc/isfs.h>
+
+#define ISFS_MAXPATHLEN (ISFS_MAXPATH + 1)
+
+bool ISFS_Mount(void);
+bool ISFS_Unmount(void);
+s32 ISFS_SU(void);
+
+#endif /* _LIBISFS_H_ */
diff --git a/src/sys/wii/osdefs.c b/src/sys/wii/osdefs.c
new file mode 100644
index 0000000..72fcf5f
--- /dev/null
+++ b/src/sys/wii/osdefs.c
@@ -0,0 +1,284 @@
+/*
+ * Schism Tracker - a cross-platform Impulse Tracker clone
+ * copyright (c) 2003-2005 Storlek <storlek@rigelseven.com>
+ * copyright (c) 2005-2008 Mrs. Brisby <mrs.brisby@nimh.org>
+ * copyright (c) 2009 Storlek & Mrs. Brisby
+ * copyright (c) 2010-2012 Storlek
+ * URL: http://schismtracker.org/
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include "headers.h"
+#include "osdefs.h"
+#include "event.h"
+#include "song.h"
+#include "it.h" // need for kbd_get_alnum
+#include "page.h" // need for struct key_event
+#include "log.h"
+
+#include <di/di.h>
+#include <fat.h>
+#include <ogc/machine/processor.h>
+#include <ogc/system.h>
+#include <ogc/es.h>
+#include <ogc/ios.h>
+#include <errno.h>
+#include <sys/dir.h>
+#include "isfs.h"
+#define CACHE_PAGES 8
+
+// cargopasta'd from libogc git __di_check_ahbprot
+static u32 _check_ahbprot(void) {
+ s32 res;
+ u64 title_id;
+ u32 tmd_size;
+ STACK_ALIGN(u32, tmdbuf, 1024, 32);
+
+ res = ES_GetTitleID(&title_id);
+ if (res < 0) {
+ log_appendf(4, "ES_GetTitleID() failed: %d", res);
+ return res;
+ }
+
+ res = ES_GetStoredTMDSize(title_id, &tmd_size);
+ if (res < 0) {
+ log_appendf(4, "ES_GetStoredTMDSize() failed: %d", res);
+ return res;
+ }
+
+ if (tmd_size > 4096) {
+ log_appendf(4, "TMD too big: %d", tmd_size);
+ return -EINVAL;
+ }
+
+ res = ES_GetStoredTMD(title_id, tmdbuf, tmd_size);
+ if (res < 0) {
+ log_appendf(4, "ES_GetStoredTMD() failed: %d", res);
+ return -EINVAL;
+ }
+
+ if ((tmdbuf[0x76] & 3) == 3) {
+ return 1;
+ }
+
+ return 0;
+}
+
+const char *osname = "wii";
+
+void wii_sysinit(int *pargc, char ***pargv)
+{
+ DIR_ITER *dir;
+ char *ptr = NULL;
+
+ log_appendf(1, "[Wii] This is IOS%d v%X, and AHBPROT is %s",
+ IOS_GetVersion(), IOS_GetRevision(), _check_ahbprot() > 0 ? "enabled" : "disabled");
+ if (*pargc == 0 && *pargv == NULL) {
+ // I don't know if any other loaders provide similarly broken environments
+ log_appendf(1, "[Wii] Was I just bannerbombed? Prepare for crash at exit...");
+ } else if (memcmp((void *) 0x80001804, "STUBHAXX", 8) == 0) {
+ log_appendf(1, "[Wii] Hello, HBC user!");
+ } else {
+ log_appendf(1, "[Wii] Where am I?!");
+ }
+
+ ISFS_SU();
+ if (ISFS_Initialize() == IPC_OK)
+ ISFS_Mount();
+ fatInit(CACHE_PAGES, 0);
+
+ // Attempt to locate a suitable home directory.
+ if (!*pargc || !*pargv) {
+ // loader didn't bother setting these
+ *pargc = 1;
+ *pargv = malloc(sizeof(char **));
+ *pargv[0] = str_dup("?");
+ } else if (strchr(*pargv[0], '/') != NULL) {
+ // presumably launched from hbc menu - put stuff in the boot dir
+ // (does get_parent_directory do what I want here?)
+ ptr = get_parent_directory(*pargv[0]);
+ }
+ if (!ptr) {
+ // Make a guess anyway
+ ptr = str_dup("sd:/apps/schismtracker");
+ }
+ if (chdir(ptr) != 0) {
+ free(ptr);
+ dir = diropen("sd:/");
+ if (dir) {
+ // Ok at least the sd card works, there's some other dysfunction
+ dirclose(dir);
+ ptr = str_dup("sd:/");
+ } else {
+ // Safe (but useless) default
+ ptr = str_dup("isfs:/");
+ }
+ chdir(ptr); // Hope that worked, otherwise we're hosed
+ }
+ put_env_var("HOME", ptr);
+ free(ptr);
+}
+
+void wii_sysexit(void)
+{
+ ISFS_Deinitialize();
+}
+
+void wii_sdlinit(void)
+{
+ int n, total;
+
+ if (SDL_InitSubSystem(SDL_INIT_JOYSTICK) != 0) {
+ log_appendf(4, "joystick init failed: %s", SDL_GetError());
+ return;
+ }
+
+ total = SDL_NumJoysticks();
+ for (n = 0; n < total; n++) {
+ SDL_Joystick *js = SDL_JoystickOpen(n);
+ if (js == NULL) {
+ log_appendf(4, "[%d] open fail", n);
+ continue;
+ }
+ }
+}
+
+
+static int lasthatsym = 0;
+
+static SDLKey hat_to_keysym(int value)
+{
+ // up/down take precedence over left/right
+ switch (value) {
+ case SDL_HAT_LEFTUP:
+ case SDL_HAT_UP:
+ case SDL_HAT_RIGHTUP:
+ return SDLK_UP;
+ case SDL_HAT_LEFTDOWN:
+ case SDL_HAT_DOWN:
+ case SDL_HAT_RIGHTDOWN:
+ return SDLK_DOWN;
+ case SDL_HAT_LEFT:
+ return SDLK_LEFT;
+ case SDL_HAT_RIGHT:
+ return SDLK_RIGHT;
+ default: // SDL_HAT_CENTERED
+ return 0;
+ }
+}
+
+// Huge event-rewriting hack to get at least a sort of useful interface with no keyboard.
+// It's obviously impossible to provide any sort of editing functions in this manner,
+// but it at least allows simple song playback.
+int wii_sdlevent(SDL_Event *event)
+{
+ SDL_Event newev = {};
+ SDLKey sym;
+
+ switch (event->type) {
+ case SDL_KEYDOWN:
+ case SDL_KEYUP:
+ { // argh
+ struct key_event k = {
+ .mod = event->key.keysym.mod,
+ .sym = event->key.keysym.sym,
+ };
+ event->key.keysym.unicode = kbd_get_alnum(&k);
+ }
+ return 1;
+
+ case SDL_JOYHATMOTION:
+ // TODO key repeat for these, somehow
+ sym = hat_to_keysym(event->jhat.value);
+ if (sym) {
+ newev.type = SDL_KEYDOWN;
+ newev.key.state = SDL_PRESSED;
+ lasthatsym = sym;
+ } else {
+ newev.type = SDL_KEYUP;
+ newev.key.state = SDL_RELEASED;
+ sym = lasthatsym;
+ lasthatsym = 0;
+ }
+ newev.key.which = event->jhat.which;
+ newev.key.keysym.sym = sym;
+ newev.key.type = newev.type; // is this a no-op?
+ *event = newev;
+ return 1;
+
+ case SDL_JOYBUTTONDOWN:
+ case SDL_JOYBUTTONUP:
+ switch (event->jbutton.button) {
+ case 0: // A
+ case 1: // B
+ default:
+ return 0;
+ case 2: // 1
+ if (song_get_mode() == MODE_STOPPED) {
+ // nothing playing? go to load screen
+ sym = SDLK_F9;
+ } else {
+ sym = SDLK_F8;
+ }
+ break;
+ case 3: // 2
+ if (status.current_page == PAGE_LOAD_MODULE) {
+ // if the cursor is on a song, load then play; otherwise handle as enter
+ // (hmm. ctrl-enter?)
+ sym = SDLK_RETURN;
+ } else {
+ // F5 key
+ sym = SDLK_F5;
+ }
+ break;
+ case 4: // -
+ // dialog escape, or jump back a pattern
+ if (status.dialog_type) {
+ sym = SDLK_ESCAPE;
+ break;
+ } else if (event->type == SDL_JOYBUTTONDOWN && song_get_mode() == MODE_PLAYING) {
+ song_set_current_order(song_get_current_order() - 1);
+ }
+ return 0;
+ case 5: // +
+ // dialog enter, or jump forward a pattern
+ if (status.dialog_type) {
+ sym = SDLK_RETURN;
+ break;
+ } else if (event->type == SDL_JOYBUTTONDOWN && song_get_mode() == MODE_PLAYING) {
+ song_set_current_order(song_get_current_order() + 1);
+ }
+ return 0;
+ case 6: // Home
+ event->type = SDL_QUIT;
+ return 1;
+ }
+ newev.key.which = event->jbutton.which;
+ newev.key.keysym.sym = sym;
+ if (event->type == SDL_JOYBUTTONDOWN) {
+ newev.type = SDL_KEYDOWN;
+ newev.key.state = SDL_PRESSED;
+ } else {
+ newev.type = SDL_KEYUP;
+ newev.key.state = SDL_RELEASED;
+ }
+ newev.key.type = newev.type; // no-op?
+ *event = newev;
+ return 1;
+ }
+ return 1;
+}
+
diff --git a/src/sys/wii/schismtracker/icon.png b/src/sys/wii/schismtracker/icon.png
new file mode 100644
index 0000000..ccab9c5
--- /dev/null
+++ b/src/sys/wii/schismtracker/icon.png
Binary files differ
diff --git a/src/sys/wii/schismtracker/meta.xml b/src/sys/wii/schismtracker/meta.xml
new file mode 100644
index 0000000..81a771e
--- /dev/null
+++ b/src/sys/wii/schismtracker/meta.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<app version="1">
+<name>Schism Tracker</name>
+<coder>Storlek</coder>
+<version>hg</version>
+<release_date>YYYYMMDD000000</release_date>
+<short_description>Tracked music editor</short_description>
+<long_description>Schism Tracker is an editor and player for tracked music (IT, XM, S3M, MOD, etc.), heavily based on the look and feel of the DOS program Impulse Tracker.
+</long_description>
+</app>
diff --git a/src/sys/wii/su_tik_bin.h b/src/sys/wii/su_tik_bin.h
new file mode 100644
index 0000000..29f42c8
--- /dev/null
+++ b/src/sys/wii/su_tik_bin.h
@@ -0,0 +1,46 @@
+static unsigned const char su_tik_bin[] = {
+'\000', '\001', '\000', '\001', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000',
+'\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000',
+'\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000',
+'\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000',
+'\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000',
+'\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000',
+'\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000',
+'\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000',
+'\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000',
+'\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000',
+'\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000',
+'\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000',
+'\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000',
+'\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000',
+'\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000',
+'\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000',
+'\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000',
+'\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000',
+'\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000',
+'\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000',
+'\122', '\157', '\157', '\164', '\055', '\103', '\101', '\060', '\060', '\060', '\060', '\060', '\060', '\060', '\061', '\055',
+'\130', '\123', '\060', '\060', '\060', '\060', '\060', '\060', '\060', '\063', '\000', '\000', '\000', '\000', '\000', '\000',
+'\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000',
+'\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000',
+'\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000',
+'\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000',
+'\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000',
+'\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000',
+'\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000',
+'\000', '\000', '\070', '\244', '\122', '\066', '\356', '\137', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\001',
+'\000', '\000', '\000', '\002', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000',
+'\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000',
+'\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000',
+'\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000',
+'\000', '\000', '\377', '\377', '\377', '\377', '\377', '\377', '\377', '\377', '\377', '\377', '\377', '\377', '\377', '\377',
+'\377', '\377', '\377', '\377', '\377', '\377', '\377', '\377', '\377', '\377', '\377', '\377', '\377', '\377', '\377', '\377',
+'\377', '\377', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000',
+'\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000',
+'\000', '\000', '\000', '\021', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000',
+'\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000',
+'\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000',
+'\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000',
+'\000', '\000', '\000', '\000',
+
+};
diff --git a/src/sys/wii/su_tmd_bin.h b/src/sys/wii/su_tmd_bin.h
new file mode 100644
index 0000000..c6ca575
--- /dev/null
+++ b/src/sys/wii/su_tmd_bin.h
@@ -0,0 +1,36 @@
+static unsigned const char su_tmd_bin[] = {
+'\000', '\001', '\000', '\001', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000',
+'\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000',
+'\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000',
+'\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000',
+'\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000',
+'\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000',
+'\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000',
+'\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000',
+'\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000',
+'\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000',
+'\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000',
+'\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000',
+'\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000',
+'\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000',
+'\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000',
+'\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000',
+'\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000',
+'\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000',
+'\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000',
+'\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000',
+'\122', '\157', '\157', '\164', '\055', '\103', '\101', '\060', '\060', '\060', '\060', '\060', '\060', '\060', '\061', '\055',
+'\103', '\120', '\060', '\060', '\060', '\060', '\060', '\060', '\060', '\064', '\000', '\000', '\000', '\000', '\000', '\000',
+'\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000',
+'\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000',
+'\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\001',
+'\000', '\000', '\000', '\002', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000',
+'\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000',
+'\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000',
+'\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000',
+'\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\001',
+'\000', '\000', '\000', '\015', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000',
+'\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000',
+'\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000',
+
+};
© All Rights Reserved