CPCWiki forum

General Category => Amstrad CPC hardware => Topic started by: Piotr on 13:44, 12 October 17

Title: Dktronic 64 PAL reversed, almost working code.
Post by: Piotr on 13:44, 12 October 17
Ok some time ago i play with DK tronic PAL and Brute force  metod, Code  almost working on GAL16v8 , R-type game running, demos too but not all, Batman Forever not start, Phortem not run proper. Demo iZ Art  hanging on some effect . So code is not full compatibile. Any ideas?

; Amstrad CPC memory expansion GAL
; Reverse-engineered from original HAL's truth table.
; Created by: MDS with Help from Zaxon.


CHIP CPCMEM GAL16V8

i0=1 i1=2 i2=3 i3=4 i4=5 i5=6 i6=7 i7=8 i8=9 GND=10
i9=11 q0=12 q1=13 q2=14 q3=15 q4=16 q5=17 i10=18 q7=19 VCC=20

EQUATIONS

!q7 = i8&i7&i5 | i4;

!q5 = i9&i8&!i7&i5&i4&!i3&!i2&!i1&!i0 | !i9&!i8&!i7 | i7&i5&i4 |
      i9&!i7&!i4 | i7&!i5 | i9&!i5 | i6;

!q4 = !i10&!i9&!i8&!i7&!i6&!i5&!i4&!i3&!i2&!i1&!i0 |
      i9&i8&!i7&i5&i4&!i3&!i2&!i1&!i0 | i9&i8&!i7&i5&!i4&i2&!i0 |
      i9&i8&!i7&i5&!i4&i3&!i0 | i9&i8&!i7&i5&!i4&i1;

!q3 = !i9&i8&!i7&!i6&!i0 | i7&!i6&i5&!i4&!i0 | i9&!i7&!i6&i5&i4&!i0 |
      !i1&!i0 | !i3;

!q2 = !i10&i9&!i7&!i6&i5&i4&i1&!i0 | !i10&!i9&i8&!i7&!i6&i1&!i0 |
      !i10&i7&!i6&i5&!i4&i1&!i0 | i9&!i7&!i6&i5&i4&!i3&i2 |
      !i9&i8&!i7&!i6&!i3&i2 | i7&!i6&i5&!i4&!i3&i2;

!q1 = i2 | i3 | i4;

!q0 = i7&i5&i4 | i9&i5 | !i7&i5;
Title: Re: Dktronic 64 PAL reversed, almost working code.
Post by: Bryce on 14:39, 12 October 17
Quote from: Piotr on 13:44, 12 October 17Batman Forever not start, Phortem not run proper

Have you first confirmed that these programs work with the original PAL?

Bryce.
Title: Re: Dktronic 64 PAL reversed, almost working code.
Post by: Piotr on 14:57, 12 October 17
I have orginal DK Tronic, when i install GAL programmed this code is hanging on some demo effects. Programs working perfect with orginal DK Tronic 64 orginal PAL and CPC 464.

Maybe schematic for DK Tronic will be usefull, is in Diptrace format, sorry about quality but is quick redrawed from PCB.
Title: Re: Dktronic 64 PAL reversed, almost working code.
Post by: arnoldemu on 17:34, 12 October 17
@Piotr (http://www.cpcwiki.eu/forum/index.php?action=profile;u=1104):

Please post a pdf of the schematics AND please assign labels to the pins on the GAL so that the equations are easier to read.
i0-i10 isn't as easy as D7/D6, A15, RAMDIS etc.
Title: Re: Dktronic 64 PAL reversed, almost working code.
Post by: Piotr on 17:54, 12 October 17
Arnoldemu , point is , schematic is a littlebit mess (Diptrace software is free and easy to download) , for convert it to PDF  i need some time. Anyway, here is log what and where,

EQN2JED - Boolean Equations to JEDEC file assembler (Version V101)
Copyright (c) National Semiconductor Corporation 1990-1993

Log file for cpcmemxp.eqn
Device: 16V8

Pin   Label               Type
---   -----               ----
1     i0                  pos,com input
2     i1                  pos,com input
3     i2                  pos,com input
4     i3                  pos,com input
5     i4                  pos,com input
6     i5                  pos,com input
7     i6                  pos,com input
8     i7                  pos,com input
9     i8                  pos,com input
10    GND                 ground pin
11    i9                  pos,com input
12    q0                  neg,com output
13    q1                  neg,com output
14    q2                  neg,com output
15    q3                  neg,com output
16    q4                  neg,com output
17    q5                  neg,com output
18    i10                 pos,com input
19    q7                  neg,com output
20    VCC                 power pin

EQN2JED - Boolean Equations to JEDEC file assembler (Version V101)
Copyright (c) National Semiconductor Corporation 1990-1993

Device Utilization:

No of dedicated inputs used               : 10/10 (100.0%)
No of feedbacks used as dedicated inputs  :  1/6  (16.7%)
No of dedicated outputs used              :  2/2  (100.0%)
No of feedbacks used as dedicated outputs :  5/6  (83.3%)

        ------------------------------------------
        Pin   Label                 Terms Usage
        ------------------------------------------
        19    q7                    2/8   (25.0%)
        17    q5                    7/8   (87.5%)
        16    q4                    5/8   (62.5%)
        15    q3                    5/8   (62.5%)
        14    q2                    6/8   (75.0%)
        13    q1                    3/8   (37.5%)
        12    q0                    3/8   (37.5%)
        ------------------------------------------
        Total Terms                31/64  (48.4%)
        ------------------------------------------

EQN2JED - Boolean Equations to JEDEC file assembler (Version V101)
Copyright (c) National Semiconductor Corporation 1990-1993

                            Chip diagram (DIP)

                             ._____    _____.
                             |     \__/     |
                          i0 |  1        20 | VCC
                          i1 |  2        19 | q7
                          i2 |  3        18 | i10
                          i3 |  4        17 | q5
                          i4 |  5        16 | q4
                          i5 |  6        15 | q3
                          i6 |  7        14 | q2
                          i7 |  8        13 | q1
                          i8 |  9        12 | q0
                         GND | 10        11 | i9
                             |______________|
Title: Re: Dktronic 64 PAL reversed, almost working code.
Post by: Piotr on 18:40, 12 October 17
BTW i have also working clone of DK tronic ;) Problem is only to finish this PAL.
Title: Re: Dktronic 64 PAL reversed, almost working code.
Post by: arnoldemu on 19:48, 12 October 17
Ok a pdf would not help because there is no labels on it.

