Skip to content

Play library: implement repetition and halt commands#1091

Merged
boriel merged 1 commit into
boriel-basic:mainfrom
oskostenko:play-lib-update
Jul 8, 2026
Merged

Play library: implement repetition and halt commands#1091
boriel merged 1 commit into
boriel-basic:mainfrom
oskostenko:play-lib-update

Conversation

@oskostenko

Copy link
Copy Markdown
Contributor

This adds support for repetition () and halt H commands to the Play routine.

@wilco2009, you might probably want to incorporate these changes to your zx81sd port.

@wilco2009

Copy link
Copy Markdown
Contributor

This adds support for repetition () and halt H commands to the Play routine.

@wilco2009, you might probably want to incorporate these changes to your zx81sd port.

Perfect, thank you. I will implement your new features in the next version.

@oskostenko

Copy link
Copy Markdown
Contributor Author

@wilco2009, would it be possible to maintain a single version of the library, with conditional macros?

Something like:

#ifdef ARCH_ZX81SD
  ' zx81sd-specific const values
#elif
  ' default const values
#endif

That way it would be much less pain to maintain multiple architectures.

@wilco2009

Copy link
Copy Markdown
Contributor

I agree with you, that's the correct way to do it.
If the example is adapted that way, I could remove it from the architecture subfolder since it would simply work without needing to port anything.
I'll do it that way in my next version.

@oskostenko

Copy link
Copy Markdown
Contributor Author

Well, I'm not sure this is possible in Boriel, that's why I'm asking... But I hope you'll manage to sort it out. Maybe @boriel can give an advise.

@boriel

boriel commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator

@wilco2009 commented this idea, and it's an antipattern.
Precisely you are coupling your implementation with the others. What happens when the number of arch increases? ZX81 didn´t even have a PLAY command in the 1st place.

@wilco2009 can use

#include [arch:zx48k] <play.bas> 

if your version is 100% compatible (that's what zxnext arch does with many libraries, because they are 100% compatible).
If it is not, you should decouple from that other architecture.

@boriel boriel merged commit 96a95fe into boriel-basic:main Jul 8, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants