flat assembler
Message board for the users of flat assembler.

Index > Windows > FASM Resource types

Author
Thread Post new topic Reply to topic
typedef



Joined: 25 Jul 2010
Posts: 2913
Location: 0x77760000
typedef
Hie all. I was wondering if there is a way i can embed an mp3 file into my FASM program's resource section. Or is there and ID for such files..like RT_WAV etc ?

thanks
Post 09 Aug 2010, 23:51
View user's profile Send private message Reply with quote
pearlz



Joined: 07 Jun 2010
Posts: 55
Location: Viet Nam
pearlz
it's can be RT_RCDATA for use it, you can FindResource then LoadResource ..etc..
Post 10 Aug 2010, 20:38
View user's profile Send private message Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4633
Location: Argentina
LocoDelAssembly
Or just:
Code:
; Part of your code where you hold data
the_mp3_file: file 'TheFile.mp3'    
Don't know if there is an advantage with RT_RCDATA if you don't have separate versions per language (maybe the resource does not occupy memory while it is not loaded?).
Post 10 Aug 2010, 20:52
View user's profile Send private message Reply with quote
typedef



Joined: 25 Jul 2010
Posts: 2913
Location: 0x77760000
typedef
@LocoDel...how do i load it afterwards... i dont know its ID but name
Post 10 Aug 2010, 21:15
View user's profile Send private message Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4633
Location: Argentina
LocoDelAssembly
It is loaded already, doing "mov eax, [the_mp3_file]" will make EAX == <"ID3", 3> (or whatever the file signature is). Think of it as a byte array already pre-initialized with the file contents.

[edit]BTW, perhaps you'll need to know the size so use this instead:
Code:
; Part of your code where you hold data
the_mp3_file: file 'TheFile.mp3'
sizeof.the_mp3_file = $ - the_mp3_file ; Now you can know the size of this "byte array" with "sizeof.the_mp3_file"
    
Post 10 Aug 2010, 21:22
View user's profile Send private message Reply with quote
typedef



Joined: 25 Jul 2010
Posts: 2913
Location: 0x77760000
typedef
ok thanks
Post 10 Aug 2010, 21:30
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 YouTube, Twitter.

Website powered by rwasa.