Welcome, Guest. Please login or register.


Author Topic: what about Boriel's zxbasic-compiler targetting Enterprise? (Read 4269 times)

Offline nitrofurano

  • Newbie
  • Posts: 4
hi! since last year i were using Boriel's zxbasic-compiler regularly for creating stuff for zx-spectrum (like for csscgc contest) -

meanwhile most people saw that this cross-compiler has a huge potential far beyond just zx-spectrum - versions for sms (sega mastersystem) and mc1000 (a gem1000 clone) started successfully, and amstrad-cpc and msx versions are on the way -

i started to collect information about a relatively good amount of hardware, Enterprise included - http://www.boriel.com/wiki/en/index.php/ZX_BASIC:Other_architectures

the conversations at the forum there is also very interesting: http://www.boriel.com/forum/zx-basic-compiler/?sid=476c31303133666603d7668cd3966617

can we have something for Enterprise starting from this?


Offline Zozosoft

  • Global Moderator
  • EP addict
  • *
  • Posts: 14723
  • Country: hu
    • http://enterprise.iko.hu/
Re: what about Boriel's zxbasic-compiler targetting Enterprise?
« Reply #1 on: 2012.August.29. 20:56:08 »
It is a very interesting idea!

Very old dream of the users, easy programming in BASIC and enjoying the machnie code speed!
For the Enterprise is exist a compiler, but with many limitations.

The Enterprise is have a very flexible programable hw, easy to simulate other computers enviroment such as ZX Spectrum or Amstrad CPC.

I think the first easy step add to the ZX compiler "EP-ZX" mode, it is add a startup code to the program which is set up the ZX like enviroment for the program. Then main code can be very similar as the ZX compiled version, only some little things (for example IO port numbers) are different.
With this version the existing (and future) ZX BASIC programs also can be compiled to run on Enterprise.
Disadvantage of this version the Enterprise used only as ZX Spectrum...

More enhanced version is a IS-BASIC compiler, which is can compile the existing Enterprise BASIC (IS-BASIC) programs, using the Enterprise operating system (EXOS) capatibilities.

And in the "dream" version some new functions added for direct handling the hw, accessing all capatibilities of the machine.

Offline nitrofurano

  • Newbie
  • Posts: 4
Re: what about Boriel's zxbasic-compiler targetting Enterprise?
« Reply #2 on: 2017.October.29. 14:42:37 »
after getting some help (thanks, Noel Persa!) i could reach the point of the attachment i’m sharing in this comment - it is still not working as expected, but it shows the process i’m trying for that

and the "dream" version is actually the first objective i have in mind - for example, i really want to firstly cover all screen modes, and try to do what i made, for example, for Amstrad-CPC (GX4000)

ZX-Spectrum simulation from Enterprise wasn’t a goal i had in mind, but i’m also curious about

Offline geco

  • EP addict
  • *
  • Posts: 7082
  • Country: hu
    • Támogató Támogató
Re: what about Boriel's zxbasic-compiler targetting Enterprise?
« Reply #3 on: 2017.October.29. 15:53:16 »
Here is an example to build a simple 320x200 screen on Enterprise:

Code: [Select]
      macro exos n
                rst   030h
                defb  n
        endm

        org 00f0h
db 00,05
dw fillen
db 00,00,00,00,00,00,00,00,00,00,00,00

