CPCWiki forum

General Category => Emulators => Topic started by: Lone on 23:10, 05 April 16

Title: Sugarbox, a CPC emulator for windows (and raspberry pi, soon).
Post by: Lone on 23:10, 05 April 16
Hello,


Since the last version was a long time ago, here's the new version of my emulator.


Here is what is worth pointing out about this one :


- Handle some disk formats, which it can read and write : DSK, EDSK, HFE, SCP, IPF (IPF is native : no use of SPS CAPS lib is needed)
- Read some more disk format (but can't write it at the moment) : CT-RAW, RAW (from kryoflux)
- Have a special support for 50 or 100Hz screen, for buttersmooth scroller (when sync is ON)
- Z80 emulation is precise : All z80 test from arnoldemu are corrects.
- Can drag'n'drop disk, snapshots, binaries (with AMSDOS header), tape





Current version is v0.26, (from tonight) it's available here : Sugarbox v0.26 | Sugarbox (http://sugarbox.free.fr/?p=142)


Log for this version is following :




- [CT-RAW/IPF]       : Native support of these two format. CAPSLib dll from SPS is no longer used. This will fix some non-working dump( due to bug in the lib).
- [IPF]              : Add a SAVE IPF option. You can save your current disk in IPF format, to generate a 3" disk. You can even write dump with weak sectors.
- [HFE]              : Now it's possible to save HFE file !
- [edsk]             : Added some tuning to handle sector of header size lower than real size.
- [edsk]             : Fixed some nasty memory overrun.
- [edsk]             : Fixed the way of handling overlapped disk : "Corsarios (UK) (1988) (CPM) [Original].dsk" disk now run correctly. In fact, all dsk should now retrieve their original size of 6k/track
- [edsk]             : Fixed support for ALLGAP dumps
- [FDC]              : New paradigm : Weak bits are now handled by bit. Multi-revolution dump are converted to single revolution with weak bits data.
- [FDC]              : Fix a bug with the SZ byte = 0 in read track command (this fixed "War In Middle Earth (UK) (1987) (CPM) [Original].dsk" dump)
- [Tape]             : Add a delay when motor is on/off. This fixed "Last Mission"
- [Z80]              : Interrupt mode 0 is partially fixed : It does nothing, but no longer corrupt the Z80 registers
- [Z80]              : Fix some wrong behaviour of undocumented opcodes
- [Z80]              : Add the undocumented 'Q' register used for Flags, and fix the SCF/CCF instructions regarding this register
- [Z80]              : All Z80 tests from Patrik Rak, adapted to the CPC by Kevin Thacker, are now correct.
- [Display]          : Fixed wrong behaviour for 100%speed with 100hz screen without black frame insertion : Speed was twice what was intendeed
- [General]          : Add Autorun disk on insertion which try to guess the best file to run.
- [General]          : Optimization : Everything is now running 60-80% faster than before
- [General]          : Add a support for auto-executing BIN file (with AMSDOS header), through drag'n'drop.
- [General]          : Fixed the Spanish configuration for 464, and added support for Danish keyboard.
- [General]          : Added -fullscreen command line to enable fullscreen by default
- [General]          : Fixed the "-command" option : In order to run a disc, just launch your command as Sugarbox -command run\"disc\" for example
- [General]          : Added sound for disk drive
- [General]          : Fix copy/paste for english/spanish/danish
- [GUI]              : Added a feedback when loading tape/disk/SNA/SNR
- [GUI]              : Added a preliminary debugger, with Register edition, breakpoints, flags
- [Joystick support] : Fixed diagonals not supported with some joypads (now, games should be far more playable !)
- [Memory]           : Fixed the configuration : 64k computer no longer have improper PAL
- [Settings]         : Fixed some nasty bugs preventing the keyboard settings to work




Title: Re: Sugarbox, a CPC emulator for windows.
Post by: TFM on 19:33, 06 April 16
WoW! Awesome update list!  :)
Title: Re: Sugarbox, a CPC emulator for windows.
Post by: arnoldemu on 10:47, 08 April 16
@Lone (http://www.cpcwiki.eu/forum/index.php?action=profile;u=886): There are some more tests in the cpctests directory (cpu.asm is one which tests interrupt reporting bug for ld a,i/ld a,r on nmos cpus - the types used in cpc. This bug is described by Zilog in their documenation), and one for testing r value for most opcodes (The test doesn't have all opcodes yet). I don't know if zexall or similar test R value.

I will move these into the z80 tests directory.

Also, the tests I converted have the out/in tests disabled because they are made for spectrum and it's ports, so I will be adding tests for those soon so we can confirm these on cpc too.

I am planning:
- a im0 test (which will run on plus; vector can be controlled so I can make a stable test), a more limited one for cpc (may need external device for this one).
- a nmi test (this will need a playcity or similar device that can cause an nmi).

But well done for making the tests run. Sugarbox emulates a Zilog NMOS Z80 :) (and full compatible Z80's).

Title: Re: Sugarbox, a CPC emulator for windows.
Post by: Lone on 12:03, 08 April 16
One more time, thanks a lot for all these tests ! It's really a wonderfull work.


I'm looking forward to any update of this to improve my emulation !


Title: Re: Sugarbox, a CPC emulator for windows.
Post by: arnoldemu on 15:25, 08 April 16
One more time, thanks a lot for all these tests ! It's really a wonderfull work.


I'm looking forward to any update of this to improve my emulation !
You're welcome.

There will be an update soon (a week or two) which includes more crtc tests. You will see it at the same time I make another release of Arnold WIP :)

