![]() |
Fucking Awesome Spectrum Engine (FASE) - Printable Version +- Forum (https://www.boriel.com/forum) +-- Forum: Compilers and Computer Languages (https://www.boriel.com/forum/forumdisplay.php?fid=12) +--- Forum: ZX Basic Compiler (https://www.boriel.com/forum/forumdisplay.php?fid=11) +--- Thread: Fucking Awesome Spectrum Engine (FASE) (/showthread.php?tid=575) |
Fucking Awesome Spectrum Engine (FASE) - antoniovillena - 01-07-2014 Hi We are writing an engine (sprites, tiles, maps) and I would like to interface with ZX Basic. The main thread is here (sorry, it's in spanish) http://www.mojontwins.com/mojoniaplus/viewtopic.php?f=9&t=1461 Now the engine is in alpha stage and there is a SDCC working demo. This is the code: Code: #include "bunuelera.h" My idea is to traslate this code to ZX Basic. The engine set ups a runtime enviroment that leave between 24K and 30K bytes free from $8000 address. Basically there are 2 routines to call: INIT to initialize the engine and FRAME, that put all the stuff in the screen every frame. With this engine you can move between 8 and 16 sprites flicker free at 50fps in 48K and all 128K models. The engine has diferent implementation for each machine (floating bus in 48K, shadow screen in 128K) so the comunication is done by accessing to next memory locations: Code: 5b00 number of screen to paint More info in the first message of the linked thread Regards ----------- Buenas, estamos escribiendo un engine de sprites, tiles y mapas y me gustaría poder usar dicho engine con ZX Basic. En el hilo que enlazo arriba está todo explicado en español. No tengo mucha idea sobre ZX Basic, pero veo que hay una comunidad detrás y me gustaría que me ayudaran a traducir la demo de C a Basic. Saludos Re: Fucking Awesome Spectrum Engine (FASE) - boriel - 01-07-2014 Hi, Antonio! This is, in fact, *fucking awesome* :!: Please, stand by me ![]() Cuenta conmigo!! ![]() Re: Fucking Awesome Spectrum Engine (FASE) - antoniovillena - 01-07-2014 Thank you very much I am looking the bitfrost engine interface. The main 2 calls can be easy done by: Code: #define INIT \ But in the rest of the code I don't know if make a subroutine or a #define with a POKE. Re: Fucking Awesome Spectrum Engine (FASE) - boriel - 01-07-2014 antoniovillena Wrote:Thank you very muchFor a single Poke, #define is MUCH faster, because it acts as an inline function. You can also use SUB/Function FASCALL <name>(param) for asm functions, if they are a bit more complicated. Re: Fucking Awesome Spectrum Engine (FASE) - antoniovillena - 01-08-2014 Hi I have made some advances in the BASIC code. The demo is functional but not complete, I don't know how to manage the keyboard. I uploaded a file with all necessary files except SjAsmPlus.exe (download it from http://sourceforge.net/projects/sjasmplus/) because 256K file size restriction in the forum. Also change "set _lang=c" to "set _lang=basic" in the second line on makeBu.bat and correct the path of some utilities. When you execute makeBu.bat and all works correctly you have the generated file "game.tap", try it on any ZX Spectrum emulator. Re: Fucking Awesome Spectrum Engine (FASE) - boriel - 01-08-2014 Wow! How fast! ![]() There is already a simple IN (multikeyboard) library management in the standard /library/ directory (see https://github.com/boriel/zxbasic/blob/v1.11.1/library/keys.bas). You can use it with: Code: #include <keys.bas> KEYB, KEYA, etc... are constants defined in the previous source code. Re: Fucking Awesome Spectrum Engine (FASE) - antoniovillena - 01-08-2014 Thank you. Now it's almost done. Unfortunately the demo only shows 6 of the 7 enemies, so I have debugged the Z80 code and found a word write to $5c0b. This position is the DEFADD variable of the 48 ROM. So, is there any way of disable writing to internal variables? Code: #include <keys.bas> Re: Fucking Awesome Spectrum Engine (FASE) - boriel - 01-31-2014 antoniovillena Wrote:Thank you. Now it's almost done.Not yet, but will be available as an option, as many others. I put it in the TODO queue. Re: Fucking Awesome Spectrum Engine (FASE) - antoniovillena - 07-08-2014 Please help. I have this code in C: Code: void *Input; // function pointer declare I want to do something similar in ZX Basic. I know that ZX Basic has not function pointers, but I think that you can find another good solution. Re: Fucking Awesome Spectrum Engine (FASE) - JBGV - 07-08-2014 Awesome !! It will be fantastic to use FASE with Zx basic !! ![]() ![]() Re: Fucking Awesome Spectrum Engine (FASE) - antoniovillena - 07-09-2014 JBGV Wrote:Awesome !! Now It's done. Download package here: http://www.mojontwins.com/mojoniaplus/download/file.php?id=5144 Re: Fucking Awesome Spectrum Engine (FASE) - JBGV - 07-09-2014 Wow! ![]() ![]() I have to study this to see how to use it in a game. Enhorabuena por el trabajo tan enorme !! |