Advertisement

Results for "Author: robert rayment"

2002ASP #3460
Creating & Testing DLL with NASM

Creating & testing an assembler DLL using NASM, a freeware assembler. The demonstration DLL does Bit testing, shifting, rotating, clearing & setting.

2002ASP #3461
Machine code & Fractals PLUS

Machine code & Fractals PLUS: (NOTE now works with 16 & 24-bit color settings though 24-bit is best for color cycling). If you are just getting into machine code (mcode) this is a tutorial and an introduction to Fractals. Fractals are well suited to mcode and covered are Mandel, Julia, Newton, Tetrate, IFS, L-Sys, Martin and Sierpinski (adapted from FRACTINT). All the Fractals are coded in both VB and mcode. Extensive use is made of the maths coprocessor. So far as possible the structures are matched so that the mcode can be followed. This doesn't always produce the most efficient code but what the mcode is doing is more important. Included are special palettes for color cycling, alternative formulae for the Julia, Tetrate and IFS Fractals and saving them as 24-bit BMPS. CallWindowProc and picture box addressing are used as shown respectively by Ulli and Non-Linear Systems Alpha24. Other introductory mcode on PSC is shown in 'Machine code (ADDITIONS)', 'Machine code & Picture Boxes' and 'Machine code & more PicBox Games'. The asm files are written for the A386 assembler.

2002ASP #3462
Sixteen million colors DLL

16 Million Colors DLL. Example of a straightforward DLL, written with NASM, to cycle through all possible colors quickly. For 24-bit color only. All source code included. Zip file 8.5KB.

2002ASP #3463
VB, Assembler & Resource files

VB, Assembler & Resource files by Robert Rayment (see small update below) Only those interested in this topic should download these files. If you have been following some of the VB+assembler progs I've been putting on PSC you may have noticed that the assembly part is either in a bin file (com in earlier examples) or in a DLL. The disadvantage of both these is that they need to be in the same folder as the prog. This is OK for testing but is a nuisance for an EXE. Also we're usually talking about small bits of assembler to beef up parts of VB (Heineken approach). The DLL may be specific and so is not appropriate to register. Assembled snippets are often much faster than VB. Also, once you've got over the red-tape and peculiarities of the particular assembler, its often _easier_ (this may be a secret so don't tell anyone) A DLL has a minimum size of 16KB and a bin file 4KB (cluster size). What this submission shows is how to put your assembler code into a resource file which gets incorporated into an EXE freeing it from associations and only taking a few more bytes than the bin file size. A 32-bit Hex/Long integer/Binary converter is developed to demonstrate these techniques. The zip file is ~11KB. UPDATE: it is possible to simplify the load from res by InCode = LoadResData(101, "CUSTOM") lpMCode = VarPtr(InCode(0)) avoiding the save to disc. Make sure to delete the line lpMCode = VarPtr(InCode(1))

2002ASP #3499
EarthWaterFireAirLight

Elemental NASM.(UPDATE Now works on Win2000 and Probably WinNT) The zip file is ~ 26KB

2002ASP #3500
As(s)embler Plus VB Picture Processing Fun

As(s)embler Plus VB Picture Processing Fun: by Robert Rayment. I like to have everything at my finger tips as the screen shot shows. If you prefer the minimalist approach see the excellent filter prog by Manuel Santos ( I have used a modification of a couple of his filters and have included his bitmap). Stephan Swertvaegher's picture handling prog is great for ideas and delicate changes to pictures ( I haven't seen Kevin Gadd's prog but which I believe is based on a dll written in C). The ripple effect is based on Didar ul Alam's prog. My prog has some of their features but also includes scrolling, shifting, rotation, zooming (plus anti-alias rotation and zooming), rectangle extraction, resizing and crazy mirrors. Looping is also included which can cycle through changes until stopped. All but a couple of things are duplicated in mcode. For some effects this is only included for completeness but has a dramatic effect on others. The programmer is usually the last person to find all the errors so - Constructive comments welcome. Win98. Zip file 63 KB.

2002ASP #3501
Crazy Mirrors

Crazy Mirrors by Robert Rayment. See Screen shot. This is very straighforward and I've left the interface simple so, if you have a mind to, you can easily add some crazy mirrors of your own, Or add your own save bmp if you want. A couple of bitmaps are included which is why the Zip file is 102 kb.

2002ASP #3502
Newton's Cradle and Metronome

Newton's Cradle & Metronome by Robert Rayment. Simulates the known movement of balls in an idealized Cradle with variable speed & improved timing for the Metronome. Two progs. Win98. Zip file 24 KB.

2002ASP #3503
Interactive Filter Design

Interactive Filter Design by Robert Rayment. IMPROVED: Input, VB or ASM, some user filters by Malcom Ferris(NZ) included in a *.ufi file. I was in two minds about submitting this since it is really for my own use. Included are some 3x3 filters from Unlimited Realities and Manuel Santos. With this prog filters can be up to 5x5. What would interest me is whether anyone can find designs that are significantly different from the 3x3 filters with the filter formula I've used. Win98, Zip file 72KB.

2002ASP #3504
Demo Spheroid Wrapping

Demo Spheroid Wrapping by Robert Rayment. This takes any bitmap & wraps it around a sphere. This can then be moved, rotated and magnified. The prog can be run with VB or machine code. Controls are keys only for this demo. Win 98 Zip file 85 KB.

2002ASP #3505
Tunnels & Things

