Skip to content

Commit

Permalink
Use rgblink -w to have one $2000-byte WRAM0 region
Browse files Browse the repository at this point in the history
  • Loading branch information
Rangi42 committed May 31, 2021
1 parent 1caab64 commit fa4ed9e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 43 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ pokeyellow_debug_pad = 0xff
opts = -cjsv -k 01 -l 0x33 -m 0x1b -p 0 -r 03 -t "POKEMON YELLOW"

%.gbc: $$(%_obj) layout.link
$(RGBLINK) -p $($*_pad) -m $*.map -n $*.sym -l layout.link -o $@ $(filter %.o,$^)
$(RGBLINK) -p $($*_pad) -w -m $*.map -n $*.sym -l layout.link -o $@ $(filter %.o,$^)
$(RGBFIX) -p $($*_pad) $(opts) $@


Expand Down
2 changes: 0 additions & 2 deletions layout.link
Original file line number Diff line number Diff line change
Expand Up @@ -235,8 +235,6 @@ WRAM0
"Tilemap"
"Overworld Map"
"WRAM"
WRAMX $1
"WRAM Bank 1"
"Party Data"
"Main Data"
"Current Box Data"
Expand Down
46 changes: 6 additions & 40 deletions wram.asm
Original file line number Diff line number Diff line change
Expand Up @@ -1322,41 +1322,7 @@ wBattleMonSpecies2:: db

wEnemyMonNick:: ds NAME_LENGTH

wEnemyMon::
; The wEnemyMon struct reaches past 0xcfff,
; the end of wram bank 0 on cgb.
; This has no significance on dmg, where wram
; isn't banked (c000-dfff is contiguous).
; However, recent versions of rgbds have replaced
; dmg-style wram with cgb wram banks.

; Until this is fixed, this struct will have
; to be declared manually.

wEnemyMonSpecies:: db
wEnemyMonHP:: dw
wEnemyMonPartyPos::
wEnemyMonBoxLevel:: db
wEnemyMonStatus:: db
wEnemyMonType::
wEnemyMonType1:: db
wEnemyMonType2:: db
wEnemyMonCatchRate_NotReferenced:: db
wEnemyMonMoves:: ds NUM_MOVES
wEnemyMonDVs:: ds 2
wEnemyMonLevel:: db
wEnemyMonMaxHP:: dw
wEnemyMonAttack:: dw
wEnemyMonDefense:: dw
wEnemyMonSpeed:: dw
wEnemyMonSpecial:: dw
wEnemyMonPP:: ds 3 ; NUM_MOVES - 1


SECTION "WRAM Bank 1", WRAMX

; continuing wEnemyMon from the previous section
ds 1 ; NUM_MOVES - 3
wEnemyMon:: battle_struct wEnemyMon

wEnemyMonBaseStats:: ds NUM_STATS
wEnemyMonActualCatchRate:: db
Expand Down Expand Up @@ -1877,7 +1843,7 @@ wSavedNPCMovementDirections2Index:: db
wPlayerName:: ds NAME_LENGTH


SECTION "Party Data", WRAMX
SECTION "Party Data", WRAM0

wPartyDataStart::

Expand Down Expand Up @@ -1906,7 +1872,7 @@ wPartyMonNicksEnd::
wPartyDataEnd::


SECTION "Main Data", WRAMX
SECTION "Main Data", WRAM0

wMainDataStart::

Expand Down Expand Up @@ -2555,7 +2521,7 @@ wDayCareMon:: box_struct wDayCareMon
wMainDataEnd::


SECTION "Current Box Data", WRAMX
SECTION "Current Box Data", WRAM0

wBoxDataStart::

Expand Down Expand Up @@ -2584,7 +2550,7 @@ wBoxMonNicksEnd::
wBoxDataEnd::


SECTION "GBC Palette Data", WRAMX
SECTION "GBC Palette Data", WRAM0

wGBCBasePalPointers:: ds NUM_ACTIVE_PALS * 2
wGBCPal:: ds PALETTE_SIZE
Expand All @@ -2595,7 +2561,7 @@ wdef5:: db
wBGPPalsBuffer:: ds NUM_ACTIVE_PALS * PALETTE_SIZE


SECTION "Stack", WRAMX
SECTION "Stack", WRAM0

; the stack grows downward
ds $eb - 1
Expand Down

0 comments on commit fa4ed9e

Please sign in to comment.