nitrofurano Posted June 29, 2013 Share Posted June 29, 2013 (edited) here is my first attempt on creating Aquarius .rom files from Boriel's ZX-Basic Compiler - i think i'm struggling on the "scramble code" ( http://www.vdsteenov...s/romcheck.html ) or something else? the resulting .rom, the ZX-Basic sources i used, the .asm temporary file (for helping the debug process) and the .sh (bash script on Linux) for the compiling process are all there! the idea was, for now, to do a "cls" with the character 0x41 ("A") and the colour attribute 0x35 (i can't remember now which colours are), and the resulting behaviour looks weird... :S aquarius_borielszxbasiccompiler_experimentalsnippets_201306291704.zip Edited June 29, 2013 by nitrofurano 2 Quote Link to comment https://forums.atariage.com/topic/213965-aquarius-stuff-from-boriels-zx-basic-compiler-first-attempt/ Share on other sites More sharing options...
nitrofurano Posted June 30, 2013 Author Share Posted June 30, 2013 working! \o/ http://img27.imageshack.us/img27/6538/h5jd.png mattelaquarius_borielszxbasiccompiler_example01c_working_201306301404.zip 2 Quote Link to comment https://forums.atariage.com/topic/213965-aquarius-stuff-from-boriels-zx-basic-compiler-first-attempt/#findComment-2784238 Share on other sites More sharing options...
mvdsteenoven Posted June 30, 2013 Share Posted June 30, 2013 working! \o/ Interesting. But the BASIC dialect is not using line numbers, like the original Aquarius Basic? Can you also do commands like SOUND or INKEY$? Regs, Martin Quote Link to comment https://forums.atariage.com/topic/213965-aquarius-stuff-from-boriels-zx-basic-compiler-first-attempt/#findComment-2784431 Share on other sites More sharing options...
Aquaman Posted June 30, 2013 Share Posted June 30, 2013 Sweet! I see potential for the Aquarius. What will be your next step to see how good it will convert some of the more complex Basic Aquarius programs including sound and graphics? Quote Link to comment https://forums.atariage.com/topic/213965-aquarius-stuff-from-boriels-zx-basic-compiler-first-attempt/#findComment-2784442 Share on other sites More sharing options...
nitrofurano Posted June 30, 2013 Author Share Posted June 30, 2013 my idea is try to do for Aquarius (and other hardware like ColecoVision and many others, starting on the z80 ones) the same approach that i did for http://nitrofurano.altervista.org/retrocoding/mc1000 , http://nitrofurano.altervista.org/retrocoding/msx and http://nitrofurano.altervista.org/retrocoding/zxspectrum - the syntax is not exactly like Aquarius Basic, it's more close to ZX-Spectrum Basic, and you can also code like FreeBasic - the only care we should have is to avoid the default ZX-Spectrum commands, and create and/or use libraries that are more specific to each hardware (in the attachments from the weblinks i'm posting in the start of this message you can see these differences clearly ) - for now, i'm struggling on creating Aquarius libraries in Basic (maybe because stack issues on the limited 2kb default ram size?) that i imagine these libraries can work better using some inline assembly (you can code in assembly there, between "asm" and "end asm") - the idea is to be able to draw even bezier curves if needed - and i hope the limit, besides the hardware limitations, is only on the creativity of each coder! 1 Quote Link to comment https://forums.atariage.com/topic/213965-aquarius-stuff-from-boriels-zx-basic-compiler-first-attempt/#findComment-2784508 Share on other sites More sharing options...
Aquaman Posted June 30, 2013 Share Posted June 30, 2013 my idea is try to do for Aquarius (and other hardware like ColecoVision and many others, starting on the z80 ones) the same approach that i did for http://nitrofurano.a...rocoding/mc1000 , http://nitrofurano.a...retrocoding/msx and http://nitrofurano.a...ding/zxspectrum - the syntax is not exactly like Aquarius Basic, it's more close to ZX-Spectrum Basic, and you can also code like FreeBasic - the only care we should have is to avoid the default ZX-Spectrum commands, and create and/or use libraries that are more specific to each hardware (in the attachments from the weblinks i'm posting in the start of this message you can see these differences clearly ) - for now, i'm struggling on creating Aquarius libraries in Basic (maybe because stack issues on the limited 2kb default ram size?) that i imagine these libraries can work better using some inline assembly (you can code in assembly there, between "asm" and "end asm") - the idea is to be able to draw even bezier curves if needed - and i hope the limit, besides the hardware limitations, is only on the creativity of each coder! Do you suggest that with these libraries it would also be possible to exceed the Aquarius basic limitations like programming the Mini-expander sound chip and controllers? Quote Link to comment https://forums.atariage.com/topic/213965-aquarius-stuff-from-boriels-zx-basic-compiler-first-attempt/#findComment-2784510 Share on other sites More sharing options...
nitrofurano Posted June 30, 2013 Author Share Posted June 30, 2013 about inkey$, i think we can use the Aquarius "Bios" somehow? i think that we can also use the keyboard i/o port, also as a library, and be able to check multiple simultaneously pressed keys, like this game also coded on Boriel's ZX-Basic Compiler ( http://nitrofurano.altervista.org/retrocoding/zxspectrum/misc/bacaball.html - sources found at http://www.mojontwins.com/csscgc2011/nitrofurano-bacaball/ - among other stuff coded on ZX-Basic for ZX-Spectrum can be find at http://www.boriel.com/wiki/en/index.php/ZX_BASIC:Released_Programs#Bacaball ) Quote Link to comment https://forums.atariage.com/topic/213965-aquarius-stuff-from-boriels-zx-basic-compiler-first-attempt/#findComment-2784515 Share on other sites More sharing options...
nitrofurano Posted June 30, 2013 Author Share Posted June 30, 2013 (edited) Do you suggest that with these libraries it would also be possible to exceed the Aquarius basic limitations like programming the Mini-expander sound chip and controllers? just for you having some idea, you can code in 100% assembly there, in 100% basic, or something between them - for example, if you can do all you are asking in assembly, you surely will do in ZX-Basic Compiler as well - the "strategy" will be on coding in Basic what you struggle to do in Assembly (like complex calculations), and coding in Assembly what you struggle to do in Basic (like specific stuff like accessing bios, i/o access with disable interruptions, optimized code for better performance, and so on), and the flexibility of the custom libraries you might create and/or use are very helpful there Edited June 30, 2013 by nitrofurano Quote Link to comment https://forums.atariage.com/topic/213965-aquarius-stuff-from-boriels-zx-basic-compiler-first-attempt/#findComment-2784516 Share on other sites More sharing options...
nitrofurano Posted June 30, 2013 Author Share Posted June 30, 2013 that is why i'm sharing the temporary .asm files on all MSX and Aquarius codes - there you can see how the compiler works, and where it is being more or less efficient (normally it is far above my expectations! ) Quote Link to comment https://forums.atariage.com/topic/213965-aquarius-stuff-from-boriels-zx-basic-compiler-first-attempt/#findComment-2784519 Share on other sites More sharing options...
Aquaman Posted June 30, 2013 Share Posted June 30, 2013 Okay, I understand! 1 Quote Link to comment https://forums.atariage.com/topic/213965-aquarius-stuff-from-boriels-zx-basic-compiler-first-attempt/#findComment-2784531 Share on other sites More sharing options...
nitrofurano Posted July 1, 2013 Author Share Posted July 1, 2013 updating a bit: http://img708.imageshack.us/img708/407/17n1.png i'm using aquariusdelay instead of aquariuswaitvbl (because i'm still struggling on how to get vbl working), and started to try to find out how the keyboard i/o port works (no idea how to use it yet, i only know it is in the port $FF) - the idea is, for now, trying to move that "sprite" with the keyboard... aquarius_borielszxbasiccompiler_example01e_delay_keymap_201307011817.zip 1 Quote Link to comment https://forums.atariage.com/topic/213965-aquarius-stuff-from-boriels-zx-basic-compiler-first-attempt/#findComment-2784968 Share on other sites More sharing options...
+Gemintronic Posted July 1, 2013 Share Posted July 1, 2013 yes.. YES!! Soon ZX Basic will rule over the Aquarius with a light-grey fist! I say you incorporate the Aquarius font into EVERY port of ZX basic from the Coleco to the SG-1000 so every 8 bit system can bask in the one true bitmapped font! 3 Quote Link to comment https://forums.atariage.com/topic/213965-aquarius-stuff-from-boriels-zx-basic-compiler-first-attempt/#findComment-2784977 Share on other sites More sharing options...
nitrofurano Posted July 1, 2013 Author Share Posted July 1, 2013 i started to move the "sprite" with the keyboard ("wasd" keys), but i don't know what causes that weird behaviour (only moving on part of the screen) example01f_delay_keymap.zip 1 Quote Link to comment https://forums.atariage.com/topic/213965-aquarius-stuff-from-boriels-zx-basic-compiler-first-attempt/#findComment-2784981 Share on other sites More sharing options...
nitrofurano Posted July 2, 2013 Author Share Posted July 2, 2013 another update: fixed the "sprite" and added some code - the keymap and waitvbl library is still about to be fixed (for now, "wsad" keys are the same as "tgfh" and "ikjl"; waitvbl i still have no idea how to work, specially in assembly - sometimes; the cls library have some kind of 1-byte offset weird behaviour that i think is caused by some interrupt noise, but if i add some "di" or "ei" between "asm" and "end asm", the code doesn't compile... :S ) aquarius_borielszxbasiccompiler_example01g_delay_keymap_201307021005.zip 2 Quote Link to comment https://forums.atariage.com/topic/213965-aquarius-stuff-from-boriels-zx-basic-compiler-first-attempt/#findComment-2785463 Share on other sites More sharing options...
nitrofurano Posted July 2, 2013 Author Share Posted July 2, 2013 found how the keymap works, from http://archive.kontek.net/aqemu.classicgaming.gamespy.com/Files/aqromdis.txt ! (thanks @catsfolly for confirming, and explaining clearly at http://atariage.com/forums/topic/214096-aquarius-reading-the-keymap-io-port-in-assembly/ ! ) example01h_delay_keymap.zip 3 Quote Link to comment https://forums.atariage.com/topic/213965-aquarius-stuff-from-boriels-zx-basic-compiler-first-attempt/#findComment-2785577 Share on other sites More sharing options...
Pset Posted January 12, 2014 Share Posted January 12, 2014 (edited) Seven months later here's a windows batch file to get the example compiled. The batch file included in previous downloads pointed to a py file that didn't exist on my install. I pointed to the .exe's in this script. I also added the ZX BASIC COMPILER folder to my PATH Need to install the dd program you see running in the script. I did an 8 our GetGnuWin install for that tiny app (and trying to figure out why lua won't build rrrrrhg!) . Maybe you just get the app. I removed the end part that launches MESS because mess, messUI, and mame all complains to me about not finding the aquarius roms that are installed when launched on command line. It also hangs if you are not actually build your rom in the Roms folder. REM Windows Batch to compile Boriel's ZX BASIC REM To Aquarius Computer System Rom REM remove old build rm example01.asm example01.rom REM ZXB is the main SDK executable. It can act both as a compiler or as a translator: zxb library/aquariusromheader.bas --org=0x0000 REM copy header into temp file dd ibs=1 count=16 skip=0 if=aquariusromheader.bin of=example01.tmr REM rm removes objects rm aquariusromheader.bin REM compiling the basic program to cartridge memory zxb example01.bas --asm --org=0xE010 zxb example01.bas --org=0xE010 cat example01.bin >> example01.tmr REM create an 8K empty file dd if=Null of=_dummybytes.bin bs=8192 count=1 seek=8192 REM fill the empty with the temp cat _dummybytes.bin >> example01.tmr REM clean up old build files rm _dummybytes.bin example01.bin REM write 8k of temp file to ROM file dd ibs=1 count=8192 skip=0 if=example01.tmr of=example01.rom rm example01.tmr Edited January 12, 2014 by Pset Quote Link to comment https://forums.atariage.com/topic/213965-aquarius-stuff-from-boriels-zx-basic-compiler-first-attempt/#findComment-2904399 Share on other sites More sharing options...
+Gemintronic Posted January 12, 2014 Share Posted January 12, 2014 Is nitrofurano still working on this? It seemed like he started porting ZX Basic to even more platforms and then stopped updating this. 1 Quote Link to comment https://forums.atariage.com/topic/213965-aquarius-stuff-from-boriels-zx-basic-compiler-first-attempt/#findComment-2904403 Share on other sites More sharing options...
Pset Posted January 12, 2014 Share Posted January 12, 2014 (edited) Probably not but the software works on Aquarius emulator and that's a huge leap. No sense in waiting on one man to do any job. Running man keeps on running! Which reminds me I got post my C code running man. Soon as I recompile and test it a dozen times. Ok looks like that batch doesn't do enough, the 8K rom it made doesn't load. Edited January 12, 2014 by Pset 2 Quote Link to comment https://forums.atariage.com/topic/213965-aquarius-stuff-from-boriels-zx-basic-compiler-first-attempt/#findComment-2904406 Share on other sites More sharing options...
Pset Posted January 13, 2014 Share Posted January 13, 2014 (edited) EUREKA! Build Boriels ZXBASIC for the Aquarius Computer on Windows http://www.boriel.com/ http://www.boriel.com/forum/post4589.html?hilit=aquarius#p4589 Add the BASIC ZX COMPILER directory to your PATH Environment Variable. Apparently there's some scripts to run in the setup I didn't read about, and I did added my path manually. Open up a Command Line program. CD to the directory of the .bas file you want to compile (this project) run example01.bs on unix or run example01.bat on Windows. The result should be a new 8K example01.rom And a bunch of other build files I left in there, for now, in case things go wrong. Load Virtual Aquarius or Mess Load the example01.rom into the catridge port Restart the emulated computer Behold the glory. Example02 is a sprite demo, WASD and IJKL keys run sprites around, think a third set of keys to. Enjoy programming on your Aquarius Home Computer System. The Original ROMs are included for testing, again, if things go wrong. REM Windows Batch to compile Boriel's ZX BASIC REM To Aquarius Computer System Rom REM cleanup disabled, build files left behind REM Edit this batch file to work cleaner REM Enjoy your time compiling Boriel's ZX BASIC. @ECHO OFF REM Write Null file ECHO NULL > Null REM remove old build rm example01.asm example01.rom REM ZXB is the main SDK executable. It can act both as a compiler or as a translator: zxb library/aquariusromheader.bas --org=0x0000 REM copy 16 BYTES header into temp files dd ibs=1 count=16 skip=16 if=aquariusromheader.bin of=example01.tmr REM the line below is the for linux? what the line above does. REM dd ibs=1 count=$((0x0010)) skip=$((0x0010)) if=aquariusromheader.bin of=example01.tmr REM remove build temp file REM rm aquariusromheader.bin REM compiling the basic program to cartridge memory zxb example01.bas --asm --org=0xE010 zxb example01.bas --org=0xE010 cat example01.bin >> example01.tmr REM create an 8K empty file my settings may be wrong. dd if=Null of=_dummybytes.bin bs=8192 count=1 seek=1024 REM here's the unix version REM dd bs=8192 count=1 if=/dev/zero of=_dummybytes.bin REM fill the empty with the TMR file cat _dummybytes.bin >> example01.tmr REM cleaning up old build files REM rm _dummybytes.bin example01.bin ECHO Writing 8k of TMR file to ROM file dd ibs=1 count=8192 skip=0 if=example01.tmr of=example01.rom REM remove TMR REM rm example01.tmr REM remove Null REM rm Null REM Launch emulator disabled for now REM mess aquarius -skip_gameinfo -resolution1 640x400 -aspect0 8:6 -cart1 example01.rom BuildBorielsZXBASIC.zip Edited January 13, 2014 by Pset 1 Quote Link to comment https://forums.atariage.com/topic/213965-aquarius-stuff-from-boriels-zx-basic-compiler-first-attempt/#findComment-2905453 Share on other sites More sharing options...
Aquaman Posted January 13, 2014 Share Posted January 13, 2014 Wow, another major breakthrough achieved!! Quote Link to comment https://forums.atariage.com/topic/213965-aquarius-stuff-from-boriels-zx-basic-compiler-first-attempt/#findComment-2905504 Share on other sites More sharing options...
+Gemintronic Posted January 13, 2014 Share Posted January 13, 2014 Looks like I need some other things besides dd to make this work. The batch file calls: rm cat zxb The first two sound like unix commands I'm guessing the last one is zx basic but I can't find where I download the Aquarius version UPDATE: I think I've tracked down rm and cat for Windows. Whatever version of dd I try gives various errors in Windows 8. I think it's more related to each revision supports different options. Is there is link to the specific dd that worked? 1 Quote Link to comment https://forums.atariage.com/topic/213965-aquarius-stuff-from-boriels-zx-basic-compiler-first-attempt/#findComment-2905512 Share on other sites More sharing options...
Pset Posted January 13, 2014 Share Posted January 13, 2014 (edited) now that 8 hour GnuWin install shows what it did. rm statements just do clean up of files you wont need when its done. But since stuff dont work perfect yet, lets see what does get done. The one I left in the script is supposed to be commented out with REM for now. I'd like to say Cygwin should have the commands you need. But nope doesn't have cat, and i'm having a hell of a time making copy do what cat did. I'm getting an extra two bytes of data at the start of my ROM. And I don't know where they come from. oh Nope, I'm losing the bytes, lets see. Edited January 13, 2014 by Pset Quote Link to comment https://forums.atariage.com/topic/213965-aquarius-stuff-from-boriels-zx-basic-compiler-first-attempt/#findComment-2905564 Share on other sites More sharing options...
+Gemintronic Posted January 13, 2014 Share Posted January 13, 2014 I made one step forward and one step back I installed the setup-x86_64.exe from cygwin and went for the base packages. I installed the zxbasix-1.2.9.msi from Boriels site. I unpacked BuildBorielsZXBASIC.zip to its own dire3ctory on the root of my hard drive. This is the result when I attempt to run the batch files: C:\BuildBorielsZXBASIC>WinBuildBorielsZXBasic01.batC:\BuildBorielsZXBASIC>REM Windows Batch to compile Boriel's ZX BASICC:\BuildBorielsZXBASIC>REM To Aquarius Computer System RomC:\BuildBorielsZXBASIC>REM cleanup disabled, build files left behindC:\BuildBorielsZXBASIC>REM Edit this batch file to work cleanerC:\BuildBorielsZXBASIC>REM Enjoy your time compiling Boriel's ZX BASIC.rm: cannot remove `example01.rom': No such file or directoryWriting 8k of TMR file to ROM fileC:\BuildBorielsZXBASIC>WinBuildBorielsZXBasic02.batC:\BuildBorielsZXBASIC>REM Windows Batch to compile Boriel's ZX BASICC:\BuildBorielsZXBASIC>REM To Aquarius Computer System RomC:\BuildBorielsZXBASIC>REM cleanup disabled, build files left behindC:\BuildBorielsZXBASIC>REM Edit this batch file to work cleanerC:\BuildBorielsZXBASIC>REM Enjoy your time compiling Boriel's ZX BASIC.rm: cannot remove `example01.rom': No such file or directoryWriting 8k of TMR file to ROM file Quote Link to comment https://forums.atariage.com/topic/213965-aquarius-stuff-from-boriels-zx-basic-compiler-first-attempt/#findComment-2905565 Share on other sites More sharing options...
+Gemintronic Posted January 13, 2014 Share Posted January 13, 2014 now that 8 hour GnuWin install shows what it did. rm statements just do clean up of files you wont need when its done. But since stuff dont work perfect yet, lets see what does get done. The one I left in the script is supposed to be commented out with REM for now. I'd like to say Cygwin should have the commands you need. But nope doesn't have cat, and i'm having a hell of a time making copy do what cat did. I'm getting an extra two bytes of data at the start of my ROM. And I don't know where they come from. This seems to have cat http://gnuwin32.sourceforge.net/packages/coreutils.htm AS a side note dd seemed to work better if I went into compatibility mode and set it to run as administrator. Quote Link to comment https://forums.atariage.com/topic/213965-aquarius-stuff-from-boriels-zx-basic-compiler-first-attempt/#findComment-2905566 Share on other sites More sharing options...
Pset Posted January 14, 2014 Share Posted January 14, 2014 (edited) Amazing what getting up and taking a break will do. Here's the skinny CAT free version using Windows COPY. I'd call it clean, but it leaves your drive with like six files every build. We'll have to figure out a good clean up method next time on Aquarius Guide To Home Computing. Update attached. Your console output only shows the little header information. ECHO is off, after that. change it to ON to see what really happens. The Boriel install instructions have some mention of getting the path to the app right. I'd start there (but I didn't lol, woops). Else add a semi-colon and any path to your PATH, in this case its starting fresh with z88dk I ended up having to add \bin to that path, watch those folders. Shift+right click a folder that contains exe's and "Copy as path" then paste into your PATH variable input, clean up the quotes and make sure your PATH looks something like C:\DEV\ZXBasicCompiler;C:\Users\Pset\AQUARIUS2014;C:\AnotherFolder\etc REM Windows Batch Compiler Script REM For Boriel's ZX BASIC to Aquarius Computer Catridge ROM REM No RM version 1.0 January 13 2014 REM Write Null file, very important ECHO NULL > Null REM ZXB is the main SDK executable. It can act both as a compiler or as a translator: REM http://www.boriel.com/en/software/the-zx-basic-compiler/ REM this command creates a binary machine code compilation of the 8k catridge header REM see library/aquarisromheader16kb.bas for bigger cart. zxb library/aquariusromheader.bas --org=0x0000 REM copy 16 BYTES header into temp files dd ibs=1 count=16 skip=16 if=aquariusromheader.bin of=example01.tmr REM compiling the basic program to cartridge memory zxb example01.bas --asm --org=0xE010 zxb example01.bas --org=0xE010 REM append rom header binary to assembly code binary copy example01.tmr /b + example01.bin /b example01.tmr REM create an 8K empty file my settings may be wrong. dd if=Null of=_dummybytes.bin bs=8192 count=1 seek=1 REM append the temp binary data with space to fill the 8k rom copy example01.tmr /b + /b _dummybytes.bin example01.tmr /b REM cleaning up old build files REM rm _dummybytes.bin example01.bin ECHO Writing only 8k of TMR binary to ROM file dd ibs=1 count=8192 skip=0 if=example01.tmr of=example01.rom BuildBorielsZXBASIC_Post23.zip Edited January 14, 2014 by Pset Quote Link to comment https://forums.atariage.com/topic/213965-aquarius-stuff-from-boriels-zx-basic-compiler-first-attempt/#findComment-2905624 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.