projects
/
gbrg
/
.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
dccf9cc
)
sys: optimized oamalloc slightly
author
Lukas Krickl
<lukas@krickl.dev>
Mon, 8 Dec 2025 04:50:15 +0000
(
05:50
+0100)
committer
Lukas Krickl
<lukas@krickl.dev>
Mon, 8 Dec 2025 04:50:15 +0000
(
05:50
+0100)
src/sys.s
patch
|
blob
|
history
src/wram.s
patch
|
blob
|
history
diff --git
a/src/sys.s
b/src/sys.s
index c2d41f002e76d6a872d94bfbe702db2876516ed8..711367eed6cfb022bf7db53d0afe5b16838a444c 100644
(file)
--- a/
src/sys.s
+++ b/
src/sys.s
@@
-66,13
+66,12
@@
call_tbl:
oamalloc:
push af
ld a, [current_oam_obj]
-
-
- ld d, 0
- ld e, a
- ld hl, shadow_oam
-
- add hl, de ; hl = next oam
+ ld hl, current_oam_obj
+ ld l, [hl] ; load low byte
+ ; this works because current_oam_obj is in the same bank
+ ; as shadown oam
+
+ ; hl = next oam object
; next object
ld b, a
diff --git
a/src/wram.s
b/src/wram.s
index 11b0b4cc7f90188421bc4334a6809aac73ceac09..9ab5bb9dc6c39d6bd87a9b3e4660c1450a3e4e94 100644
(file)
--- a/
src/wram.s
+++ b/
src/wram.s
@@
-4,11
+4,11
@@
; needs to be at the start or alinged properly for DMA!
shadow_oam: .adv OBJSMAX * oamsize
shadow_oam_end:
+current_oam_obj: .adv 1
frame_ready: .adv 1
frame_count: .adv 1
-current_oam_obj: .adv 1
; current frame's inputs
curr_inputs: .adv 1