xboxscene.org forums

Pages: 1 ... 10 11 [12] 13

Author Topic: Kawa-x ...virtual Memory?  (Read 1082 times)

Donan Fear

  • Archived User
  • Newbie
  • *
  • Posts: 10
Kawa-x ...virtual Memory?
« Reply #165 on: July 29, 2003, 04:44:00 AM »

QUOTE (hosh @ Jul 29 2003, 11:13 AM)
QUOTE (Donan Fear @ Jul 29 2003, 11:19 AM)
How I think it works is that it doesn't load the entire decompressed rom, it reads and decompresses the roms on-the-fly when needed, the Xbox should be fast enough to do that. That's probably why it doesn't support decryption, without virtual memory you can't load everything into ram, and to decrypt on-the-fly is either too slow or not possible at all.

How do you propose this would be? Making it not load up all the levels at once, etc? That would mean MHz would have to code his emulator to open specific things when specific stuff happens in the game, for each and every game that's too big. I kinda doubt it.

And if this was true, how would you explain those games with tons of fighter characters - that show the characters moving when you highlight their name on the select screen? The characters must be the biggest space-hogs in fighters, at least, seeing as how they're amazingly well-animated with a whole truckload of frames of animation.

It's pretty simple really. When the game wants to read data from some address in a rom, it loads that. It probably loads a larger block than requested to speed things up (the game will probably need data somewhere around there soon).

And those games with tons of characters that are animated on the select screen, you don't have to load the entire character to show a simple animation.

Even if you did use true virtual memory you would face the same problems, what if the data that you need for the next frame is paged out?
Logged

Iriez

  • Administrator
  • Hero Member
  • *****
  • Posts: 1238
Kawa-x ...virtual Memory?
« Reply #166 on: July 29, 2003, 06:57:00 AM »

QUOTE (mr jones @ Jul 29 2003, 01:41 AM)
Iriez - I only have the most rudimentary of programming knowledge, and would love for you to to explain abit about how paging is used on here.  From a curiosity standpoint, I'd really like to know.

As for both files needing to be used, I'm afraid that you're mistaken.  Both files do not need to be in the directory for larger games like Metal Slug 3, to run.  I'll explain:


As for needing both files, im aware of the situation. I just worded poorly. I had meant that you need files from both the zips, but not that you *had* to have both zips present ...i understand you can merge them.

As for his paging, i wont paste any code, but heres the jist..

Its basically 20mb of central RAM area allocated for swap. The pages are divided into 256kb. At the beginning, they are loaded with the first pages by default. For each frame, if a page is used, has a flag set to 0. At the end of a frame you increment all flags. When a new page is needed, replace the one that has a bigger flag (the one that was used most long ago).

The point is to have the most used pages in the RAM at that instant, for speed and efficiency. Very similar to LRU paging.
Logged

Mage

  • Archived User
  • Sr. Member
  • *
  • Posts: 482
Kawa-x ...virtual Memory?
« Reply #167 on: July 29, 2003, 07:45:00 AM »

It is his emulator, and think about this, being an emulator writer he is used to dealing with memory maping.  It isn't far off for him to write software paging support.

Now I doubt he's using the IA32 hardware on demand paging.  
Since if he was, the code would be instantly portable to all xbox programs.

Edit:
Donan Fear - just because he's smart about it and only demand loads graphics and such doesn't make it any less VM.  VM has nothing to do with the hard drive for your information.  Nor does paging.
Logged

Donan Fear

  • Archived User
  • Newbie
  • *
  • Posts: 10
Kawa-x ...virtual Memory?
« Reply #168 on: July 29, 2003, 08:02:00 AM »

tongue.gif
Logged

Mage

  • Archived User
  • Sr. Member
  • *
  • Posts: 482
Kawa-x ...virtual Memory?
« Reply #169 on: July 29, 2003, 08:35:00 AM »

QUOTE (Donan Fear @ Jul 29 2003, 09:02 AM)
Yeah, I know. But you have to page to/from somewhere, and the only memory areas the Xbox has is RAM and HDD.
This isn't virtual memory on the Xbox level (what people may think when you simply call it "virtual memory"), it's "virtual rom" on the emulated system's level. Rom is memory too, so it IS true 100% virtual memory, I know that, but the noobs get confused so I would rather call it something else.. tongue.gif

I'll make it simple.

He is maping multiple segments of rom addresses to a single xbox virtual address space of 20MB as Iriez said.  The ROM segments exceed 20MB therefore not all can exist in this memory chunk at the same time.

Now tell me, how is that NOT virtual memory?  He cannot alone just use a simple TLB to handle the ROM address <-> xbox memory space conversion.

I think you confuse the term virtual memory with swap disk being used in some demand paging methods.  Since to use paging you don't need to use a hard drive.  That's just the most common method.  So you shouldn't link demand paging with swap disks always, that is bad thing to do.

Logged

falz

  • Archived User
  • Full Member
  • *
  • Posts: 113
Kawa-x ...virtual Memory?
« Reply #170 on: July 29, 2003, 08:41:00 AM »

Yes, Kawa-x uses virtual memory.

