Lunar lander and UDG generally
Lunar lander and UDG generally
I ran Lunar lander using a SGC on a bbql.
The udg routine doesn't work, but not sure why?
Actually this picture isn't helpful. Essentially the udgs are coloured letters rather than a lunar lander!
Here is the udg routine...
Not sure what is wrong. Can anyone help?
The udg routine doesn't work, but not sure why?
Actually this picture isn't helpful. Essentially the udgs are coloured letters rather than a lunar lander!
Here is the udg routine...
Not sure what is wrong. Can anyone help?
__________________
And beyond it, the deep blue air, that shows
Nothing, and is nowhere, and is endless.
https://jbizzel.itch.io/
And beyond it, the deep blue air, that shows
Nothing, and is nowhere, and is endless.
https://jbizzel.itch.io/
Re: Lunar lander and UDG generally
Not used BASIC much for a while but shouldn’t line 820 be Restore 860?
Re: Lunar lander and UDG generally
Thanks, it's not fixed the issue, but hasn't seemed to break anything!
__________________
And beyond it, the deep blue air, that shows
Nothing, and is nowhere, and is endless.
https://jbizzel.itch.io/
And beyond it, the deep blue air, that shows
Nothing, and is nowhere, and is endless.
https://jbizzel.itch.io/
-
- Font of All Knowledge
- Posts: 3975
- Joined: Mon Dec 20, 2010 11:40 am
- Location: Sunny Runcorn, Cheshire, UK
Re: Lunar lander and UDG generally
Hi,
I tired the game in sQLux and Q-emulator, the UDGs are not defined if the RAM s greater than 256K.
The actual programme does not run very well, i fact I would say the author does not understand the QL graphics setup, he is poke-ing into the channel table, which, is no a good idea.
It would be better to define a font and attach it to the QL Channel.
I will update this with a proper UDG Font routine.
I tired the game in sQLux and Q-emulator, the UDGs are not defined if the RAM s greater than 256K.
The actual programme does not run very well, i fact I would say the author does not understand the QL graphics setup, he is poke-ing into the channel table, which, is no a good idea.
It would be better to define a font and attach it to the QL Channel.
I will update this with a proper UDG Font routine.
Regards,
Derek
Derek
Re: Lunar lander and UDG generally
On the QL, "everything is floating". That means that POKEing to fixed addresses is potentially dangerous.
Your POKE in line 810 pokes to memory in the free memory area of the QL . This might or might not be what you assume (you seem to assume that it's a font address in a channel definition block). Apparently, on your system that's not it
(and, as Derek rightly said: That is a clear no-no!). The address of a channel definition block depends very much on your running OS, your Minerva dual-screen settings and the history of opened and closed channels in your system.
You're also POKEing your font not into the allocated memory at a (line 830), but rather (again) into free memory at udg_base. It's a bit of a miracle your code didn't crash the machine.
The proper way to set a font in a channel is actually: Use Toolkit II's (or SMSQ/E's) CHAR_USE function to set the font.
I was thinking about providing an alternative way to do it without TK2, but you seem to be using it, so, so let's make it simple:
Your POKE in line 810 pokes to memory in the free memory area of the QL . This might or might not be what you assume (you seem to assume that it's a font address in a channel definition block). Apparently, on your system that's not it
![Smile :)](./images/smilies/icon_e_smile.gif)
You're also POKEing your font not into the allocated memory at a (line 830), but rather (again) into free memory at udg_base. It's a bit of a miracle your code didn't crash the machine.
The proper way to set a font in a channel is actually: Use Toolkit II's (or SMSQ/E's) CHAR_USE function to set the font.
I was thinking about providing an alternative way to do it without TK2, but you seem to be using it, so, so let's make it simple:
Code: Select all
100 udg_base = ALCHP (<fontsize>)
101 REMark POKE your font starting from udg_base here (line 820+ in your program)
110 CHAR_USE #channel,udg_base,0
ʎɐqǝ ɯoɹɟ ǝq oʇ ƃuᴉoƃ ʇou sᴉ pɹɐoqʎǝʞ ʇxǝu ʎɯ 'ɹɐǝp ɥO
Re: Lunar lander and UDG generally
Thanks for your help, this isn't my code, and I'm not familiar with the tk2 commands.
Having a go though.
When you say font size you mean the size of the data in the data statements?
11*9 bytes, + 2 bytes in the initial data statement, so the frontsize is 808 maybe
Having a go though.
When you say font size you mean the size of the data in the data statements?
11*9 bytes, + 2 bytes in the initial data statement, so the frontsize is 808 maybe
__________________
And beyond it, the deep blue air, that shows
Nothing, and is nowhere, and is endless.
https://jbizzel.itch.io/
And beyond it, the deep blue air, that shows
Nothing, and is nowhere, and is endless.
https://jbizzel.itch.io/
Re: Lunar lander and UDG generally
yep.
cw/you/your program/
![Smile :)](./images/smilies/icon_e_smile.gif)
![Wink ;)](./images/smilies/icon_e_wink.gif)
ʎɐqǝ ɯoɹɟ ǝq oʇ ƃuᴉoƃ ʇou sᴉ pɹɐoqʎǝʞ ʇxǝu ʎɯ 'ɹɐǝp ɥO
-
- Font of All Knowledge
- Posts: 3975
- Joined: Mon Dec 20, 2010 11:40 am
- Location: Sunny Runcorn, Cheshire, UK
Re: Lunar lander and UDG generally
Hi,
Have look at QL Today Vol13 issue 2,3,4 Dilwyn did an excellent article on the use of Fonts.
Have look at QL Today Vol13 issue 2,3,4 Dilwyn did an excellent article on the use of Fonts.
Regards,
Derek
Derek
Re: Lunar lander and UDG generally
Haha, don't worry ![Smile :)](./images/smilies/icon_e_smile.gif)
If only I *HAD* written it
Can you help me with what the new poke should look like?
Is it ...
Assuming I am wrong, but still it shows my workings out....
![Smile :)](./images/smilies/icon_e_smile.gif)
If only I *HAD* written it
![Very Happy :D](./images/smilies/icon_e_biggrin.gif)
![Very Happy :D](./images/smilies/icon_e_biggrin.gif)
Can you help me with what the new poke should look like?
Is it ...
Code: Select all
poke (udg_base +n ), but
__________________
And beyond it, the deep blue air, that shows
Nothing, and is nowhere, and is endless.
https://jbizzel.itch.io/
And beyond it, the deep blue air, that shows
Nothing, and is nowhere, and is endless.
https://jbizzel.itch.io/
Re: Lunar lander and UDG generally
Looks alright, but the CHAR_USE should (logically, I don't think it matters) come after the font is poked.
ʎɐqǝ ɯoɹɟ ǝq oʇ ƃuᴉoƃ ʇou sᴉ pɹɐoqʎǝʞ ʇxǝu ʎɯ 'ɹɐǝp ɥO