diff --git a/compiler/res/prog8lib/cx16/sprites.p8 b/compiler/res/prog8lib/cx16/sprites.p8 index fa1d2511a..ed7a410c9 100644 --- a/compiler/res/prog8lib/cx16/sprites.p8 +++ b/compiler/res/prog8lib/cx16/sprites.p8 @@ -42,9 +42,15 @@ sprites { cx16.vpoke_mask(1, sprite_reg+1, %11110000, msb(addr)) ; address 16:13 } - sub get_data_ptr(ubyte spritenum) { + inline asmsub get_data_ptr(ubyte spritenum @A) -> ubyte @R1, uword @R0 { ; -- returns the VRAM address where the sprite's bitmap data is stored ; R1 (byte) = the vera bank (0 or 1), R0 (word) = the address. + %asm {{ + jsr p8b_sprites.p8s_get_data_ptr_internal + }} + } + + sub get_data_ptr_internal(ubyte spritenum) { sprite_reg = VERA_SPRITEREGS + spritenum*$0008 cx16.r0L = cx16.vpeek(1, sprite_reg) cx16.r0H = cx16.vpeek(1, sprite_reg+1) diff --git a/docs/source/todo.rst b/docs/source/todo.rst index ede881340..1dae37e6b 100644 --- a/docs/source/todo.rst +++ b/docs/source/todo.rst @@ -1,6 +1,8 @@ TODO ==== +docs: stress more that the @split for word arrays can provide significant code efficiency over normal linear word array + optimizer bug, see "optimizing inlined functions must reference proper scopes" unittest (skipped for now) causes compiler error for virtual: just calling txt.cls() gives compile error undefined symbol clear_screen