• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.

Archived

This topic is now archived and is closed to further replies.

bosjoh

win32 asm question

9 posts in this topic

Just take your current code add ';'s after all your statements and you can put your lables inside the _asm {}. Thats another thing its _asm not asm. So it would be something like:

_asm {
les di, buffer;
add di, 63360;
.
.
.
Loop:
mov al, [es:di-1];
.
.
.
}

Josh

0

Share this post


Link to post
Share on other sites
Why adding 63360 to di? This would take the pointer to the bottom of the screen (I want to use this blurring effect all over the screen.
I already figured out that asm{} becomes _asm{}, but that's not my prblem. Every assembler test runs but when I use
les di, buffer
the compiler quits when it gets out of the function. I know that changing registers causes this, so I want to know which registers I should save (like in BC++ 5.0 not saving DS would be critical) and if I can use push and pop for that.
0

Share this post


Link to post
Share on other sites
oops sorry about the wrong number (it was kinda late when i typed that). The problem is (probably) that youre trying to use old dos style stuff in windows which doesnt fly. Are you trying to use this with mode 13h or with DDraw? And as far as registers go you usually dont have to save any, its usually done by the compiler (tho in some cases such as CPUID you have to save them). But i could be wrong so try pushing and poping di, its not going to hurt anything. I cant really help you out much without knowing if youre trying to do this with DDraw or 13h, so tell me.

Josh

0

Share this post


Link to post
Share on other sites
The C/C++ compilers tend to push everything on the stack for you and pop it off at the end. So, doing it again is kind of redundant.

Also, there is NO need to load the segments. The les instruction is invalid in 32-bit flat memory model program. Instead use lea if you want the address.

- Chris

0

Share this post


Link to post
Share on other sites
Thanks bit, that was the information I need.
But here is another question: is it es:edi or just edi? And do you move (except using stos) a value at a memory like this:
mov es:edi, 10
or
mov edi, 10?

I'm using a directdraw 640x480x256 screenmode, lock the area and retrieving the pointer to the screen.

0

Share this post


Link to post
Share on other sites
Just use EDI.

For all intents and purposes there are NO segments. This isn't entirely correct. But, you won't need to be doing anything with them.

- Chris

0

Share this post


Link to post
Share on other sites
I've changed the code to this:

_asm{
lea edi, buffer
add edi, 640
mov ecx, 305920
xor ax, ax
xor bx, bx
};
Looper:
_asm{
mov al, [edi-1]
mov bl, [edi+1]
add ax, bx
mov bl, [edi-640]
add ax, bx
mov bl, [edi+640]
add ax, bx
shr ax, 2
jz Done
dec ax
};
Done:
_asm{
stosb
loop Looper
};

But it doesn't work. The address of 'buffer' is not loaded into EDI.

0

Share this post


Link to post
Share on other sites
To move the buffer address into EDI, you can do:

MOV EDI, buffer

To move the contents of where the buffer address points
to into EAX, do:

MOV EAX, [EDI]

To increment the buffer address (to just the next byte), do:

ADD EDI, 1


Heathen

0

Share this post


Link to post
Share on other sites
I've written this code in BC++ 5.0. My question is: how can I write it in VC++ 6.0?
And which registers should I save/load (using push & pop?). Here is the code:

asm{
les di, buffer
add di, 320
mov cx, 63360
xor ax, ax
xor bx, bx
};
Loop:
asm{
mov al, [es:di-1]
mov bl, [es:di+1]
add ax, bx
mov bl, [es:di-320]
add ax, bx
mov bl, [es:di+320]
add ax, bx
shr ax, 2
jz Done
dec ax
};
Done:
asm{
stosb
loop Loop
};//a blurring effect in 320x200 rez

0

Share this post


Link to post
Share on other sites