Virtual Memory (http://www.hyperdict.../virtual memory)

Definition:   A system allowing a computer program to behave as though the computer's memory was larger than the actual physical RAM. The excess is stored on hard disk and copied to RAM as required.

--falz
Logged

mr jones

  • Archived User
  • Full Member
  • *
  • Posts: 164
Kawa-x ...virtual Memory?
« Reply #171 on: July 29, 2003, 09:03:00 AM »

QUOTE (Iriez @ Jul 29 2003, 10:57 AM)
As for his paging, i wont paste any code, but heres the jist..

Its basically 20mb of central RAM area allocated for swap. The pages are divided into 256kb. At the beginning, they are loaded with the first pages by default. For each frame, if a page is used, has a flag set to 0. At the end of a frame you increment all flags. When a new page is needed, replace the one that has a bigger flag (the one that was used most long ago).

The point is to have the most used pages in the RAM at that instant, for speed and efficiency. Very similar to LRU paging.

Ah hell.  I was hopin' for a paragraph of code or two.  I was studying up on VMM algorithms back when Nintendo 64 emulation was all the rage and this sounded an awful lot like same upper memory management that my instructor talked about in my Unix classes.

I won't try to dig too much farther into this, considering that the little bit about page swapping that I learned was WAY back when Windows NT was introduced.  But I do want to know this:  How is it that Mhz's memory manager knows what pages are accessed the least to be able to be swapped?  For an application like an emulator, I would think that the it would not only have to swap the page that's requested, but the surrounding pages as well.  That would mean that he'd have to have extensive knowledge of the Neo Geo / CPS architecture to be able to determine how the original hardware utilized its memory.  Otherwise, you'd have page faults all over the place, I would think...  huh.gif

Damn, I should've paid more attention in class....
Logged

digitalman42

  • Archived User
  • Full Member
  • *
  • Posts: 202
Kawa-x ...virtual Memory?
« Reply #172 on: July 29, 2003, 09:27:00 AM »

This may be a stupid question but this emu isn't leaving a big perm swap file on my xbox hd is it? cause I really like this EMU, it kicks mames butt, as far as the roms it does play.  So much faster and they look better,, it cant screw anything on my xbox up though right?
Logged

digitalman42

  • Archived User
  • Full Member
  • *
  • Posts: 202
Kawa-x ...virtual Memory?
« Reply #173 on: July 29, 2003, 09:30:00 AM »

also, im running this emu from a DVD, with the roms on the dvd, seems to be working flawless,, this doesn't screw anything up either does it?
Logged

Beelzebud

  • Archived User
  • Full Member
  • *
  • Posts: 124
Kawa-x ...virtual Memory?
« Reply #174 on: July 29, 2003, 09:59:00 AM »

smile.gif  

Look for great things in the xbox future.  smile.gif

Thanks for that info Iriez.
Logged

Donan Fear

  • Archived User
  • Newbie
  • *
  • Posts: 10
Kawa-x ...virtual Memory?
« Reply #175 on: July 29, 2003, 11:28:00 AM »

QUOTE (Mage @ Jul 29 2003, 04:35 PM)
I'll make it simple.

You don't have to, I'm not stupid (too late, you already did tongue.gif). I know exactly what virtual memory is and how it works, I've done it myself a few times. I was just saying that this is not what the "average joe" knows as virtual memory, if you tell them it's virtual memory they will think it uses a swap file. (see?)

Anyway, it's still brilliant, but I don't think this would work well on other emus where the author of the port doesn't have as much control over the actual emu. The code seems to be too close to the actual emulator, and when the emulator you ported gets updated you could get a lot of extra work, it's better to keep it more general, especially for huge projects such as MAME, a more traditional virtual memory system outside the actual emulator would work better in that case.

mr jones: You DO get page faults, but in this case the system is fast enough for you not to notice it, and the amount of data isn't huge either. It's not like swaping in 100 MB in Windows while you are copying a file...

digitalman42: Don't worry, there's no swap file.
Logged

Iriez

  • Administrator
  • Hero Member
  • *****
  • Posts: 1238
Kawa-x ...virtual Memory?
« Reply #176 on: July 29, 2003, 11:30:00 AM »

QUOTE (mr jones @ Jul 29 2003, 11:03 AM)
But I do want to know this: How is it that Mhz's memory manager knows what pages are accessed the least to be able to be swapped?

By counting how many times a page is hit. The less times a page is hit, the more likely it will be dropped for a page that needs to be loaded into ram.

No, its not going to leave a big swap file permantly on your xbox. Im sure it uses the x/y/z drives to cache the temporary dumped roms(no it doesnt read it directly from the zip)
Logged

erexx

  • Archived User
  • Hero Member
  • *
  • Posts: 504
Kawa-x ...virtual Memory?
« Reply #177 on: July 29, 2003, 11:44:00 AM »

The emu does create 256 individual page files on the Z partition when emulating MetalSlug3.
(page.000~page.255) thats 256KB files x 256 for a total of 64MB page file space.

How ever you want to define it.
I could care less.
Logged

erexx

  • Archived User
  • Hero Member
  • *
  • Posts: 504
Kawa-x ...virtual Memory?
« Reply #178 on: July 29, 2003, 11:47:00 AM »

Damn Donan Fear and I thought I was the -smarty- to think of testing it that way.
I deleted them then restarted the emu just to test the recreation of the files and time.

fuck it, so there you go...




Logged

SHiZNO

  • Archived User
  • Sr. Member
  • *
  • Posts: 287
Kawa-x ...virtual Memory?
« Reply #179 on: July 30, 2003, 12:07:00 PM »

hybernation
Logged
Pages: 1 ... 10 11 [12] 13