[fceux's source]Where is the rendering part?

Are you new to 6502, NES, or even programming in general? Post any of your questions here. Remember - the only dumb question is the question that remains unasked.

Moderator: Moderators

Post Reply
michikaze
Posts: 36
Joined: Sat Jun 28, 2014 2:35 am

[fceux's source]Where is the rendering part?

Post by michikaze »

I wonder if anyone here is familiar with fceux's source code. I'm curious how it draws things. You see, for quite a while fceux and cavestory were the only games that didn't made my computer freeze. I want to steal from their code the rendering part and do something for myself.
michikaze
Posts: 36
Joined: Sat Jun 28, 2014 2:35 am

Re: [fceux's source]Where is the rendering part?

Post by michikaze »

...
User avatar
rainwarrior
Posts: 8062
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

Re: [fceux's source]Where is the rendering part?

Post by rainwarrior »

I think its rendering involves a number of files (PPU, palettes, windows/SDL specific display stuff, probably some other stuff).

You haven't explained what you're looking for very well, or why you need help finding it. What have you tried already? Could you not find what you need by looking for files with "PPU", "video", or "display"?

Also, if you're looking for an example to learn how to write an NES renderer, FCEUX is probably not a good teaching example. Its code it big and crusty because it's very old and has seen a lot of changes over the years.
User avatar
tokumaru
Posts: 12106
Joined: Sat Feb 12, 2005 9:43 pm
Location: Rio de Janeiro - Brazil

Re: [fceux's source]Where is the rendering part?

Post by tokumaru »

From his original post it doesn't look like he's interested in the NES aspect at all, only in how the program handles video output, but I can't say for sure.
michikaze
Posts: 36
Joined: Sat Jun 28, 2014 2:35 am

Re: [fceux's source]Where is the rendering part?

Post by michikaze »

tokumaru is a good mindreader, I admit that.

I haven't tried anything yet. But next few days are going to be a rush, I guess. Just waiting for somebody to say "Yes, I looked inside fceux's sources! And even understood something!", to annoy him with questions later...
User avatar
Memblers
Site Admin
Posts: 3902
Joined: Mon Sep 20, 2004 6:04 am
Location: Indianapolis
Contact:

Re: [fceux's source]Where is the rendering part?

Post by Memblers »

I was under the impression that FCEUX uses SDL. I'm not actually familiar with FCEUX's source, but I have used SDL myself for video and audio output. I used this tutorial: http://lazyfoo.net/SDL_tutorials/

You'll probably have to share more details of what you're wanting to do, to get more specific help.
User avatar
rainwarrior
Posts: 8062
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

Re: [fceux's source]Where is the rendering part?

Post by rainwarrior »

The primary build uses native Win32 stuff, but there is an alternative SDL build.

I actually quite like SDL. I've used it in several of my own projects.

As for FCEUX, I occasionally look at its source code, but I haven't worked on it enough to understand more than a few isolated things. I dunno how many people you'd be able to find who have deep knowledge of it on-hand; there are active maintainers but it's a very slow burn, so most questions are probably not in anyone's ready set of knowledge to share.
michikaze
Posts: 36
Joined: Sat Jun 28, 2014 2:35 am

Re: [fceux's source]Where is the rendering part?

Post by michikaze »

By the way, I'm also interested in how SDL renders stuff. The part that isn't about OpenGL. Last time I opened it's source, I was lost in all those folders for every operating system and every architecture in existence. Unix way. Wish there was a little file telling what directory stands for what.

I just want to get a good and minimalistic example of rendering stuff with winapi. I guess I just can't read documentation, since I always just steal others code and rewrite it for my needs. Microsoft's documentation is a torture for me.

I suspect that fceux may do some tiny optimisations, since all images it works with are paletted. This may be useful for me.
michikaze
Posts: 36
Joined: Sat Jun 28, 2014 2:35 am

How to develop a simple DirectDraw application?

Post by michikaze »

I hope nobody is mind me creating threads only I care about and don't letting them sink.

It was DirectDraw7 in both Cave Story and fceux. I didn't had to look inside sources for that, just in options. Rendering isn't too deep inside, I managed to find it somewhere, probably, I don't remember.

New question is: How to develop a simple DirectDraw application? Is it a good idea to develop something in a deprecated api? Maybe it's not, I don't care, it's the only one what still works.

I don't have VisualStudio installed. I tried, it worked one month and then asked for free registration. Fuck them. I'll try older versions from torrents, maybe I will be more lucky with them. Maybe somebody will recommend me, which version of VisualStudio should I install?

I don't have headers. Maybe I will use ones from MinGW, even fasm have them, so it's not that much of a problem. Maybe I will extract imports directly from ddraw.dll, tools that come with TinyC can do that.

I don't have examples. Maybe I will find some in some tutorial on the internet.

I don't have documentation. MSDN is chaos, I don't want to go there;_; I wonder if I'll find or somebody shares offline docs. I just prefere offline.

I don't really have time, but I'll steal some.

Thank everyone in advance for all replies you may or may not leave, I really appreciate them even if I don't say so or if they aren't that useful. Err. Yes.
User avatar
Quietust
Posts: 1787
Joined: Sun Sep 19, 2004 10:59 pm
Contact:

Re: [fceux's source]Where is the rendering part?

Post by Quietust »

Nintendulator also uses DirectDraw7 - if it doesn't crash on your system, its graphics code will probably be slightly easier for you to read (though not to copy verbatim, unless you intend to license your code under GPLv2).
Quietust, QMT Productions
P.S. If you don't get this note, let me know and I'll write you another.
Post Reply