I will only say this:
I don't remember writting all that code he posted.
so now that we know he is writting 90% of it, lets help in those
areas he my have problems in.

I would like to remind some people that it is not our job to scare people from asking.
if you still think he was not writting most of the code, look at the file he posted.

Zcoder....

Posted on 2006-06-26 20:52:25 by Zcoder
Once you make the basic correlation between those high level concepts you learned, and the low level ones, you will start to understand better. It seems that you have approached this level.

OS Based assembly language is really nothing more than adhering to the OS' API calls, and as you stated, your weakness seems to be the API itself.

My suggestion, would be to study something like THIS. It might not be the exact thing you are looking for, but it will help you along the way. It will take a lot of patience, careful attention and plenty of re-reading before it *clicks*, but you will get there if you work through it. The assembly language parts you will understand from the sourrounding context, the API calls should be studied from the horse's mouth (MSDN in this case) for any further explanations. As always, you can come here if you have any any questions :)
Posted on 2006-06-26 21:43:41 by SpooK
Horse's mouth, quite an apt way to put it :P
I'll definately check out SpaceTris, nice to see some ASM stuff on gamedev, I forgot to check their articles for any ASM stuff.
Apparently I still need practice with my ASM syntax, lol. I coded a bunch tonight and got pelted by on averag between 20 and 30 errors (or more), which I'm slowly working though (Thuogh if I get stumped, I'll be posting tomorrow morning to see what part of them I messed up on).

EDIT: Ok, I managed to fix most errors, but I'm just not sure why this isn't working. I know my code probably sucks compared to something professional, but considering I havent touched ASM since trying to learn todo SNES ASM (and promptly quitting because of the fact that there's just WAY too much you need to do), I think it's not bad.
Attachments:
Posted on 2006-06-26 22:56:21 by Bobbias
Bobbias,
I am sorry to add to your reading list but perhaps you should read up on creating a resource scrip as yours has a big problem with a simple solution.

There is an error in the first line of code.  It is a comment, true; but comments are not handled the same way as in assembly or include files.  Examine the following:
//This Resource Script was generated by WinAsm Studio.

100 BITMAP DISCARDABLE "paddle.bmp"

Note that I have replaced the semi-colon with two slashes.

That is just a beginning, there are assembly errors, also.

Paul
Posted on 2006-06-27 07:26:22 by PBrennick
The semicolon works for me.
Posted on 2006-06-27 08:47:53 by JimG
Lol, I don't really care about how much I gotta read (unless it's some heavy technical specs or something, :P), but I really never looked into the resource file stuff, I just assumed that the IDE knew enough about them, and I could figure things out by reading the resulting file myself sometime later.

And yeah, my assembly errors are the ones that are more pressing :/ I know it's goddt be something really stupid, but I do need a bit more practice in ASM before I can truely say I completely know what I'm doing. Then again, projects like this are a good way for me to learn stuff. It's certainly helped me in java (I was writing a multi-threaded chat server form the ground up... well, I leared quickly that thread synchronization is a GIGANTIC pain in java, especially when you have a thread dedicated to popping out threaded connections when necessary, which you need to conroll somehow)

In any case, I'm definately going to try to fix all this crap, because I know that overall, most of my ASM there should work.
Posted on 2006-06-27 11:05:52 by Bobbias
Jimg,
I copied this from the rc.hlp file.
The syntax and semantics for the RC preprocessor is the same as for the preprocessor in a C compiler. Single-line comments begin with two forward slashes (//) and run to the end of the line. Block comments begin with an opening delimiter (/*) and run to a closing delimiter (*/). Comments do not nest.

Emphasis added by me.  As you can see there is no semi-colon used for comments.  If you are using an IDE it may be teaching bad habits by switching this 'on the fly.'

The reference is the final arbitrator in this situation, I think; though, references are not without errors.  ;)

Stick with using //
Paul
Posted on 2006-06-27 16:34:36 by PBrennick
Nice to know it uses C-style comments (Probably the most commn form), but that still doesn't help with whatever's wrong with my macro :/

If someone could point out what I got wrong here, I'd greatly appreciate it:

SETPAD macro paddle,isleft,scr_width,scr_height
.IF isleft==1
mov paddle.left,10
mov paddle.right,26
.ELSE
mov eax,scr_width
sub eax,10 ;XScreen - 10
lea ecx,paddle
mov PADDLE.right,eax
sub eax,16 ;XScreen -10 - 16
mov PADDLE.left,eax
.ENDIF
mov eax,scr_height ;top = screen/2 - height/2
div eax,10 ;screen/10 = height
shr eax,1 ;height/2
mov ebx,scr_height
shr ebx,1 ;screen/2
sub eax,ebx ;screen/2 - height/2
mov PADDLE.top,eax
add eax,ebx ;screen/2 - height/2 + height/2
add eax,ebx ;+ height/2
mov PADDLE.bottom,eax ;screen/2 + height/2
endm
Posted on 2006-06-27 17:16:17 by Bobbias

Or you could use this:


?  invoke GetSystemMetrics,SM_CXFULLSCREEN
?  mov ,eax
?  invoke GetSystemMetrics,SM_CYFULLSCREEN
?  mov ,eax


then use CreateWindow using Xscreen,Yscreen


Zcoder....



Here is a VC code to set a dialog fullscreen:


