General Insanity (Genesis + PVR)

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
BlackAura
DC Developer
DC Developer
Posts: 9951
https://www.artistsworkshop.eu/meble-kuchenne-na-wymiar-warszawa-gdzie-zamowic/
Joined: Sun Dec 30, 2001 9:02 am
Has thanked: 0
Been thanked: 1 time

Post by BlackAura »

There's only one (major) problem with the sprites at the moment. For whatever reason, some of the sprites look completely screwed up. Basically, they look as if they're displaying the wrong graphics. However, even if it's displaying the wrong graphics every single frame and you pause it, it suddenly fixes itself. So that probably means it's an issue with the tile cache code. It's probably because of deferred rendering - I think I'm uploading textures for frame X when the PVR is still rendering frame X-1, so the frame gets bits of the graphics from the next frame...

I'm off to bed now. Having just played a couple of levels of Sonic 1 and 2, and Rocket Knight Adventures at full speed with a nice black background where the level should be (which is bloody hard, by the way), and having had an exam at 8:00 in the morning so I had to get up at 6, I'm going to bed. Se y'all tomorrow!
Ian Micheal
Soul Sold for DCEmu
Soul Sold for DCEmu
Posts: 4865
Joined: Fri Jul 11, 2003 9:56 pm
Has thanked: 2 times
Been thanked: 4 times

Post by Ian Micheal »

See ya B A nice progress report to read was the high light of my day today thanks for sharing. Sounds like your almost there. Good luck on the exams.
Dreamcast forever!!!
Warmtoe
DC Developer
DC Developer
Posts: 453
Joined: Thu May 16, 2002 8:29 am
Location: ice88's house
Has thanked: 0
Been thanked: 0
Contact:

Post by Warmtoe »

Wowowowow... BA, you are hardcore!

If I can help - holler!
BlackAura
DC Developer
DC Developer
Posts: 9951
Joined: Sun Dec 30, 2001 9:02 am
Has thanked: 0
Been thanked: 1 time

Post by BlackAura »

Ian Micheal wrote:Sounds like your almost there.
For sprites, yes. Aside from the graphics corruption thing (I think I know what's causing it, but I don't know how to fix it) there's two major things I've not implemented (Shadow/Hilight mode and in-frame palette changes) but I'm not going to do those now.

For backgrounds, I've not even started yet. I still don't really understand a lot about the way the VDP's background layers work. Still, the best way to learn is to try, right?
Good luck on the exams.
Thanks! One more to go (Unix Systems Programming), and I'm pretty confident about that one.
ice88 wrote:Wowowowow... BA, you are hardcore!

If I can help - holler!
Thank you. I might post the code somewhere later today, so if anyone wants to have a look at it, feel free. There are undoubtedly a number of things I'm doing slightly wrong, or at least stupidly, and it never hurts to have someone with a different brain take a look at it.

Edit: If anyone has any idea how the scrolling backgrounds work, some assistance would be appreciated.
BlackAura
DC Developer
DC Developer
Posts: 9951
Joined: Sun Dec 30, 2001 9:02 am
Has thanked: 0
Been thanked: 1 time

Post by BlackAura »

I'm going to let you guys play with this thing as soon as I've fixed one bug related to horizontal scrolling (and me not having a bloody clue how horizontal scrolling works, or what the hell Charles MacDonald was doing in Genesis Plus - both have been causing a lot of problems). Basically, the tile offset into the name table is scrolling the wrong way, but the pixel offset onto the screen is scrolling correctly.

Aside from that, it works, and it's a hair's breadth from being full speed (every few frames it just passes over the 16.6ms boundary and takes two frames instead of one). Compatability is utter crap at the moment, and there are a lot of graphics glitches on every game I've tested on, but it works!

(Thirty minutes later)

Fixed. I'm going to bed now, because I have an exam tomorrow (last one - yay!)

Enjoy!

If anyone wants to try to fix a few of the more glaringly obvious bugs while I'm asleep. please feel free. The fact that the rendering code ignores virtually every single register used to control the display is a major problem (stuff like the display enable bit, background colour, vertical scroll mode, that kind of thing), it doesn't handle 32-cell display modes properly (draws them as if they were 40-cell), column-based vertical scrolling doesn't work, shadow/hilight doesn't work, theres some weird graphics glitches on the sprites, it's a bit slow, and it draws garbage outside the borders of the display.
BlackAura
DC Developer
DC Developer
Posts: 9951
Joined: Sun Dec 30, 2001 9:02 am
Has thanked: 0
Been thanked: 1 time

Post by BlackAura »

