oric-international / oric-tools

8 stars 3 forks source link

MacOS version of TAP2WAV #4

Closed 0ddjob closed 1 month ago

0ddjob commented 1 month ago

Hi, I got your TAP2WAV.C to compile on macOS Sonoma 14.5 by making some minor adjustments (you can find them with "BH" comments). Attached is the modified C-source and also compiled binary. I noticed that you must use -R option otherwise it gets stuck in a loop. Of course, could try to troubleshoot that but it's working fine for me using the -R option.

I tested the resulting WAV files by loading on to my Праветц 8Д (Pravetz 8D) - they loaded without issue. /Brett.


For interest, these were the initial errors when trying to compile on MacOS with clang:

ERROR 1

tap2wav.c:87:1: error: type specifier missing, defaults to 'int'; ISO C99 and later do not support implicit int [-Wimplicit-int] init(int argc, char *argv[]) ^ int

ERROR 2

tap2wav.c:92:9: error: call to undeclared library function 'strcmp' with type 'int (const char , const char )'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] if (strcmp(argv[i],"-8")==0) speed=8000; ^ tap2wav.c:92:9: note: include the header or explicitly provide a declaration for 'strcmp'

ERROR 3

tap2wav.c:94:11: error: call to undeclared function 'stricmp'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] else if (stricmp(argv[i],"-R")==0) raw_mode=1; ^

ERROR 4

tap2wav.c:114:1: error: type specifier missing, defaults to 'int'; ISO C99 and later do not support implicit int [-Wimplicit-int] main(int argc,char *argv[]) ^ int

ERROR 5

tap2wav.c:124:5: error: call to undeclared library function 'exit' with type 'void (int) attribute((noreturn))'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] exit(1); ^ tap2wav.c:124:5: note: include the header or explicitly provide a declaration for 'exit'

ERROR 6

tap2wav.c:164:2: error: expected '}' } ^ tap2wav.c:115:1: note: to match this '{' { ^ 6 errors generated. tap2wav_macos.zip

norayr commented 1 month ago

oh, thank you so much!

your changes work on linux or windows too, right? wouldn't you be interested instead of attaching a file to make a pull request and then we will have the better history of commits, with descriptions which commit solves which issue?

0ddjob commented 1 month ago

Oh, of course, I can try that - never done a PULL request before. At the moment it probably won't compile for Windows ... would need to add a compiler directive I guess for this line ... if compiling on Windows then use the "stricmp" line, otherwise if compiling on Linux/MacOS then use the "strcasecmp" line:

  else if (strcasecmp(argv[i],"-R")==0) raw_mode=1; /* BH MacOS */
/*  else if (stricmp(argv[i],"-R")==0) raw_mode=1;     BH Windows */

I'll do a little bit more work on it and try the PULL request. BTW, I made a video here where I loaded the generated WAV files onto my Pravetz with no issue: https://youtu.be/2S4YCyEtwn8

Brett.

norayr commented 1 month ago

yeah, that would be great. you'll get the credit, and we'll have the commit history - this commit fixes this issue, that commit - that issue. (:

norayr commented 1 month ago

oh, so pity pulsoids didn't work. i also have pravetz and i had a hope to run pulsoids on it one day.

norayr commented 1 month ago

i enjoyed your video.

i have a bulgarian vesion of same pacman here: https://norayr.am/RetroComputing/Oric/old/homepage/bulgarian_games.html it is called dos adaptation for some reason, and there the language issue is fixed.

0ddjob commented 1 month ago

Oh wow - I was hoping to find some Bulgarian software for the machine - thanks for sharing! I'll try them out.