flat assembler
Message board for the users of flat assembler.

Index > Windows > Windows Game programming for dummies, more examples

Author
Thread Post new topic Reply to topic
madmatt



Joined: 07 Oct 2003
Posts: 1045
Location: Michigan, USA
madmatt
Exclamation UPDATED Exclamation Some Bug Fixes for chapter 9 examples and updated chapter 9 examples that use the new fasmlib.dll, let me know how the dll version works for YOU! see the readme.txt and update.txt for details.

Here are 6 more examples from the Windows Game programming for dummies. Chapter 9. In these examples we actually start using some DirectX function calls. Nothin' special yet, however, you can learn how to get a pointer to a surface and draw directly to frame buffer memory, and set and reset palettes. I Will also add better comments to the examples future examples that I post. Also, I'm going to work on my fasm library adding some functionality, cleaning up some of the code, and most likely, making it into a DLL. This will eventually be a "black box" for fasm Windows assembly programers who need a c like programming library for various directx/windows tasks. If anyone has any routines they would like me to add to the fasmlib let me know.
Enjoy Very Happy ,
MadMatt Idea Exclamation Wink


Last edited by madmatt on 01 Jun 2004, 19:09; edited 1 time in total
Post 28 May 2004, 18:57
View user's profile Send private message Reply with quote
i-don



Joined: 18 Jul 2003
Posts: 66
i-don
Compliment to madmatt for a working DirectX examples in this tutorial. Smile

Just I'm wonder why it's slow a bit compared other DX program I run. Changing screen size seem does not improve it speed. With FasmW Dx example I got a speedy gonzales framerate.

Is it puposely coded to draw with a slow pace or something got to do with method being used such as FPU bloat?


Great contributions. Keep up the good works mate... Wink

Thanks,

i-don.
Post 30 May 2004, 22:52
View user's profile Send private message Reply with quote
madmatt



Joined: 07 Oct 2003
Posts: 1045
Location: Michigan, USA
madmatt
Which example are you talking about?
Post 31 May 2004, 01:23
View user's profile Send private message Reply with quote
i-don



Joined: 18 Jul 2003
Posts: 66
i-don
Examples from chapter 9. All those DX screen with color bars and pixelette. I just got tricked by my PC at dying windows resource and testing those examples seem running a bit faster. But once re-boot, it's back to previous speed. You can't almost spot it, since I'm running on a slower pc it does noticable a bit. Changing into higher DX screen resolution in the source code doesn't slow it down but stay the same speed. And lowering the size also does not speed it up... strange huh?

i-don.
Post 31 May 2004, 03:07
View user's profile Send private message Reply with quote
madmatt



Joined: 07 Oct 2003
Posts: 1045
Location: Michigan, USA
madmatt
in the directdrawpaletterotate.asm example, you can remove the "invoke Sleep,1" in the GameMain loop, for a speedup. Also The drawing for both the color bars examples is done in software, which would explain the slowdown on slower processors. The whole screen is redrawn each call to our MainGame loop, which is almost continuously, another reason for the slowdown. You probably won't get much of a slowdown (or speed up) for the random pixel examples because there is little change for the plotting routines between the 8-16-32-bit versions, even when changing to a higher resolution. Also if you change the SCREENWIDTH,SCREENHEIGHT constants, don't forget to change the RndNxxx functions in the MainGame loop as well. Not that strange to me, i've been programming in dos vesa graphics for a few years now before I moved to windows coding, and know quite a bit about how the graphics displays operate, at least when coding software functions.
Post 31 May 2004, 10:30
View user's profile Send private message Reply with quote
i-don



Joined: 18 Jul 2003
Posts: 66
i-don
Aaah, okay. I got the idea... Smile

Just wonder the different.

ps - when looking at the pixel render, I remembered the TinyPTC. Is there any chance to have such as that one written in Fasm?

Rgds,

i-don.
Post 01 Jun 2004, 13:52
View user's profile Send private message Reply with quote
madmatt



Joined: 07 Oct 2003
Posts: 1045
Location: Michigan, USA
madmatt
Smile Hello everyone: Smile
Updated Examples (see first post above), no new examples, but the fasmlib.dll that I have been promising, is here. It eliminates the need for including files directly into the source and calling (or forgetting to call) initialization routines. Everything is setup when the dll loads just load the registers and invoke the functions needed. Let me know if the examples that use the dll work for you.

