C-like compiler with devkit?
Moderator: Moderators
Forum rules
- For making cartridges of your Super NES games, see Reproduction.
C-like compiler with devkit?
I was thinking of making a devkit with a C-like compiler for SNES but with some slightly different syntax to be able to optimize some of the low level like short vs long pointers.
I'm also curious as to what people expect from the code's syntax. How similar to C should it be? Is there something you wish was supported at a high level language? What features should the devkit have built-in?
My personal goals for the devkit:
- Automatic convertion of PNG files for tile map, tile chars and sprite sheet
- Automatic convertion of WAV files
- Static and dynamic VRAM allocation for BG and sprite chars
- BRR files streaming from ROM (done)
- Music player supporting common audio formats
- Multi-threading (done)
- Object oriented with garbage collection (almost done)
I have already made an attempt at a compiler but I'm going to rebuild parts of it for the new one.
I'm also curious as to what people expect from the code's syntax. How similar to C should it be? Is there something you wish was supported at a high level language? What features should the devkit have built-in?
My personal goals for the devkit:
- Automatic convertion of PNG files for tile map, tile chars and sprite sheet
- Automatic convertion of WAV files
- Static and dynamic VRAM allocation for BG and sprite chars
- BRR files streaming from ROM (done)
- Music player supporting common audio formats
- Multi-threading (done)
- Object oriented with garbage collection (almost done)
I have already made an attempt at a compiler but I'm going to rebuild parts of it for the new one.
Re: C-like compiler with devkit?
My only recommendation.
Have an asm library for communication with the hardware registers. Especially with DMA transfers.
As for high level syntax. It doesn't much matter as long as it compiles to correct code.
Have an asm library for communication with the hardware registers. Especially with DMA transfers.
As for high level syntax. It doesn't much matter as long as it compiles to correct code.
nesdoug.com -- blog/tutorial on programming for the NES
-
- Posts: 1565
- Joined: Tue Feb 07, 2017 2:03 am
Re: C-like compiler with devkit?
probably better of porting Kick-C to 65816, as it already does what you want but is designed for optimal 6502. Or filling out the 65816 support of MillFork.
C has long and short pointers, hence MS stuff is now LPSTR = Long Pointer STRing. but they are normally implemented as near and far pointers ( implementation specific ) so you have
but nobody has needed this since the 286 so most compilers don't support it anymore. The WDC C compiler might still have it though.
what are you converting wav into?
C has long and short pointers, hence MS stuff is now LPSTR = Long Pointer STRing. but they are normally implemented as near and far pointers ( implementation specific ) so you have
Code: Select all
int* pDefaultPointer;
int far * pLargePointer;
int near * pShortPointer;
what are you converting wav into?
Re: C-like compiler with devkit?
I honestly don't know what it needs, but, as someone who's used stuff like GameMaker (old versions before Studio) and Unity in the past to make some games and do some tests, if the coding part was something along the same lines as that kind of thing, I'd at least be able to use it myself to some degree. And, above anything else, I actually want to be able to use it. I think there's probably a lot of aspiring SNES developers in a similar boat, just waiting for something that's as user-end friendly as that kind of stuff to come along so they can try their hand at making their own SNES games. Whatever way you go, I wish you the very best.
- Individualised
- Posts: 310
- Joined: Mon Sep 05, 2022 6:46 am
Re: C-like compiler with devkit?
The problem is with that approach you'll end up with pretty limited capabilities. You'd essentially end up with a SNESmaker. Not really good for making games unless you're only interested in making simple games, and not really good for learning how to program the target system as everything is so abstracted.SNES AYE wrote: ↑Mon Apr 24, 2023 10:46 am I honestly don't know what it needs, but, as someone who's used stuff like GameMaker (old versions before Studio) and Unity in the past to make some games and do some tests, if the coding part was something along the same lines as that kind of thing, I'd at least be able to use it myself to some degree. And, above anything else, I actually want to be able to use it. I think there's probably a lot of aspiring SNES developers in a similar boat, just waiting for something that's as user-end friendly as that kind of stuff to come along so they can try their hand at making their own SNES games. Whatever way you go, I wish you the very best.
____
I'd love to see this happen, especially if it happens for NES as well (I know there's now NESFab).
Re: C-like compiler with devkit?
Is there a particular reason why a new SNES game creation devkit or tool can't cater to both more casual game makers who just want to make something simple and the more hardcore game makers who want to code stuff down to the lowest level and push the system to its limits?Individualised wrote: ↑Mon Apr 24, 2023 11:13 amThe problem is with that approach you'll end up with pretty limited capabilities. You'd essentially end up with a SNESmaker. Not really good for making games unless you're only interested in making simple games, and not really good for learning how to program the target system as everything is so abstracted.SNES AYE wrote: ↑Mon Apr 24, 2023 10:46 am I honestly don't know what it needs, but, as someone who's used stuff like GameMaker (old versions before Studio) and Unity in the past to make some games and do some tests, if the coding part was something along the same lines as that kind of thing, I'd at least be able to use it myself to some degree. And, above anything else, I actually want to be able to use it. I think there's probably a lot of aspiring SNES developers in a similar boat, just waiting for something that's as user-end friendly as that kind of stuff to come along so they can try their hand at making their own SNES games. Whatever way you go, I wish you the very best.
____
I'd love to see this happen, especially if it happens for NES as well (I know there's now NESFab).
I don't know about NESmaker, but I would hope that's actually an option there. And, if it doesn't exist there, then I guess a SNESmaker with exactly that additional level of optional functionality is exactly what I'd like to see in an ideal scenario.
But, honestly, for now I'd personally be happy to have the simple high-level SNESmaker-like tool over the alternative if it just means more people can get into SNES development in general, including myself. I'd actually consider that a big and valuable step forward from where things are at currently.
Re: C-like compiler with devkit?
100% agree with you.
WAV to BRR and into a format compatible to my HDMA transfer code to ARAM.
This is going to be more casual than pure assembly and can be used to push limits though other tools are already better at that.SNES AYE wrote: ↑Mon Apr 24, 2023 1:35 pm Is there a particular reason why a new SNES game creation devkit or tool can't cater to both more casual game makers who just want to make something simple and the more hardcore game makers who want to code stuff down to the lowest level and push the system to its limits?
-
- Posts: 1565
- Joined: Tue Feb 07, 2017 2:03 am
Re: C-like compiler with devkit?
what are you going to use to sequence the samples?
-
- Posts: 1565
- Joined: Tue Feb 07, 2017 2:03 am
Re: C-like compiler with devkit?
there is also https://lemonspawn.com/turbo-rascal-syn ... but-begin/ which says it has SNES support, might be able to expand and improve the SNES support for it?
edit : Fixed the link
edit : Fixed the link
Last edited by Oziphantom on Tue Apr 25, 2023 7:28 am, edited 1 time in total.
Re: C-like compiler with devkit?
I made my own from scratch, I haven't made it public because I'm using Warcraft II sound effects and music for the demo. The music is just a >1MB BRR file.
Data rate is 832 bytes per frame in 224p (49920 bytes per 60 frames). This is enough to stream 8 channels at 11025 Hz but there's a small issue preventing full transfer all the time, the audio files that I use for my demo lose about 1/16 of the transfer rate to this issue.
Sorry, I'm not sure I fully understand your question.
"Oops! That page can’t be found."Oziphantom wrote: ↑Tue Apr 25, 2023 4:20 am there is also https://lemonspawn.com/turbo-rascal-syn ... egin/which says it has SNES support, might be able to expand and improve the SNES support for it?
-
- Posts: 1565
- Joined: Tue Feb 07, 2017 2:03 am
Re: C-like compiler with devkit?
fixed the link.
- NovaSquirrel
- Posts: 483
- Joined: Fri Feb 27, 2009 2:35 pm
- Location: Fort Wayne, Indiana
- Contact:
Re: C-like compiler with devkit?
I think that because this compiler would be specifically for game dev, it could help a lot to natively support a concept of a "this" pointer/index. In my experience a lot of game code ends up involving a list of entities, and I've seen cc65 repeatedly load the same "current entity" value into an index register when handwritten assembly would have gone for just keeping it in X or Y. So "this" or some other means of communicating that you want to operate on the same object across a chunk of code sounds really helpful.
I also want to point out the strategy of using an index register as a pointer, instead of as an index since it's not obvious, and it has some speed and code size benefits.
As for friendlier, simpler tools, I feel like a good compiler actually helps a lot with those goals too, because then those sorts of tools can generate code for a higher level language instead of directly being tasked with generating assembly, and that sounds like it'd reduce the effort needed for making a tool like that.
I also want to point out the strategy of using an index register as a pointer, instead of as an index since it's not obvious, and it has some speed and code size benefits.
As for friendlier, simpler tools, I feel like a good compiler actually helps a lot with those goals too, because then those sorts of tools can generate code for a higher level language instead of directly being tasked with generating assembly, and that sounds like it'd reduce the effort needed for making a tool like that.
Re: C-like compiler with devkit?
I'm absolutely doing the "this" pointer. Also the ability to force passing arguments in certain registers.
What do you think of the following? "Something" should result in a 1-liner in assembly.
What do you think of the following? "Something" should result in a 1-liner in assembly.
Code: Select all
RegY Class Player : iEntity
{
u16 SomeValue;
void Something(RegA u16 value)
{
this.SomeValue = value;
}
}