Author Topic: gpSP-Nspire (GBA Emulator)  (Read 198335 times)

0 Members and 2 Guests are viewing this topic.

Offline Ti-DkS

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 143
  • Rating: +21/-1
  • In retro, we trust !
    • View Profile
Re: gpSP-Nspire (GBA Emulator)
« Reply #105 on: August 09, 2012, 04:50:02 am »
Hi ! I'm very impressed by your work calc84, this is simply amazing ! Because I don't brought my laptop with me I can't test it but it seems really impressing :) So because I used exactly the same open source C code of gp2x as base for my try-of-sort-of-gba-emulator (wow, great project name, nope ? ^^) I wanted to know if you used the files ARM_EMIT, STUB and other .S files without modifying them and how you organized your makefile to obtain a lighter TNS file than mine (it was 14Mb, so you can easily imagine that the 8mb metroid fusion rom + 160kb bios + 14 mb emulator + 30mb TI-os == reboot ^^). If course if the informations I ask you are classified as "top-secret" or "for-calc84maniac-eyes-only" you are not forced to tell me this Secret :) Just wanted to know were my code was crashing !

So congratulations for this app, I believe you will suceed in optimizing it and make it perfect better than me (14mb emu ... I need to fix my linker I think ><), great job !

Offline calc84maniac

  • eZ80 Guru
  • Coder Of Tomorrow
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2912
  • Rating: +471/-17
    • View Profile
    • TI-Boy CE
Re: gpSP-Nspire (GBA Emulator)
« Reply #106 on: August 09, 2012, 10:35:26 am »
The main "secret" is that I used the ELF loader created by tangrs (with some modifications because it didn't catch all relocation cases) to load my generated ELF file into memory for execution. This solves lots of problems with global variables and such, and I was also able to force it to load to an address aligned to 32 bytes, which Ndless doesn't do. That's why there is a launcher file and a resources file, the latter is actually just an ELF.

It was also rather important that I was able to implement cache invalidation manually for the dynamic recompiler, since the library for that on GP2X is not available on Nspire.

I'm not sure how you got 14MB, were you not compiling with optimization enabled?
"Most people ask, 'What does a thing do?' Hackers ask, 'What can I make it do?'" - Pablos Holman

Offline Hayleia

  • Programming Absol
  • Coder Of Tomorrow
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3367
  • Rating: +393/-7
    • View Profile
Re: gpSP-Nspire (GBA Emulator)
« Reply #107 on: August 09, 2012, 11:01:46 am »
   * Disable document screen refresh on exit, it made exiting too slow.
What exactly were you refreshing ? The whole file system or just the My Documents menu ? Because that would be useless to refresh anything else than the My Documents menu and maybe that was why is was slow ?
I own: 83+ ; 84+SE ; 76.fr ; CX CAS ; Prizm ; 84+CSE
Sorry if I answer with something that seems unrelated, English is not my primary language and I might not have understood well. Sorry if I make English mistakes too.

click here to know where you got your last +1s

Offline calc84maniac

  • eZ80 Guru
  • Coder Of Tomorrow
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2912
  • Rating: +471/-17
    • View Profile
    • TI-Boy CE
Re: gpSP-Nspire (GBA Emulator)
« Reply #108 on: August 09, 2012, 11:21:14 am »
   * Disable document screen refresh on exit, it made exiting too slow.
What exactly were you refreshing ? The whole file system or just the My Documents menu ? Because that would be useless to refresh anything else than the My Documents menu and maybe that was why is was slow ?
It's the standard document refresh function introduced in Ndless 3.1. It's probably not really necessary though unless I'm renaming or deleting files.
"Most people ask, 'What does a thing do?' Hackers ask, 'What can I make it do?'" - Pablos Holman

Offline Hayleia

  • Programming Absol
  • Coder Of Tomorrow
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3367
  • Rating: +393/-7
    • View Profile
Re: gpSP-Nspire (GBA Emulator)
« Reply #109 on: August 09, 2012, 02:12:13 pm »
Also, I had a feature request. Could file association not change the rom directory ?

For example, I have a.gba in tha A folder and b.gba in the B folder.
I use the gpSP browser to go to the B folder, launch b.gba then quit.
Then I use the file association to launch a.gba, and there, it would be great if gpsp_romdir still indicated the B folder :)
I own: 83+ ; 84+SE ; 76.fr ; CX CAS ; Prizm ; 84+CSE
Sorry if I answer with something that seems unrelated, English is not my primary language and I might not have understood well. Sorry if I make English mistakes too.

click here to know where you got your last +1s

Offline ExtendeD

  • CoT Emeritus
  • LV8 Addict (Next: 1000)
  • *
  • Posts: 825
  • Rating: +167/-2
    • View Profile
