Skip to content

Commit 75faef1

Browse files
committed
feat(gfx): screen dressing (phase 7)
Chart gets a SEA CHART header with compass-rose tiles and parchment margins flanking the grid; the title screen gets two gulls over the horizon; port screens get a thin rule frame. New glyph tiles 134-136 (compass/gull/rule), mapped to the UI palette.
1 parent ff660ee commit 75faef1

5 files changed

Lines changed: 101 additions & 0 deletions

File tree

src/defs.inc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,11 @@ DEF TILE_SAND_GR25 EQU 131 ; sand 75 / grass 25 (e 154-155)
131131
DEF TILE_SAND_GR50 EQU 132 ; sand/grass 50/50 (e 156-157, 160-161)
132132
DEF TILE_GR_SAND25 EQU 133 ; grass 75 / sand 25 (e 158-159)
133133

134+
; --- Screen-dressing glyphs (phase 7) ---
135+
DEF TILE_COMPASS EQU 134 ; compass rose (chart header)
136+
DEF TILE_GULL EQU 135 ; gull arcs (title screen)
137+
DEF TILE_FRAME EQU 136 ; thin rule (port screen frame)
138+
134139
; --- Port towns (S4) ---
135140
; In a port district, four buildings spawn at hashed spots: tavern,
136141
; market, shipyard, harbor. Each opens the matching port screen.

src/main.asm

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -744,6 +744,10 @@ DrawTitleScreen::
744744
; a lone ship on the horizon
745745
ld a, TILE_SHIP_S
746746
ld [$9800 + 13 * 32 + 9], a
747+
; gulls overhead
748+
ld a, TILE_GULL
749+
ld [$9800 + 2 * 32 + 3], a
750+
ld [$9800 + 2 * 32 + 15], a
747751
ld hl, StrTitle
748752
ld de, $9800 + 4 * 32 + 3
749753
call PrintStr

src/port.asm

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -501,6 +501,21 @@ EnterPortFromShore::
501501
; Full re-render of the port screen (LCD off).
502502
RenderPort:
503503
call DrawSeedScreen ; clear tilemap
504+
; thin frame: a rule across the top and bottom rows
505+
ld hl, $9800
506+
ld b, 20
507+
.topRule
508+
ld [hl], TILE_FRAME
509+
inc hl
510+
dec b
511+
jr nz, .topRule
512+
ld hl, $9800 + 17 * 32
513+
ld b, 20
514+
.botRule
515+
ld [hl], TILE_FRAME
516+
inc hl
517+
dec b
518+
jr nz, .botRule
504519
; port name, row 1
505520
ld de, $9800 + 1 * 32 + 3
506521
call PrintPortName

src/tiles.asm

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,10 @@ LoadTiles::
5555
ld de, $8000 + 121 * 16
5656
ld bc, 4 * 16
5757
call CopyVRAM
58+
ld hl, ScreenTiles
59+
ld de, $8000 + 134 * 16
60+
ld bc, 3 * 16
61+
call CopyVRAM
5862
; --- synthesize the transition tiles (Bayer-dither mixes) ---
5963
ld hl, TerrainTiles + 16 ; DEEP
6064
ld de, TerrainTiles + 32 ; SHALLOW
@@ -975,6 +979,36 @@ VariantTiles:
975979
dw `33333333
976980
dw `33333333
977981

982+
; tiles 134-136: screen-dressing glyphs
983+
ScreenTiles:
984+
; 134 TILE_COMPASS — four-point star (white & ink on parchment)
985+
dw `00030000
986+
dw `00033000
987+
dw `13030030
988+
dw `13333331
989+
dw `13030030
990+
dw `00033000
991+
dw `00030000
992+
dw `00000000
993+
; 135 TILE_GULL — two soaring arcs
994+
dw `00000000
995+
dw `00000000
996+
dw `00300300
997+
dw `03033030
998+
dw `00000000
999+
dw `00000000
1000+
dw `00000000
1001+
dw `00000000
1002+
; 136 TILE_FRAME — a single dark rule mid-tile
1003+
dw `00000000
1004+
dw `00000000
1005+
dw `33333333
1006+
dw `00000000
1007+
dw `00000000
1008+
dw `00000000
1009+
dw `00000000
1010+
dw `00000000
1011+
9781012
HexFont:
9791013
; 3x5 pixel glyphs, top-left of the tile. 16 tiles: 0-9, A-F.
9801014
; NOTE: A-F exist twice — here (tiles 26-31, so hex nibbles print as

src/world.asm

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1634,8 +1634,50 @@ ChartSeed:
16341634

16351635
PUSHS "Chart strings", ROMX, BANK[3]
16361636
StrCartDone: db "CHART COMPLETE! 500G", 0
1637+
StrSeaChart: db "SEA CHART", 0
16371638
POPS
16381639

1640+
; Dress the chart: "SEA CHART" header with compass roses, and parchment
1641+
; margins flanking the 16x16 grid. LCD off. clobbers a, b, d, e, h, l
1642+
ChartFrame:
1643+
ld hl, StrSeaChart
1644+
ld de, $9800 + 5
1645+
call PrintStr
1646+
ld a, TILE_COMPASS
1647+
ld [$9800 + 3], a
1648+
ld [$9800 + 15], a
1649+
; parchment margins: cols 0-1 and 18-19, rows 1-17
1650+
ld e, 1 ; row
1651+
.rowLoop
1652+
ld a, e
1653+
call MapRowAddr ; hl = row base
1654+
call .putSand ; col 0
1655+
inc hl
1656+
call .putSand ; col 1
1657+
ld a, l
1658+
add 16
1659+
ld l, a ; col 18
1660+
call .putSand
1661+
inc hl
1662+
call .putSand ; col 19
1663+
inc e
1664+
ld a, e
1665+
cp 18
1666+
jr nz, .rowLoop
1667+
ret
1668+
.putSand
1669+
ld [hl], TILE_SAND
1670+
push hl
1671+
ld a, [wIsCGB]
1672+
cp $11
1673+
jr nz, .psNo
1674+
VBK1
1675+
ld [hl], 2 ; sand palette
1676+
VBK0
1677+
.psNo
1678+
pop hl
1679+
ret
1680+
16391681
; Clear all 40 OAM entries. LCD must be off.
16401682
ClearOAM::
16411683
ld hl, $FE00
@@ -1655,6 +1697,7 @@ EnterChart::
16551697
call RenderChart
16561698
call ChartMarker
16571699
call ChartSeed
1700+
call ChartFrame
16581701
call ChartBounty
16591702
ld a, LCDC_ON | LCDC_BG_ON | LCDC_BLOCK01 | LCDC_OBJ_ON
16601703
ldh [rLCDC], a

0 commit comments

Comments
 (0)