Idea on how to port a GBA emulator easily, maybe more too?

This forum is for discussion pertaining to homebrew and indie software for the Dreamcast, such as homebrew games, emulators/interpreters, and other homebrew software/applications. Porting requests and developmental ideas are not to be made here; you can make those here. If you need any help burning discs for homebrew software, this is the place to ask as well.
bufalo73
DCEmu Newbie
DCEmu Newbie
Posts: 5
https://www.artistsworkshop.eu/meble-kuchenne-na-wymiar-warszawa-gdzie-zamowic/
Joined: Wed Mar 24, 2004 3:37 pm
Has thanked: 0
Been thanked: 0

Post by bufalo73 »

Just a question : why not "recode" the games to run directly on DC? I mean, doing like emus do "translating" the original code. But unlike emus, writing on another file the resulting "translation". Of course, it would not be done with a DC, but with a Win/Lin/Mac/... computer.

It's just an idea. I don't know if it can be done. But I've seen stranger things :)
Hobbes T Tiger
Mental DCEmu
Mental DCEmu
Posts: 458
Joined: Fri Dec 27, 2002 11:27 am
Location: Prisoner of the Nintendo Police?
Has thanked: 0
Been thanked: 0

Post by Hobbes T Tiger »

The problem here would be that the code needs to be written in asm, and you'd need to translate x86 code into SH-4.

There are such things as cross assemblers, but they tend to be of the variety of PC assemblers for Z80 or 6502, not as advanced as what you suggest.

Apart from the fact that I'm sure such a thing doesn't exist for SH-4 the emulator you want to translate would also need to be coded in asm and due to the sheer power of PC's very few are now.

I don't usually answer coding queries, did I do good?
Sega of Japan wrote:Offline - No confusion! No Boring! No Silence!
Online - No Loneliness! No Typing!
Orange_Ribbon
DCEmu's Cheerleader
Posts: 2553
Joined: Tue May 27, 2003 7:38 pm
Location: Insert Witty Comment here
Has thanked: 0
Been thanked: 0

Post by Orange_Ribbon »

Wills- I would love to see one ported for the soul purpose of making a DC portible and wearing it on my back like it Typing of the Dead. On the other hand if you wanna steal GBA roms so bad you can get a GC, and a GBA player. all Joking set a side I can understand why some people would love a GBA Emu on DC. I loved it when Nintendo released the SGB for SNES. But then again you should just get a GC, and a GBA player. Suport the current games.
Ze_ro
Insane DCEmu
Insane DCEmu
Posts: 120
Joined: Thu May 22, 2003 7:08 pm
Location: MB, Canada
Has thanked: 0
Been thanked: 0

Post by Ze_ro »

I'm surprised this thread is still here. I thought it was pretty much par for the course to just lock all these GBA emulator requests.

The whole thing is basically a waste of time anyway, and the idea of doing it via Java is completely misguided, for three main reasons: 1) There is no suitable Java implementation on the Dreamcast. 2) It would almost certainly be too slow to be playable. And 3) You're still stuck with the problem of fitting the (somewhat large) GBA roms into memory. I guess you're safe for the smaller ones, but there are a lot out there that are just too big.

--Zero
doragasu
DCEmu Cool Poster
DCEmu Cool Poster
Posts: 1048
Joined: Thu May 16, 2002 5:01 pm
Location: Madrid, Spain
Has thanked: 0
Been thanked: 0

Post by doragasu »

Supposing Java is as fast as C/C++ and There's a JVM ported to DC, it would not be useful to code a GBA emulator for DC due to memory constraints. Java Virtual Machine not only uses CPU power, it also uses a big (big for the 16 MB of DC, not for the 512 MB of my PC) chunk of RAM.

Something maybe somebody could do is to port J2ME (Java for mobile phones) to play J2ME games in DC, but forget to code emulators in Java.
SSJKarma
Insane DCEmu
Insane DCEmu
Posts: 124
Joined: Sun Jan 05, 2003 11:44 pm
Has thanked: 0
Been thanked: 0

Post by SSJKarma »

maybe some people really should be understanding things a bit more !

PLANETWEB BROWSERS have virtual machines enabled JAVA !
but it is way too out of date to use anything good !
and since they said there is no open source, they would have to deal with it as it is.

either way... i doubt any GBA emulators to actually come close to perfection when it comes down to something like emulating a system almost identical to the PSX one ! well comparision wise.

in any case... if the DC streams the files directly from CD to buffer, why wouldn't we use that to do some new ROMS redesigning stuff...

oh well i'll let the others experienced people speak !
i know too few of the dreamcast to know exactly where i'm going !
but know that PLANET WEB BROWSERS do have JAVA ENBLED and that includes the JAVA virtual machine !

i know cause i played a few games off the net with my dreamcast, they actually played but i couldn't due to not having a keyboard !
FLASH also works with PLANET WEB BROWSERS !
Ze_ro
Insane DCEmu
Insane DCEmu
Posts: 120
Joined: Thu May 22, 2003 7:08 pm
Location: MB, Canada
Has thanked: 0
Been thanked: 0

Post by Ze_ro »

SSJKarma wrote:PLANETWEB BROWSERS have virtual machines enabled JAVA !
First of all, whatever Java the Planetweb browser has is meant for webpages, not for doing emulators. Even if you did write a GBA emulator in Java, are you absolutely sure that Planetweb even has enough features for it to actually work properly? (Can a Java program running in the browser even read the controller for example?)