Re: gpSP-Nspire (GBA Emulator)
« Reply #110 on: August 09, 2012, 04:45:25 pm »
The main "secret" is that I used the ELF loader created by tangrs (with some modifications because it didn't catch all relocation cases) to load my generated ELF file into memory for execution. This solves lots of problems with global variables and such, and I was also able to force it to load to an address aligned to 32 bytes, which Ndless doesn't do. That's why there is a launcher file and a resources file, the latter is actually just an ELF.

I suppose the alignment requirement isfor a screen buffer array, and that tangrs's BFLT loader doesn't support 32-bytes alignment? I? Does ELF allow to define this on a per variable basis?
Ndless.me with the finest TI-Nspire programs

Offline calc84maniac

  • eZ80 Guru
  • Coder Of Tomorrow
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2912
  • Rating: +471/-17
    • View Profile
    • TI-Boy CE
Re: gpSP-Nspire (GBA Emulator)
« Reply #111 on: August 09, 2012, 04:48:39 pm »
The main "secret" is that I used the ELF loader created by tangrs (with some modifications because it didn't catch all relocation cases) to load my generated ELF file into memory for execution. This solves lots of problems with global variables and such, and I was also able to force it to load to an address aligned to 32 bytes, which Ndless doesn't do. That's why there is a launcher file and a resources file, the latter is actually just an ELF.

I suppose the alignment requirement isfor a screen buffer array, and that tangrs's BFLT loader doesn't support 32-bytes alignment? I? Does ELF allow to define this on a per variable basis?
The screen buffer requires 8-byte alignment, and that was a problem. I used some GCC syntax to align to 8 bytes, but of course this means nothing if the program itself is only 4-byte aligned. Alignment of 32 is nice because of how the program might be optimized due to cache line boundaries. The issue is that malloc itself is only 4-byte aligned, so I had to malloc with the size+32 and then align manually.
"Most people ask, 'What does a thing do?' Hackers ask, 'What can I make it do?'" - Pablos Holman

Offline willrandship

  • Omnimagus of the Multi-Base.
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2953
  • Rating: +98/-13
  • Insert sugar to begin programming subroutine.
    • View Profile
Re: gpSP-Nspire (GBA Emulator)
« Reply #112 on: August 09, 2012, 11:54:06 pm »
Frankly the number one surprise for me on this emulator is the apparent lack of TI-Boy style similar-system hacks. I mean, it's written in C!

Offline Yeong

  • Not a bridge
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3739
  • Rating: +278/-12
  • Survivor of Apocalypse
    • View Profile
Re: gpSP-Nspire (GBA Emulator)
« Reply #113 on: August 10, 2012, 09:38:37 am »
I'm wondering if you'll implement (feature request) the codebreaker codes(the one with the syntax like ABCDEF10 0001)
Sig wipe!

Offline calc84maniac

  • eZ80 Guru
  • Coder Of Tomorrow
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2912
  • Rating: +471/-17
    • View Profile
    • TI-Boy CE
Re: gpSP-Nspire (GBA Emulator)
« Reply #114 on: August 10, 2012, 09:52:07 am »
I didn't have anything to do with the other cheat code implementation (except making sure that they're loaded properly on the Nspire platform), so I don't really have plans to add more.
"Most people ask, 'What does a thing do?' Hackers ask, 'What can I make it do?'" - Pablos Holman

Offline ExtendeD

  • CoT Emeritus
  • LV8 Addict (Next: 1000)
  • *
  • Posts: 825
  • Rating: +167/-2
    • View Profile
Re: gpSP-Nspire (GBA Emulator)
« Reply #115 on: August 10, 2012, 01:15:17 pm »
calc84maniac, would the integration of tangrs's BFLT loader to Ndless make the emulator lighter (there's a patch ready for it, and its much more simple that the ELF loader), even if you still need to align the malloc yourself? (I'm not sure if making a 32-byte alignment the default in Ndless would make sense for all programs).
Ndless.me with the finest TI-Nspire programs

Offline willrandship

  • Omnimagus of the Multi-Base.
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2953
  • Rating: +98/-13
  • Insert sugar to begin programming subroutine.
    • View Profile
Re: gpSP-Nspire (GBA Emulator)
« Reply #116 on: August 10, 2012, 02:01:56 pm »
@Yeong it's not hard to make your own codes, or even convert codebreaker to whatever the nspire uses. They're just memory access codes.

Offline calc84maniac

  • eZ80 Guru
  • Coder Of Tomorrow
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2912
  • Rating: +471/-17
    • View Profile
    • TI-Boy CE
Re: gpSP-Nspire (GBA Emulator)
« Reply #117 on: August 10, 2012, 04:17:50 pm »
calc84maniac, would the integration of tangrs's BFLT loader to Ndless make the emulator lighter (there's a patch ready for it, and its much more simple that the ELF loader), even if you still need to align the malloc yourself? (I'm not sure if making a 32-byte alignment the default in Ndless would make sense for all programs).
32-byte alignment seems like it would be pretty standard for ARM programs. I'm talking about the program itself; the screen buffers I mentioned are in the .bss section of the program (and this is certainly dependent on the program loader). If the BFLT converter is based on that ELF loader, though, it might be missing some relocation cases. I'm not sure how much lighter BFLT would make it, either (it does define the .bss section by size and not a bunch of zeroes, right?)
"Most people ask, 'What does a thing do?' Hackers ask, 'What can I make it do?'" - Pablos Holman

Offline xacto

  • LV3 Member (Next: 100)
  • ***
  • Posts: 68
  • Rating: +10/-0
    • View Profile
Re: gpSP-Nspire (GBA Emulator)
« Reply #118 on: August 11, 2012, 12:27:39 am »
I was wondering, is there any way to tell how many megabytes a GBA Rom would take up before downloading it?
« Last Edit: August 11, 2012, 12:40:09 am by xacto »

Offline nyanfly

  • LV1 Newcomer (Next: 20)
  • *
  • Posts: 15
  • Rating: +4/-0
    • View Profile
Re: gpSP-Nspire (GBA Emulator)
« Reply #119 on: August 11, 2012, 12:45:06 am »
Just curious, how well does gba homebrew run?
This is a signature. You are reading it. You will finish this sentence. You will reach the end of this line. There are 227 characters in this signature. There are 42 words. You will now go back and examine this signature again.