Emulation Multi-platform builder scripts for GBA emulators

hippy dave

BBMB
Member
Joined
Apr 30, 2012
Messages
9,916
Trophies
2
XP
29,843
Country
United Kingdom
For good measure - here are the disassemblies of each of HVCA's flashcart reboot functions:
Each of these routines has a consistent end section:
Code:
mov r0, #0
mov r1, #0x4000000
strh r0, [r1, #-6]     @ store half-word 0x0000 at address 0x3fffffa
mov r0, #0xfc          @ move word 0x000000fc into register r0
svc #0x10000           @ supervisor call 0x10000
svc #0                 @ supervisor call 0x00000

More known-good EZ-Flash reset code here:
https://github.com/EvilJagaGenius/jagoombacolor/blob/master/src/visoly.s

It also uses supervisor call 0x10000 followed by supervisor call 0x00000.
Post automatically merged:

Ok, so here is my tweaking of the flash_ez1.sub disassembled source to create flash_ez4.sub:
Code:
# HVCA exit code for EZ-Flash IV / 3in1 / Omega
# by patters in 2023
#
# https://gbatemp.net/threads/multi-platform-builder-scripts-for-gba-emulators.611219/post-10138443

add   sb, pc, #0x48          @ sb = start of .BYTE definitions
ldm   sb, {r1, r2, r3, r4}
mov   r5, #0xd200
mov   r6, #0x1500
strh  r5, [r1]               @ 0x9fe0000 = 0xd200
strh  r6, [r2]               @ 0x8000000 = 0x1500
strh  r5, [r3]               @ 0x8020000 = 0xd200
strh  r6, [r4]               @ 0x8040000 = 0x1500
mov   r0, #0x8000
ldr   r1, [pc, #0x34]        @ 5th .BYTE
strh  r0, [r1]               @ 0x9880000 = 0x8000
mov   r0, #0x1500
ldr   r1, [pc, #0x2c]        @ 6th .BYTE
strh  r0, [r1]               @ 0x9fc0000 = 0x1500
mov   r0, #0
mov   r1, #0x4000000         @ 0x9fc0000 = 0x1500
strh  r0, [r1, #-6]          @ 0x3fffffa = 0x0000
mov   r0, #0xfc
svc   #0x10000
svc   #0
.BYTE 0x00, 0x00, 0xfe, 0x09
.BYTE 0x00, 0x00, 0x00, 0x08
.BYTE 0x00, 0x00, 0x02, 0x08
.BYTE 0x00, 0x00, 0x04, 0x08
.BYTE 0x00, 0x00, 0x88, 0x09
.BYTE 0x00, 0x00, 0xfc, 0x09

...which assembles into the 104 byte file which is attached to this post.
:yaysp: And it actually works on my EZ-Flash IV! I'm very pleased with that. :toot:

I think it ought to work on EZ-Flash 3in1 / Omega / Omega DE too. Please try it and let me know. You'll need to add the exit sub using my build script's -x command line option.

The final point of confusion is that if you select <EXIT Emulation> from the menu it only resets the emulator. You need to Hold L+R whilst in the menu to actually exit back to the flashcart menu (keep holding while the screen turns black). The clue to this was in the rather intriguing controls schematic in the HVCA readme.

Take note - all of this was made possible by Open Source. I know next to nothing about ARM ASM, and I'm not a software developer. If I can do this then so can you, with curiosity, logic, and patience.
Interesting discussion above, but all I can tell you so far is that this attachment definitely works on my Omega :gba: Many thanks!
 

TechieSaru

Well-Known Member
Newcomer
Joined
Mar 2, 2022
Messages
72
Trophies
0
Location
Somewhere, Out there
XP
824
Country
United States
Does 0x8000 definitely work on EZ-Omega?
Just ran a quick test. It works fine.

Edit: I did another test and it turns out I was right about the truncation. It seems only values that are a multiple of 512 are used by SetRompage. Evidentally, their documentation was wrong.
 
Last edited by TechieSaru,

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • K3Nv2 @ K3Nv2:
    People have put 50mg salt nic in straight subohm coils which is like more powerful hits
    +1
  • BigOnYa @ BigOnYa:
    Hey psi, do they have dress codes down there in FLa, here there are signs on stores that say "No shirt, no service" but curious bout down yonder
  • BigOnYa @ BigOnYa:
    Yea I tried the salts and too strong for me, I prefer the norm juice
  • K3Nv2 @ K3Nv2:
    In Florida they don't serve you if you have clothes on
    +1
  • K3Nv2 @ K3Nv2:
    Fucking raining again
  • BigOnYa @ BigOnYa:
    How can you tell, do you see rain drops on top of other rain drops?
    +1
  • K3Nv2 @ K3Nv2:
    I can tell by whenever your wife done letting out loud ass moans then I get her a ticket back home
    +1
  • Psionic Roshambo @ Psionic Roshambo:
    @BigOnYa, yeah most places demand clothes and shoes, unless it's some really back water place that I am unaware of lol
    +1
  • BigOnYa @ BigOnYa:
    Cool, I got lunch money for tomorrow then.
  • BakerMan @ BakerMan:
    @K3Nv2 call uremum Sloppenheimer the way she givin me this bomb head
    +1
  • K3Nv2 @ K3Nv2:
    I call uremum alzheimer she forgets to leave
    +1
  • Psionic Roshambo @ Psionic Roshambo:
    Time to start a vape straight nicotine challenge, Darwin be praised!
    +1
  • K3Nv2 @ K3Nv2:
    Imagine if Hitler had vapes, we promise it's not cyanide it'll help you quit nicotine
    +1
  • BigOnYa @ BigOnYa:
    Please, walk into my patented vape chamber, aka the non smoking area
  • K3Nv2 @ K3Nv2:
    I do wonder how dominate Germany would've been if they just enlisted Jewish people
  • BigOnYa @ BigOnYa:
    They actually enlisted Muslims, seriously, because the Muslims hates Jews, even tho it was not the supreme race. He claimed common hate, is friendship.
  • K3Nv2 @ K3Nv2:
    He could've just made them walking shields kind of a dumb ass move
  • K3Nv2 @ K3Nv2:
    https://a.co/d/3km8bqC lol cd level quality I fucking hope so
  • BigOnYa @ BigOnYa:
    So a man, wifey laying in bed, and man wants sum and rubs on her a little, she turns and says "Not tonight, I have a gyno apt in the morning." So man rolls over, but after few minutes starts rubbing her again. She says didn't you here me, no messing around, I have a gyno apt tomorrow. " Man says, "Well you don't have a dentist apt tomorrow also do you?"
  • BigOnYa @ BigOnYa:
    Damn I have 8 modded rgh3 x360 slims I've done, I need to get rid of, I figured my family members or friends would want but times have changed. Think I'm gonna stop buying them and modding. Time to Switch it up (pun intended)
  • K3Nv2 @ K3Nv2:
    Yay power outages
  • K3Nv2 @ K3Nv2:
    @BigOnYa, I'm your friend
    +1
  • BigOnYa @ BigOnYa:
    There literally no storms in your area, does it go out alot? You need to just send me your slim n ill rgh3 it free.
  • BigOnYa @ BigOnYa:
    Or grow sum balls and do it yourself, not hard.
    BigOnYa @ BigOnYa: Or grow sum balls and do it yourself, not hard.