CodeWalrus

Development => PC, Mac & Vintage Computers => Topic started by: Snektron on September 07, 2016, 08:25:15 pm

Title: Z80-based pico8 clone?
Post by: Snektron on September 07, 2016, 08:25:15 pm
Recently i came to the idea of making a Z80 based pico8-like platform. I wonder how many people would be interested in such a thing.
I myself find the z80 a pretty cool language, but i kinda lost interest in calculators :/.
It would boot the KOS kernel, but wouldn't use the (standard) programs on it since the project would not aim for calculator like emulation.
Title: Re: Z80-based pico8 clone?
Post by: c4ooo on September 07, 2016, 08:36:02 pm
Interesting, if you do this in java i'll be grateful to help! Are you thinking of mimicking a specific platform, like the TI84 series?
Title: Re: Z80-based pico8 clone?
Post by: Snektron on September 07, 2016, 08:37:19 pm
I have a C++ course on my uni so this would be an excellent opportunity to do some more stuff in it. That and i could use Z80e ;)
Title: Re: Z80-based pico8 clone?
Post by: gameblabla on September 08, 2016, 12:45:54 am
I'm not sure to understand... do you want to create a programming language similar to z80 assembly with
a similar spirit ?
Or you want to create a physical device with a z80 processor in it with its own API similar to pico8 ?
Title: Re: Z80-based pico8 clone?
Post by: Snektron on September 08, 2016, 06:20:19 am
I want to create pico-8 with z80 (or anything that compiles/runs on it) instead of lua
Title: Re: Z80-based pico8 clone?
Post by: Hayleia on September 08, 2016, 06:32:18 am
Not sure either if I understand correctly :P

You want to make a z80-like language that would "compile" in bytecode or something that would run in a "vm" that you wrote too, allowing you to write programs for your PC (or whatever the "vm" is ported too) in that z80-like language?
Title: Re: Z80-based pico8 clone?
Post by: gameblabla on September 08, 2016, 07:19:58 am
Quote from: Cumred_Snektron on September 08, 2016, 06:20:19 am
I want to create pico-8 with z80 (or anything that compiles/runs on it) instead of lua

So you want to make a pico8 API for z80 assembly ? Ok, that makes sense.
Probably the best z80 platform for your project should be the Gameboy : it has a z80 clone in it and a C compiler called GBDK. (as well as an assembler)
The Gameboy also closely follows the pico8 specifications : its resolution is slightly bigger than pico8's one and the art style is the same as the Gameboy color.
Pico8 supports much more sprites on screen though.

If you don't like the gameboy, then have a look at the targets supported by z88dk :
http://www.z88dk.org/wiki/doku.php?id=targets (http://www.z88dk.org/wiki/doku.php?id=targets)

This is what i used to make my Flappy Bird for Vtech Laser 200, it comes with a C compiler and an assembler.
Sega Master system, Amstrad CPC, MSX... the choice is yours.
Title: Re: Z80-based pico8 clone?
Post by: Snektron on September 08, 2016, 08:15:57 am
Quote from: Hayleia on September 08, 2016, 06:32:18 am
Not sure either if I understand correctly :P

You want to make a z80-like language that would "compile" in bytecode or something that would run in a "vm" that you wrote too, allowing you to write programs for your PC (or whatever the "vm" is ported too) in that z80-like language?


No, i want to make a similar "fantasy console", but with Z80 instead of lua. It could run a modified knightos rom, so that gets a bit more pc attention too. The idea is being able to program z80 asm for fun without the need for an actual calculatoe.
Title: Re: Z80-based pico8 clone?
Post by: Hayleia on September 08, 2016, 09:29:21 am
Quote from: Cumred_Snektron on September 08, 2016, 08:15:57 am
Quote from: Hayleia on September 08, 2016, 06:32:18 am
Not sure either if I understand correctly :P

You want to make a z80-like language that would "compile" in bytecode or something that would run in a "vm" that you wrote too, allowing you to write programs for your PC (or whatever the "vm" is ported too) in that z80-like language?


No, i want to make a similar "fantasy console", but with Z80 instead of lua. It could run a modified knightos rom, so that gets a bit more pc attention too. The idea is being able to program z80 asm for fun without the need for an actual calculatoe.

