Search found 105 matches

by TapamN
Fri Apr 19, 2024 7:25 am
Forum: Programming Discussion
Topic: KOS Examples not Building
Replies: 2
Views: 29

Re: KOS Examples not Building

It looks like it's trying to use vqenc, but it hasn't been built yet. Go to the /opt/toolchains/dc/kos/utils/vqenc/ directory and build vqenc.
by TapamN
Fri Feb 23, 2024 5:33 pm
Forum: Programming Discussion
Topic: CDDA Won't Loop Last Track on GDEMU/MODE
Replies: 12
Views: 836

Re: CDDA Won't Loop Last Track on GDEMU/MODE

I have the basic CD driver working. You use can use stdio and fs_read to read stuff via DMA, with caching similar to KOS's existing CD cache, and it handles reads from multiple threads at the same time fine (trying that on KOS will hang those threads, though not the entire system). It probably doesn...
by TapamN
Fri Feb 23, 2024 4:55 pm
Forum: Programming Discussion
Topic: Crowdfunding the improvement of the gcc SH backend
Replies: 16
Views: 718

Re: Crowdfunding the improvement of the gcc SH backend

Could you open a bug report for that in the gcc bug tracker? [1] Make sure to set sh*-*-* as the target and CC me and Oleg. Also, please prefix the subject with [SH] . Ok, I'll try to do it sometime. It shouldn't be a big deal that I was using a patched version of 12.2? The patches are for integrat...
by TapamN
Wed Feb 21, 2024 6:16 am
Forum: Programming Discussion
Topic: Crowdfunding the improvement of the gcc SH backend
Replies: 16
Views: 718

Re: Crowdfunding the improvement of the gcc SH backend

I'd be willing to help fund improvements. It would be nice if GCC would compile "char val = *char_ptr++;" as a single instruction, instead of four! [1] Related aside: I was recently looking into -mrelax and how/why it only partially works on GCC 12.2. Until a couple of years ago, would reg...
by TapamN
Sun Jan 28, 2024 5:33 pm
Forum: Programming Discussion
Topic: pvrtex - PVR Texture Encoder
Replies: 14
Views: 1272

Re: pvrtex - PVR Texture Encoder

Apparently Tvspelsfreak's texconv was never even considered for being added to KOS due to the big-ass Qt dependency. I always thought it was a massive shame and that it feels wrong to have a Dreamcast SDK without such a tool built into it... is there any way you would consider letting us put this i...
by TapamN
Sun Jan 28, 2024 5:22 pm
Forum: Programming Discussion
Topic: HDR rendering on Dreamcast
Replies: 15
Views: 2802

Re: HDR rendering on Dreamcast

If we were to twiddle the reduced buffer, it would work much faster. In that case, the tile matrix would have to be uniquely aligned (e.g. horizontally) and the KOS PVR would have to be hijacked, so it might not be suitable as a sample. Yes, I've done 60 FPS bloom on the DC , and twiddling the bloo...
by TapamN
Sat Dec 23, 2023 5:36 pm
Forum: Programming Discussion
Topic: Timer precision
Replies: 13
Views: 1503

Re: Timer precision

Do you have example of doing this The clock counts the 50 MHz peripheral clock, divided by four (which would be 12.5 MHz), but it can be set to count on both the rising and falling edges of the clock, doubling it back up to 25 MHz. i have not been able to get this to work.. I haven't tried this, bu...
by TapamN
Thu Oct 26, 2023 4:04 pm
Forum: Programming Discussion
Topic: Timer precision
Replies: 13
Views: 1503

Re: Timer precision

I think you have the right final result, but the calculation is off. The clock counts the 50 MHz peripheral clock, divided by four (which would be 12.5 MHz), but it can be set to count on both the rising and falling edges of the clock, doubling it back up to 25 MHz. One complaint I have about the ti...
by TapamN
Thu Oct 26, 2023 3:26 pm
Forum: Programming Discussion
Topic: What's the fastest implementation of the cross product on the SH4?
Replies: 3
Views: 1097

Re: What's the fastest implementation of the cross product on the SH4?

For a cross product, I think it would be better to just let GCC decide how to preform it than using inline asm. That way GCC has more freedom to allocate and move registers around, rather than having to get things lined up for how the asm wants it. And, if you were writing asm yourself, I think it c...
by TapamN
Thu Sep 28, 2023 4:52 am
Forum: Programming Discussion
Topic: pvrtex - PVR Texture Encoder
Replies: 14
Views: 1272

Re: pvrtex - PVR Texture Encoder

I don't know your environment but guess try find /opt/local/include -name avconfig.h I'm using Xubuntu 20.04. All #includes using avconfig.h are local includes (#include "libavutil/avconfig.h"), so I don't think they should be using the system's headers. When I was first setting up the co...
by TapamN
Wed Sep 27, 2023 12:31 am
Forum: Programming Discussion
Topic: pvrtex - PVR Texture Encoder
Replies: 14
Views: 1272

