flat assembler
Message board for the users of flat assembler.

Index > Main > 2d graphic library project

Goto page Previous  1, 2, 3, 4, 5  Next
Author
Thread Post new topic Reply to topic
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid
bytes per pixel would be useful when you want to get index inside pixel array. You have to multiply by size of of pixel (in bytes). So when you have it in bits, you have to load it in register and shift by 3, and that needs another register. This way you can multiply by [ebx + bitmap.bmp]. And having bits per pixel has no such advantage so i find bytes per pixel better.
15bpp - pixel size is 16bits too on these card, but upper bit is just not used.

another problem: how should be bitmap structure named. "bitmap" is used by windows' equates. Now i use tg2d.bitmap in development. Any idea?
Post 04 Dec 2003, 09:19
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
decard



Joined: 11 Sep 2003
Posts: 1092
Location: Poland
decard
about bpp: I wasn't sure why do you need bytes per pixel, that's why I mentioned about 15bpp. And I see your point now. So just try bytes per pixel and see how would it work Smile

bitmap: tg2d.bitmap is OK I think.
Post 04 Dec 2003, 13:48
View user's profile Send private message Visit poster's website Reply with quote
MazeGen



Joined: 06 Oct 2003
Posts: 977
Location: Czechoslovakia
MazeGen
Good luck, vid.

Vidím, že na tom makáš, tak hodně štěstí...
Post 04 Dec 2003, 18:34
View user's profile Send private message Visit poster's website Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid
Question:

on error procedure returns -1 in eax and structure with error info is filled. Do you think i should check for case when user didnt catch error and calls other tg2d proc without clearing structure (which means he handled error)? It will mess code, slow down library a little bit, waste some time and i am not sure if it will be of any use (is somesone SO stupid that he didnt check for returned errors)?

BTW: note i have put new version onto first post in this thread, look at it
Post 08 Dec 2003, 22:10
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
aaro



Joined: 21 Jun 2003
Posts: 107
Location: hel.fi
aaro
IMO if someone isn't checking for errors it's his/her fault. So don't bloat your code with checking errors.
Post 09 Dec 2003, 02:08
View user's profile Send private message Reply with quote
Octavio



Joined: 21 Jun 2003
Posts: 366
Location: Spain
Octavio
>'m writing multiOS 2d graphic library. If you are good in 2d gfx maybe >you could watch this topic and discuss some questions with me.
>you could even join this project... Anyway, please aid me few links to >OOD jpeg file format description, i havent seen such.

here you will find docs about many file formats:
http://www.wotsit.org/search.asp?page=5&s=graphics

before define any standard library interface i recommend that you get some experience writing programs to know what do you need.
if you want to write a very fast library you will have to write drivers for every os and for every video card and this is near impossible
And 2d games not need too much graphical power.
There are many projects like this. have you read about others?
i'm not a 2d gfx programmer ,
i´m a system programmer and this mean that i have not much time to write especialized libraries like allegro but my os has a basic graphic library whit functions like line,rectangle,triangle,ellipse...
and it can also display jpg,gif,bmp,pcx
the problem is that áll this code is writen in my own assembly language
and i have no time to translate it to fasm
Post 18 Dec 2003, 09:53
View user's profile Send private message Visit poster's website Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid
1. 50% of things i wrote were 2d games, thats why i chose this project
2. I want to gain speed by very hacky drawing routines which arent supported by any video card on computers where speed of such game is improtant (like rotated shaded bitmaps). This library will be fast in "special" 2d graphic, of course that just blitting wont be extremly fast. BTW in last project i coded i had routine for blitting bitmaps which was faster than hardware accelerated blitting via directdraw (which has specialized drivers)
3. This one is true - I dont know many such projects. But there is surely no 2d gfx lib in FASM, and i like supporting FASM community (also menuet will have 2d graphic library!).
4. What OS? You wrote your own assembler?
Post 18 Dec 2003, 20:14
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
Octavio



Joined: 21 Jun 2003
Posts: 366
Location: Spain
Octavio
1 could i see these games?
2 probably because it was not hardware accelerated and because manufactures drivers were written in visual basic Smile
some times the problem is the memory bandwith , the code i have is limited by memory bandwith and optimizations are useless.
3 no,fasm and menuetos don´t have any kind of library and id woud be interesting that some people develops libraries ,but i´m already workig
in many projects.
4 The os is not published ,and istill is runing in flat real mode.
now i´m working on the assembler that is autocompilable but there are
still some bugs and some features i want to add.
probably will be published in 1 or two months.
Post 19 Dec 2003, 09:35
View user's profile Send private message Visit poster's website Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid
1. only last game i wrote is still existing, 3 others were under DOS, Turbo Pascal (+ asm 2 last). If you give me your mail i'll send last one to you (0.5 mb). Others were destroyed by virus, i wasnt backuping those times. First one was just one-screen game (when you came to edge of screen it switched to another screen - no scrolling), second was scrolling, it was quite good with good idea and lot of work done, too bad i lost it. Third was newer version of first, but 640x480 (try to make this under turbo pascal Smile , flat real). Now this last is just 2d directdraw game coded for some contest (i was last because of some bug Crying or Very sad ). Just gimme that mail and you will see (and onyone who is interested). If you want sources too, let me know.

2. Due to documentation it was hw accelerated (i know, M$ documentation), but you are probably right about second point. I think it was some OOP Basic code, with lot of useful extra features.