That's what I said actually :P
Except that you seem to want real z80 instead of a z80-like language, and instead of doing your vm completely from scratch, you use KOS as a base (still almost from scratch but not totally).
Title: Re: Z80-based pico8 clone?
Post by: Snektron on September 08, 2016, 12:06:33 pm
Exactly. But i dont know if people would be interested in programming on something like that...
Title: Re: Z80-based pico8 clone?
Post by: ben_g on September 08, 2016, 12:09:11 pm
I think it would be interesting, especially if it would be compatible with actual calculators.
Title: Re: Z80-based pico8 clone?
Post by: DarkestEx on September 08, 2016, 12:09:28 pm
Quote from: Cumred_Snektron on September 08, 2016, 12:06:33 pm
Exactly. But i dont know if people would be interested in programming on something like that...

While it sounds like a nice idea and I know you want to get into some real projects again (btw did you make any progress on the compiler ;)), I don't know what the benefit would be over a real platform like a TI-8x emulator.

Quote from: ben_g on September 08, 2016, 12:09:11 pm
I think it would be interesting, especially if it would be compatible with actual calculators.

That wouldn't be the point because it would be a custom platform. There are already numbers of calculator emulators out there.
Title: Re: Z80-based pico8 clone?
Post by: Hayleia on September 08, 2016, 08:00:00 pm
Quote from: Cumred_Snektron on September 08, 2016, 12:06:33 pm
Exactly. But i dont know if people would be interested in programming on something like that...

I actually thought about something similar but different at some point.
Basically, the same kind of idea as yours, a vm that is able to run a z80-like or ez80-like language natively with color support and maybe the ability to specify the screen features we need (so people who want to port monochrome calc games can specify "monochrome 96x64" and people who want to port color calc games can specify otherwise, and people who don't want to port anything but make their own game in 640x480 can do it too).
Not sure if using KOS as a base is a good idea for that one idea here though.

And the reason why I wanted something like that was to get Axe working on PC :P
Obviously, not the original Axe Parser, which compiles calculator tokens into real z80 language for monochrome calcs (and not into some (e)z80-like language for a potentially color screen) but an Axe Parser that would first support this target (for easier debugging purposes mostly) then maybe the CE since I have no idea if Runer plans on porting it.

But that was more my fantasy project rather than a real project for a fantasy console :P
(I even had names in mind, the (e)z80-like language would have been Axm, Axe would have been Axe, and the whole project would have been the project Legaxy :P)

I felt like it would have some potential.
I mean, golfers and stuff, people who love to write 256 byte codes that do amazing demos etc, they'd most likely be glad to have a platform where they can do what they enjoy and that actually runs on more than just the windows terminal (for example) due to the vm being potentially available on several platforms.
Title: Re: Z80-based pico8 clone?
Post by: DarkestEx on September 08, 2016, 08:16:04 pm
Quote from: Hayleia on September 08, 2016, 08:00:00 pm
Quote from: Cumred_Snektron on September 08, 2016, 12:06:33 pm
Exactly. But i dont know if people would be interested in programming on something like that...

I actually thought about something similar but different at some point.
Basically, the same kind of idea as yours, a vm that is able to run a z80-like or ez80-like language natively with color support and maybe the ability to specify the screen features we need (so people who want to port monochrome calc games can specify "monochrome 96x64" and people who want to port color calc games can specify otherwise, and people who don't want to port anything but make their own game in 640x480 can do it too).
Not sure if using KOS as a base is a good idea for that one idea here though.

And the reason why I wanted something like that was to get Axe working on PC :P
Obviously, not the original Axe Parser, which compiles calculator tokens into real z80 language for monochrome calcs (and not into some (e)z80-like language for a potentially color screen) but an Axe Parser that would first support this target (for easier debugging purposes mostly) then maybe the CE since I have no idea if Runer plans on porting it.

But that was more my fantasy project rather than a real project for a fantasy console :P
(I even had names in mind, the (e)z80-like language would have been Axm, Axe would have been Axe, and the whole project would have been the project Legaxy :P)

I felt like it would have some potential.
I mean, golfers and stuff, people who love to write 256 byte codes that do amazing demos etc, they'd most likely be glad to have a platform where they can do what they enjoy and that actually runs on more than just the windows terminal (for example) due to the vm being potentially available on several platforms.

The idea doesn't sound bad :)
Similarily what I had in mind for my project, though I had a different motivation to start it (which was need of a compact VM language for embedded systems).
Title: Re: Z80-based pico8 clone?
Post by: c4ooo on September 08, 2016, 08:18:34 pm
I guess someone could just take the the wabbit code, remove all the "emulator" UI, and just leave the LCD so it looks like the user is playing the game natively ;)
Title: Re: Z80-based pico8 clone?
Post by: MateoConLechuga on September 08, 2016, 08:35:33 pm
Quote from: c4ooo on September 08, 2016, 08:18:34 pm
I guess someone could just take the the wabbit code, remove all the "emulator" UI, and just leave the LCD so it looks like the user is playing the game natively ;)

