Hi,
I'm trying to use hanimex pencil II driver, a very rare Z80 computer from 1983. Only 2 cartridges were made and another for sdbasic.
It has nearly the same hardware as a colecovision and had an expansion card to make games works without modifying them.
I had used z80dasm to have a clue of how it works, where are entry points, how things are done.
I have succeeded to know how work cartridges and now can make z80 programs to have fun.
Some z80 / tms9928 examples can be converted with a little work, i had a mandelbrot cartridge and an ascii table printed on screen.
I was about to tried some animated examples when i saw a blank screen and my pc counter stay at a halt instruction.
If i use this same example on the colecovision driver, animated sprites appeared on screen.
My guess is that the pencil2 driver doesn't handle interrupts. In fact, in pencil2.cpp there is nothing about nmi or int. I have tried to port colecovision code with a little success. PC is moving across interrupts but i have glitch on screen or nothing more. I don't know if it's the z80 code or my poorly C code.
Does anyone have tried to add some interrupts handle for pencil2 ? it would be so fun to have a new product for this computer 36 years after it's release

Maybe with a little explanation about how to implement interrupts i could handle it

Xavier.
We need a schematic of the Pencil II, to know how any interrupts might be used.
Alternatively, we need to know how the interrupts are hooked up. I assume the interrupt source is the TMS9927, does it go to IRQ or NMI? And is there some hardware in the way to gate it?
Maybe I'll have to pull my Pencil II out of storage, and try to trace tracks....
And the video chip is a TMS9929 btw.
are we sure the expansion card isn't generating the interrupts, and that without it no interrupts are generated?
The main board ROM trampolines the NMI and RST handlers (with the understandable exception of RST 00) into cartridge space. However, as SD-BASIC never enables maskable interrupts at any point, I'd guess that NMI is the only actual interrupt.
On closer examination, NMI does write to the VDP after four or five layers of indirection. I've added that as the interrupt.
If you happen to own a Pencil II, you need to do some preventative maintenance to keep it working. After all, the reason it is rare is because most of them failed in the warranty period and were returned to the store for a refund.
You need to open it, and locate the cart slot in the middle of the motherboard. You'll probably find that the slot socket is loose. Hold it in firmly and resolder every joint on it. Then put it back together and make sure the 2 self-tapping screws on the slot socket are screwed in firmly. After that, it should work well for many years.
If his still works he's probably had that done already, but good pointer
Thanks for reply π
Yesturday i asked someone on eBay to send me hight resolution pictures of the motherboard. I don't know if he will send them to me... Wait and see π
Today i cleaned up the assembly code and to my surprise it nearly works. I can follow my code into the nmi interrupt.
To reply at your question about to know if it nmi or not, I'm nearly sure that nmi is triggered by the tms9928 vdp.
The rom bios has jump from 66h to 8014h which jump into the nmi custom rout. It works with my patch. But when the interrupt return, the pencil go to 18h and reset and restart the whole thing for ever... I miss some z80 knowledge π
I could share what I've done on pencil2.cpp driver if you want.
For the z80 assembly code I nead to minimize it just to have the interrupt enabled and make it works without doing graphics that can brings some other bugs I cannot understand π
Hope pencil2 can have some enhancements. I plan to make something on it, perhaps just a little demo with sound and graphic, a little game, or porting an existing game from colecovision. For that it needs to have joystick support π
.... But it's another step.
Thanks for your help.
Thanks for reply π
Yesturday i asked someone on eBay to send me hight resolution pictures of the motherboard.
I bought this unit yesterday so it should be in safe hands. Also ran the Pencil II bios (from mame) in my hacked colecovision, so more fun down the road...
We need them carts!
Picture of the Pencil II Bios in a ColecoVision:
https://twitter.com/plgDavid/status/1114147940296220672
ColecoVision is in turn nearly MSX-1, so it's not too surprising there are other Coleco-alikes.
Really good news!
This is a so rare machine that need to be in good hands π
Unfortunately for the moment I never see any dump rom to play on it. Only 2 exists it seems.
That's why I'm learning z80 to make a little funny demo with sound or a little game.... If I have time π it would be soooo exciting to see it running on a real hardware. After owning one, 33 years later it's time to release new roms for it π
the MSX video was also common to the early Sega systems, with the SMS VDP even having compatible screen modes for backwards compatibility with SG-1000 software. (the MD version of the VDP drops that mode, so SMS titles using it won't run on an MD but that was mostly just bootleg conversions)
Seems like it was a popular video setup anyway.
Indeed. I have a cross emulation hardware setup based on this idea where my Coleco/MSX/SMS can plan games from various similar systems.
To know how this machine should works I've looked at msx 1, SMS, colecovision, sg-1000, Adam.
At this time they share nearly the same hardware and even the port map with little differences.
The only big difference is for the bios. Entry points is not known for the pencil. For the moment I've identified only for shutting down the soundchip...it's a good start π
The original post said only 2 carts were made, but that isn't quite correct, as the box has pictures of many more carts and other software. I listed everything from the box in hash\pencil2.xml
With the unit I received 6 cassettes with demo programs. These have been extracted and are on my site which I'm sure you can find. There's a manual there too.
I'm in touch with someone who has at least one undumped game, I might have to send them a dumping rig
The original post said only 2 carts were made, but that isn't quite correct, as the box has pictures of many more carts and other software. I listed everything from the box in hash\pencil2.xml
With the unit I received 6 cassettes with demo programs. These have been extracted and are on my site which I'm sure you can find. There's a manual there too.
You are wright for the tapes, i have found them in an old lost forum and archive them too π But for the cartridges I've always heard about 2 only games and one cartridge for the sdbasic 2.0. Maybe sdbasic 1.0 exist but i' m not sure.
What is exciting is to learn that more things exist and can be fonctionnal. I just read the xml and I'm just so happy to see that there are well known games as on colecovision.
Hope that somebody could find them and archive them.
I've tested the last version with vdp interrupt. It works as mine.... But it's far more cleaner π now I need to understand how interrupts work and why there is a reset.
I like to learn with failure, even more when it's for something that is nearly inexistant π
Great job and thanks a lot for improving this multi emulator. Without him I think that many many old computers would have been lost for ever. π
I remember an Atari age user named coleconut who had the only two games I have noticed (ladybug and treasure hunt I believe) as well as a coleco adaptor. Sadly it seems he didnβt manifest himself despite my PMs.
Another lead I had regarding the carts was the Canadian pc museum with mention of another game called big foot chase. Sadly seems I canβt contact them by phone. Furthermore the curator of the museum has passed away.
https://pcmuseum.ca/details.asp?id=19
I tried to ping both without success two days ago. Sad to hear.
The museumβs definitely an eye keeper, as iβve Never seen that game cart before.
coleconut answered me, and as I guessed sending the cart away is not interesting to them. Well that will not stop me, I'll just send a dumping rig their way.
Ah! great to know.
Out of curiosity, can you ask whether he knows about the museum game? I know he tried to go after anything pencil 2 related.
I just got my unit from eBay. Bitrot is real people the M5L2764 read half garbage compared with the BIOS in MESS. (same file I'm pretty sure).
more later
I have notified members of mysilicium: I believe they are in possession of one, maybe a few, card games for the pencil 2.
I have notified members of mysilicium: I believe they are in possession of one, maybe a few, card games for the pencil 2.
Pretty cool!
No answers yet, but one of the games one of the users have is treasure hunt. Should anyone have specific infos on big foot chase, that would be great, as aside from the canadian pcmuseum, there is absolutely nothing on this one.
It also appears to be a pencil 2 exclusive (several titles seem to have been ported or were planned to be ported to the pencil 2 directly from the arcade, CBS and emerson arcadia: ladybug is such a title).
Also, PLGdavid, I believe coleconut should have both treasure hunt and secret garden (not sure he knows about big foot chase though).
If the carts use the same M5L2764 eproms, time is not on our side. I've had many die on me or ROT.
In the mean time I just mapped out the cartridge slot and its _exactly_ mapped like the ColecoVision.
Traced out the main MREQ decoding and its a 74LS138 (typical)
With A=A15, B=A14, C=A13 (other way around in Coleco but doesn't matter)
Y0:$0000 (BIOS EPROM)
Y1:$8000 (Cart pin 18)
Y2:$4000 (External memory slot pin 18)
Y3:$C000 (Cart pin 2)
Y4:$2000 (External memory slot pin 16)
Y5:$A000 (Cart pin 22)
Y6:$6000 (RAM chip)
Y7:$E000 (Cart pin 27)
Nice. Hopefully we can get the remaining games dumped before they bitrot.
So in essence, aside from differences in dimensions, pencil 2 carts are coleco carts correct?
Right, which is why there was a cartridge converter.
I see. Speaking of which, I'm curious regarding the innards of said converter.
It shouldn't have any innards from what plg said. It's purely making the connections work.
I thought the bios was different and incompatible? assuming cart space can completely override system space, I guess it contains a compatible bios?
The ColecoVision carts insert perfectly in the main slot.
[EDIT] guess there is a CV compatible bios and some glue chips and thats it in the adapter
*NOT MY PICTURE*
![[Linked Image]](http://atariage.com/forums/uploads/monthly_03_2011/post-18191-130014499127.jpg)
I'm confident I can just hook up a 27128+switch and have the bios change from one to the other.
I was saying...
![[Linked Image]](https://imagizer.imageshack.com/img923/9200/LdPCM9.jpg)
Just tried one game. Surely the switch from 1KiB to 2KiB of RAM will cause issues to some game assuming mirroring. I'll try a few more later.
Didn't find a non working ColecoVision game so far (tried 20 or so)
Scanned the PCBs
https://imageshack.com/a/wFco/1
Amazing! Good scans of the inside were really needed π hope this would help one day π€ maybe for a fpga project π€?
You said you have only plugged the coleco games and it worked?
I had tried this with the emulator and nothing worked. It said "no cartridge".
What I had understood with the help of the debugger is that the bios search for "COPYRIGHT SOUNDIC" from $8000 to $8010. If it's not equal the cartridge is set unknown.
Maybe I've missed something?
For the adapter I had a pic of the inside I'll post it when I'll find it. In fact there is only one chip. My guess is there is only bios code. Maybe a replacement of the main bios? For me it's the only thing it does, but I don't know how π
You can see on these
pics the pcb of the colecovision adapter.
Only one chip, nothing else.
It's the only reference I have. Hope it helps π
It looks like a ROM. Are you in a position to dump it?
It looks like a ROM. Are you in a position to dump it?
I'm not owning this rom, nor able to get it to make a dump. I had told the owner if it was possible for him but... No.
I will send him a new message, perhaps things have changed π
You said you have only plugged the coleco games and it worked?
I had tried this with the emulator and nothing worked. It said "no cartridge".
What I had understood with the help of the debugger is that the bios search for "COPYRIGHT SOUNDIC" from $8000 to $8010. If it's not equal the cartridge is set unknown.
Maybe I've missed something?
Yes I was doing a hardware test replacing the Pencil Bios for the Coleco bios (my Pencil now has a switch to toggle between both).
With the coleco bios all games that I've tried work as if they were in a ColecoVision.... Well they are PAL and slow, but they work.
As far as the ColecoVision adapter is concerned, this is interesting.
The 2764 in there has its !OE on the memory slot pin 17 (which is connected just like the BIOS to the same Y0 line of the 74138, (missed this info last time)
So it maps to $0000 and most possibly a Coleco-Compatible BIOS that we do not have dumped. (or the real thing which would be very surprising)
So there is of course a needed mechanism to shut down the native Pencil II bios.
The console's bios's !OE line is called !XTM0 on the silkscreen, (not external M0)
Its pulled down on the mainboard through R6 and connects to line 2 of the memory slot
Looking into the ColecoVision adapter you can see that pin2 is connected to VCC, so there is no conflict for $0000
Back to the 74LS138@U10: [edit]
Y0:$0000 (BIOS EPROM - and memory slot pin 17)
Y1:$8000 (Cart pin 18)
Y2:$4000 (External memory slot pin 18)
Y3:$C000 (Cart pin 2)
Y4:$2000 (External memory slot pin 16)
Y5:$A000 (Cart pin 22)
Y6:$6000 (RAM chip)
Y7:$E000 (Cart pin 27)
All set
https://twitter.com/occitel/status/1123126397864697856?s=20 just waiting for my IZE80 board to cross the Atlantic to France and they should get the first game dumped.
Great! Who came through? My silicium i take it?
Edit: never mind, just saw the tweet. Great job.
I think things would go further after the game will be dumped. We could see how it works and make emulation better.
I'll post something about that shortly. I have a simple code showing rasters, so using nmi, and with a normal execution rasters seems not to be at the right place on screen. If after i use the debugger and follow step by step the execution, rasters go at the wright place. It's like if there is some timer issue or wrong cycle count.
I'll post screen shots and the assembly code.
In this picture we can see a normal execution. Lines are drawn during nmi.
![[Linked Image]](https://imagizer.imageshack.com/img923/3888/eJpKFf.png)
In this one all lines are correctly drawn.
![[Linked Image]](https://imagizer.imageshack.com/img921/5426/dfwZWe.png)
.
The only difference is that the second one is drawn using the debugger by pressing F11 after every instructions. I'm maybe wrong, but i'm thinking of a wrong timing in normal run.
; Header d'une cartouche Pencil II
org $8000
; COPYRIGHT SOUNDIC
defb "COPYRIGHT SOUNDIC" ; 8000 - 8010
; 8011 - 8034
;
; 8011 - START
; 8014 - NMI
; 8029 - INT
; Point d'entrΓ©e du lancement du programme sur la cartouche
jp start ; 8011 - 8013
;defs 32,0
; NMI
jp inthandler ; 8014 - 8016
;defs 10,0
defs 6,0
; RST 18
ret
nop
defs 13,0
;jp inthandler ; 8029 - 802B
reti
nop
;defs 32,0
defs 27,0
; VERSION!TITRE!DATE (C)
defb "BETA!** VDP TESTS **!2019"
defs 10,0
; VARIABLES
dataVDP: EQU $BE ; VDP Data port
cmdVDP: EQU $BF ; VDP Command port
ramtop: equ $7050
include "tms.asm"
inthandler:
in a, (tmsreg) ; clear interrupt flag
call rasters
ei
reti
rasters:
; Register 7 = $2 => 0000 0010 (BGC)
ld c, $02
lp_b:
ld a, c
out ($bf), a
ld a, $87
out ($bf), a
inc c
ld a, $15
lp_a:
dec a
jp nz, lp_a
nop
nop
add a, 1
add a, 1
add a, 1
ld a, c
sub a, $50
jp nz, lp_b
xor a, a
out ($bf), a
ld a, $87
out ($bf), a
ret
start:
ld ($7000),sp ; save old stack poitner
ld sp, ramtop ; set up stack
call tmsbitmap
call $505 ; TURN_OFF_SOUND
call tmsintenable
mainLoop:
jr mainLoop
Code is compiled with z80asm on Linux.
What do you think about ?
I think if there is a timing issue for the Pencil II there is one for the colecovision driver as well, since they are identical, minus a few ports for the keyboard and tape.
No game on the colecovision uses rasters that way to my knowedge but surely MSX games does and its, again near exact hardware.
I know π
It's just a strange behavior. The code was made for rc2014. I've just tried to adapt it. Maybe something wrong with my code... Again π
I'll try to do some more tests with sprites this time π
Sooooo nice π
Really good job. So excited to download it and see how it works π
We have a lot to learn now.
Great job! Congrats to all involved. I will make a post on atariage. It could motivate coleconut further.
Edit: and it seems thatβs done already! Letβs see what happens next.
This is some examples I adapted from others sources to learn z80 and how pencil 2 works.
Now it's time to go further and write something new π
Source code
on github and videos
on youtubeHave fun π
Sorry to reopen that old thread, but was the dump of treasure hunter transmitted to MAME to try out in the driver?
As far as I know gameplay footage was only made on a real machine, correct? If so, Iβd be curious how it runs under mame.
Yes, it was added. 'mame64 pencil2 treasure' will let you try it out.