Previous Thread
Next Thread
Print Thread
Page 1 of 6 1 2 3 4 5 6
Hanimex Pencil 2 - vdp interrupts #114969 04/01/19 06:52 PM
Joined: Jan 2019
Posts: 14
xavierm Offline OP
Member
OP Offline
Member
Joined: Jan 2019
Posts: 14
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 smile
Maybe with a little explanation about how to implement interrupts i could handle it smile

Xavier.

Last edited by xavierm; 04/01/19 07:04 PM. Reason: published too fast
Re: Hanimex Pencil 2 - vdp interrupts [Re: xavierm] #114977 04/04/19 03:20 AM
Joined: Aug 2004
Posts: 1,394
Robbbert Offline
Very Senior Member
Offline
Very Senior Member
Joined: Aug 2004
Posts: 1,394
We need a schematic of the Pencil II, to know how any interrupts might be used.

Re: Hanimex Pencil 2 - vdp interrupts [Re: xavierm] #114978 04/04/19 03:50 AM
Joined: Mar 2001
Posts: 16,535
R
R. Belmont Online Content
Very Senior Member
Online Content
Very Senior Member
R
Joined: Mar 2001
Posts: 16,535
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?

Re: Hanimex Pencil 2 - vdp interrupts [Re: xavierm] #114979 04/04/19 10:51 AM
Joined: Aug 2004
Posts: 1,394
Robbbert Offline
Very Senior Member
Offline
Very Senior Member
Joined: Aug 2004
Posts: 1,394
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.

Re: Hanimex Pencil 2 - vdp interrupts [Re: xavierm] #114980 04/04/19 10:56 AM
Joined: May 2004
Posts: 1,615
H
Haze Offline
Very Senior Member
Offline
Very Senior Member
H
Joined: May 2004
Posts: 1,615
are we sure the expansion card isn't generating the interrupts, and that without it no interrupts are generated?

Re: Hanimex Pencil 2 - vdp interrupts [Re: xavierm] #114981 04/04/19 11:06 AM
Joined: Dec 2015
Posts: 116
A
AJR Offline
Senior Member
Offline
Senior Member
A
Joined: Dec 2015
Posts: 116
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.

Last edited by AJR; 04/04/19 11:16 AM.
Re: Hanimex Pencil 2 - vdp interrupts [Re: xavierm] #114983 04/04/19 12:17 PM
Joined: Aug 2004
Posts: 1,394
Robbbert Offline
Very Senior Member
Offline
Very Senior Member
Joined: Aug 2004
Posts: 1,394
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.

Re: Hanimex Pencil 2 - vdp interrupts [Re: xavierm] #114984 04/04/19 02:07 PM
Joined: Mar 2001
Posts: 16,535
R
R. Belmont Online Content
Very Senior Member
Online Content
Very Senior Member
R
Joined: Mar 2001
Posts: 16,535
If his still works he's probably had that done already, but good pointer smile

Re: Hanimex Pencil 2 - vdp interrupts [Re: xavierm] #114985 04/04/19 05:26 PM
Joined: Jan 2019
Posts: 14
xavierm Offline OP
Member
OP Offline
Member
Joined: Jan 2019
Posts: 14
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.

Re: Hanimex Pencil 2 - vdp interrupts [Re: xavierm] #114987 04/05/19 12:46 PM
Joined: Aug 2009
Posts: 192
P
plgDavid Offline
Senior Member
Offline
Senior Member
P
Joined: Aug 2009
Posts: 192
Originally Posted by xavierm
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

Last edited by plgDavid; 04/05/19 12:52 PM.
Page 1 of 6 1 2 3 4 5 6

Who's Online Now
4 registered members (Lord Nightmare, R. Belmont, judge, robcfg), 53 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
ShoutChat Box
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Forum Statistics
Forums9
Topics8,789
Posts115,687
Members4,908
Most Online890
Jan 17th, 2020
Powered by UBB.threads™ PHP Forum Software 7.7.3