diff options
| author | Rangi <remy.oukaour+rangi42@gmail.com> | 2020-11-04 15:16:20 -0500 |
|---|---|---|
| committer | Rangi <remy.oukaour+rangi42@gmail.com> | 2020-11-04 19:44:31 -0500 |
| commit | aae999f72bd81a3156c7e00da4ebf499f52da5a6 (patch) | |
| tree | 32fef70a31af3a0b5ad2b0d34042c312574fb42d /home/cgb_palettes.asm | |
| parent | Merge branch 'master' of https://github.com/pret/pokered (diff) | |
| download | pokeyellow-aae999f72bd81a3156c7e00da4ebf499f52da5a6.tar.gz pokeyellow-aae999f72bd81a3156c7e00da4ebf499f52da5a6.tar.xz pokeyellow-aae999f72bd81a3156c7e00da4ebf499f52da5a6.zip | |
Start reorganizing pokeyellow
Diffstat (limited to 'home/cgb_palettes.asm')
| -rw-r--r-- | home/cgb_palettes.asm | 81 |
1 files changed, 81 insertions, 0 deletions
diff --git a/home/cgb_palettes.asm b/home/cgb_palettes.asm new file mode 100644 index 00000000..24738ae2 --- /dev/null +++ b/home/cgb_palettes.asm @@ -0,0 +1,81 @@ +UpdateGBCPal_BGP:: + push af + ldh a, [hGBC] + and a + jr z, .notGBC + push bc + push de + push hl + ldh a, [rBGP] + ld b, a + ld a, [wLastBGP] + cp b + jr z, .noChangeInBGP + farcall _UpdateGBCPal_BGP +.noChangeInBGP + pop hl + pop de + pop bc +.notGBC + pop af + ret + +UpdateGBCPal_OBP0:: + push af + ldh a, [hGBC] + and a + jr z, .notGBC + push bc + push de + push hl + ldh a, [rOBP0] + ld b, a + ld a, [wLastOBP0] + cp b + jr z, .noChangeInOBP0 + ld b, BANK(_UpdateGBCPal_OBP) + ld hl, _UpdateGBCPal_OBP + ld c, CONVERT_OBP0 + call Bankswitch +.noChangeInOBP0 + pop hl + pop de + pop bc +.notGBC + pop af + ret + +UpdateGBCPal_OBP1:: + push af + ldh a, [hGBC] + and a + jr z, .notGBC + push bc + push de + push hl + ldh a, [rOBP1] + ld b, a + ld a, [wLastOBP1] + cp b + jr z, .noChangeInOBP1 + ld b, BANK(_UpdateGBCPal_OBP) + ld hl, _UpdateGBCPal_OBP + ld c, CONVERT_OBP1 + call Bankswitch +.noChangeInOBP1 + pop hl + pop de + pop bc +.notGBC + pop af + ret + +Func_3082:: + ldh a, [hLoadedROMBank] + push af + call FadeOutAudio + callbs Music_DoLowHealthAlarm + callbs Audio1_UpdateMusic + pop af + call BankswitchCommon + ret |
