slenkar Wrote:is it ok to add it when its not finished?I can see the screenshot, and its OK. Maybe a cache problem?
EDIT- I added it but cant get the screenshot to show up
https://zxbasic.readthedocs.io/en/docs/r...SpeccyWars
Speccy Wars
|
04-19-2013, 03:18 PM
yep its workin now thanks
04-27-2013, 05:05 PM
its playable now
its at the limits of the memory so new features are unlikely
05-02-2013, 06:36 PM
slenkar Wrote:here is the source code:
![]() Try lowering the ORG with --org=26000?
05-02-2013, 10:50 PM
yeh the line function allows me to do line of sight, (need all x and y coordinates of a line)
Thanks for the other tips
05-02-2013, 11:24 PM
In main file:
Code: PRINT AT 3,13 ; PAPER 1 ; INK 7 ; "BattleField" Code: PRINT AT 3,13 ;"\{p1}\{i7}BattleField" Code: 60 LET j$ = INKEY$ Code: Do Code: PRINT AT 1,x ; PAPER 1 ; INK 0 ; " " Code: PRINT AT 1,x ;"\{p1}\{i0} " Code: FUNCTION millisecs AS ULONG Code: dim millisecs as ULONG at 23672 Also check if there are undimed variables as this make them float There is a lot of optimisation potential. I'm sure, you can save 3-5 Kb. It looks like you define UDG multiple times. Thats what I found quickly checking the sources. Optimising the source is a bit time consuming because you did not use indentation. You can also change: Code: dim selecty as byte Code: dim selecty,selectx,selectedUnit,targettedUnit as ubyte And as boriel said, you can set up org to 24200 without problems. Reduce the heap to 512.
------------------------------------------------------------
http://lcd-one.da.ru redirector is dead Visit my http://members.inode.at/838331/index.html home page!
05-02-2013, 11:26 PM
Another trick (not yet implemented) is: There is many arrays which are taking lot of memory. If you don't need 2 of them *at once* it's possible to map two of them in the same memory area (note: This feature IS NOT implemented; i'm still working on it). Basically, it's using DIM ... AT ... with arrays (at the moment only available with single variables).
05-02-2013, 11:42 PM
slenkar Wrote:yeh the line function allows me to do line of sight, (need all x and y coordinates of a line)Did you use Bresenham's algorithm for speed also? A classical y = x0 + mx take much less memory (althoug slower, if using FP, but FP is in ROM). Update: Also, in the speccy.org (Spanish) forum people are also talking about 128K ram management. I think we could manage so create some simple bank-switching functions and store graphs and some array/logic there.
05-03-2013, 06:54 PM
thanks for all the tips
I used bresenham just because thats the only line function I know of, where I can get all the co-ordinates along the line. I dont know how to use 'y = x0 + mx' , to make a line from two known points. |
« Next Oldest | Next Newest »
|
Users browsing this thread: 1 Guest(s)