Quantcast
Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
    1. Welcome to GTAForums!

    1. Red Dead Redemption 2

      1. Gameplay
      2. Missions
      3. Help & Support
    2. Red Dead Online

      1. Gameplay
      2. Find Lobbies & Outlaws
      3. Help & Support
    1. Crews & Posses

      1. Recruitment
    2. Events

    1. GTA Online

      1. Arena War
      2. After Hours
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Grand Theft Auto Series

    3. GTA Next

    4. GTA V

      1. PC
      2. Guides & Strategies
      3. Help & Support
    5. GTA IV

      1. Episodes from Liberty City
      2. Multiplayer
      3. Guides & Strategies
      4. Help & Support
      5. GTA Mods
    6. GTA Chinatown Wars

    7. GTA Vice City Stories

    8. GTA Liberty City Stories

    9. GTA San Andreas

      1. Guides & Strategies
      2. Help & Support
      3. GTA Mods
    10. GTA Vice City

      1. Guides & Strategies
      2. Help & Support
      3. GTA Mods
    11. GTA III

      1. Guides & Strategies
      2. Help & Support
      3. GTA Mods
    12. Top Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    13. Wiki

      1. Merchandising
    1. GTA Modding

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Mod Showroom

      1. Scripts & Plugins
      2. Maps
      3. Total Conversions
      4. Vehicles
      5. Textures
      6. Characters
      7. Tools
      8. Other
      9. Workshop
    3. Featured Mods

      1. DYOM
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Red Dead Redemption

    2. Rockstar Games

    1. Off-Topic

      1. General Chat
      2. Gaming
      3. Technology
      4. Programming
      5. Movies & TV
      6. Music
      7. Sports
      8. Vehicles
    2. Expression

      1. Graphics / Visual Arts
      2. GFX Requests & Tutorials
      3. Writers' Discussion
      4. Debates & Discussion
    1. News

    2. Forum Support

    3. Site Suggestions

Sign in to follow this  
Shmoopy

[SA/DOC]Functions list

Recommended Posts

Shmoopy

Documenting GTA SA asm functions + some scm functions I've made, so that people can grab what they need without harassing themselves by looking for functions addresses.This topic will be updated from time to time.


[table]

