Register | Login
Views: 19364387
Main | Memberlist | Active users | ACS | Commons | Calendar | Online users
Ranks | FAQ | Color Chart | Photo album | IRC Chat
11-02-05 12:59 PM
1 user currently in Super Mario World hacking: labmaster | 3 guests
Acmlm's Board - I2 Archive - Super Mario World hacking - Question about a program for ASM | |
Pages: 1 2Add to favorites | "RSS" Feed | Next newer thread | Next older thread
User Post
jman2050

Red Koopa
Level: 19

Posts: 59/123
EXP: 33172
For next: 2605

Since: 03-21-04

Since last post: 10 days
Last activity: 103 days
Posted on 01-29-05 11:40 PM Link | Quote
there is absolutely nothing about the behavior of SRAM that would differentiate it from any other sort of RAM. It can be read from and written to non-sequentially. It relies on an electrical chare to maintain the states of its bits. The ONLY difference between the two is that SRAM receives it's power source from the battery. The battery is not RAM, it is a power source, no different from the power the console/PC gets from the outlet on the wall. Thinking otherwise means you misunderstand the very concept of the terms.

DahrkDaiz

Red Super Koopa

Acmlm's Mosts 2005
Best ROM Hacker

Level: 45

Posts: 486/885
EXP: 643520
For next: 16644

Since: 03-15-04
From: K-Town

Since last post: 4 hours
Last activity: 4 hours
Posted on 01-29-05 11:45 PM Link | Quote
I must back up Parasyte on this. RAM is memory that's powered by electricity and when the the electricity is cut off, the contents of the RAM will go away. SRAM isn't a special file that's written.

SRAM is the normal ole RAM that's placed onto the cart, it's written and read into as normal, except there's a battery that has a charge to supply electricity to the RAM so when the console is turned, off, the battery will still flow electricity into it and the RAM doesn't die, effectively saving it.

This is why when you lose a save on a game cart, it's usually said that the "battery died". Which means the battery no longer holds a charge to power the RAM on the cart. So you can still save a game and the game will remain as long as the system isn't cut off, because electricity is being supplied to it constantly. Once you turn the console off or pull the cart out, the RAM inside the cart loses it's contents and you lose your saves. Thus, once the battey on a cart that keeps SRAM alive dies, that SRAM because normal ole RAM.
FuSoYa
Defender of Relm
Level: 26

Posts: 142/255
EXP: 99529
For next: 2746

Since: 03-15-04
From: Moon

Since last post: 7 days
Last activity: 7 hours
Posted on 01-30-05 02:52 AM Link | Quote
Originally posted by DahrkDaiz
SRAM isn't a special file that's written.


Except when you're dealing with an emulator, where the SRAM (or rather, the regular RAM your emulator temporarily set aside to serve for what would be battery-backed SRAM on the SNES) data is copied to a file on your hard drive so you'll still have it when you shut the emulator down. And just as a ROM image on you hard drive is not literally ROM, an SRAM file on your hard drive is not literally SRAM. But we call them that anyway, because people are lazy and it's generally understood what those files are for.

Just thought I'd cover all the bases.


I hope you don't feel picked on Atma... but when you say something like "Save files that get produced are ROM (AKA a File stored into your Hard Drive)", it's kind of hard to ignore.
Alastor the Stylish
Hey! I made a cool game! It's called "I poisoned half the food, so if you eat you might die!" Have a taco.


Level: 114

Posts: 4842/7620
EXP: 16258468
For next: 51099

Since: 03-15-04
From: Oregon, US

Since last post: 2 hours
Last activity: 2 hours
Posted on 01-30-05 03:01 AM Link | Quote
I was gonna yell at him for saying firmware is another name for hardware, but he edited it out =/
Atma X

Bandit
Level: 43

Posts: 707/801
EXP: 553639
For next: 11407

Since: 03-16-04
From: Derrière vous!!!

Since last post: 43 days
Last activity: 14 days
Posted on 01-30-05 03:06 AM Link | Quote
Exactly, FuSoYa knows what I'm talking about with the diff between SRAM and Save Files.

DahrkDaiz: Thanks for the explination with the Consoles Battery and SRAM.
(but I was still referring to the way SRAM works with Games run on Emulators)


Quoting FuSoYa,..... and myself
"Save files that get produced are ROM (AKA a File stored into your Hard Drive)"

Opps, I did screw up on that.
---so what's the name for Readable and Writable Memeory (R/W Mem that is not RAM),... like a Hard Drive for instance.

(Ok everyone, I confused ROM with the kind of Mem a Hard Drive etc. is).


Quoting Kyouji
I was gonna yell at him for saying firmware is another name for hardware, but he edited it out =/

Yea, I was writing too fast, and took another look at it to see that I had made a mistake.

Quoting Parasyte
Further, I never said that 'running' is an improper term. I said that 'perform' is an improper term. I also said that 'interpret' and 'handle' are improper terms. The correct terms are execute, run, etc.