I loaded up the schematic, I can hover over the PAL pins and find some of the connections.

I *think* this is part of it:


MREQ=1 M1=2 IORQ=3 WR=4 A15=5 A14=6 i6=7 i7=8 i8=9 GND=10
i9=11 q0=12 q1=13 q2=14 RAS=15 q4=16 q5=17 RAMDIS=18 q7=19 VCC=20

EQUATIONS

!q7 = i8 & i7 & A14 |
         A15;

!q5 = i9 & i8 & !i7 & A14 & A15 & !WR & !IORQ & !M1 & !MREQ |
        !i9 &!i8 & !i7 |
       i7 &A14 & A15 |
      i9 & !i7 & !A15 |
    i7 & !A14 |
   i9 & !A14 |
  i6;

!q4 = !RAMDIS&!i9&!i8&!i7&!i6&!A14&!A15&!WR&!IORQ&!M1&!MREQ |
      i9&i8&!i7&A14&A15&!WR&!IORQ&!M1&!MREQ | i9&i8&!i7&A14&!A15&IORQ&!MREQ |
      i9&i8&!i7&A14&!A15&WR&!MREQ | i9&i8&!i7&A14&!A15&M1;

!RAS = !i9 & i8 & !i7 & !i6 & !MREQ |
     i7 & !i6 & A14 & !A15 & !MREQ |
i9 & !i7 & !i6 & A14 & A15 & !MREQ |
      !M1 & !MREQ |
!WR;

!q2 = !RAMDIS & i9 & !i7 & !i6 & A14 & A15 & M1 & !MREQ | !RAMDIS & !i9 & i8 & !i7 & !i6 & M1 & !MREQ |
      !RAMDIS & i7 & !i6 & A14 & !A15 & M1 & !MREQ | i9&!i7&!i6&A14&A15&!WR&IORQ |
      !i9&i8&!i7&!i6&!WR&IORQ | i7&!i6&A14&!A15&!WR&IORQ;

!q1 = IORQ | WR | A15;

!q0 = i7 & A14 & A15 | i9 & A14 | !i7 & A14;


!q1 makes sense, that is the I/O write to select the amstrad paging.
EDIT: Added RAS
EDIT: Made more of it readable with some spaces.
EDIT: Put it into a code block
Title: Re: Dktronic 64 PAL reversed, almost working code.
Post by: Piotr on 20:03, 12 October 17
Ok, i test it tomorrow.
Title: Re: Dktronic 64 PAL reversed, almost working code.
Post by: Piotr on 16:00, 13 October 17
Hmm, is better, Batman start (on previous .JED not working) but hanging . Phortem total stop working  :)
Short vid where Batman hanging.  https://www.youtube.com/watch?v=WvtVI9SHJgw
Title: Re: Dktronic 64 PAL reversed, almost working code.
Post by: blackdalek on 02:50, 02 January 18
For those not in the know or technically minded... What exactly is a Dk'tronics PAL? Is it some kind of video adapter or chip? I tried googling Dk'Tronics and PAL together but got no useful results.
Title: Re: Dktronic 64 PAL reversed, almost working code.
Post by: 00WReX on 04:19, 02 January 18
Quote from: blackdalek on 02:50, 02 January 18
For those not in the know or technically minded... What exactly is a Dk'tronics PAL? Is it some kind of video adapter or chip? I tried googling Dk'Tronics and PAL together but got no useful results.

A 'Programmable Array Logic' (PAL) is a family of programmable logic device semiconductors used to implement logic functions in digital circuits.

https://en.wikipedia.org/wiki/Programmable_Array_Logic

In the case of the DK'tronics 64K expansion (or the 6128 to access the second 64k bank), a PAL is programmed to perform Memory Management functions.

http://www.cpcwiki.eu/index.php/PAL16L8

Cheers,
Shane
Title: Re: Dktronic 64 PAL reversed, almost working code.
Post by: rpalmer on 05:17, 02 January 18
blackdalek,

The Dk'Tronics PAL is a chip to manage the memory banking on the CPC.

rpalmer
Powered by SMFPacks Menu Editor Mod