(Can't get the edit thing to work now, so sorry for the triple post)

Fixed. I'm going to bed now, because I have an exam tomorrow (last one - yay!)

Enjoy!

If anyone wants to try to fix a few of the more glaringly obvious bugs while I'm asleep. please feel free. The fact that the rendering code ignores virtually every single register used to control the display is a major problem (stuff like the display enable bit, background colour, vertical scroll mode, that kind of thing), it doesn't handle 32-cell display modes properly (draws them as if they were 40-cell), column-based vertical scrolling doesn't work, shadow/hilight doesn't work, theres some weird graphics glitches on the sprites, it's a bit slow, and it draws garbage outside the borders of the display.
Storminator16
DCEmu Veteran
DCEmu Veteran
Posts: 850
Joined: Mon Sep 01, 2003 11:12 am
Location: NC/Iraq
Has thanked: 0
Been thanked: 0
Contact:

Post by Storminator16 »

What do I need to do to use snd_stream.c found in /dreamcast-x/ instead of the functions listed in libkallisti? I keep getting 'function already defined' errors.
BlackAura
DC Developer
DC Developer
Posts: 9951
Joined: Sun Dec 30, 2001 9:02 am
Has thanked: 0
Been thanked: 1 time

Post by BlackAura »

Using the included Makefile, it works fine for me. In theory, the linker should allow you to replace any functions within a static library with your own, and KOS actually relies on that in a number of places.

If you can't get it to work, remove it, make sure the audio_init in dreamcast-x/main.c is commented out, and comment out everything to do with snd_stream and the audio_callback function from system.c
q_006
Mental DCEmu
Mental DCEmu
Posts: 415
Joined: Thu Oct 10, 2002 7:18 pm
Has thanked: 0
Been thanked: 0
Contact:

Post by q_006 »

hey BlackAura,

could you look on the DWORD vs. WORD thread and answer Rand's question about dcache and word size. thanks. i kinda curious to know the rest of it (it being the discussion)
Storminator16
DCEmu Veteran
DCEmu Veteran
Posts: 850
Joined: Mon Sep 01, 2003 11:12 am
Location: NC/Iraq
Has thanked: 0
Been thanked: 0
Contact:

Post by Storminator16 »

Thanks, BA, that did the trick.

For those who don't know, this emu is what you've all been dying to see: fast speed (frame skip to 2?) homebrewn Genesis/Megadrive emu!

Dude, when I saw Sonic move that fast I almost cried. This is totally awesome. When do you plan to add a GUI and such? I have a bit more time lately, so I wouldn't mind trying to add something to this project.

I'm going to play some other games and post results. Btw, is tthere a way to exit the emu?

Note: When I say highly playable, I mean it's fast!

Sonic - runs well with the current emu's settings; highly playable
Alien 3 - seems to run a tad slower with varying speed ups, but playable
NHLPA '93 - right off the bat I got a 'pvr_wait_ready: timed out' then proceeded to some errors in the title screen, in-game menu, and game. My VGA monitor may be jacked up, but it seems I'm getting a black ice :/ Probably my monitor, it has been inverting colors lately. Playable, and speed runs well with current emu's settings. Highly playable asside from graphic errors.
Ghostbusters - Status bar at the bottom of the screen missing, would be highly playable but the status bar is important :) Runs fantastic otherwise
Chakan - The Forever Man seems to move slow, and the scrolling is jerky at times. Nevermind, this is how bad the game usually is. I have no reason why I tested this. Highly playable....if you like this garbage game.
Thunderforce 3 - Status bars missing, but highly playable :) I guess you have some foreground sprites not working or disabled, BA?
Streets of Rage 2 - Status bar missing, seems to run a tad slow. First "alleged" 16 meg rom I tried with this.
Valis 3 - Well, there is a color problem. All text in the opening cinema were black (or I just couldn't see it) and the in-game conversations are fudged. Overall all, the tiles on the right side of the screen are fudged. 'Course, status window is non-existent. Not very playable because of the graphical glitches, but speed-wise it's fine if you love this game.
Street Fighter 2 Turbo - The other "alleged" 16 meg rom I tried. Memory issue? The emu refuses to run it, and crashes.
Sonic 2 - Read what I said about Sonic 1. Works fine.
Storminator16
DCEmu Veteran
DCEmu Veteran
Posts: 850
Joined: Mon Sep 01, 2003 11:12 am
Location: NC/Iraq
Has thanked: 0
Been thanked: 0
Contact:

Post by Storminator16 »

Now that I've re-read your post, BA, now I see why I saw the issues I ran into.
frogcoin
Insane DCEmu
Insane DCEmu
Posts: 218
Joined: Tue May 20, 2003 12:45 am
Has thanked: 0
Been thanked: 0

Post by frogcoin »

even with some issues almost-full-speed is an awesome achievement. as much awesome as one of the first emulators / homebrew project that i heard use the dramcast video memory.

this this a big step in dreamcast development, with a few better results it can be used in some other emus/ ports / homebrew to break the actual limitations that until today the DC programming had. (for example to push a little of speed to the GBA emu of GPF)

sorry to sound like a noobish, but i guess almost eveyone in DC emulation is giving a close attention to this, if not check the number of views -954 views- !!!!

B A if a god!!! - hands down -
ssj4goku128
Insane DCEmu
Insane DCEmu
Posts: 290
Joined: Wed Oct 17, 2001 7:44 pm
Has thanked: 0
Been thanked: 0

Post by ssj4goku128 »

Streets of Rage 2 - Status bar missing, seems to run a tad slow. First "alleged" 16 meg rom I tried with this.
...
Street Fighter 2 Turbo - The other "alleged" 16 meg rom I tried. Memory issue? The emu refuses to run it, and crashes.
Streets of Rage 2 is 16 megs? I could have sworn it was much less than that. Same with Street Fighter 2 Turbo and Super Street Fighter 2.
"So I gotta be carefull, can't let tha evil of tha money trap me
so when ya see me #@#$%
ya better holla at me "

Tupac Shakur[1971-1996]
Makaveli[1996-????]
Phantom
DC Developer
DC Developer
Posts: 1753
Joined: Thu Jan 16, 2003 4:01 am
Location: The Netherlands
Has thanked: 0
Been thanked: 0
Contact:

Post by Phantom »

BlackAura wrote:Enjoy!
I just tried it. Here's my review:

:jawdrop:

Keep up the good work! :)
Storminator16
DCEmu Veteran
DCEmu Veteran
Posts: 850
Joined: Mon Sep 01, 2003 11:12 am
Location: NC/Iraq
Has thanked: 0
Been thanked: 0
Contact:

