• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

[ASM & Hex] Three-channel music bank switcher

RoadToCerulean

A Ordinary Kanto Lover
205
Posts
7
Years
  • I have read Jambo51's development of GB player on FR on this thread:
    https://www.pokecommunity.com/showthread.php?t=257647
    This is his original code (slightly modified and organized), switching music banks between 0x4A32CC and 0x800000:
    Code:
    .text
    .align 2
    .thumb
    .thumb_func
    .global gameboyplayerbackgroundroutine
    main:
     add r3, r2, #0x4
     ldr r2, ramtable
     push {r0,r2-r7}
     ldr r0, flag
     bl decrypt
     add r1, r0, #0x0
     pop {r0,r2-r7}
     cmp r1, #0x0
     bne gbp
     ldr r1, normaltable
     b exit
    gbp: 
     ldr r1, gbptable
    exit: 
     lsr r0, r0, #0xD
     add r0, r0, r1
     mov pc, r3
    decrypt:
     ldr r1, decry
     bx r1
    .align
    ramtable:     .word 0x084A329C
    normaltable:  .word 0x084A32CC
    gbptable:     .word 0x08800000        @Originally 0x08FFFFFF
    flag:         .word 0x000008F0
    decry:        .word 0x0806E6D1

    Since I am a rookie in ASM hacking, could someone tell me how to modify the codes to upgrade it to switch between 3 music banks?
     
    Back
    Top