The MASM Forum Archive 2004 to 2012
Welcome, Guest. Please login or register.
July 10, 2020, 11:40:39 AM

Login with username, password and session length
Search:     Advanced search
128553 Posts in 15254 Topics by 684 Members
Latest Member: mottt
* Home Help Search Login Register
+  The MASM Forum Archive 2004 to 2012
|-+  General Forums
| |-+  The Campus
| | |-+  Scrolling text flickers?
« previous next »
Pages: 1 2 [3] 4 5 Print
Author Topic: Scrolling text flickers?  (Read 29432 times)
hfheatherfox07
Member
*****
Posts: 482



Re: Scrolling text flickers?
« Reply #30 on: June 05, 2011, 10:12:12 PM »

Still no idea how to create the jumping sine .....
what did you mean with jumping sine? (See the attachment).
Is your problem the mathematics or measuring and placement of characters (or both)?

That is what I was looking to do.... If you don't mind me saying ...you seem like a very very good programmer, it will be many many years before I even catch up slightly..... Roll Eyes
Logged
hfheatherfox07
Member
*****
Posts: 482



Re: Scrolling text flickers?
« Reply #31 on: June 06, 2011, 12:05:42 AM »

Still no idea how to create the jumping sine .....
what did you mean with jumping sine? (See the attachment).
Is your problem the mathematics or measuring and placement of characters (or both)?

Any chance of a source?  Sad
Logged
qWord
Member
*****
Posts: 1425



Re: Scrolling text flickers?
« Reply #32 on: June 06, 2011, 03:25:07 AM »

in the attachment an lib holding the function JmpSine(). A short description can be found in the include file.
(take care of used data types  ThumbsUp)

qWord

* SinText.zip (7.92 KB - downloaded 360 times.)
Logged

FPU in a trice: SmplMath
It's that simple!
hfheatherfox07
Member
*****
Posts: 482



Re: Scrolling text flickers?
« Reply #33 on: June 07, 2011, 12:33:39 AM »

in the attachment an lib holding the function JmpSine(). A short description can be found in the include file.
(take care of used data types  ThumbsUp)

qWord


Thanks this should keep me plenty busy trying to really understand the concept of what is making the sine jump and wave....  dazzled
Logged
qWord
Member
*****
Posts: 1425



Re: Scrolling text flickers?
« Reply #34 on: June 07, 2011, 01:22:46 AM »

really understand the concept of what is making the sine jump and wave....  dazzled
Sinusoidal waves
or
Sine wave
Logged

FPU in a trice: SmplMath
It's that simple!
dedndave
Member
*****
Posts: 12523


Re: Scrolling text flickers?
« Reply #35 on: June 07, 2011, 08:16:05 AM »

Logged
hfheatherfox07
Member
*****
Posts: 482



Re: Scrolling text flickers?
« Reply #36 on: June 09, 2011, 10:18:23 PM »

YES !! found it...  BigGrin

Here are the complete sources of "HTMLencoder".
changed the music for a smaller piece else it wouldn't fit in the file.
Most of the labels are written in Dutch, if there's something you don't understand you can always ask me.
( Or you can take a course in dutch language, hahahahaha  lol )

Veel plezier.

Thanks a lot...here is a translated version to English

* HTMLencoder[ENG].zip (240.83 KB - downloaded 393 times.)
Logged
Siekmanski
Member
*****
Gender: Male
Posts: 112



Re: Scrolling text flickers?
« Reply #37 on: June 10, 2011, 12:44:59 PM »

Funny translation, hahaha  BigGrin BigGrin

Quote
Insert Quote
Quote from: Siekmanski on June 05, 2011, 05:45:04 pm
YES !! found it... 

Here are the complete sources of "HTMLencoder".
changed the music for a smaller piece else it wouldn't fit in the file.
Most of the labels are written in Dutch, if there's something you don't understand you can always ask me.
( Or you can take a course in dutch language, hahahahaha   )

Veel plezier.


Thanks a lot...here is a translated version to English
Logged
hfheatherfox07
Member
*****
Posts: 482



Re: Scrolling text flickers?
« Reply #38 on: June 18, 2011, 07:02:16 PM »

Funny translation, hahaha  BigGrin BigGrin

Quote
Insert Quote
Quote from: Siekmanski on June 05, 2011, 05:45:04 pm
YES !! found it... 

Here are the complete sources of "HTMLencoder".
changed the music for a smaller piece else it wouldn't fit in the file.
Most of the labels are written in Dutch, if there's something you don't understand you can always ask me.
( Or you can take a course in dutch language, hahahahaha   )

Veel plezier.


Thanks a lot...here is a translated version to English

It is all Google Translate ......
http://translate.google.com/#   

By the Way here is the version with your original song... I managed compressing the song a little..... and took out 21 instruments that were not used ......

http://www.megaupload.com/?d=1S3ZWV2Q
Logged
hfheatherfox07
Member
*****
Posts: 482