RwCameraASM Functions100%FunctionParametersCommentSampleFlags0x7EE4F0There are no parameters to pass,not so sure thought,returns a pointer to the RwCamera createdRwCameraCreate creates a new camera0AA7: RwCameraCreate 0x7EE4F0 num_params 0 pop 0 ret:RwCamera [email protected] pass the RwCamera pointerRwCameraDestroy destroys the specified camera that you've created0AA5: RwCameraDestroy 0x7EE4B0 num_params 1 pop 1 RwCamera [email protected] pass the RwCamera pointer,returns the clone pointerRwCameraClone is used to create a copy of the specified camera,the old and new camera share the same frame, image raster and Z-buffer raster. If the original camera has been added to a world, the new camera is also in that world0AA7: RwCameraClone 0x7EF3B0 num_params 1 pop 1 RwCamera [email protected] ret:RwCamera2 [email protected] pass the clearmode (see flags for different modes), the color RGBA of the raster wich should be an offset ([email protected] = 255 [email protected] = 255 [email protected] = 255 [email protected] = 255) the offset is [email protected] and finally our cameraRwCameraClear is used to clear the image and/or Z-buffer rasters associated with the specified camera. This function is typically used to prepare the camera's rasters for receiving the results from a new rendering0AA5: RwCameraClear 0x7EE340 num_params 3 pop 3 clearmode 0x1 color [email protected] RwCamera [email protected] the image raster = 0x1Clear the Z-buffer raster = 0x2Clear the stencil buffer= 0x40x7EE190You pass the pointer to RwCamera,it returns the pointer to the camera that is renderingRwCameraBeginUpdate is used to indicate that the specified camera is about to start rendering a view of a scene and that the camera's frame buffer raster is to be the target of any subsequent 3D rendering0AA7: RwCameraBeginUpdate 0x7EE190 num_params 1 pop 1 RwCamera [email protected] ret:RwCamera [email protected] pass the pointer to RwCamera,it returns the pointer to the camera that was renderingRwCameraEndUpdate is used to indicate that 3D rendering to the specified camera has been completed0AA7: RwCameraEndUpdate 0x7EE180 num_params 1 pop 1 RwCamera [email protected] ret:RwCamera [email protected] pass the farclip float value (in world unit like coordinates) plus the cameraRwCameraSetFarClip is used to set the distance of the specified camera's far clip-plane. This distance is specified in world units and must be greater than the near clip-plane.0AA5: RwCameraSetFarClip 0x7EE2A0 num_params 2 pop 2 farclip 200.0 RwCamera [email protected] pass the nearclip float value (in world unit like coordinates) plus the cameraRwCameraSetNearClip is used to set the distance of the specified camera's near clip-plane. This distance is specified in world units and must be greater than zero and less than the far clip-plane.0AA5: RwCameraSetNearClip 0x7EE1D0 num_params 2 pop 2 nearclip 0.2 RwCamera [email protected] pass the view offset (2d vector) which consists of two floats x and y (example: [email protected] = 50.0 [email protected] = 45.0 offset is [email protected]) plus the cameraRwCameraSetViewOffset is used to specify the current view-offset of the given camera.0AA5: RwCameraSetViewOffset 0x7EE1A0 num_params 2 pop 2 viewoffset [email protected] RwCamera [email protected] pass the RwSphere (3d vector) which consists of three floats x y and z (example: [email protected] = 2134.4 [email protected] = 1021.1 [email protected] = 13.2 offset is [email protected]), it returns the result which is a flag , see flagsRwCameraFrustumTestSphere is used to check if a specified sphere intersects the view frustum of the given camera. A sphere that is wholly inside the frustum is considered to have intersected the frustum..0AA7: RwCameraFrustumTestSphere 0x7EE2D0 num_params 2 pop 2 [email protected] RwCamera [email protected] ret: RwFrustumTestResult [email protected]@ == 0 :outside the frustum;[email protected] == 1 :on the boundary of the frustum;[email protected] == 2 :inside the frustum0x7EE3A0You pass projection type , see flags, and the RwCameraRwCameraSetProjection is used to specify the projection mode for the given camera:perspective or parallel.0AA5: RwCameraSetProjection 0x7EE3A0 num_params 2 pop 2 projection 1 RwCamera [email protected] : 1;parallel: 2;0x7EE410You pass the view window v2d ([email protected] = 0.4 [email protected] = 0.4) and the RwCameraRwCameraSetViewWindow is used to set the size of the specified camera's view-window.0AA5: RwCameraSetViewWindow 0x7EE410 num_params 2 pop 2 viewwindow [email protected] RwCamera [email protected] pass the camera pointer, it returns the clump of the cameraRwCameraGetClump is used to get the RpClump of a RwCamera0AA7: RwCameraGetClump 0x749E50 num_params 1 pop 1 RwCamera [email protected] RpClump [email protected] pass the camera pointer, it returns a pointer to the RpWorld that holds the camera (if any)RwCameraGetWorld is used to get the RpWorld of a RwCamera0AA7: RwCameraGetWorld 0x750F80 num_params 1 pop 1 RwCamera [email protected] RpWorld [email protected] pass the camera and the clump pointers[/tdRpClumpAddCamera is used to add a RwCamera that was created to an RpClump0AA5: RpClumpAddCamera 0x74A550 num_params 2 pop 2 RwCamera [email protected] RpClump [email protected] pass the camera and the world pointersRpWorldAddCamera is used to add the specified camera to the given world. Cameras must be added to a world before they can be used to render objects0AA5: RpWorldAddCamera 0x750F20 num_params 2 pop 2 RwCamera [email protected] RpWorld [email protected] pass the camera and the frame pointersRwCameraSetFrame is used to attach a RwCamera that was created to a RwFrame, therefore the RwCamera gets the rotation and position of the RwFrame0AA5: RwCameraSetFrame 0x804EF0 num_params 2 pop 2 RwFrame [email protected] RwCamera [email protected][/table]


[table]RwCameraSCM Functions70%FunctionParametersComment0AB1: @RwCameraGetRaster params 2 RwCamera [email protected] type 1 ret:RwRaster [email protected]

 

:RwCameraGetRasterif    [email protected] == [email protected] += 960A8D: [email protected] = read_memory [email protected] size 4 virtual_protect 0else if    [email protected] == [email protected] += 1000A8D: [email protected] = read_memory [email protected] size 4 virtual_protect 0endend0AB2: ret 1 [email protected]

 

 

Type 1: Normal buffer; Type 2: Z Buffer-

0AB1: @RwCameraSetRaster params 3 RwCamera [email protected] type 1 RwRaster [email protected]

 

:RwCameraSetRasterif    [email protected] == [email protected] += 960A8C: write_memory [email protected] size 4 value [email protected] virtual_protect 0else if    [email protected] == [email protected] += 1000A8C: write_memory [email protected] size 4 value [email protected] virtual_protect 0endend0AB2: ret 0

 

 

Type 1: Normal buffer; Type 2: Z Buffer-

0AB1: @RwCameraGetNearClip params 1 RwCamera [email protected] ret:Nearclip [email protected]

 

:[email protected] += 1280A8D: [email protected]= read_memory [email protected] size 4 virtual_protect 00AB2: ret 1 [email protected]

 

 

--

0AB1: @RwCameraGetFarClip params 1 RwCamera [email protected] ret:Farclip [email protected]

 

:[email protected] += 1320A8D: [email protected]= read_memory [email protected] size 4 virtual_protect 00AB2: ret 1 [email protected]

 

 

--

0AB1: @RwCameraGetType params 1 RwCamera [email protected] ret:Type [email protected]

 

:[email protected] += 200A8D: [email protected]= read_memory [email protected] size 1 virtual_protect 00AB2: ret 1 [email protected]

 

 

Type:Perspective = 1;Orthographic = 2-

0AB1: @RwCameraSetType params 2 RwCamera [email protected] Type 1

 

:[email protected] += 200A8C: write_memory [email protected] size 1 value [email protected] virtual_protect 00AB2: ret 0

 

 

Type:Perspective = 1;Orthographic = 2-

0AB1: @GetPlayerRwCamera params 0 ret:RwCamera [email protected]

 

:[email protected] = 0xB6F97C0A8D: [email protected] = read_memory [email protected] size 4 virtual_protect 00AB2: ret 1 [email protected]

 

 

--
[/table] Edited by Manfred Von Karma

Share this post


Link to post
Share on other sites
Shmoopy

[table]

RwRasterASM Functions100%FunctionParametersCommentSampleFlags0x7FB230There are 4 parameters to pass:flag(type and/or format),depth,height and width,it returns the pointer of the created rasterRwRasterCreate is used to create a new raster of the specified type with the given width, height and depth.The width and height are specified in pixels, the depth is the number of bits per pixel, and the flags indicate the type, and possibly the format, of the raster to create. Specifying zero for the depth indicates that the device default value should be used Note that the type and format are combined using a bit-wise OR, here is an example : 0B11: [email protected] = 0x04 OR 0x0000 // type is 0x04 (texture) and format is 0x0000 (default)0AA7: RwRasterCreate 0x7FB230 num_params 4 pop 4 format/type [email protected] depth 0 height 480 width 640 ret: RwRaster [email protected]

Type:-Device default raster = 0x00 -Camera Z-buffer raster = 0x01 -Camera frame buffer raster = 0x02 -Texture raster = 0x04 -Camera texture raster = 0x05 -Texture mask = 0x07 Format:Default = 0x0000;16 bits - 1 bit alpha, 5 bits red, green and blue = 0x0100 ;16 bits - 5 bits red and blue, 6 bits green = 0x0200 ;16 bits - 4 bits per component = 0x0300 ;Gray scale = 0x0400 ;32 bits - 8 bits per component = 0x0500 ;24 bits - 8 bits per component = 0x0600 ;16 bits - undefined: useful for things like Z buffers = 0x0700 ;24 bits - undefined: useful for things like Z buffers = 0x0800 ;32 bits - undefined: useful for things like Z buffers = 0x0900 ;16 bits - 5 bits red, green and blue = 0x0a00 ;RenderWare generated the mip levels = 0x1000 ;8 bit palettised = 0x2000 ;4 bit palettised = 0x4000 ;Mip mapping on = 0x8000 ;The pixel color format = 0x0f00 ;The whole format = 0xff00

 

0x7FB020 You pass the pointer of the raster RwRasterDestroy is used to destroy the specified raster and free any resources it may have used 0AA5: RwRasterDestroy 0x7FB020 num_params 1 pop 1 RwRaster [email protected] - 0x7FAEE0 You pass the pixel value which is an integer RwRasterClear is used to clear the entire area of the current render target 5(active RwRaster) to the given device specific pixel value 0AA5: RwRasterClear 0x7FAEE0 num_params 1 pop 1 pixel 1 - 0x7FAF90 You pass the pixel value which is an integer and the rectangle which is an offset of 4 elements:xpos,ypos,height and width ([email protected] = 25 [email protected] = 30 [email protected] = 480 [email protected] = 640) RwRasterClearRect is used to clear the specified rectangular sub-region of the current render target to the given device specific pixel value 0AA5: RwRasterClearRect 0x7FAF90 num_params 2 pop 2 pixel 1 rect [email protected] - 0x8043F0 You pass the path of the image which can be in PNG or BMP format RwRasterRead is used to read an image from a disk file and convert it into a raster 0AA7: RwRasterRead 0x8043F0 num_params 1 pop 1 image "CLEO\\bullethole.png" RwRaster [email protected] - 0x8044E0 You pass the path of the images which shoul be in BMP format RwRasterReadMaskedRaster is used to read two images from disk files, apply the mask contained in the second to the first and convert the result to a raster 0AA7: RwRasterReadMaskedRaster 0x8044E0 num_params 2 pop 2 imagemask "CLEO\\bulletholem.bmp" image "CLEO\\bullethole.bmp" RwRaster [email protected] - 0x7FB2D0 You pass the lockmode,the level which is generally 0 and the raster RwRasterLock is used to lock the specified raster for direct pixel access according to the given lock mode. The lock prevents the device changing the raster's data while it is under the control of the application 0AA5: RwRasterLock 0x7FB2D0 num_params 3 pop 3 lockmode 0x01 level 0 RwRaster [email protected] LockMode:Lock for writing = 0x01 Lock for reading =0x02 0x7FAEC0 You pass the raster RwRasterUnlock is used to unlock the specified raster, following a call to RwRasterLock, allowing it to be used by the device again 0AA5: RwRasterUnlock 0x7FAEC0 num_params 1 pop 1 RwRaster [email protected] - 0x804290 You pass the RwImage and the raster,note that the width and height of the raster must be equal to those of RwImage RwRasterSetFromImage is used to change the pixels of the specified raster to those of the given image 0AA5: RwRasterSetFromImage 0x804290 num_params 2 pop 2 RwImage [email protected] RwRaster [email protected] - 0x7FAFB0 You pass the y position (integer) the x position (integer) and the raster,note that you should always push the raster on top of the stack before any rendering(RwRasterPushContext),and when you want to render another raster you should pop the previous one (if there was any) that was rendered before pushing this new one(RwRasterPopContext) RwRasterRender is used to render the specified raster to the currently selected render target 0AA5: RwRasterRender 0x7FAFB0 num_params 3 pop 3 y 30 x 30 RwRaster [email protected] - 0x7FAF50 You pass the y position (integer) the x position (integer) and the raster RwRasterRenderFast is used to render the specified raster to the currently selected render target but without considering the alpha transparency 0AA5: RwRasterRenderFast 0x7FAF50 num_params 3 pop 3 y 30 x 30 RwRaster [email protected] - 0x7FAE80 You pass the rectangle and the raster RwRasterRenderScaled is used to render the specified raster to the given rectangular region in the currently selected render target 0AA5: RwRasterRenderScaled 0x7FAE80 num_params 2 pop 2 rect [email protected] RwRaster [email protected] - 0x7FB060 You pass the raster RwRasterPushContext is used to indicate that the specified raster is to be the target of subsequent clears and blits (rendering) 0AA5: RwRasterPushContext 0x7FB060 num_params 3 pop 3 y 30 x 30 RwRaster [email protected] - 0x7FAE60 Returns the raster RwRasterGetCurrentContext is used to determine which, if any, raster is the current target for raster rendering and clearing 0AA7: RwRasterGetCurrentContext 0x7FAE60 num_params 0 pop 0 RwRaster [email protected] - 0x7FB110 - RwRasterPopContext is used to indicate that the raster on the top of the context stack is no longer to be targeted with subsequent clears and blits 0AA5: RwRasterPopContext 0x7FB110 num_params 0 pop 0 - 0x7FB1D0 You pass the RwRect, the raster and the subraster RwRasterSubRaster is used to define a raster that references a rectangular sub-region in another raster 0AA5: RwRasterSubRaster 0x7FB1D0 num_params 3 pop 3 rect [email protected] RwRaster [email protected] SubRwRaster [email protected] - 0x7FB160 You pass the raster,it returns the number of mipmap levels RwRasterGetNumLevels is used to retrieve the number of mipmap levels in a specified raster 0AA7: RwRasterGetNumLevels 0x7FB160 num_params 1 pop 1 RwRaster [email protected] mipmaplevels [email protected] - [/table]

[table] RwRasterSCM Functions100%FunctionParametersComment0AB1: @RwRasterGetParent params 1 RwRaster [email protected] ret:RwRasterParent [email protected]

 

:RwRasterGetParent 0A8D: [email protected] = read_memory [email protected] size 4 virtual_protect 0 0AB2: ret 1 [email protected]

 

 

- - 0AB1: @RwRasterGetParams params 1 RwRaster [email protected] ret: width [email protected] height [email protected] depth [email protected]

 

:RwRasterGetParams [email protected] += 12 0A8D: [email protected] = read_memory [email protected] size 4 virtual_protect 0 [email protected] += 40A8D: [email protected] = read_memory [email protected] size 4 virtual_protect 0 [email protected] += 4 0A8D: [email protected] = read_memory [email protected] size 4 virtual_protect 0 0AB2: ret 3 [email protected] [email protected] [email protected]

 

 

- - [/table] Edited by Manfred Von Karma

Share this post


Link to post
Share on other sites
Shmoopy

[table]

RwImageASM Functions80%FunctionParametersCommentSampleFlags0x8026E0 You pass the depth,height and width (integer),it returns the RwImage RwImageCreate is used to create an image with the specified size and depth 0AA7: RwImageCreate 0x8026E0 num_params 3 pop 3 depth 32 height 480 width 640 ret:RwImage [email protected] Depth:4 bits,8 bits or 32 bits 0x802740 You pass the pointer of the RwImage RwImageDestroy is used to destroys the specified image 0AA5: RwImageDestroy 0x802740 num_params 1 pop 1 RwImage [email protected] - 0x802FD0 You pass the path of the image file RwImageRead is used to read an image from a disk file (PNG or BMP) 0AA7: RwImageRead 0x802FD0 num_params 1 pop 1 path "CLEO\\image.png" RwImage [email protected] - 0x8027A0 You pass the pointer of the RwImage RwImageAllocatePixels is used to allocate memory for pixels for the specified image that was created using RwImageCreate 0AA5: RwImageAllocatePixels 0x8027A0 num_params 1 pop 1 RwImage [email protected] - 0x802860 You pass the pointer of the RwImage RwImageFreePixels is used to free memory previously allocated by using RwImageAllocatePixels, this is used after you destroy the RwImage 0AA5: RwImageFreePixels 0x802860 num_params 1 pop 1 RwImage [email protected] - 0x803FE0 You pass the correction value (float) RwImageSetGamma is used to specify the current gamma correction value 0AA5: RwImageSetGamma 0x803E30 num_params 1 pop 1 value 0.7 - 0x803E30 You pass the pointer of the RwImage RwImageGammaCorrect is used to apply gamma correction to the specified image according to gamma correction value that was set using RwImageSetGamma 0AA5: RwImageGammaCorrect 0x803E30 num_params 1 pop 1 RwImage [email protected] - 0x802A20 You pass the pointer of the RwImage whose alpha channel will be generated RwImageMakeMask generates an alpha channel for the specified image based on it's pixel color values 0AA7: RwImageMakeMask 0x802A20 num_params 1 pop 1 RwImage [email protected] RwImageMask [email protected] - 0x802AF0 You pass the pointer of the mask image and the image that will receive the mask RwImageApplyMask applies an image's alpha mask to another image 0AA5: RwImageApplyMask 0x802AF0 num_params 2 pop 2 RwImageMask [email protected] RwImage [email protected] - 0x8035C0 You pass the path of the mask image and the normal image RwImageReadMaskedImage is used to read an image from a disk file 0AA7: RwImageReadMaskedImage 0x8035C0 num_params 2 pop 2 mask "CLEO\\imagemask.bmp" image "CLEO\\image.bmp" RwImage [email protected] - 0x804250 You pass the path of the mask image and the normal image RwImageSetFromRaster is used to convert the specified RwRaster into an equivalent RwImage 0AA5: RwImageSetFromRaster 0x804250 num_params 2 pop 2 RwRaster [email protected] RwImage [email protected] - 0x8042C0 You pass the raster type flag(integer) and the RwImage,it returns the format,depth,height and width of the image raster RwImageFindRasterFormat is used to determine a suitable raster format for a given image and the current target 0AA5: RwImageFindRasterFormat 0x8042C0 num_params 6 pop 6 ret:format [email protected] ret:depth [email protected] ret:height [email protected] ret:width [email protected] type 4 RwImage [email protected] Raster type: Texture = 4;Mask = 7; [/table] Edited by Manfred Von Karma

Share this post


Link to post
Share on other sites
Shmoopy

Reserved

Share this post


Link to post
Share on other sites
Shmoopy

Reserved

Share this post


Link to post
Share on other sites
Shmoopy

Reserved

Share this post


Link to post
Share on other sites
TJGM

Locked on request.

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  

  • 1 User Currently Viewing
    0 members, 0 Anonymous, 1 Guest

×
×
  • Create New...

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.