Smile Hello i-don:
I did some bug fixes in the chapter 9 examples, this may help the examples run better. What is a "TinyPTC"? The ones in the examples are just ones I wrote "on the fly" no optimization or anything, I DO have techniques to speed up many software rendering functions, I don't know if they will work with Directx. Haven't had time to try out much yet.

well everyone take care, any problems let me know and I will see what I cant do, or the fella' named INSKIPP Very Happy

MadMatt
Post 01 Jun 2004, 19:35
View user's profile Send private message Reply with quote
i-don



Joined: 18 Jul 2003
Posts: 66
i-don
Hi madmatt!

Will try the DLL version, it's getting more interesting.

TinyPTC is software rendering graphics library which is can be used on GDI, DirectX, Opengl, Java, PocketPC, PalmOS, smartphone and Video for Window. Its actually quite universal on it's implementations. I think you should get a better view from it's website here:


  1. http://www.gaffer.org:8080/tinyptc/
  2. https://sourceforge.net/projects/tinyptc/


Have a look at the Java Applets version from it's website. It shows some graphics demo, console-like games and fractals (I think).

I've seen TinyPTC been used to make 3d racing game for smartphone with combination of Hermes(can remember it's website) another graphics library.

i-don.


Description: Try this small tinyPTC Win32 demo (7KB) to get a little idea about it.
Download
Filename: ptcdemo.zip
Filesize: 4.16 KB
Downloaded: 195 Time(s)



Last edited by i-don on 02 Jun 2004, 16:25; edited 1 time in total
Post 01 Jun 2004, 22:46
View user's profile Send private message Reply with quote
madmatt



Joined: 07 Oct 2003
Posts: 1045
Location: Michigan, USA
madmatt
Hi I-don, tried the tinptc, not bad, looks interesting, very simple. tried some of the java samples, every one worked and looked good except the space invaders game, could only see missles going up and falling down, nothing else, not very fun Very Happy . Also going to have a look at the fmod sound library, looks VERY interesting if the claims it make's turn out to be true.
Post 02 Jun 2004, 08:06
View user's profile Send private message Reply with quote
i-don



Joined: 18 Jul 2003
Posts: 66
i-don
Hey madmatt!

The chapter 9 example now working smoothly. Smile

Quote:
tried some of the java samples, every one worked and looked good except the space invaders game, could only see missles going up and falling down, nothing else, not very fun .


I got it working with my browser. May be, so many people play with, so it lag and at start-up. Quite addictive I may say. simple and fun. you got to shot all the bottom row invaders first before it reach you. Here is screenshot from my IE5 browser:

Image
It's a bit dark. But I guess the game is to demonstrate how it look when running on smartphone/pocketpc or palmOS.


I think it is a good source to get another graphics rendering engine (off-course it's software based) to be written in fasm. I see it uses existing compiler libraries as it's based rendering source. So, it can be DirectX, DirectShow, VFW, gdi or OpenGL. As I understand it, TinyPTC is made for low resource PC such as VGA card display, WinCE, pocketPC and interestingly Java applets for web based animations.

i-don.
Post 02 Jun 2004, 16:17
View user's profile Send private message Reply with quote
madmatt



Joined: 07 Oct 2003
Posts: 1045
Location: Michigan, USA
madmatt
Hello i-don,
Your saying the examples with the dll worked good too? looks alright, I have a old dos space invaders written in 100% (16bit) dos assembly that looks really good actually, it looks quite a bit like the original space invaders, I'm old enough to remember when the first arcade games came out, aournd 1980 or so. Exclamation DAG NABBIT Exclamation has it been that long ago!! I'm gettin' old Crying or Very sad
And looking for when the original space invaders came into being found thise site that has almost exactly the look and play of the original arcade games:
Razz http://www.80smusiclyrics.com/games.html#nullt

Should be able to add the routines to the fasmlib.dll. I don't see any open source statements though, but then again I don't see any copyrights either. I'll probably finish the chapter 10 examples, and then add much to the fasmlib.dll that I've been wanting to add for a while. Stay tuned.
MADMATT
Post 03 Jun 2004, 01:17
View user's profile Send private message Reply with quote
i-don



Joined: 18 Jul 2003
Posts: 66
i-don
Yeah! The DLL version working alright. Smile

According to my viewing preference, it seem the DLL works a bit smoother than the 'includes' version.

;---
I guess the techniques ni TinyPTC could be added into your fasmlib library.
;---

Looking forward for upcoming examples and wonders what will be the shape of your fasmlib Library. Very Happy

i-don
Post 03 Jun 2004, 03:39
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.

Website powered by rwasa.