Search found 71 matches

by DarkSchneider
Thu Jun 15, 2023 8:55 am
Forum: Bug reports
Topic: #ifndef/#define/#endif not working on z80asm if called multiple times
Replies: 3
Views: 1495

Re: #ifndef/#define/#endif not working on z80asm if called multiple times

All the other #define with values within the header works without any issue of duplicated.
by DarkSchneider
Thu Jun 15, 2023 8:48 am
Forum: Bug reports
Topic: #ifndef/#define/#endif not working on z80asm if called multiple times
Replies: 3
Views: 1495

#ifndef/#define/#endif not working on z80asm if called multiple times

I have a base define header with typical: #ifndef MEMMAPPER_DEFS_H_ #define MEMMAPPER_DEFS_H_ ... #endif Then have another 2 that uses it: #ifndef MEMMAPPER_TABLE_ASM_ #define MEMMAPPER_TABLE_ASM_ include "memmapper_defs.h" ... #endif #ifndef MEMMAPPER_INFO_ASM_ #define MEMMAPPER_INFO_ASM_...
by DarkSchneider
Sat Jun 10, 2023 2:33 pm
Forum: Feature Requests
Topic: Creating library documentation needs an update
Replies: 15
Views: 4574

Re: Creating library documentation needs an update

Is there some way to do the library get a #define value at linking with no need to recompile it? Probably not as it should be a binary for linking, but is worth to ask. As solution I could create a script to recompile the libraries and getting the defined -DVALUE=xx in compilation sentence, but if i...
by DarkSchneider
Sat Jun 10, 2023 10:27 am
Forum: Bug reports
Topic: zcc -I path not used by z80asm
Replies: 2
Views: 1265

Re: zcc -I path not used by z80asm

OK now is working. Thanks.
by DarkSchneider
Sat Jun 10, 2023 8:09 am
Forum: Feature Requests
Topic: z80asm add C line comment style
Replies: 1
Views: 1347

Re: z80asm add C line comment style

OK just realized, for those with the same problem, just put a semicolon at start of the line, so in your common C header file:

Code: Select all

;//your comment
#ifndef SOMETHING
#define SOMETHING 33
#endif
And works.
by DarkSchneider
Sat Jun 10, 2023 8:05 am
Forum: Feature Requests
Topic: z80asm add C line comment style
Replies: 1
Views: 1347

z80asm add C line comment style

I am trying to unify my definition files to avoid duplicating, it works well since z80asm included others C style directives, like #ifndef. The issue is that cannot put comments, because C uses // or *//*. It could be nice if at least z80asm would suppport one of them to be able to comment the commo...
by DarkSchneider
Sat Jun 10, 2023 8:03 am
Forum: Bug reports
Topic: zcc -I path not used by z80asm
Replies: 2
Views: 1265

zcc -I path not used by z80asm

https://github.com/z88dk/z88dk/wiki/Tool---z80asm---directives#include-filename INCLUDE "filename" Include the given file in the current assembly position. The file is searched in the path pointed by the -IPATH options. Detects and reports an attempt to recursively include the same file. ...
by DarkSchneider
Fri Jun 09, 2023 4:56 pm
Forum: Feature Requests
Topic: Creating library documentation needs an update
Replies: 15
Views: 4574

Re: Creating library documentation needs an update

It's been suggested that we get rid of it since it's not really needed anymore. However, it does still serve one useful purpose which is to distinguish between the entry points for variadic functions for the two compilers. OK so for normal functions is not more required. About the 2nd sentence, not...
by DarkSchneider
Fri Jun 09, 2023 3:59 pm
Forum: Feature Requests
Topic: Creating library documentation needs an update
Replies: 15
Views: 4574

Re: Creating library documentation needs an update

To be more precise, in both cases using or not using __LIB__ qualifer the binary is the same size, so probably the linker (that is z88dk-z80asm) already included in its linking process its new method to create libs.
But an official confirmation would be preferable, of course.
by DarkSchneider
Fri Jun 09, 2023 3:43 pm
Forum: Feature Requests
Topic: Creating library documentation needs an update
Replies: 15
Views: 4574

Re: Creating library documentation needs an update

Well made my first library. Now it has changed, starting with the own z80asm: https://github.com/z88dk/z88dk/wiki/Tool---z80asm ... as librarian z88dk-z80asm -xlibrary.lib [options] file... When called with the -x option, z80asm builds a library containing all the object files passed as argument. Th...
by DarkSchneider
Wed May 31, 2023 7:36 am
Forum: Feature Requests
Topic: Creating library documentation needs an update
Replies: 15
Views: 4574

Re: Creating library documentation needs an update

Yes that is what I do also, but not tested yet with own library functions. Seems then that if declaring with typedef it uses the correct calling at compile time even if function pointer.
by DarkSchneider
Tue May 30, 2023 12:58 pm
Forum: Feature Requests
Topic: Creating library documentation needs an update
Replies: 15
Views: 4574

Re: Creating library documentation needs an update

But from a library made by yourself?

The z88dk included ones can use the trick indicated at link, that is using a wrapper, which I’d prefer to avoid.
by DarkSchneider
Sun May 28, 2023 1:20 pm
Forum: Feature Requests
Topic: sccz80 allow return 8-bit values in L register
Replies: 12
Views: 3170

