Homebrew 3DNES - NES Emulator

DiscostewSM

Well-Known Member
Member
Joined
Feb 10, 2009
Messages
5,484
Trophies
2
Location
Sacramento, California
Website
lazerlight.x10.mx
XP
5,522
Country
United States
Nice!

I wonder if using a function pointer table over a big switch will improve speed much, though. Compilers generally turn big switch statements into jump tables.

However, something that could give you more speed would be storing the 6502 registers in ARM registers rather than in RAM. lolSnes/blargSnes do it this way, and I think SNemulDS goes even further but I haven't looked into it much. But the overall idea is to do the least RAM accesses possible. I don't know how slow the 3DS RAM is, but on the DS the main RAM is slow as shit, so yeah.


DS RAM is pretty bad. Memory and I/O accesses are delayed to 33Mhz as opposed to 66Mhz (which is only with cache and tcm), and it's further dropped by a hardware glitch that adds 3 wait cycles to all non-sequential access on the NDS9 side, resulting in the bus clock to about 8Mhz.
 

Abcdfv

What comes around goes around.
Member
Joined
Dec 24, 2013
Messages
1,455
Trophies
0
XP
837
Country
United States
DS RAM is pretty bad. Memory and I/O accesses are delayed to 33Mhz as opposed to 66Mhz (which is only with cache and tcm), and it's further dropped by a hardware glitch that adds 3 wait cycles to all non-sequential access on the NDS9 side, resulting in the bus clock to about 8Mhz.

That actually made me laugh. Though given the constraints of the hardware, I must say the DS devs did a damn fine job.
 

VMM

Hamon > Stand
Member
Joined
Jul 1, 2010
Messages
3,132
Trophies
2
Age
33
XP
2,243
Country
Brazil
DS RAM is pretty bad. Memory and I/O accesses are delayed to 33Mhz as opposed to 66Mhz (which is only with cache and tcm), and it's further dropped by a hardware glitch that adds 3 wait cycles to all non-sequential access on the NDS9 side, resulting in the bus clock to about 8Mhz.


Is there a benefit for delaying the DS memory frequency?
 

DiscostewSM

Well-Known Member
Member
Joined
Feb 10, 2009
Messages
5,484
Trophies
2
Location
Sacramento, California
Website
lazerlight.x10.mx
XP
5,522
Country
United States
Is there a benefit for delaying the DS memory frequency?


I don't have the exact details on it, but my belief is that the ARM7 was originally meant to act as the primary CPU, and that the ARM9 was thrown in very late into the R&D phase. Whether this means the DS was to have 2 ARM7s or just one, I don't know, but we do know the ARM7 operates at 33Mhz as the bus does, and from what I understand, the ARM7 isn't affected by the hardware glitch. The DS was meant to be a 3rd pillar, according to Nintendo, so I wouldn't be surprised if their R&D wasn't as "structured" for this project as it has with their other hardware developments.

Anyways, I'm going off-topic here. This thread is about the 3DNES. My apologies.
 
  • Like
Reactions: st4rk

st4rk

nah
OP
Member
Joined
Feb 11, 2014
Messages
542
Trophies
0
Website
st4rk.net
XP
815
Country
Brazil
Nice!

I wonder if using a function pointer table over a big switch will improve speed much, though. Compilers generally turn big switch statements into jump tables.

However, something that could give you more speed would be storing the 6502 registers in ARM registers rather than in RAM. lolSnes/blargSnes do it this way, and I think SNemulDS goes even further but I haven't looked into it much. But the overall idea is to do the least RAM accesses possible. I don't know how slow the 3DS RAM is, but on the DS the main RAM is slow as shit, so yeah.


Exact, i know about the big switch, but i will just do a test if i don't get speed the last way is do what you told, use ARM Registers, i don't know if is possible do it with inline asm, if not, i will try write the CPU in ARM-ASM :C
 

Coto

-
Member
Joined
Jun 4, 2010
Messages
2,979
Trophies
2
XP
2,565
Country
Chile
Exact, i know about the big switch, but i will just do a test if i don't get speed the last way is do what you told, use ARM Registers, i don't know if is possible do it with inline asm, if not, i will try write the CPU in ARM-ASM :C

Inline assembly on short functions have been very fast in my opinion. (when reading / writing to dtcm or wram).

Some KEIL (ARM devs) said inline was good for short functions, and it doesn't optimize inlined thumb code if compiler flags are set to do so. The only drawback is that there's no PC, LR or SP management from it (from what I remember..) (this means 0x10 mode for CPSR only)

edit: but the use of labels are permitted, which is nice
 
  • Like
Reactions: futaris and st4rk

Doran754

Conform comrades
Member
Joined
Mar 19, 2014
Messages
1,256
Trophies
0
Location
UTS
XP
1,761
Country
United Kingdom
Hello everyone, this weekend i will release a new build(if everything continue good), it will include some new features, this will be the 1.8b(2.0 just in Homebrew Loader).


Regards, St4rk.

Care to say what these new features are im excited :D It's fine if you would rather not though.
 

Doran754

Conform comrades
Member
Joined
Mar 19, 2014
Messages
1,256
Trophies
0
Location
UTS
XP
1,761
Country
United Kingdom
I only asked what the features were didn't exactly demand he release it now or anything, also said it's fine if he'd rather not .. don't see how I bugged him but ok
 

st4rk

nah
OP
Member
Joined
Feb 11, 2014
Messages
542
Trophies
0
Website
st4rk.net
XP
815
Country
Brazil
Hi hi, sorry, i am a busy guy :C

So the new features is the new menu, auto-frameskip, re-worked CPU(it's in WIP), fixing some instruction and timming, support save-state and some issues fixing, i hope i can finish it on weekend :3

I learned that through PM's. :rofl2:
Sorry i forgot you, read now (:
 

Abcdfv

What comes around goes around.
Member
Joined
Dec 24, 2013
Messages
1,455
Trophies
0
XP
837
Country
United States
Hi hi, sorry, i am a busy guy :C

So the new features is the new menu, auto-frameskip, re-worked CPU(it's in WIP), fixing some instruction and timming, support save-state and some issues fixing, i hope i can finish it on weekend :3


Sorry i forgot you, read now (:
How about me buddy ;)
 

st4rk

nah
OP
Member
Joined
Feb 11, 2014
Messages
542
Trophies
0
Website
st4rk.net
XP
815
Country
Brazil
Updates :3

As everyone know, we have some issues with speed in the 3DNES, what i did now:

written unrom in assembly
written CPU with Jump Table
written a configuration menu(in progress yet)
fixing some instructions on CPU
what i will do:
try use GPU on 3DNES(ppu is really the speed problem here)
finish the SaveState/Load Sate
Finish the Menu
Add new mappers(my priority is to Final Fantasy 7 Hack Rom Mapper).
Fix issues on CPU(yeah, there is some little issues in CPU yet).

I hope i can finish it this week XD
 
  • Like
Reactions: Margen67 and Abcdfv

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
    BakerMan @ BakerMan: fuckin heavy storm over here