Execute, Run, and Perform all mean the same thing (because one of the definitions of Execute is Perform, and if Run means Execute as you say, then all 3 are alike).


Quoting Parasyte
Almost all instructions are executed from ROM.

Um, that's partially wrong, because the Game isn't ROM, and so ROM isn't the main thing that Instructions are executed from (at least not in most cases).

*Good to see that all cleared up.*


(edited by Atma X on 01-29-05 11:07 PM)
(edited by Atma X on 01-29-05 11:07 PM)
(edited by Atma X on 01-29-05 11:13 PM)
(edited by Atma X on 01-29-05 11:16 PM)
(edited by Atma X on 01-29-05 11:18 PM)
(edited by Atma X on 01-29-05 11:24 PM)
(edited by Atma X on 01-29-05 11:25 PM)
(edited by Atma X on 01-29-05 11:26 PM)
(edited by Atma X on 01-29-05 11:27 PM)
(edited by Atma X on 01-29-05 11:27 PM)
(edited by Atma X on 01-29-05 11:36 PM)
(edited by Atma X on 01-29-05 11:36 PM)
(edited by Atma X on 01-29-05 11:38 PM)
(edited by Atma X on 01-29-05 11:38 PM)
(edited by Atma X on 01-29-05 11:39 PM)
(edited by Atma X on 01-29-05 11:39 PM)
(edited by Atma X on 01-29-05 11:41 PM)
(edited by Atma X on 01-29-05 11:43 PM)
(edited by Atma X on 01-29-05 11:44 PM)
(edited by Atma X on 01-29-05 11:46 PM)
(edited by Atma X on 01-29-05 11:47 PM)
(edited by Atma X on 01-29-05 11:48 PM)
(edited by Atma X on 01-29-05 11:49 PM)
Parasyte

Bullet Bill
Level: 35

Posts: 249/514
EXP: 267348
For next: 12588

Since: 05-25-04

Since last post: 104 days
Last activity: 32 days
Posted on 01-30-05 06:31 AM Link | Quote
*sigh* Let's try this again.
Say you're playing good ol' Super Mario World on your SNES. Now hit your SNES with a nice, big hammer, or cut it open with some really nice laser or something. Now borrow a powerful microscope, and a logic analyzer. Now that you have the tools and means to verify that SNES runs code directly from ROM, do so.

You have your head in the clouds thinking that an emulator is in it's own little world, seperated from the real world, where SNES hardware once existed (and still does, to this day). The rules of SNES hacking are quite literally governed by the SNES hardware. That being the case, I'd appreciate it if you would stop confusing matters by looking at an emulator as anything but a virtual hardware system.
No, an emulator is not really running code from "ROM" but as far as the emulator and game are concerned, it is ROM.


(edited by Parasyte on 01-30-05 02:32 AM)
HyperLamer
<||bass> and this was the soloution i thought of that was guarinteed to piss off the greatest amount of people

Sesshomaru
Tamaranian

Level: 118

Posts: 3082/8210
EXP: 18171887
For next: 211027

Since: 03-15-04
From: Canada, w00t!
LOL FAD

Since last post: 2 hours
Last activity: 2 hours
Posted on 01-30-05 08:09 AM Link | Quote
You guys just seem to be getting confused by storage mediums. First off, SRAM and RAM are identical. If you cut the power, their contents are lost. The difference is that SRAM is generally connected to a battery, so when you cut the power to the cartridge, the chip is still powered. For all intents and purposes, SRAM = RAM with a battery.

