Página 2/2
1 |


Enlighted (6828)

Imagen del ARTRAG

08-01-2022, 13:34

If I understand correctly Marco's idea, the compiler (actually the compilers) will support all the HW features of each platform in order to allow the users to exploit them at their best. The same code will need adaptations to work on different platforms.

Por spotlessmind1975

Supporter (2)

Imagen del spotlessmind1975

09-01-2022, 09:50

Helo ARTRAG and hello PingPong, you are both right.

Software sprites can be a solution in some contexts, but not in others. Hardware sprites can help too, but up to a point.

Take ALIEN STORM for example. In this case I needed to animate dozens of sprites, and moreover on completely different platforms. Software sprites could be a solution but I preferred to do it differently. This program is written in C but it is a "strange" C because it is full of functional and logical constructs that make it another language, which is why I came to write ugBASIC. Because if you have a different approach, you need a different language.

That is, the point is to overcome a purely technical approach to rethink the paradigm, and this to take into due consideration all the correct observations made so far.

To explain me better, I would like you to focus on how images are managed under ugBASIC today. All the platforms that are able to represent a bitmap, directly or indirectly (via tiles), can be candidates to draw an image on the screen. For this there is the primitive PUT IMAGE. This primitive takes the image and the coordinates, and the (specific) compiler does the rest. The image source is a bitmap compatible with the target hardware (hence: efficient by design). The drawing routine is as simple as possible, and easily unrollable (hence: efficient for implementation). The real work is the conversion of the PNG, JPG, .. to the actual image, which happens at compile time.

The same principle can be applied with sprites. You can give one or more primitives that allow the manipulation, at the hardware level, of the sprites, without forcing you to adapt the code if the sprite subsystem changes. If there is anything different, ugBASIC will take care of the differences, and always without introducing an abstraction.

This is why I stated that you can write efficient code for a certain platform and then make it, with little effort, efficient for others or, with more effort, available for every target. The key for everything is isomorphism.

Por thegeps

Paladin (1020)

Imagen del thegeps

11-01-2022, 14:26

If someone here is interested in homeputerium 10liner basic contest, ugBASIC has been accepted for pure120 and extreme256 categories

Página 2/2
1 |