All working ok!! New beta!!

TakaIsSilly

New Member
Cool! I also did a working version and was about to post the source code :). When I ran some more tests, I noticed that the tile decoding routine _was_running, but the scrools were not pointing to the correct adresses.

Turns out the big problem is the slScrAutoDisp() function (as you said Denis^^;), that SSF seems to ignore :). the ASCII scroll was also set to VRAM_B1, so I changed that location. To make it look nicer, I also moved the scrolls a bit to the left of the screen.

Most errors that mal posted also seem to happen with me. The reason is simple, the background scroll register is not working. Denis, you can use the function i used to adjust the scrolls to correctly emulate this :)

*we live and learn*

Main.c

(Edited by TakaIsSilly at 9:41 pm on Dec. 7, 2001)

(Edited by TakaIsSilly at 9:56 pm on Dec. 7, 2001)

(Edited by TakaIsSilly at 11:01 am on Dec. 8, 2001)
 

TakaIsSilly

New Member
BTW, anyone that actually has played the original game (or a speed-locked emulator) say if the speed seems correct. It might run at 30fps instead of 60.
 

Denis

New Member
yes! yes! WE did it :)))

By the way, please, check new version (beta6) with some improvement (what if it will crash on real saturn!!!??)

url:

http://phemusat.tripod.com/beta6.zip

Please report - does it work or crash?

Improvement are:

1) Clsfast usage again (get rid of garbage)

2) Phoenix screen centered on TV. (and only one Phoenix screen - no more mirror/ghost images)
 

Denis

New Member
By the way, TakaIsSilly!

Already uploaded sources for beta6. But it somewhat changed from 1st "not-crashable" SAFE version n2 =)

Can't d/l your main.c, so here is how i did in SAFE version 2:

1)added slScrAutoDisp(NBG0ON|NBG1ON);

2)not used clsfast (used again in beta6);

3)added slTVOff() (and slTVOn of course); after pressing start button function and after slinitsystem;

4)used buffers in Video_Decode. buf1 for tile_data and buf2 for tile_data2. I.e. copied buf to tiles only at end of video_decode (and TV is stills off).

5) added slTVOff/slTVOn before videodraw use in Z80_RDMEM (Removed in beta6)
 

Denis

New Member
To TakaIsSilly:

Comparing both methods (i.e. used in your main.c and in safe n2) i think, that most important feature is slScrAutoDisp?? It's really that "crashing bug"? =)))

PS. What do you think about speed optimising? I.e. possibly it something in synch (you said about, that it runs at 30fps)?
 

mal

Member
####.

You're making these great improvements already and I won't be able to test anything new for a week or so. :(

Maybe I can burn one off at work...

Keep it up. This is great! :biggrin:
 

TakaIsSilly

New Member
The amusing part is that it didn't crashed. The game was running perfectly under all the garbage ^^;

As for optimizing, try setting :

Code:
static Uint32 fskip = 0; //faster? 32 bit padding is needed anyway.

if(DipSwitchSYNC == 1)

    {

    VideoDraw();

        DipSwitchSYNC = 0;

if (fskip & 0x00000001) slSynch(); //Jump every other frame.

fskip++;//Increase frameskipper.

        return 128;

}
at the Z80_RDMEM();

This sould boost the speed by 50%, but removing the SlSynch() and setting

slInitSystem to :

Code:
slInitSystem(TV_320x480, NULL, 2);
.

(1 is 60 fps, 2 is 30fps, 3 is 15 fps, and so on)

but this brings huge synchronization problems.

*EDIT : the first post was totally wrong*

(Edited by TakaIsSilly at 11:23 pm on Dec. 8, 2001)

(Edited by TakaIsSilly at 11:35 pm on Dec. 8, 2001)
 

Denis

New Member
Oh yes, forgot to tell :))

Beta6 works ok on real saturn (thanks to John M Fudacz for testing).

By the way:

Here is current to do list:

1) As mentioned - need to speed up emu.

2) Background layer - here is the problem. It need to be scrolled, not to be static.
 

Artemio Urbina

New Member
It feels great to see i runnining!

Well...

Here is what I found:

Vertical positions are not right.... items are shown further than they are =)

It runs still apparently at 50-60% of the real speed.

Background is not scrolling

Thats about what I saw comparing it with the original.. keep up the excellent work!
 

TakaIsSilly

New Member
Hnn, here's some functions that will emulate scrolling. I hope.

Code:
int VideoDraw(dword A)

{

//The big trick here is to make the

//system think we're using the

//standard tile format....

int x,y;

Uint8 c;

unsigned int background_y;

background_y=((y*8)+(256-scroll_reg))%256;

slScrPosNbg1(toFIXED(-220), toFIXED(-(background_y >> 2))); // Is this correct?

// I'm only guessing. Nbg1 is the 

// background layer, otherwise

// replace with Nbg0.

for(y = 0; y < 32; y++)

{

int pos = 0x4000+32*(26-1)+y;

int pos2 = 0x4800+32*(26-1)+y;

    for (x = 0; x < 26; x++)

{

map_data[(y*64)+x] = RAM[pos2] << 1;

gfx_data[(y*64)+x] = RAM[pos] << 1;

gfx_data[(y*64)+x+0x800] = RAM[pos] << 1; //Is this the background

//scroll? if not, please switch

//to the other.

pos -= 32;

            pos2 -= 32;

     }

        }

return(0);

}
This needs also the updated Z80_WRMEM() :

Code:
void Z80_WRMEM(dword A,byte V)

{

if (A < 0x4000)

{

// Attempting to write to ROM, just return

return;

}

else if(A >= 0x5800 && A <= 0x5bff) scroll_reg = V;

else if(A > 0x3fff && A < 0x8000) RAM[A] = V;

return;

}
This uses a
Code:
unsigned int scroll_reg
as a global variable.

(Edited by TakaIsSilly at 8:00 pm on Dec. 9, 2001)
 

Denis

New Member
To TakaIsSilly:

I tried to directly implement scroll function from Jim's emulator. But after many tries nothing work...

If it applied without changes the bug is - all background vertical tiles repeated 8x times.

Taka did you tryed it too? Or you inititally started from slScrPosNbg method???

I think, here is little problem in background_y calculation (not really in map_data[] assignment)

What you think about it?
 
Top