git.y1.nz

gbdk-2020

GameBoy Development Kit
download: https://git.y1.nz/archives/gbdk.tar.gz
README | Files | Log | Refs | LICENSE

commit 7f26a1ab846c80ffbb968e0045ffd89a49817be6
parent 371c705f862c49bde17fbae0ad441f216915d52f
Author: Toxa <untoxa@mail.ru>
Date:   Thu,  1 Sep 2022 12:33:28 +0300

minor code style

Diffstat:
DLICENSE35-----------------------------------
Mgbdk-lib/libc/targets/sm83/ap/crt0.s32++++++++++++++++----------------
Mgbdk-lib/libc/targets/sm83/duck/crt0.s22+++++++++++-----------
Mgbdk-lib/libc/targets/sm83/gb/crt0.s26+++++++++++++-------------
Mgbdk-lib/libc/targets/sm83/pad_ex.s6+++---
Mgbdk-lib/libc/targets/z80/gg/global.s2+-
Mgbdk-lib/libc/targets/z80/msxdos/crt0.s26+++++++++++++-------------
7 files changed, 57 insertions(+), 92 deletions(-)

diff --git a/LICENSE b/LICENSE @@ -1,35 +0,0 @@ - - -### Overview of Licenses in GBDK-2020 - -See the relevant licensing files in the LICENSE folder for details on the entries below - - -### GBDK Library & Makefiles: -GPLv2+LE (linking exception). Some files from SDCC, some from the historical GBDK that were originally LGPL and have been relicensed to GPLv2+LE (linking exception) to match the SDCC ones in 2022 by permission of original authors. -- LICENSE_SDCC -- LICENSE_GPLV2_LE - - -### Crash handler in the GBDK Library -MIT License: https://github.com/ISSOtm/gb-starter-kit/ -- LICENSE_crashhandler - - -### makebin: -zlib/libpng License -According to: http://sdcc.sourceforge.net/ - - -### bankpack, ihxcheck, gbcompress, makecom: -Public Domain. @bbbbbr is the original author - - -### png2asset: -MIT License. @Zal0 is the original author + additional contributors - - -### LCC front end / compiler driver: -LCC License, traditionally named as the "CPYRIGHT" file - - diff --git a/gbdk-lib/libc/targets/sm83/ap/crt0.s b/gbdk-lib/libc/targets/sm83/ap/crt0.s @@ -73,7 +73,7 @@ POP HL INC HL JR 1$ -_wait_int_handler:: +_wait_int_handler:: ADD SP,#4 .int_tail: POP DE @@ -96,7 +96,7 @@ __standard_VBL_handler:: INC (HL) 2$: CALL .refresh_OAM - + LD A, #1 LDH (.vbl_done),A RET @@ -130,11 +130,11 @@ _refresh_OAM:: ;; Nintendo logo .org 0x104 - .byte 0x01,0x10,0xCE,0xEF,0x00,0x00,0x44,0xAA - .byte 0x00,0x74,0x00,0x18,0x11,0x95,0x00,0x34 - .byte 0x00,0x1A,0x00,0xD5,0x00,0x22,0x00,0x69 - .byte 0x6F,0xF6,0xF7,0x73,0x09,0x90,0xE1,0x10 - .byte 0x44,0x40,0x9A,0x90,0xD5,0xD0,0x44,0x30 + .byte 0x01,0x10,0xCE,0xEF,0x00,0x00,0x44,0xAA + .byte 0x00,0x74,0x00,0x18,0x11,0x95,0x00,0x34 + .byte 0x00,0x1A,0x00,0xD5,0x00,0x22,0x00,0x69 + .byte 0x6F,0xF6,0xF7,0x73,0x09,0x90,0xE1,0x10 + .byte 0x44,0x40,0x9A,0x90,0xD5,0xD0,0x44,0x30 .byte 0xA9,0x21,0x5D,0x48,0x22,0xE0,0xF8,0x60 ;; Title of the game @@ -174,7 +174,7 @@ _refresh_OAM:: ;; **************************************** .org 0x150 - + ;; soft reset: falldown to .code_start .reset:: _reset:: @@ -265,7 +265,7 @@ _reset:: ;; Call the main function CALL _main -_exit:: +_exit:: 99$: HALT NOP @@ -312,13 +312,13 @@ _set_interrupts:: .area _CODE_0 ;; Constant data .area _LIT -; ;; since _CODE_1 area base address is pre-defined in the linker from 0x4000, +; ;; since _CODE_1 area base address is pre-defined in the linker from 0x4000, ; ;; that moves initializer code and tables out of bank 0 ; .area _CODE_1 ;; Constant data, used to init _DATA .area _INITIALIZER ;; Code, used to init _DATA - .area _GSINIT + .area _GSINIT .area _GSFINAL ;; Uninitialised ram data .area _DATA @@ -344,7 +344,7 @@ _sys_time:: .area _HRAM (ABS) - .org 0xFF90 + .org 0xFF90 __current_bank:: ; Current bank .ds 0x01 .vbl_done: @@ -359,7 +359,7 @@ gsinit:: LD BC, #l__INITIALIZER LD HL, #s__INITIALIZER LD DE, #s__INITIALIZED - call .memcpy_simple + call .memcpy_simple .area _GSFINAL ret @@ -405,7 +405,7 @@ gsinit:: DEC C JR NZ,1$ DEC B - JR NZ,1$ + JR NZ,1$ 4$: RET @@ -493,7 +493,7 @@ _display_off:: LDH A,(.LCDC) AND #LCDCF_ON RET Z ; Return if screen is off -1$: ; We wait for the *NEXT* VBL +1$: ; We wait for the *NEXT* VBL LDH A,(.LY) CP #0x92 ; Smaller than or equal to 0x91? JR NC,1$ ; Loop until smaller than or equal to 0x91 @@ -516,7 +516,7 @@ _remove_VBL:: CALL .remove_VBL POP BC RET - + _add_VBL:: PUSH BC LDA HL, 4(SP) ; Skip return address and registers diff --git a/gbdk-lib/libc/targets/sm83/duck/crt0.s b/gbdk-lib/libc/targets/sm83/duck/crt0.s @@ -74,7 +74,7 @@ POP HL INC HL JR 1$ -_wait_int_handler:: +_wait_int_handler:: ADD SP,#4 .int_tail: POP DE @@ -97,7 +97,7 @@ __standard_VBL_handler:: INC (HL) 2$: CALL .refresh_OAM - + LD A, #1 LDH (.vbl_done),A RET @@ -123,7 +123,7 @@ _refresh_OAM:: RET .org 0x150 - + ;; soft reset: falldown to .code_start .reset:: _reset:: @@ -205,7 +205,7 @@ _reset:: ;; Call the main function CALL _main -_exit:: +_exit:: 99$: HALT NOP @@ -252,13 +252,13 @@ _set_interrupts:: .area _CODE_0 ;; Constant data .area _LIT -; ;; since _CODE_1 area base address is pre-defined in the linker from 0x4000, +; ;; since _CODE_1 area base address is pre-defined in the linker from 0x4000, ; ;; that moves initializer code and tables out of bank 0 ; .area _CODE_1 ;; Constant data, used to init _DATA .area _INITIALIZER ;; Code, used to init _DATA - .area _GSINIT + .area _GSINIT .area _GSFINAL ;; Uninitialised ram data .area _DATA @@ -284,7 +284,7 @@ _sys_time:: .area _HRAM (ABS) - .org 0xFF90 + .org 0xFF90 __current_bank:: ; Current bank .ds 0x01 .vbl_done: @@ -299,7 +299,7 @@ gsinit:: LD BC, #l__INITIALIZER LD HL, #s__INITIALIZER LD DE, #s__INITIALIZED - call .memcpy_simple + call .memcpy_simple .area _GSFINAL ret @@ -345,7 +345,7 @@ gsinit:: DEC C JR NZ,1$ DEC B - JR NZ,1$ + JR NZ,1$ 4$: RET @@ -433,7 +433,7 @@ _display_off:: LDH A,(.LCDC) AND #LCDCF_ON RET Z ; Return if screen is off -1$: ; We wait for the *NEXT* VBL +1$: ; We wait for the *NEXT* VBL LDH A,(.LY) CP #0x92 ; Smaller than or equal to 0x91? JR NC,1$ ; Loop until smaller than or equal to 0x91 @@ -456,7 +456,7 @@ _remove_VBL:: CALL .remove_VBL POP BC RET - + _add_VBL:: PUSH BC LDA HL, 4(SP) ; Skip return address and registers diff --git a/gbdk-lib/libc/targets/sm83/gb/crt0.s b/gbdk-lib/libc/targets/sm83/gb/crt0.s @@ -73,7 +73,7 @@ POP HL INC HL JR 1$ -_wait_int_handler:: +_wait_int_handler:: ADD SP,#4 .int_tail: POP DE @@ -96,7 +96,7 @@ __standard_VBL_handler:: INC (HL) 2$: CALL .refresh_OAM - + LD A, #1 LDH (.vbl_done),A RET @@ -120,7 +120,7 @@ _refresh_OAM:: LD C, #(40 << 2) ; 40 entries 4 bytes each RST 0x28 RET - + ;; GameBoy Header ;; DO NOT CHANGE... @@ -180,7 +180,7 @@ _refresh_OAM:: ;; **************************************** .org 0x150 - + ;; soft reset: falldown to .code_start .reset:: _reset:: @@ -192,7 +192,7 @@ _reset:: .code_start:: DI ; Disable interrupts LD D, A ; Store CPU type in D - LD E, B ; Store GBA flag in E + LD E, B ; Store GBA flag in E ;; Initialize the stack LD SP, #.STACK @@ -271,7 +271,7 @@ _reset:: ;; Call the main function CALL _main -_exit:: +_exit:: 99$: HALT NOP @@ -318,13 +318,13 @@ _set_interrupts:: .area _CODE_0 ;; Constant data .area _LIT -; ;; since _CODE_1 area base address is pre-defined in the linker from 0x4000, +; ;; since _CODE_1 area base address is pre-defined in the linker from 0x4000, ; ;; that moves initializer code and tables out of bank 0 ; .area _CODE_1 ;; Constant data, used to init _DATA .area _INITIALIZER ;; Code, used to init _DATA - .area _GSINIT + .area _GSINIT .area _GSFINAL ;; Uninitialised ram data .area _DATA @@ -354,7 +354,7 @@ _sys_time:: .area _HRAM (ABS) - .org 0xFF90 + .org 0xFF90 __current_bank:: ; Current bank .ds 0x01 .vbl_done: @@ -369,7 +369,7 @@ gsinit:: LD BC, #l__INITIALIZER LD HL, #s__INITIALIZER LD DE, #s__INITIALIZED - call .memcpy_simple + call .memcpy_simple .area _GSFINAL ret @@ -415,7 +415,7 @@ gsinit:: DEC C JR NZ,1$ DEC B - JR NZ,1$ + JR NZ,1$ 4$: RET @@ -503,7 +503,7 @@ _display_off:: LDH A,(.LCDC) AND #LCDCF_ON RET Z ; Return if screen is off -1$: ; We wait for the *NEXT* VBL +1$: ; We wait for the *NEXT* VBL LDH A,(.LY) CP #0x92 ; Smaller than or equal to 0x91? JR NC,1$ ; Loop until smaller than or equal to 0x91 @@ -526,7 +526,7 @@ _remove_VBL:: CALL .remove_VBL POP BC RET - + _add_VBL:: PUSH BC LDA HL, 4(SP) ; Skip return address and registers diff --git a/gbdk-lib/libc/targets/sm83/pad_ex.s b/gbdk-lib/libc/targets/sm83/pad_ex.s @@ -4,7 +4,7 @@ .area _HOME -_joypad_init:: +_joypad_init:: call .sgb_check ld a, e inc e @@ -64,7 +64,7 @@ _joypad_init:: ld (hl+), a ld (hl+), a ld (hl+), a - ld (hl), a + ld (hl), a ret _joypad_ex:: @@ -124,4 +124,4 @@ _joypad_ex:: jr nz, 1$ pop bc - ret + ret diff --git a/gbdk-lib/libc/targets/z80/gg/global.s b/gbdk-lib/libc/targets/z80/gg/global.s @@ -1,5 +1,5 @@ .GG_STATE = 0x00 - + .GGSTATE_STT = 0b10000000 .GGSTATE_NJAP = 0b01000000 .GGSTATE_NNTS = 0b00100000 diff --git a/gbdk-lib/libc/targets/z80/msxdos/crt0.s b/gbdk-lib/libc/targets/z80/msxdos/crt0.s @@ -31,7 +31,7 @@ ld a, (___overlay_count) and a - call nz, .load_overlays + call nz, .load_overlays jp c, .exit_error call .setup_video_mode @@ -42,7 +42,7 @@ ld c, (hl) or c jr z, 1$ - + add hl, bc inc hl xor a @@ -93,7 +93,7 @@ ld b, h ld c, l add ix, bc -8$: +8$: ld d, (hl) ld a, 0 (ix) ld 0 (ix), d @@ -134,7 +134,7 @@ _exit:: ;; fills memory at HL of length BC with A, clobbers DE .memset_simple:: - ld e, a + ld e, a ld a, c or b ret z @@ -218,7 +218,7 @@ __current_bank:: ; --- 256 byte boundary --------------------------------------- - .bndry 0x100 + .bndry 0x100 __banks_remap_table:: .ds 100 l__banks_remap_table = .-__banks_remap_table @@ -231,7 +231,7 @@ __mapper_bank_alloc:: ld l, a ld a, #0xff cp (hl) - jr nz, 1$ + jr nz, 1$ xor a ld b, a @@ -256,7 +256,7 @@ __mapper_bank_alloc:: .endm .initialize_ram_mapper:: - ; detect mapper capacity + ; detect mapper capacity in a, (.MAP_FRAME1) ld e, a xor a @@ -302,7 +302,7 @@ _wait_vbl_done:: ld a, (_shadow_VDP_R1) and #.R1_DISP_ON ret z - + xor a ld (.vbl_done), a 1$: @@ -325,7 +325,7 @@ _shadow_OAM:: or a jr nz, 3$ ld a, (__mapper_page_mask) - sub #3 ; ram segments used for DOS + sub #3 ; ram segments used for DOS inc a cp b ret c ; not sufficient ram to load overlays @@ -386,7 +386,7 @@ _shadow_OAM:: ld (hl), a xor a - ld bc, #(.overlay_fcb_end - .overlay_fcb_extent) + ld bc, #(.overlay_fcb_end - .overlay_fcb_extent) ld hl, #.overlay_fcb_extent call .memset_simple ; initialize fcb @@ -456,7 +456,7 @@ _shadow_OAM:: ld a, b or #.VDP_REG_MASK out (c), a - + ld a, b or a jr nz, 1$ @@ -475,7 +475,7 @@ _shadow_VDP_R1:: _shadow_VDP_R2:: .db .R2_MAP_0x1C00 _shadow_VDP_R3:: - .db 0xFF ; tiledata attr from 0x2000 + .db 0xFF ; tiledata attr from 0x2000 _shadow_VDP_R4:: .db 0x03 ; tiledata from 0x0000 _shadow_VDP_R5:: @@ -485,7 +485,7 @@ _shadow_VDP_R6:: _shadow_VDP_R7:: _shadow_VDP_RBORDER:: .db 0x01 -.shadow_VDP_end:: +.shadow_VDP_end:: .sys_time:: _sys_time::

This webpage is intended to be an accessible preview of this repository. To get a fuller picture, clone it and use the git CLI.