From 655c16d46fbe185e97694f903c6e9ee0935da15a Mon Sep 17 00:00:00 2001 From: Lukas Krickl Date: Sat, 24 May 2025 17:29:59 +0200 Subject: [PATCH] sys: Added farcall sys call --- src/jmp.inc | 19 +++++++++++++++++-- src/macros.inc | 5 +++++ 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/src/jmp.inc b/src/jmp.inc index aa09be9..b5eaead 100644 --- a/src/jmp.inc +++ b/src/jmp.inc @@ -8,10 +8,25 @@ rst_panic: ; rst 0008 ; simple call to hl -call_hl: +sys_call_hl: jp hl -.fill 0, 0x40 - $ +.fill 0, 0x10 - $ + + ; rst 0010 + ; farcall + ; inputs: + ; a: bank + ; hl: routine ptr +sys_farcall: + ; TODO: save current bank + ; TODO: switch bank + call_hl + ; TODO: switch bank + ret + + +.fill 0, 0x40 - $ ; interrupt vectors ;============= diff --git a/src/macros.inc b/src/macros.inc index 978698a..d3be0a3 100644 --- a/src/macros.inc +++ b/src/macros.inc @@ -241,3 +241,8 @@ #macro call_hl rst 0x08 #endmacro + + ; calls rst 0x10 +#macro farcall + rst 0x10 +#endmacro -- 2.30.2