Post by Storminator16 »

ssj4goku128 wrote:
Streets of Rage 2 - Status bar missing, seems to run a tad slow. First "alleged" 16 meg rom I tried with this.
...
Street Fighter 2 Turbo - The other "alleged" 16 meg rom I tried. Memory issue? The emu refuses to run it, and crashes.
Streets of Rage 2 is 16 megs? I could have sworn it was much less than that. Same with Street Fighter 2 Turbo and Super Street Fighter 2.
In cartridge form, but I'm not recalling if it was 16 megabits or megabytes were the size of the chips.
Warmtoe
DC Developer
DC Developer
Posts: 453
Joined: Thu May 16, 2002 8:29 am
Location: ice88's house
Has thanked: 0
Been thanked: 0
Contact:

Post by Warmtoe »

OK - does this work in Chankast?

I have it building - but chankast isn't doing anything with it, should I see something on screen - what am I missing here?
Storminator16
DCEmu Veteran
DCEmu Veteran
Posts: 850
Joined: Mon Sep 01, 2003 11:12 am
Location: NC/Iraq
Has thanked: 0
Been thanked: 0
Contact:

Post by Storminator16 »

Don't really know about Chankacast, but it only runs 1 rom at a time, and you have to compile the rom's name in 'main.c'. I believe it's in test_exec(), which is at the bottom of the source. The current default is "games/sonic.zip". And I believe everything with Chankacast has to be run on a CD, and not as a romdisk. I used romdisk to suit my purposes.

/me strokes his BBA.
doragasu
DCEmu Cool Poster
DCEmu Cool Poster
Posts: 1048
Joined: Thu May 16, 2002 5:01 pm
Location: Madrid, Spain
Has thanked: 0
Been thanked: 0

Post by doragasu »

ssj4goku128 wrote:
Streets of Rage 2 - Status bar missing, seems to run a tad slow. First "alleged" 16 meg rom I tried with this.
...
Street Fighter 2 Turbo - The other "alleged" 16 meg rom I tried. Memory issue? The emu refuses to run it, and crashes.
Streets of Rage 2 is 16 megs? I could have sworn it was much less than that. Same with Street Fighter 2 Turbo and Super Street Fighter 2.
SOR 2 is 16 Megabits (2 megabytes) and I'm pretty sure SF2 Special Champion Edition is 24 Megabits (3 megabytes).
Ian Micheal
Soul Sold for DCEmu
Soul Sold for DCEmu
Posts: 4865
Joined: Fri Jul 11, 2003 9:56 pm
Has thanked: 2 times
Been thanked: 4 times

Post by Ian Micheal »

Yeah people get it mixed up.
Dreamcast forever!!!
bender
Mental DCEmu
Mental DCEmu
Posts: 399
Joined: Sun May 12, 2002 4:18 pm
Has thanked: 0
Been thanked: 0

Post by bender »

I can't belive what i'm reading. :D

thnks BlackAura, Stef.D and all the guys that made this possible. This is the best year for the scene so far :kiss)
Post Reply