![]() |
Speccy Wars - Printable Version +- Forum (https://www.boriel.com/forum) +-- Forum: Compilers and Computer Languages (https://www.boriel.com/forum/forumdisplay.php?fid=12) +--- Forum: ZX Basic Compiler (https://www.boriel.com/forum/forumdisplay.php?fid=11) +---- Forum: Gallery (https://www.boriel.com/forum/forumdisplay.php?fid=18) +---- Thread: Speccy Wars (/showthread.php?tid=410) Pages:
1
2
|
Re: Speccy Wars - boriel - 04-19-2013 slenkar Wrote:is it ok to add it when its not finished?I can see the screenshot, and its OK. Maybe a cache problem? Re: Speccy Wars - slenkar - 04-19-2013 yep its workin now thanks Re: Speccy Wars - slenkar - 04-27-2013 its playable now its at the limits of the memory so new features are unlikely Re: Speccy Wars - slenkar - 05-02-2013 here is the source code: How could I free up some more RAM? Re: Speccy Wars - boriel - 05-02-2013 slenkar Wrote:here is the source code:
![]() Try lowering the ORG with --org=26000? Re: Speccy Wars - slenkar - 05-02-2013 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 Re: Speccy Wars - LCD - 05-02-2013 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. Re: Speccy Wars - boriel - 05-02-2013 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). Re: Speccy Wars - boriel - 05-02-2013 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. Re: Speccy Wars - slenkar - 05-03-2013 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. |