Search found 399 matches
- Fri Jul 22, 2016 11:34 pm
- Forum: Programming Discussion
- Topic: Possible bug?
- Replies: 3
- Views: 1044
Re: Possible bug?
It's one of those weird things you run into by accident. I'm working on video playing and wanted a quick update for the player OpenGL texture and was googling for various ways people do this. On "old" OpenGL, you use glSubTexImage2D when available, or glTexImage2D if not, and something els...
- Fri Jul 22, 2016 12:19 pm
- Forum: Programming Discussion
- Topic: Possible bug?
- Replies: 3
- Views: 1044
Possible bug?
I'm not the expert on OpenGL, but if I've read various guides right, I think this is a bug. In glTexImage2D(), you find this code: GL_KOS_TEXTURE_UNIT[GL_KOS_ACTIVE_TEXTURE]->width = width; GL_KOS_TEXTURE_UNIT[GL_KOS_ACTIVE_TEXTURE]->height = height; GL_KOS_TEXTURE_UNIT[GL_KOS_ACTIVE_TEXTURE]->mip_m...
- Mon Jul 18, 2016 6:11 pm
- Forum: Programming Discussion
- Topic: Trying to get interrupts to work
- Replies: 12
- Views: 1385
Re: Trying to get interrupts to work
Oh, you need to edit the dreamcast environment script. Look for this line export KOS_LDFLAGS="${KOS_LDFLAGS} -ml -m4-single-only -Wl,-Ttext=0x8c010000 -Wl,--gc-sections" That sets the address that everything links to. Hmm - that does lead to a tricky situation - you need some of the code i...
- Mon Jul 18, 2016 3:33 pm
- Forum: Programming Discussion
- Topic: Trying to get interrupts to work
- Replies: 12
- Views: 1385
Re: Trying to get interrupts to work
Most OSes setup the user level task at kernel level, then use a return from exception to run the task. One of the main things a return from exception does is restore the level the task had before the exception occurred. So it can switch you from kernel to user mode while simultaneously jumping to th...
- Fri Jul 15, 2016 2:00 pm
- Forum: Programming Discussion
- Topic: Debug message expanded to handle vga
- Replies: 1
- Views: 2740
Debug message expanded to handle vga
In vid_set_mode_ex(), you have a debug message: dbglog(DBG_INFO, "vid_set_mode: %ix%i%s %s%s\n", mode->width, mode->height, (mode->flags & VID_INTERLACE) ? "IL" : "", (mode->flags & VID_PAL) ? "PAL" : "NTSC", (mode->generic & DM_MULTIBUFF...
- Fri Jul 15, 2016 1:56 pm
- Forum: Programming Discussion
- Topic: Trying to get interrupts to work
- Replies: 12
- Views: 1385
Re: Trying to get interrupts to work
Yes, most processors do something like that because an exception during an exception is usually fatal. BTW, interrupts are also exceptions, just a specific type (asynchronously externally generated and possibly masked). When testing exception handlers, a trap command is very handy as you can use inl...
- Fri Jul 15, 2016 12:05 pm
- Forum: Programming Discussion
- Topic: Trying to get interrupts to work
- Replies: 12
- Views: 1385
Re: Trying to get interrupts to work
KOS sets up a lot of stuff. Look at kos/kernel/arch/dreamcast/kernel/init.c - the standard kos start calls arch_main, which clears the bss, calls arch_auto_init, calls all the ctors, and then calls main(). The arch_auto_init does a lot of hardware setup. And in general, exceptions ALWAYS occur. Inte...
- Wed Jul 13, 2016 2:03 pm
- Forum: Programming Discussion
- Topic: How's your sound?
- Replies: 3
- Views: 946
Re: How's your sound?
Yeah, should have made that clear. I was talking about the channel volume rather than the master volume. Which is really an attenuator as BlueCrab points out. Attenuators are almost always logarithmic rather than linear. The channel volume function tries to convert that to linear, and does a decent ...
- Sat Jul 09, 2016 11:08 pm
- Forum: Programming Discussion
- Topic: request
- Replies: 10
- Views: 971
Re: request
I've got what I think is the final version, pending criticism. :grin: I took the wait for start out of the play function, so it's back to normal. I kept the update function, but added more to it, using a new aica driver variable to help. typedef struct aica_channel { uint32 cmd; /* Command ID */ uin...
- Sat Jul 09, 2016 6:15 pm
- Forum: Programming Discussion
- Topic: How's your sound?
- Replies: 3
- Views: 946
How's your sound?
I mentioned this in another thread, but I thought I'd make a separate one just for this. Has anyone experimented with the volume levels on their DC? What range do you get for your setup? I have my DC hooked to a VGA box which feeds a Sceptre 21" monitor. I'm using the monitor speakers, which ar...
- Sat Jul 09, 2016 1:25 pm
- Forum: Programming Discussion
- Topic: request
- Replies: 10
- Views: 971
Re: request
Let me use Doom as an example... you start a sound with a particular frequency, volume, and pan based on where it is in relation to the player. Then during the sound ticker, it updates all the sounds in case the player moved or turned, or the sound source moved. So the volume and pan can change at a...
- Fri Jul 08, 2016 7:50 pm
- Forum: Programming Discussion
- Topic: request
- Replies: 10
- Views: 971
Re: request
This is why you don't rush to commit new code. Upon testing, I found that once a single-shot sfx is done, the chpos returns to 0. So I tried this code for the update function... if(chpos == 0) return 1; /* done */ Except that immediately fails because the channel doesn't start the moment you start t...
- Fri Jul 08, 2016 7:41 pm
- Forum: Programming Discussion
- Topic: Design flaw in KosGL
- Replies: 12
- Views: 1538
Re: Design flaw in KosGL
Yeah, it was a relief to see it was just a minor issue. Good to see you back!
- Thu Jul 07, 2016 12:13 pm
- Forum: Programming Discussion
- Topic: Trying to get interrupts to work
- Replies: 12
- Views: 1385
Re: Trying to get interrupts to work
Interrupt handlers MUST save and restore ANY register that is used. In fact, your handler itself is walking on r0 and PR without saving and restoring them. In general, if you plan to use C/C++ code from interrupts, save and restore ALL registers, period. Well, you don't have to save the FP regs... b...
- Thu Jul 07, 2016 11:51 am
- Forum: Programming Discussion
- Topic: request
- Replies: 10
- Views: 971
Re: request
Eventually (not any time real soon), I plan to look into some more improvements in the sound effects manager. Looping in particular would allow for usage with certain kinds of music playback, like MOD, XM, IT, etc. Processing a MOD/XM score is nothing - even slow 16-bit processors could do that and ...
- Wed Jul 06, 2016 11:19 am
- Forum: Programming Discussion
- Topic: request
- Replies: 10
- Views: 971
Re: request
Right. Sounds good. I'll do that once I've had a chance to test this a bit. I might also make a small example that shows using sfx seeing as all the sound examples only demonstrate using the streaming music. The changes in format are minor, so it's not an issue, but as to line length, the sound file...
- Tue Jul 05, 2016 8:06 pm
- Forum: Programming Discussion
- Topic: request
- Replies: 10
- Views: 971
Re: request
... and slightly more useful. This allows you to tell when a sfx is done. Note that the arm checks the aica position for each playing channel once per loop while waiting for commands, so there will be a tiny delay from the actual finishing of the sfx and when the channel position variable is updated...
- Tue Jul 05, 2016 7:58 pm
- Forum: Developmental Ideas
- Topic: A serious discussion: porting open source engines to DC
- Replies: 3
- Views: 4406
Re: A serious discussion: porting open source engines to DC
One of the biggest problems you see with open source ports of games is that they assume infinite memory. For example, nearly all Doom ports cache graphics, but don't release the graphics when memory gets low because they assume that can't happen. In fact, most now assume you can't run out of video m...
- Sun Jul 03, 2016 1:20 am
- Forum: Programming Discussion
- Topic: request
- Replies: 10
- Views: 971
request
I was looking through the snd_sfxmgr in kos, and it's really nice. However, it's missing one crucial function: an update function. The arm driver has an update function defined #define AICA_CH_CMD_UPDATE 0x00000003 ... /* Update values */ #define AICA_CH_UPDATE_MASK 0x000ff000 #define AICA_CH_UPDATE...
- Sun Jul 03, 2016 1:13 am
- Forum: Programming Discussion
- Topic: Design flaw in KosGL
- Replies: 12
- Views: 1538
Re: Design flaw in KosGL
Glad to help. That was a tough nut to crack.