What I'm thinking of is to write a C128 cross development package such that you can write C= BASIC 7.0 code, and then use a modified version of VICE as the debugger. The editor in the 128 was revolutionary at the time, but of course today's dev environments are much better. I thought about debugging directly from the dev environment, but I don't really want to re-write the entire BASIC 7.0 language and deal with the problem of POKE-ing around in memory.
Id like to hear your thoughts about such a project, and what you would like to see included. Remember, the core functionality that I want to include are:
1 - Ability to write BASIC 7.0 BASIC code. Typical File..Open/Save functions to *.bas text files, MDI user interface
2 - Ability to search / replace, cut/copy/paste
3 - Auto line numbering as optional
4 - An optional means to use structured programming (Sub SubName ... End Sub) which are translated into line numbers when executed.
5 - Ability to hook into VICE to execute and step through code. This is a biggie. With all of the interesting 128 memory locations around BASIC code execution, some time spent studying, I dont see why this isnt possible
6 - Ability to "watch" variables. Shouldnt be difficult either once we can hook into VICE since variables are typically nicely isolated in BANK 1
7 - Ability to set breakpoints. Im sure zero page somewhere stores the current line number. Then pausing the VICE emulation when the selected breakpoint is hit.
8 - A simple monitor perhaps? It would be nice to be able to see memory since many BASIC programs write to RAM.
9 - Preprocessor directives such as #IFDEF, so that you can create debug and release code, or #INCLUDE to add external files to the project, etc
10 - Macros
This is all I can think of for now, but Id like to hear more ideas. VICE's source code gives us ALOT of possibilities in this arena I think.
Sounds great, but I'd change a few things up:
1) Do not use line numbers. In your text editor, use labels. When deploying to VICE and tokenizing, replace the labels with line numbers.
2) Allow pre-processor codes in your text editor for linking together .bas files
Thanks Payton, will take those into consideration. What I have done so far is modify VICE 1.19 to include a TCPIP server, which will allow you to connect and send commands to VICE. Obviously there has to be some mechanism to peek/poke to memory from the development server, so I figured adding a TCPIP server to VICE was probably the best way. You connect to VICE via port #6400.
Im hoping to get the code included in the official build of VICE, so Ill include some commands which would make it general purpose. Im initially thinking:
Command and parameters are space delimited, return values are 0 = OK, negative value = error code
POKE
returns 0 if ok, otherwise and error code
PEEK
returns value from memory or error code
These two commands ought to get us access to zero page, hence variables, current line number, etc, as well as be really useful for other projects. BTW, the socket is non-blocking, and Im pretty sure I have a good means of dealing with CPU cycle speed, so it doesn't appear to affect the virtual machine's speed any.
I have the poke command working. Once peek is added and its stable, Ill upload the x64.exe file here. Right now its proof of concept, so I havent added it to x128.exe yet or any of the others. Im still learning how the VICE code is setup, but it's pretty modular, so adding it to the other emulations should be simple.
Great Job! This will be very useful.
Do you have the modified source available ? I'm guessing this could connect to a modem emulator (NetSerial or such) ? If that's so, you could, I imagine, run commie BBS software under VICE.....
Brendon
Yes, the code is done. Tonight Ill gather up the files and the EXE and post them on the board. BTW, I spoke with a member of the VICE team, and he says he might very well be interested in including this in an upcoming release, which would be great.
Quote from: xlar54Yes, the code is done. Tonight Ill gather up the files and the EXE and post them on the board. BTW, I spoke with a member of the VICE team, and he says he might very well be interested in including this in an upcoming release, which would be great.
That's good news - what's your list of changes/mods ?
cheers,
Lance
Ive uploaded the EXE to the downloads section. You guys can get it here:
http://landover.no-ip.com/128/olate/details.php?file=984
Read the readme file, then try it out and let me know what you think. Current has the following commands:
peek
poke
mem
help
quit
Quote from: xlar54Ive uploaded the EXE to the downloads section. You guys can get it here:
http://landover.no-ip.com/128/olate/details.php?file=984
Read the readme file, then try it out and let me know what you think. Current has the following commands:
peek
poke
mem
help
quit
Just to stuff everyone up I've moved this to commodore128.org along with the rest of the emulator files (removed from Olate).
Link to the emulation page : http://commodore128.org/down33.html
Direct download : http://landover.no-ip.com/files/emu/x64-119-tcpip.zip
(Slight renaming of the file, hope you don't mind Scott ? Do you wanna send the source as well ?)
cheers,
Lance
Rename is fine. I didnt upload the source yet, but probably should. Will look into that this evening. Thanks Lance
Quote from: xlar54Ive uploaded the EXE to the downloads section. You guys can get it here:
http://landover.no-ip.com/128/olate/details.php?file=984
Read the readme file, then try it out and let me know what you think. Current has the following commands:
peek
poke
mem
help
quit
Everything works as you state - what are your ultimate plans with this ?
Oz
Well, Id like to write up a development package (PC side) that uses VICE as a BASIC 2.0 and 7.0 debugger. This way you can write programs on the PC, and debug them in VICE. Thats my future goal. There's some other ideas as well that I'm thinking about, and some other folks are doing some things to get their BBSs working with VICE too. Tonight / tomorrow Ill be working on adding watches (when a memory location changes to or from a certain value, to send a message to the server or pause emulation). I want to be careful that this doesnt end up a remote monitor. I want it to stay in real time, whereas the system goes into a paused state when the monitor is invoked.
Some other quick ideas that I can think of include
- automatically "typing" BASIC programs in (import from a text file directly into the keyboard buffer)
- prototype testing I/O / userport hardware designs
- output the screen and input to another device (Commodore 64 via telnet?)
- Network a bunch of C128s together? (why? who knows)
- Hacking software by manipulating memory
- 2 player remote gaming?
These are just quick brainstorming of ideas. Can you guys think of any other ideas where this would be useful?
Quote from: xlar54- 2 player remote gaming?
2 player remote gaming over the Internet :)