Re: pvrtex - PVR Texture Encoder

I tried to build avconfig.h under libavutil seems to be missing. It does not seem to be affected by its . Odd, you're right. I'm surprised it compiles on my system. I wonder why? Is it somehow using my system's avconfig.h? New version with minor fixes: Add missing header (I don't think it's used by...
by TapamN
Wed Sep 13, 2023 6:38 am
Forum: Programming Discussion
Topic: Use fs_read instead of fread
Replies: 3
Views: 348

Re: Use fs_read instead of fread

So, the reason BBA is so slow is because newlib breaks up every I/O operation into tiny chunks, and dcload-ip is kind of half baked and doesn't handle many small requests well. I feel incredibly stupid for not thinking about this earlier, but you can use setvbuf to disable stdio's buffering on a str...
by TapamN
Wed Sep 06, 2023 2:24 am
Forum: Programming Discussion
Topic: pvrtex - PVR Texture Encoder
Replies: 14
Views: 1272

Re: pvrtex - PVR Texture Encoder

Thanks again TapamN! I'll check this out when I have some time. Btw, do you have a github/gitlab/other? My game framework library auto-downloads its dependencies so it would be nice to add a download for this without the 7-zip requirement. I have SourceForge and GitHub accounts, that I've used for ...
by TapamN
Wed Aug 30, 2023 4:15 am
Forum: Programming Discussion
Topic: pvrtex - PVR Texture Encoder
Replies: 14
Views: 1272

pvrtex - PVR Texture Encoder

After running across a post on using FFmpeg's ELBG for encoding Cinepak (which uses vector quantization), I thought I'd try seeing how well it would work for the Dreamcast. It worked quite well, so I ended up creating a full texture convertor (including uncompressed textures). Source code is attache...
by TapamN
Tue Aug 29, 2023 2:42 pm
Forum: Programming Discussion
Topic: Pvr dma glitch at the bottom ?
Replies: 6
Views: 262

Re: Pvr dma glitch at the bottom ?

That's much better, but from my benchmarks, the fastest way I've found to flush a large part of the cache is pctPurgeCache in the code in this attachment . I also tried flushing/purging the cache by accessing the memory mapped cache tags, but it still wasn't faster than pctPurgeCache. KOS's function...
by TapamN
Tue Aug 29, 2023 3:54 am
Forum: Programming Discussion
Topic: Is spritesheet demo appropriate for tilemapping
Replies: 2
Views: 179

Re: Is spritesheet demo appropriate for tilemapping

Using the sprite command for tile maps works fine. I worked on an unfinished port of Micropolis (open source SimCity Classic), and I used the sprite command to render the city as a 120x100 tile tilemap without issues.

When using KOS's PVR driver, the driver will handle flipping automatically.
by TapamN
Sun Aug 27, 2023 4:17 am
Forum: Programming Discussion
Topic: Pvr dma glitch at the bottom ?
Replies: 6
Views: 262

Re: Pvr dma glitch at the bottom ?

It looks like the cache isn't being flushed properly. dcache_flush_range((uintptr_t)textures[current_frame], (uintptr_t)(textures[current_frame] + stride * texture_height * 2)); // Send the video frame as a texture over to video RAM pvr_txr_load_dma(buf, textures[current_frame], stride * texture_hei...
by TapamN
Sat Aug 26, 2023 4:59 am
Forum: Programming Discussion
Topic: CDDA Won't Loop Last Track on GDEMU/MODE
Replies: 12
Views: 836

Re: CDDA Won't Loop Last Track on GDEMU/MODE

Interesting. I guess tvspelsfreak just didn't test it and accepted the SEGA docs like the rest of us did. Glad you tested it. And yeah, makes sense with that palette+compressed+X-linear bug, since SEGA didn't even intend compressed paletted textures to be usable. If you don't use mipmaps or filteri...
by TapamN
Fri Aug 25, 2023 10:25 pm
Forum: Programming Discussion
Topic: CDDA Won't Loop Last Track on GDEMU/MODE
Replies: 12
Views: 836

Re: CDDA Won't Loop Last Track on GDEMU/MODE

Hey TapamN, I just heard about your project and its really cool. Its always good to have multiple options, especially since not everyone wants to use Qt stuff. A few things you said stand out to me and other people, so I'd like to ask for more details about them: - Can you really have a compressed ...
by TapamN
Mon Aug 07, 2023 5:27 pm
Forum: Programming Discussion
Topic: CDDA Won't Loop Last Track on GDEMU/MODE
Replies: 12
Views: 836

Re: CDDA Won't Loop Last Track on GDEMU/MODE

I've been distracted with other things, but getting back to the driver and decoder is my next task. I ran across a post mentioning FFMPEG's ELBG for VQ compression, tried using that for Dreamcast VQ, and it worked very well. I ended up making such good progress on getting a texture compressor/encode...