To elaborate on this, anyone who can understand how the WabbitEmu source operates and can even read it is a god. Good luck with this :)
Title: Re: Z80-based pico8 clone?
Post by: ben_g on September 08, 2016, 09:09:32 pm
Quote from: c4ooo on September 08, 2016, 08:18:34 pm
I guess someone could just take the the wabbit code, remove all the "emulator" UI, and just leave the LCD so it looks like the user is playing the game natively ;)

I think that's why he was planning to use z80e: it already only shows the LCD. It might be a good idea to scale that a bit though, since the window is a bit small to  play games on it for hours.
Title: Re: Z80-based pico8 clone?
Post by: Snektron on September 08, 2016, 10:37:22 pm
I might strip out the LCD part though and make my own code for that
Title: Re: Z80-based pico8 clone?
Post by: DJ Omnimaga on September 11, 2016, 04:19:02 pm
THis would be a nice idea, although since many people find ASM and sometimes even C too difficult, maybe the Z80-based PICO-8 clone should also include Axe Parser support or maybe some hybrid TI-BASIC. Else your audience will be extremely limited, especially if it only supports monochrome graphics.

In the past I remember there were similar attempts with FreeBASIC, but with TI-BASIC. I think the file might still be available for download but I don't remember if that language supported graphical commands other than text.


Another idea that could be similar is what some people suggested: A tool allowing you to release calc games for the PC by having them embedded in a stripped down WabbitEmu/z80e and they get launched by double-clicking the icon on the PC. But that would require the game to be compatible with KnightOS or be released as an OS, since embedding copies of the TI-84+/CSE ROM would be illegal.
Title: Re: Z80-based pico8 clone?
Post by: Snektron on September 25, 2016, 06:50:25 pm
I got bored so i started developement. Now i need to come up with a name, anyone have suggestions? :P
Title: Re: Z80-based pico8 clone?
Post by: DJ Omnimaga on September 25, 2016, 07:56:21 pm
For a Z80-based Pico-8 clone? Maybe PicoZ80? :P
Title: Re: Z80-based pico8 clone?
Post by: Snektron on September 25, 2016, 07:59:55 pm
I thought of pico-80 but its a little too close to the original for my liking.
Title: Re: Z80-based pico8 clone?
Post by: c4ooo on September 25, 2016, 08:01:08 pm
So, did you use java or C++? :)
Title: Re: Z80-based pico8 clone?
Post by: DJ Omnimaga on September 25, 2016, 10:18:59 pm
Quote from: Cumred_Snektron on September 25, 2016, 07:59:55 pm
I thought of pico-80 but its a little too close to the original for my liking.
It could be named after the calc, such as PICO-84, PICO-84+CE, PICO-PCE or PICO-CE or something.
Title: Re: Z80-based pico8 clone?
Post by: Snektron on September 26, 2016, 03:47:15 pm
Quote from: c4ooo on September 25, 2016, 08:01:08 pm
So, did you use java or C++? :)

I used C++ :P

Quote from: DJ Omnimaga on September 25, 2016, 10:18:59 pm
Quote from: Cumred_Snektron on September 25, 2016, 07:59:55 pm
I thought of pico-80 but its a little too close to the original for my liking.
It could be named after the calc, such as PICO-84, PICO-84+CE, PICO-PCE or PICO-CE or something.


That would be kinda weird though since i dont really aim for calculator compatibility
Title: Re: Z80-based pico8 clone?
Post by: DJ Omnimaga on October 04, 2016, 03:14:58 am
PicoWalrii?

:walrii:
Title: Re: Z80-based pico8 clone?
Post by: Snektron on October 05, 2016, 03:52:04 pm
So i now im at the point where i want to implement the backend for the filesystem,
but i cant really decide between two options:

a) trying to implement an abstraction to a host platforms filesystem through an IO port (easy file transferring to the pico80 system, which means easier developement outside of the system, but possibly very weird to implemet)

