Jump to content
Tuts 4 You

help- As working with music XM in assembler


ZELT@

Recommended Posts

Somebody would be able to help me to work with music XM in assembler preferential that it is with Winasm right now than when I create the executable you tell me that he is virus but solo if use it in a file RC but if I assemble templates from here somebody does not earmark me like virus can pleas help me?

--------------------------------------------------------------------------------------------------------

alguien me podria ayudar a trabajar con musica XM en ensamblador de preferencia que sea con Winasm ya que cuando creo el ejecutable me dice que es virus pero solo si lo utilizo en un archivo RC pero si ensamblo templates de aqui no me marca como virus alguien me puede ayudar por favor?

Link to comment
  • 2 weeks later...

hm this is new for me i never see that are av pop ups and say ther is are virus if i us are xm file wight asm.

Test this is for play are xm includet as are inc file.

include ufmod.inc

includelib ufmod.lib

.data

chiptune.inc

xmSize equ $ - table

.code

start:

dlgproc hWnd:etc etc

invoke uFMOD_PlaySong,addr table,xmSize,XM_MEMORY

--------------------------------------------------------

And her is it for playing it from are rc file

include ufmod.inc

includelib ufmod.lib

.const

ID_XM equ 2007(change to the number you whant)if you change the number to 12

and this on the rc file

2007 RCDATA DISCARDABLE "One.xm" change one.xm to the sound you whant make sure that is are xm file.change this number to 12 or it dont work.

dlgproc proc etc:etc,

invoke uFMOD_PlaySong,ID_XM,0,XM_RESOURCE <--this plays the sound from the rc file.

Link to comment
  • 2 weeks later...

you whant us mfmplayer is that right i thing its bether you us ufmod.

ufmod

1:the code is smaller /god

2: its eayse to us /god

-------------------------------------

mfmplayer

1:the code is large very larg /bad

2:its faster /god

------------------------------------------------------------------------

her is the code for mfmplayer.

include \masm32\include\winmm.inc

include mfmplayer.inc

includelib mfmplayer.lib

includelib \masm32\lib\winmm.lib

ID_XM equ 2007

.data?

nMusicSize DWORD ?

pMusic LPVOID ?

.const

you code

.code

start:

DlgProc PROC hWnd:DWORD,uMsg:DWORD,wParam:DWORD,lParam:DWORD

cmp playflag, 1

invoke mfmPlay, pMusic

mov playflag,1

invoke FindResource, hInstance, ID_XM, RT_RCDATA

push eax

invoke SizeofResource, hInstance, eax

mov nMusicSize, eax

pop eax

invoke LoadResource, hInstance, eax

invoke LockResource, eax

mov esi, eax

mov eax, nMusicSize

add eax, SIZEOF nMusicSize

invoke GlobalAlloc, GPTR, eax

mov pMusic, eax

mov ecx, nMusicSize

mov dword ptr [eax], ecx

add eax, SIZEOF nMusicSize

mov edi, eax

rep movsb

pop esi

invoke mfmPlay, pMusic

mov playflag,1

DlgProc endp

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...