Re: Scrolling text flickers?
« Reply #39 on: June 20, 2011, 08:41:54 PM »

YES !! found it...  BigGrin

Here are the complete sources of "HTMLencoder".
changed the music for a smaller piece else it wouldn't fit in the file.
Most of the labels are written in Dutch, if there's something you don't understand you can always ask me.
( Or you can take a course in dutch language, hahahahaha  lol )

Veel plezier.


Here is a poor attempt to get just the sinescroller... I don't know what to do to initialize the scrolling??? any Ideas???...what don't I need In there???
Also I have a bunch of fonts ... that If I ever get this thing going I would like to use....but I can not find were you set the RGB (255,0,255) as the Transparent color for the font picture, also were did you set the font picture order??? what I mean is not all fonts will have certain Characters in them  If you try to use any of the fonts that I have you get misspellings .... where did you set:

Code:
fonts db " ? " ' ! # @% $ ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz 1234567890", 0

mine are in a different order ...are they in one of the libs??

* Sine Scroll With Bitmap Font.zip (122.58 KB - downloaded 364 times.)
* Fonts_32x32.zip (112.05 KB - downloaded 341 times.)
Logged
Siekmanski
Member
*****
Gender: Male
Posts: 112



Re: Scrolling text flickers?
« Reply #40 on: June 22, 2011, 12:18:49 PM »

Hi hfheatherfox07

The format is just "ASCII" format starting with "space" == (dec)32
In RadAsm you can find an "ASCII Table" on the right side of the toolbar.
Compare it with the picture and you'll understand it.

In the routine "Sinus_scroller" you can find this piece of code:

Code:
    sub    eax,32        ; ASCII value - 32   ( all values below 32 are used to control the speed etc. )
    shl    eax,5         ; chacracters are 32 pixels ( width and higth ) picture is 256 pixels  by 256 pixels ( so, 256/32=8 characters in one row )
    mov    ecx,eax       ; copy character start
    and    ecx,0ffh      ; calculate X pos
    and    eax,0ff00h    ; calculate Y pos
    shr    eax,3         ; 8 characters in one row to the next row

    mov    rcScrollFont.left,ecx  ; postion in font picture
    mov    rcScrollFont.top,eax

So, if you want to write a character just substract the value of the character with 32 and you get the right position in de font picture.

This is a fast way of getting the right position in the fontpicture.  BigGrin
But it only works on 256 pixel wide pictures with 32 pixel wide fonts.
( you can change the code to 8*8, 16*16 wide fonts if you want.)

The function "Set_TransparantColor" is in "common\DD_util.asm" and sets that color as the transparent color.

greetings Siekmanski
Logged
hfheatherfox07
Member
*****
Posts: 482



Re: Scrolling text flickers?
« Reply #41 on: June 23, 2011, 07:11:40 PM »

Hi hfheatherfox07

The format is just "ASCII" format starting with "space" == (dec)32
In RadAsm you can find an "ASCII Table" on the right side of the toolbar.
Compare it with the picture and you'll understand it.

In the routine "Sinus_scroller" you can find this piece of code:

Code:
    sub    eax,32        ; ASCII value - 32   ( all values below 32 are used to control the speed etc. )
    shl    eax,5         ; chacracters are 32 pixels ( width and higth ) picture is 256 pixels  by 256 pixels ( so, 256/32=8 characters in one row )
    mov    ecx,eax       ; copy character start
    and    ecx,0ffh      ; calculate X pos
    and    eax,0ff00h    ; calculate Y pos
    shr    eax,3         ; 8 characters in one row to the next row

    mov    rcScrollFont.left,ecx  ; postion in font picture
    mov    rcScrollFont.top,eax

So, if you want to write a character just substract the value of the character with 32 and you get the right position in de font picture.

This is a fast way of getting the right position in the fontpicture.  BigGrin
But it only works on 256 pixel wide pictures with 32 pixel wide fonts.
( you can change the code to 8*8, 16*16 wide fonts if you want.)

The function "Set_TransparantColor" is in "common\DD_util.asm" and sets that color as the transparent color.

greetings Siekmanski


Sorry no clue how to initiate "Sinus_scroller proc" with out crashing.... it seems that this little demo is very intertwined .... you almost need all the procs that you wrote including size window, why is that needed ??... No luck getting just a black screen with scrolling text Sad
Logged
Siekmanski
Member
*****
Gender: Male
Posts: 112



Re: Scrolling text flickers?
« Reply #42 on: June 24, 2011, 05:50:23 PM »

Your wish is my command.............  BadGrin

OK, stripped the source at your wishes.
Now it's your turn to change the font, and it's size.

Quote
you almost need all the procs that you wrote including size window, why is that needed ??...

It has no need but,  the user can stretch the screensize to the size they like.  ( you can remove it if you want. )


