News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

Recent posts

#21
Game Development / Re: Space Invaders
Last post by FORTRANS - July 19, 2024, 12:03:17 AM
Hi,

   I tried INVADERS.COM, INVADERS.EXE, and INVADE32.EXE in a
Windows NTVDM, and all ran normally.  INVADERS.COM and
INVADERS.EXE had an odd long pause after dying until I could
quit.

   Trying in an OS/2 VDM, all ran too fast.  Same odd Pauses.

Regards,

Steve N.
#22
Game Development / Re: Space Invaders
Last post by daydreamer - July 18, 2024, 10:15:13 PM
nice work japhet  :thumbsup:
its design is old dos game run ASAP=run As fast as possible,it makes my cpu go full speed with turbo and cooler fan goes full speed(windows version)

but I already have a different energy setting for lower cpu speed to switch to when run old win95 games for that to solve that kinda problem
 
#23
Game Development / Re: Space Invaders
Last post by FORTRANS - July 18, 2024, 08:26:26 AM
Hi,

   The Windows version works well with my Win2k system.

Regards,

Steve
#24
Game Development / Re: Space Invaders
Last post by Vortex - July 18, 2024, 04:25:12 AM
Hi Japheth,

Nice work :thumbsup:

For those who would like to try the game, here is how to use the keyboard : left and right arrow keys to move the cannon and SPACE to fire.
#25
Game Development / Space Invaders
Last post by _japheth - July 17, 2024, 08:45:34 PM

Hello Friends,

I played with Paul S. Reid's "Space Invaders" source code a bit. It's a clone of the famous Arcade game of the 1980s, written with TASM, using VGA mode 0x13 ( 320x200x8 ). The first step was to convert it to Masm syntax. Then, just for fun, I made protected-mode variants, for DPMI 16-/32-bit and Win32.

The Win32 variant uses the (now "legacy") DirectDraw API, and runs in 640x480x8 mode; this seems to be supported by all Windows versions. It might run too fast on new machines - that probably can be fixed rather easily by switching to DirectDraw7 and then select a vertical refresh rate of 60 or 70.

The DOS versions run fine in true DOS and in DosBox. However, with Qemu and VBox there's a problem - they don't support "vertical retrace" synchronisation ( an interesting discussion about this is here: https://forum.osdev.org/viewtopic.php?t=31917 ) - so the game runs way too fast there.

Btw, the game is copyright Paul S. Reid, but distribution of binary and source is ok....


#26
ObjAsm / Command Line Options
Last post by Biterider - July 17, 2024, 05:32:33 PM
Managing the command line options turned out to be a repetitive task that can be greatly simplified with some procedures I have come up with that I would like to share.

Starting from the following command line format:
MyApplication.exe -MyOption1 -MyOption2 ...
where MyOption can be a number, a quoted string, a bit position, a boolean or a single character, e.g.
MyApplication.exe -I:".\Windows Drivers\" -s:1 -W:42
There are 2 pieces of information needed. The first is the target structure where the options are stored and the second is the definition where the procedures take their information to process the switches.

Here I used a fictional structure that could look like this:
OPTIONS struct
  bShowUsage          BYTE      FALSE         ;-? command line switch
  pIncludeDirs        PSTRINGW  NULL          ;-I command line switch
  dSelectiveOutput    DWORD     0             ;-s command line switch
  dWarningLevel       DWORD     0             ;-W command line switch
OPTIONS ends

And the second one, in accordance with the first structure, could be like this:
OptionDefTable label OPTION_ENTRY
  OPTION_ENTRY <$OfsTBStr("-?"),  OPT_IS_BOOL,    offset OPTIONS.bShowUsage>
  OPTION_ENTRY <$OfsTBStr("-I:"), OPT_IS_STRING,  offset OPTIONS.pIncludeDirs>
  OPTION_ENTRY <$OfsTBStr("-s:"), OPT_IS_BIT,     offset OPTIONS.dSelectiveOutput>
  OPTION_ENTRY <$OfsTBStr("-W:"), OPT_IS_DECIMAL, offset OPTIONS.dWarningLevel>
  PSTRINGW NULL


Once this is done, only 3 procs need to be called:
.data
Options OPTIONS {}
.code
invoke GetCommandLine
invoke ParseCmdLineArgs, xax
mov pCmdLineArgList, xax
lea xdx, Options
invoke GetOptions, offset OptionDefTable, xdx, xax

Finally when you are done, free the allocated argument list (pCmdLineArgList) and all option strings.
MemFree pCmdLineArgList
invoke StrDispose Options.pIncludeDirs

The workhorses are the ParseCmdLineArgs and GetOptions procedures.
They can be downloaded fromof from the attachment or from https://github.com/ObjAsm/ObjAsm-C.2/blob/master/Code/ObjMem/Common/


Some definitions must be added:
OPT_IS_BOOL     equ 0
OPT_IS_BIT      equ 1
OPT_IS_CHAR     equ 2
OPT_IS_DECIMAL  equ 3
OPT_IS_STRING   equ 4

;Option table entry
OPTION_ENTRY struct
  pSwitch  PSTRINGW ?     ;BSTR
  bType    BYTE     ?
  xOffset  XWORD    ?
OPTION_ENTRY ends
POPTION_ENTRY typedef ptr OPTION_ENTRY

Notes:
- pSwitch points to a BSTR in the alt .const segment and can be created using the $OfsTBStr macro.
- The created option strings are WIDE (unicode) und must be disposed when no longer needed.


Regards, Biterider
#27
The Campus / Re: ML errors
Last post by stoo23 - July 17, 2024, 11:28:39 AM
Beat me to it,  :smiley: ... I was on the phone. ... Thanks  :thumbsup:
#28
The Campus / Re: ML errors
Last post by NoCforMe - July 17, 2024, 11:21:57 AM

#29
The Campus / Re: ML errors
Last post by stoo23 - July 17, 2024, 11:08:57 AM
Quote
Quote from: tda0626 on July 16, 2024, 10:18:42 PMNot sure how that happened but asked for deletion.
In the future, you can simply edit your posts, at any time after you make them.
Yes, in fact I'd have thought you may already have been aware of that ??  :smiley:

From the choices (which should be visible in the Lower Right of you Post, (shown below), you can choose either "Quick Edit" or "More", which will allow you to choose 'Modify' to give you Full access to the Post Editor available when you initially wrote your post  :smiley:

You cannot view this attachment.
#30
The Campus / Re: ML errors
Last post by NoCforMe - July 17, 2024, 03:36:09 AM
Quote from: tda0626 on July 16, 2024, 10:18:42 PMNot sure how that happened but asked for deletion.
In the future, you can simply edit your posts, at any time after you make them.