3. Of course, i take it. btw: what projects? (except your OS)

4. I'm looking forward to see it. Maybe menuet and fasm will have new foe? Wink
Post 19 Dec 2003, 19:30
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
Octavio



Joined: 21 Jun 2003
Posts: 366
Location: Spain
Octavio
[quote="vid"]1. only last game i wrote is still existing, 3 others were >under DOS, Turbo Pascal (+ asm 2 last). If you give me your mail i'll >send last one to you (0.5 mb).
you can post it here so everybody could see it , see my profile for the email.
> If you want sources too, let me know.
off course , sources is the most interesting for programmers.

>3.what projects? (except your OS)
My OS are all the projects

>... will have new foe?
what´s "foe" ?
Post 20 Dec 2003, 10:30
View user's profile Send private message Visit poster's website Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid
Octavio:
1. i dont like idea of posting 0.5 mb just for some 5 people who download game and then delete it. BTW, development directory has 1.8 mb (including all graphic twice etc), so it would be little too much. I've sent it to you, i hope you have enough space in you mail account
4. It means "enemy" if i am right (i am not native english speaker of course)
-------------------------------
there is new version of TG2D posted in first message in this thread, check it. It can set other resolutions, but when i try to write video memory some standard window pics will be overwriten, i must work on it. But please look at coding & commenting & documentating style and advice some improvations.
Post 20 Dec 2003, 19:33
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid
hi, TG2D 0.1 almost done. Now it can blit bitmaps (clipped). I post new version (0.0.3) now, it is almost like 0.1, it just lacks some documentations (and bugfixes probably).
Post 30 Dec 2003, 12:23
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
decard



Joined: 11 Sep 2003
Posts: 1092
Location: Poland
decard
vid: as I can see from the source, your library looks vell organised, and... just nice Wink. But I can't make it work, when I try to run your test program, my system crashes horribly (just after it changes the screen resolution). I can't tell you where exackly it crashses, because OllyDbg can't correctly disassemble the test executable Sad.
Post 04 Jan 2004, 15:06
View user's profile Send private message Visit poster's website Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid
thx, this bug has been already reported by one friend, so i will check it. Also problem with OllyDbg - maybe it is caused by some bug in FASM formatter, i discovered that Olly fails only when i access some labels. But probably it is problem of OllyDbg.

By the way, what OS were you using?
Post 06 Jan 2004, 10:31
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
decard



Joined: 11 Sep 2003
Posts: 1092
Location: Poland
decard
I think that OllyDbg is fooled because you are using following syntax:
Code:
invoke MessageBox, 0,"blahblah","blahblah",MB_OK    

which seem to put strings directly into code section (code is mixed with data). Maybe you could change it (put strings in data section and use pointers when invoking MsgBox.

I'm using WinME; I didn't install any new DirectX so its version is 7.1 (it installed with the system).
Post 06 Jan 2004, 15:19
View user's profile Send private message Visit poster's website Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid
this is not the problem, olly claims he supports this feature (push & jump over the string with call). By the way, i was able to view test.exe in olly. Save your old olly cfg file and try to play with analysis settings (try everything off)

btw, did you try TG2D v0.0.2 (and did it work)? If so, then error is elsewhere.
If error occurs inside directdraw (there are many such) then it would be problem as it doesnt occur at computer where i am developing this.

directx version is not problem because tg2d uses interface 1.0 (for now until i start with wrapping some hw support) which is supported by all next versions.

btw: data and code in separate section: this is irrelevant because i would have to have data and code in diferent files and also in future i will use self modyfing code (in fact - self generating code) for speeding up some routines so at least some memory would have to be executable and writable.
Post 07 Jan 2004, 19:17
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
decard



Joined: 11 Sep 2003
Posts: 1092
Location: Poland
decard
well I must say I missed v0.0.2 Sad.
So I will try to do something with OllyDbg...
Post 07 Jan 2004, 20:54
View user's profile Send private message Visit poster's website Reply with quote
decard



Joined: 11 Sep 2003
Posts: 1092
Location: Poland
decard
OK, got it Wink
It crashes inside IDirectDraw_SetDisplayMode in ddraw.inc file (line 500).
Post 08 Jan 2004, 14:53
View user's profile Send private message Visit poster's website Reply with quote
Octavio



Joined: 21 Jun 2003
Posts: 366
Location: Spain
Octavio
vid wrote
1. i dont like idea of posting 0.5 mb just for some 5 people who download game and then delete it. BTW, development directory has 1.8 mb (including all graphic twice etc), so it would be little too much. I've sent it to you, i hope you have enough space in you mail account


I received the file but i can't extract files because the file has errors.
I post this message here because i have problems whith my email system.
Post 14 Jan 2004, 01:21
View user's profile Send private message Visit poster's website Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid
octavio: OK, here is release version 1.0 (without sources), take a look at it

decard: here is 0.0.3.1 - i initialized ddraw same as i did it in that game (which worked on one computer where tg2d 0.0.3 dont). please test it if it works.

[edit] - removed Becher Shock game example, too big. ask for it Smile[/edit]


Last edited by vid on 10 Apr 2006, 00:12; edited 1 time in total
Post 18 Jan 2004, 19:57
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  
Goto page Previous  1, 2, 3, 4, 5  Next

< 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.