| Welcome, Guest |
You have to register before you can post on our site.
|
| Forum Statistics |
» Members: 273
» Latest member: mindlin
» Forum threads: 1,085
» Forum posts: 6,486
Full Statistics
|
| Online Users |
There are currently 37 online users. » 0 Member(s) | 36 Guest(s) DuckDuckGo
|
| Latest Threads |
location of heap manageme...
Forum: Help & Support
Last Post: boriel
2026-03-07, 12:13 AM
» Replies: 1
» Views: 212
|
non-paged supervisor code...
Forum: Help & Support
Last Post: sdo303
2026-02-20, 06:38 PM
» Replies: 8
» Views: 684
|
How to open fuse as an ex...
Forum: How-To & Tutorials
Last Post: Duefectu
2026-02-09, 01:52 PM
» Replies: 3
» Views: 1,062
|
Old zxbasic game errors
Forum: Help & Support
Last Post: boriel
2025-11-09, 11:52 AM
» Replies: 7
» Views: 1,671
|
Error: Undefined GLOBAL l...
Forum: Help & Support
Last Post: ardentcrest
2025-11-04, 05:46 PM
» Replies: 3
» Views: 808
|
A Fast(er) Plot Routine f...
Forum: How-To & Tutorials
Last Post: tubz74
2025-10-30, 03:16 PM
» Replies: 2
» Views: 927
|
Hall of Fame - Include fo...
Forum: How-To & Tutorials
Last Post: tubz74
2025-10-28, 03:48 PM
» Replies: 0
» Views: 473
|
[SOLVED] Array layout bug...
Forum: Bug Reports
Last Post: Zoran
2025-10-25, 05:48 PM
» Replies: 2
» Views: 942
|
3DOS Commands?
Forum: Help & Support
Last Post: boriel
2025-10-06, 02:54 PM
» Replies: 3
» Views: 1,105
|
CLS/Fade out ASM Sub-rout...
Forum: How-To & Tutorials
Last Post: tubz74
2025-10-05, 03:39 PM
» Replies: 2
» Views: 835
|
|
|
| Calling non-ZXB code with RANDOMIZE USR |
|
Posted by: LTee - 2011-05-13, 03:11 PM - Forum: Help & Support
- Replies (13)
|
 |
Hi all, it's been a while but I've been kind of busy. :-)
My game project is almost complete, I just wanted to add some music. I wrote a couple of (quite bad) tunes with Beepola, compiled with the Music Box engine. I've loaded these high into memory (64000 up), well away from my ZXB code and I'm calling them with 'randomize usr X' from within ZXB. The player is configured to play the tune once and then return control to the caller.
I'm having a small problem that I can get around, but I wanted to ask about. If I call the music player from within a SUB or a FUNCTION, the Spectrum crashes after playing the tune. If I call it from OUTSIDE a SUB or FUNCTION (i.e. just from within the main code) then it returns fine.
For example:
Code: cls
pause 0
print "test"
randomize usr 64000
pause 0
print "test 2"
test()
stop
SUB test()
randomize usr 64000
END SUB
In the above code (surmising that the player is loaded at 64000), the tune plays and returns correctly after "test" is printed, but crashes after playing the tune after "test2" is printed.
Is calling external code via "randomize usr" actually supported? It's not in the Wiki, so I'm thinking 'not'. If it is supported, is there something else I should be doing before making such a call? Or is there a better way of doing this?
My main concern is that the call which appears to be working is actually doing something bad that I'm just not seeing immediately and might cause unexpected problems later.
Thanks for any insights! :-)
|
|
|
| GOTO (arithmetical expression) |
|
Posted by: JBGV - 2011-05-09, 09:23 PM - Forum: Help & Support
- Replies (2)
|
 |
Hello!
Could anyone tell me how I can simulate "GOTO (arithmetical expression)":
ex:
Code: N can have a value between 1 and 20
GOTO (1000+(N*10))
I need to assign values to an array depends on the value "N", I had thought something like this:
Code: ASM
ORG 62000
DEFB 12,5,8,11,12,11,4,11,(...)
END ASM
DIM P(7) AS UBYTE
...
N=20
...
FOR B=0 TO 7
P(B)=PEEK (62000+N+B)
NEXT B
Is this efficient?
Is there a danger that the program itself erase the data stored at positions 62000?
THANKS
|
|
|
| Simple RLE Decompressor |
|
Posted by: LCD - 2011-04-30, 12:47 AM - Forum: Wishlist
- Replies (5)
|
 |
Maybe not a bad idea: a decompress function for RLE encoded binaries (starting with dbyte contains length of compressed and a flag byte). Maybe something like UnRLE(sourceaddress,destinationaddress) returning the length of decompressed bytes or alternative, if the starting bytes are missing: UnRLE(sourceaddress,destinationaddress,length,flagbyte), or even with bank switching management. This will allow to pack more graphical and level-data into our programs. Maybe a job for britlion, to write a fastcall routine? This can be used for all Z80 computers then.
|
|
|
| Reading files from disk |
|
Posted by: na_th_an - 2011-04-28, 11:14 AM - Forum: How-To & Tutorials
- No Replies
|
 |
Maybe this is obvious, but let me ask - is there any way to read a BYTES file from disk (I mean, plan +3 disks) from a program compiled in ZX Basic to RAM? I mean, without having to exit the program and go back to plain BASIC to do so. Maybe through ROM calls? Any info on this would be greatly appreciated. I'd like to design some kind of system to make graphic adventures which load stuff from disk.
|
|
|
| IF Nesting problem and +D Emulation (*solved*) |
|
Posted by: LCD - 2011-04-20, 12:42 AM - Forum: Bug Reports
- Replies (2)
|
 |