Now, as far as the whole hard drive/ROM issue goes... Technically a hard drive is not ROM (because it's rewriteable) or RAM (because it works differently). But, when you run the game, the ROM file and SRAM file get copied into the computer's memory. In a way, you could say that it's all RAM, because that's what it's stored in, but you still wouldn't be entirely correct.

The easiest way to understand this is exactly what each one of them is in an emulator. Part of the memory is set aside for the game's RAM. When you close the emulator (equivilant to turning the power off), this memory gets cleared, so it can be considered RAM. Another part of memory is reserved for the game's program code (the parts that are stored on a ROM chip in a real cartridge). Technically this is RAM, but with one major exception: The emulator will not let the game modify it. As far as the game is concerned this memory area is read-only - thus, ROM. And finally, some memory is reserved for SRAM. It's the same as RAM, but its contents aren't lost when the program is closed.

Simple enough? The part called ROM is read-only, and the part called SRAM starts with the same values it had last time, just like real ROM and SRAM chips, even though it's all being stored in a RAM chip.
Atma X

Bandit
Level: 43

Posts: 708/801
EXP: 553639
For next: 11407

Since: 03-16-04
From: Derrière vous!!!

Since last post: 43 days
Last activity: 14 days
Posted on 01-31-05 06:07 AM Link | Quote
Originally posted by Parasyte
Now that you have the tools and means to verify that SNES runs code directly from ROM, do so.


Um dude, nothing runs directly from ROM.
The Information is copied from ROM to RAM, and then run from RAM (It makes an EXACT COPY of the program/game to RAM, so it can be run from RAM, because it cannot be run from ROM at all, for any reason) Easy concept to understand? I hope so, because it is.

I think you need to get your head out of the clouds.

Btw, how do you program anything correctly when you don't even know that the Information needs to be copied from ROM to RAM in order to be run?


(edited by Atma X on 01-31-05 02:07 AM)
(edited by Atma X on 01-31-05 02:08 AM)
(edited by Atma X on 01-31-05 02:16 AM)
Parasyte

Bullet Bill
Level: 35

Posts: 254/514
EXP: 267348
For next: 12588

Since: 05-25-04

Since last post: 104 days
Last activity: 32 days
Posted on 01-31-05 07:02 AM Link | Quote
Originally posted by Atma X

Um dude, nothing runs directly from ROM.
The Information is copied from ROM to RAM, and then run from RAM (It makes an EXACT COPY of the program/game to RAM, so it can be run from RAM, because it cannot be run from ROM at all, for any reason) Easy concept to understand? I hope so, because it is.

I think you need to get your head out of the clouds.

Btw, how do you program anything correctly when you don't even know that the Information needs to be copied from ROM to RAM in order to be run?


I tend to "program correctly" because I understand the machine I write programs for. In the case of x86-based machines, I am well aware of the fact that all code and data is available only in RAM during the life of the program. But that is not what we are discussing.
On SNES it is a fact that the ROM addresses accessed by the 65c816 are indeed ROM. The SNES begins running code from the reset vector which points to a ROM address. The 65c816 executes the code at the reset vector directly. That means it puts instruction data on the bus by initiating a read directly from ROM. The data sits on the bus and enters the cpu circuitry, where it is then decoded. Finally, the decoded instruction is "executed" via plenty more circuitry, where data is either input or output to the bus (or not at all) depending on the instruction. The 65c816 is a very simple CISC CPU with no means of instruction caching. Without an instruction cache, it does not copy the instruction data anywhere. If the instruction data is in ROM, it is run directly from ROM. If it is in RAM, it is run directly from RAM.

SNES has a very limited amount of RAM. You seem to be thinking something along the lines of, "Anything in SNES address space must be RAM." Well, you're wrong. SNES address space is mapped to hardware in a nasty array. In banks $00 - $3F, you have RAM at :0000 - :1FFF, some hardware I/O registers at :2000 - :5FFF, ROM at :8000 - :FFFF. SRAM at $70:0000 - $70:7FFF. And more RAM (albeit mapped in a stange manner) at $7E:0000 - $7F:FFFF. Obviously, not all of SNES address space is RAM. Namely the ROM banks at $00:8000, $01:8000, $02:8000, and etc. That is actual ROM, believe it or not. Any time a game executes code at $00:8000 (which is usually the reset vector for LoROM) the CPU is accessing the ROM chip on the cart directly. There is no copying going on. Therefore, it is said to be running directly in ROM. If you want to verify this, feel free to pull your cart out while the game is running. If the code were running in RAM, the game would not crash. A game like Super Mario World will just crash. N64, on the other hand (a console which actually does copy data into RAM before using it) will happily run without a cart until it tries to get more data from the cart. (Keep in mind that to do this on N64, you must hold reset before pulling the cart out. This will keep the hardware from checking for the cart. If it doesn't check for the cart, it won't know it's been taken out. Therefore it will not trigger an exception, which would "crash" the game.)

So yeah, that's how I can "program correctly". I do understand what is going on, deep down inside that hardware. But I hope you're learning something from all of this. You seem to be making assumptions, rather than doing any kind of research. And that is helping no one.
jman2050

Red Koopa
Level: 19

Posts: 60/123
EXP: 33172
For next: 2605

Since: 03-21-04

Since last post: 10 days
Last activity: 103 days
Posted on 01-31-05 07:14 AM Link | Quote
Some n00b is telling Parasyte of all people he can't program correctly? Ha ha ha, that's a good one... seriously, it's one thing to be clueless, misguided, and ignorant, but it is quite another to be just plain stupid. And that's exactly what you are, not knowing anything about the hardware you are trying to explain. And don't give this crap about "oh, but zsnes copies he rom into ram before running. So you're wrong, lol" because no one here gives two craps about the actual behavior of an emulator, since it is merely mimicing an existing system.

In short, your wrong, Parasyte is right, and we can all be happy, let this argument pass, and get back to helping the topic creator write ASM code. 'kay?
Pages: 1 2Add to favorites | "RSS" Feed | Next newer thread | Next older thread
Acmlm's Board - I2 Archive - Super Mario World hacking - Question about a program for ASM | |


ABII


AcmlmBoard vl.ol (11-01-05)
© 2000-2005 Acmlm, Emuz, et al



Page rendered in 0.027 seconds.