Results 1 to 10 of 10

Thread: BASIC interpreter

                  
   
  1. #1
    DCEmu Coder
    Join Date
    Apr 2004
    Posts
    227
    Rep Power
    74

    Default BASIC interpreter

    I've just ditched the work I previously did on getting this to work. It was originally based on wxBasic v1, which was a bloody mess. I've re-ported wxBasic v2, using a newer version of KOS this time, and it's much less messy. It's still not very nice to work with - everything is #included from one source file and it has global variables everywhere - but it's an improvement.

    Since I don't have any way to get a working debug console at the moment, could someone test this binary for me?

    http://files.frashii.com/~sp00nz/Doo.../wxcore.elf.gz

    It should output something like this:
    Code:
    Hi!
    wxBasic test program by Stuart Dalton
    Today is 09:22:2004
    The time is 15:29:39
    
    Let's do some math, shall we?
    66 + 23 = 89
    66 * 2 = 132
    chr(66) = B
    len(a_string) = 11
    mid(a_string, 1, 5) = Hello
    right(a_string, 5) = World
    pi = 3.14159
    floor(3.14159) = 3
    
    Testing factorial function
    x x!
    1 1
    2 2
    3 6
    4 24
    5 120
    6 720
    7 5040
    8 40320
    9 362880
    10 3628800
    
    Sinage Function
    xsin(x)cos(x)tan(x)
    0010
    0.6283190.5877850.8090170.726543
    1.256640.9510570.3090173.07768
    1.884960.951056-0.309017-3.07768
    2.513270.587785-0.809017-0.726542
    3.14159-8.74228e-08-18.74228e-08
    3.76991-0.587785-0.8090170.726543
    4.39823-0.951056-0.3090173.07768
    5.02655-0.9510560.309017-3.07768
    5.65487-0.5877850.809017-0.726542
    
    Arrays and random numbers:
    4 5 3 4 6 6 1 1 2 4 3 12 4 8 2 7

  2. #2
    DCEmu Coder
    Join Date
    Apr 2004
    Location
    The Netherlands
    Posts
    43
    Rep Power
    0

    Default Re: BASIC interpreter

    Code:
    KallistiOS ##version##: Wed Sep 1 00:09:38 EST 2004
     blackaura@shadow:/home/blackaura/dreamcast/kos-1.3.161/kos
    thd: pre-emption enabled, HZ=100
    maple: active drivers:
      PuruPuru (Vibration) Pack: JumpPack
      VMU Driver: Clock, LCD, MemoryCard
      Mouse Driver: Mouse
      Keyboard Driver: Keyboard
      Controller Driver: Controller
     DMA Buffer at ac08b440
    vid_set_mode: 640x480IL NTSC
    dc-load console support enabled
    maple: attached devices:
     A0: Dreamcast Controller     (01000000: Controller)
     B0: Keyboard           (40000000: Keyboard)
    Hi!
    [Syntax error]
    Unable to open "test.bas" or "/rd/test.bas"
    
    Syntax error: Unable to open "test.bas" or "/rd/test.bas"
    arch: shutting down kernel
    maple: final stats -- device count = 2, vbl_cntr = 5, dma_cntr = 5
    vid_set_mode: 640x480IL NTSC
    Missing romdisk?

  3. #3
    DCEmu Coder
    Join Date
    Apr 2004
    Location
    Botoru Battalion
    Age
    51
    Posts
    257
    Rep Power
    75

    Default Re: BASIC interpreter

    Had the same result.. suggestion just make it look for it on the root of the cdrom, that way we can easily toss other code at it.

  4. #4
    DCEmu Coder
    Join Date
    Apr 2004
    Posts
    227
    Rep Power
    74

    Default Re: BASIC interpreter

    Actually, the romdisk is there. It just doesn't seem to be working. I had similar problems with the wxBasic v1 source, or it could just be something wrong with (toolchain/KOS/Makefile/insert excuse here)

    It should now be looking for test.bas in /cd

    There's a Windows and a Linux binary in there too. It's just the interpreter, so it'll just text out to stdout. Tries to load test.bas in the current directory, and they both seem to work.

    http://files.frashii.com/~sp00nz/Doo...e_test.tar.bz2

    (Still uploading, so give it a minute or two)

  5. #5
    DCEmu Coder
    Join Date
    Apr 2004
    Location
    Botoru Battalion
    Age
    51
    Posts
    257
    Rep Power
    75

    Default Re: BASIC interpreter

    ??? Never seen this before.. DCLOAD just stays at the (Executing) screen.. gonna try a few more things first, and re-edit this later..

  6. #6

    Default Re: BASIC interpreter

    Here's my debug output if you want to analyze it:

    Code:
    KallistiOS ##version##: Wed Sep 1 00:09:38 EST 2004
     blackaura@shadow:/home/blackaura/dreamcast/kos-1.3.161/kos
    thd: pre-emption enabled, HZ=100
    maple: active drivers:
      PuruPuru (Vibration) Pack: JumpPack
      VMU Driver: Clock, LCD, MemoryCard
      Mouse Driver: Mouse
      Keyboard Driver: Keyboard
      Controller Driver: Controller
     DMA Buffer at ac08ac40
    vid_set_mode: 640x480IL NTSC
    dc-load console support enabled
    maple: attached devices:
     A0: Dreamcast Mouse        (00020000: Mouse)
     B0: Dreamcast Controller     (01000000: Controller)
    Hi!
    fs_iso9660: disc change detected
    wxBasic test program by Stuart Dalton
    Today is 12:10:1998
    The time is 07:49:19
    
    Let's do some math, shall we?
    66 + 23 = 89
    66 * 2 = 132
    chr(66) = B
    len(a_string) = 11
    mid(a_string, 1, 5) = Hello
    right(a_string, 5) = World
    pi = 3.14159
    floor(3.14159) = 3
    
    Testing factorial function
    x x!
    1 1
    2 2
    3 6
    4 24
    5 120
    6 720
    7 5040
    8 40320
    9 362880
    10 3628800
    
    Sinage Function
    xsin(x)cos(x)tan(x)
    0010
    0.6283190.5877850.8090170.726543
    1.256640.9510570.3090173.07768
    1.884960.951056-0.309017-3.07768
    2.513270.587785-0.809017-0.726542
    3.14159-8.74228e-08-18.74228e-08
    3.76991-0.587785-0.8090170.726543
    4.39823-0.951056-0.3090173.07768
    5.02655-0.9510560.309017-3.07768
    5.65487-0.5877850.809017-0.726542
    
    Arrays and random numbers:
    4 4 1 2 4 9 2 1 11 10 7 16 8 12 12 14
    arch: shutting down kernel
    maple: final stats -- device count = 1, vbl_cntr = 27, dma_cntr = 27
    vid_set_mode: 640x480IL NTSC

  7. #7
    Dream Coder
    Join Date
    Apr 2004
    Location
    Miami, FL
    Age
    37
    Posts
    4,675
    Rep Power
    50

    Default Re: BASIC interpreter

    [quote author=BlackAura link=board=pdev;num=1095831458;start=0#3 date=09/23/04 at 01:46:17]Actually, the romdisk is there. It just doesn't seem to be working. I had similar problems with the wxBasic v1 source, or it could just be something wrong with (toolchain/KOS/Makefile/insert excuse here)[/quote]

    Ive had similar problems, where a program just wont work with romdisk (neopop) i remember i made a thread about it on DCemulation, and tried 5 different methods of file access before just switching to CD, changed the makefile, and eventually completely re-ported it, and it still didnt work. kos weirdness i think =P
    If anyone is looking to buy, sell, trade games and support a developer directly at the same time, consider joining Goozex. Enjoy!

  8. #8
    DCEmu Coder
    Join Date
    Apr 2004
    Posts
    227
    Rep Power
    74

    Default Re: BASIC interpreter

    Ah good. That means it works. And it works a lot better than the other version used to, probably because I'm using newlib now instead of the KOS libc.

  9. #9
    DCEmu Coder
    Join Date
    Apr 2004
    Posts
    227
    Rep Power
    74

    Default Re: BASIC interpreter

    Still haven't done any testing on the Dreamcast yet, but I have graphics working in the PC / SDL version.

    The simplest part of the graphics system is now more-or-less done. You can load images, draw them on the screen, and draw simple (and even complex) shapes using an OpenGL-like command set. It automatically does depth sorting and all that stuff, so you can draw transparencies and the like without worrying about sorting it first, just like you don't on a Dreamcast.

    Now all it needs is a Dreamcast implementation. And something resembling a manual...

    I'll see if I can post something a bit later on.

  10. #10
    Won Hung Lo wraggster's Avatar
    Join Date
    Apr 2003
    Location
    Nottingham, England
    Age
    52
    Posts
    139,640
    Blog Entries
    3209
    Rep Power
    50

    Default Re: BASIC interpreter

    very nice

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •