Author Topic: Dktronic 64 PAL reversed, almost working code.  (Read 306 times)

0 Members and 1 Guest are viewing this topic.

Offline Piotr

  • CPC6128
  • ****
  • Posts: 248
  • Country: pl
  • Liked: 276
Dktronic 64 PAL reversed, almost working code.
« on: 15: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;

Offline Bryce

  • The Hardware Guy.
  • Supporter
  • 6128 Plus
  • *
  • Posts: 9.791
  • Country: wf
  • It's not broken, it just hasn't been fixed yet.
    • index.php?action=treasury
  • Liked: 3007
Re: Dktronic 64 PAL reversed, almost working code.
« Reply #1 on: 16:39, 12 October 17 »
Batman Forever not start, Phortem not run proper

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

Bryce.

Offline Piotr

  • CPC6128
  • ****
  • Posts: 248
  • Country: pl
  • Liked: 276
Re: Dktronic 64 PAL reversed, almost working code.
« Reply #2 on: 16: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.

Offline arnoldemu

  • Supporter
  • 6128 Plus
  • *
  • Posts: 5.153
  • Country: gb
    • Unofficial Amstrad WWW Resource
  • Liked: 1970
Re: Dktronic 64 PAL reversed, almost working code.
« Reply #3 on: 19:34, 12 October 17 »
@Piotr:

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.
My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

Offline Piotr

  • CPC6128
  • ****
  • Posts: 248
  • Country: pl
  • Liked: 276
Re: Dktronic 64 PAL reversed, almost working code.
« Reply #4 on: 19: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
                             |______________|
« Last Edit: 19:55, 12 October 17 by Piotr »

Offline Piotr

  • CPC6128
  • ****
  • Posts: 248
  • Country: pl
  • Liked: 276
Re: Dktronic 64 PAL reversed, almost working code.
« Reply #5 on: 20:40, 12 October 17 »
BTW i have also working clone of DK tronic ;) Problem is only to finish this PAL.

Offline arnoldemu

  • Supporter
  • 6128 Plus
  • *
  • Posts: 5.153
  • Country: gb
    • Unofficial Amstrad WWW Resource
  • Liked: 1970
Re: Dktronic 64 PAL reversed, almost working code.
« Reply #6 on: 21: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:

Code: [Select]
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
« Last Edit: 22:14, 12 October 17 by arnoldemu »
My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

Offline Piotr

  • CPC6128
  • ****
  • Posts: 248
  • Country: pl
  • Liked: 276
Re: Dktronic 64 PAL reversed, almost working code.
« Reply #7 on: 22:03, 12 October 17 »
Ok, i test it tomorrow.
« Last Edit: 22:11, 12 October 17 by Piotr »

Offline Piotr

  • CPC6128
  • ****
  • Posts: 248
  • Country: pl
  • Liked: 276
Re: Dktronic 64 PAL reversed, almost working code.
« Reply #8 on: 18: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.