Emulation Multi-platform builder scripts for GBA emulators

hippy dave

BBMB
Member
Joined
Apr 30, 2012
Messages
9,943
Trophies
2
XP
30,270
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
836
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
  • No one is chatting at the moment.
  • S @ salazarcosplay:
    hunter x hunter
  • S @ salazarcosplay:
    he has not allowed anyone to continue it for him for example
  • Xdqwerty @ Xdqwerty:
    @salazarcosplay, theres a dragon ball af mod for budokai 3
  • Xdqwerty @ Xdqwerty:
    updated ship of harkinian, gonna install some hd texture pack
  • Xdqwerty @ Xdqwerty:
    I might download rayman revolution for my ps3
  • BigOnYa @ BigOnYa:
    I may try the new ram site, and download more RAM to my Switch. Not sure if ddr3 is the right ram
    for it tho. Edit- no it uses floppy Ram, just like @AncientBoi
    +1
  • Xdqwerty @ Xdqwerty:
    aeiou
  • BigOnYa @ BigOnYa:
    And sometimes Z
  • SylverReZ @ SylverReZ:
    @K3Nv2, MAGA supporters be wearing tin foil hats lol.
    +1
  • Xdqwerty @ Xdqwerty:
    @SylverReZ, whats maga?
  • BigOnYa @ BigOnYa:
    It stands for Maniacs Against General Acceptance
    +1
  • Xdqwerty @ Xdqwerty:
    @BigOnYa, people rejecting general consensus about stuff?
    +1
  • BigOnYa @ BigOnYa:
    Yup, nuh its really just Trump followers
  • Xdqwerty @ Xdqwerty:
    @BigOnYa, im not american so i dont care about trump
    +1
  • Xdqwerty @ Xdqwerty:
    or us elections
  • BigOnYa @ BigOnYa:
    Me niether, us north Koreans don't care
  • Xdqwerty @ Xdqwerty:
    good night
  • BakerMan @ BakerMan:
    i don't care either, even if i'm american
  • BakerMan @ BakerMan:
    truth be told, i agree with psi, i dislike both candidates, but i'd probably vote trump simply because the economy was better during his presidency
  • AngryCinnabon @ AngryCinnabon:
    Just be careful, if trump ends up winning and using project 2025 America might really change...for the worse.
  • AngryCinnabon @ AngryCinnabon:
    I'm not american and even that sends shivers down my spine.
  • AngryCinnabon @ AngryCinnabon:
    anything that offers trump an opportunity to become an actual dictator
    is bad in my book, i could care less if it wasn't for that...
  • K3Nv2 @ K3Nv2:
    Canada: America's Russia
  • NinStar @ NinStar:
    people are so dramatic that I can't even tell if they are being serious
    NinStar @ NinStar: people are so dramatic that I can't even tell if they are being serious