Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[LUA] sj.get_slot(n) missed #270

Open
NS-Clone opened this issue Mar 21, 2025 · 4 comments
Open

[LUA] sj.get_slot(n) missed #270

NS-Clone opened this issue Mar 21, 2025 · 4 comments
Assignees
Milestone

Comments

@NS-Clone
Copy link

NS-Clone commented Mar 21, 2025

there is no sj.get_slot(n)
so we again need to make ugly code with org instead

current = $
org $4000
slot1 = $$
org current
...
_c( slot1)
@ped7g
Copy link
Collaborator

ped7g commented Mar 21, 2025

you mean to get current page in the slot? I guess so, considering the asm code.
Technically it is what you set it to or default, so why do you need to read it...

But I guess it could be handy when providing some library-like code where you are not sure what the user of library did.

I'm not sure about the "get_slot" name, I was initially thinking you want current active slot, which I wouldn't bother with (I generally dislike the state-based SLOT + PAGE), so maybe "get_page_at"?

@ped7g ped7g added this to the v1.21.1 milestone Mar 21, 2025
@ped7g ped7g self-assigned this Mar 21, 2025
@NS-Clone
Copy link
Author

NS-Clone commented Mar 21, 2025

get_page_at
(I generally dislike the state-based SLOT + PAGE

yep i dislikes this slot name to
but there is
sj.set_slot
and instead to make opposite compatible function
you make another name with another behavior...

it's like you using logical
ENDIF, ENDLUA
but SUDDENLY
ENT, ENDM
and you always need to recall this wrong opposite names
that doesn't match main one :)

@ped7g
Copy link
Collaborator

ped7g commented Mar 21, 2025

the sj.set_slot sets slot, not page. That's something different than what you proposed with your get_slot.

I would rather prefer to remove set_slot and set_page as they can be called by _pc. While get_page_at is useful, that can't even be done in asm easily with current operators.

In your example the get_slot returning slot number would return value 1 (slot 1 for memory range 0x4000..0x7FFF) in ZX128 device), while your example will return value 5 (page number mapped to slot 1) (5 as "Bank 5" being mapped to 0x4000 in ZX128 device).

@NS-Clone
Copy link
Author

NS-Clone commented Mar 22, 2025

That's something different than what you proposed with your get_slot.

OH i forgot AGAIN that there is "current slot"
and 2nd command "page" for edit this "current slot"... 🤦

so this sj.get_slot not fully opposite command

well then this get_page_at maybe better

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants