Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - XL2

Pages: 1 ... 4 5 [6] 7 8 ... 23
76
Free talk / Re: Would a Flash player be possible?
« on: July 15, 2018, 12:56:05 am »
RAM, RAM, RAM. And it would probably be slow and you would only be able to run a few programs. I'm not sure how the 486 handled it, but I guess the performance should be somewhat similar.

77
Project announcement / Re: Sonic Z-Treme
« on: July 14, 2018, 07:47:11 pm »
I'm not sure I understand what you mean, but I don't have time right now to focus on little details as I barely got some gameplay.

78
Project announcement / Re: Sonic Z-Treme
« on: July 14, 2018, 05:41:48 pm »
Yes, it's frustrating. Try all main 3 emulators each time before burning a disk.
You should also try the USB cart if you don't need cd access for your tests.
At least I understand how the whole paletted gouraud shading bug works, so I can at least plan ahead and make sure it works on paper before wasting a disk.
But it does look truly amazing on real hardware, I hope I can expand it for more effects as it looks like something you would see on PS2 or Dreamcast, not Saturn.

79
Project announcement / Re: Sonic Z-Treme
« on: July 14, 2018, 05:02:29 am »
Ok, scratch that, the green gouraud bug works on real hardware as I thought, but not on emulator sadly.
But it does allow pseudo environment mapping and easy switching between flat and gouraud shading.

80
Project announcement / Re: Sonic Z-Treme
« on: July 14, 2018, 02:31:38 am »
No, I will try to focus more on the gameplay for now.
I spend a bit too much time on graphics, but the gameplay is super buggy now.

81
Project announcement / Re: Sonic Z-Treme
« on: July 13, 2018, 09:56:31 pm »
Using CRAM and paletted sprites/gouraud to create a bump mapping effect was easier than I thought.
It works, but sadly using the green gouraud didn't seem to work, so only the red worked for me so far.

82
Project announcement / Re: Sonic Z-Treme
« on: July 13, 2018, 01:15:38 am »
I'm using SGL, which makes heavy use of the slave SH2, so it's not an option. Even in Sonic R they scrapped using it ingame, probably because it was too intensive for such a little effect.
If I were to use software rendering, it would be for something such as transparency on the NBG0 or NBG1 layer, using them as framebuffers.
And only if I could use the SCU DSP or sound cpu to do it.

83
Project announcement / Re: Sonic Z-Treme
« on: July 12, 2018, 10:52:46 pm »
Environment mapping is a sure no, it's super slow to read from the framebuffer and there are no texture coordinates.
I am considering power ups but I have many other things to do first.


84
Project announcement / Re: Sonic Z-Treme
« on: July 12, 2018, 06:50:53 pm »
I'm doing something similar, but I'm not reading the mtl file so I just use the texture name.
I will expand that system in the future to try to allow bump mapping.

85
Project announcement / Re: Sonic Z-Treme
« on: July 10, 2018, 10:20:52 pm »
Thanks.
Good news : SAGE as been pushed back one month, which should help me quite a bit to get a demo out in time.
I've also added support for very basic paletted light sources (per face instead of per vertex, so no gouraud for now).
I will have to improve my support for light sources, but it doesn't look bad and comes at no costs since it's just precomputed.

I might stick with this technique and maybe use gouraud shading on special objects to allow bump mapping (see third and fourth images for the SGL tech demos).

86
General Jo Engine Help / Re: Request for real hardware tests
« on: July 08, 2018, 12:53:05 am »
Well, I'm already doing that in Z-treme, I could try to share it soon enough.

87
General Jo Engine Help / Re: Request for real hardware tests
« on: July 07, 2018, 09:41:36 pm »
What do you mean about variable interpolation?
About the real hardware, I don't even have access to real hardware for now so I can't help you for now.

