Incorrect DMA code in KOS?

If you have any questions on programming, this is the place to ask them, whether you're a newbie or an experienced programmer. Discussion on programming in general is also welcome. We will help you with programming homework, but we will not do your work for you! Any porting requests must be made in Developmental Ideas.
Post Reply
User avatar
bogglez
Moderator
Moderator
Posts: 576
Joined: Sun Apr 20, 2014 9:45 am
Has liked: 0
Been liked: 0

Incorrect DMA code in KOS?

Post by bogglez » Fri Aug 12, 2016 4:26 am

I've compared kos/kernel/arch/dreamcast/hardware/pvr/pvr_dma.c to the official SH4 documentation "Hitachi SuperH RISC engine SH7750 Series SH7750, SH7750S
Hardware Manual" (page 436 of 850) and found the code to write to reserved bits, for example in line 113.
Is this code just incorrect or are the bits used in the DC CPU?

Wiki & tutorials: http://dcemulation.org/?title=Development
Wiki feedback: viewtopic.php?f=29&t=103940
My libgl playground (not for production): https://bitbucket.org/bogglez/libgl15
My lxdream fork (with small fixes): https://bitbucket.org/bogglez/lxdream
MetalliC
DCEmu Crazy Poster
DCEmu Crazy Poster
Posts: 27
Joined: Wed Apr 23, 2014 3:04 pm
Has liked: 0
Been liked: 0

Re: Incorrect DMA code in KOS?

Post by MetalliC » Mon Aug 15, 2016 9:06 am

you mean shdma[DMAC_CHCR2] = 0x12c1; ?
cant see anything wrong here

on side note... not well known fact - HOLLY-chipset based hardware (DC, NAOMI, etc) uses *NOT* SH4 CPU.
but custom designed chip - SH7091 (HD6417091), sadly there no public available docs for it, we only know it have several (but not all) SH-4A SH7780 extended CPU instructions - FSRRA, FSCA, etc

but there can be more differences with 'regular' SH4, so SH7750's hardware manuals is not really trustable source of information about Dreamcast's CPU.
User avatar
BlueCrab
The Crabby Overlord
The Crabby Overlord
Posts: 5383
Joined: Mon May 27, 2002 11:31 am
Location: Sailing the Skies of Arcadia
Has liked: 1 time
Been liked: 11 times
Contact:

Re: Incorrect DMA code in KOS?

Post by BlueCrab » Mon Aug 15, 2016 9:32 am

Actually, I'm pretty sure that all of the SH4 line had the fsca and fsrra instructions (source: GCC mailing list post from a SuperH employee).
MetalliC
DCEmu Crazy Poster
DCEmu Crazy Poster
Posts: 27
Joined: Wed Apr 23, 2014 3:04 pm
Has liked: 0
Been liked: 0

Re: Incorrect DMA code in KOS?

Post by MetalliC » Mon Aug 15, 2016 10:58 am

well, I've seen two gaming systems with 'regular' SH7750 - Gaelco's ATV Track and Smashing Drive (2x SH7750 + PVR2 NEON250) and Aristokrat MK6 gambling machines (SH7750 + PVR2 NEON250).
both of them doesn't use FSRAA or FSCA opcodes, so I'm pretty sure 7750 haven't them.

I think you misunderstood that employee message, its more likely he meant this instructions is SH4 because DC's custom SH7091 is part of SH4 line/family, and he have this instructions.
but it doesn't mean 'regular' SH7750 SH4 have them
User avatar
BlueCrab
The Crabby Overlord
The Crabby Overlord
Posts: 5383
Joined: Mon May 27, 2002 11:31 am
Location: Sailing the Skies of Arcadia
Has liked: 1 time
Been liked: 11 times
Contact:

Re: Incorrect DMA code in KOS?

Post by BlueCrab » Mon Aug 15, 2016 12:09 pm

That is not what that employee said (and what other replies in the thread have also indicated). He clearly said that the SH4 has those opcodes, and GCC/GNU Assembler fully support using them on SH4 (not just SH4A) targets.

A later reply in the thread also confirms that the entire SH4 line has the opcodes, but that they were only majorly tested on the SH7750 (as a "customer" requested them).
Chilly Willy
DC Developer
DC Developer
Posts: 414
Joined: Thu Aug 20, 2009 11:00 am
Has liked: 0
Been liked: 2 times

Re: Incorrect DMA code in KOS?

Post by Chilly Willy » Mon Aug 15, 2016 2:39 pm

Does gas support the known DC-SH4 opcodes?
User avatar
BlueCrab
The Crabby Overlord
The Crabby Overlord
Posts: 5383
Joined: Mon May 27, 2002 11:31 am
Location: Sailing the Skies of Arcadia
Has liked: 1 time
Been liked: 11 times
Contact:

Re: Incorrect DMA code in KOS?

Post by BlueCrab » Mon Aug 15, 2016 3:44 pm

Chilly Willy wrote:Does gas support the known DC-SH4 opcodes?
Those would be fsrra and fsca. They've been supported in GNU Assembler for a while (about 10 years or so, IIRC).

EDIT: Make that about 12 and a half years (source)...
MetalliC
DCEmu Crazy Poster
DCEmu Crazy Poster
Posts: 27
Joined: Wed Apr 23, 2014 3:04 pm
Has liked: 0
Been liked: 0

Re: Incorrect DMA code in KOS?

Post by MetalliC » Wed Aug 17, 2016 9:49 am

BlueCrab wrote:That is not what that employee said (and what other replies in the thread have also indicated). He clearly said that the SH4 has those opcodes, and GCC/GNU Assembler fully support using them on SH4 (not just SH4A) targets.
it depends on definition of term "SH4"
as far as I know there no some specific "SH4" chip, it is family of MCUs, often very different.
BlueCrab wrote: A later reply in the thread also confirms that the entire SH4 line has the opcodes, but that they were only majorly tested on the SH7750 (as a "customer" requested them).
can you please point this message ? about it was tested (using some 7750 dev board ?)
User avatar
BlueCrab
The Crabby Overlord
The Crabby Overlord
Posts: 5383
Joined: Mon May 27, 2002 11:31 am
Location: Sailing the Skies of Arcadia
Has liked: 1 time
Been liked: 11 times
Contact:

Re: Incorrect DMA code in KOS?

Post by BlueCrab » Wed Aug 17, 2016 10:00 am

MetalliC wrote:
BlueCrab wrote: A later reply in the thread also confirms that the entire SH4 line has the opcodes, but that they were only majorly tested on the SH7750 (as a "customer" requested them).
can you please point this message ? about it was tested (using some 7750 dev board ?)
https://gcc.gnu.org/ml/gcc-patches/2005 ... 01176.html

Note: This is speaking of "internal" testing (i.e, during the actual development process at the company making the CPU -- not on random development boards after the CPU design was finalized and produced).
Post Reply