Title: Re: Sugarbox, a CPC emulator for windows.
Post by: Lone on 23:24, 27 November 16
Hello there,


Here is a new version of Sugarbox (v0.27)


Source : http://sugarbox.free.fr/?p=151


And here's the log :



- [Emulation]        : Add some optimizations. MAX speed should be faster (about 100% gain from v0.26)
- [Emulation]        : Remove memory leaks in IPF writing process
- [Config files]     : Fix the '-' and '_' for french keyboard : "From scratch" now autorun properly.
- [Display]          : Screenshots are fixed : No more unwanted black line at the top.
- [Dump support]     : Fix the code used to compute multi revolution dump, to be more reliable (when a revolution is wrecked, dont use it)
- [FDC]              : Lots of fix in the FDC : The 'acid tests' of arnoldEmu are almost all corrects now.
- [FDC]              : Fix some bugs when reconstructing the tracks (fix some dump of "Le Necreomancien", and various CTRaw files also)
- [FDC]              : The 'Flip' fonction (used to flip double sided dumps) is now working correctly. Double faces IPF are now working
- [FDC]              : '10' bits used for bit synchronisation can be in a smaller number : 40 bits are enough to consider the PLL as correctly fixed between clock/data bits
- [General]          : Fix a deadlock that occurs when a command is used during a dump disk is read
- [General]          : Fix the autotype feature : the feature is more relevant. Also, the "|" character is correctly rtanslated to 'ù' on french keyboard.
- [General]          : Add a function to recording every frame into a screenshot
- [General]          : Autorun feature is a bit more reliable (more rules added)
- [General]          : Added some command line switches : -sn xx (load xx as a Snapshot file), -drivea xx to set xx into drive A, -driveb (same for drive B)
                        -fullscreen to start in full screen mode, -config xx to load xx as config file, -command xx to run xx as basic command at start
- [GUI]              : Fix the incorrect update of "Save as.." menu when inserting a disk.
- [Multiface II]     : Add preliminary support for Multiface II (no config yet)
- [PPI]              : Rewrite most of the 8255 implementation. Now run the 'acid test' properly (when it have meanings)
- [PSG]              : Correct lots of bugs (sound is now a LOT better, and digitized sound works correctly). Fix Dick tracy, Antiriad, Crazy cars 2, and probably a lot more !
- [PSG]              : Also run the 'acid test' of PSG correctly.
- [Z80]              : Support for NMI added
Title: Re: Sugarbox, a CPC emulator for windows.
Post by: Lone on 16:45, 30 June 17
Hello,


New version is available :


http://sugarbox.free.fr/?p=166


Whats new : New z80 core, playcity and multiface II, and lots of bugfix