Code: while (a band 16)=0
h=a band 5
v=a band 10
if oldh=4 then
if h=5 then newx=x+1
elseif h=0 then newx=x-1
end If
else if oldh=5 then
if h=1 then newx=x+1
elseif h=4 then newx=x-1
end If
else if oldh=1 then
if h=0 then newx=x+1
elseif h=5 then newx=x-1
end If
else if oldh=0 then
if h=4 then newx=x+1
elseif h=1 then newx=x-1
end If
end If
wend
The compiler does not like this, and revolts against WEND (should it not work?), but after removing some IFs this works:
Code: while (a band 16)=0
h=a band 5
v=a band 10
if oldh=4 then
if h=5 then newx=x+1
elseif h=0 then newx=x-1
end If
end If
wend
And I also noticed that one of my games crahes the Spectrum if ZX Spin is started with enabled +D emulation. Boriel, could you check all your compiler tests with ZX Spin and enabled +D? The game preview of QFJ I sent to you some time ago: If I try to play, the gems cannot be swaped. Without +D Emulation anything works okay.
|
|
|
| Paper/Border rerun bug |
|
Posted by: Darkstar - 2011-04-12, 11:34 PM - Forum: Bug Reports
- Replies (5)
|
 |
Code: 10 BORDER 4
20 CLS
30 PRINT AT 1,9;INK 3;"Hello World from Assi";
40 END
Hi,
The above code gives green paper with a magenta in ink in the text
message when run the second time from the BASIC loader.
|
|
|
| DIM x as String = ? |
|
Posted by: LTee - 2011-04-07, 01:36 PM - Forum: Wishlist
- Replies (3)
|
 |
Hi everyone!
Should this work?
Code: DIM x as String = "test"
I get the following error when I try to compile:
Code: Initializer expression is not constant.
Doing this instead is fine:
Code: DIM x as String: x = "test"
I'm using the latest 1.2.8s696, by the way.
|
|
|
| Japan Tsunami Appeal (open ZX firmware) |
|
Posted by: cheveron - 2011-04-04, 09:34 AM - Forum: ZX Basic Compiler
- Replies (8)
|
 |
As some of you will be aware, I've been tinkering with an open source version of SE Basic that could be distributed with hardware without infringing Amstrad's copyright. I'm pleased to say the project is now viable, although it is not yet written.
I've also said I would only release it in exchange for a sack of cash. So let me quantify that: I want 100 people to donate a minimum of £10/€10 each to the Red Cross Japan Tsunami Appeal.
You can sign up here:
http://www.pledgebank.com/opense
If you are based in the UK you can make your donation here:
http://www.redcross.org.uk/Donate-Now/Ma...ami-Appeal
If you are based in Spain you can make your donation here:
http://www.cruzroja.es/portada/
I know it's called pledgebank but I want you to donate now. This is an honour system. If you say you've donated £10/€10 or more I'll assume you have.
Please sign up by July 1st.
Thank you.
-Andrew
P.S. I have donated £10 to get the ball rolling
The total has now reached 17 (13 of which have paid up already). It would be lovely to get to 20 this week. So to encourage you here's a progress report:
* More than 60% of the ROM is now fully functional and unencumbered by Amstrad code.
* The ROM is functionally compatible with SE Basic 2.21 http://www.worldofspectrum.org/infoseeki...id=0025327
* As far as I can tell, everything that ran on the 2.21 ROM still works.
* New RENUM routine. It only accepts the first two parameters, but it isn't broken either.
* New tokenizer. You can now enter INK and it will automatically be translated to PEN.
* 60 abbreviated commands:
Code: A.TTR ED.IT LO.AD RA.NDOMIZE
BE.EP ER.ASE ME.RGE RE.AD
B.IN E.XP M.OVE REN.UM
BO.RDER FL.ASH NE.XT RES.TORE
BR.IGHT F.ORMAT N.OT RET.URN
CH.R$ GOS.UB ON.ERR R.ND
CI.RCLE G.OTO OP.EN# SA.VE
CLE.AR I.NK OV.ER S.CREEN$
CL.OSE# INKE.Y$ PA.PER SO.UND
C.ODE INP.UT PAL.ETTE ST.R$
CON.TINUE INV.ERSE PAU.SE T.AB
DA.TA L.EN PE.EK TH.EN
D.EFFN LI.NE PL.OT U.SR
DEL.ETE LL.IST P.OINT V.AL$
DR.AW LP.RINT PR.INT VE.RIFY
* Macros for the following tokens:
Code: LOAD, CODE, RUN, SIN, COS, TAN, ASN, ACS
* INSERT ([G]) mode now has it's own cursor (an I beam)
Thanks again to everyone who has already contributed.
|
|
|
| Memory Management |
|
Posted by: britlion - 2011-03-31, 10:48 AM - Forum: Wishlist
- Replies (16)
|
 |
Why not just put your org lower, have your low non speed critical functions, use align to hop to 32768 and stick a defs 6912, 0 to skip your screen buffer zone?
|
|
|
| A For-Next bug in 1.2.8-s682 |
|
Posted by: Darkstar - 2011-03-29, 07:24 PM - Forum: Bug Reports
- Replies (13)
|
 |
This works:
Code: For i = AttrAddress to AttrAddress + NumberOfCells - 1
Poke i, AttrColor
Next i
This does not:
Code: For AttrAddress = AttrAddress to AttrAddress + NumberOfCells - 1
Poke AttrAddress, AttrColor
Next AttrAddress
This would work in other dialects.
Thanks,
Darkstar
|
|
|
|