Re: sccz80 allow return 8-bit values in L register

I am in the side of reading the returning value. And yes inserting LD H, 0 is what actually does, which is not a concern for me, if it was made by that way. I have no intention for having to rewrite all library functions to a new calling convention. I was interested in that if a function returns an ...
by DarkSchneider
Sun May 28, 2023 7:51 am
Forum: Feature Requests
Topic: Creating library documentation needs an update
Replies: 15
Views: 4574

Re: Creating library documentation needs an update

Well, with the main code already "finished" (only requiring some final attunement) it's time to split it into individual parts to allow smaller binary linking only the required. Let's say I have this folder structure: root | |-src | |-test I am compiling from test folder. Looking at docume...
by DarkSchneider
Sun May 28, 2023 7:23 am
Forum: Feature Requests
Topic: sccz80 allow return 8-bit values in L register
Replies: 12
Views: 3170

Re: sccz80 allow return 8-bit values in L register

Could be done probably applying an autocasting to the function returning type. I think a compiler option to do that for 8-bit returning values could do the trick. Casting works nice and no matter if the functions uses HL or only L for returning values, as the issue is later when the compiled code r...
by DarkSchneider
Sat May 27, 2023 7:33 am
Forum: Feature Requests
Topic: sccz80 allow return 8-bit values in L register
Replies: 12
Views: 3170

Re: sccz80 allow return 8-bit values in L register

Notice we lose extra registers if using 16-bit. Depending the situation the backup could be done in A and use DE for the check itself. Using __z88dk_sdccdecl could be used but better from the start, so don't requiring to rewrite so many functions for correctly reading parameters. Currently what I do...
by DarkSchneider
Wed May 24, 2023 10:58 am
Forum: Feature Requests
Topic: sccz80 allow return 8-bit values in L register
Replies: 12
Views: 3170

Re: sccz80 allow return 8-bit values in L register

Or if you mean for reading the returning value (instead the generated code), then yes use it as 0 or simply ignore. Could be done probably applying an autocasting to the function returning type.
by DarkSchneider
Wed May 24, 2023 10:43 am
Forum: Feature Requests
Topic: sccz80 allow return 8-bit values in L register
Replies: 12
Views: 3170

Re: sccz80 allow return 8-bit values in L register

stefano wrote: Wed May 24, 2023 10:28 am In short, you're expecting sccz80 to force h to zero, right?
The opposite. It actually forces to zero because __smallc calling convention uses it. I'd like to be able to use only L as return value, ignoring H.
by DarkSchneider
Wed May 24, 2023 10:13 am
Forum: Feature Requests
Topic: sccz80 allow return 8-bit values in L register
Replies: 12
Views: 3170

Re: sccz80 allow return 8-bit values in L register

This issue https://github.com/z88dk/z88dk/issues/2264 And according to __smallc calling convention, it uses HL, probably that's why I had issues when using only L for a bool return value and reading without manual casting. So seems an issue about reading the value, that the compiler assumes using HL...
by DarkSchneider
Tue May 23, 2023 2:59 pm
Forum: Feature Requests
Topic: sccz80 allow return 8-bit values in L register
Replies: 12
Views: 3170

sccz80 allow return 8-bit values in L register

I had the issue returning 8-bit values (like bool) in L not read properly by the caller, until someone noticed me that __smallc uses only HL or DEHL. It would be good if we could return 8-bit values using only L register, so the asm code could be more consistent to use with sccz80 or sdcc. Also some...
by DarkSchneider
Mon May 01, 2023 1:15 pm
Forum: Misc
Topic: Passing function params via registers
Replies: 9
Views: 2308

Re: Passing function params via registers

I recently found the intrinsic, that allow to load and store 16 bit values from/to address. Also the ones to return values using other registers. Is not worth to change all the library, then maybe it could be achieved adding intrinsic, these are the ones to load values (instead passing address) into...
by DarkSchneider
Sun Apr 30, 2023 1:05 pm
Forum: Amstrad
Topic: CPC Maths working again
Replies: 19
Views: 9498

Re: CPC Maths working again

You are my hero :)

I am at mobile I’ll take it a look tomorrow. Some reference to documentation or is integrated as native type?
by DarkSchneider
Fri Apr 28, 2023 9:34 am
Forum: Amstrad
Topic: CPC Maths working again
Replies: 19
Views: 9498

Re: CPC Maths working again

I think there is already a 8.8 library available somewhere, even if I have never used it. I do think it would be useful though, and I am guessing that Churrera is using something similar, because they have accerleration and therefore fixed point coordinates. It would depends on how good it is befor...
by DarkSchneider
Thu Apr 27, 2023 12:26 pm
Forum: Amstrad
Topic: CPC Maths working again
Replies: 19
Views: 9498

Re: CPC Maths working again

I you ask me IMHO a Fixed Point library would be a great addition. Very used for games and in format Q8.8 fits nicely in the Z80. You operate with a vector Q8.8 for iteration movement and then “apply” the integer part to your (unsigned) integer vector x,y for the integer positions of elements, prese...