Who's Online |
55 user(s) are online ( 30 user(s) are browsing Forums)
Members: 0
Guests: 55
more...
|
|
|
|
Re: Anyone Tried Compiling the latest WebKit?
|
Posted on: 2022/9/4 14:28
#321
|
Quite a regular
|
@walkero I am in the same position, but, help can be found by just using the library. I am using it in mednafen now and others. I can see, then, what things are missing in CLIB2 that I can report, or "attempt" to add. By using CLIB2 in larger projects, we can already help. @hans https://github.com/afxgroup/clib2. It should be a matter of cross-compiling. Installing it "somewhere" and then copying over the clib2 directory to your AmigaOne. Personally, I think I would toggle between the original clib2 and bleeding-edge by just using a soft link.
|
If liberty means anything at all, it means the right to tell people what they do not want to hear. George Orwell.
|
|
|
Re: Do People Still Use IRC?
|
Posted on: 2022/9/3 23:36
#322
|
Quite a regular
|
Okay, I rebooted the X5000 and now it connected again.
What can this possibly mean?
On the cold turn-on of the machine, I opened up some programs. Then, I opened up the IRC client and it would not connected. Then, I rebooted and the first thing I opened was the IRC client and it connected.
Something odd going on here.
|
If liberty means anything at all, it means the right to tell people what they do not want to hear. George Orwell.
|
|
|
Re: Do People Still Use IRC?
|
Posted on: 2022/9/3 23:31
#323
|
Quite a regular
|
Yeah, very, very odd.
It seems like on my X5000 it is random as to when it will connect to that channel.
One time it decides to work, the other it does not.
Really bizaar.
|
If liberty means anything at all, it means the right to tell people what they do not want to hear. George Orwell.
|
|
|
Compatible memory modules
|
Posted on: 2022/9/3 20:50
#324
|
Quite a regular
|
So, I read that performance is better with dual memory modules. In my x5,I only have one. Is the list on http://wiki.amiga.org/index.php?title=X5000The best option. 2 * 4Gb ? I was thinking of the Kingston. Thanks.
|
If liberty means anything at all, it means the right to tell people what they do not want to hear. George Orwell.
|
|
|
Re: GL4ES / SDL+GL4ES / CLIB2 / Outdated NEWLIB libs and OnWards
|
Posted on: 2022/9/3 14:42
#325
|
Quite a regular
|
Well, the GetWindowActiveSize was removed in a much later version. So that explains it. Just a synchronisation issue between non-exact dates. Can live with that for now, and just apply some code changes. === Let me be more clear. It is the fact that I applied the GL4ES additions patch from exactly: https://github.com/kas1e/SDL2_GL4ES/co ... 8b63e66ace2ebe5dae6e8288d (this patch was for an older version of SDL, and the changes - themselves, have probably moved on) to the 2.0.22 SDL release code. Thankfully, not too much change, so it was not really a problem.
Edited by rjd324 on 2022/9/3 15:02:09 Edited by rjd324 on 2022/9/3 15:02:41
|
If liberty means anything at all, it means the right to tell people what they do not want to hear. George Orwell.
|
|
|
Re: AmigaOS 4 Monthly Roundup - August 2022
|
Posted on: 2022/9/3 9:27
#326
|
Quite a regular
|
Thanks for the read @AmigaOldskooler,
|
If liberty means anything at all, it means the right to tell people what they do not want to hear. George Orwell.
|
|
|
GL4ES / SDL+GL4ES / CLIB2 / Outdated NEWLIB libs and OnWards
|
Posted on: 2022/9/3 1:49
#327
|
Quite a regular
|
Okay. We have pthreads now in CLIB2 and progress is being made with a C library for which we have source code access to. Who knows when extra features to newlib will happen. For that reason, I continued on my quest to make improvements to mednafen. Rather than the necessary hacks I needed to add to the mednafen source code to ensure successful builds against newlib, due to a great, but outdated 2004/5 version of pthreads, I wanted to link with CLIB2 instead of newlib. It has been a success, but it required that a number of library be compiled with CLIB2. This, at least for mednafen, included "porting" libFLAC to CLIB2. It also required building GL4ES / SDL2_GL4ES with CLIB2. What I am noticing is outdated libraries on OS4Depot that are linked against NEWLIB. Going forward, we probably always want to offer both. But, I worry that the LHA files and their original owners on OS4Depot are either inactive or will never update to include CLIB2 / newer versions on those libraries. I wonder how we can solve that issue. Tonight, I compiled bleeding-edge GL4ES using CLIB2 commit: 44cdcded7653ec5f3cc845b1b0e28c78f6f2b4d3 (this included the merged back pthreads branch). Before I say the following, I thank @kas1e, @capehill, @hans for all the work. But, I kind of needed to figure out how to build SDL2 + GL4ES on my own. @kas1e already has the GL4ES SDK, but it is with an older version of SDL2. I built SDL2@version 2.0.22 against CLIB2 - fine. I was then confused how to create SDL2 + GL4ES changes. Actually, it did not seem to be that complicated. It was a matter of grabbing the Amiga SDL2 port and then applying the following patch file:
diff --git a/Makefile.amigaos4 b/Makefile.amigaos4
index 754d92f..c7c28d3 100755
--- a/Makefile.amigaos4
+++ b/Makefile.amigaos4
@@ -8,7 +8,7 @@ STRIP = ppc-amigaos-strip
AMIGADATE = $(shell date +"%-d.%-m.%Y")
-CFLAGS = -gstabs -O2 -Wall -fPIC -fcommon -I./include -D__AMIGADATE__=\"$(AMIGADATE)\"
+CFLAGS = -DSDL_GL4ES -gstabs -O2 -Wall -fPIC -fcommon -I./include -D__AMIGADATE__=\"$(AMIGADATE)\"
TARGET_STATIC = libSDL2.a
TARGET_SHARED = libSDL2-2.0.so
diff --git a/src/video/amigaos4/SDL_os4gl4es.c b/src/video/amigaos4/SDL_os4gl4es.c
new file mode 100755
index 0000000..c5fa921
--- /dev/null
+++ b/src/video/amigaos4/SDL_os4gl4es.c
@@ -0,0 +1,297 @@
+/*
+ Simple DirectMedia Layer
+ Copyright (C) 1997-2018 Sam Lantinga <slouken@libsdl.org>
+
+ This software is provided 'as-is', without any express or implied
+ warranty. In no event will the authors be held liable for any damages
+ arising from the use of this software.
+
+ Permission is granted to anyone to use this software for any purpose,
+ including commercial applications, and to alter it and redistribute it
+ freely, subject to the following restrictions:
+
+ 1. The origin of this software must not be misrepresented; you must not
+ claim that you wrote the original software. If you use this software
+ in a product, an acknowledgment in the product documentation would be
+ appreciated but is not required.
+ 2. Altered source versions must be plainly marked as such, and must not be
+ misrepresented as being the original software.
+ 3. This notice may not be removed or altered from any source distribution.
+*/
+#include "../../SDL_internal.h"
+
+#if SDL_VIDEO_DRIVER_AMIGAOS4
+
+#include "SDL_os4video.h"
+#include "SDL_os4window.h"
+#include "SDL_os4library.h"
+#include "SDL_os4opengl.h"
+
+#include <proto/exec.h>
+#include <proto/intuition.h>
+
+#include "agl.h"
+
+#define DEBUG
+#include "../../main/amigaos4/SDL_os4debug.h"
+
+
+int OS4_GL_LoadLibrary(_THIS, const char * path)
+{
+ dprintf("Called %d\n", _this->gl_config.driver_loaded);
+ dprintf("Opening of libraries done inside of gl4es\n");
+
+ return 0;
+}
+
+void *OS4_GL_GetProcAddress(_THIS, const char * proc)
+{
+ void *func = NULL;
+
+ dprintf("Called for '%s'\n", proc);
+
+ func = (void *)aglGetProcAddress(proc);
+
+ if (func == NULL) {
+ dprintf("Failed to load '%s'\n", proc);
+ SDL_SetError("Failed to load function");
+ }
+
+ return func;
+
+}
+
+
+SDL_bool
+OS4_GL_AllocateBuffers(_THIS, int width, int height, int depth, SDL_WindowData * data)
+{
+
+ return SDL_TRUE;
+}
+
+void
+OS4_GL_FreeBuffers(_THIS, SDL_WindowData * data)
+{
+
+}
+
+
+
+SDL_GLContext OS4_GL_CreateContext(_THIS, SDL_Window * window)
+{
+
+ int width, height;
+ ULONG errCode = 0;
+
+ SDL_WindowData *data = window->driverdata;
+
+ OS4_GetWindowActiveSize(window, &width, &height);
+
+
+ if (data->glContext) {
+ dprintf("Old context %p found, deleting\n", data->glContext);
+
+ aglDestroyContext(data->glContext);
+
+ data->glContext = NULL;
+ }
+
+ dprintf("Depth buffer size %d, stencil buffer size %d\n",
+ _this->gl_config.depth_size, _this->gl_config.stencil_size);
+
+
+ struct TagItem create_context_taglist[] =
+ {
+ {OGLES2_CCT_WINDOW, (ULONG)data->syswin},
+ {OGLES2_CCT_DEPTH, _this->gl_config.depth_size},
+ {OGLES2_CCT_STENCIL, _this->gl_config.stencil_size},
+ {OGLES2_CCT_VSYNC, 0},
+ {OGLES2_CCT_SINGLE_GET_ERROR_MODE,1},
+ {OGLES2_CCT_RESIZE_VIEWPORT,TRUE},
+ {TAG_DONE, 0}
+ };
+
+ data->glContext = aglCreateContext2(&errCode,create_context_taglist);
+
+ if (data->glContext) {
+
+ dprintf("OpenGL ES 2 context %p created for window '%s'\n",
+ data->glContext, window->title);
+
+
+ aglMakeCurrent(data->glContext);
+
+ // Some games (like q3) doesn't clear the z-buffer prior to use. Since we're using a floating-point depth buffer in warp3dnova,
+ // that means it may contain illegal floating-point values, which causes some pixels to fail the depth-test when they shouldn't,
+ // so we clear the depth buffer to a constant value when it's first created.
+ // Pandora may well use an integer depth-buffer, in which case this can't happen.
+ // On MiniGL it didn't happens as there is workaround inside of old warp3d (and probabaly inside of MiniGL itself too).
+ // in SDL1 with gl4es (so warp3dnova/ogles2, where no such workaround) it didn't happens probabaly because SDL1 doing something like that (but not glClear).
+
+ glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
+
+ glViewport(0, 0, width, height);
+
+ return data->glContext;
+
+ } else {
+ dprintf("Failed to create OpenGL ES 2 context for window '%s' (error code %d)\n",
+ window->title, errCode);
+
+ SDL_SetError("Failed to create OpenGL ES 2 context");
+ return NULL;
+ }
+
+ return NULL;
+
+}
+
+void OS4_GL_DeleteContext(_THIS, SDL_GLContext context)
+{
+ dprintf("Called with context=%p\n", context);
+
+ if (context) {
+
+ SDL_Window *sdlwin;
+ Uint32 deletions = 0;
+
+ for (sdlwin = _this->windows; sdlwin; sdlwin = sdlwin->next) {
+
+ SDL_WindowData *data = sdlwin->driverdata;
+
+ if (data->glContext == context) {
+
+ dprintf("Found ogles2 context, destroy it and clearing window binding\n");
+
+ aglDestroyContext(context);
+ data->glContext = NULL;
+ deletions++;
+ }
+ }
+
+ if (deletions == 0) {
+ dprintf("OpenGL ES 2 context doesn't seem to have window binding\n");
+ dprintf("So, just delete context without clearing of window binding\n");
+ aglDestroyContext(context);
+ }
+ } else {
+ dprintf("No context to delete\n");
+ }
+
+}
+
+
+int OS4_GL_MakeCurrent(_THIS, SDL_Window * window, SDL_GLContext context)
+{
+
+ int result = -1;
+
+ if (!window || !context) {
+ dprintf("Called window=%p context=%p\n", window, context);
+ }
+
+ if (window) {
+ SDL_WindowData *data = window->driverdata;
+
+ if (context != data->glContext) {
+ dprintf("Context pointer mismatch: %p<>%p\n", context, data->glContext);
+ SDL_SetError("Context pointer mismatch");
+ } else {
+ aglMakeCurrent(context);
+ }
+ }
+
+ result = 0;
+
+ return result;
+}
+
+
+void OS4_GL_GetDrawableSize(_THIS, SDL_Window * window, int * w, int * h)
+{
+ OS4_WaitForResize(_this, window, w, h);
+}
+
+int
+OS4_GL_SetSwapInterval(_THIS, int interval)
+{
+ SDL_VideoData *data = _this->driverdata;
+
+ switch (interval) {
+ case 0:
+ case 1:
+ data->vsyncEnabled = interval ? TRUE : FALSE;
+ dprintf("VSYNC %d\n", interval);
+ return 0;
+ default:
+ dprintf("Unsupported interval %d\n", interval);
+ return -1;
+ }
+}
+
+int
+OS4_GL_GetSwapInterval(_THIS)
+{
+
+ SDL_VideoData *data = _this->driverdata;
+
+ return data->vsyncEnabled ? 1 : 0;
+}
+
+
+
+int OS4_GL_SwapWindow(_THIS, SDL_Window * window)
+{
+ SDL_WindowData *data = window->driverdata;
+
+ if (data->glContext) {
+ SDL_VideoData *videodata = _this->driverdata;
+
+
+ glFinish();
+
+ if (videodata->vsyncEnabled) {
+ IGraphics->WaitTOF();
+ }
+
+ // Swap the Buffers!
+ aglSwapBuffers();
+ return 0;
+
+ } else {
+ dprintf("No OpenGL ES 2 context\n");
+ }
+ return -1;
+}
+
+
+
+SDL_bool OS4_GL_ResizeContext(_THIS, SDL_Window * window)
+{
+ return SDL_TRUE;
+}
+
+
+void OS4_GL_UpdateWindowPointer(_THIS, SDL_Window * window)
+{
+ SDL_WindowData *data = window->driverdata;
+
+ dprintf("Updating GLES2 window pointer %p\n", data->syswin);
+
+ struct TagItem setparams[] =
+ {
+ {OGLES2_CCT_WINDOW, (ULONG)data->syswin},
+ {TAG_DONE, 0}
+ };
+
+ aglSetParams2(setparams);
+}
+
+
+void OS4_GL_UnloadLibrary(_THIS)
+{
+ dprintf("Called %d\n", _this->gl_config.driver_loaded);
+ dprintf("Closing of ogles2 libraries done inside of gl4es\n");
+}
+
+#endif /* SDL_VIDEO_DRIVER_AMIGAOS4 */
diff --git a/src/video/amigaos4/SDL_os4opengl.c b/src/video/amigaos4/SDL_os4opengl.c
index 13b96b2..87f0462 100755
--- a/src/video/amigaos4/SDL_os4opengl.c
+++ b/src/video/amigaos4/SDL_os4opengl.c
@@ -20,7 +20,7 @@
*/
#include "../../SDL_internal.h"
-#if SDL_VIDEO_DRIVER_AMIGAOS4
+#if defined (SDL_VIDEO_OPENGL) && !defined (SDL_GL4ES)
#include "SDL_os4video.h"
#include "SDL_os4window.h"
diff --git a/src/video/amigaos4/SDL_os4openglwrapper.c b/src/video/amigaos4/SDL_os4openglwrapper.c
index 07b5d72..2fa3642 100755
--- a/src/video/amigaos4/SDL_os4openglwrapper.c
+++ b/src/video/amigaos4/SDL_os4openglwrapper.c
@@ -23,7 +23,7 @@
/* wrapper functions for MiniGL */
-#if SDL_VIDEO_DRIVER_AMIGAOS4
+#if defined (SDL_VIDEO_OPENGL) && !defined (SDL_GL4ES)
#include <GL/gl.h>
#include <GL/glu.h>
diff --git a/src/video/amigaos4/SDL_os4video.c b/src/video/amigaos4/SDL_os4video.c
index 806055a..08a0a0a 100755
--- a/src/video/amigaos4/SDL_os4video.c
+++ b/src/video/amigaos4/SDL_os4video.c
@@ -361,10 +361,15 @@ OS4_LoadGlLibrary(_THIS, const char * path)
_this->gl_config.major_version,
_this->gl_config.minor_version);
+#ifdef SDL_GL4ES
+ OS4_SetMiniGLFunctions(_this);
+ return OS4_GL_LoadLibrary(_this, path);
+#else
if (OS4_IsMiniGL(_this)) {
OS4_SetMiniGLFunctions(_this);
return OS4_GL_LoadLibrary(_this, path);
}
+#endif
#if SDL_VIDEO_OPENGL_ES2
if (OS4_IsOpenGLES2(_this)) {
diff --git a/src/video/amigaos4/agl.h b/src/video/amigaos4/agl.h
new file mode 100755
index 0000000..4400f09
--- /dev/null
+++ b/src/video/amigaos4/agl.h
@@ -0,0 +1,32 @@
+#ifndef _AGL_H_
+#define _AGL_H_
+
+#ifndef EXEC_TYPES_H
+#include <exec/types.h>
+#endif
+#ifndef EXEC_EXEC_H
+#include <exec/exec.h>
+#endif
+#ifndef EXEC_INTERFACES_H
+#include <exec/interfaces.h>
+#endif
+
+#ifndef GRAPHICS_GFX_H
+#include <graphics/gfx.h>
+#endif
+
+#ifndef OGLES2_OGLES2_DEFS_H
+// it would be better to have an include with only the CreateContextTags enum difed, to avoid conflict
+// of other typedef with full OpenGL header file...
+#include <ogles2/ogles2_defs.h>
+#endif
+
+void* aglCreateContext2(ULONG * errcode, struct TagItem * tags);
+void aglDestroyContext(void* context);
+void aglMakeCurrent(void* context);
+void aglSwapBuffers();
+void aglSetBitmap(struct BitMap *bitmap);
+void aglSetParams2(struct TagItem * tags);
+void* aglGetProcAddress(const char* name);
+
+#endif //_AGL_H_
\ No newline at end of file
To the SDL2@released 2.0.22 branch. However, I am not sure if this is exactly correct! The only issue I ran into was an undefined reference to:
OS4_GetWindowActiveSize
In order to get around that, I just hacked in some values for Height and Width - but I would like to get an idea of where that function went. Recall, that I am using the latest bleeding-edge GL4ES combined wth SDL2.0.22. In any case, so far, Mednafen is running quite well with out DSI errors probably due to the bleeding-edge CLIB2 changes and the pthread support. A lot of the hacks I had to add could be removed such that the code base is a lot more closer to Mednafen version 1.29. The points are: - What happened to OS4_GetWindowActiveSize - How can we all come together to ensure that CLIB2 versions of SDK/Library/Dev LHAs are available - What about those that have uploaded versions of libraries from a few years ago that are only built with NEWLIB Regards.
|
If liberty means anything at all, it means the right to tell people what they do not want to hear. George Orwell.
|
|
|
Re: New verson of CLiB2 from Andrea (afxgroup)
|
Posted on: 2022/9/1 21:40
#328
|
Quite a regular
|
@afxgroup
Excellent news!
|
If liberty means anything at all, it means the right to tell people what they do not want to hear. George Orwell.
|
|
|
Re: New verson of CLiB2 from Andrea (afxgroup)
|
Posted on: 2022/9/1 18:28
#329
|
Quite a regular
|
Thanks, let me use those tests and see what I can do.
|
If liberty means anything at all, it means the right to tell people what they do not want to hear. George Orwell.
|
|
|
Re: New verson of CLiB2 from Andrea (afxgroup)
|
Posted on: 2022/9/1 10:53
#330
|
Quite a regular
|
Yeah I know, makefile ?= handles that.
But really, these are my private changes that should not be visible anyway.
Thanks.
|
If liberty means anything at all, it means the right to tell people what they do not want to hear. George Orwell.
|
|
|
Re: New verson of CLiB2 from Andrea (afxgroup)
|
Posted on: 2022/9/1 10:25
#331
|
Quite a regular
|
Right,
Git ans github always baffles me. I just prefer SVN.
I can correct the pull requests if you want, or, let you handle it. Let me know.
|
If liberty means anything at all, it means the right to tell people what they do not want to hear. George Orwell.
|
|
|
Re: New verson of CLiB2 from Andrea (afxgroup)
|
Posted on: 2022/8/31 22:17
#332
|
Quite a regular
|
Perhaps:
git diff
diff --git a/library/pthread/pthread_create.c b/library/pthread/pthread_create.c
index 2005efb..d4c2a00 100644
--- a/library/pthread/pthread_create.c
+++ b/library/pthread/pthread_create.c
@@ -90,7 +90,7 @@ StarterFunc() {
StackSwap(&stack);
Printf("[%s] Finishing stuff\n", inf->name);
- if (inf->status == THREAD_STATE_RUNNING) {
+ if (inf->status == THREAD_STATE_RUNNING || inf->status == THREAD_STATE_JOINING) {^M
if (!inf->detached) {
Printf("[%s] Signal parent %p\n", inf->name, inf->parent);
// tell the parent thread that we are done
@@ -108,7 +108,7 @@ StarterFunc() {
}
}
else
- Printf("[%s] Thread was not running\n", inf->name);
+ Printf("[%s] Thread was not running or joining\n", inf->name);^M
Printf("[%s] Exit StarterFunc\n", inf->name);
return RETURN_OK;
@@ -202,4 +202,4 @@ pthread_create(pthread_t *thread, const pthread_attr_t *attr, void *(*start)(voi
Printf("\n[%s] pthread_create done\n", inf->name);
return OK;
-}
\ No newline at end of file
+}^M
Since we can get in the situation where the code in pthread_join is called (setting the status to JOINING) before needing to give the final signal to the parent thread (which assumes that the state will only be in the RUNNING state). But, I could be way off! But, this works for my personal example. I should run the full tests since it may have broken other things! === PS: DOS line endings are expected in this repository?
|
If liberty means anything at all, it means the right to tell people what they do not want to hear. George Orwell.
|
|
|
Re: New verson of CLiB2 from Andrea (afxgroup)
|
Posted on: 2022/8/31 20:35
#333
|
Quite a regular
|
@afxgroup Hi, I noticed the cause for the hanging of threads. I have not figured out exactly why or the elegant solution, but, in the situation where I have a simple program (known, now, as the "main thread") that then creates a thread (known, now, as the "child thread"); where, child thread loops constantly until some request from the main thread - in my case - pthraed_cancel(childThread); In this case, it seems like (pthread_join.c):
Wait(SIGF_PARENT);
Will never receive the signal. At (StartFunc / pthread_create.c)
Printf("[%s] Finishing stuff\n", inf->name);
the issue seems to be that
if (inf->status == THREAD_STATE_RUNNING) {
is NOT true. Then, no "Signal(inf->parent, SIGF_PARENT);" is performed. In that case, the parent thread is left WAITING. To test it, I hacked in
Forbid();
Signal(inf->parent, SIGF_PARENT);
to be executed - regardless. Now, child thread shuts down, which it does anyway, but also the main thread shuts down because it receives the signal. === Alternatively to modifying anything in the clib2/pthread branch, you can issue something like a Delay(150) between "pthread_cancel" and "pthread_join" in your own user program without adding any hacks to the current clib2/pthreads branch - and you may be able to see that in that case the main thread is also not left WAITING and that it successfully closes. === Here is the test code: Can toggle the commenting of IDOS->Delay. Forget about the "sound thread" that was just some extra testing. Ofc, requires SDL2.
#include <SDL2/SDL.h>
#include <pthread.h>
#include <time.h>
#include <proto/dos.h> /* just for Delay */
#define MSG(msg) { fprintf(stderr,"%s\n",msg); fflush(stderr); }
#define BAIL(msg,ret) { MSG(msg) ; RET=ret; goto ENDER; }
int RET=0;
SDL_Window *window;
SDL_Renderer *render;
SDL_Event ev;
int quit=0;
int vel_x=3,vel_y=-2;
/* thread stuff*/
pthread_t thread_s;
pthread_t thread_e;
// void* thread_sound(void*);
void* thread_engine(void*);
int retval_sound,retval_engine;
Uint8 r=0xFF,g=0x00,b=0x00;
/* gfx */
SDL_Rect block = { 400,300,10,10};
int main(int argc, char *argv[])
{
(void)argc;(void)argv;
if(SDL_Init(SDL_INIT_VIDEO|SDL_INIT_AUDIO))
{
BAIL(SDL_GetError(),10);
}
if(SDL_CreateWindowAndRenderer(800,600,0/*no flags*/,&window,&render))
{
BAIL(SDL_GetError(),20);
}
SDL_SetWindowTitle(window,"thread_test");
// /* now let's create a thread for some sound */
// if(pthread_create(&thread_s,NULL,&thread_sound,NULL))
// {
// BAIL("Unable to create a thread for sound",30);
// }
/* and, a thread for some sort of engine */
if(pthread_create(&thread_e,NULL,&thread_engine,NULL))
{
BAIL("Unable to create a thread for engine",31);
}
while(!quit)
{
while(SDL_PollEvent(&ev))
{
if(ev.type == SDL_QUIT)
{
quit=1;
}
}
SDL_SetRenderDrawColor(render,0x00,0x00,0x00,0x00);
SDL_RenderClear(render); /* draw an empty black screen! */
SDL_SetRenderDrawColor(render,r,g,b,0x00);
SDL_RenderFillRect(render,&block);
SDL_RenderPresent(render);
SDL_Delay(33);
}
// /* we get here if we quit */
// if(pthread_cancel(thread_s))
// {
// BAIL("Failed to cancel sound thread!",40);
// }
/* we get here if we quit */
if(pthread_cancel(thread_e))
{
BAIL("Failed to cancel engine thread!",41);
}
else
{
printf("We canceled it!\n");
}
// /* wait for the thread to finish */
// if(pthread_join(thread_s,NULL))
// {
// BAIL("Could not join sound thread!",50);
// }
/*IDOS->Delay(150);*/
printf("Calling pthread_join!\n");
if(pthread_join(thread_e,NULL))
{
BAIL("Could not join engine thread!",51);
}
else
{
printf("We joined it!\n");
}
ENDER:
if(render) SDL_DestroyRenderer(render);
if(window) SDL_DestroyWindow(window);
SDL_Quit();
return RET;
}
// void* thread_sound(void* args)
// {
// (void)args;
// struct timespec ts;
// for(;;)
// {
// pthread_testcancel();
// if(clock_gettime(CLOCK_REALTIME,&ts))
// {
// MSG("Unsuccessful call to clock_gettime()");
// }
// printf("Time: %llu\n",ts.tv_sec);
// }
// }
void* thread_engine(void* args)
{
(void)args;
for(;;)
{
pthread_testcancel();
if((block.x > 800)||(block.x<0))
vel_x=-(vel_x);
if((block.y > 600)||(block.y<0))
vel_y=-(vel_y);
block.x+=vel_x;
block.y+=vel_y;
if(block.x>400)
{
r=0x00;
g=0x00;
b=0xFF;
}
else
{
r=0xFF;
g=0x00;
b=0x00;
}
}
}
|
If liberty means anything at all, it means the right to tell people what they do not want to hear. George Orwell.
|
|
|
Re: Debugging on Amiga OS4
|
Posted on: 2022/8/28 21:09
#334
|
Quite a regular
|
So,
Does this mean that db101, until a newer publicly released kernel, is the canonical debugger to use?
Does it suffer from any bugs? Can it handle applications using threads, where those threads, under the hood, are just separate tasks?
|
If liberty means anything at all, it means the right to tell people what they do not want to hear. George Orwell.
|
|
|
Re: Debugging on Amiga OS4
|
Posted on: 2022/8/28 20:10
#335
|
Quite a regular
|
I bring this up because I am trying to help on the clib2 pthreads branch. Debugging it would hugely useful.
Although I am quite used to printf debugging, even at work, when it comes to multiple interoperable tasks, this is where a debugger is more useful.
For a single threaded application it is easier to do printf debugging.
|
If liberty means anything at all, it means the right to tell people what they do not want to hear. George Orwell.
|
|
|
Re: Debugging on Amiga OS4
|
Posted on: 2022/8/28 19:57
#336
|
Quite a regular
|
Then, I am just another person here asking for stuff instead of "doing" stuff. Sure, I have ported a few things over, but I think having a debugger is an absolutely fundamental tool.
What do we need to do to make this happen?
I remember Trevor talking about GDB some years ago. I recall Richard Stallman talking about the bare-bones essentials for the future or software for an OS/System: a compiler, a debugger are pretty much the top of the list.
We have great people doing great things, but the debugger - for whatever reason - seems to be not getting the dedication it deserves. How can I, or @raziel, or the number of other programmers help? I am not claiming to be useful btw, I just would be happy to help in the development of what is a fundamental tool.
|
If liberty means anything at all, it means the right to tell people what they do not want to hear. George Orwell.
|
|
|
Debugging on Amiga OS4
|
Posted on: 2022/8/28 19:18
#337
|
Quite a regular
|
Hi, I am just curious on getting the latest information wrt. debugging for developers on AmigaOS4.
So far, my understanding is the GDB is not available, and that the closest thing we have is Spotless, which is not fully developed.
Is this the case? Or, am I missing something.
A lot of great work is going on, but having a debugger is really important.
Regs, rjd.
|
If liberty means anything at all, it means the right to tell people what they do not want to hear. George Orwell.
|
|
|
Re: SED does not produce output within SH on X5000 but does with X1000 [SOLVED]
|
Posted on: 2022/8/27 23:48
#338
|
Quite a regular
|
@nbache
Thank you. I will remember that.
|
If liberty means anything at all, it means the right to tell people what they do not want to hear. George Orwell.
|
|
|
Re: SED does not produce output within SH on X5000 but does with X1000 (program version are the same)
|
Posted on: 2022/8/27 21:28
#339
|
Quite a regular
|
Okay, what an ordeal. So, when in SH on the X5000 I noticed - thanks to Snoopy - that it was running SED from AmiCygnix instead of the one in the SDK which is very interesting because when in SH:
which sed
Bring back:
Programs:SDK/local/C/sed
I am afraid that is lies, and not how "which" should behave.
echo $PATH
Returns:
/Cygnix/CygnixPPC/gtk2.24/bin:/Cygnix/CygnixPPC/local/bin:/Cygnix/CygnixPPC/bin:/Cygnix/CygnixPPC/X11R6.3/bin:/gcc/bin:/SDK/C:/SDK/Local/C:/SDK/Local/newlib/bin:/SDK/Local/clib2/bin:/C:.
And, "sed" is in "/Cygnix/CygnixPPC/bin/sed" before "/SDK/Local/C". So now, I guess we cannot trust even "which". === Edit: Actually, "which" is an Amiga program, so when I said "not how which should behave" I assumed I was using a linux version of which. === Okay, wow. The reason "which sed" is bringing back SDK/Local/C is because - yes, it is the Amiga version, and for me, the SDK/Local/C is BEFORE the AmiCygnix WITHIN the Amiga environment context (i.e. typing "PATH" in AmigaShell) It was kind of my mistake. I forgot that "which" was not a core-utils thing, and it is an Amiga application. So - finally - all of this makes sense! === Now, I need to figure out where SH gets its PATH from, and why the Amiga path is not honoured.
Edited by rjd324 on 2022/8/27 21:54:58
|
If liberty means anything at all, it means the right to tell people what they do not want to hear. George Orwell.
|
|
|
Re: SED does not produce output within SH on X5000 but does with X1000 (program version are the same)
|
Posted on: 2022/8/27 21:15
#340
|
Quite a regular
|
Okay, that seems to be it.
For whatever reason, in within SH within Amiga Shell on the X5000, SED is opening up "newlib". When running SED just withing Amiga Shell it opens up "utility" and "dos".
On the X1000 it opens up "utility" and "dos" no matter if just running through Amiga Shell or Amiga Shell->SH.
At this point, I need someone more qualified than me to explain why this is happening.
|
If liberty means anything at all, it means the right to tell people what they do not want to hear. George Orwell.
|
|
|