started targeting msx on zxbasic-compiler

Page 1/2
| 2

By nitrofurano

Champion (300)

nitrofurano's picture

20-09-2012, 18:09

maybe some of you know how amazing is zxbasic-compiler as development tool

because of this, i tried this aproach: http://www.boriel.com/forum/wishlist/started-msx-version-hel...

if anyone know how can we have this working fine, please help! thanks! :)

Login or register to post comments

By PingPong

Prophet (3700)

PingPong's picture

20-09-2012, 20:53

can you explain what do you need please?

By nanochess

Master (222)

nanochess's picture

21-09-2012, 02:41

I've found three bugs in your generated code.

First, there should be a XOR A just before CALL $00C3 (otherwise it won't do its function)

Second, your _msxcolor function doesn't change any color, because you didn't put CALL $0062 after writing vars..

Third, your __CALL_BACK__ variable is being written inside ROM.

Check this http://map.grauw.nl/resources/msxbios.php and this http://map.grauw.nl/resources/msxsystemvars.php ;)

I hope this helps you. :)

By jltursan

Prophet (2505)

jltursan's picture

21-09-2012, 11:31

Although zxbasic-compiler is, obviously, Sinclair BASIC oriented is nonetheless an interesting project. I've heard good things about it and an intermachine development platform is always welcome; but there's already a C-related project (ccz80) that never become popular. I suposse that people is stuck with the classic languages.

A Spectrum user can be pleased with the compiler as he only needs to take its BASIC program and slightly modify it to make it work; but an MSX user must to learn a new BASIC. A piece of cake, of course; but we're all lazy chaps isn't it?.
If the compiler is adapted to match MSX-Basic, it won't be a intermachine tool never more Sad

By nanochess

Master (222)

nanochess's picture

21-09-2012, 15:10

Even if only one person uses this compiler to create a new MSX game program then it's a well worth effort Smile

As far as I remember SDCC was used to create Nerlaska's Monster Hunter Wink

http://www.nerlaska.com/msx/monsterhunter.html

By PingPong

Prophet (3700)

PingPong's picture

21-09-2012, 20:03

jltursan wrote:

Although zxbasic-compiler is, obviously, Sinclair BASIC oriented is nonetheless an interesting project. I've heard good things about it and an intermachine development platform is always welcome; but there's already a C-related project (ccz80) that never become popular. I suposse that people is stuck with the classic languages.

A Spectrum user can be pleased with the compiler as he only needs to take its BASIC program and slightly modify it to make it work; but an MSX user must to learn a new BASIC. A piece of cake, of course; but we're all lazy chaps isn't it?.
If the compiler is adapted to match MSX-Basic, it won't be a intermachine tool never more Sad

I think, a new compiler even with zx basic syntax is a good choice. we msx users have XBasic, sure, but suffers from some limitations:
- reduced space for object code, because it works on basic memory and uses afaik basic memory by itself
- cannot generate independent machine code it is always needed to have in ram so is more a basic accelerator
- there are some limitations like statements that does not compile etc.

Sure for msx the way is a mix of C and assembly, but i think a basic is a step more short from a people that worked in msx basic than learning C or assembly.
So welcome to this project. Let us see of could be done with it!

By nitrofurano

Champion (300)

nitrofurano's picture

22-09-2012, 17:24

i updated that forum thread with another post and another attachment, and the rom file now seems to work (somehow....) - i think the issue is mostly about 'sub fastcall' or 'function fastcall' you can use there in the zx-spectrum version, because it uses 'push' and 'pop' for each more parameters you use there (so it seems to be a stack issue there)

By anonymous

incognito ergo sum (116)

anonymous's picture

23-09-2012, 23:26

Guys, could you please help me. I thought ZX BASIC Compiler is a Windows program which generates Z80 code, ready to use on the ZX Spectrum. So uhm, a cross compiler. I can imagine you want to alter the Windows ZX BASIC Compiler to make it generate Z80 code which can be used on the MSX. But nitrofurano, your available download contains a ROM image (which doesn't work here, by the way). So I guess it's some kind of an MSX ZX BASIC Compiler, based on the original python sources? So it's possible to use this BASIC Compiler on the MSX to generate Z80 code which you can use on the same MSX? I'm confused.

By nitrofurano

Champion (300)

nitrofurano's picture

23-09-2012, 23:55

zxbasic-compiler is a multiplatform cross-compiler, coded in Python, which you can use on Linux, OSX, BSD, Haiku/BeOS, etc., and ReactOS/Windows as well - it's not a ms-windows only program (i don't use ms-windows for more than 5 years... - now i'm a bit 95% Linux, 4% OSX, and 1% Haiku/Aros/etc. ) - Latok, the idea is to have your code in Basic you code on a simple .txt editor (just like Gedit, Kate, Vim, Emacs, etc.), and on a terminal compile it into a binary file (or into a rom image file, tape image file, or whatever) - for zx-spectrum you just need to run zxb.py yourcode.zxb for compiling it (maybe adding some options if you want in a tape file, if you want the .asm convertion, etc.), but in this case, and in the case of other situations (PacMan-Namco arcade, mc1000/gem1000, etc.), i needed a bash script (that .sh you see there in the attachment from my first message in this thread - for ms-windows users, i really don't know how to have a similar .bat script ) for converting the result into a msx-compatible - so, the effort on helping on this cross-development tool were started, any help is very welcome! Smile

By anonymous

incognito ergo sum (116)

anonymous's picture

24-09-2012, 08:15

So you're not altering the zxbasic compiler itself but you are developing a script which makes the compiled result readable on msx? How do you program msx typical stuff then, when you have only the instructions supported in the zx basic compiler? What do you mean with supporting gfx9000 through libraries? How?

By ARTRAG

Enlighted (6504)

ARTRAG's picture

25-09-2012, 00:04

as far as I understand, the whole compiler is coded in Python so it is a script itself
nitro is patching the compiler, the bash script is only to get a binary file in msx format (bloadable ?)

Page 1/2
| 2