projects
/
gbrg
/
.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
677019f
)
sys: Added farcall sys call
author
Lukas Krickl
<lukas@krickl.dev>
Sat, 24 May 2025 15:29:59 +0000
(17:29 +0200)
committer
Lukas Krickl
<lukas@krickl.dev>
Sat, 24 May 2025 15:29:59 +0000
(17:29 +0200)
src/jmp.inc
patch
|
blob
|
history
src/macros.inc
patch
|
blob
|
history
diff --git
a/src/jmp.inc
b/src/jmp.inc
index aa09be99387a62208cc09632ae391910d88d9225..b5eaeadd8b66dc2ad092d8bb9af0c83fbe6d079e 100644
(file)
--- 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 978698af697eeae03de8a52ec74d197916a71871..d3be0a3a33815abf334ebe428d1bb1fd587ac7f6 100644
(file)
--- 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