Forums

Sega Master System / Mark III / Game Gear
SG-1000 / SC-3000 / SF-7000 / OMV
Home - Forums - Games - Scans - Maps - Cheats - Credits
Music - Videos - Development - Hacks - Translations - Homebrew

View topic - Loading assets playing music

Reply to topic Goto page Previous  1, 2
Author Message
  • Joined: 17 Nov 2015
  • Posts: 97
  • Location: Canada
Reply with quote
Post Posted: Tue Sep 05, 2017 3:45 pm
sverx wrote

edit: rel format isn't so complicated, new feature is on the way :)


Maybe an option to output asm instead of c too? z88dk doesn't use asz80 so rel format is not supported but an asm file is very quickly assembled and would achieve the same purpose as well as make asset2banks compatible with other assemblers.
  View user's profile Send private message Visit poster's website
  • Joined: 05 Sep 2013
  • Posts: 3770
  • Location: Stockholm, Sweden
Reply with quote
Post Posted: Tue Sep 05, 2017 4:10 pm
I've got to think if it'd be really useful, as of course it wouldn't help eruiz00 (as every asm file would be re-generated, make would then call the assembler for each of them) and also because I actually don't see the point, as any C compiler won't take much longer processing such a file than an assembler a respective asm file...
  View user's profile Send private message Visit poster's website
  • Joined: 17 Nov 2015
  • Posts: 97
  • Location: Canada
Reply with quote
Post Posted: Tue Sep 05, 2017 4:30 pm
sverx wrote
I've got to think if it'd be really useful,


Yes you could use it for asm projects too for people not interested in using c tools.

Quote
also because I actually don't see the point, as any C compiler won't take much longer processing such a file than an assembler a respective asm file...


It makes a difference in z88dk because the asm generated by sdcc has to be translated to more standard form for z80asm. It just so happens that asz80/sdcc needs # in front of every constant and that's been deprecated for z80asm so we do a translation of that to + using a regular expression engine. There are a lot of # in files like these and the translation step is slow for these files because the process is not a simple replace.

There is a trick if the files only contain data - use sccz80 instead of zsdcc to compile them to objects then there is no translation step.

Eg, from this:


zcc +sms -v -c -clib=sdcc_iy --constsegBANK_02 src/bank2.c -o ./bank2.o


to this:


zcc +sms -v -c -clib=new --constsegBANK_02 src/bank2.c -o ./bank2.o


But otherwise getting the data in asm form means the asm step is very quick.
  View user's profile Send private message Visit poster's website
  • Joined: 28 Jan 2017
  • Posts: 551
  • Location: Málaga, Spain
Reply with quote
Post Posted: Tue Sep 05, 2017 4:41 pm
Ummmm...

Ill do a tool which check the output from assets2banks and copy if needed. Should be made in half an hour!

Although, if asm is quickly compiled, should be ideal :)

But, i mean, i think the file check itself is not a bad idea, as, by example, i have fixed data using half bank 14,compiling a custom c file which include bank14.c, and full bank 15, so for bank14, i have to do a .c compilation yes or yes.
  View user's profile Send private message
  • Joined: 05 Sep 2013
  • Posts: 3770
  • Location: Stockholm, Sweden
Reply with quote
Post Posted: Tue Sep 05, 2017 7:07 pm
eruiz00 wrote
Ill do a tool which check the output from assets2banks and copy if needed. Should be made in half an hour!


if you do a batch file using fc and copy if the compare fails, it'll take one minute

fc /b  %1  %2
if %errorlevel% NEQ 0 copy %1 %2


@AA: I don't get it :| With asm I should be able to binary include data directly, so what's the point? The 'auto' management of assets? Superfree sections! :D
  View user's profile Send private message Visit poster's website
  • Joined: 28 Jan 2017
  • Posts: 551
  • Location: Málaga, Spain
Reply with quote
Post Posted: Tue Sep 05, 2017 7:48 pm
Good idea!
Btw... you have failed... check your email!
  View user's profile Send private message
  • Joined: 28 Jan 2017
  • Posts: 551
  • Location: Málaga, Spain
Reply with quote
Post Posted: Wed Sep 06, 2017 5:19 am
Have to say that a point which i did not though is the bank dependencies from src files. Is impossible to track them, having to compile all files if banks change (for a make system).

I only see two solutions. An intermediate table of pointers, in last bank , for example (having to recompile that bank always) or a fixed banks structure (like astroforce, but this is a back pass)
  View user's profile Send private message
  • Joined: 05 Sep 2013
  • Posts: 3770
  • Location: Stockholm, Sweden
