Recent Posts

Pages: [1] 2 3 ... 10
1
Irvine Book Questions. / Re: Bundle and Play XM File As Resource
« Last post by dedndave on Today at 12:54:11 PM »
what i find interesting here is the "sound from memory" ability
i have been looking for a good way to do this, primarily for ham radio stuff

if i wasn't so lazy, i could pour through all the ufmod library code and figure out how it works
(that would probably include learning all about the XM file format)

instead, i wanted a quick list of the functions called to make it happen
so, i did a disassembly on one of Marinus' programs and dumped this  :biggrin:

Code: [Select]
   Import Module 002: winmm.dll

Addr:00003210 hint(00B5) Name: waveOutGetPosition
Addr:00003226 hint(00B8) Name: waveOutOpen
Addr:00003234 hint(00BA) Name: waveOutPrepareHeader
Addr:0000324C hint(00BB) Name: waveOutReset
Addr:0000325C hint(00C0) Name: waveOutUnprepareHeader
Addr:00003276 hint(00C1) Name: waveOutWrite
Addr:00003200 hint(00AC) Name: waveOutClose

.... wow, Jochen is catching me up - lol - 7666 posts  :shock:
2
The Campus / Re: RichEdit or PoorEdit
« Last post by Mikl__ on Today at 10:55:25 AM »
3
The Campus / Re: RichEdit or PoorEdit
« Last post by jj2007 on Today at 09:58:42 AM »
Something like this maybe?
Code: [Select]
lea rsi, pSourceAnsi
lea rdi, pDestUnicode
@@:
  lodsb
  stosw
  dec ecx
  jns @B
4
The Campus / RichEdit or PoorEdit
« Last post by Jokaste on Today at 09:03:46 AM »
I'm having trouble with RichEdit! It has been 3 or 4 days. I'm trying to search for a string. After 3 days I finally realized that the search string had to be converted to UNICODE! Despite all my reading, I could almost recite Iczelion's tutorial by heart, I can not do it. I ask for help.
5
Irvine Book Questions. / Re: Bundle and Play XM File As Resource
« Last post by DavidB on Today at 08:51:37 AM »
I cannot figure out how to convert my XM to a data dump that I could then use in my .data section

That is the easy part, use the attached tool: Just drag the xm file over the exe (works with any type of file, but there may be size limits, see SetClip$).

Once it's on the clipboard, use the data as follows:
Code: [Select]
include \masm32\include\masm32rt.inc
.code
start:
  mov ebx, offset dend
  mov edi, offset dstart
  sub ebx, edi
  ... your code here ...
  print str$(edi), " is the start of the buffer", 13, 10
  inkey str$(ebx), " bytes are available", 13, 10
  exit
dstart:
db  045h, 078h, 074h, 065h, 06Eh, 064h, 065h, 064h, 020h, 04Dh, 06Fh, 064h, 075h, 06Ch, 065h, 03Ah
db  020h, 048h, 061h, 070h, 070h, 079h, 020h, 048h, 02Eh, 020h, 043h, 068h, 072h, 069h, 073h, 074h
...
db  021h, 000h, 000h, 000h, 020h, 020h, 020h, 020h, 020h, 020h, 020h, 073h, 069h, 067h, 06Eh, 065h
db  064h, 02Ch, 020h, 044h, 052h, 041h, 058h, 000h, 000h, 000h, 080h, 000h, 000h, 028h, 000h, 000h
db  000h
dend:
end start
Well that method was way too messy, so what I've done instead is added an obj file that was created from the XM file to the linker. I tried adding the inc file created from the XM to the linker instead, but Visual Studio complained that it was invalid.

The inc file has this in it:

Code: [Select]
; -----------------------------------------------------
; Include the contents of this file in your source file
; to access the data as an OFFSET and use the equate as
; the byte count for the file data in the object module
; -----------------------------------------------------
EXTERNDEF MyXMFile:DWORD
ln_MyXMFile equ <26087>

I've placed this code in the .data segment. I acquired a copy of the ufmod.inc and ufmod.lib and added them to my project like so:

Code: [Select]
include ufmod.inc
includelib ufmod.lib

After that, I tried loading the offset for my XM file in eax like this:

Code: [Select]
lea eax, MyXMFile
I followed this line up with:

Code: [Select]
invoke uFMOD_PlaySong, eax, 0, 0
Moving the offset of MyXMFile to eax seems to have worked, but when I try to do the "PlaySong" part, I get an entire collection of "unresolved external symbol" errors. Here is the section of Visual Studio's output pertaining to this issue.

Code: [Select]
1>ufmod.lib(ufmod.obj) : error LNK2001: unresolved external symbol __imp__waveOutClose@4
1>ufmod.lib(ufmod.obj) : error LNK2001: unresolved external symbol __imp__waveOutGetPosition@12
1>ufmod.lib(ufmod.obj) : error LNK2001: unresolved external symbol __imp__waveOutOpen@24
1>ufmod.lib(ufmod.obj) : error LNK2001: unresolved external symbol __imp__waveOutPrepareHeader@12
1>ufmod.lib(ufmod.obj) : error LNK2001: unresolved external symbol __imp__waveOutReset@4
1>ufmod.lib(ufmod.obj) : error LNK2001: unresolved external symbol __imp__waveOutUnprepareHeader@12
1>ufmod.lib(ufmod.obj) : error LNK2001: unresolved external symbol __imp__waveOutWrite@12

Where do I go from here? I am fairly certain that I am close, but I am still not quite there.
6
The Campus / Re: Need Help / Recommendations for my compiler
« Last post by newbiedude on Today at 07:36:53 AM »
Indeed, tried with instruction "sas" and also worked, one issue less. Thanks  :icon_redface:
7
The Campus / Re: Need Help / Recommendations for my compiler
« Last post by jj2007 on Today at 07:26:16 AM »
mov cad1_00, chr$("Hola") should work.
8
The Campus / Re: Need Help / Recommendations for my compiler
« Last post by newbiedude on Today at 04:20:17 AM »
Hi. Yeah, it's a school project, my teacher and classmates are going to use emu8086, but I don't feel really excited to use it since we are well beyond the 8086 and 16 bits and I don't want to emulate. The sintax is very similar to a C language, it uses { } for zones, the same basic operators, etc. It has sintax support for objects and arrays 1d and 2d but since time is lacking it will be limited to local methods and no arrays. And yes, the plan is to generate all the assembly code, there's already an intermediate code which will be mostly the source for the assembly. I declare every variable from a symbol table, and plan using registers for temporal values from operations instead of creating aditional variables for temporals.
I was looking at the Help files, couldn't find the crt_ functions, I'm still confused on what functions use to read and write my data types, and what data use to each one. I'm also having trouble loading a string into a variable:
cad1_00 SDWORD ?
...
mov cad1_00,"Hola"
invoke crt_printf,OFFSET cad1_00
...
It prints < aloH > and is restricted to 4 chars long.
Do I have to make a special case for strings?

Thanks for your help.
9
16 bit DOS Programming / Re: Unknown relocation type (1) error
« Last post by Vortex on Today at 04:13:34 AM »
In legacy BIOS systems, 16-bit assembly can be useful to handle the code in the Master Boot Record. For example, one could create a hotkey to boot from a customized recovery environment.
10
Irvine Book Questions. / Re: Bundle and Play XM File As Resource
« Last post by Siekmanski on Today at 02:44:02 AM »
Cool music  8)
Pages: [1] 2 3 ... 10