View Single Post
Old 30 November 2018, 10:42   #13
Daedalus
Registered User
 
Daedalus's Avatar
 
Join Date: Jun 2009
Location: Dublin, then Glasgow
Posts: 6,344
Quote:
Originally Posted by xboxown;1288065[url
https://computerarchive.org/files/computer/manufacturers/computers/Commodore/books/amiga/Compute's_Second_Book_of_Amiga.pdf[/url].
There's also the official AmigaBasic manual here: https://archive.org/details/Amiga_BA...dore/page/n145

Quote:
What are the following conversion commands from AmigaBASIC => Blitz Basic?

AmigaBASIC => BlitzBasic
CLEAR, 25000 => ?
There's a conceptual difference here. Short answer is there's no equivalent in Blitz and it's not needed.
Quote:
RANDOMIZE TIMER => ?
This seeds the random routine, and again, isn't typically needed by Blitz. Ignore it for now.
Quote:
SCREEN 1,320,200,4,1 => ?
Blitz has a Screen command that is similar. The equivalent is Screen 1, 4 for the Blitz shorthand.
Quote:
WINDOW 3,,(0,0)-(311,186),16,1 => ?
Again, Blitz has a Window command too. You need to look at the parameters of the AmigaBasic version and see what the equivalent is in Blitz. Something like Window 3, 0, 0, 311, 186, 0, "", 1, 2 is probably along the lines of what you need, but you need to figure more out from what the original program does.
Quote:
LOCATE 3,111 => ?
Blitz uses WLocate to locate the text cursor within the window.
Quote:
ON TIMER(1) GOSUB => ?
Blitz has an On command that works basically the same way. However, it's the TIMER() function that's the issue here. Blitz handles things in a different way. You should set up your own variable for counting seconds, and increment it based on the Secs function in Blitz. This will return a seconds value but since it's from the clock, not a timer, it will reset to 0 every 60 seconds, so you need to compensate for that.

Quote:
OBJECT.X => ?
OBJECT.Y => ?
OBJECT.Shape => ?
Again, this is handled differently in Blitz, and in a more Amiga-ish fashion. You need to define a Shape object (typically a graphics image loaded from disk), then set up a queue or buffer, then clear the previous shape in the queue, then blit it to a bitmap. If your program needs to work in a window, you can then transfer that bitmap to the window, which is slow. Alternatively, use the screen without a window at all and blit directly to the screen's bitmap for much faster operation.
Quote:
WHILE MOUSE(0) => ?
While is the same, but the MOUSE(0) function needs to be changed AmigaBasic has a funky way of using the MOUSE() function, so you need to base the change on what the program is doing there. At a guess, you could change it to While Joyb(0) = 0, which will carry out the loop until either mouse button is clicked.
Quote:
PAINT(12,95),2 => ?
Floodfill is the equivalent in Blitz. Check the Blitz manual for parameter information.
Quote:
PALETTE => ?
RGB is probably what you're looking for, but again, you need to know what the program is trying to do here.
Quote:
WAVE => ?
SoundData is used in Blitz to manually define a sound waveform, but you need to initialise the sound object first with InitSound.
Quote:
COLOR => ?
WColor is probably the same thing.
Quote:
PUT (for sprite - not disk access) => ?
GET (for sprite - not disk access) => ?
These are another conceptual difference between the dialects, and again, the conversion depends on the intended usage. I take it you mean graphics objects, not actual sprites for this. You might be better off using the screen's bitmap instead of the window here, but the vague equivalents are Blit, BBlit and QBlit for PUT, depending on what the intention is, and GetaShape for GET.

Look, without meaning any disrespect, I think you need to learn a bit more about how both languages work before you can do this conversion. Some of the commands above are the type of thing that's fundamental knowledge in a language, and others need more of an understanding of the program itself to convert. I've linked to both manuals above, so I think you should spend some time getting to know them both. Additionally, Blitz comes with lots of examples on the disks that you can load and run to see how the commands are used.

Porting a program, even to a different dialect of the same language, is rarely as simple as a 1:1 dictionary change of commands. But if you spend some time learning the languages, you'll eventually be able to translate concepts, not just keywords, as well as being able to write your own original programs.
Daedalus is offline  
 
Page generated in 0.04484 seconds with 11 queries