Welcome, Guest |
You have to register before you can post on our site.
|
Online Users |
There are currently 319 online users. » 0 Member(s) | 317 Guest(s) Bing, Google
|
Latest Threads |
.tap file code not execut...
Forum: Help & Support
Last Post: Zoran
04-28-2025, 10:59 AM
» Replies: 4
» Views: 190
|
Exit from more than one l...
Forum: Wishlist
Last Post: Duefectu
04-23-2025, 10:06 PM
» Replies: 3
» Views: 259
|
put small ASM programs li...
Forum: How-To & Tutorials
Last Post: Zoran
04-18-2025, 02:02 PM
» Replies: 6
» Views: 1,521
|
Creating +3 Menus - Loadi...
Forum: Help & Support
Last Post: merlinkv
04-16-2025, 02:08 PM
» Replies: 6
» Views: 513
|
Randomize not very random...
Forum: Help & Support
Last Post: Zoran
04-08-2025, 10:40 AM
» Replies: 4
» Views: 415
|
Scope rules
Forum: Bug Reports
Last Post: Zoran
04-04-2025, 09:46 AM
» Replies: 2
» Views: 287
|
Using constants not allow...
Forum: Bug Reports
Last Post: baltasarq
03-19-2025, 10:00 PM
» Replies: 8
» Views: 1,014
|
404 page not found
Forum: Documentation
Last Post: boriel
03-08-2025, 07:16 PM
» Replies: 5
» Views: 2,852
|
Spectrum keywords codes
Forum: Bug Reports
Last Post: boriel
03-08-2025, 11:00 AM
» Replies: 1
» Views: 395
|
ZXodus][Engine
Forum: ZX Basic Compiler
Last Post: boriel
02-19-2025, 11:43 PM
» Replies: 69
» Views: 213,484
|
|
|
Is posible put a ubyte variable just after DIM |
Posted by: maeloterkim - 09-04-2021, 02:17 PM - Forum: Help & Support
- Replies (2)
|
 |
Hi
Is posible put a ubyte variable just after DIM WITHOUT ASSEMBLER maybe with AT @ or something
Example:
Code: DIM udg(1, 7) AS uByte => {{0,1,3,7,15,31,63,127}, _
{1,2,4,7,15,31,63,127}}
DIM myVariable as ubyte
I WANT THIS VARIABLE VALUE JUST THE NEXT BYTE AT THE END OF LAST UDG DIM BYTE LIKE THIS
ADDRESS 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
VALUE 0 1 3 7 15 31 63 127 1 2 4 7 15 31 63 127 myVariable
-------------------- DIM UDG -------------------------------
|
|
|
struggle on using/implementing sprite libraries |
Posted by: nitrofurano - 08-25-2021, 08:02 PM - Forum: Wishlist
- Replies (2)
|
 |
since a long time i was thinking how simple or possible would be using sprite engines/libraries on zxbasic-compiler (just like those used on z88dk and so on)
so i started to try this (very glitchy and inefficient, as the code shows... )
(wsad or cursors for moving)
Code: ink 1
border 1:ink 5:bright 1: paper 1: cls
sub putudgsprite(txp1 as uinteger,typ1 as uinteger,tad1 as uinteger)
poke uinteger $5C7B,tad1+(7-(typ1 mod 8))+(txp1 mod 8)*32
print at int(typ1/8),int(txp1/8);"\A\C"
print at 1+int(typ1/8),int(txp1/8);"\B\D"
end sub
yo=0:xo=0
putudgsprite(xo,yo,@udg01)
x1=128:y1=128
do
cn1=((255-(in 64510)) band 2)/2 bor ((255-(in 65022)) band 2) bor ((255-(in 65022)) band 1)*4 bor ((255-(in 65022)) band 4)*2 :'- wsad
cn2=((255-(in 61438)) band 8)/8 bor ((255-(in 61438)) band 16)/8 bor ((255-(in 63486)) band 16)/4 bor ((255-(in 61438)) band 4)*2 :'-7658
cn0=cn1 bor cn2
x1=x1-((cn0 band 4)/4)
x1=x1+((cn0 band 8)/8)
y1=y1-((cn0 band 1)/1)
y1=y1+((cn0 band 2)/2)
over 1
putudgsprite(xo,yo,@udg01)
xo=x1:yo=y1
putudgsprite(x1,y1,@udg01)
pause 1
loop
do:loop
udg01:
asm
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %11111111
defb %11111111
defb %11111111
defb %11111111
defb %11111111
defb %11111111
defb %11111111
defb %11111111
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %01111111
defb %01111111
defb %01111111
defb %01111111
defb %01111111
defb %01111111
defb %01111111
defb %01111111
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %10000000
defb %10000000
defb %10000000
defb %10000000
defb %10000000
defb %10000000
defb %10000000
defb %10000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00111111
defb %00111111
defb %00111111
defb %00111111
defb %00111111
defb %00111111
defb %00111111
defb %00111111
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %11000000
defb %11000000
defb %11000000
defb %11000000
defb %11000000
defb %11000000
defb %11000000
defb %11000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00011111
defb %00011111
defb %00011111
defb %00011111
defb %00011111
defb %00011111
defb %00011111
defb %00011111
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %11100000
defb %11100000
defb %11100000
defb %11100000
defb %11100000
defb %11100000
defb %11100000
defb %11100000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00001111
defb %00001111
defb %00001111
defb %00001111
defb %00001111
defb %00001111
defb %00001111
defb %00001111
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %11110000
defb %11110000
defb %11110000
defb %11110000
defb %11110000
defb %11110000
defb %11110000
defb %11110000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000111
defb %00000111
defb %00000111
defb %00000111
defb %00000111
defb %00000111
defb %00000111
defb %00000111
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %11111000
defb %11111000
defb %11111000
defb %11111000
defb %11111000
defb %11111000
defb %11111000
defb %11111000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000011
defb %00000011
defb %00000011
defb %00000011
defb %00000011
defb %00000011
defb %00000011
defb %00000011
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %11111100
defb %11111100
defb %11111100
defb %11111100
defb %11111100
defb %11111100
defb %11111100
defb %11111100
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000001
defb %00000001
defb %00000001
defb %00000001
defb %00000001
defb %00000001
defb %00000001
defb %00000001
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %11111110
defb %11111110
defb %11111110
defb %11111110
defb %11111110
defb %11111110
defb %11111110
defb %11111110
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
end asm
so, any idea of using "true" sprites instead of that attempt above?
|
|
|
GOTO inside a function question? |
Posted by: RandomiserUsr - 06-05-2021, 03:14 PM - Forum: Help & Support
- Replies (3)
|
 |
I have two functions that have a return 0
Code: FUNCTION processTest(test INTEGER) as INTEGER
......processing stuff
IF X=1 THEN
poke TestAddress, 1
GOTO displayMsg
END IF
return 0
END FUNCTION
Does the this cause any memory leaks on the stack?
i.e. by not "returning" something is left on the stack and won't be removed?
I remember something about GOSUB/RETURN having this or am I okay to not RETURN (I am experimenting before you may say it's not "good practice )
Thanks in advance
|
|
|
How to carve up ZX Basic into different ORG values |
Posted by: RandomiserUsr - 05-15-2021, 09:29 AM - Forum: Help & Support
- Replies (10)
|
 |
This might be asking a tricky thing to do but :-
GOAL :
To have main.bas compile at 24576 as main.tap
with the ability to at runtime, call on the functions in the below separate files
Functions.bas compile at last address use above +1 as functions-Bank1.bin
** ZX Basic functions only
textdata.bas compile at last address use above +1 as textdata-Bank3.bin
** Mixture of ZX BASIC and ASM functions and data references.
picturedata.bas compile at last address use above +1 as picturedata-Bank6.bin
** Mixture of ZX BASIC and ASM functions and picture references but uses the 168384 address to load into.
This I am hoping would result in files being created that I can then join them together into one TAP file which can then be loaded via an emulator.
The idea is then to be able switch to the relevant bank # to call the relevant function,.
Issue:
When the main,bas is compiled the compiler insists on functions being accessible at runtime, a very logical thing, so the compile fails as the methods are not in main.bas but in the other *.BIN files.
Is there a way around this?
I was using blank labels which helps a bit but I can't really do this with the functions (I have not tried though)
thanks
:-)
|
|
|
|