English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Language > Coders. C/C++

 
 
Thread Tools
Old 21 December 2017, 07:31   #21
buggs
Registered User

 
Join Date: May 2016
Location: Rostock/Germany
Posts: 52
Quote:
Originally Posted by emufan View Post
Code:
SDL_surface.go: undefined reference to `___memset64'
SDL_surface.go: undefined reference to `___memset64'
SDL_surface.go: undefined reference to `___memset64'
SDL_video.go: undefined reference to `___memset64'
SDL_pixels.go: undefined reference to `___memset64'
SDL_pixels.go: more undefined references to `___memset64' follow
where is this memset64 function?
This issue stems from your libnix build. I've noticed this, too when building bebbo's toolchain. GCC6 handles inlines differently in comparison to gcc2.95. I've ended up passing -fgnu89-inline to the libnix Makefile.
buggs is offline  
AdSense AdSense  
Old 21 December 2017, 07:39   #22
buggs
Registered User

 
Join Date: May 2016
Location: Rostock/Germany
Posts: 52
Quote:
Originally Posted by emufan View Post
I try to build the AMMX version --> Makefile.bax using gcc6:
Code:
video/amigaos/SDL_cgxvideo.c:34:23: error: expected identifier or
‘(’ before numeric constant
 #define Apollo_AMMXon 0
*ugh* That wasn't me.

If desired, the AMMX routines can be disabled entirely by disabling the Apollo_EnableAMMX() call. But in any case, the mentioned call does check whether the code is running on a machine that has the instructions available. Even the regular 68k blitting functions should be considerably faster than the generic C counterpart from SDL.
buggs is offline  
Old 21 December 2017, 12:20   #23
emufan
Registered User
 
Join Date: Feb 2012
Location: #DrainTheSwamp
Posts: 4,546
Quote:
Originally Posted by Hedeon View Post
This version identifies itself as 1.2.14 btw. See sdl_version.h
I didnt noticed, so there is still some room for improvements with updating to final 1.2.15
Quote:
Originally Posted by buggs View Post
I've ended up passing -fgnu89-inline to the libnix Makefile.
ok, I will try this in my next build.
Quote:
Originally Posted by buggs View Post
Even the regular 68k blitting functions should be considerably faster
than the generic C counterpart from SDL.
so the AMMX sdl functions are just a prove of concept for now - do not boost things on the vampire?

Last edited by emufan; 21 December 2017 at 12:27.
emufan is offline  
Old 21 December 2017, 13:30   #24
buggs
Registered User

 
Join Date: May 2016
Location: Rostock/Germany
Posts: 52
Quote:
Originally Posted by emufan View Post
so the AMMX sdl functions are just a prove of concept for now - do not boost things on the vampire?
When I rewrote the blitting functions, I did write two versions of each subroutine: one for 68020+ and one for AMMX. I consider both sets of routines ready for use. The code I've put to Github will auto-select the right ones (reflected in Apollo_AMMXon).

Whether one gets an actual boost by these blitting functions is a matter of the respective applications or games. Many programs I've seen don't use the SDL blitting functions but draw everything by themselves.
buggs is offline  
Old 21 December 2017, 13:49   #25
emufan
Registered User
 
Join Date: Feb 2012
Location: #DrainTheSwamp
Posts: 4,546
Quote:
Originally Posted by buggs View Post
Whether one gets an actual boost by these blitting functions is a matter of the respective applications or games. Many programs I've seen don't use the SDL blitting functions but draw everything by themselves.
so a game has to use SDL_BlitSurface function for example?

if that's right, which other functions will use AMMX if available?

#1) reading in blitapollo.h: ApolloCopyRect, ApolloARGBtoRGB565 ... are these the function one has to use in a game?
emufan is offline  
Old 21 December 2017, 21:26   #26
buggs
Registered User

 
Join Date: May 2016
Location: Rostock/Germany
Posts: 52
Quote:
Originally Posted by emufan View Post
so a game has to use SDL_BlitSurface function for example?
SDL_BlitSurface is the central hub in SDL to move pixel data around. It also covers implicit conversion betweeen different pixel formats. That's why I wrote a number of routines for typical conversion sources/destinations.

Arti asked me to help him out with an underperforming game he was porting. That's why I concentrated on faster blit functions.

Otherwise, there are two other places in SDL where I plan to put in some work (given some spare time). The audio mixer could be faster. Also, RectFill might warrant some attention.

Apart from these places where data conversion will be done, SDL in itself doesn't require too much CPU time by itself. It's mostly game logic and casual coding that makes recent titles slow on less potent hardware.
buggs is offline  
Old 22 December 2017, 16:57   #27
emufan
Registered User
 
Join Date: Feb 2012
Location: #DrainTheSwamp
Posts: 4,546
hmm, lotsa details.
but what are the exact sdl functions which will use the AMMX extension if available
emufan is offline  
Old 09 March 2018, 23:24   #28
emufan
Registered User
 
Join Date: Feb 2012
Location: #DrainTheSwamp
Posts: 4,546
I try to build GnNeo, which is almost done, but linking give some errors,
which makes no sense.
using my "old" libSDL.a which was ok for many things i build,
now I get these things:
Code:
libSDL.a(SDL_string.go) :SDL_string.go: undefined reference to `_ctype_'
libSDL.a(SDL_string.go) :SDL_string.go: undefined reference to `_ctype_'
libSDL.a(SDL_string.go) :SDL_string.go: undefined reference to `_ctype_'
libSDL.a(SDL_string.go) :SDL_string.go: undefined reference to `_ctype_'
libSDL.a(SDL_string.go) :SDL_string.go: undefined reference to `_ctype_'
libSDL.a(SDL_string.go) :SDL_string.go: more undefined references to `_ctype_' follow
libSDL.a(SDL_cgxvideo.go) :SDL_cgxvideo.go: undefined reference to `Delay'
libSDL.a(SDL_cgxvideo.go) :SDL_cgxvideo.go: undefined reference to `Delay'
libSDL.a(SDL_ahiaudio.go) :SDL_ahiaudio.go: undefined reference to `Delay'
libSDL.a(SDL_sysjoystick.go) :SDL_sysjoystick.go: undefined reference to `Delay'
libSDL.a(SDL_amigaevents.go) :SDL_amigaevents.go: undefined reference to `Open'
libSDL.a(SDL_amigaevents.go) :SDL_amigaevents.go: undefined reference to `MapRawKey'
libSDL.a(SDL_amigaevents.go) :SDL_amigaevents.go: undefined reference to `MapRawKey'
libSDL.a(SDL_amigaevents.go) :SDL_amigaevents.go: undefined reference to `MapRawKey'
libSDL.a(SDL_amigaevents.go) :SDL_amigaevents.go: undefined reference to `MapRawKey'
libSDL.a(SDL_amigaevents.go) :SDL_amigaevents.go: undefined reference to `Close'
libSDL.a(SDL_amigaevents.go) :SDL_amigaevents.go: undefined reference to `MapRawKey'
libSDL.a(SDL_amigaevents.go) :SDL_amigaevents.go: undefined reference to `MapRawKey'
using gcc6, maybe 3 month old:
Code:
CFLAGS="-DNDEBUG -D__AMIGA__ -I/cygdrive/d/SDL/include -mcrt=clib2 -O3 -m68020-40 -g"
Code:
$ m68k-amigaos-nm.exe /cygdrive/d/SDL/lib/libSDL.a | grep MapRawKey
m68k-amigaos-nm: SDL_cgxyuv.go: no symbols
m68k-amigaos-nm: SDL_cgxgl_wrapper.go: no symbols
m68k-amigaos-nm: SDL_stdlib.go: no symbols
m68k-amigaos-nm: SDL_malloc.go: no symbols
m68k-amigaos-nm: SDL_getenv.go: no symbols
         U _MapRawKey
any idea?

#1) playing with sdl 1.2.15, i found these warnings, which match some of the errors above:
Code:
video/amigaos/SDL_amigaevents.c:195: warning: implicit declaration of function ‘Open’ 
video/amigaos/SDL_amigaevents.c:200: warning: implicit declaration of function ‘Close’
video/amigaos/SDL_cgxvideo.c:1402: warning: implicit declaration of function ‘Delay’
video/amigaos/SDL_amigaevents.c:748: warning: implicit declaration of function ‘MapRawKey’
no such warning, building SDL_string.go, which above complains about "_ctype_" :/

what the heck is wrong here?

#2)
video/amigaos/SDL_amigaevents.c:
Code:
	#ifdef STORMC4_WOS
	if( (actual=MapRawKey(&event,buffer,5,NULL))>=0)
at least something to fix :/

this is the very same folder I build my libSDl couple weeks ago, not a bit changed,
now out of a sudden such errors, even with the one build many weeks ago.

the new player here is gcc6, but all this makes no sense. need a break :/

Last edited by emufan; 10 March 2018 at 03:06.
emufan is offline  
Old 10 March 2018, 05:59   #29
Hedeon
Sonnet Hacker

 
Join Date: Mar 2012
Location: Leiden / The Netherlands
Posts: 593
Need to add proto/dos.h for Open, Delay, Close and proto/keymap.h for maprawkey.
Hedeon is offline  
Old 10 March 2018, 10:10   #30
arti
Registered User

 
Join Date: Jul 2008
Location: Poland
Posts: 494
Or link with -lauto and/or -lamiga

_ctype_ comes from clib2
arti is offline  
Old 10 March 2018, 10:41   #31
emufan
Registered User
 
Join Date: Feb 2012
Location: #DrainTheSwamp
Posts: 4,546
Quote:
Originally Posted by arti View Post
Or link with -lauto and/or -lamiga

_ctype_ comes from clib2
I will try that.
Quote:
Originally Posted by Hedeon View Post
Need to add proto/dos.h for Open, Delay, Close and proto/keymap.h for maprawkey.
added dos.h proto to a gngeo/video.h and it did fix the delay, open, keymap errors,
but some new just pop up:

==> to make it even more confusing: the proto did not help,
but was fixed, because I was using "-noixemul" instead of my previous "-mcrt=clib2"
==> I try AmiDevCpp now

Code:
memory.o(.text+0xf96): undefined reference to `write_irq2pos'
memory.o(.text+0xfb4): undefined reference to `write_irq2pos'
memory.o(.text+0xf70): undefined reference to `write_neo_control'
i fixed by removing the __inline__ statement from the src:
Code:
// __inline__ void write_irq2pos(Uint32 data) {
void write_irq2pos(Uint32 data) {
...
// __inline__ void write_neo_control(Uint16 data) {
void write_neo_control(Uint16 data) {
but there is a gcc options for inline, IIRC, to "fix" or make the inline stuff work.

#2) now with gcc3 (AmiDevCpp) i get some asm errors:
Code:
m68k-amigaos-gcc.exe -DHAVE_CONFIG_H -I. -I..  -DDATA_DIRECTORY=\\"data\\"  
 -DNDEBUG -D__AMIGA__ -D_HAVE_STDINT_H -I/SDL/include  -m68020-40 -I/SDL/
 -D_GNU_SOURCE=1 -D_REENTRANT  -Wall -Wno-unused -funroll-loops -ffast-math
 -g -MT video.o -MD -MP -MF .deps/video.Tpo -c -o video.o video.c
.../Local/Temp/ccj9YFfJ.s: Assembler messages:
.../Local/Temp/ccj9YFfJ.s:6739: Error: parse error -- statement `moveb d3,(sr.3)' ignored
make.exe[3]: *** [video.o] Error 1
any idea how to debug this?

Last edited by emufan; 10 March 2018 at 13:21.
emufan is offline  
Old 10 March 2018, 14:29   #32
bebbo
Registered User

 
Join Date: Jun 2016
Location: Hamburg/Germany
Posts: 275
instead of removing __inline__ you coud fix its definitions, I did not look into your code so I am guessing:
Code:
#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)
#define __inline__ inline
#else
#define __inline__ extern inline
#endif
bebbo is offline  
Old 10 March 2018, 16:12   #33
emufan
Registered User
 
Join Date: Feb 2012
Location: #DrainTheSwamp
Posts: 4,546
*OMG* finaly a binary, does start with tiny window, switches to full screen and does crash winuae.
done with gcc6, since I could not fix the damn gcc3 assembler.

I tried adding your lines in memory.c, but it makes no diff.
funny enough since other __inline__ functions seems just fine.

sdl stuff was gone, when I skiped clib2, now -noixemul
getopt related things I fixed with getopt_long source I found, build and added getopt_long.o.
furthermore removed some "external" from simple variables.

*now* I can look into the GnNeo fullscreen vs window mode problem

#1) not much progress. it does switch from tiny window to a black overlay,
I can move the "hidden" window, so it's visible again, but it does guru some moments later.

Last edited by emufan; 10 March 2018 at 19:32.
emufan is offline  
Old 11 March 2018, 22:45   #34
arti
Registered User

 
Join Date: Jul 2008
Location: Poland
Posts: 494
inlines in memory.c are fine on gcc 2.95.3


BTW:

[ Show youtube player ]


I have also alredy ported snes9x before you :

[ Show youtube player ]

Lolz

Last edited by arti; 11 March 2018 at 23:11.
arti is offline  
Old 13 March 2018, 12:25   #35
AMIGASYSTEM
Registered User
AMIGASYSTEM's Avatar
 
Join Date: Aug 2014
Location: Brindisi (Italia)
Posts: 2,946
@arti
I would like to test the new version of GnGeo r1142 hoping it works up WinUAE, can you download it somewhere?
AMIGASYSTEM is offline  
Old 13 March 2018, 12:40   #36
arti
Registered User

 
Join Date: Jul 2008
Location: Poland
Posts: 494
http://netsurf.baderman.net/gngeo.svn.r1142.zip

It works, just set desktop to 15bit.
arti is offline  
Old 13 March 2018, 13:21   #37
AMIGASYSTEM
Registered User
AMIGASYSTEM's Avatar
 
Join Date: Aug 2014
Location: Brindisi (Italia)
Posts: 2,946
Thank you Arti, GnGeo r1142 it works and is very fast on WinUAE, but the colors are bad, tested UAE-Gfx 15,16 and 32Bit the result does not change, also tried card Picasso IV with the same result.

Last edited by AMIGASYSTEM; 06 April 2018 at 18:00.
AMIGASYSTEM is offline  
Old 13 March 2018, 13:53   #38
arti
Registered User

 
Join Date: Jul 2008
Location: Poland
Posts: 494
Try in window.
arti is offline  
Old 13 March 2018, 14:06   #39
AMIGASYSTEM
Registered User
AMIGASYSTEM's Avatar
 
Join Date: Aug 2014
Location: Brindisi (Italia)
Posts: 2,946
Even in the window you can see badly, see screenshot !

Last edited by AMIGASYSTEM; 06 April 2018 at 18:00.
AMIGASYSTEM is offline  
Old 13 March 2018, 14:10   #40
arti
Registered User

 
Join Date: Jul 2008
Location: Poland
Posts: 494
Fine here, make sure that game script runs proper gngeo.exe.
EDIT: Is screen set to 15bit not 15bit PC?
arti is offline  
AdSense AdSense  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
SDL problem. tolkien Coders. C/C++ 10 24 March 2015 03:29
use SDL 1.2.13 with AmyDevCpp TheDarkCoder Coders. General 3 18 August 2009 20:55
req details for sdl turrican3 request.Other 0 20 April 2008 22:06
WinUAE w/SDL mangamuscle request.UAE Wishlist 8 31 January 2007 11:41
What do you know about Amiga SDL? Tolismlf Amiga scene 6 15 November 2004 18:54

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 17:44.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2018, vBulletin Solutions Inc.
Page generated in 0.09013 seconds with 13 queries