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
|
|
2013-04-19, 04:18 PM
yep its workin now thanks
2013-04-27, 06:05 PM
its playable now
its at the limits of the memory so new features are unlikely
2013-05-02, 07:36 PM
slenkar Wrote:here is the source code:
so don't know if something else could be done. Why do you need more ram? Try lowering the ORG with --org=26000?
2013-05-02, 11: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
2013-05-03, 12:24 AM
In main file:
Code: PRINT AT 3,13 ; PAPER 1 ; INK 7 ; "BattleField"
PRINT AT 5,9 ; PAPER 7 ; INK 0 ; "Q - Up"
PRINT AT 6,9 ; PAPER 7 ; INK 0 ; "A - Down"
PRINT AT 7,9 ; PAPER 7 ; INK 0 ; "O - Left"
PRINT AT 8,9 ; PAPER 7 ; INK 0 ; "P - Right"
PRINT AT 9,9 ; PAPER 7 ; INK 0 ; "M or Space- Select"
PRINT AT 10,3 ; PAPER 7 ;INK 0 ; "C to End Turn"
PRINT AT 10,3 ; PAPER 7 ; INK 0 ; "You have to select units"
PRINT AT 11,3 ; PAPER 7 ; INK 0 ; "to fight the enemy units"
PRINT AT 15,3 ; PAPER 7 ; INK 0 ; "Press any key to start"Code: PRINT AT 3,13 ;"\{p1}\{i7}BattleField"
PRINT AT 5,9 ; "\{p7}\{i0}Q - Up"; AT 6,9 ;"A - Down"; AT 7,9 ; "O - Left"; AT 8,9 ; "P - Right"; AT 9,9 ; "M or Space- Select";AT 10,3; "C to End Turn";AT 10,3 ; "You have to select units"; PRINT AT 11,3; "to fight the enemy units"; PRINT AT 15,3; "Press any key to start";Code: 60 LET j$ = INKEY$
IF j$ = "" THEN GOTO 60: END IFCode: Do
j$=inkey$
loop until j$<>""Code: PRINT AT 1,x ; PAPER 1 ; INK 0 ; " "Code: PRINT AT 1,x ;"\{p1}\{i0} "Code: FUNCTION millisecs AS ULONG
REM Reads the FRAMES counter
RETURN INT((65536 * PEEK(23674) + 256 * PEEK(23673) + PEEK(23672)))
END FUNCTIONCode: dim millisecs as ULONG at 23672Also 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
dim selectx as byte
dim selectedUnit as ubyte
dim targettedUnit as ubyteCode: dim selecty,selectx,selectedUnit,targettedUnit as ubyteAnd 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!
2013-05-03, 12:26 AM
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).
2013-05-03, 12:42 AM
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.
2013-05-03, 07: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: 2 Guest(s)


so don't know if something else could be done. Why do you need more ram?