git.y1.nz

gbdk-2020

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

commit 165fd693e0e423658890e13a66a2e6293a39ace6
parent a99c8d6ac9d97bdea9eb5976d99237475e0deb82
Author: Toxa <untoxa@mail.ru>
Date:   Tue,  7 Sep 2021 23:10:04 +0300

SMS/GG: GG ports and bits definition

Diffstat:
Mgbdk-lib/examples/cross-platform/pong/Makefile2+-
Mgbdk-lib/examples/cross-platform/scroller/Makefile2+-
Mgbdk-lib/libc/targets/z80/gg/global.s42+++++++++++++++++++++++++++++++++++-------
Mgbdk-lib/libc/targets/z80/gg/pad.s4++--
Mgbdk-lib/libc/targets/z80/gg/pad_ex.s6+++---
5 files changed, 42 insertions(+), 14 deletions(-)

diff --git a/gbdk-lib/examples/cross-platform/pong/Makefile b/gbdk-lib/examples/cross-platform/pong/Makefile @@ -22,7 +22,7 @@ LCCFLAGS += -Wl-j -Wm-yoA -Wm-ya4 -autobank -Wb-ext=.rel -Wb-v # MBC + Autobanki # LCCFLAGS += -v # Uncomment for lcc verbose output # You can set the name of the ROM file here -PROJECTNAME = fonts +PROJECTNAME = pong # EXT?=gb # Only sets extension to default (game boy .gb) if not populated SRCDIR = src diff --git a/gbdk-lib/examples/cross-platform/scroller/Makefile b/gbdk-lib/examples/cross-platform/scroller/Makefile @@ -22,7 +22,7 @@ LCCFLAGS += -Wl-j -Wm-yS -Wm-yoA -Wm-ya4 -autobank -Wb-ext=.rel -Wb-v # MBC + Au # LCCFLAGS += -v # Uncomment for lcc verbose output # You can set the name of the ROM file here -PROJECTNAME = example +PROJECTNAME = scroller # EXT?=gb # Only sets extension to default (game boy .gb) if not populated SRCDIR = src diff --git a/gbdk-lib/libc/targets/z80/gg/global.s b/gbdk-lib/libc/targets/z80/gg/global.s @@ -1,10 +1,38 @@ - .GG_P0 = 0x00 - .GG_P1 = 0x01 - .GG_P2 = 0x02 - .GG_P3 = 0x03 - .GG_P4 = 0x04 - .GG_P5 = 0x05 - .GG_P6 = 0x06 + .GG_STATE = 0x00 + + .GGSTATE_STT = 0b10000000 + .GGSTATE_NJAP = 0b01000000 + .GGSTATE_NNTS = 0b00100000 + + .GG_EXT_7BIT = 0x01 + + .GG_EXT_CTL = 0x02 + + .GGEXT_NINIT = 0b10000000 + + .GG_SIO_SEND = 0x03 + .GG_SIO_RECV = 0x04 + .GG_SIO_CTL = 0x05 + + .SIOCTL_TXFL = 0b00000001 + .SIOCTL_RXRD = 0b00000010 + .SIOCTL_FRER = 0b00000100 + .SIOCTL_INT = 0b00001000 + .SIOCTL_TON = 0b00010000 + .SIOCTL_RON = 0b00100000 + .SIOCTL_BS0 = 0b01000000 + .SIOCTL_BS1 = 0b10000000 + + .GG_SOUND_PAN = 0x06 + + .SOUNDPAN_TN1R = 0b00000001 + .SOUNDPAN_TN2R = 0b00000010 + .SOUNDPAN_TN3R = 0b00000100 + .SOUNDPAN_NOSR = 0b00001000 + .SOUNDPAN_TN1L = 0b00010000 + .SOUNDPAN_TN2L = 0b00100000 + .SOUNDPAN_TN3L = 0b01000000 + .SOUNDPAN_NOSL = 0b10000000 .MEMORY_CTL = 0x3E diff --git a/gbdk-lib/libc/targets/z80/gg/pad.s b/gbdk-lib/libc/targets/z80/gg/pad.s @@ -11,9 +11,9 @@ _joypad:: cpl and #0b00111111 ld l, a - in a, (.GG_P0) + in a, (.GG_STATE) cpl - and #0b10000000 + and #.GGSTATE_STT or l ld l, a ret diff --git a/gbdk-lib/libc/targets/z80/gg/pad_ex.s b/gbdk-lib/libc/targets/z80/gg/pad_ex.s @@ -45,9 +45,9 @@ _joypad_init:: ;void joypad_ex(joypads_t * joypads) __z88dk_fastcall; _joypad_ex:: - in a, (.GG_P0) + in a, (.GG_STATE) cpl - and #0b10000000 + and #.GGSTATE_STT ld b, a ld c, #.JOY_PORT1 in e, (c) @@ -65,7 +65,7 @@ _joypad_ex:: ld e, a ld a, d cpl - and #0b01111111 + and #0b00111111 ld d, a inc hl

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