Search found 399 matches

by Chilly Willy
Sat Jul 02, 2016 10:13 pm
Forum: Programming Discussion
Topic: Design flaw in KosGL
Replies: 12
Views: 1549

Re: Design flaw in KosGL

I'd say that works. Ran three for three, going a few levels each time.
by Chilly Willy
Fri Jul 01, 2016 9:52 pm
Forum: Programming Discussion
Topic: SH4 assembly function call in C
Replies: 15
Views: 2379

Re: SH4 assembly function call in C

Windows CE... ugh. The Dreamcast looks like the old Amiga line (1000/500/2000), and AROS would probably run really well on it. The DC looks more like a CD based Amiga than any of the CD based Amigas. :lol:
by Chilly Willy
Fri Jul 01, 2016 8:28 pm
Forum: Programming Discussion
Topic: Design flaw in KosGL
Replies: 12
Views: 1549

Re: Design flaw in KosGL

Hmm - looking at the kosgl code, I THINK this might be the problem: /* Custom version of sq_cpy from KOS for copying vertex data to the PVR */ static inline void pvr_list_submit(void *src, int n) { GLuint *d = TA_SQ_ADDR; GLuint *s = src; /* fill/write queues as many times necessary */ while(n--) { ...
by Chilly Willy
Fri Jul 01, 2016 8:09 pm
Forum: Programming Discussion
Topic: SH4 assembly function call in C
Replies: 15
Views: 2379

Re: SH4 assembly function call in C

A quick note: You should experiement using library code, not kernel code. The icache flushing code likely requires privileged mode so calling it from your user code is not advisable. KOS doesn't actually provide a "user" mode. Lots of things would break horribly if we did. :wink: Almost a...
by Chilly Willy
Fri Jul 01, 2016 2:36 pm
Forum: Programming Discussion
Topic: Design flaw in KosGL
Replies: 12
Views: 1549

Re: Design flaw in KosGL

Actually, as far as I know it's a single thread. I haven't looked at the display list routines enough to see what the issue could be, but your guess was mine as well. All I know right now is that using memcpy4 works every time while sq_cpy fails within random amount of time, rarely allowing you to p...
by Chilly Willy
Fri Jul 01, 2016 2:16 pm
Forum: Programming Discussion
Topic: SH4 assembly function call in C
Replies: 15
Views: 2379

Re: SH4 assembly function call in C

Gcc can handle clobber registers and memory on the SH just like the x86. That said, inline assembly in gcc is not all that fun. It's much easier and cleaner to make an assembly FILE that holds the pure assembly functions. For example, make a test.s file with this .text .align 4 ! int SetSHSR(int lev...
by Chilly Willy
Thu Jun 30, 2016 11:30 am
Forum: Programming Discussion
Topic: Design flaw in KosGL
Replies: 12
Views: 1549

Design flaw in KosGL

I knew I'd find it eventually. While hunting through the PVR code for any reason why the game would simply stop flipping buffers, I noticed this: if(flags & PVR_TXRLOAD_DMA) { mutex_lock((mutex_t *)&pvr_state.dma_lock); pvr_txr_load_dma(img->data, dst, img->byte_count, (flags & PVR_TXRLO...
by Chilly Willy
Mon Jun 27, 2016 12:25 am
Forum: Programming Discussion
Topic: Technical question on PVR DMA
Replies: 2
Views: 635

Re: Technical question on PVR DMA

That's one thing I thought - doing val & ~2 and val & ~1 makes sense there, but the code as it is doesn't match the docs at all. In my experience on the 32X with the SH2, reading the CHCR and immediately writing back 0 let's you then setup the next DMA operation. Not doing that makes it igno...
by Chilly Willy
Thu Jun 23, 2016 11:58 pm
Forum: Programming Discussion
Topic: Technical question on PVR DMA
Replies: 2
Views: 635

Technical question on PVR DMA

The PVR driver uses one of the DMA channels in the SH4 to do its transfers, but in looking at the code, I saw this val = shdma[DMAC_CHCR2]; if(val & 0x1) /* DE bit set so we must clear it */ shdma[DMAC_CHCR2] = val | 0x1; if(val & 0x2) /* TE bit set so we must clear it */ shdma[DMAC_CHCR2] =...
by Chilly Willy
Sat Jun 18, 2016 11:34 pm
Forum: Programming Discussion
Topic: A few notes about the devkit for Debian/Ubuntu users
Replies: 7
Views: 1182

Re: A few notes about the devkit for Debian/Ubuntu users

Hmm - this is the page I normally use for "fixing" scripts to work with dash. It's always worked for me so far.

http://mywiki.wooledge.org/Bashism

It says it was last updated on 2016-04-26.
by Chilly Willy
Sat Jun 18, 2016 9:03 pm
Forum: Programming Discussion
Topic: A few notes about the devkit for Debian/Ubuntu users
Replies: 7
Views: 1182

Re: A few notes about the devkit for Debian/Ubuntu users

The for loop isn't supported according to a couple dash/bash difference pages I've read. Also some issues with the case statement. Under xubuntu 16.04 dash, the kos-cc script was never using the right USEMODE as far as my testing showed. It worked fine when I switched to bash... not that that cured ...
by Chilly Willy
Sat Jun 18, 2016 11:55 am
Forum: Programming Discussion
Topic: A few notes about the devkit for Debian/Ubuntu users
Replies: 7
Views: 1182

A few notes about the devkit for Debian/Ubuntu users

I've run into this before, but many folks working on devkits make bash scripts. The problem is that Debian and any distro derived from Debian have been using dash for quite a few years. While dash strives for speed and POSIX compliance, bash keeps adding more and more non-standard features to tempt ...
by Chilly Willy
Wed Jun 15, 2016 12:42 pm
Forum: Programming Discussion
Topic: Bug in dc-tool
Replies: 3
Views: 835

Re: Bug in dc-tool

Cool, thanks. At least that was an easy one. :)
by Chilly Willy
Tue Jun 14, 2016 10:39 pm
Forum: Programming Discussion
Topic: Bug in C++ version of fread
Replies: 3
Views: 919

Re: Bug in C++ version of fread

The program opens all files in use and leaves them open until you explicitly delete the refs. Then functions are called that fseek/fread the open files. In the case we're talking about, a WAD file is being scanned for chunks. It reads the header okay, then failed to read the directory. When I got it...
by Chilly Willy
Mon Jun 13, 2016 12:07 pm
Forum: Programming Discussion
Topic: Bug in C++ version of fread
Replies: 3
Views: 919

Bug in C++ version of fread

While working on a C++ program with the current KOS, I ran into a problem - fread() doesn't work for jack. It sometimes works, and many times doesn't. There's no rhyme or reason to be found - it just fails whenever it feels like it. It works fine in C programs - not a hitch at all. What I've done at...
by Chilly Willy
Sun Jun 12, 2016 3:01 pm
Forum: Programming Discussion
Topic: Bug in dc-tool
Replies: 3
Views: 835

Bug in dc-tool

I think I found a bug in dc-tool. In syscalls.c in dc_cdfs_redir_read_sectors(), buf is allocated but never freed. In the other functions that allocate a buffer, it's freed before returning.

This was in dcload-ip; I imagine dcload has the same issue with dc-tool.
by Chilly Willy
Fri Jun 03, 2016 10:30 am
Forum: Programming Discussion
Topic: kos-ports missing includes for jpeg
Replies: 1
Views: 556

kos-ports missing includes for jpeg

You missed a couple include files for libjpeg. The makefile needs the last two added like this

Code: Select all

INSTALLED_HDRS =	jconfig.h jmorecfg.h jpeg.h jpeglib.h jpegint.h jerror.h
Not many use jpegint.h, but quite a few I've seen use jerror.h. Both need to be present if the app defines JPEG_INTERNALS.
by Chilly Willy
Thu Jun 02, 2016 4:28 pm
Forum: Programming Discussion
Topic: KOS - KOS-PORTS mismatch?
Replies: 14
Views: 1445

Re: KOS - KOS-PORTS mismatch?

The GCC version used to compile the toolchain shouldn't matter at this point. A patch was provided to make it work with GCC 5.x. As for the GCC version used for the toolchain itself, I'd have to actually test out newer versions of GCC to make any comment on them. I haven't had the time nor energy t...
by Chilly Willy
Wed Jun 01, 2016 6:37 pm
Forum: Programming Discussion
Topic: KOS - KOS-PORTS mismatch?
Replies: 14
Views: 1445

Re: KOS - KOS-PORTS mismatch?

I think I have a way that should fix it on either (or at least this works on OS X and some references indicate that it should work on Linux as well)... Try changing if [ -n "${HDR_DIRECTORY}" ] ; then \ cp -r ${HDR_DIRECTORY}/ ../../inst/include ; \ fi ; \ To this: if [ -n "${HDR_DIR...
by Chilly Willy
Tue May 31, 2016 11:12 pm
Forum: Programming Discussion
Topic: KOS - KOS-PORTS mismatch?
Replies: 14
Views: 1445

Re: KOS - KOS-PORTS mismatch?

Yeah, it's a BSD vs linux problem. The man for cp for linux is not at all like that. Linux cp works like this: http://www.gnu.org/software/coreutils/manual/html_node/cp-invocation.html In particular, look at this: http://www.gnu.org/software/coreutils/manual/html_node/Target-directory.html The cp, i...