(Link to AcmlmWiki) Offline: thank ||bass
Register | Login
Views: 13,040,846
Main | Memberlist | Active users | Calendar | Chat | Online users
Ranks | FAQ | ACS | Stats | Color Chart | Search | Photo album
05-08-24 07:07 AM
0 users currently in ROM Hacking.
Acmlm's Board - I3 Archive - ROM Hacking - An idea for ROM hacking New poll | |
Pages: 1 2Add to favorites | Next newer thread | Next older thread
User Post
HyperHacker

Star Mario
Finally being paid to code in VB! If only I still enjoyed that. <_<
Wii #7182 6487 4198 1828


 





Since: 11-18-05
From: Canada, w00t!
My computer's specs, if anyone gives a damn.
STOP TRUNCATING THIS >8^(

Last post: 6289 days
Last view: 6289 days
Posted on 05-01-06 01:50 AM Link | Quote
That's just the port I was thinking of when I wrote that. No idea how to use it though.
MathOnNapkins

1100

In SPC700 HELL


 





Since: 11-18-05

Last post: 6288 days
Last view: 6288 days
Posted on 05-01-06 02:34 AM Link | Quote
Assuming you have a device with the proper type of connection (no fricken clue where you would find a connector like that or a device that's compatible with it), you can read and write to that port using special registers. The official snes documentation mentions being able to use a keyboard or other peripheral as some ideas. I heard Xband came with a keyboard but I've never seen what the Xband setup looked like.
HyperHacker

Star Mario
Finally being paid to code in VB! If only I still enjoyed that. <_<
Wii #7182 6487 4198 1828


 





Since: 11-18-05
From: Canada, w00t!
My computer's specs, if anyone gives a damn.
STOP TRUNCATING THIS >8^(

Last post: 6289 days
Last view: 6289 days
Posted on 05-01-06 03:58 AM Link | Quote
Yeah, I imagine I'd be making my own connector, or soldering it directly into a spare SNES (if they were reasonably priced).

[edit] BTW, I thought of another case where it's OK to use emulator-specific add-ons: When it doesn't make sense to use the ROM on anything else. For example, an emulator which uses a specially-named or built-in ROM as its interface. Obviously it'd make little sense to run something like that on a real console or another emulator.


(edited by HyperMackerel on 05-02-06 01:25 AM)
Glyphodon



 





Since: 11-18-05

Last post: 6329 days
Last view: 6310 days
Posted on 05-03-06 06:17 PM Link | Quote
I rather disagree with all your exceptions, HH.

The first group seems to encompass extra hardware features. My beef isn't just with roms becoming unusable on their original system, but with other emulators. Compatiblity over platforms and emulators = win. But since emulation entails emulating features made by fans as well, I guess this might count. Though building new features for an ancient system is impractical to the highest degree, it'd still be cool.

The second feature group, debugging, is largely unrelated to the issue. The problem is adding things to ROMs that cause incompatiblities and can't be run on the original system. Debugging tools aren't ROM features, they're emulator features. Emulators should be able to do whatever the hell they want; extra graphical effects, fancy quality sound, what-have-you as long as the ROMs pretty much stay the same. It's when the ROMs start changing to support the emulators when things get really messy.

Your third group, system-specific interface tools and such, doesn't make much sense. It would be a lot harder to make a rom that the system uses as a plugin or interface than to actually write an interface or plugin system and build it directly into the emulator.
Disch

Red Cheep-cheep


 





Since: 12-10-05

Last post: 6568 days
Last view: 6568 days
Posted on 05-03-06 07:35 PM Link | Quote
Originally posted by Glyph Phoenix
Emulators should be able to do whatever the hell they want; extra graphical effects, fancy quality sound, what-have-you as long as the ROMs pretty much stay the same. It's when the ROMs start changing to support the emulators when things get really messy.


The way I see it... emulator additions should involve (optionally) improving what's already there. This is often seen in the form of graphic filters (2xSai, HQ2x, et al), audio filters, built in turbo-buttons, fastforward, programmable key sequences, movies, savestates, etc. While all these things slightly improve the way the game looks/sounds and even plays, they do not really change the games at all. Nor are they geared for any specific game.

When things start going astray is when emulators start replacing in-game data with external media. Such as replacing in-game music with external .ogg or .mp3 files. subbing in .pngs for graphics, that kind of thing. Or replacing system functions with "enhanced" system capabilities (adding additional registers for the games to do extra stuff that they couldn't on the real console, that kind of thing).

A grey area that sort of falls between these two examples is the .pal file usage by NES emulators. While it's a good idea for NES emus to support them (since it does provide a practical function), it can easily be abused by sloppy ROM hackers who want a "souped up" palette.


So to make a long story short: Addition is good. Replacement is bad.
HyperHacker

Star Mario
Finally being paid to code in VB! If only I still enjoyed that. <_<
Wii #7182 6487 4198 1828


 





Since: 11-18-05
From: Canada, w00t!
My computer's specs, if anyone gives a damn.
STOP TRUNCATING THIS >8^(

Last post: 6289 days
Last view: 6289 days
Posted on 05-03-06 10:56 PM Link | Quote
Originally posted by Glyph Phoenix
The first group seems to encompass extra hardware features. My beef isn't just with roms becoming unusable on their original system, but with other emulators. Compatiblity over platforms and emulators = win. But since emulation entails emulating features made by fans as well, I guess this might count. Though building new features for an ancient system is impractical to the highest degree, it'd still be cool.

Good point there. You'd have to add the new features to at least the most popular emulators for each platform.


The second feature group, debugging, is largely unrelated to the issue. The problem is adding things to ROMs that cause incompatiblities and can't be run on the original system. Debugging tools aren't ROM features, they're emulator features. Emulators should be able to do whatever the hell they want; extra graphical effects, fancy quality sound, what-have-you as long as the ROMs pretty much stay the same. It's when the ROMs start changing to support the emulators when things get really messy.

I mean like adding features that the ROM can use, but only using them for debugging. Extra RAM or a second display screen would be a good example of this.


Your third group, system-specific interface tools and such, doesn't make much sense. It would be a lot harder to make a rom that the system uses as a plugin or interface than to actually write an interface or plugin system and build it directly into the emulator.

Eh, I think it'd be fairly easy and kinda cool to do. Making an interface in Windows can be a huge pain. If you have a ROM doing it, not only is it easier (I'd assume if you can write an emulator for a given console, you can write ROMs for it too), but you get the added bonus that you can work the interface using a joypad.
Glyphodon



 





Since: 11-18-05

Last post: 6329 days
Last view: 6310 days
Posted on 05-04-06 09:52 AM Link | Quote
Originally posted by HyperHacker
I mean like adding features that the ROM can use, but only using them for debugging. Extra RAM or a second display screen would be a good example of this.

If you're trying to get rid of bugs, your ROM probably shouldn't have extra RAM or a second display screen handy when you're debugging but not when it's playing, especially if you wanted people to help debug without having to use your special emulator.

Originally posted by HyperHacker
Eh, I think it'd be fairly easy and kinda cool to do. Making an interface in Windows can be a huge pain. If you have a ROM doing it, not only is it easier (I'd assume if you can write an emulator for a given console, you can write ROMs for it too), but you get the added bonus that you can work the interface using a joypad.

Please tell me you're joking.

That would be more work. Your points about joysticks and such don't hold any weight-- the emulator already has joystick access if it's emulating with one, obviously. It has better joystick access, in fact, because it can know things like whether extra buttons are pressed and the exact joystick position instead of left, right, up, down, A, B, X, Y, et cetera. Even if you wanted to create a SNES style interface, it would be a bad idea to store it in a ROM because you'd be limited in what you can do and what you can do in the future without scrapping the old system.

It would also be a security risk. Every time I download a hard-to-find rom from some shitty site I am thankful there's no chance a corrupted rom can possibly do more than cause a crash. If my emulator is good enough, it shouldn't even be able to crash. Not so if it were possible to corrupt my interface via a ROM.
HyperHacker

Star Mario
Finally being paid to code in VB! If only I still enjoyed that. <_<
Wii #7182 6487 4198 1828


 





Since: 11-18-05
From: Canada, w00t!
My computer's specs, if anyone gives a damn.
STOP TRUNCATING THIS >8^(

Last post: 6289 days
Last view: 6289 days
Posted on 05-05-06 12:15 AM Link | Quote
Originally posted by Glyph Phoenix
That would be more work.

Have you ever made an interface in Windows? I could write a Game Boy ROM to do the job of a standard Windows interface for an emulator in about half the time it'd take to actually make a Windows interface.


Your points about joysticks and such don't hold any weight-- the emulator already has joystick access if it's emulating with one, obviously.

But if you want to be able to navigate a standard Windows interface with it... better start brewing some coffee.


It has better joystick access, in fact, because it can know things like whether extra buttons are pressed and the exact joystick position instead of left, right, up, down, A, B, X, Y, et cetera.

Which is why in this special mode the ROM would be able to query the exact joystick state, keyboard, etc.


Even if you wanted to create a SNES style interface, it would be a bad idea to store it in a ROM because you'd be limited in what you can do and what you can do in the future without scrapping the old system.

Not if you do it right.


It would also be a security risk. Every time I download a hard-to-find rom from some shitty site I am thankful there's no chance a corrupted rom can possibly do more than cause a crash. If my emulator is good enough, it shouldn't even be able to crash. Not so if it were possible to corrupt my interface via a ROM.

Which is why you only grant this privilege to a ROM with a specific filename that's included with the emulator, or one built into the emulator itself. There's not even any reason to give it the ability to do anything more than change settings in the emulator, read ROMs and poll the joystick and keyboard.
Glyphodon



 





Since: 11-18-05

Last post: 6329 days
Last view: 6310 days
Posted on 05-05-06 06:41 AM Link | Quote
If you have written an emulator with joystick and screen support, the emulator will have joystick and screen support. Are you still with me?

You seem to think that it is wrong to simply take those features and write functions in whatever language the emulator is written in to create an interface. Instead, you seem to believe it is better to create an entirely new ROM and coding complex systems to communicate from ROM to emulator. That is where you seem to have gotten lost.

You would think I needn't mention that a built-in interface could directly access the mouse, keyboard, and other features without coding an in-between. Apparently I do, because you still don't understand why a ROM interface isn't a good idea.

Also, not once did I mention the Windows interface. In fact, I specifically mentioned that even for system-style interfaces there are significant advantages to building it into the emulator or using a plugin or skin rather than a ROM.

Do I have to go over it again or do you understand now?
HyperHacker

Star Mario
Finally being paid to code in VB! If only I still enjoyed that. <_<
Wii #7182 6487 4198 1828


 





Since: 11-18-05
From: Canada, w00t!
My computer's specs, if anyone gives a damn.
STOP TRUNCATING THIS >8^(

Last post: 6289 days
Last view: 6289 days
Posted on 05-06-06 01:14 AM Link | Quote
Apparently you do, because I'm still missing the part where you make sense.
Originally posted by Glyph Phoenix
If you have written an emulator with joystick and screen support, the emulator will have joystick and screen support. Are you still with me?

No, I can code an emulator and a ROM to go with it but I can't possibly comprehend how this could be. Acting like an ass hardly helps your case.


You seem to think that it is wrong to simply take those features and write functions in whatever language the emulator is written in to create an interface. Instead, you seem to believe it is better to create an entirely new ROM and coding complex systems to communicate from ROM to emulator. That is where you seem to have gotten lost.

Seems you're the who's lost here. I didn't say it was wrong to build an interface into the emulator or that it's better to have a ROM do it. I only said it would be easier and you'd be able to navigate the interface with a joystick.


You would think I needn't mention that a built-in interface could directly access the mouse, keyboard, and other features without coding an in-between.

No shit? You act like it's difficult to write:
if(ROMFlags & RF_INTERFACE) IO[2] = (GetKeyState(IO[1]) & 0x8000) ? 1 : 0;
It actually takes more work to have a built-in interface respond to the joystick than a ROM-based one, since you'd have to poll it a second time outside of the emulation loop.


Also, not once did I mention the Windows interface.

When you talk about making an interface for a Windows program, it's generally assumed you'd use a Windows interface.


In fact, I specifically mentioned that even for system-style interfaces there are significant advantages to building it into the emulator or using a plugin or skin rather than a ROM.

Which I responded to in the previous post.

Are we done, or did you want to continue arguing that things I haven't said are wrong?
Glyphodon



 





Since: 11-18-05

Last post: 6329 days
Last view: 6310 days
Posted on 05-06-06 03:18 AM Link | Quote
Originally posted by HyperHacker
Acting like an ass hardly helps your case.

Considering all the rational points you haven't made, I'll take my chances.

Originally posted by HyperHacker
I only said it would be easier and you'd be able to navigate the interface with a joystick.

Which doesn't make any sense. I said it wouldn't be easier and you can navigate the interface with a joystick easily without using a ROM.

Originally posted by HyperHacker
You act like it's difficult to write:
if(ROMFlags & RF_INTERFACE) IO[2] = (GetKeyState(IO[1]) & 0x8000) ? 1 : 0;
It actually takes more work to have a built-in interface respond to the joystick than a ROM-based one, since you'd have to poll it a second time outside of the emulation loop.

Is it so difficult to set a simple variable within the poll if the interface is active? Also, if you wanted to use the ROM interface while a game is running, you'd have to add support for loading two ROMs at once. Whether programming support for this would be easy or trival is hard to tell at this point, however.


When you talk about making an interface for a Windows program, it's generally assumed you'd use a Windows interface.

Good job. Now find the post where I mentioned making an interface for a Windows program.

Originally posted by HyperHacker
Which I responded to in the previous post.

Ah, yes, "Not if you do it right". How thoughtful and informative that sentence was! Care to elaborate?

Originally posted by HyperHacker
Are we done, or did you want to continue arguing that things I haven't said are wrong?

I'll stick with the things that you have said, thank you.
HyperHacker

Star Mario
Finally being paid to code in VB! If only I still enjoyed that. <_<
Wii #7182 6487 4198 1828


 





Since: 11-18-05
From: Canada, w00t!
My computer's specs, if anyone gives a damn.
STOP TRUNCATING THIS >8^(

Last post: 6289 days
Last view: 6289 days
Posted on 05-06-06 07:20 AM Link | Quote
Originally posted by Glyph Phoenix
Originally posted by HyperHacker
I only said it would be easier and you'd be able to navigate the interface with a joystick.

Which doesn't make any sense. I said it wouldn't be easier and you can navigate the interface with a joystick easily without using a ROM.

Well I just plain disagree there. Making a Windows interface is a HUGE pain and I feel I could make a Game Boy ROM to do the job far easier. Navigating a Windows interface with a joystick is quite difficult to implement. As far as making your own non-standard interface, this might be easier than a Windows interface but I still feel it'd be more difficult than a ROM-based one.


Originally posted by HyperHacker
You act like it's difficult to write:
if(ROMFlags & RF_INTERFACE) IO[2] = (GetKeyState(IO[1]) & 0x8000) ? 1 : 0;
It actually takes more work to have a built-in interface respond to the joystick than a ROM-based one, since you'd have to poll it a second time outside of the emulation loop.

Is it so difficult to set a simple variable within the poll if the interface is active?

The emulation loop would have to be running for this to work. It can't very well be running if you're still in the interface choosing which ROM to load.


Also, if you wanted to use the ROM interface while a game is running, you'd have to add support for loading two ROMs at once.

Ideally you'd do this for a simple emulator that doesn't need to display an interface while the game is running. Either way it wouldn't be particuarly difficult to run multiple ROMs at once if you design it with this capability to begin with; nearly every Game Boy emulator already has to do this for link support.



When you talk about making an interface for a Windows program, it's generally assumed you'd use a Windows interface.

Good job. Now find the post where I mentioned making an interface for a Windows program.

You didn't; I figured since there are far more emulators for and users of Windows than any other platform, and since AFAIK neither of us code for any other platform, it'd be implied. The fact that you didn't bring up the idea of a non-Windows emulator until now further backs up this implication.


Originally posted by HyperHacker
Which I responded to in the previous post.

Ah, yes, "Not if you do it right". How thoughtful and informative that sentence was! Care to elaborate?

Well that was only one response to one small portion of your post, but what the heck. You'd have to design the entire system quite poorly for it to impose any severe limitations. ROM too big? Allow bigger ROMs. Out of memory? Add more. Already used up all the I/O ports that aren't used by the system itself? Then you did it wrong; a good system would only need around 6-10 of them depending how much joystick information you supply to the ROM. (And if not even that many are available to begin with, use a specific RAM address instead.)
This entire thread is about adding features to emulators that exceed the capabilities and limitations of the system they're emulating. To use these limitations in your argument just doesn't make sense.

Honestly, don't you have anything better to do than to analyze every post you see looking for even the smallest, most insignificant flaw? If you must do this you could at least practice it some more. If you're absolutely certain that the ideas of a ROM-based interface and running multiple ROMs at once are absurd, feel free to donate me a GBC flash cart so I can finish my emulator and prove you wrong.
Glyphodon



 





Since: 11-18-05

Last post: 6329 days
Last view: 6310 days
Posted on 05-06-06 03:03 PM Link | Quote
Originally posted by HyperHacker
Well I just plain disagree there. Making a Windows interface is a HUGE pain and I feel I could make a Game Boy ROM to do the job far easier. Navigating a Windows interface with a joystick is quite difficult to implement. As far as making your own non-standard interface, this might be easier than a Windows interface but I still feel it'd be more difficult than a ROM-based one.

How would making your own interface using limited tools and limited graphic formats in a ROM--which you would specifically have to build support for--be easier than simply putting an interface directly into the emulator?


The emulation loop would have to be running for this to work. It can't very well be running if you're still in the interface choosing which ROM to load.

You wouldn't have to put joystick support in an emulation-only loop. A system organized like so doesn't seem like a good idea at all, really. I'd consider a separate code section for input that tosses values to code that tells the game what buttons are pressed to be a more elegant solution.


Ideally you'd do this for a simple emulator that doesn't need to display an interface while the game is running. Either way it wouldn't be particuarly difficult to run multiple ROMs at once if you design it with this capability to begin with; nearly every Game Boy emulator already has to do this for link support.

Fair enough.


You didn't; I figured since there are far more emulators for and users of Windows than any other platform, and since AFAIK neither of us code for any other platform, it'd be implied. The fact that you didn't bring up the idea of a non-Windows emulator until now further backs up this implication.

Just stop assuming Windows altogether. Whatever you're programming in, anyway, it should be easier to put in a couple of code pieces in already existant screendrawing functions to make an interface than to write an entirely new ROM and supporting functions for it.


You'd have to design the entire system quite poorly for it to impose any severe limitations.

That's not true. It's a matter of the ROM not being designed for interfaces and requiring heavy modifications to the emulator in order to interpret it as such. If you ever wanted improved resolution, additional colors (or colors at all), any integration with any sort of application, or basically any features common to operating systems today but not to ROMs you'd have to do some serious rehauling or, more likely, give it up and go for a more traditional interface.


This entire thread is about adding features to emulators that exceed the capabilities and limitations of the system they're emulating. To use these limitations in your argument just doesn't make sense.

The more ROM systems that are overwritten, the more work involved and the more bugs to catch. It's just not rational to override regular emulation so a single limited, emulated ROM image can serve as an interface when much better options are present.


Honestly, don't you have anything better to do than to analyze every post you see looking for even the smallest, most insignificant flaw?

How are those hypocritical ad hominem attacks working out for you? I am having a fine time sticking to the issue. Thank you for asking.
HyperHacker

Star Mario
Finally being paid to code in VB! If only I still enjoyed that. <_<
Wii #7182 6487 4198 1828


 





Since: 11-18-05
From: Canada, w00t!
My computer's specs, if anyone gives a damn.
STOP TRUNCATING THIS >8^(

Last post: 6289 days
Last view: 6289 days
Posted on 05-06-06 09:28 PM Link | Quote
Originally posted by Glyph Phoenix
Originally posted by HyperHacker
Well I just plain disagree there. Making a Windows interface is a HUGE pain and I feel I could make a Game Boy ROM to do the job far easier. Navigating a Windows interface with a joystick is quite difficult to implement. As far as making your own non-standard interface, this might be easier than a Windows interface but I still feel it'd be more difficult than a ROM-based one.

How would making your own interface using limited tools and limited graphic formats in a ROM--which you would specifically have to build support for--be easier than simply putting an interface directly into the emulator?

I don't see your point here. Limited tools? A tile editor, a text editor and an assembler are all the tools I need to make a Game Boy ROM. Limited graphic formats? Sure if you wanted super-high-resolution graphics, but the idea of a ROM-based interface is to use the same resolution, colours etc that games use, to make it feel like it's built right into the game.



The emulation loop would have to be running for this to work. It can't very well be running if you're still in the interface choosing which ROM to load.

You wouldn't have to put joystick support in an emulation-only loop. A system organized like so doesn't seem like a good idea at all, really. I'd consider a separate code section for input that tosses values to code that tells the game what buttons are pressed to be a more elegant solution.

What, like a separate loop? That would just consume more CPU power and make it harder to keep everything synchronized. Especially if, for example, you want to support the console's real controllers plugged into a parallel port (even moreso on systems like N64 where you have accessories connected to the controller), synchronization is important for accurate emulation.



You didn't; I figured since there are far more emulators for and users of Windows than any other platform, and since AFAIK neither of us code for any other platform, it'd be implied. The fact that you didn't bring up the idea of a non-Windows emulator until now further backs up this implication.

Just stop assuming Windows altogether. Whatever you're programming in, anyway, it should be easier to put in a couple of code pieces in already existant screendrawing functions to make an interface than to write an entirely new ROM and supporting functions for it.

If you want to use the existing screen-drawing functions, then you'd again need to have the emulation loop running. You then have the choice of drawing on a separate buffer not used by the ROM at all, which uses up more memory, or writing your graphics directly into emulated VRAM in which case it's already halfway to being ROM-based.



You'd have to design the entire system quite poorly for it to impose any severe limitations.

That's not true. It's a matter of the ROM not being designed for interfaces

...Wha? The ROM that's designed solely to act as an interface, not being designed for an interface? I'm afraid I can't find any meaning to this sentence.


and requiring heavy modifications to the emulator in order to interpret it as such.

Adding this functionality would be trivial, as I've already mentioned a few times.


If you ever wanted improved resolution, additional colors (or colors at all), any integration with any sort of application, or basically any features common to operating systems today but not to ROMs

Then you shouldn't be using a ROM-based interface to begin with. Again, the point is to use the same resolution and colours as the original system.



This entire thread is about adding features to emulators that exceed the capabilities and limitations of the system they're emulating. To use these limitations in your argument just doesn't make sense.

The more ROM systems that are overwritten, the more work involved and the more bugs to catch. It's just not rational to override regular emulation so a single limited, emulated ROM image can serve as an interface when much better options are present.

If I can write one line of code to allow a ROM to do something, and 10-15 to allow a standard or built-in interface to do the same, it's pretty clear which is the better option. Compare:
if(ROMFlags & RF_INTERFACE) IO[2] = (GetKeyState(IO[1]) & 0x8000) ? 1 : 0;
versus
case WM_KEYDOWN:
if(ProgramMode == PM_INTERFACE)
{
if(wParam == VK_UP) InterfaceMenuPos[InterfaceMenu]--;
else if(wParam == VK_DOWN) InterfaceMenuPos[InterfaceMenu]++;
else if(wParam == VK_SPACE)
{
InterfaceMenu = InterfaceMenuTarget[InterfaceMenu][InterfaceMenuPos];
InterfaceMenuPos = 0;
}
if(InterfaceMenuPos >= InterfaceMenuMax) InterfaceMenuPos = 0;
else if(InterfaceMenuPos < 0) InterfaceMenuPos = InterfaceMenuMax - 1;
}
else
//Normal emulation-related keystroke handling here
break;

Not including the additional code you'd need for mouse movements, joystick input, actually drawing the menu, the menu definitions themselves, and special cases for the menu options that don't just lead to another menu.


(edited by HyperMackerel on 05-06-06 08:30 PM)
Glyphodon



 





Since: 11-18-05

Last post: 6329 days
Last view: 6310 days
Posted on 05-07-06 07:57 AM Link | Quote
Originally posted by HyperHacker
I don't see your point here. Limited tools? A tile editor, a text editor and an assembler are all the tools I need to make a Game Boy ROM. Limited graphic formats? Sure if you wanted super-high-resolution graphics, but the idea of a ROM-based interface is to use the same resolution, colours etc that games use, to make it feel like it's built right into the game.

It's not built into the game, though. It'd be for an emulator, which has a wide array of advantages--the higher resolution being only one of them--that would be tossed away in favor of an interface stuck to a ROM.


What, like a separate loop? That would just consume more CPU power and make it harder to keep everything synchronized. Especially if, for example, you want to support the console's real controllers plugged into a parallel port (even moreso on systems like N64 where you have accessories connected to the controller), synchronization is important for accurate emulation.

Separating the input read through the OS or whatever you use to gather input from the rest of the emulation loop is not only valid; it's smart when you might want to choose a different way to gather input down the line or code the emulator to run on different platforms.


If you want to use the existing screen-drawing functions, then you'd again need to have the emulation loop running. You then have the choice of drawing on a separate buffer not used by the ROM at all, which uses up more memory, or writing your graphics directly into emulated VRAM in which case it's already halfway to being ROM-based.

Again, separating the input and screen drawing functions from the direct emulation loop is going to help out in the long run anyway. Do you really think running and interpreting a second ROM will take up LESS memory than a simple buffer?


...Wha? The ROM that's designed solely to act as an interface, not being designed for an interface? I'm afraid I can't find any meaning to this sentence.

Most ROM formats weren't designed with interfaces in mind. The SNES, GBA, NES, and a great deal of other ROM formats were never designed to be used as interfaces. And while there are some ROMs designed to be used as BIOS (Neo Geo has a BIOS, I think), those were designed back when we didn't have speedup or manipulatable display or the things we have now and just aren't as valid today as they were then.

Speaking of speedup keys, can you imagine writing a ROM interface that accesses more keyboard input than a regular ROM? That'd be uncomfortable. And you'd have to do it in order to put a button mapping system in the ROM interface.


Originally posted by Glyph Phoenix
and requiring heavy modifications to the emulator in order to interpret it as such.

Adding this functionality would be trivial, as I've already mentioned a few times.

It wouldn't be, though. Manipulating a loop designed for emulation to add setting-changing support would involve sticking lots of code where it doesn't belong and just misusing the ROM in general.


Then you shouldn't be using a ROM-based interface to begin with.

Agreed.


Again, the point is to use the same resolution and colours as the original system.

More resolution can mean you can fit in more menus. Menus can get cramped in a GB even when you have much more space available. As for colors, I'd sure like to be able to see more of them if ever this ROM interface were to support changing the palette.


If I can write one line of code to allow a ROM to do something, and 10-15 to allow a standard or built-in interface to do the same, it's pretty clear which is the better option. Compare:
if(ROMFlags & RF_INTERFACE) IO[2] = (GetKeyState(IO[1]) & 0x8000) ? 1 : 0;
versus
case WM_KEYDOWN:
if(ProgramMode == PM_INTERFACE)
{
if(wParam == VK_UP) InterfaceMenuPos[InterfaceMenu]--;
else if(wParam == VK_DOWN) InterfaceMenuPos[InterfaceMenu]++;
else if(wParam == VK_SPACE)
{
InterfaceMenu = InterfaceMenuTarget[InterfaceMenu][InterfaceMenuPos];
InterfaceMenuPos = 0;
}
if(InterfaceMenuPos >= InterfaceMenuMax) InterfaceMenuPos = 0;
else if(InterfaceMenuPos < 0) InterfaceMenuPos = InterfaceMenuMax - 1;
}
else
//Normal emulation-related keystroke handling here
break;

Not including the additional code you'd need for mouse movements, joystick input, actually drawing the menu, the menu definitions themselves, and special cases for the menu options that don't just lead to another menu.

This is complete bunk. Key handling code already exists if you've written a decent emulator, and the other features are just a common courtesy that, if desired, would have to be coded whether making a ROM-type interface or not.

Let me simplify this:

A built-in interface can have access to whatever you code for the emulator, and coding access to features for it should be as simple as passing a few variables to it and tossing a few to the screen functions.

On the other hand, a ROM has only access to what regular ROMs do and whatever expansion features are coded in. In this case, expansion features would be incompatible emulator features introduced for a single rom.

Do you see why the latter isn't a good idea yet?


(edited by Glyph Phoenix on 05-07-06 06:59 AM)
(edited by Glyph Phoenix on 05-07-06 07:02 AM)
HyperHacker

Star Mario
Finally being paid to code in VB! If only I still enjoyed that. <_<
Wii #7182 6487 4198 1828


 





Since: 11-18-05
From: Canada, w00t!
My computer's specs, if anyone gives a damn.
STOP TRUNCATING THIS >8^(

Last post: 6289 days
Last view: 6289 days
Posted on 05-11-06 12:46 AM Link | Quote
You're still missing the entire point.
Originally posted by Glyph Phoenix
Originally posted by HyperHacker
I don't see your point here. Limited tools? A tile editor, a text editor and an assembler are all the tools I need to make a Game Boy ROM. Limited graphic formats? Sure if you wanted super-high-resolution graphics, but the idea of a ROM-based interface is to use the same resolution, colours etc that games use, to make it feel like it's built right into the game.

It's not built into the game, though. It'd be for an emulator, which has a wide array of advantages--the higher resolution being only one of them--that would be tossed away in favor of an interface stuck to a ROM.

Yes it's for an emulator but (again) it's supposed to feel like part of the game. Also, what about those who run the game on their TV using a TV-out card? You can't just switch to a higher resolution there.



What, like a separate loop? That would just consume more CPU power and make it harder to keep everything synchronized. Especially if, for example, you want to support the console's real controllers plugged into a parallel port (even moreso on systems like N64 where you have accessories connected to the controller), synchronization is important for accurate emulation.

Separating the input read through the OS or whatever you use to gather input from the rest of the emulation loop is not only valid; it's smart when you might want to choose a different way to gather input down the line or code the emulator to run on different platforms.

If I wanted to change how my emulator handles input from the OS, I'd just go to the one place in the emulation loop responsible for this and change it there. If I then had an interface using this same input method, I'd either have to have a second instance of this code that needs to be changed, or put the input code in a separate function, adding unnecessary overhead to the loop.



If you want to use the existing screen-drawing functions, then you'd again need to have the emulation loop running. You then have the choice of drawing on a separate buffer not used by the ROM at all, which uses up more memory, or writing your graphics directly into emulated VRAM in which case it's already halfway to being ROM-based.

Again, separating the input and screen drawing functions from the direct emulation loop is going to help out in the long run anyway. Do you really think running and interpreting a second ROM will take up LESS memory than a simple buffer?

Have you ever written an emulator? Screen drawing functions in an emulator are generally very complex, and to separate them from the emulation loop would be a major pain. Not to mention, altering them to allow for a high-resolution interface would require a ridiculous amount of changes. I don't know where you're getting this "running and interpreting a second ROM"; I already stated - and you replied - that the interface would only be displayed when no game is running.



...Wha? The ROM that's designed solely to act as an interface, not being designed for an interface? I'm afraid I can't find any meaning to this sentence.

Most ROM formats weren't designed with interfaces in mind. The SNES, GBA, NES, and a great deal of other ROM formats were never designed to be used as interfaces. And while there are some ROMs designed to be used as BIOS (Neo Geo has a BIOS, I think), those were designed back when we didn't have speedup or manipulatable display or the things we have now and just aren't as valid today as they were then.

All ROM formats are designed to be a simple executable program that can be anything from a game to a calendar to the brain of a robot connected to the controller ports. Most types of games also have to display some form of menu already.


Speaking of speedup keys, can you imagine writing a ROM interface that accesses more keyboard input than a regular ROM? That'd be uncomfortable. And you'd have to do it in order to put a button mapping system in the ROM interface.

I already posted the one line of code required to do this. I don't see how it'd be at all uncomfortable.



Originally posted by Glyph Phoenix
and requiring heavy modifications to the emulator in order to interpret it as such.

Adding this functionality would be trivial, as I've already mentioned a few times.

It wouldn't be, though. Manipulating a loop designed for emulation to add setting-changing support would involve sticking lots of code where it doesn't belong and just misusing the ROM in general.

A switch statement or two and some reads/writes of unused emulated I/O ports. Seems easy enough to me.



Again, the point is to use the same resolution and colours as the original system.

More resolution can mean you can fit in more menus. Menus can get cramped in a GB even when you have much more space available. As for colors, I'd sure like to be able to see more of them if ever this ROM interface were to support changing the palette.

Only really old systems would need any palette-changing method, and it'd still be easy enough to do. Select a colour, adjust some RGB sliders to change it. Menus get cramped on the GB because games add fancy borders and keep them in small windows. The screen resolution is 20x18 tiles, which means the simplest type of menu can fit 18 options with up to 19 characters each on the screen. With some more tweaking, you could use a smaller font (not 8x8) and fit more options on the screen. That's at a resolution of 160x144.



If I can write one line of code to allow a ROM to do something, and 10-15 to allow a standard or built-in interface to do the same, it's pretty clear which is the better option. Compare:
if(ROMFlags & RF_INTERFACE) IO[2] = (GetKeyState(IO[1]) & 0x8000) ? 1 : 0;
versus
case WM_KEYDOWN:
if(ProgramMode == PM_INTERFACE)
{
if(wParam == VK_UP) InterfaceMenuPos[InterfaceMenu]--;
else if(wParam == VK_DOWN) InterfaceMenuPos[InterfaceMenu]++;
else if(wParam == VK_SPACE)
{
InterfaceMenu = InterfaceMenuTarget[InterfaceMenu][InterfaceMenuPos];
InterfaceMenuPos = 0;
}
if(InterfaceMenuPos >= InterfaceMenuMax) InterfaceMenuPos = 0;
else if(InterfaceMenuPos < 0) InterfaceMenuPos = InterfaceMenuMax - 1;
}
else
//Normal emulation-related keystroke handling here
break;

Not including the additional code you'd need for mouse movements, joystick input, actually drawing the menu, the menu definitions themselves, and special cases for the menu options that don't just lead to another menu.

This is complete bunk. Key handling code already exists if you've written a decent emulator, and the other features are just a common courtesy that, if desired, would have to be coded whether making a ROM-type interface or not.

See that second-last line? That's where the existing key handling code would be. The rest is code that would have to be added specifically for a built-in interface.


Let me simplify this:

A built-in interface can have access to whatever you code for the emulator, and coding access to features for it should be as simple as passing a few variables to it and tossing a few to the screen functions.

On the other hand, a ROM has only access to what regular ROMs do and whatever expansion features are coded in. In this case, expansion features would be incompatible emulator features introduced for a single rom.

So I'm guessing the answer to my earlier question is no, you've never written an emulator. To have a built-in interface with a higher resolution and more colours like you keep going on about, you would have to:
  • Modify the screen-drawing functions to draw in a higher resolution and with more colours, and from an alternate source
  • Enlarge the emulation window, and change screen resolutions in full-screen mode
  • Add a second input handler
  • Rewrite large portions of the emulation loop so that you can exit the loop and re-enter it again later without changing any of the emulated system states
  • Add functions to draw the interface, detect clicks, respond to keypresses depending what control has focus, etc etc

For a very basic interface that does nothing aside from choosing a ROM to load, this could add up to several hundred lines you need to change. (Just drawing the interface could easily add up to 3-400; I've done it before.)

To have a ROM-based interface, you would have to:
  • Modify one or two parts (depending how complex you want it) of the emulation loop to read from an unused I/O port, use the value as an index in a switch statement, and write things into other unused I/O ports, if a certain flag is set.
  • Modify the ROM loading code to set that flag if the ROM being loaded has a certain filename or is being loaded from a resource within the EXE.

For a very basic interface that does nothing aside from choosing a ROM to load, this could add up to about 20 lines you need to add/change.
d4s

Shyguy








Since: 12-01-05

Last post: 6410 days
Last view: 6308 days
Posted on 05-11-06 09:45 PM Link | Quote
awesome thread, guys, keep it up!
glyph phoenix is right, imho.
dont care to elaborate, though.

Originally posted by HyperMackerel
Originally posted by MathOnNapkins
You know the SNES has an I/O port... hop to it.
That's just the port I was thinking of when I wrote that. No idea how to use it though.


dont confuse the 2 write/read i/o registers with the ext-connector on the bottom of the snes.
the wrio/rdio regs are partly related to the controller, although i've never used them tbh. maybe you can poll them in a similar way to reading controller data on the nes, although i thought thats what regs $4016/7 are for...
no idea, gotta try that out later.

these are 1bit serial, however, and probably the slowest way possible to hook up a cd rom to the snes.

anyway, the ext port basically contains the b-bus, audio input lines, irq and some clocks.
almost everything (i think just the dot and sampleclocks are missing, dont even know if these are the correct name, didnt bother to hook my scope up to it yet.) on that connector can also be accessed through the ext pins on the cartridges (the ones sa1 or sfx amongst others use), so you don't actually have to use the bottom slot.

the only known sony snes cdrom prototype for example doesnt connect to the bottom slot at all, its just a really fat cartridge.

so, to answer your question, all you have to do to talk to devices through the bottom port is to access $xx:2100-$xx:21ff (actually not all the banks, but you know what i mean, where the ppu registers are).
actually, its pretty handy because you have to decode just 8 adress lines to map your registers into the memory map, not 24 like the a-bus.

if you design your hardware, it would of course be wise not to use adresses that are already occupied by the snes' own registers.

and dont use $21Ex, thats where i put the registers for the multi-region snes i built some time ago. (bottom of this page: http://www.ultrasnes.de/snes.html)


(edited by d4s on 05-11-06 08:48 PM)
Pages: 1 2Add to favorites | Next newer thread | Next older thread
Acmlm's Board - I3 Archive - ROM Hacking - An idea for ROM hacking |


ABII

Acmlmboard 1.92.999, 9/17/2006
©2000-2006 Acmlm, Emuz, Blades, Xkeeper

Page rendered in 0.070 seconds; used 511.17 kB (max 659.40 kB)