xbox-scene.com - your xbox news information source
Quick Links: Main Forums | Xbox360 Forums | Xbox1 Forums | PS3 Forums
Xbox-Scene Forum Help  Search Xbox-Scene Forums   Xbox-Scene Forum Members   Xbox-Scene Calendar

Giganews Usenet Offers: +1150 days binary retention, 99%+ Completion, and Unlimited Speed/Access!

360 ODD Emulators: X360 Key $99 | Wasabi360 FAT $99 | Wasabi360 Slim $99
C4E's iXtreme Burner MAX Drive: LiteOn iHAS124 DROPPED TO JUST $17


Welcome Guest ( Log In | Register )

 Forum Rules Rules
 
Reply to this topicStart new topic
> Using Virtual Memory On Xbox, Do you manage it yourself or something?
_zlinky
post Feb 19 2011, 07:03 AM
Post #1


X-S Member
*

Group: Members
Posts: 75
Joined: 6-June 06
Member No.: 285003



I know this is going to sound very n00bish, but I'm kinda new to using virtual memory on Xbox, or for programming games in general. Since the average Xbox is limited to 64Mb or RAM, I obviously can't allocate buffers that large or load in files larger than that. For instance, the old versions of MAME-X used physical memory to load ROMs and couldn't load large ROMs. Then when they started using virtual memory, they had much more memory to work with.

I understand that virtual memory doesn't work like physical memory, and I already understand how to use VirtualAlloc/Free, but what addresses do you read/write to exactly? On my debug Xbox, it says that I have a total of 2GB of virtual memory to work with, and it hardly gets used (only about 8MB max on average), and I'd like to use it to my advantage so that non-immediately used data won't hog up the physical RAM. So would I just choose any address after the first 64MB in the 4GB address space? If so, do you have to manage the addresses allocated yourself? I noticed that there's no Map/UnmapViewOfFile functions on Xbox, so I thought I'd ask. Thanks.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
halofreak1990
post Feb 24 2011, 12:21 PM
Post #2


X-S Young Member
*

Group: Members
Posts: 57
Joined: 6-November 08
From: The Netherlands
Member No.: 394680
Xbox Version: v1.6
360 version: v1 (xenon)



The XBOX kernel has several functions that allow you to interact with virtual memory, like NtAllocateVirtualMemory and NtDeallocateVirtualMemory

Other than keeping track of how many chunks of memory you've allocated (in order to prevent memory leaks) you don't need to keep track of it. The kernel does that for you. Virtual Memory can be accessed just like physical memory. In fact, a game usually only reads/writes into virtual memory. The only reason for a game to write to Physical memory would be some special interaction with the XBOX hardware.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
Ez0n3
post Mar 9 2011, 05:39 AM
Post #3


X-S Member
*

Group: Dev/Contributor
Posts: 74
Joined: 13-October 08
Member No.: 392390
Xbox Version: unk
360 version: unknown



I think zlinky means use more than 64MB by paging the additional virtual memory to a file on the disk. The kernel has VM functions and a 4GB address space, but allocating more than 64MB of RAM will crash the application because the VMM function never page to disk like windows does. It just dies when > 64MB is used.

StepMania and MAMEoX both have their own implementation of a virtual memory manager which allows paging to disk. There was talk of adding it to XBMC, but I don't think that ever materialized.

Surreal64 also uses paging, but it's very tailored to the app. I'm not sure how they compare against each other performance wise yet, but would like to know.

Virtual Memory Allocation On The Xbox, Problems while allocating ram.

Why Does The Emulator Have To Load The Whole Rom?, Still pondering this 64MB thing...

A "possible" Solution To Ram Shortages...., ...Possible....

The Google wink.gif

I think there's an SDK project that touches on this also:
\Microsoft Xbox SDK\Samples\Xbox\Misc\CustomMemoryAllocator

Undecided atm :/.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post





Reply to this topicStart new topic

 

Lo-Fi Version Time is now: 22nd May 2013 - 02:32 PM