Next Generation Emulation banner
1 - 20 of 53 Posts

·
Registered
Joined
·
63 Posts
Hi guys,

Chip16 looks like a charming retro-like platform. Good work all of you. Although I think it's very important to try and keep it minimalistic if the goal of it is to get mega-platform support. And also to get new-comers to the emu-scene to be able to comprehend Chip16 as their first lucky emulation-implementation.. if that is a goal.. For example if you already got a working XOR, don't add a NEG.

Is the spec still changing, and what kind of changes are permitted? Breaking changes that makes older ROM's stop working or just newer changes making older emulators not being able to run newer ROM's?

Has someone implemented (or heard of) a hardware implementation of Chip16? That is a real "chip" version implemented in a hardware description language as Verilog or VHDL? I'm kind of tempted but only if it's still undone.

Anyway I probably warm up with implementing a simple Chip16-emulator in C# (my programming language of choice) just to get a good sense of the details. Then probably implement a Chip-16 program which is also good training. I already got 2 fun project to choose from. Which is the best assembler program for Windows? Which is the best Debugging environment? Ch16Debugger 0.5a looks very nice but it doesn't seem to work as expected.. Any comments on this?

Keep creating good stuff and tools for Chip16 and I keep following "the scene"!
 

·
Registered
Joined
·
63 Posts
Memory interface for Chip16

OK sounds good. Another question about Chip16 that isn't clearly stated, is the memory interface width 8-bit or 16-bit as the machine? The most obvious would be 16-bit width which I chose to begin with for my emulator, but when reading about how many steps one need to take in memory to get to the next instruction it seems more like 8-bit width. Which is correct?

I'm having a nice time implementing a new little emu, my simple C# Chip16 is taking form.. :)
 

·
Registered
Joined
·
63 Posts
Thanks for the help! I present: SharpChip16



C#, 718 lines of code, most demos actually tops out a quite low load. Boing demo in the picture 1-7%. Same for Mandel.

One of the ways of getting ok performance was to handle all graphics low-level.

The timing is handled by a timer I chose to set to 15ms, not vblank. This way the code is simple and I think it looks good enough. By using 15 instead of 16 it feels more fluent..

Left to do:
- Sprite Flip
- Sound
- Redraw fullscreen when palette/colors change..
- Some nice % usage of Chip16/Host performance and FPS..
 

·
Registered
Joined
·
63 Posts
Chip16 Release: Sierpinski triangle using chaos game method

One of my favorite first hacks on new platforms, a Sierpinski Triangle using the Chaos Game Method. Chip16 already had one demo showing a version of the Sierpinski triangle (triangle.c16) but I couldn't resist doing it my way.
To make it lesss static I added some more randomness to it.
Source included in ZIP.

Please feedback any problems and I'll try to fix them.
 

·
Registered
Joined
·
63 Posts
Yikes, my new Chip-16 program has dirty bugs that none of the current debug-tools can help me find.. I tried using Visual Studio 2012 to do double debugging (debugging Chip-16 code via debugging the Chip-16 emulator C# code) but it got too complex for poor me.. Solution? Well there will be a new C# Chip-16 emulator including more complete Debug-tools. Fun hack! I've done a couple of these in the past so it'll work out. I'll post it here for people to try out when it got some functionality worth checking out. And maybe add source to suitable GIT/SVN. Anyone got an idea where it would fit in?
 

·
Registered
Joined
·
63 Posts
Once again, great job. Have you tried running "BC_TestRom"?
Btw, how are you displaying graphics? Are you using GDI+ or something else?
Yea, I've used the great "BC_TestRom" and used it to fix some later bugs so for now its says OK!

GRAPHICS:
About the graphics, I use low-level bit-banging on a byte[] so its hard-coded against GDI's graphics representation. It won't be portable to Mono just now.. I actually reuse(and tweaked) a MemBitmap class I've found in another project which has the following comment:

// This class was derived from " Fast Pointerless Image Processing in .NET", J. Dunlap, Nov 2006

The good thing is that it actually shows itself as a Bitmap to .NET so a normal PictureBox is used in design mode. This also gives a possible resize "for free" if one wishes not to use pixel-to-pixel representation on-screen and not care about the scaling.

Sorry to say, the MemBitmap class still has unfixed problems making it Crash while Running Release Build. I'll try to fix that before releasing sources.

Possibly a better solution would be using SDL.NET instead, making it better suited for multi-platform .NET. But this begin only a side-project to the bigger goal, I'll probably leave that to someone else or as a future hack.
 

·
Registered
Joined
·
63 Posts
Great, nice to know that the release is "awaited"! :) It will be released. The Crash with Release was not connected to Graphics and is fixed already.

