-
Notifications
You must be signed in to change notification settings - Fork 95
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #133 from ElectroDeoxys/master
Split bank 7
- Loading branch information
Showing
8 changed files
with
271 additions
and
271 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
Func_1c865: | ||
ret | ||
|
||
; debug function | ||
; adjusts hSCX and hSCY by using the arrow keys | ||
; pressing B makes it scroll faster | ||
Func_1c866: ; unreferenced | ||
ldh a, [hKeysHeld] | ||
and B_BUTTON | ||
call nz, .asm_1c86d ; executes following part twice | ||
.asm_1c86d | ||
ldh a, [hSCX] | ||
ld b, a | ||
ldh a, [hSCY] | ||
ld c, a | ||
ldh a, [hKeysHeld] | ||
bit D_UP_F, a | ||
jr z, .check_d_down | ||
inc c | ||
.check_d_down | ||
bit D_DOWN_F, a | ||
jr z, .check_d_left | ||
dec c | ||
.check_d_left | ||
bit D_LEFT_F, a | ||
jr z, .check_d_right | ||
inc b | ||
.check_d_right | ||
bit D_RIGHT_F, a | ||
jr z, .asm_1c889 | ||
dec b | ||
.asm_1c889 | ||
ld a, b | ||
ldh [hSCX], a | ||
ld a, c | ||
ldh [hSCY], a | ||
ret | ||
|
||
; sets some flags on a given sprite | ||
Func_1c890: ; unreferenced | ||
ld a, [wVBlankCounter] | ||
and %111111 | ||
ret nz | ||
|
||
ld a, [wd41b] | ||
cp $11 | ||
jr z, .asm_1c8a3 | ||
cp $0e | ||
ret c | ||
cp $10 | ||
ret nc | ||
|
||
; wd41b == $11 || (wd41b >= $0e && wd41b < $10) | ||
.asm_1c8a3 | ||
ld a, [wd41c] | ||
ld [wWhichSprite], a | ||
ld c, SPRITE_ANIM_FLAGS | ||
call GetSpriteAnimBufferProperty | ||
call UpdateRNGSources | ||
and (1 << SPRITE_ANIM_FLAG_X_SUBTRACT) | ||
jr nz, .asm_1c8b9 | ||
res SPRITE_ANIM_FLAG_SPEED, [hl] | ||
jr .asm_1c8bb | ||
.asm_1c8b9 | ||
set SPRITE_ANIM_FLAG_SPEED, [hl] | ||
.asm_1c8bb | ||
ret |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
ClearMasterBeatenList: | ||
push hl | ||
push bc | ||
ld c, $a | ||
ld hl, wMastersBeatenList | ||
xor a | ||
.loop | ||
ld [hli], a | ||
dec c | ||
jr nz, .loop | ||
pop bc | ||
pop hl | ||
ret | ||
|
||
; writes Master in register a to | ||
; first empty slot in wMastersBeatenList | ||
AddMasterBeatenToList: | ||
push hl | ||
push bc | ||
ld b, a | ||
ld c, $a | ||
ld hl, wMastersBeatenList | ||
.loop | ||
ld a, [hl] | ||
or a | ||
jr z, .found_empty_slot | ||
cp b | ||
jr z, .exit | ||
inc hl | ||
dec c | ||
jr nz, .loop | ||
debug_nop | ||
jr .exit | ||
|
||
.found_empty_slot | ||
ld a, b | ||
ld [hl], a | ||
|
||
.exit | ||
pop bc | ||
pop hl | ||
ret | ||
|
||
; iterates all masters and attempts to | ||
; add each of them to wMastersBeatenList | ||
AddAllMastersToMastersBeatenList: | ||
ld a, $01 | ||
.loop | ||
push af | ||
call AddMasterBeatenToList | ||
pop af | ||
inc a | ||
cp $0b | ||
jr c, .loop | ||
ret |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
JumpSetWindowOff: | ||
jp SetWindowOff | ||
|
||
; debug function | ||
; prints player's coordinates by pressing B | ||
; and draws palettes by pressing A | ||
Func_1c003: ; unreferenced | ||
ld a, [wCurMap] | ||
or a | ||
jr z, JumpSetWindowOff | ||
ld a, [wOverworldMode] | ||
cp OWMODE_START_SCRIPT | ||
jr nc, JumpSetWindowOff | ||
|
||
ldh a, [hKeysHeld] | ||
ld b, a | ||
and A_BUTTON | B_BUTTON | ||
cp b | ||
jr nz, JumpSetWindowOff | ||
and B_BUTTON | ||
jr z, JumpSetWindowOff | ||
|
||
ld bc, $20 | ||
ld a, [wPlayerXCoord] | ||
bank1call WriteTwoByteNumberInTxSymbolFormat | ||
ld bc, $320 | ||
ld a, [wPlayerYCoord] | ||
bank1call WriteTwoByteNumberInTxSymbolFormat | ||
ld a, $77 | ||
ldh [hWX], a | ||
ld a, $88 | ||
ldh [hWY], a | ||
|
||
ldh a, [hKeysPressed] | ||
and A_BUTTON | ||
jr z, .skip_load_scene | ||
ld a, SCENE_COLOR_PALETTE | ||
lb bc, 0, 33 | ||
call LoadScene | ||
.skip_load_scene | ||
ldh a, [hKeysHeld] | ||
and A_BUTTON | ||
jr z, .set_wd_on | ||
ld a, $67 | ||
ldh [hWX], a | ||
ld a, $68 | ||
ldh [hWY], a | ||
.set_wd_on | ||
call SetWindowOn | ||
ret |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
; loads data from the map header of wCurMap | ||
LoadMapHeader: | ||
push hl | ||
push bc | ||
push de | ||
ld a, [wCurMap] | ||
add a | ||
ld c, a | ||
add a | ||
add c | ||
ld c, a | ||
ld b, 0 | ||
ld hl, MapHeaders | ||
add hl, bc | ||
ld a, [hli] | ||
ld [wCurTilemap], a | ||
ld a, [hli] | ||
ld c, a ; CGB tilemap variant | ||
ld a, [hli] | ||
ld [wCurMapInitialPalette], a ; always 0? | ||
ld a, [hli] | ||
ld [wCurMapSGBPals], a | ||
ld a, [hli] | ||
ld [wCurMapPalette], a | ||
ld a, [hli] | ||
ld [wDefaultSong], a | ||
|
||
ld a, [wConsole] | ||
cp CONSOLE_CGB | ||
jr nz, .got_tilemap | ||
; use CGB variant, if valid | ||
ld a, c | ||
or a | ||
jr z, .got_tilemap | ||
ld [wCurTilemap], a | ||
.got_tilemap | ||
|
||
pop de | ||
pop bc | ||
pop hl | ||
ret | ||
|
||
INCLUDE "data/map_headers.asm" |
Oops, something went wrong.