startpr ld      sp,0100h

        ld      hl,error        ;store error and soft reset routine
        ld      (0bff8h),hl
        ld      bc,011bh
        ld      d,00h
        exos    16 ;set border to 0 via EXOS

        call    vid             ;get a video segment
        out     (0b3h),a        ;page into page 3
        call    memaddr         ;get Nick address of the video segment
        ld      (vlpb+04h),hl   ;store Nick address of video memory to the LPT
        ld      a,h
        ld      hl,vlpb         ;copy LPT into video memory (now it's z80 address is 0ff00h)
        ld      de,0ff00h
        ld      bc,0070h
        ldir
        or      3fh             ;this part activate copied LPT, 1st calculate value for port (83h,82h)
        rrca                    ;Address of LPT/16 or 0c000h is written to ports 83h,82h
        rrca
        rrca
        rrca
        or      0c0h
        ld      c,a
        ld      a,0f0h
        out     (82h),a         ;low value of LPT/16 or 0c000h
        ld      a,c
        out     (83h),a         ;high value of LPT/16 or 0c000h
;after this 2 port writes Nick starts to display the new screen, which is a 320x200 screen with 16 colours and it can be used 0c000h-0fe7fh
;by changing VLPB+1 you can change colours: 0f2h 256 colour, 0d2h 16 colour, 0b2h 4 colour, 92h 2 colour mode

vid     ld      hl,endprg       ;request a Video RAM from EXOS
        ld      (hl),0
req_seg  exos    24
        jr      z,whatsup
        cp      7fh
        jp      nz,error
whatsup ex      af,af'
        ld      a,c
        cp      0fch
        jr      nc,dontask
        inc     hl
        ld      (hl),c
        jr      req_seg
dontask ex      af,af'
        push    bc
        push    af
back    ld      c,(hl)
        exos    25
        dec     hl
        jr      z,back
        pop     af
        pop     bc
        or      a
        jp       nz,error
        ld      a,c
        ret

memaddr ld      hl,0000h
        rra
        rr      h
        rra
        rr      h
        ret

error   di
        ld      sp,0100h
        ld      a,0ffh
        out     (0b2h),a
        ld      c,40h
        exos    0
        ld      a,01h
        out     (0b3h), a
        ld      a,06h
        jp      0c00dh
;          number of lines, 100h-38h
;               0d2h: b7: video interrupt will occur after this line, b6,b5: now 16 colour, b4: if it is 0 then Nick takes graphics data from the same place for each scan line defined in this LPB, b3,b2,b1: 001 - PIXEL mode
;                   0bh: left margin at 0bh
;                       33h: right margin at 33h
;                            video address1
;                                    video address2
;                                          colour 1-8
vlpb    db 038h,0d2h,0bh,33h,00h,00h,00,00,00h,0dfh,09h,04h,34h,3fh,00h,66h ;video lpb          200
vsync   db 0d2h,02h,3fh,00h,00h,00h,00,00,00,00,00,00,00,00,00,00           ;sync               46
        db 0fdh,00h,3fh,00h,00h,00h,00,00,00,00,00,00,00,00,00,00           ;                   3
        db 0feh,00h,06h,3fh,00h,00h,00,00,00,00,00,00,00,00,00,00           ;                   2
        db 0ffh,00h,3fh,20h,00h,00h,00,00,00,00,00,00,00,00,00,00           ;                   1
        db 0f0h,02h,06h,3fh,00h,00h,00,00,00,00,00,00,00,00,00,00           ;                   16
        db 0d4h,03h,3fh,00h,00h,00h,00,00,00,00,00,00,00,00,00,00           ;                   44

endprg
fillen  equ     $-startpr
« Last Edit: 2017.October.29. 17:07:03 by geco »

Offline nitrofurano

  • Newbie
  • Posts: 4
Re: what about Boriel's zxbasic-compiler targetting Enterprise?
« Reply #4 on: 2017.October.30. 20:57:08 »
excellent help. @geko ! sharing the ZX-Basic Compiler version, including a version based on this .asm you shared here! :)

Offline nitrofurano

  • Newbie
  • Posts: 4
Re: what about Boriel's zxbasic-compiler targetting Enterprise?
« Reply #5 on: 2017.November.05. 20:13:14 »
finally, some examples available in the Boriel’s ZX-Basic Compiler wikipage: http://www.boriel.com/wiki/en/index.php/ZX_BASIC:Released_Programs_-_Enterprise

Offline Zozosoft

  • Global Moderator
  • EP addict
  • *
  • Posts: 14723
  • Country: hu
    • http://enterprise.iko.hu/
Re: what about Boriel's zxbasic-compiler targetting Enterprise?
« Reply #6 on: 2017.November.05. 21:26:18 »
Wow! Great work!

Offline endi

  • EP addict
  • *
  • Posts: 7298
  • Country: hu
  • grafikus, játékfejlesztõ, programozás, scifi, tudományok, vallás
    • Honlapom
Re: what about Boriel's zxbasic-compiler targetting Enterprise?
« Reply #7 on: 2017.November.06. 14:02:25 »
I hope somebody will convert cool games with this. As I remember there are many cool game in Boriel Basic.
Here you can list Boriel games (Main Programming language drowdown menu):
https://sites.google.com/site/speccy21/home
Vigyázat! Szektás vagyok! :)