I have 30 storys left on my TODO-list, but not all of them will be fixed.
Some of the goodies still left to do:
- Breakpoints
- Mem window should follow changes (as seen in CH16Debugger_0_5a)
- Make program handle the mmap.txt file and show labels, this also greys out all addresses in assembler listing.
- Watches
- Add Joystick handling
- Memory Dump
 

·
Registered
Joined
·
63 Posts
nChip16 v0.9.5 RC

Hi all,

Finally a first Release Candidate of my Chip16 emulator written in C# called, nChip16!

View attachment 219898

Please try it out and use the issues in GIT for bug report or feature requests. I'm giving this a couple of hours more to finish it off.

Sources are added GIT under:
https://github.com/mwedmark/nChip16

and I've built a ZIP with nChip16 v0.9.5 binary files for your convenience. You can find it here:
https://github.com/mwedmark/nChip16/tree/master/releases

Install instructions:
Just unzip the ZIP-file in a directory of your choice. The nChip16 requires .NET v4.5 installed on the machine and An extra library called MWHexEdit.dll is used and need to be located in the same directory as the nchip.exe file.
nChip16 only handles ROM-files that has a 16 bytes header in release.
Chip16 controls are hard-coded:
- Arrow keys mapped as: UP/DOWN/LEFT/RIGHT
- A,S as SELECT, START
- Z,X as A,B

OK here's a simple manual and feature list:
- Load file can be performed in 3 ways:
1) File/Open in menu.
2) Drag'n'Drop .c16 Chip16 binary file into nChip16
3) Send the path to a *.c16 Chip16 binary file as a single parameter when starting nChip16.exe
- FULL-SCREEN mode, just click the Chip16 output window!
- Possible to RESET/START/STOP/STEP/'STEP INTO' - STEP will perform a CALL but not step into it. Step into will follow the program flow and continue stepping inside a call.
- RESET resets the complete machine(memory, registers) and also reloads the last chosen program from disk again. Also reread the mmap.txt if found. This can be used to do a quick reload of a Chip16 binary file while writing/debugging Chip16-programs using tchip16 assembler. Just rebuilt the new code, press RESET and the latst bin file will load without restarting the emulator.
- Emulator shows both registers/flags and user watches. Both can be shown in real-time. Then it is updated once each frame to not hog the CPU totally.
- There are a memory window which can both be used for watching memory changes are changing values in memory.
- A assembly source window can be used to track program flow. This can also import the "mmap.txt" from tchip assembler, which makes it possible to show label instead of just an address.
- Breakpoints are supported and can be added by double-clicking source lines.
- Info from ROM is shown in status field.
- It also shows Chip16 usage which is the number of instructions executed between VBLNK. So if VBLNK isn't used, the number will be screwed up.. F.e. I'm looking at the "Starfield.c16" just now. It shows:
Chip16 usage: [12163/16666] 73% this means that to keep 60 FPS, some 27% more could still be added.
- User-definable watches can be added. BYTE/WORD size can be chosen and HEX/DEC/BIN representation on-screen. Also the choice of LockTo: address or label can be used. Watches also uses the mmap.txt file to help the user add watches pointing to labels from your assembly program. If the user choose LockTo: Label, the address of the watch will move to the new location read from mmap.txt. This way the user can keep his labels as watches even if the assembler chooses to move it in memory. I think this feature is quite nice.

Left todo:
- Still mot implemented handling "late changes" to colors. So the palette color that was used when drawing pixels will be shown, thus changes made to the palette will NOT affect pixels already drawn.
- Sound, not implemented today.
- Joystick control will be added
- Bug with breakpoint and RUN, when using RUN today from a breakpoint line it is stuck. You must use STEP once and then RUN works. I will fix this later.

- Lots of other stuff..

Well try it out, get back to me and say what you think!
 

·
Registered
Joined
·
63 Posts
Thanks for the feedback.
I've entered them into GIT's issue tracker to keep them in order.

Mash16 already includes full-screen mode (by command-line switch "--fullscreen") so the only thing I think nChip16 introduces is the possiblity to switch between them runtime.

I actually missed the fact that CLS should set background index to 0.. will add!
 

·
Registered
Joined
·
63 Posts
nChip v0.9.6

New version of nChip16 released.

From now releases will appear here, using standard GitHub functions.
https://github.com/mwedmark/nChip16/releases

Direct download: https://github.com/mwedmark/nChip16/releases/download/0.9.6/nChip16_v0.9.6.zip

