Emulation Multi-platform builder scripts for GBA emulators

hippy dave

BBMB
Member
Joined
Apr 30, 2012
Messages
9,921
Trophies
2
XP
30,066
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
830
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
  • Xdqwerty @ Xdqwerty:
    @SylverReZ I read that non-binary people identify as a blend of male and female. The point is i think i'm a blend of those and thus non binary
  • SylverReZ @ SylverReZ:
    @Xdqwerty, Non-binary people are those who don't identify themselves exclusively as male or female.
  • cearp @ cearp:
    I don't identify as anything, unless I need to get on a plane then I show ID
    +3
  • AncientBoi @ AncientBoi:
    👈 [homo, queer, fag, coksuqr, etc......]
    +3
  • Xdqwerty @ Xdqwerty:
    @SylverReZ, I meant that I read that they can also identify as what i mentioned
    +2
  • BigOnYa @ BigOnYa:
    I identify as Long Rod Johnson, cause a cat called me that once.
    +2
  • AncientBoi @ AncientBoi:
    [takes a 👀 in your pants] Liar :angry:
    +3
  • Xdqwerty @ Xdqwerty:
    @SylverReZ, and thus that would make me non binary since i feel like a blend of both male and female
    +1
  • AncientBoi @ AncientBoi:
    @Xdqwerty only time will tell, what/whom you are. At 14, its a bit early to "Define" yourself. :)
    +3
  • Psionic Roshambo @ Psionic Roshambo:
    I only recently have learned who I am and how much I am capable of and I'm 50 lol
    +3
  • Psionic Roshambo @ Psionic Roshambo:
    A thousand epiphanies and unbelievable pain and growth.
    +2
  • Psionic Roshambo @ Psionic Roshambo:
    I wish I could sum it up for children to understand but it truly takes living a lifetime of learning
    +2
  • Psionic Roshambo @ Psionic Roshambo:
    It's more than knowledge it's understanding
    +1
  • Psionic Roshambo @ Psionic Roshambo:
    Both are required
  • Xdqwerty @ Xdqwerty:
    @Psionic Roshambo, ask chatgpt or Google gémini to summarize it
  • Psionic Roshambo @ Psionic Roshambo:
    Lol summarize life's lessons
  • BigOnYa @ BigOnYa:
    My wifey tells me all the time "You need to grow the fuck up." Which I don't understand, cause I'm full grown already.
    +2
  • Xdqwerty @ Xdqwerty:
    @BigOnYa, she means grow more
    +1
  • Xdqwerty @ Xdqwerty:
    Yawn
  • AncientBoi @ AncientBoi:
    farrrrrrrrrrrt
    +1
  • BigOnYa @ BigOnYa:
    @AncientBoi I imagine it don't make the fart sound anymore, probably sounds more like letting go of a balloon you just blew up.
    +3
  • SylverReZ @ SylverReZ:
    @BigOnYa, Tell her to grow a pair. :rofl2:
    +3
  • Xdqwerty @ Xdqwerty:
    @SylverReZ, you played any Sega genesis games?
    Xdqwerty @ Xdqwerty: @SylverReZ, you played any Sega genesis games?