diff options
author | Astatin <[email protected]> | 2024-10-31 17:41:13 +0900 |
---|---|---|
committer | Astatin <[email protected]> | 2024-10-31 17:41:13 +0900 |
commit | d5c723c063e3cbe15f8a8ec8d241496dcd2bfbf7 (patch) | |
tree | 8b067f9b3010c967fc36580888081093076c1218 | |
parent | 0a203e404468bb0822657d309ca8168bae2fd24b (diff) |
Add bold/slim font palette + top bar border
-rw-r--r-- | definitions.gbasm | 2 | ||||
-rw-r--r-- | dialogues.gbasm | 6 | ||||
-rw-r--r-- | init.gbasm | 14 | ||||
-rw-r--r-- | main.gbasm | 15 | ||||
-rw-r--r-- | scripts/generate-tiledata.py | 6 | ||||
-rw-r--r-- | sprites/font.png | bin | 403 -> 418 bytes | |||
-rw-r--r-- | sprites/gui/borders.png | bin | 0 -> 169 bytes | |||
-rw-r--r-- | tiles.gbasm | 29 | ||||
-rw-r--r-- | tileset.gbasm | 96 |
9 files changed, 95 insertions, 73 deletions
diff --git a/definitions.gbasm b/definitions.gbasm index 079e457..deb9789 100644 --- a/definitions.gbasm +++ b/definitions.gbasm @@ -4,6 +4,8 @@ .DEFINE reg_lyc ($45) .DEFINE reg_viewport_y ($42) .DEFINE reg_viewport_x ($43) +.DEFINE reg_window_pos_y ($4a) +.DEFINE reg_window_pos_x ($4b) .DEFINE reg_bg_palette ($47) .DEFINE reg_obj0_palette ($48) .DEFINE reg_interrupt_enable ($ff) diff --git a/dialogues.gbasm b/dialogues.gbasm index 71054d2..908975a 100644 --- a/dialogues.gbasm +++ b/dialogues.gbasm @@ -1,8 +1,6 @@ Lain_Text: .DB 0x95, 0x8a, 0x92, 0x97, 0x0, 0x92, 0x9c, 0x0, 0x8c, 0x9e, 0x9d, 0x8e, 0xa5, 0xff Owl_Text: -.DB 0x98, 0xa0, 0x95, 0x0, 0x92, 0x9c, 0x0, 0x8c, 0x9e, 0x9d, 0x8e, 0xa4, 0xff +.DB 0x98, 0xa0, 0x95, 0x0, 0x92, 0x9c, 0x0, 0x8c, 0x9e, 0x9d, 0x8e, 0xa5, 0xff Auz_Text: -.DB 0xa0, 0x92, 0x9d, 0x8c, 0x91, 0x0, 0x92, 0x9c, 0x0, 0x8c, 0x9e, 0x9d, 0x8e, 0xa7, 0xff -Astatin_Text: -.DB 0x96, 0x8e, 0xaa, 0x0, 0xa9, 0x92, 0xa8, 0x96, 0x0, 0x97, 0x98, 0x9d, 0x0, 0x8c, 0x9e, 0x9d, 0x8e, 0xa9, 0xff +.DB 0xa0, 0x92, 0x9d, 0x8c, 0x91, 0x0, 0x92, 0x9c, 0x0, 0x8c, 0x9e, 0x9d, 0x8e, 0xa5, 0xff @@ -71,6 +71,20 @@ Empty_VRAM: ; (Clear screen) LD A, $40 LD $reg_lcd_status, A + ; Window position + LD A, $ff + LD $reg_window_pos_x, A + +Initialize_Window_GUI: + LD HL, $9c20 + Initialize_Window_GUI.loop: + LD A, $10 + LD (HL+), A + + LD A, L + CP $40 + JR NZ, =Initialize_Window_GUI.loop + Copy_OAM_DMA_Transfer_Routine_To_HRAM: LD HL, $OAM_DMA_Transfer_routine LD DE, =OAM_DMA_Transfer_routine_src @@ -37,17 +37,18 @@ VBLANK_Entrypoint: CALL =Print_8bit LD A, $68 - LD (HL+), A - - INC HL - - LD BC, =Astatin_Text - CALL =Print_str + LD (HL), A CALL =Display_Prepared_Block CALL =Display_Object CALL $OAM_DMA_Transfer_routine + ; BOLD FONT + LD A, $f4 + ; SLIM FONT + ; LD A, $c4 + LD $reg_bg_palette, A + LD A, $mem_prepared_viewport_x LD B, A LD A, $mem_prepared_viewport_y @@ -65,6 +66,8 @@ STAT_Entrypoint: LD $reg_viewport_x, A LD A, C LD $reg_viewport_y, A + LD A, $e4 + LD $reg_bg_palette, A CALL =Object_Interactions_Check diff --git a/scripts/generate-tiledata.py b/scripts/generate-tiledata.py index 720191f..d3ee127 100644 --- a/scripts/generate-tiledata.py +++ b/scripts/generate-tiledata.py @@ -10,6 +10,10 @@ def get_sprite_png_parse_output(png, tallmode=False, sprite_1bpp_mode=False): print("\t{} ; 0x{:02x}".format(r, sprite_idx)) sprite_idx += 1 +sprite_idx = 0x10 +print("GUI_Border_Data:") +get_sprite_png_parse_output("./sprites/gui/borders.png") + sprite_idx = 0x20 print("BG_Tile_Image_Data:") print("\n\t; Trees") @@ -25,7 +29,7 @@ get_sprite_png_parse_output("./sprites/bg/heart.png") sprite_idx = 0x80 print("\nFont_Data:") -get_sprite_png_parse_output("./sprites/font.png", sprite_1bpp_mode=True) +get_sprite_png_parse_output("./sprites/font.png") sprite_idx = 0x02 print("\nOBJ_Tile_Image_Data:") diff --git a/sprites/font.png b/sprites/font.png Binary files differindex 890781b..ea05ca9 100644 --- a/sprites/font.png +++ b/sprites/font.png diff --git a/sprites/gui/borders.png b/sprites/gui/borders.png Binary files differnew file mode 100644 index 0000000..cba5872 --- /dev/null +++ b/sprites/gui/borders.png diff --git a/tiles.gbasm b/tiles.gbasm index fbe6fdc..9cfce67 100644 --- a/tiles.gbasm +++ b/tiles.gbasm @@ -3,27 +3,18 @@ Load_Tile: LD DE, =OBJ_Tile_Image_Data LD BC, $0280 CALL =memcpy - CALL =Load_Number_Font + LD HL, $8800 + LD DE, =Font_Data + LD BC, $2b0 + CALL =memcpy + + LD HL, $9100 + LD DE, =GUI_Border_Data + LD BC, $0090 + CALL =memcpy + LD HL, $9200 LD DE, =BG_Tile_Image_Data LD BC, $0490 CALL =memcpy RET - -Load_Number_Font: ; Load number font into the tilemap at tiles 0x10-0x1f - LD HL, $8800 - LD DE, =Font_Data - LD BC, $0158 - - Load_Number_Font.loop: - LD A, (DE) - LD (HL+), A - LD (HL+), A - INC DE - DEC BC - XOR A - CP B - JR NZ, =Load_Number_Font.loop - CP C - JR NZ, =Load_Number_Font.loop - RET diff --git a/tileset.gbasm b/tileset.gbasm index 7e4b09e..f872563 100644 --- a/tileset.gbasm +++ b/tileset.gbasm @@ -1,3 +1,13 @@ +GUI_Border_Data: + .DB $ff, $00, $ff, $ff, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00 ; 0x10 + .DB $00, $00, $1f, $1f, $3f, $20, $70, $40, $60, $40, $60, $40, $60, $40, $60, $40 ; 0x11 + .DB $60, $40, $60, $40, $60, $40, $60, $40, $70, $40, $3f, $20, $1f, $1f, $00, $00 ; 0x12 + .DB $00, $00, $f8, $f8, $fc, $04, $0e, $02, $06, $02, $06, $02, $06, $02, $06, $02 ; 0x13 + .DB $06, $02, $06, $02, $06, $02, $06, $02, $0e, $02, $fc, $04, $f8, $f8, $00, $00 ; 0x14 + .DB $60, $40, $60, $40, $60, $40, $60, $40, $60, $40, $60, $40, $60, $40, $60, $40 ; 0x15 + .DB $06, $02, $06, $02, $06, $02, $06, $02, $06, $02, $06, $02, $06, $02, $06, $02 ; 0x16 + .DB $00, $00, $ff, $ff, $ff, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00 ; 0x17 + .DB $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $ff, $00, $ff, $ff, $00, $00 ; 0x18 BG_Tile_Image_Data: ; Trees @@ -83,49 +93,49 @@ Small_sprites: .DB $00, $00, $6c, $6c, $fe, $fe, $fe, $fe, $7c, $7c, $38, $38, $10, $10, $00, $00 ; 0x68 Font_Data: - .DB $00, $3c, $46, $46, $46, $46, $3c, $00 ; 0x80 - .DB $00, $18, $38, $18, $18, $18, $7e, $00 ; 0x81 - .DB $00, $3c, $46, $06, $1c, $30, $7e, $00 ; 0x82 - .DB $00, $7c, $06, $3c, $06, $06, $7c, $00 ; 0x83 - .DB $00, $0c, $1c, $2c, $4c, $7e, $0c, $00 ; 0x84 - .DB $00, $7c, $40, $7c, $06, $06, $7c, $00 ; 0x85 - .DB $00, $3c, $40, $7c, $46, $46, $3c, $00 ; 0x86 - .DB $00, $7e, $06, $0c, $18, $18, $18, $00 ; 0x87 - .DB $00, $3c, $46, $3c, $46, $46, $3c, $00 ; 0x88 - .DB $00, $3c, $46, $46, $3e, $06, $3c, $00 ; 0x89 - .DB $00, $3c, $46, $46, $7e, $46, $46, $00 ; 0x8a - .DB $00, $7c, $46, $7c, $46, $46, $7c, $00 ; 0x8b - .DB $00, $3e, $60, $60, $60, $60, $3e, $00 ; 0x8c - .DB $00, $7c, $46, $46, $46, $46, $7c, $00 ; 0x8d - .DB $00, $7e, $60, $78, $60, $60, $7e, $00 ; 0x8e - .DB $00, $7e, $60, $78, $60, $60, $60, $00 ; 0x8f - .DB $00, $3e, $60, $60, $66, $62, $3e, $00 ; 0x90 - .DB $00, $46, $46, $7e, $46, $46, $46, $00 ; 0x91 - .DB $00, $3c, $18, $18, $18, $18, $3c, $00 ; 0x92 - .DB $00, $1e, $0c, $0c, $0c, $4c, $38, $00 ; 0x93 - .DB $00, $66, $6c, $78, $78, $6c, $66, $00 ; 0x94 - .DB $00, $60, $60, $60, $60, $60, $7e, $00 ; 0x95 - .DB $00, $46, $6e, $56, $46, $46, $46, $00 ; 0x96 - .DB $00, $46, $66, $56, $4e, $46, $46, $00 ; 0x97 - .DB $00, $3c, $46, $46, $46, $46, $3c, $00 ; 0x98 - .DB $00, $7c, $46, $46, $7c, $40, $40, $00 ; 0x99 - .DB $00, $3c, $46, $46, $56, $4e, $3c, $02 ; 0x9a - .DB $00, $7c, $46, $46, $7c, $46, $46, $00 ; 0x9b - .DB $00, $3e, $60, $3c, $06, $06, $7c, $00 ; 0x9c - .DB $00, $7e, $18, $18, $18, $18, $18, $00 ; 0x9d - .DB $00, $46, $46, $46, $46, $46, $3c, $00 ; 0x9e - .DB $00, $46, $46, $46, $2c, $2c, $18, $00 ; 0x9f - .DB $00, $46, $46, $56, $56, $56, $3c, $00 ; 0xa0 - .DB $00, $46, $2c, $18, $18, $2c, $46, $00 ; 0xa1 - .DB $00, $46, $46, $3c, $18, $18, $18, $00 ; 0xa2 - .DB $00, $7e, $06, $0c, $18, $30, $7e, $00 ; 0xa3 - .DB $00, $00, $00, $00, $00, $18, $18, $00 ; 0xa4 - .DB $00, $18, $18, $18, $18, $00, $18, $00 ; 0xa5 - .DB $00, $3c, $66, $06, $1c, $00, $18, $00 ; 0xa6 - .DB $00, $00, $00, $00, $00, $18, $08, $00 ; 0xa7 - .DB $00, $18, $18, $30, $00, $00, $00, $00 ; 0xa8 - .DB $00, $2c, $2c, $2c, $00, $00, $00, $00 ; 0xa9 - .DB $00, $18, $18, $00, $00, $18, $18, $00 ; 0xaa + .DB $00, $00, $38, $3c, $44, $46, $44, $46, $44, $46, $44, $46, $38, $3c, $00, $00 ; 0x80 + .DB $00, $00, $10, $18, $30, $38, $10, $18, $10, $18, $10, $18, $7c, $7e, $00, $00 ; 0x81 + .DB $00, $00, $38, $3c, $44, $46, $04, $06, $18, $1c, $20, $30, $7c, $7e, $00, $00 ; 0x82 + .DB $00, $00, $78, $7c, $04, $06, $38, $3c, $04, $06, $04, $06, $78, $7c, $00, $00 ; 0x83 + .DB $00, $00, $08, $0c, $18, $1c, $28, $2c, $48, $4c, $7c, $7e, $08, $0c, $00, $00 ; 0x84 + .DB $00, $00, $78, $7c, $40, $40, $78, $7c, $04, $06, $04, $06, $78, $7c, $00, $00 ; 0x85 + .DB $00, $00, $38, $3c, $40, $40, $78, $7c, $44, $46, $44, $46, $38, $3c, $00, $00 ; 0x86 + .DB $00, $00, $7c, $7e, $04, $06, $08, $0c, $10, $18, $10, $18, $10, $18, $00, $00 ; 0x87 + .DB $00, $00, $38, $3c, $44, $46, $38, $3c, $44, $46, $44, $46, $38, $3c, $00, $00 ; 0x88 + .DB $00, $00, $38, $3c, $44, $46, $44, $46, $3c, $3e, $04, $06, $38, $3c, $00, $00 ; 0x89 + .DB $00, $00, $38, $3c, $44, $46, $44, $46, $7c, $7e, $44, $46, $44, $46, $00, $00 ; 0x8a + .DB $00, $00, $78, $7c, $44, $46, $78, $7c, $44, $46, $44, $46, $78, $7c, $00, $00 ; 0x8b + .DB $00, $00, $3c, $3e, $40, $60, $40, $60, $40, $60, $40, $60, $3c, $3e, $00, $00 ; 0x8c + .DB $00, $00, $78, $7c, $44, $46, $44, $46, $44, $46, $44, $46, $78, $7c, $00, $00 ; 0x8d + .DB $00, $00, $7c, $7e, $40, $60, $70, $78, $40, $60, $40, $60, $7c, $7e, $00, $00 ; 0x8e + .DB $00, $00, $7c, $7e, $40, $60, $70, $78, $40, $60, $40, $60, $40, $60, $00, $00 ; 0x8f + .DB $00, $00, $3c, $3e, $40, $60, $40, $60, $46, $66, $42, $62, $3c, $3e, $00, $00 ; 0x90 + .DB $00, $00, $44, $46, $44, $46, $7c, $7e, $44, $46, $44, $46, $44, $46, $00, $00 ; 0x91 + .DB $00, $00, $38, $3c, $10, $18, $10, $18, $10, $18, $10, $18, $38, $3c, $00, $00 ; 0x92 + .DB $00, $00, $1c, $1e, $08, $0c, $08, $0c, $08, $0c, $48, $4c, $30, $38, $00, $00 ; 0x93 + .DB $00, $00, $44, $66, $48, $6c, $50, $78, $70, $78, $48, $6c, $44, $66, $00, $00 ; 0x94 + .DB $00, $00, $40, $60, $40, $60, $40, $60, $40, $60, $40, $60, $7c, $7e, $00, $00 ; 0x95 + .DB $00, $00, $44, $46, $6c, $6e, $54, $56, $44, $46, $44, $46, $44, $46, $00, $00 ; 0x96 + .DB $00, $00, $44, $46, $64, $66, $54, $56, $4c, $4e, $44, $46, $44, $46, $00, $00 ; 0x97 + .DB $00, $00, $38, $3c, $44, $46, $44, $46, $44, $46, $44, $46, $38, $3c, $00, $00 ; 0x98 + .DB $00, $00, $78, $7c, $44, $46, $44, $46, $78, $7c, $40, $40, $40, $40, $00, $00 ; 0x99 + .DB $00, $00, $38, $3c, $44, $46, $44, $46, $54, $56, $4c, $4e, $3c, $3c, $00, $02 ; 0x9a + .DB $00, $00, $78, $7c, $44, $46, $44, $46, $78, $7c, $44, $46, $44, $46, $00, $00 ; 0x9b + .DB $00, $00, $3c, $3e, $60, $60, $38, $3c, $04, $06, $04, $06, $78, $7c, $00, $00 ; 0x9c + .DB $00, $00, $7c, $7e, $10, $18, $10, $18, $10, $18, $10, $18, $10, $18, $00, $00 ; 0x9d + .DB $00, $00, $44, $46, $44, $46, $44, $46, $44, $46, $44, $46, $38, $3c, $00, $00 ; 0x9e + .DB $00, $00, $44, $46, $44, $46, $44, $46, $28, $2c, $28, $2c, $10, $18, $00, $00 ; 0x9f + .DB $00, $00, $44, $46, $44, $46, $44, $56, $54, $56, $54, $56, $38, $3c, $00, $00 ; 0xa0 + .DB $00, $00, $44, $46, $28, $2c, $10, $18, $10, $18, $28, $2c, $44, $46, $00, $00 ; 0xa1 + .DB $00, $00, $44, $46, $44, $46, $38, $3c, $10, $18, $10, $18, $10, $18, $00, $00 ; 0xa2 + .DB $00, $00, $7c, $7e, $04, $06, $08, $0c, $10, $18, $20, $30, $7c, $7e, $00, $00 ; 0xa3 + .DB $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $18, $10, $18, $00, $00 ; 0xa4 + .DB $00, $00, $10, $18, $10, $18, $10, $18, $10, $18, $00, $00, $10, $18, $00, $00 ; 0xa5 + .DB $00, $00, $18, $3c, $24, $66, $04, $06, $18, $1c, $00, $00, $10, $18, $00, $00 ; 0xa6 + .DB $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $10, $18, $08, $08, $00, $00 ; 0xa7 + .DB $00, $00, $10, $18, $10, $18, $20, $30, $00, $00, $00, $00, $00, $00, $00, $00 ; 0xa8 + .DB $00, $00, $28, $2c, $28, $2c, $28, $2c, $00, $00, $00, $00, $00, $00, $00, $00 ; 0xa9 + .DB $00, $00, $00, $18, $10, $18, $00, $00, $00, $00, $10, $18, $00, $18, $00, $00 ; 0xaa OBJ_Tile_Image_Data: |