From: Lukas Krickl Date: Thu, 3 Oct 2024 15:59:53 +0000 (+0200) Subject: wip: room loading routine X-Git-Url: https://git.krickl.dev/?a=commitdiff_plain;h=ef28f9e11f116cae801b62cc85844b75849a49cc;p=gbrg%2F.git wip: room loading routine --- diff --git a/src/hw.inc b/src/hw.inc index dc8ac70..7d2c69e 100644 --- a/src/hw.inc +++ b/src/hw.inc @@ -67,7 +67,13 @@ ; memory map .def int VRAM = 0x8000 .def int VRAM9000 = VRAM+0x1000 + +.def int SCRN_W = 32 +.def int SCRN_H = 32 + .def int SCRN0 = 0x9800 +.def int SCRN0_UI = SCRN0 + SCRN_W * 16 + .def int SCRN1 = 0x9C00 .def int OAMRAM = 0xFE00 .def int OBJSIZE = 4 diff --git a/src/macros.inc b/src/macros.inc index e768638..9edc2d0 100644 --- a/src/macros.inc +++ b/src/macros.inc @@ -12,5 +12,21 @@ pop af #endmacro + ; loads the lo part of an address + ; inputs: + ; $1: register + ; $2: address +#macro ldlo + ld $1, ($2 & 0xFF) +#endmacro + + ; loads the high part of an address + ; inputs: + ; $1: register + ; $2: address +#macro ldhi + ld $1, ($2 >> 8) & 0xFF +#endmacro + ; relative jump: jr