Tunnels & Things by Robert Rayment: The simplicity of this appeals to me. Draw to a byte array and blit it to the form using StretchDIBits. The advantage of StretchDIBits is that it can take a pointer to the byte drawing surface and to a palette. It can be as close as VB gets to direct screen addressing similar to the old DOS Screen 13, only better. It is no competitor to DirectX but is very much simpler and pretty fast. The demonstration shows various tunnels, MMX scrolling, Plasma, Fire etc. Drawing is done using VB and animation using assembler (assembler doesn't have to be used but I prefer it). BTW please do not contaminate my progs with the prurient Option Explicit !! Zip file is 63KB.

2002ASP #3506
Linear transforms

Linear Transforms by Robert Rayment. This is maybe 'old hat' to some of you. It shows in pure VB, apart from loading bitmaps & set & get pixels, how to map a rectangular bitmap area onto a non-reeentrant quadrilateral, a circle, cylinder, right-circular cone and a sphere. I've stopped short of automating the shapes and saving the transfoms so you need to change the parameters in the code to get variations. Hopefully the comments are sufficient for you to do with it as you wish! Zip file 145KB (With some bitmaps).

2002ASP #3507
Spirals

Spirals by Robert Rayment. Chris and I were looking at some spirals and I've animated a few for your pleasure (if you like that kind of thing!). See 'Tunnels & Things' for the techniques. Zip file 24 KB.

2002ASP #3508
A Dash Thru the Woods

A Dash Through the Woods by Robert Rayment. UPDATE: Improved bitmap creation (Having been goaded by Paul) plus some simple sound. This prog is based on the triplet StretchDIBits, byte arrays and assembler (as with 'Tunnels & Things' which got 10 excellent votes) except I've left out the assembler which means that it MUST be compiled so that the array manipulations are again dealt with by machine code. The prog will only produce a large bitmap file of smaller trees from a starting bitmap ONCE so that later runs can load up the byte arrays quickly. The creation of the bit maps is fast enough now so you could leave out the save to disk if you wanted to. It shows some other uses for StretchDIBits and 8-bit color byte surfaces, which might be of interest to some of you. No assembler is used. Trees are then put onto a drawing surface starting with the smallest and ignoring a white surround (masks not needed). By keeping and adjusting the x-position, direction and type of tree it looks like moving through some woods. Timing (using GetTickCount) and hence speed, the number of tree starts and their spread are on an options menu. The left & right cursor moves a little car to the left & right (actually the trees move in the opposite direction) and the up & down cursor changes the speed. You have to try not to hit the trees. Collision detection is based on x-coords. It needs compiling to an EXE to get a decent speed. Don't expect DirectX quality but I think its fun! The Zip file is 54 KB.

2002ASP #3509
NASM Editor, assembler & Tutorial

NASM Editor, assembler & Tutorial by Robert Rayment. (Version 3.4) This is an MDI RTB editor specifically for creating and producing pure machine code and DLLs for use with VB. I've written it because nearly all the refs on the Web are for DOS-asm, C-asm and All asm Windows progs. These are mostly confusing and none of it is needed to write useful VB-asm progs. nasmw.exe is needed to make full use of this package (Latest Web refs for NASM are given (NB Can also be obtained from A1VBCODE.com)). In the pack there is a Help file (make sure to read Requirements about the placement of nasmw.exe and other progs), a Tutor file and a crib for all the NASM mnemonics. Bin files ( called in VB using CallWindowProc) and DLL files can be created with temporary files to clear errors and then permanent files. Starter stub files for Bins and DLLs are menued. There are also 5 Bin examples and 7 DLLs showing a variety of ways that these can be written, in particular the NASM syntax. Reference code for the editor was taken from all over the place. If you're a beginner there's still a lot of work to do before you can write useful asm progs but, hopefully, this will get you over the first hurdles. Good luck! Win98, Zip 120KB.

2002ASP #3510
Simple reader for kjv.ini

Simple reader for kjv.ini by Robert Rayment. This may be of interest to those who want a simple but effective way of displaying large text files using simple VB. You will need to download Clint LaFever's kjv.ini (KJV BIBLE on PSC, I have his permission) and put it in the same folder as this prog. Basically the whole of the file is loaded into a string (most computers nowadays, can cope with this size of file) and an offset table built up to the Book, Chapter and Verse. 3 list boxes then take Book description and Chapter & Verse numbers enabling any Book, Chapter and all its Verses to be displayed quickly in a multi-line, scrollable text box. UPGRADE for Jude which has only 1 chapter -- whoops.

2002C #12044
Machine code & more PicBox Games

Machine code & Picture Box Games by Robert Rayment: This shows some more demonstrations of machine code and picture boxes. Mixing, Blending, Greying, Scrolling, Color cycling, Shimmering, Darkening, Brightening and Rotating. All code fully commented - good fun!

2002C #12045
FindWords

Finds words starting with, containing, ending with, >

2002C #12046
Machine code(ADDITIONS)

Machine code: Demonstrates the use of machine code in VB using CallWindowProc (as put forward by Ulli). 7 pieces of code ending with code equivalent to the API CopyMemory. I've added some notes on using MASM32 as suggested by respondents. NB See later submissions for use of the freeware assembler NASM.

2002C #12047
Machine code & Picture Boxes

Machine Code Picture box addressing: This show how to manipulate picture box images using direct machine code with CallWindowProc (see Ulli). This demonstration is a door to other image processing without using DirectX. Non-linear systems recent Alpha24 shows the DLL way.

Languages
Top Categories
Global Discovery