88
General Jo Engine Help / Re: Request for real hardware tests
« on: July 07, 2018, 03:29:50 pm »
Can you show me the problem?
I won't have access to my Saturn for a while.
About the matrix issue, how big is it?
A couple of vertices?
If so, move your vertices to high ram (just set your model's pdata pntbl pointer to a global array of say 200 vertices, the model functions will just overwrite the data anyway).
Your pcm functions are also on low ram?
Make sure the alignment is right.
There is a SGL document somewhere that explains issues with audio stored in low ram, again because - if I'm not mistaken - you can't do scu dma from low ram.
Make sure your audio buffer is in high ram.
Low ram is slower and has many restrictions as it's not directly linked with the scu.

89
General Jo Engine Help / Re: Request for real hardware tests
« on: July 05, 2018, 10:22:32 pm »
Here is from my readme for a (someday) to be shared engine :

*********************************************
Z-TREME ENGINE AUDIO IMPLEMENTATION - README
2018-04-05
*********************************************

Using audio is a bit tricky and it might take you a while to get it right.
Most homebrew apps simply use PCM audio from the work ram and DMA it in the sound RAM buffer area.
The issue with this is that it wastes precious RAM, adds CPU overhead and hogs the B-BUS with DMA transfers (the same bus that connects the SH2 CPUs with the VDP1 and VDP2).

The best solution is to use the audio processors and the audio RAM with MIDI sequences - but instead of using sequences, we will use direct MIDI commands to the sound driver.
Sadly, I won't have time in the near future to write an app to replace the Sega Sound Tools, so right now the solution is tricky and not user-friendly.
All the Sega Sound Tools apps are for old 68K Macs and they require extra hardware (like a sound box).
By using an emulator, we can do almost everything we need for sound effects.

The solution is the following :

1) Download an old Mac emulator (68K). I use BASILISK II : https://basilisk.cebix.net/

2) Set your MAC OS 7 ROM

3) Download the Sound Tools : https://antime.kapsi.fi/sega/docs.html

4) Make sure you have .AIFF (Big endian) audio that you want to use. It will all be put in sound RAM (512 KB), so make sure you have no more than about 400 KB.

5) Use the Tone Editor to create your tone data : https://antime.kapsi.fi/sega/files/ST-068-R1-042594.pdf
   You can also look at the SGL tutorial documentation (Page 2-8) to see how to use it : https://antime.kapsi.fi/sega/files/ST-237-R1-051795.pdf
   Note that you should use only 1 bank (or switch banks ingame) and keep all the sounds in different layers.
   YOU NEED to offset the base pitch! Your first value should be C4 (60) for both beginning and end in the layer section.
   Each subsequent sound should increase that value by 1.
   Make sure you change the base pitch with the same increase. If all your audio is 22,050 khz, your base pitch should be 72 or 84 for 11,025 khz.
   Follow the SGL guide closely as it's pretty complicated the first time!

6) Create your MAP file : you can use the Sound simulator to generate one.
   Look again at the SGL tutorial documentation (Page 2-29)

7) Put your files (MAP, Sound driver and Tone data) in your CD folder, under the SOUND subfolder.

8) Tweak your Z-TREME Engine ZT_AUDIO.c file if you want to use different names, or just use the default names for your files and replace them.
   Make sure that you modify the length of the files as needed.

9) Ingame, just call the sound function when you need to play a sound.
   If you have more than 16 sounds, you will need to do a bank change depending on where your sound is.
   The sound function will stop the previous sound (say sound 60) if the same sound (again sound 60) is called twiced. By using MONO sound, you can play the same sound twice at the same moment, else it will be once only.
   If you wish to have the same sound played on several channels, just remove the MIDI stop command from the ZT_AUDIO.c file, but make sure you clear the channels manualy as needed.
   I suspect that by using the wave editor you might be able to put an end comand at the end of the sound, so that the channel clears itself, but I haven't tried it yet.
   The sound will stop on it's own, but the channel won't be cleared as it is now, which isn't a very huge deal.

Enjoy!

---------
For the audio functions :

#include        "ZTE_DEF.H"
#include        <SEGA_GFS.H>
#include        <SEGA_SND.H>
//#define         SoundSeqBuf      0x25a0b000
static   CdcPly   playdata;
static   CdcPos   posdata;

void loadSndDrv(void)
{
    Sint32 fid;
    void * ptr = (void*)LWRAM;
    fid = GFS_NameToId((Sint8*)"SDDRVS.TSK");
    GFS_Load(fid, 0, (Uint32 *)ptr, 26610);

    ptr=(void*)(LWRAM+26610+2);
    fid = GFS_NameToId((Sint8*)"MAP.BIN");
    GFS_Load(fid, 0, (Uint32 *)ptr, 10);

    SndIniDt sndInit;
    SND_INI_PRG_ADR(sndInit)=(Uint16*)LWRAM;
    SND_INI_PRG_SZ(sndInit)=(Uint16)(26610);

    SND_INI_ARA_ADR(sndInit)=(Uint16*)(LWRAM+26610+2);
    SND_INI_ARA_SZ(sndInit)=(Uint16)(10);
    SND_Init(&sndInit);
}

void loadSndData(void)
{
    SND_ChgMap(0);
    Sint32 fid;
    void * ptr = (void*)LWRAM;
    fid = GFS_NameToId((Sint8*)"TONE.BIN");
    GFS_Load(fid, 0, (Uint32 *)ptr, 352514);
    SND_MoveData((Uint16*)ptr, (Uint32)352514, SND_KD_TONE, 0);
}

/** TODO : Change this implementation for something better and implement MIDI audio **/
void ztPlayCDDA(Sint32 startTrack, Sint32 endTrack)
{
    CDC_PLY_STYPE(&playdata) = CDC_PTYPE_TNO;
    CDC_PLY_STNO(&playdata) = startTrack+1;
    CDC_PLY_SIDX(&playdata) = 1;  //First track ID
    CDC_PLY_ETYPE(&playdata) = CDC_PTYPE_TNO;
    CDC_PLY_ETNO(&playdata) = endTrack+1;
    CDC_PLY_EIDX(&playdata) = 1;
    CDC_PLY_PMODE(&playdata) = CDC_PM_DFL + 15;
    CDC_CdPlay(&playdata);
}

void ztStopCDDA( void )
{
    CDC_POS_PTYPE( &posdata ) = CDC_PTYPE_DFL;   /* Stop Music. */
}

/** NOTE : The current function doesn't clear the channels after the playback, only after you play the sound again. There must be a setting in the tone editor I missed, but for now we just clear it first... **/
void ztPlaySound(Uint8 SFX) //The direct Midi control is as follow : SndRet SND_CtrlDirMidi(SndSeqNum, SndSeqPri, Uint8 MidiCommand, Uint8 MidiChannel, Uint8 pitch, Uint8 velocity);
{
    SND_CtrlDirMidi(0x02, 0x00, MidiNoteOff, Channel1, SFX, 127); //Stop the note (clears the channel)
    SND_CtrlDirMidi(0x02, 0x00, MidiNoteOn, Channel1, SFX, 127); //Plays the note (it will stop playing once it's done, but won't clear the channel)
}

void ztInitSound()
{
    /*
    Sound map structure :
    Byte 0 : 0, using 3 bits for a sequence : 0x0K where K = bank ID, with 4 bits (so max 16 banks per map)
    Bytes 1, 2 and 3 : first 4 bits are unused, the remaining bits are the start of the bank's adress
    Byte 4 : first bit is 0, the rest is unused AFAIK
    Byte 5, 6 and 7 : area size
    */

    ztCDsetDir("SOUND");
    {

        loadSndDrv();
        loadSndData();

        CDC_CdInit(0x00,0x00,0x05,0x0f);

        SND_ChgMix(0, 0);
        SND_SetTlVl(15);

        SND_CtrlDirMidi(0x02, 0x00, MidiCtrlChg, 0x01, 0x20, 0x00);
        SND_CtrlDirMidi(0x02, 0x00, MidiPrgChg, 0x01, 0x00, 0x00);  //If you have more than 1 voice, you will need to do a program change at some point
        SND_SetCdDaLev(6,6);
        SND_SetCdDaPan(0,0);
    }
    ztCDsetRoot();
}

---
Of course, you will need to adapt this code for your needs.
Say you want to play the sound no 0 in your map, just call :
   ztPlaySound(60);


90
General Jo Engine Help / Re: Request for real hardware tests
« on: July 05, 2018, 09:53:58 pm »
You should be able to just delete line 20 of ZT Cd (g_stm_work), "PCM_Init", "STM_Init", and "PCM_DeclareUseAdpcm" as those are SBL functions that I do not use (they are in there because I was testing it). They have no effect on the function of the program. I recommend anyone who builds the program do the same. (.. They also could have been interfering)
Thanks for trying to work with me. And before you waste more CD-Rs, I recommend doing preliminary testing using Bizhawk, and if that works, then move on to real hardware.

And, actually: It didn't run out of PCM memory. You can't actually store PCM files themselves in sound memory; think of it more as a playback buffer. It ran out of LWRAM (1MB).
19 sectors (38 KB) of sound RAM is consumed by the sound driver.
There's only about 16 sectors (32 KB) of PCM playback buffer (8 sectors for mono, 16 sectors for stereo).
And for some reason they have a whopping 436 KB dedicated to "pitch/sequence" . .
Well, sequence = audio files, mainly midi, but you can actualy store pcm files too.
It's what I do to free up some 450 KB of memory.
Take a look at the tone editor with a mac emulator as it's the only way I know of to use pcm audio within sound ram.
Also you only need to transfer commands during v blank instead of dma transfering files.

Pages: 1 ... 4 5 [6] 7 8 ... 23
SMF spam blocked by CleanTalk