b) a file that acts as flash memory (easier to implement but i'd need to make a program to store files from outside the system)

The first option would also mean that i lose more compatebility with the original kos api: most kos filesystem calls return the address relative to 0x4000 of files, which wont be possible...
Title: Re: Z80-based pico8 clone?
Post by: DJ Omnimaga on October 22, 2016, 05:02:40 pm
Would the program to store files from outside the system be difficult to implement?
Title: Re: Z80-based pico8 clone?
Post by: Snektron on October 23, 2016, 08:45:08 am
Ive already implemented it with a file, and now im thinking about how to do that. Ideally the file should go through the OS though, so i need a way to do that. I thought about adding an interrupt device and making the file available as some sort of stream on a port, or something like that.
Title: Re: Z80-based pico8 clone?
Post by: Snektron on November 23, 2016, 05:32:49 pm
I'm still working on this, even though it doesnt go fast. I'm now using Qt to design a gui:
https://sr.ht/sE9l.mp4 (https://sr.ht/sE9l.mp4)
and with icons:
(https://sr.ht/o6UP.jpg)

Note the Pico80 screen is just a placeholder for now. I think im going to split the project into the emulator core and the gui, and add the code as submodule
to the gui project or something.
Title: Re: Z80-based pico8 clone?
Post by: DJ Omnimaga on November 24, 2016, 09:09:01 pm
Will it be possible to use full-screen?

Also nice progress :)
Title: Re: Z80-based pico8 clone?
Post by: Snektron on November 29, 2016, 10:32:25 pm
(https://codewalr.us/proxy.php?request=http%3A%2F%2Fimg.codewalr.us%2Fpico80-snekpreview.png&hash=820a70f6f0dabb7637a44cf44ea403cc)
I've added a log screen too.
I have received some critics regarding the ui on irc though, and i wonder what the best design would be like?
(i like material though :P)
Title: Re: Z80-based pico8 clone?
Post by: Ivoah on November 29, 2016, 11:35:52 pm
Looking great!
Title: Re: Z80-based pico8 clone?
Post by: Unicorn on November 30, 2016, 07:21:39 am
Ooo this is looking quite cool! Will it be able to run all programs from the pico 8? (Sorry if this was answered earlier in the thread)
Title: Re: Z80-based pico8 clone?
Post by: Snektron on November 30, 2016, 09:31:10 am
Thanks you both!
Quote from: Unicorn on November 30, 2016, 07:21:39 am
Ooo this is looking quite cool! Will it be able to run all programs from the pico 8? (Sorry if this was answered earlier in the thread)

Well it uses Z80 assembly :P The idea was actually people can write programs in C and ASM and later some scripting language instead of lua.
If i am able to port lua (which would be very hard since lua is pretty complicated) then it would be cool to add the pico 8 api but i dont think i can see that happening.
Title: Re: Z80-based pico8 clone?
Post by: Snektron on January 09, 2017, 06:53:58 pm
(https://img.codewalr.us/c2037e0c-1989-462c-97d9-9a504fe2d17b.jpg)

Still making progress, i've now added a lot of featues, such as:
- Settings saving
- Redesigned the ui a bit, the card layout wasn't really fit for this.
- Theme file parsing
- Emulator plugins, when you select another plugin its "display" (the left side of the screen that says "No plugin selected or something has gone wrong") is automatically created and added to the view, removing the previous one.
Title: Re: Z80-based pico8 clone?
Post by: DJ Omnimaga on January 20, 2017, 06:36:03 am
What are the plugins? Are they dependencies like with console emulators or something like video players that requires Java or Flash? Or are they add-ons?

Glad to see this is still progressing by the way. Keep us posted :)
Title: Re: Z80-based pico8 clone?
Post by: Snektron on January 20, 2017, 11:52:28 pm
The plugins are what implement the actual emulator. This way multiple emulators can be combined very easily into one program.
For example, when you want to install another emulator you just drop a .dll or .so file in the applications plugin directory.
In the settings menu you can then select from a dropdown menu one of the available emulators.
Title: Re: Z80-based pico8 clone?
Post by: DJ Omnimaga on January 21, 2017, 07:03:21 pm
Ah ok. I assume that the Pico Z80 language is still only for KnightOS, right?
Title: Re: Z80-based pico8 clone?
Post by: Snektron on January 21, 2017, 07:07:27 pm
Ive actually decided to change it. The first plugin i will make will uze z80e to emulate ti hardware, and thus should be able to run knightos.
I will then make a seperate plugin for the pico-8 like idea, still in Z80. The difference is this emulator will have different "hardware", for example a color screen.
Title: Re: Z80-based pico8 clone?
Post by: Snektron on January 27, 2017, 12:29:54 pm
(https://wank.party/5iUM.png)
Im finished with most of the main program, and im now developing the knightos aimed emulator.
As you can see Z80e's (very weirdly made) debugger can be used from the built-in console :)
Also there are tooltips and there is a file picker for flashing roms. A problem (in qt i think) is that the filepicker takes 2-3 seconds to load when you start the program
(even though its not even opened yet).
Title: Re: Z80-based pico8 clone?
Post by: DJ Omnimaga on January 29, 2017, 02:58:00 am
OOoh I like the idea actually, especially with a color screen. :)