gbdk-2020 | GameBoy Development Kit |
| download: https://git.y1.nz/archives/gbdk.tar.gz | |
| README | Files | Log | Refs | LICENSE |
commit d37fb69a08043b1545bbab6571acdb5f12f6944b parent 5fc17b21b7140485f8aa05eaf331f9b9fd8e0f15 Author: Toxa <untoxa@mail.ru> Date: Sun, 22 Aug 2021 01:45:52 +0300 SMS/GG: corrected timings for _scroll_viewport Diffstat:
| M | gbdk-lib/examples/gg/banks_autobank/Makefile | 2 | +- |
| M | gbdk-lib/examples/gg/banks_farptr/Makefile | 2 | +- |
| M | gbdk-lib/examples/gg/fonts/Makefile | 2 | +- |
| M | gbdk-lib/examples/gg/smoke/Makefile | 2 | +- |
| M | gbdk-lib/examples/sms/banks_autobank/Makefile | 2 | +- |
| M | gbdk-lib/examples/sms/banks_farptr/Makefile | 2 | +- |
| M | gbdk-lib/examples/sms/fonts/Makefile | 2 | +- |
| M | gbdk-lib/examples/sms/smoke/Makefile | 2 | +- |
| M | gbdk-lib/include/gbdk/gbdk-lib.h | 10 | ++++------ |
| M | gbdk-lib/include/gbdk/metasprites.h | 20 | ++++++-------------- |
| M | gbdk-lib/include/gbdk/platform.h | 20 | ++++++-------------- |
| M | gbdk-lib/libc/targets/z80/cls.s | 10 | +++------- |
| M | gbdk-lib/libc/targets/z80/scroll.s | 19 | ++++++++----------- |
13 files changed, 35 insertions(+), 60 deletions(-)
diff --git a/gbdk-lib/examples/gg/banks_autobank/Makefile b/gbdk-lib/examples/gg/banks_autobank/Makefile @@ -1,4 +1,4 @@ -LCC = ../../../bin/lcc -mz80:gg -Wa-l -Wl-m +LCC = ../../../bin/lcc -mz80:gg -Wl-j -Wm-yS BANKPACK = ../../../bin/bankpack # uncomment for lcc verbose output diff --git a/gbdk-lib/examples/gg/banks_farptr/Makefile b/gbdk-lib/examples/gg/banks_farptr/Makefile @@ -1,4 +1,4 @@ -CC = ../../../bin/lcc -mz80:gg -Wm-yoA -Wa-l -Wl-j +CC = ../../../bin/lcc -mz80:gg -Wm-yoA -Wl-j BINS = banks_farptr.gg diff --git a/gbdk-lib/examples/gg/fonts/Makefile b/gbdk-lib/examples/gg/fonts/Makefile @@ -1,4 +1,4 @@ -CC = ../../../bin/lcc -mz80:gg -Wm-yoA -Wa-l -Wl-j +CC = ../../../bin/lcc -mz80:gg -Wm-yoA -Wl-j BINS = fonts.gg diff --git a/gbdk-lib/examples/gg/smoke/Makefile b/gbdk-lib/examples/gg/smoke/Makefile @@ -1,4 +1,4 @@ -CC = ../../../bin/lcc -mz80:gg -Wm-yoA -Wa-l -Wl-m -Wl-j +CC = ../../../bin/lcc -mz80:gg -Wm-yoA -Wl-m -Wl-j BINS = smoketest.gg diff --git a/gbdk-lib/examples/sms/banks_autobank/Makefile b/gbdk-lib/examples/sms/banks_autobank/Makefile @@ -1,4 +1,4 @@ -LCC = ../../../bin/lcc -mz80:sms -Wa-l -Wl-m +LCC = ../../../bin/lcc -mz80:sms -Wl-j -Wm-yS BANKPACK = ../../../bin/bankpack # uncomment for lcc verbose output diff --git a/gbdk-lib/examples/sms/banks_farptr/Makefile b/gbdk-lib/examples/sms/banks_farptr/Makefile @@ -1,4 +1,4 @@ -CC = ../../../bin/lcc -mz80:sms -Wm-yoA -Wa-l -Wl-j +CC = ../../../bin/lcc -mz80:sms -Wm-yoA -Wl-j BINS = banks_farptr.sms diff --git a/gbdk-lib/examples/sms/fonts/Makefile b/gbdk-lib/examples/sms/fonts/Makefile @@ -1,4 +1,4 @@ -CC = ../../../bin/lcc -mz80:sms -Wm-yoA -Wa-l -Wl-j +CC = ../../../bin/lcc -mz80:sms -Wm-yoA -Wl-j BINS = fonts.sms diff --git a/gbdk-lib/examples/sms/smoke/Makefile b/gbdk-lib/examples/sms/smoke/Makefile @@ -1,4 +1,4 @@ -CC = ../../../bin/lcc -mz80:sms -Wm-yoA -Wa-l -Wl-j +CC = ../../../bin/lcc -mz80:sms -Wm-yoA -Wl-j BINS = smoketest.sms diff --git a/gbdk-lib/include/gbdk/gbdk-lib.h b/gbdk-lib/include/gbdk/gbdk-lib.h @@ -4,14 +4,12 @@ #ifndef GBDK_LIB_INCLUDE #define GBDK_LIB_INCLUDE -#ifdef __PORT_gbz80 +#if defined(__PORT_gbz80) #include <asm/gbz80/provides.h> +#elif defined(__PORT_z80) + #include <asm/z80/provides.h> #else - #ifdef __PORT_z80 - #include <asm/z80/provides.h> - #else - #error Unrecognised port - #endif + #error Unrecognized port #endif diff --git a/gbdk-lib/include/gbdk/metasprites.h b/gbdk-lib/include/gbdk/metasprites.h @@ -1,20 +1,12 @@ #ifndef __PLAT_METASPRITES_H_INVCLUDE #define __PLAT_METASPRITES_H_INVCLUDE -#ifdef __TARGET_gb -#include <gb/metasprites.h> -#endif - -#ifdef __TARGET_ap -#include <gb/metasprites.h> -#endif - -#ifdef __TARGET_sms -#include <sms/metasprites.h> -#endif - -#ifdef __TARGET_gg -#include <sms/metasprites.h> +#if defined(__TARGET_gb) || defined(__TARGET_ap) + #include <gb/metasprites.h> +#elif defined(__TARGET_sms) || defined(__TARGET_gg) + #include <sms/metasprites.h> +#else + #error Unrecognized port #endif #endif diff --git a/gbdk-lib/include/gbdk/platform.h b/gbdk-lib/include/gbdk/platform.h @@ -1,20 +1,12 @@ #ifndef __PLATFORM_H_INVCLUDE #define __PLATFORM_H_INVCLUDE -#ifdef __TARGET_gb -#include <gb/gb.h> -#endif - -#ifdef __TARGET_ap -#include <gb/gb.h> -#endif - -#ifdef __TARGET_sms -#include <sms/sms.h> -#endif - -#ifdef __TARGET_gg -#include <sms/sms.h> +#if defined(__TARGET_gb) || defined(__TARGET_ap) + #include <gb/gb.h> +#elif defined(__TARGET_sms) || defined(__TARGET_gg) + #include <sms/sms.h> +#else + #error Unrecognized port #endif #endif diff --git a/gbdk-lib/libc/targets/z80/cls.s b/gbdk-lib/libc/targets/z80/cls.s @@ -10,21 +10,17 @@ _cls:: ld hl, #(.VDP_TILEMAP + ((.SCREEN_Y_OFS * .VDP_MAP_WIDTH) * 2)) WRITE_VDP_CMD_HL + ld hl, #.SPACE ld bc, #(.SCREEN_HEIGHT * .VDP_MAP_WIDTH) inc b inc c jr 1$ 2$: - ld a, #.SPACE - out (.VDP_DATA), a - VDP_DELAY - xor a - out (.VDP_DATA), a + WRITE_VDP_DATA_HL 1$: dec c jr nz, 2$ - dec b - jr nz, 2$ + djnz 2$ ENABLE_VBLANK_COPY ; switch ON copy shadow SAT ret diff --git a/gbdk-lib/libc/targets/z80/scroll.s b/gbdk-lib/libc/targets/z80/scroll.s @@ -18,6 +18,8 @@ _scroll_viewport:: 2$: res 6, h WRITE_VDP_CMD_HL + nop + nop in a, (.VDP_DATA) ld e, a @@ -30,6 +32,7 @@ _scroll_viewport:: set 6, h WRITE_VDP_CMD_HL + nop ld a, e out (.VDP_DATA), a @@ -43,22 +46,16 @@ _scroll_viewport:: 1$: dec c jr nz, 2$ - dec b - jr nz, 2$ + djnz 2$ ld hl, #(.VDP_TILEMAP + ((.SCREEN_Y_OFS + .SCREEN_HEIGHT - 1) * .VDP_MAP_WIDTH * 2)) WRITE_VDP_CMD_HL - ld c, #.VDP_MAP_WIDTH + ld hl, #.SPACE + ld b, #.VDP_MAP_WIDTH 3$: - ld a, #.SPACE - out (.VDP_DATA), a - VDP_DELAY - xor a - out (.VDP_DATA), a - - dec c - jr nz, 3$ + WRITE_VDP_DATA_HL + djnz 3$ ENABLE_VBLANK_COPY ; switch ON copy shadow SAT ret
This webpage is intended to be an accessible preview of this repository. To get a fuller picture, clone it and use the git CLI.