git.y1.nz

gbdk-2020

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

commit 6400fa1586158c04338d942c3f9805f39846ce7a
parent 820a36d7ce6e12b5d44d5d4788591b344b434fca
Author: Toxa <untoxa@mail.ru>
Date:   Thu,  9 Sep 2021 09:09:37 +0300

rename some hardware constants

Diffstat:
Mgbdk-lib/examples/cross-platform/pong/src/pong.c4++--
Mgbdk-lib/include/gb/gb.h4++--
Mgbdk-lib/include/gb/hardware.h6++++--
Mgbdk-lib/include/sms/hardware.h10++++++----
Mgbdk-lib/include/sms/sms.h13++-----------
Mgbdk-lib/libc/targets/z80/font.s8--------
6 files changed, 16 insertions(+), 29 deletions(-)

diff --git a/gbdk-lib/examples/cross-platform/pong/src/pong.c b/gbdk-lib/examples/cross-platform/pong/src/pong.c @@ -35,8 +35,8 @@ uint16_t player1_score, player2_score; // player constraints #define YMIN 28 #define YMAX 100 -#define PLAYER1_X DEVICE_SPRITE_OFFSET_X -#define PLAYER2_X (uint8_t)(DEVICE_SPRITE_OFFSET_X + (DEVICE_SCREEN_WIDTH * 8) - 8) +#define PLAYER1_X DEVICE_SPRITE_PX_OFFSET_X +#define PLAYER2_X (uint8_t)(DEVICE_SPRITE_PX_OFFSET_X + DEVICE_SCREEN_PX_WIDTH - 8) // coordinates and speeds of ball uint8_t ballX, ballY; diff --git a/gbdk-lib/include/gb/gb.h b/gbdk-lib/include/gb/gb.h @@ -119,10 +119,10 @@ /* Limits */ /** Width of the visible screen in pixels. */ -#define SCREENWIDTH 0xA0U +#define SCREENWIDTH DEVICE_SCREEN_PX_WIDTH /** Height of the visible screen in pixels. */ -#define SCREENHEIGHT 0x90U +#define SCREENHEIGHT DEVICE_SCREEN_PX_HEIGHT /** The Minimum X position of the Window Layer (Left edge of screen) @see move_win() */ #define MINWNDPOSX 0x07U diff --git a/gbdk-lib/include/gb/hardware.h b/gbdk-lib/include/gb/hardware.h @@ -368,8 +368,10 @@ __REG IE_REG; /** Interrupt enable */ #define DEVICE_SCREEN_BUFFER_WIDTH 32 #define DEVICE_SCREEN_BUFFER_HEIGHT 32 #define DEVICE_SCREEN_MAP_ENTRY_SIZE 1 -#define DEVICE_SPRITE_OFFSET_X 8 -#define DEVICE_SPRITE_OFFSET_Y 16 +#define DEVICE_SPRITE_PX_OFFSET_X 8 +#define DEVICE_SPRITE_PX_OFFSET_Y 16 +#define DEVICE_SCREEN_PX_WIDTH (DEVICE_SCREEN_WIDTH * 8) +#define DEVICE_SCREEN_PX_HEIGHT (DEVICE_SCREEN_HEIGHT * 8) #endif diff --git a/gbdk-lib/include/sms/hardware.h b/gbdk-lib/include/sms/hardware.h @@ -184,8 +184,8 @@ extern volatile UBYTE VDP_ATTR_SHIFT; #define DEVICE_SCREEN_BUFFER_WIDTH 32 #define DEVICE_SCREEN_BUFFER_HEIGHT 28 #define DEVICE_SCREEN_MAP_ENTRY_SIZE 2 -#define DEVICE_SPRITE_OFFSET_X 0 -#define DEVICE_SPRITE_OFFSET_Y 255 +#define DEVICE_SPRITE_PX_OFFSET_X 0 +#define DEVICE_SPRITE_PX_OFFSET_Y -1 #elif defined(__TARGET_gg) #define DEVICE_SCREEN_X_OFFSET 6 #define DEVICE_SCREEN_Y_OFFSET 3 @@ -194,10 +194,12 @@ extern volatile UBYTE VDP_ATTR_SHIFT; #define DEVICE_SCREEN_BUFFER_WIDTH 32 #define DEVICE_SCREEN_BUFFER_HEIGHT 28 #define DEVICE_SCREEN_MAP_ENTRY_SIZE 2 -#define DEVICE_SPRITE_OFFSET_X 48 -#define DEVICE_SPRITE_OFFSET_Y 23 +#define DEVICE_SPRITE_PX_OFFSET_X 48 +#define DEVICE_SPRITE_PX_OFFSET_Y 23 #else #error Unrecognized port #endif +#define DEVICE_SCREEN_PX_WIDTH (DEVICE_SCREEN_WIDTH * 8) +#define DEVICE_SCREEN_PX_HEIGHT (DEVICE_SCREEN_HEIGHT * 8) #endif diff --git a/gbdk-lib/include/sms/sms.h b/gbdk-lib/include/sms/sms.h @@ -114,21 +114,12 @@ uint8_t get_mode(void) NONBANKED; void set_interrupts(uint8_t flags) __z88dk_fastcall; /* Limits */ -#if defined(__TARGET_sms) /** Width of the visible screen in pixels. */ -#define SCREENWIDTH 256U +#define SCREENWIDTH DEVICE_SCREEN_PX_WIDTH /** Height of the visible screen in pixels. */ -#define SCREENHEIGHT 192U -#elif defined(__TARGET_gg) -/** Width of the visible screen in pixels. - */ -#define SCREENWIDTH 160U -/** Height of the visible screen in pixels. - */ -#define SCREENHEIGHT 144U -#endif +#define SCREENHEIGHT DEVICE_SCREEN_PX_HEIGHT /** The Minimum X position of the Window Layer (Left edge of screen) @see move_win() */ #define MINWNDPOSX 0x00U diff --git a/gbdk-lib/libc/targets/z80/font.s b/gbdk-lib/libc/targets/z80/font.s @@ -34,14 +34,6 @@ font_first_free_tile: ; Table containing descriptors for all of the fonts font_table: .ds (sfont_handle_sizeof*.MAX_FONTS) -plane0: - .ds 1 -plane1: - .ds 1 -plane2: - .ds 1 -plane3: - .ds 1 .area _HOME

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