* SinusScroller.zip (116.95 KB - downloaded 373 times.)
Logged
hfheatherfox07
Member
*****
Posts: 482



Re: Scrolling text flickers?
« Reply #43 on: June 27, 2011, 02:23:51 AM »

Your wish is my command.............  BadGrin

OK, stripped the source at your wishes.
Now it's your turn to change the font, and it's size.

Quote
you almost need all the procs that you wrote including size window, why is that needed ??...

It has no need but,  the user can stretch the screensize to the size they like.  ( you can remove it if you want. )



Thank you so much ....
but I am at a loss about the 2 things still....

1. the ASCII table ( I am well familiar with ASCII to HEX to DEC conversion) but I do not see any were where you added the character order...
how did you declare the character pattern?...most pictures of fonts are not 8 rows by 8 columns
also I realize from your
2.previous post that the transparent color is set in :
Code:
The function "Set_TransparantColor" is in "common\DD_util.asm" and sets that color as the transparent color.

but I do not see a reference there for (255,0,255)  there.... ???

at the risk of looking dumb I just don't see it  Sad

were in the program would I change the picture-font background to black as transparent for example??

and were would I declare the character order and how.... ????

Thank you and sorry again that I don't see it
Logged
Siekmanski
Member
*****
Gender: Male
Posts: 112



Re: Scrolling text flickers?
« Reply #44 on: June 27, 2011, 07:42:23 AM »

You have to rearrange your fontpicture according to the "ASCII TABLE"

 ASCII TABLE 32 - 96 ( values used in the font picture )
 8 characters per row as in the "ASCII TABLE" starting with space ( value 32 )

   ! " # $ % & '   ; 32 - 39
 ( ) * + , - . /   ; 40 - 47
 0 1 2 3 4 5 6 7   ; 48 - 55
 8 9 : ; < = > ?   ; 56 - 63
 @ A B C D E F G   ; 64 - 71
 H I J K L M N O   ; 72 - 79
 P Q R S T U V W   ; 80 - 87
 X Y Z [ \ ] ^ _   ; 88 - 95

All characters are 32 * 32 pixels ( fontpicture has to be 256 * 256 )

Let's say we want to write "M"
"M" has the value 77

We need to calculate the offset of "M" in the fontpicture to cut it out and copy it in
the scrollscreen.

First substract 32 from 77 because our characters start with "SPACE" which is equal to 32

Let's do the calculations:

77 - 32 = 45
45 * 32 (character width) = 1440 ( keep a copy of 1440 to calc X position )
Y position == 1440 and 0ff00h = 1280 / 8 (characters in a row) = 160
X position == 1440 and 0ffh = 160

Cut out the M at left-top pixelposition 160,160 in the font picture ( 32 * 32 pixels )

all is done in this piece of code:
Code:
    sub    eax,32        ; ASCII value - 32   ( all values below 32 are used to control the speed etc. )
    shl    eax,5         ; chacracters are 32 pixels ( width and higth ) picture is 256 pixels  by 256 pixels ( so, 256/32=8 characters in one row )
    mov    ecx,eax       ; copy character start
    and    ecx,0ffh      ; calculate X pos
    and    eax,0ff00h    ; calculate Y pos
    shr    eax,3         ; 8 characters in one row to the next row

    mov    rcScrollFont.left,ecx  ; postion in font picture
    mov    rcScrollFont.top,eax

   etc......


; Initialisation of the background color and de tranparent color are done here:

Load_AllPictures proc

   invoke   Load_Picture,SinusFont,addr g_pSinusFont

   mov      eax,dwWindow_Width
   add      eax,32
   invoke   Create_Surface,eax,32,addr g_pDDSScrollScherm

   mov      ddBack_bltfx.dwFillColor,RGB(0,0,64) ; set the background color of the scrollscreen and the backbufferscreen ( they use the same struct )
   coinvoke g_pDDSScrollScherm,IDirectDrawSurface7,Blt,NULL,NULL,NULL,DDBLT_COLORFILL or DDBLT_WAIT,addr ddBack_bltfx

   invoke   Set_TransparantColor,g_pDDSScrollScherm,RGB(255,0,255) ; set the transparent fontcolor ( in this case it's pink )

   etc......

RenderDD proc hwnd:DWORD

;  clear backbuffer with your background color....
   coinvoke g_pDDSBack,IDirectDrawSurface7,Blt,NULL,NULL,NULL,DDBLT_COLORFILL or DDBLT_WAIT,addr ddBack_bltfx

   invoke   Sinus_scroller

   etc......



If you want to use other fonts with other offsets you need to make a look up table.....
Logged
Pages: 1 2 [3] 4 5 Print 
« previous next »
Jump to:  

Powered by MySQL Powered by PHP The MASM Forum Archive 2004 to 2012 | Powered by SMF 1.0.12.
© 2001-2005, Lewis Media. All Rights Reserved.
Valid XHTML 1.0! Valid CSS!