void CSwfPlayerDlg::OnbtnFullScr()//play in fullscreen widnow
{
// TODO: Add your control notification handler code here
if(false==m_IsFullScr)
{
  GetWindowPlacement(&m_DefDlgPos);
  ::ShowWindow(m_hStatusWindow, SW_HIDE);//Hide the statusbar
  SetWindowLong(m_hDlg, GWL_STYLE, GetWindowLong(m_hDlg, GWL_STYLE) - WS_CAPTION);//Hide the title bar
  CClientDC dc(this);
  int horzres = dc.GetDeviceCaps(HORZRES);
  int vertres = dc.GetDeviceCaps(VERTRES);
  this->MoveWindow(0, 0, horzres, vertres);
  m_SwfBox.SetWindowPos(&CWnd::wndTop, 0, 0, horzres, vertres, SWP_SHOWWINDOW);//Let flash display in fullscreen
  m_IsFullScr = true;
}
}


Posted on 2006-06-27 20:14:30 by purpleendurer

Jimg,
I copied this from the rc.hlp file.
The syntax and semantics for the RC preprocessor is the same as for the preprocessor in a C compiler. Single-line comments begin with two forward slashes (//) and run to the end of the line. Block comments begin with an opening delimiter (/*) and run to a closing delimiter (*/). Comments do not nest.

Emphasis added by me.  As you can see there is no semi-colon used for comments.  If you are using an IDE it may be teaching bad habits by switching this 'on the fly.'

The reference is the final arbitrator in this situation, I think; though, references are not without errors.  ;)

Stick with using //
Paul


Hi Paul-  You are totally correct.    But it works with semicolons also, documentation or no.  I'll ask Antonis, who first told me this, where he found out.
Posted on 2006-06-27 20:39:25 by JimG
As helpful as that is, the problem isn't setting a fullscreen window, it's positioning the pong paddles in referance to the screen location.

In any case, for some reason I'm getting tons of errors refering to this macro:


Assembling: C:\Documents and Settings\Sue\Desktop\asm\WinAsm\WinTut stuph\test1.asm
C:\Documents and Settings\Sue\Desktop\asm\WinAsm\WinTut stuph\test1.asm(89) : error A2070: invalid instruction operands
SETPAD(5): Macro Called From
  C:\Documents and Settings\Sue\Desktop\asm\WinAsm\WinTut stuph\test1.asm(89): Main Line Code
C:\Documents and Settings\Sue\Desktop\asm\WinAsm\WinTut stuph\test1.asm(89) : error A2070: invalid instruction operands
SETPAD(12): Macro Called From
  C:\Documents and Settings\Sue\Desktop\asm\WinAsm\WinTut stuph\test1.asm(89): Main Line Code
C:\Documents and Settings\Sue\Desktop\asm\WinAsm\WinTut stuph\test1.asm(89) : error A2008: syntax error : ,
SETPAD(13): Macro Called From
  C:\Documents and Settings\Sue\Desktop\asm\WinAsm\WinTut stuph\test1.asm(89): Main Line Code
C:\Documents and Settings\Sue\Desktop\asm\WinAsm\WinTut stuph\test1.asm(89) : error A2070: invalid instruction operands
SETPAD(15): Macro Called From
  C:\Documents and Settings\Sue\Desktop\asm\WinAsm\WinTut stuph\test1.asm(89): Main Line Code
C:\Documents and Settings\Sue\Desktop\asm\WinAsm\WinTut stuph\test1.asm(90) : error A2070: invalid instruction operands
SETPAD(5): Macro Called From
  C:\Documents and Settings\Sue\Desktop\asm\WinAsm\WinTut stuph\test1.asm(90): Main Line Code
C:\Documents and Settings\Sue\Desktop\asm\WinAsm\WinTut stuph\test1.asm(90) : error A2070: invalid instruction operands
SETPAD(12): Macro Called From
  C:\Documents and Settings\Sue\Desktop\asm\WinAsm\WinTut stuph\test1.asm(90): Main Line Code
C:\Documents and Settings\Sue\Desktop\asm\WinAsm\WinTut stuph\test1.asm(90) : error A2008: syntax error : ,
SETPAD(13): Macro Called From
  C:\Documents and Settings\Sue\Desktop\asm\WinAsm\WinTut stuph\test1.asm(90): Main Line Code
C:\Documents and Settings\Sue\Desktop\asm\WinAsm\WinTut stuph\test1.asm(90) : error A2070: invalid instruction operands
SETPAD(15): Macro Called From
  C:\Documents and Settings\Sue\Desktop\asm\WinAsm\WinTut stuph\test1.asm(90): Main Line Code
C:\Documents and Settings\Sue\Desktop\asm\WinAsm\WinTut stuph\test1.asm(89) : error A2001: immediate operand not allowed
SETPAD(1): Macro Called From
  C:\Documents and Settings\Sue\Desktop\asm\WinAsm\WinTut stuph\test1.asm(89): Main Line Code
C:\Documents and Settings\Sue\Desktop\asm\WinAsm\WinTut stuph\test1.asm(90) : error A2001: immediate operand not allowed
SETPAD(1): Macro Called From
  C:\Documents and Settings\Sue\Desktop\asm\WinAsm\WinTut stuph\test1.asm(90): Main Line Code
Posted on 2006-06-27 21:10:30 by Bobbias