Plus, Java virtual machines are not trivial programs, and the Dreamcast has a rather moderate amount of power... assuming that Planetweb's Java implementation was up to the task, and that someone had already written a whole Java GBA emulator, you still have to deal with the fact that the VM will be hogging just about all the Dreamcast's resources, so the emulator will take a huge performance hit no matter how well it's coded, and you'll have a very tough time even fitting the emulator in memory alongside the VM, let alone the rom that you want to play.

Also, in order to keep everything nice and legal, you couldn't hack the browser, so you'd have to access the emulator through the internet as if it were any of the other Java or Flash games you see out there. That would be inconvenient at best, and likely completely defeats the whole purpose at worst.
in any case... if the DC streams the files directly from CD to buffer, why wouldn't we use that to do some new ROMS redesigning stuff...
If this is your answer to getting GBA roms into memory, then where do you think this "buffer" is?

The only way I can think of that would even remotely work would be to leave the whole rom on the disc, and whenever the emulator has to read something off the rom, just load that one tiny part. However, that would be unnacceptably slow. Even if you added tons of crazy caching and whatnot, I don't think you could build a workable emulator around that... not to mention that the CD's motor would be killing itself trying to keep up.

In the end, it's really not worth it to get a GBA emulator on the Dreamcast. The only way you'd get anywhere near full speed (without sacrificing sound or skipping frames) would be to write the whole thing in nice SH4 machine language, or to write some extremely tight C. And even then, you'd almost certainly be restricted to only the smallest GBA roms out there. Plus, what do you have in the end? You get to play portable games without the benefit of portability. If that's what you want, then either buy a Gamecube and a GB Player, or get just use a GBA emulator on your computer instead. I'd much rather see the talent of the DC Devver's around here put to better use on realistic projects like a TG-16 emulator or some new homebrews rather than spending the years it would take to get a decent GBA emulator.

It's simply not worth it.

--Zero
Hobbes T Tiger
Mental DCEmu
Mental DCEmu
Posts: 458
Joined: Fri Dec 27, 2002 11:27 am
Location: Prisoner of the Nintendo Police?
Has thanked: 0
Been thanked: 0

Post by Hobbes T Tiger »

Ahhhhhh.... just lock it. Go on, you know you want to. :wasntme:
Sega of Japan wrote:Offline - No confusion! No Boring! No Silence!
Online - No Loneliness! No Typing!
Storminator16
DCEmu Veteran
DCEmu Veteran
Posts: 850
Joined: Mon Sep 01, 2003 11:12 am
Location: NC/Iraq
Has thanked: 0
Been thanked: 0
Contact:

Post by Storminator16 »

Ze_ro wrote:Also, in order to keep everything nice and legal, you couldn't hack the browser....
8-)
SSJKarma
Insane DCEmu
Insane DCEmu
Posts: 124
Joined: Sun Jan 05, 2003 11:44 pm
Has thanked: 0
Been thanked: 0

Post by SSJKarma »

hey i never said it would be easy to do and i even tho didn't say it was so possible to do one !

al i been saying was... if you had that "KEYBOARD" you know the DC keyboard, lots of JAVA GAMES were working by back then standards !

that was a fact.

now by today's standard, there is no way a java enabled web site would work since the JAVA on PLANET WEB browsers was never updated.

so yeah there would be a need to redesign those browsers.
that is the problem.
that's all i said, nothing more !

as for the streaming...
well i doubt any PSX or DC games running their whole programs into memory !
so that's why i said it would actually works if we were able to do it.

the problem is...
FILES on a PSX and or DC disk are all separate files which the program can access at will fromt he GD or CD. contrary to our ROMS which are one packed file with everything in it !
User avatar
Quzar
Dream Coder
Dream Coder
Posts: 7499
Joined: Wed Jul 31, 2002 12:14 am
Location: Miami, FL
Has thanked: 4 times
Been thanked: 10 times
Contact:

Post by Quzar »

http://gcn.com/vol1_no1/daily-updates/25400-1.html

that ends the question of java...
"When you post fewer lines of text than your signature, consider not posting at all." - A Wise Man
User avatar
KDAnarch
DCEmu Newbie
DCEmu Newbie
Posts: 7
Joined: Wed Jan 21, 2004 11:02 am
Has thanked: 0
Been thanked: 0
Contact:

Post by KDAnarch »

So can someone lock the damn topic now?
Pain is good for torture... bad for sex.
Alexvrb
DCEmu Ultra Poster
DCEmu Ultra Poster
Posts: 1754
Joined: Wed Jul 17, 2002 11:25 am
Has thanked: 0
Been thanked: 0

Post by Alexvrb »

SSJKarma wrote:as for the streaming...
well i doubt any PSX or DC games running their whole programs into memory !
so that's why i said it would actually works if we were able to do it.

the problem is...
FILES on a PSX and or DC disk are all separate files which the program can access at will fromt he GD or CD. contrary to our ROMS which are one packed file with everything in it !
There's more to it than that. CD-based games are designed to load things off slow optical media, so they are more than happy to run off a CD. Cartridge-based games have to be loaded in memory because the GD-ROM isn't nearly fast enough to match the speed of the real cartridge, which could be called upon to load things at any time.
Post Reply