Bedazzle wrote: ↑Mon Sep 18, 2023 8:55 pm
Same does Boriel
That's true, but
ugBASIC also has one more thing. It manages tilemaps
natively. In other words, you can draw a tilemap, like the beautiful ones that we are seeing here, using an handy open source tool like
Tiled. Then you can draw (and scroll it) it on ZX Spectrum with just two instructions:
Code: Select all
map := LOAD TILEMAP("map-keeper.tmx")
PUT TILEMAP map FROM 0, 0
There are also instructions for exploring / scrolling the map you are seeing at that moment, or drawing single tiles / element of the game, but in short they are all things that make writing games of this type a bit easier.
ParadigmShifter wrote: ↑Mon Sep 18, 2023 9:27 pm
C is the de facto lingua franca of coders really
Yes, you are right.
The main problem in using C on 8-bit processors lies in the fact that this language (like most others) relies heavily on the use of stack: with the stack you pass parameters to functions, on the stack you allocate variables, and so on. The stack is an overall expensive resource -- much more expensive, for example, than accessing memory directly. So much so that most optimizations in 8 bit cross-compiler C consist of... not using the stack! How? Using global variables, for example.
There are some languages, such as
ugBASIC, that were created specifically to program efficiently on 8-bit processors. Unlike the C language, this language is "stackless". This approach, in addition to allowing you to write very efficient prototypes, allows you to write
multitasking programs with dozens of threads on ZX Spectrum. Multitasking programming allows you to write simpler programs because the logic for each "task" in the game is in a separate procedure.