English Amiga Board


Go Back   English Amiga Board > Search Forums

Showing results 1 to 40 of 509
Search took 0.04 seconds.
Search: Posts Made By: bebbo
Forum: Coders. C/C++ Yesterday, 08:46
Replies: 7
Views: 212
Posted By bebbo
I recommend using -libnix aka -mcrt=nix20 instead...

I recommend using -libnix aka -mcrt=nix20 instead of clib2.







use the prefixed programs in $PREFIX/bin -> $PREFIX/bin/m68k-amigaos-nm
Forum: Coders. C/C++ 11 April 2021, 20:42
Replies: 15
Views: 695
Posted By bebbo
use <number>$ for local labels: void...

use <number>$ for local labels:


void foo() {
asm("1$:");
asm("bra 1$");
}
void faa() {
asm("1$:");
asm("bra 1$");
Forum: Coders. C/C++ 17 March 2021, 08:28
Replies: 1,275
Views: 187,060
Posted By bebbo
http://eab.abime.net/data:text/plain;base64,LyoqCi...

http://eab.abime.net/data:text/plain;base64,LyoqCiAqIFNrZWxldG9uIGZvciBsaWJyYXJpZXMuCiAqLwoKI2luY2x1ZGUgPGV4ZWMvbGlicmFyaWVzLmg+CiNpbmNsdWRlIDxleGVjL25vZGVzLmg+CiNpbmNsdWRlIDxleGVjL3Jlc2lkZW50Lmg+CiNp...
Forum: Coders. C/C++ 16 March 2021, 12:04
Replies: 1,275
Views: 187,060
Posted By bebbo
it's not related to the toolchain - but why do so...

it's not related to the toolchain - but why do so many people use -fbaserel to create libraries, if you could store all your data in your library via a6?
Forum: Coders. C/C++ 15 March 2021, 15:07
Replies: 1,275
Views: 187,060
Posted By bebbo
I recommend using WSL to compile and debug. I...

I recommend using WSL to compile and debug. I even run Eclipse to develop C/C++ within WSL.
You find all your windows drives at /mnt/c etc.p.p. so if you open a WSL bash you can cd and make also on...
Forum: Coders. C/C++ 14 March 2021, 18:55
Replies: 15
Views: 695
Posted By bebbo
use the mangled names to refer to these. ...

use the mangled names to refer to these.

e.g.

bsr __Z3fooi

to call the C++ function

int foo(int);
Forum: Coders. C/C++ 14 March 2021, 18:55
Replies: 15
Views: 695
Posted By bebbo
m68k-amigaos-as does not need the percent sign...

m68k-amigaos-as does not need the percent sign for registers. The tradeoff is: you can't use symbols having register names.
Forum: Coders. C/C++ 14 March 2021, 18:53
Replies: 1,275
Views: 187,060
Posted By bebbo
plus I recommend using WSL instead of msys2 or...

plus I recommend using WSL instead of msys2 or cygwin!


https://franke.ms/amiga/wsl2.wiki
Forum: Coders. C/C++ 14 March 2021, 16:05
Replies: 1,275
Views: 187,060
Posted By bebbo
or some of the libs aren't build with...

or some of the libs aren't build with -mhard-float?
Forum: Coders. C/C++ 14 March 2021, 16:04
Replies: 1,275
Views: 187,060
Posted By bebbo
maybe you are not linking against -noixemul ?

maybe you are not linking against -noixemul ?
Forum: Coders. C/C++ 14 March 2021, 08:27
Replies: 15
Views: 695
Posted By bebbo
On the Amiga the called function saves all...

On the Amiga the called function saves all modified registers but not d0/d1/a0/a1/fp0/fp1.



the doc for inline assembly is there https://gcc.gnu.org/onlinedocs/gcc/Extended-Asm.html


...
Forum: Coders. C/C++ 27 February 2021, 08:26
Replies: 15
Views: 877
Posted By bebbo
a proper malloc/free implementation must free...

a proper malloc/free implementation must free it's allocated memory on program exit.


that implementation usually frees the underlying large memory chunks. Consider a 16kB chunk size and single...
Forum: Coders. C/C++ 22 February 2021, 09:12
Replies: 2
Views: 587
Posted By bebbo
Arrow I prefer to use only: -noixemul PS:...

I prefer to use only:
-noixemul

PS: https://github.com/bebbo/amiga-gcc/wiki/Libraries
Forum: Coders. C/C++ 02 February 2021, 08:53
Replies: 1,275
Views: 187,060
Posted By bebbo
int __saveds QBobFunc(struct myBltNode *node...

int __saveds QBobFunc(struct myBltNode *node asm("a1"))
{
...
}



__saveds is only needed if a baserel data model is used - it means that the function loads the a4 register. Useful in...
Forum: Coders. C/C++ 02 February 2021, 08:50
Replies: 1,275
Views: 187,060
Posted By bebbo
the bgdbserver allows you to debug your program...

the bgdbserver allows you to debug your program on the Amiga remotely.
What you need is a working TCP/IP stack on your Amiga, then you can debug the program even on a real Amiga.


debugging >...
Forum: Coders. C/C++ 01 February 2021, 16:52
Replies: 14
Views: 1,761
Posted By bebbo
Quick guess: Your "phantom memory loss" is...

Quick guess:
Your "phantom memory loss" is related to your console history/buffer.

EDIT:

more time to write now:

I can run that example program over and over and the memory reported by...
Forum: Coders. C/C++ 06 January 2021, 15:55
Replies: 8
Views: 981
Posted By bebbo
you might also consider int...

you might also consider


int scandir(const char *dirname,struct dirent ***namelist,
int (*select)(const struct dirent *),
int (*dcomp)(const struct dirent **, const struct dirent **))...
Forum: support.WinUAE 04 January 2021, 20:35
Replies: 4
Views: 744
Posted By bebbo
good to know :spin I disabled JIT and was...

good to know :spin


I disabled JIT and was able to hunt down the culprit. libpthread is working better now and libnix provides thread safe FILE functions (if all is build for thread usage)^^

...
Forum: support.WinUAE 01 January 2021, 18:09
Replies: 4
Views: 744
Posted By bebbo
(spam the exe and pray) never mind -...

(spam the exe and pray)



never mind - I found the real cause^^ - but IMHO WinUAE should not crash^^


HNY2021
Forum: support.WinUAE 31 December 2020, 15:43
Replies: 4
Views: 744
Posted By bebbo
crash if JIT is enabled

I'm testing libpthread atm... and I get a WinUAE crash if JIT is enabled:



WinUAE message


JIT: serious error
JIT: 64-bit pointer (0xffffffffffffff8b) at...
Forum: Coders. C/C++ 31 December 2020, 14:04
Replies: 26
Views: 2,295
Posted By bebbo
you could precompute the "stack" Rename...

you could precompute the "stack"


Rename DrawSection to PreComputeSection and add a 2nd parameter.
Replace the real drawing part with an update to ordered.
You'll end up with a null terminated...
Forum: Coders. C/C++ 30 December 2020, 21:23
Replies: 26
Views: 2,295
Posted By bebbo
and with a little bit more if/else the 2nd stack...

and with a little bit more if/else the 2nd stack can be spared


void DrawSection(const Section *section) {
const Section *stack[STACKSIZE];
const Section **stackTop = stack;

// mark end...
Forum: Coders. C/C++ 30 December 2020, 19:58
Replies: 26
Views: 2,295
Posted By bebbo
nice - what compiler/options do you use? ...

nice - what compiler/options do you use?


Would you test one more variant?

void DrawSection(const Section *section) {
const Section *stack[STACKSIZE];
const Section...
Forum: Coders. C/C++ 30 December 2020, 18:52
Replies: 26
Views: 2,295
Posted By bebbo
I forgot a ++listTop; after the inner for(;;)...

I forgot a ++listTop; after the inner for(;;) loop - the listTop was moved to the terminating zero and must not kill this^^
Forum: Coders. C/C++ 30 December 2020, 16:05
Replies: 26
Views: 2,295
Posted By bebbo
first here is a maybe faster version, I would not...

first here is a maybe faster version, I would not count on the recursive version to be faster, since each call with the register push/pops takes also time

void DrawSection(const Section *section)...
Forum: Coders. C/C++ 30 December 2020, 09:45
Replies: 26
Views: 2,295
Posted By bebbo
untested...: // use even numbers cos of...

untested...:

// use even numbers cos of char...
#define STACKSIZE 100
#define MAXPUSHPERLOOP 4

void DrawSection(const Section *section) {
const Section *stack[STACKSIZE];
char...
Forum: Coders. C/C++ 29 December 2020, 22:53
Replies: 12
Views: 2,336
Posted By bebbo
fix for this specific issue is queued - should be...

fix for this specific issue is queued - should be live soon


(gdb) list
1 #include <stdio.h>
2
3 int main(int argc, char** argv)
4 {
5 for(int i=0;i<argc;i++)
6 ...
Forum: Coders. C/C++ 29 December 2020, 22:52
Replies: 26
Views: 2,295
Posted By bebbo
My "simple" approach: 1. use a stack 2....

My "simple" approach:

1. use a stack
2. push the initial value
3. loop over the stack and pop until it gets empty
4. fill a list during loop and collect all values of recursive calls
5. push...
Forum: Coders. C/C++ 29 December 2020, 22:37
Replies: 12
Views: 2,336
Posted By bebbo
1. your example does not compile fixed version...

1. your example does not compile
fixed version is
#include <stdio.h>

int main(int argc, char** argv)
{
for(int i=0;i<argc;i++)
printf("Arg #%d -> %s\n",i,argv[i]);
return 0;
}
Forum: Coders. C/C++ 22 December 2020, 13:32
Replies: 28
Views: 2,896
Posted By bebbo
this looks wrong: do { ...

this looks wrong:

do
{
if(GetMsg(_con_reply_port))
{
// Nothing to do
}
else
{
Forum: Coders. C/C++ 11 December 2020, 07:10
Replies: 28
Views: 2,896
Posted By bebbo
guess you'd have to use a static variable ...

guess you'd have to use a static variable



#pragma pack(push,4)
static struct StandardPacket con_standard_packet;
#pragma pack(pop)
Forum: Coders. C/C++ 09 December 2020, 15:54
Replies: 28
Views: 2,896
Posted By bebbo
you might enhance your code and do less...

you might enhance your code and do less alloc/free by using stack vars like

struct StandardPacket con_standard_packet;
char received_char = '\0';
ULONG ...
Forum: Coders. C/C++ 04 December 2020, 19:07
Replies: 21
Views: 1,902
Posted By bebbo
How do you start your threads? Maybe you could...

How do you start your threads? Maybe you could set the seglist for your threads?



newProc = CreateNewProcTags(NP_Entry, (ULONG )startProc,
NP_FreeSeglist, 0,
...);

...
Forum: Coders. C/C++ 24 November 2020, 19:26
Replies: 1,275
Views: 187,060
Posted By bebbo
the correct link is:...

the correct link is: https://franke.ms/download/bgdbserver_6.zip - I updated the page. Thank you!
Forum: News 18 November 2020, 11:09
Replies: 36
Views: 9,147
Posted By bebbo
don't forget to replace the RasPi with a MacBook...

don't forget to replace the RasPi with a MacBook Pro with the new M1 cpu...
Forum: Coders. C/C++ 02 November 2020, 18:46
Replies: 44
Views: 3,125
Posted By bebbo
multiplying a const? here you go: move.w...

multiplying a const? here you go:


move.w #$fff6,d0 ; this is #$ffff * 10 in word size.

:bash
Forum: Coders. C/C++ 02 November 2020, 13:40
Replies: 44
Views: 3,125
Posted By bebbo
I'm referring to this doc:...

I'm referring to this doc: https://www.nxp.com/docs/en/reference-manual/MC68000UM.pdf
Forum: Coders. C/C++ 02 November 2020, 13:39
Replies: 44
Views: 3,125
Posted By bebbo
your slower example is using longs - something...

your slower example is using longs - something you can't do with mulu in the 68k. Also add.l takes only 6 cycles.


so using .w in the first example yields 16 cycles less - which is 38.



And...
Forum: Coders. C/C++ 02 November 2020, 13:22
Replies: 44
Views: 3,125
Posted By bebbo
I'd say it takes 48 cycles: "The multiply...

I'd say it takes 48 cycles:


"The multiply algorithm requires 42+2n clocks where n is defined as: MULS: n = tag the with a zero as the MSB; n is the resultant number of 10 or 01 patterns in the...
Forum: Coders. C/C++ 31 October 2020, 12:55
Replies: 44
Views: 3,125
Posted By bebbo
and here a C/asm version for 68020: void...

and here a C/asm version for 68020:

void SetPixel3(const UWORD x, const UWORD y, UWORD colour) {
short j;
UBYTE * p = ((UBYTE *) currentBuffer) + y * DISPLAY_WIDTH_IN_BYTES *...
Showing results 1 to 40 of 509

 
Forum Jump

All times are GMT +2. The time now is 13:51.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, vBulletin Solutions Inc.
Page generated in 0.10187 seconds with 10 queries