-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding examples to this repo #37
Comments
This is definitely a good idea. I would say good example source files are 20 to 50 lines of code but if some topic needs more lines of course it'll be more. |
Do you have a preference or ideas for the directory structure? Here is my suggestion: examples/ For complete examples that can be compiled resulting in a working ROM, I would use the following structure: examples/name/main.c The makefiles could assume the required tools (sdcc, ihx2hex, makesms, assets2banks) is in the path. |
I wonder if it's worth having an additional folder under examples/ for the different systems, such as
or if we could just add -gg or -sg to the example name when it's a GameGear or SG-1000 specific example. Also SG-1000 is using a different library altogether... mmm... I don't know, I've got to think about it. 🤔 Maybe have separate example folders under each library directory so that the examples refer to the usage of that specific library?
|
I think adding an additional layer of folders for each system is nice, the only drawback it that it leads to some duplication. For instance, many examples will compile at least for SMS and GG. For the simple hello world example I intend to begin with, that would mean two identical files, one under sms/ and the other under gg/... But that's not the end of the world. As for placing examples under the library directory, I thought about it but I did not like it, as this makes less sense for examples also using other libraries, such as PSGlib. Because depending on the subject, you then have to think where the example fits best. For instance, a basic SMS/GG playback example for PSGlib could fit well under PSGlib/ I guess, but then imagine a more complex example demonstrating the use of the vblank hook to play music in the background. Would this go under SMSlib since the focus is not really PSGlib? Also consider an example using assets2banks demonstrating how to handle a multi-bank resource. Should this be considered an SMSlib example? Or should it live in an assets2banks/examples directory? With an examples/ directory at the root, no need to think about all this. I guess one way to see it is that this is going to be a collection of devkitSMS examples rather than SMSlib/PSGlib examples, which is why the examples/ directory would belong to the root of the project. And as a user discovering devkitSMS, I imagine I would prefer all examples in one place, so I can see quickly what's available. |
What if we start simple with an example folder with examples in there and naming them with some suffix in case it's a system specific example and no suffix if the example is for both sms and gg? Say Also, I hate hello world examples where there's just one |
I'm reviving this issue because I'm (trying to) add more examples to the repository, but I'm not very good at makefile-fu 🙄 Any idea about how to add the call to Anyway I know you can instruct
but I don't know how to generalize this recipe (if it's possible) in the way you did with the two examples already in the repository. Can you help me? 😅 |
Adding example for sglib would be great |
I was wondering what you would think of adding an examples/ directory to the root of the repo, where examples and demos using different devkitSMS features could be added? I notice there is no such thing, so maybe you prefer to have this elsewhere?
For instance, when contributing new features, I often make a simple program to test it but there is no good place to share it right now. I think it would make sense to have examples here, those could also be an easy starting point for new projects.
The text was updated successfully, but these errors were encountered: