PDA

View Full Version : Watara SuperVision emulator



elefas
February 7th, 2005, 10:51
Hi! I just found a supervision emulator in SDL for windows. I am trying to port it to DC. I don't know if a supervision emulator already exists in the scene, if not I hope to give a small contribution to it.
The problem I have is that in some parts it uses windows functions and C++. Can anyone help me to overcome these problems? For example the function timeGetTime() I have replaced it by clock(). Is that correct?
The code compiles ok with sh-elf g++ (I develop it using the Dev-Cpp environment), the whole system seems to work (I get almost the same logfile as the one running in windows) but the screen is totally black!
Is anyone willing to help me cause I have much work other than this to do?

Eric
February 7th, 2005, 14:28
Aslong as the emu doesnt use windows DLL files,Direct X,Flash or anyother thing that the coders nor i think the Dreamcast can understand and i am not to sure.

Eric

GPF
February 7th, 2005, 18:36
Hi! I just found a supervision emulator in SDL for windows. I am trying to port it to DC. I don't know if a supervision emulator already exists in the scene, if not I hope to give a small contribution to it.
The problem I have is that in some parts it uses windows functions and C++. Can anyone help me to overcome these problems? For example the function timeGetTime() I have replaced it by clock(). Is that correct?
The code compiles ok with sh-elf g++ (I develop it using the Dev-Cpp environment), the whole system seems to work (I get almost the same logfile as the one running in windows) but the screen is totally black!
Is anyone willing to help me cause I have much work other than this to do?

I think the function that is closest to timeGetTime() is timer_ms_gettime64() which returns the number of ms since KOS has started. I think that was available in KOS 1.2

Also what are you using to render to the screen?

Troy

elefas
February 8th, 2005, 10:55
Thanks GPF, I am gonna check this.
The emulator uses SDL (some C++ classes) to render to the screen. One thing I noticed is that it uses setVideoMode to create a 160x160 resolution. At first I thought that this was the problem. I mean DC may not be able to render such a resolution. But it did not produce any errors at that point. I may post the SDL code here tonight so everyone can take a look at it.

elefas
February 8th, 2005, 18:01
Good news. Thanks to GPF's advices the emu is up and running. Tested 2 games, they play slow but we'll see later what can be done for this. Currently it uses keyboard as input (have to fix it for dc gamepad) and has no sound. But that's my first attempt in porting an emulator!

I would like to upload a binary for you guys to test it also but currently I have not implemented a rom menu (I load the roms from romdisk) and that may be a legallity issue.

GPF
February 8th, 2005, 18:10
glad to be of help. Good Luck with increasing the speed. If you need some help let us know.

Troy

elefas
February 9th, 2005, 11:23
A bit of history for those who don't know what a Watara Supervision was can be found in the links:

http://www.silicium.org/console/supervision.htm
http://slydc.20m.com/supervsn.htm

Darksaviour69
February 9th, 2005, 12:10
Good news. Thanks to GPF's advices the emu is up and running. Tested 2 games, they play slow but we'll see later what can be done for this. Currently it uses keyboard as input (have to fix it for dc gamepad) and has no sound. But that's my first attempt in porting an emulator!

I would like to upload a binary for you guys to test it also but currently I have not implemented a rom menu (I load the roms from romdisk) and that may be a legallity issue.


well done ;)

elefas
February 10th, 2005, 11:30
Some more news:

-Added DC controller (on port 1)
-Improved the speed (unfolded some for() loops in gpu rendering). It now runs acceptable at standard rendering but it is still slow if an enhancement (2xSaI,...) is used.

the emu is using m6502.c as cpu emulator. I wonder if there exists a faster emulator than m6502.c The nesterdc 6502 emu seems quite different than the above so I don't know if I would benefit from it.

OneThirty8
February 11th, 2005, 04:11
If this uses SDL for the timer at all, it seemst that will slow things down. I've seen a couple of timer hacks work to speed things up, although I don't know how accurate they are. The hack I use is to edit timer/dc/SDL_systimer.c, specifically the SDL_StartTicks and SDL_GetTicks functions. It looks something like this in my setup:


void SDL_StartTicks(void)
{
Uint32 *milis, *secs;
timer_ms_gettime(secs, milis);
start = ((Uint32)secs*1000)+(Uint32)milis;
}

Uint32 SDL_GetTicks(void)
{
Uint32 *milis, *secs;
timer_ms_gettime(secs, millis);
return ((((Uint32)secs*1000)+(Uint32)milis)-start);
}


I don't know if that applies to your emulator or not, but I've noticed things that used the SDL timer speed up quite a bit after I changed those two functions so it might be useful to somebody. Good luck with the emulator. Can't wait to see it!

MetaFox
February 11th, 2005, 07:29
Is that code correct? (other than the millis typo in the SDL_GetTicks function)

When I try this, I get nothing but a blank screen.

Using Uint32 to initialize the variables gives me an incompatible type warning.

changing it to int32 gets rid of this warning, but still produces a black screen.

GPF
February 11th, 2005, 07:50
Is that code correct? *(other than the millis typo in the SDL_GetTicks function)

When I try this, I get nothing but a blank screen.

Using Uint32 to initialize the variables gives me an incompatible type warning.

changing it to int32 gets rid of this warning, but still produces a black screen.

Since your using a version of KOS later than 1.2 you can use the following which is similiar to the above code


void SDL_StartTicks(void)
{
/* Set first ticks value */
start = timer_ms_gettime64();//jiffies;
}

Uint32 SDL_GetTicks(void)
{
//return((jiffies-start)*1000/HZ);
return timer_ms_gettime64()-start;
}

Thats what i use in my timer/dc/SDL_systimer.c

Troy

elefas
February 11th, 2005, 10:52
Thanks for the advices. As I can see SDL is only used to create the surfaces and nothing more. No SDL_StartTicks(), nothing more on SDL. It runs quite good with the standard 160x160 resolution but slows down if an enhancement (2xSaI, SuperEagle, etc) is used. For now I try to make a menu for loading roms. As soon as I finish it I will post a binary for you guys to test it.

I have not implemented sound at all. The windows port uses seal for sound. Is this portable to DC or I'll have to rewrite the sound stuff from scratch?

quzar
February 11th, 2005, 11:36
seal isnt portable, but its usually replacable with SDL fairl easy.

OneThirty8
February 11th, 2005, 19:20
Is that code correct? (other than the millis typo in the SDL_GetTicks function)

When I try this, I get nothing but a blank screen.

Using Uint32 to initialize the variables gives me an incompatible type warning.

changing it to int32 gets rid of this warning, but still produces a black screen.
That's probably not exactly what the code is on my system. I was posting from my mac, and looking at the code on the Linux PC next to it so I didn't bother typing stuff that I had commented out and may have inadvertently introduced an error. The SDL_GetTicks function is definitely declared as Uint32, though.

The only reason I didn't use timer_ms_gettime64() in mine the way Troy did is because SDL_GetTicks() is supposed to return a 32-bit integer, but iirc I essentially did the same thing that timer_ms_gettime64 does - multiply 'secs' by 1000, and add the 'milis' to that, so I have the number of miliseconds since SDL started.

What I'll do is copy + paste the real code in a few minutes when I dig it up again on my other machine.

*edit*
Here's the copy+pasted code.


void SDL_StartTicks(void)
{

/* Set first ticks value */

/*start = jiffies;*/
/* 138's hack */
Uint32 *milis, *secs;
timer_ms_gettime(secs, milis);
start = ((Uint32)secs*1000)+(Uint32)milis;
}

Uint32 SDL_GetTicks(void)
{

/*return((jiffies-start)*1000/HZ);*/\
/* 138's hack */
Uint32 *milis, *secs;
timer_ms_gettime(secs, milis);
return ((((Uint32)secs*1000)+(Uint32)milis)-start);
}


Sorry, didn't meant to hijack a topic to discuss SDL Timer hacks. :-[

obelisk
February 12th, 2005, 02:11
hey, elefas. *so this is in black n white, eh? * I have a question, will the emu on dc be actually black and actually white, or black(?) n beige like now for game boy mono in gnuboy? *hey, i wish i could have this on dcgnuboy, but mybe it can happen on this: *have like a color scheme customizer so, you can select red for black and black for white and make it like a virtual boy, or green = black & black = white to pull of an oldskool mono ibm look. *just a thought, please take no offense and i thank you for yr work.