- [Gate Array]       : Fix mode changing : Imperial Mahjong now looks better !
- [Devices]          : Add support for the Playcity and the Multiface II cards.
- [Z80]              : Complete recoding of the Z80 core. It now use the real M and T states, and handle WAIT states correctly. More accurate.
- [General]          : ZIP support (only zip file at the moment) for tape and disks
- [IPF]              : IPF created is striclty equivalent to the original dump (in term of MFM track)
- [IPF]              : Minor fixes in IPF reading
- [DSK]              : Fix some wrong behaviour. Dsk reading should be more reliable (and will no longer crash)
- [DSK]              : Fix a bug in saving DSK file. It should no longer crash (anyway, if you can avoid using it, prefer HFE or IPF format !)
- [Emulation]        : All peripherals are now running in the correct timings.
- [FDC]              : Index detection fixed on Sector writing (Imperial Mahjong is able to save its configuration)
- [FDC]              : Dump with missing tracks will no longer crash Sugarbox
- [FDC]              : Fix wrong behaviour for double sided dumps that needs flipping of disk (fix altered beast double sided CTRaw)
- [FDC]              : Fix wrong status than can set "Seek end" incorrectly in some cases
Title: Re: Sugarbox, a CPC emulator for windows.
Post by: Carnivius on 19:06, 30 June 17
Very cool.  I like this emulator for it's ease of use and that it lets me use the d-pad of my gamepads rather than forced to use analog stick. :)

Having a bit of trouble with zips though.
If I load them through Disk menu at top it fails with loading error.   And if i try loading them by dragging the zip file into the emulator window it finds it and starts loading but eventually I get the CPC error "Drive A: Read Fail"
Title: Re: Sugarbox, a CPC emulator for windows.
Post by: Lone on 19:18, 30 June 17
Thanks for the remark !


Concerning the zip support, I'll try to fix it (and complete it with other formats)
Is it possible to send me in any way the zip file with this "drive A: read fail" ?
Title: Re: Sugarbox, a CPC emulator for windows.
Post by: roudoudou on 18:11, 11 August 17



Sugar is going Plus  8)


(WIP)
Title: Re: Sugarbox, a CPC emulator for windows.
Post by: ssg on 10:23, 10 November 17
The web site seems to be down?
Title: Re: Sugarbox, a CPC emulator for windows.
Post by: Lone on 11:44, 10 November 17
The web site seems to be down?
 


I Just checked for it now, it's currently available (at least from france)

Title: Re: Sugarbox, a CPC emulator for windows.
Post by: ThomH on 17:58, 10 November 17
  I Just checked for it now, it's currently available (at least from france)

It is however also seemingly unavailable from New York City. free.fr is reachable, but sugarbox.free.fr, which maps to perso153-g5.free.fr, times out.
Title: Re: Sugarbox, a CPC emulator for windows.
Post by: Lone on 19:19, 10 November 17
Trying to connect through a US proxy, I get an error.
With a french proxy, same error.
With my default connexion, everything's fine



Also, everything seems ok from my provider point of view.


So it far beyond my IT skill :/


What I can suggest : If anyone needs any information (or binaries), I'll provide them here.



Title: Re: Sugarbox, a CPC emulator for windows.
Post by: Nich on 22:25, 10 November 17
It is however also seemingly unavailable from New York City. free.fr is reachable, but sugarbox.free.fr, which maps to perso153-g5.free.fr, times out.

I was also unable to access the Sugarbox website using my default connection and I had to resort to using Tor to access it. The same thing happens with Tom et Jerry's site, http://tj.gpa.free.fr/ (http://tj.gpa.free.fr/) .
Title: Re: Sugarbox, a CPC emulator for windows.
Post by: Lone on 19:17, 22 January 18

Hello,


A new release is available.
This release is mainly focus on the PLUS emulation, and a more precise sound emulation.


Version is available here :


http://sugarbox.free.fr/?p=173


What’s new :


Sound have also been been reworked.


I'm aware that the website seems to be unreachable from outside of France. I'll try to find another place to put them (and update this post as soon as I can find something better)



