What sysvar do you peek to find the address of the basic program? What is it terminated by or does it have a length somewhere?
I don't mind putting the basic tokens in the code since I can easily put it in a buffer which will be overwritten at runtime so the extra space is not an issue really.
Search found 1087 matches
- Thu Dec 07, 2023 6:55 pm
- Forum: Programming
- Topic: How to add a basic program to a TAP file.
- Replies: 11
- Views: 324
- Thu Dec 07, 2023 6:37 pm
- Forum: Programming
- Topic: How to add a basic program to a TAP file.
- Replies: 11
- Views: 324
Re: How to add a basic program to a TAP file.
I know there is a util to do that but I couldn't find a way to do that in sjasmplus or using the TAP browser in Spin, I am looking for a better way though.
OP is also using sjasmplus.
OP is also using sjasmplus.
- Thu Dec 07, 2023 5:57 pm
- Forum: Programming
- Topic: How to add a basic program to a TAP file.
- Replies: 11
- Views: 324
Re: How to add a basic program to a TAP file.
I use this but I would like a better way too, since the CLEAR address is hard coded (in 2 places, the actual number is the 5 byte float following the string "32767", the string doesn't get used by the interpreter, can be anything), and it takes up space in the ASM (although I don't save ac...
- Thu Dec 07, 2023 5:15 pm
- Forum: Sinclair Miscellaneous
- Topic: Google bard vs ChatGPT
- Replies: 13
- Views: 355
Re: Google bard vs ChatGPT
Those jokes are bad. At least Wolfram Alpha goes to a well known website and mines a joke if you ask for a maths joke.
Of which the best one might be:
Why did the chicken cross the Möbius strip? To get to the same side
Of which the best one might be:
Why did the chicken cross the Möbius strip? To get to the same side
- Thu Dec 07, 2023 4:00 pm
- Forum: Sinclair Miscellaneous
- Topic: Google bard vs ChatGPT
- Replies: 13
- Views: 355
Re: Google bard vs ChatGPT
But chatGPT just gets its answers from trawling the entire internet and working out which word is likely to follow on from the previous word, unless they have recently changed how it works. It only writes 1 word at a time it has no idea about what it is writing about. Stephen Wolfram has a good vide...
- Thu Dec 07, 2023 2:52 pm
- Forum: Sinclair Miscellaneous
- Topic: Google bard vs ChatGPT
- Replies: 13
- Views: 355
Re: Google bard vs ChatGPT
Spectrum Basic way for string slicing is better than the original BASIC spec, I guess it only knows about MID$, LEFT$ and RIGHT$. The Speccy BASIC manual does tell you how to implement those if you like though (in the chapter on functions via DEF FN I believe, or else it is an exercise). Speccy way ...
- Tue Dec 05, 2023 12:54 am
- Forum: Programming
- Topic: Game of Life sizecoding contest
- Replies: 36
- Views: 2642
Re: Game of Life sizecoding contest
Michael Abrash (software rendering optimisation (ASM) on Quake) held a compo where the emphasis was on speed so this postmortem may give some ideas https://www.phatcode.net/res/224/files/html/ch17/17-01.html There should probably be a category for speed as well (number of generations/second) since t...
- Tue Nov 14, 2023 10:33 pm
- Forum: Programming
- Topic: BASIC code to test compilers
- Replies: 45
- Views: 1226
Re: BASIC code to test compilers
I watched it too. Wonder how "quick" it would be in the pathological worst case (an already sorted array, which is O(n^2) for quicksort - so same sort of performance as a bubble sort (probably worse than that though if it is recursive))? The expected ("amortised") time is O(n log...
- Tue Nov 14, 2023 10:30 pm
- Forum: Games/Software
- Topic: If you had to give five ZX Spectrum games to the Spice Girls
- Replies: 20
- Views: 476
Re: If you had to give five ZX Spectrum games to the Spice Girls
They'd probably tell us what they want, what they really really want is something like this?
https://spectrumcomputing.co.uk/entry/2 ... igzag_Golf
Or Maybe Ziggurat and R-Type
https://spectrumcomputing.co.uk/entry/2 ... igzag_Golf
Or Maybe Ziggurat and R-Type
- Mon Oct 30, 2023 2:52 am
- Forum: Programming
- Topic: earliest address to assemble to ?
- Replies: 12
- Views: 592
Re: earliest address to assemble to ?
It depends if you use the system variables (so, most ROM calls i.e. calls to below #4000, or any RST instruction) or not (and if you don't change interrupt mode, the ROM interrupt tries to use them, changing interrupt mode wastes 257 bytes of RAM usually). Also depends on the size of the basic loade...
- Sun Oct 29, 2023 2:32 pm
- Forum: Programming
- Topic: decimal point
- Replies: 4
- Views: 191
Re: decimal point
Another thing you can do if the numbers represent currency (or something which should never be rounded) is store the value * 100 and do this https://i.postimg.cc/Vv22mN3B/currency.png Or a version which builds a string in a$ and has currency symbol in c$, pads non negative amounts with a leading spa...
- Sun Oct 29, 2023 1:33 pm
- Forum: Programming
- Topic: decimal point
- Replies: 4
- Views: 191
Re: decimal point
Yeah I suggested something like that in my edit (use STR$). You can't round easily doing that and if you have to search for the decimal point it will probably be slower? Both methods have issues if the number would be displayed in scientific notation. But you can pad numbers with no decimal point so...
- Sun Oct 29, 2023 12:47 pm
- Forum: Programming
- Topic: decimal point
- Replies: 4
- Views: 191
Re: decimal point
PRINT INT(x * 100)/100 or PRINT INT(x * 100 + 0.5)/100 if you want rounding Here's a function version which takes the number of significant digits s as second parameter DEF FN r(x,s)=INT(x*(10^s)+0.5)/(10^s) It's slow and I can't remember how many significant digits the 5 byte floats have in Basic a...
- Sat Oct 28, 2023 5:38 pm
- Forum: Programming
- Topic: Short fallout style text game (Merged from multiple topics)
- Replies: 90
- Views: 1183
Re: Short fallout style text game (Merged from multiple topics)
If you are currently calling the ROM to clear the screen you might want to try one of these methods instead. Note - does not set the border colour ; A -> attrib to set when clearing screen ; at exit ; HL = 0 ; B = 0 cls_fast: di ;disable interrupt ld (.stack+1), sp ;store current stack pointer ld sp...
- Sat Oct 28, 2023 4:17 pm
- Forum: Programming
- Topic: Short fallout style text game (Merged from multiple topics)
- Replies: 90
- Views: 1183
Re: Short fallout style text game (Merged from multiple topics)
I usually just have a compile time switch so that if I want to I can do something every frame if I want to time it. I use IF/ENDIF directives a lot in my code to enable debug code while I am writing it (so the border timing, the collision minimap, etc.). Then when I am satisfied it is fast as I can ...
- Sat Oct 28, 2023 3:38 pm
- Forum: Programming
- Topic: Short fallout style text game (Merged from multiple topics)
- Replies: 90
- Views: 1183
Re: Short fallout style text game (Merged from multiple topics)
I draw a little ruler on the right hand side of the frame if TIMING is set (only draw it once, before the main loop starts), so I can see exactly where the raster gets up to https://i.postimg.cc/gJ8K0mMw/fulleval.gif Black border: erasing the 6 16x16 sprites Blue border: redrawing them. This finishe...
- Sat Oct 28, 2023 3:22 pm
- Forum: Programming
- Topic: Short fallout style text game (Merged from multiple topics)
- Replies: 90
- Views: 1183
Re: Short fallout style text game (Merged from multiple topics)
You can also time stuff by changing the border colour to see how long stuff takes. .mainloop ; set border colour to black IF TIMING xor a out (#FE), a ENDIF ; stuff ; finished mainloop ; set border colour to white IF TIMING xor a out (#FE), a ENDIF halt jp .mainloop That sets the border colour to bl...
- Sat Oct 28, 2023 1:10 am
- Forum: Programming
- Topic: Short fallout style text game (Merged from multiple topics)
- Replies: 90
- Views: 1183
Re: Short fallout style text game (Merged from multiple topics)
Use HALT to slow it down if it is too fast, and it may prevent the flickering of the text as well if you are lucky. Ideally you want to draw everything you need immediately after the HALT and then do all the input and game logic stuff afterwards. If you have not got anything to draw on the first fra...
- Tue Oct 24, 2023 8:52 pm
- Forum: Sinclair Miscellaneous
- Topic: Are all coders basically autistic?
- Replies: 65
- Views: 2303
Re: Are all coders basically autistic?
Agreed. In SJOE I have banned (= you don't score points and it won't echo the word) SPAZ and CRIP (unless you turn on CUSS mode) since they are offensive and banned in US tournament Scrabble. In CUSS mode the full UK list is allowed which includes all sorts of offensive words of course. EDIT: SPAS i...
- Tue Oct 24, 2023 1:06 am
- Forum: Games/Software
- Topic: Devfinitive Edition (Mike Singleton) vote
- Replies: 10
- Views: 351
Re: Devfinitive Edition (Mike Singleton) vote
1. Lords of Midnight, probs the best Speccy game
2. Doomdark's Revenge, harder to get into than 1
3. Treachery, only because of WhatHoSnorker's video about it
2. Doomdark's Revenge, harder to get into than 1
3. Treachery, only because of WhatHoSnorker's video about it
- Mon Oct 23, 2023 4:36 pm
- Forum: Sinclair Miscellaneous
- Topic: Are all coders basically autistic?
- Replies: 65
- Views: 2303
Re: Are all coders basically autistic?
Scramble of course was a vertical shooter because the CRT was rotated 90 degrees :p
- Sat Oct 21, 2023 4:13 pm
- Forum: Programming
- Topic: Forth - better than BASIC?
- Replies: 18
- Views: 391
Re: Forth - better than BASIC?
Obviously Forth is better than basic ;) I wouldn't say the STL is bad either. iostreams are bad but they aren't part of the STL. <algorithm> is pretty good as are the containers. What is bad is all the boilerplate code you have to write to make it so your objects can be placed in a container. EDIT: ...
- Fri Oct 20, 2023 9:37 pm
- Forum: Games/Software
- Topic: Guess the screen$
- Replies: 8158
- Views: 274781
Re: Guess the screen$
Advanced Trump prison simulator 2024-life?
Press S to slop out
Press S to slop out
- Fri Oct 20, 2023 9:33 pm
- Forum: Sinclair Miscellaneous
- Topic: Habits you have because of anything Spectrum
- Replies: 49
- Views: 1869
Re: Habits you have because of anything Spectrum
then they'll make the price higher?
- Fri Oct 20, 2023 7:29 pm
- Forum: Programming
- Topic: Forth - better than BASIC?
- Replies: 18
- Views: 391
Re: XT-Engine: small, but powerful platform game engine in asm
Well I didn't say C was great either, it does it's job though (and is easy to convert to assembly language). When we were forced to code in C we didn't like it and wanted to code in C++. Then we saw terrible C++ code and thought maybe that was a bad idea ;) These days I use C#. For beginners (on PCs...