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
04/01/19 06:52 PM
Joined: Jan 2019
Posts: 13
France
xavierm Offline OP
Member
xavierm  Offline OP
Member
Joined: Jan 2019
Posts: 13
France
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
04/04/19 03:20 AM
Joined: Aug 2004
Posts: 1,382
Robbbert Offline
Very Senior Member
Robbbert  Offline
Very Senior Member
Joined: Aug 2004
Posts: 1,382
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
04/04/19 03:50 AM
Joined: Mar 2001
Posts: 16,206
USA
R
R. Belmont Online content
Very Senior Member
R. Belmont  Online Content
Very Senior Member
R
Joined: Mar 2001
Posts: 16,206
USA
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
04/04/19 10:51 AM
Joined: Aug 2004
Posts: 1,382
Robbbert Offline
Very Senior Member
Robbbert  Offline
Very Senior Member
Joined: Aug 2004
Posts: 1,382
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
04/04/19 10:56 AM
Joined: May 2004
Posts: 1,571
H
Haze Offline
Very Senior Member
Haze  Offline
Very Senior Member
H
Joined: May 2004
Posts: 1,571
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
04/04/19 11:06 AM
Joined: Dec 2015
Posts: 97
A
AJR Online content
Member
AJR  Online Content
Member
A
Joined: Dec 2015
Posts: 97
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
04/04/19 12:17 PM
Joined: Aug 2004
Posts: 1,382
Robbbert Offline
Very Senior Member
Robbbert  Offline
Very Senior Member
Joined: Aug 2004
Posts: 1,382
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
04/04/19 02:07 PM
Joined: Mar 2001
Posts: 16,206
USA
R
R. Belmont Online content
Very Senior Member
R. Belmont  Online Content
Very Senior Member
R
Joined: Mar 2001
Posts: 16,206
USA
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
04/04/19 05:26 PM
Joined: Jan 2019
Posts: 13
France
xavierm Offline OP
Member
xavierm  Offline OP
Member
Joined: Jan 2019
Posts: 13
France
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
04/05/19 12:46 PM
Joined: Aug 2009
Posts: 191
Montreal
P
plgDavid Offline
Senior Member
plgDavid  Offline
Senior Member
P
Joined: Aug 2009
Posts: 191
Montreal
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
2 registered members (Dam0, reenigne), 26 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Shout Box
Forum Statistics
Forums9
Topics8,654
Posts113,414
Members4,846
Most Online324
Dec 20th, 2018
Powered by UBB.threads™ PHP Forum Software 7.6.1.1
(Release build 20180111)
Page Time: 0.036s Queries: 15 (0.017s) Memory: 5.7275 MB (Peak: 5.9488 MB) Zlib enabled. Server Time: 2019-05-26 06:58:29 UTC