Title: Re: Sugarbox, a CPC emulator for windows.
Post by: Carnivius on 20:56, 22 January 18
Website seems fine to me in England. Downloaded now but am off out to a rehearsal so will give it a go tomorrow. :)
Title: Re: Sugarbox, a CPC emulator for windows.
Post by: tjohnson on 22:27, 22 January 18
Hello,


A new release is available.
This release is mainly focus on the PLUS emulation, and a more precise sound emulation.


Version is available here :


http://sugarbox.free.fr/?p=173 (http://sugarbox.free.fr/?p=173)


What’s new :


  • Complete PLUS family support : 464+, 6128+, GX4000. All ASIC functions are supported (making modern demo like « CRTC3″ or « Eerie forest » functionnal).
  • SNA v3 is supported, with BRKS chunks (breakpoints generated by RASM or Winape)
  • Various fix on full screen management (should not crash anymore)
  • Various fix on DSK management. More dumps should be analyzed correctly
  • IPF support : Generated IPF file should be more reliable (no more crash with Samdisk or DTC from kryoflux)
  • Joystick support is better
Sound have also been been reworked.


I'm aware that the website seems to be unreachable from outside of France. I'll try to find another place to put them (and update this post as soon as I can find something better)


I've never been able to access your website, I'm in the UK and on a mainstream broadband supplier.
Title: Re: Sugarbox, a CPC emulator for windows.
Post by: roudoudou on 22:34, 22 January 18
free provider has trouble today, try in a few days
Title: Re: Sugarbox, a CPC emulator for windows.
Post by: Lone on 14:32, 23 January 18
You can download the latest version from the Emu-france (http://www.emu-france.com/news/54347-ordi-sugarbox-v0-29/) website here (http://www.emu-france.com/?wpfb_dl=6526) :
Title: Re: Sugarbox, a CPC emulator for windows.
Post by: Carnivius on 20:35, 23 January 18
Update seems great.  And I love that it has better joypad configuration than most CPC emulators. 
How do you load carts?  I see a 'default cart' option in the settings and have set the CPC type to 6128 Plus EN but I don't see a load cartridge thing in the menu or button at the bottom like I do with tapes/disks.  I played a bit of Burnin' Rubber just fine.  :)
Title: Re: Sugarbox, a CPC emulator for windows.
Post by: Lone on 21:08, 23 January 18
Sorry, I'll have to do a tutorial once :)


Like any other medias, the best way to load CPR is drag'n'drop.

Title: Re: Sugarbox, a CPC emulator for windows.
Post by: Carnivius on 21:22, 23 January 18
I tried that (as clumsy as it is) but it only seemed to work once per instance of emulator.  So, I played one cart then when i wanted to switch, I tried dragging another and rebooting but it still booted up the previous cartridge again so I had to close down the emulator, reload it, then open explorer again and navigate to game folder if I'd closed it for some reason, and drag another game cart in.  It certainly does play the Plus stuff well when I get a game in there though. :)
Title: Re: Sugarbox, a CPC emulator for windows.
Post by: Lone on 21:28, 23 January 18
Thanks for the first official bug of this version !


I'll have to figure out how to fix this (I hope I can reproduce it !), and I guess i'll have to setup next version quick !
Title: Re: Sugarbox, a CPC emulator for windows.
Post by: Lone on 00:01, 16 August 18
Hello,


Here's a new release of Sugarbox.
Mostly refactoring of code and bug fix, with a new Configuration selection mode (quicker and simpler)
Also, a BIG fix on tape, allowing most of tape dump to work now.


Note that I moved to github to allow everybody worldwide to download it easily.
I'll add the source code later (when it will work with more than as single OS !)


Complete log & bins here :


https://github.com/Tom1975/Sugarbox/releases/tag/v0.30

Title: Re: Sugarbox, a CPC emulator for windows.
Post by: SOS on 12:25, 16 August 18
thanks.
Do you plan to implement the IDE-Interface? (XMASS,...)
Title: Re: Sugarbox, a CPC emulator for windows.
Post by: Lone on 13:29, 16 August 18
thanks.
Do you plan to implement the IDE-Interface? (XMASS,...)