Reply with quote
Post Posted: Wed Sep 06, 2017 7:53 am
eruiz00 wrote
Btw... you have failed... check your email!


LOL. Don't derail this topic. And you're wrong BTW :p
  View user's profile Send private message Visit poster's website
  • Joined: 05 Sep 2013
  • Posts: 3770
  • Location: Stockholm, Sweden
Reply with quote
Post Posted: Wed Sep 06, 2017 9:21 am
newer assets2banks just released :)

to create RELs directly, instead of C files that you need to compile yourself, add
--compile
to the command line.

so in your makefile you'll probably have to put dependencies from RELs to what's in your asset folder. I'm not good at all with makefiles so I really can't help you much :|
  View user's profile Send private message Visit poster's website
  • Joined: 28 Jan 2017
  • Posts: 551
  • Location: Málaga, Spain
Reply with quote
Post Posted: Wed Sep 06, 2017 11:34 am
Ummm...
Sorry then, i am a formalist!!!
  View user's profile Send private message
  • Joined: 05 Sep 2013
  • Posts: 3770
  • Location: Stockholm, Sweden
Reply with quote
Post Posted: Wed Sep 06, 2017 1:07 pm
I don't get what you mean. Didn't you solve your problem this way?
  View user's profile Send private message Visit poster's website
  • Joined: 17 Nov 2015
  • Posts: 97
  • Location: Canada
Reply with quote
Post Posted: Thu Sep 07, 2017 5:53 am
sverx wrote

@AA: I don't get it :| With asm I should be able to binary include data directly, so what's the point? The 'auto' management of assets? Superfree sections! :D


I thought the auto management of assets was the point of assets2banks? In sdcc you can just create .s files, include binary data and assign to areas too?

Quote

I don't get what you mean. Didn't you solve your problem this way?


If any of the binary data moves or changes size, the entire project may have to recompile because addresses change.
  View user's profile Send private message Visit poster's website
  • Joined: 05 Sep 2013
  • Posts: 3770
  • Location: Stockholm, Sweden
Reply with quote
Post Posted: Thu Sep 07, 2017 7:59 am
Alcoholics Anonymous wrote
I thought the auto management of assets was the point of assets2banks? In sdcc you can just create .s files, include binary data and assign to areas too?


don't know if you can do that with asm in SDCC, but you can do that in asm with WLA-DX, and I suspect with other assemblers too - so I still don't get the point of creating .s files so that you can assemble them to object files when you can get the object files directly.

Alcoholics Anonymous wrote
If any of the binary data moves or changes size, the entire project may have to recompile because addresses change.


With the new assets2banks feature, you won't need to recompile the assets, just the sources referencing them (those who need the .h files) and call the linker at the end, which you would do anyway. I think there's no other option as assets placement into banks may change at any time (you might add an asset, modify one of them changing its size, remove one...). Some spot-on scripts such as the one I provided before might address the 'no header file changes whatsoever' case, but that's a really rare case IMHO.
  View user's profile Send private message Visit poster's website
  • Joined: 17 Nov 2015
  • Posts: 97
  • Location: Canada
Reply with quote
Post Posted: Mon Sep 11, 2017 4:00 pm
Last edited by Alcoholics Anonymous on Mon Sep 11, 2017 5:13 pm; edited 1 time in total
sverx wrote
Alcoholics Anonymous wrote
In sdcc you can just create .s files, include binary data and assign to areas too?

don't know if you can do that with asm in SDCC,


You can mix asm and c easily in sdcc. C can reference asm data with a suitable extern declaration.

A very basic example that mixes asm and c (but the only interaction between the two is happening through functions defined in a library header file):

https://github.com/z88dk/z88dk/tree/master/libsrc/_DEVELOPMENT/EXAMPLES/benchmar...

I'm a bit surprised that asz80 can't include a binary file or at least it looks that way from the online docs?

Quote

but you can do that in asm with WLA-DX, and I suspect with other assemblers too - so I still don't get the point of creating .s files so that you can assemble them to object files when you can get the object files directly.


The object file only works with asz80 whereas an asm file can work with everything.
  View user's profile Send private message Visit poster's website
  • Joined: 28 Jan 2017
  • Posts: 551
  • Location: Málaga, Spain
Reply with quote
Post Posted: Mon Sep 11, 2017 4:40 pm
Ummmm... for this moment, i have dropped sdcc compiling for the game. I am far away in source code size while z88dk keeps under max on 500 bytes, and i have not finished!
  View user's profile Send private message
Reply to topic Goto page Previous  1, 2



Back to the top of this page

Back to SMS Power!