From the release note:
-snip-
New features:

  • Make it possible to switch filtering type in Full-screen mode. Both unfiltered(Nearest Neighbor) and quite a few which uses filtering.
  • Access Auto start property from Menu. If Enabled, this is used when doing RESET so that after reloading the program it starts right after load finishes.
  • Big ROM takes too long to load, make it faster. Added disable to source listing to make loading faster. Also added wait cursor while loading for better feedback when waiting.

Included bugfixes:

  • CLS doesn't reset background index. => Fixed
  • All unassigned key generate Chip16 UP => Fixed! Nothing happens when using un-assigned keys.
-snip-
 

·
Registered
Joined
·
63 Posts
img16 and palettes??

If I use the program img16 to try and get pictures into Chip16 via tchip16, who fixes the palette? If I want to use standard palette, shouldn't the program by default help me choose the closest colors for all pixels.

Which kind of BMP-files can the program handle as input? 24-bit? 8-bit? 4-bit? other?

I've seen that the program can take both a text file and binary file that holds user-defined palettes, but this is not so helpful. Then you still need to figure out at good palette by yourself. Couldn't the program do that also and just integrate a good palette as part of the binary file (maybe at the end)

When trying out one picture, the pixels are correct and my picture in size 254*191 can be seen in Chip16 emulator, but I don't understand the palette handling. Look like Schatko...
 

·
Registered
Joined
·
63 Posts
img16 continued

OK thanks for the info. I feel that hacking this makes my Chip16 interest a little too wide!
:) But still, even if I choose to use the original palette (not sending in a custom) it will not handle this black and white 254*191 24-bit BMP-picture saved with Paint.NET:

View attachment 219907

The output:

View attachment 219908

I'll take a look at the alternative, and hack away on both nChip16 AND my latest interesting Chip16 project. I think you like it.. :D
 

·
Registered
Joined
·
63 Posts
imgconv test

OK i did a test of Tronix imgconv and though I'd share the result:

View attachment 219910

View attachment 219909

Looking great I think.
Although using these kind of pictures isn't really a good fitting for the Chip16 platform, the color picture is taking up almost 60% of total RAM! :)

Someone written a good picture packer for Chip16 yet... ??
 

·
Registered
Joined
·
63 Posts
I've encountered this problem before, I'm not sure what caused it...
Was that with the dithering enabled (--dither)? Perhaps try saving the BMP with MS Paint, and/or dump the header (--info), too.

EDIT: You are not running the latest version. Get it from the Chip16 github and compile from source, it will work with/without dither ;) See below:

View attachment 219911 View attachment 219912

As for packers... you could probably write a small RLE, or even LZMA, decoder (hehe)... :)
OK, kind of PEBKAC here then.. well, thank for clearing that up. Those pictures are looking very good, tykel. It seems that Chip16 has a lot of good tools already. Hopefully my Debugger added one more.. or at least when its cleaned up a bit. Working on that..
 

·
Registered
Joined
·
63 Posts
Sounds like a usable addition. Would this region in memory be used as usual memory if no flag is flipped? Otherwise we would loose valuable memory.

When having only 64K of memory both for graphics and program, maybe these kind of spec. should be mapped as a READ/WRITE port instead? Not as optimal as directly memory-mapped, but 2 big advantages:

1) We don't potentially make bigger parts of memory mapped twice as two different duties.
2) Because we will read very small amounts of memory and few times, the overhead in performance will not hurt as much.

Something like:
0xFF05: Address to access in battery-backed RAM
0xFF06: Data Read/Write register
0xFF07: Command

Command could be whatever the specifier would like but minimum:
0x01 - Read Command
0x02 - Write Command

For more advanced commands:
0x03 - Burst-Read: By loading the Data register with a number X and starting this command, X number bytes can be read just by reading address 0xFF06 X number of times.

Well what do you think?

Tykel also wanted me to bring up a discussion about adding Keyboard to Chip16. I've entered this as a new Feature-request in GitHub. The reason for me is to make programs like Console, BASIC-interpreter, Hex-mem-editor and other nice utilities available to write. Also programs using simple Windows/TextBoxes would be fun to write.
 

·
Registered
Joined
·
63 Posts
New tool-suite for creating optimal Chip16 images

OK instead of coming of with these stupid examples of new functionality that nobody wants, I gave a go on setting up a tool-suite for creating optimal pictures for the Chip16 platform.

I actually can't take credit for the bigger part of the tool-chain, but uses mostly available tools.

What do you think?

View attachment 219917 View attachment 219918 View attachment 219919
 
1 - 20 of 53 Posts
Top