I have no real plan for anything : New features mainly are added when asked for.
I also plan a cross platform release with a new GUI, new hardware (technimusic (an old promise) , XMASS and IDE interface, etc)
Added from these, bugfix, improvement of the CRTCs, and so on.
Title: Re: Sugarbox, a CPC emulator for windows.
Post by: roudoudou on 14:09, 16 August 18
Linux support  :P
Title: Re: Sugarbox, a CPC emulator for windows (and raspberry pi, soon).
Post by: Lone on 00:43, 18 August 19
Hello,


Some news from Sugarbox : I'm currently porting it to Rapsberry Pi (without any OS - bare metal rules !).


Here is a teaser of it :


https://www.youtube.com/watch?v=9sj5ZJMNrLQ (https://www.youtube.com/watch?v=9sj5ZJMNrLQ)

Title: Re: Sugarbox, a CPC emulator for windows (and raspberry pi, soon).
Post by: robcfg on 02:13, 18 August 19
Nice!


Which Pi models will be supported?
Title: Re: Sugarbox, a CPC emulator for windows (and raspberry pi, soon).
Post by: Lone on 10:47, 18 August 19
I currently work on the PI 3 model (mainly because it's the only one I own).
I plan to make it work for Pi2 also.
Title: Re: Sugarbox, a CPC emulator for windows (and raspberry pi, soon).
Post by: Gryzor on 15:56, 21 August 19
That's really nice. The beginning of a CPC micro of sorts! What OS are you using?
Title: Re: Sugarbox, a CPC emulator for windows (and raspberry pi, soon).
Post by: Lone on 22:48, 21 August 19
That's really nice. The beginning of a CPC micro of sorts! What OS are you using?


No OS ! Bare metal here (so it can boot in less than 3 seconds - which was mainly why I did it : I loved when my CPC start in few seconds)
Title: Re: Sugarbox, a CPC emulator for windows (and raspberry pi, soon).
Post by: Urusergi on 00:13, 22 August 19

No OS ! Bare metal here (so it can boot in less than 3 seconds - which was mainly why I did it : I loved when my CPC start in few seconds)

Finally I'm going to buy a Raspberry Pi 3  ;D
Title: Re: Sugarbox, a CPC emulator for windows (and raspberry pi, soon).
Post by: Gryzor on 10:46, 22 August 19

No OS ! Bare metal here (so it can boot in less than 3 seconds - which was mainly why I did it : I loved when my CPC start in few seconds)


Well yes, you did say that, but I assumed it just boots straight to the emulator instead of going through a desktop and whatnot. How are you booting directly into the CPC? It's not quite an FPGA to just load the core!
Title: Re: Sugarbox, a CPC emulator for windows (and raspberry pi, soon).
Post by: robcfg on 11:56, 22 August 19
From the Raspberry.org forums:



- When the Raspberry Pi is first turned on, the ARM core is off, and the GPU core is on. At this point the SDRAM is disabled.
- The GPU starts executing the first stage bootloader, which is stored in ROM on the SoC. The first stage bootloader reads the SD card, and loads the second stage bootloader (bootcode.bin) into the L2 cache, and runs it.
- bootcode.bin enables SDRAM, and reads the third stage bootloader (loader.bin) from the SD card into RAM, and runs it.
- loader.bin reads the GPU firmware (start.elf).
- start.elf reads config.txt, cmdline.txt and kernel.img
Title: Re: Sugarbox, a CPC emulator for windows (and raspberry pi, soon).
Post by: Lone on 17:26, 22 August 19
In fact, I do a very, very light OS (no multitask, almost no drivers, etc).
It's basically some init functions, then it goes straight to the emulation core.


Have a look at https://github.com/bztsrc/raspi3-tutorial (https://github.com/bztsrc/raspi3-tutorial) or https://github.com/rsta2/circle (https://github.com/rsta2/circle) for some informations (really interresting by the way)


With the help of circle++ lib, it's really easy to do it (and quite fun and satisfying)
Title: Re: Sugarbox, a CPC emulator for windows (and raspberry pi, soon).
Post by: Gryzor on 09:58, 23 August 19
Ah that was what I was thinking, something minimal and lightweight to get you going :) Still, very interesting indeed! Got to try it...