From 97fa45589b24c85923c71368c924f954493e2fb4 Mon Sep 17 00:00:00 2001 From: Lucas Scharenbroich Date: Mon, 1 Aug 2022 22:00:54 -0500 Subject: [PATCH] Allow GTEStartUp caller to specify whether tool is loaded as a system or user tool --- macros/GTE.Macs.s | 1 + src/Defs.s | 1 + src/Tool.s | 4 +++- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/macros/GTE.Macs.s b/macros/GTE.Macs.s index e1cfcaa..4313f90 100644 --- a/macros/GTE.Macs.s +++ b/macros/GTE.Macs.s @@ -146,6 +146,7 @@ PAD_KEY_DOWN equ $0400 ENGINE_MODE_TWO_LAYER equ $0001 ENGINE_MODE_DYN_TILES equ $0002 ENGINE_MODE_BNK0_BUFF equ $0004 +ENGINE_MODE_USER_TOOL equ $8000 ; Communicate if GTE is loaded as a system tool, or a user tool ; Render flags RENDER_ALT_BG1 equ $0001 diff --git a/src/Defs.s b/src/Defs.s index 48f8d37..9457df8 100644 --- a/src/Defs.s +++ b/src/Defs.s @@ -166,6 +166,7 @@ SPRITE_VBUFF_PTR equ 224 ; 32 bytes of adjusted pointers to VBuf ENGINE_MODE_TWO_LAYER equ $0001 ENGINE_MODE_DYN_TILES equ $0002 ENGINE_MODE_BNK0_BUFF equ $0004 +ENGINE_MODE_USER_TOOL equ $8000 ; Communicate if GTE is loaded as a system tool, or a user tool ; Render flags RENDER_ALT_BG1 equ $0001 diff --git a/src/Tool.s b/src/Tool.s index 760331e..dae5db3 100644 --- a/src/Tool.s +++ b/src/Tool.s @@ -156,7 +156,9 @@ zpToUse = userId+4 ; SetWAP(userOrSystem, tsNum, waptPtr) - pea #$8000 ; $8000 = user tool set + lda EngineMode ; $0000 = system tool, $8000 = user tool set + and #$8000 + pha pei ToolNum ; Push the tool number from the direct page pea $0000 ; High word of WAP is zero (bank 0) phd ; Low word of WAP is the direct page