Previous 199869 Revisions Next

r33918 Tuesday 16th December, 2014 at 01:09:22 UTC by Jürgen Buchmüller
Clean up and fix comments (nw)
[src/emu/cpu/pps4]pps4.c pps4.h

trunk/src/emu/cpu/pps4/pps4.c
r242429r242430
116116inline UINT8 pps4_device::ROP()
117117{
118118    const UINT8 op = m_direct->read_decrypted_byte(m_P & 0xFFF);
119    m_Ip = m_I;         // save previous opcode
119    m_Ip = m_I1;         // save previous opcode
120120    m_P = (m_P + 1) & 0xFFF;
121121    m_icount -= 1;
122122    return op;
r242429r242430
158158
159159/**
160160 * @brief pps4_device::iAD Add
161 * OPCODE     cycles  mnemonic
162 * -----------------------------
163 * 0000 1011  1 cyc   AD
161 * HEX   BINARY    CYCLES  MNEMONIC
162 * ----------------------------------
163 * 0x0b  0000 1011      1  AD
164164 *
165165 * Symbolic equation
166 * -----------------------------
166 * ----------------------------------
167167 * C, A <- A + M
168168 *
169169 * The result of the binary addition of contents of accumulator
r242429r242430
180180
181181/**
182182 * @brief pps4_device::iADC Add with carry-in
183 * OPCODE     cycles  mnemonic
184 * -----------------------------
185 * 0000 1010  1 cyc   ADC
183 * HEX   BINARY    CYCLES  MNEMONIC
184 * ----------------------------------
185 * 0x0a  0000 1010      1  ADC
186186 *
187187 * Symbolic equation
188 * -----------------------------
188 * ----------------------------------
189189 * C, A <- A + M + C
190190 *
191191 * Same as AD except the C flip-flop serves as a carry-in
r242429r242430
200200
201201/**
202202 * @brief pps4_device::iADSK Add and skip if carry-out
203 * OPCODE     cycles  mnemonic
204 * -----------------------------
205 * 0000 1001  1 cyc   ADSK
203 * HEX   BINARY    CYCLES  MNEMONIC
204 * ----------------------------------
205 * 0x09  0000 1001      1  ADSK
206206 *
207207 * Symbolic equation
208 * -----------------------------
208 * ----------------------------------
209209 * C, A <- A + M
210210 * Skip if C = 1
211211 *
r242429r242430
222222
223223/**
224224 * @brief pps4_device::iADCSK Add with carry-in and skip if carry-out
225 * OPCODE     cycles  mnemonic
226 * -----------------------------
227 * 0000 1000  1 cyc   ADCSK
225 * HEX   BINARY    CYCLES  MNEMONIC
226 * ----------------------------------
227 * 0x08  0000 1000      1  ADCSK
228228 *
229229 * Symbolic equation
230 * -----------------------------
230 * ----------------------------------
231231 * C, A <- A + M + C
232232 * Skip if C = 1
233233 *
r242429r242430
244244
245245/**
246246 * @brief pps4_device::iADI Add immediate
247 * OPCODE     cycles  mnemonic
248 * -----------------------------
249 * 0110 xxxx  1 cyc   ADI x
247 * HEX   BINARY    CYCLES  MNEMONIC
248 * ----------------------------------
249 * 0x6*  0110 xxxx      1  ADI x
250250 *
251251 * Symbolic equation
252 * -----------------------------
252 * ----------------------------------
253253 * A <- A + [I(4:1)]
254254 *
255255 * The result of the binary addition of contents of
r242429r242430
265265 */
266266void pps4_device::iADI()
267267{
268    const UINT8 imm = ~m_I & 15;
268    const UINT8 imm = ~m_I1 & 15;
269269    m_A = m_A + imm;
270270    m_Skip = (m_A >> 4) & 1;
271271    m_A = m_A & 15;
r242429r242430
273273
274274/**
275275 * @brief pps4_device::iDC Decimal correction
276 * OPCODE     cycles  mnemonic
277 * -----------------------------
278 * 0110 0101  1 cyc   DC
276 * HEX   BINARY    CYCLES  MNEMONIC
277 * ----------------------------------
278 * 0x65  0110 0101      1  DC
279279 *
280280 * Symbolic equation
281 * -----------------------------
281 * ----------------------------------
282282 * A <- A + 1010
283283 *
284284 * Decimal correction of accumulator.
r242429r242430
293293
294294/**
295295 * @brief pps4_device::iAND Logical AND
296 * OPCODE     cycles  mnemonic
297 * -----------------------------
298 * 0000 1101  1 cyc   AND
296 * HEX   BINARY    CYCLES  MNEMONIC
297 * ----------------------------------
298 * 0x0d  0000 1101      1  AND
299299 *
300300 * Symbolic equation
301 * -----------------------------
301 * ----------------------------------
302302 * A <- A & M
303303 *
304304 * The result of logical AND of accumulator and
r242429r242430
312312
313313/**
314314 * @brief pps4_device::iOR Logical OR
315 * OPCODE     cycles  mnemonic
316 * -----------------------------
317 * 0000 1111  1 cyc   OR
315 * HEX   BINARY    CYCLES  MNEMONIC
316 * ----------------------------------
317 * 0x0f  0000 1111      1  OR
318318 *
319319 * Symbolic equation
320 * -----------------------------
320 * ----------------------------------
321321 * A <- A | M
322322 *
323323 * The result of logical OR of accumulator and
r242429r242430
331331
332332/**
333333 * @brief pps4_device::iEOR Logical exclusive-OR
334 * OPCODE     cycles  mnemonic
335 * -----------------------------
336 * 0000 1100  1 cyc   EOR
334 * HEX   BINARY    CYCLES  MNEMONIC
335 * ----------------------------------
336 * 0x0c  0000 1100      1  EOR
337337 *
338338 * Symbolic equation
339 * -----------------------------
339 * ----------------------------------
340340 * A <- A ^ M
341341 *
342342 * The result of logical exclusive-OR of
r242429r242430
351351
352352/**
353353 * @brief pps4_device::iCOMP Complement
354 * OPCODE     cycles  mnemonic
355 * -----------------------------
356 * 0000 1110  1 cyc   COMP
354 * HEX   BINARY    CYCLES  MNEMONIC
355 * ----------------------------------
356 * 0x0e  0000 1110      1  COMP
357357 *
358358 * Symbolic equation
359 * -----------------------------
359 * ----------------------------------
360360 * A <- ~A
361361 *
362362 * Each bit of the accumulator is logically
r242429r242430
369369
370370/**
371371 * @brief pps4_device::iSC Set carry flip-flop
372 * OPCODE     cycles  mnemonic
373 * -----------------------------
374 * 0010 0000  1 cyc   SC
372 * HEX   BINARY    CYCLES  MNEMONIC
373 * ----------------------------------
374 * 0x20  0010 0000      1  SC
375375 *
376376 * Symbolic equation
377 * -----------------------------
377 * ----------------------------------
378378 * C <- 1
379379 *
380380 * The C flip-flop is set to 1.
r242429r242430
386386
387387/**
388388 * @brief pps4_device::iRC Reset carry flip-flop
389 * OPCODE     cycles  mnemonic
390 * -----------------------------
391 * 0010 0100  1 cyc   RC
389 * HEX   BINARY    CYCLES  MNEMONIC
390 * ----------------------------------
391 * 0x28  0010 0100      1  RC
392392 *
393393 * Symbolic equation
394 * -----------------------------
394 * ----------------------------------
395395 * C <- 0
396396 *
397397 * The C flip-flop is set to 0.
r242429r242430
403403
404404/**
405405 * @brief pps4_device::iSF1 Set flip-flop FF1
406 * OPCODE     cycles  mnemonic
407 * -----------------------------
408 * 0010 0010  1 cyc   SF1
406 * HEX   BINARY    CYCLES  MNEMONIC
407 * ----------------------------------
408 * 0x22  0010 0010      1  SF1
409409 *
410410 * Symbolic equation
411 * -----------------------------
411 * ----------------------------------
412412 * FF1 <- 1
413413 *
414414 * The Flip-flop FF1 is set to 1.
r242429r242430
420420
421421/**
422422 * @brief pps4_device::iRF1 Reset flip-flop FF1
423 * OPCODE     cycles  mnemonic
424 * -----------------------------
425 * 0010 0110  1 cyc   RF1
423 * HEX   BINARY    CYCLES  MNEMONIC
424 * ----------------------------------
425 * 0x26  0010 0110      1  RF1
426426 *
427427 * Symbolic equation
428 * -----------------------------
428 * ----------------------------------
429429 * FF1 <- 0
430430 *
431431 * The Flip-flop FF1 is set to 0.
r242429r242430
437437
438438/**
439439 * @brief pps4_device::iSF2 Set flip-flop FF2
440 * OPCODE     cycles  mnemonic
441 * -----------------------------
442 * 0010 0001  1 cyc   SF2
440 * HEX   BINARY    CYCLES  MNEMONIC
441 * ----------------------------------
442 * 0x21  0010 0001      1  SF2
443443 *
444444 * Symbolic equation
445 * -----------------------------
445 * ----------------------------------
446446 * FF2 <- 1
447447 *
448448 * The Flip-flop FF2 is set to 1.
r242429r242430
454454
455455/**
456456 * @brief pps4_device::iRF2 Reset flip-flop FF2
457 * OPCODE     cycles  mnemonic
458 * -----------------------------
459 * 0010 0101  1 cyc   RF2
457 * HEX   BINARY    CYCLES  MNEMONIC
458 * ----------------------------------
459 * 0x25  0010 0101      1  RF2
460460 *
461461 * Symbolic equation
462 * -----------------------------
462 * ----------------------------------
463463 * FF2 <- 0
464464 *
465465 * The flip-flop FF2 is set to 0.
r242429r242430
471471
472472/**
473473 * @brief pps4_device::iLD Load accumulator from memory
474 * OPCODE     cycles  mnemonic
475 * -----------------------------
476 * 0011 0xxx  1 cyc   LD x
474 * HEX   BINARY    CYCLES  MNEMONIC
475 * ----------------------------------
476 * 0x30+ 0011 0xxx      1  LD x
477477 *
478478 * Symbolic equation
479 * -----------------------------
479 * ----------------------------------
480480 * A <- M
481481 * B(7:5) <- B(7:5) ^ [I(3:1)]
482482 *
r242429r242430
490490 */
491491void pps4_device::iLD()
492492{
493    const UINT16 i3c = ~m_I & 7;
493    const UINT16 i3c = ~m_I1 & 7;
494494    m_A = M();
495495    m_B = m_B ^ (i3c << 4);
496496}
497497
498498/**
499499 * @brief pps4_device::iEX Exchange accumulator and memory
500 * OPCODE     cycles  mnemonic
501 * -----------------------------
502 * 0011 1xxx  1 cyc   EX x
500 * HEX   BINARY    CYCLES  MNEMONIC
501 * ----------------------------------
502 * 0x38+ 0011 1xxx      1  EX x
503503 *
504504 * Symbolic equation
505 * -----------------------------
505 * ----------------------------------
506506 * A <-> M
507507 * B(7:5) <- B(7:5) ^ [I(3:1)]
508508 *
r242429r242430
513513 */
514514void pps4_device::iEX()
515515{
516    const UINT16 i3c = ~m_I & 7;
516    const UINT16 i3c = ~m_I1 & 7;
517517    const UINT8 mem = M();
518518    W(m_A);
519519    m_A = mem;
r242429r242430
522522
523523/**
524524 * @brief pps4_device::iEXD Exchange accumulator and memory and decrement BL
525 * OPCODE     cycles  mnemonic
526 * -----------------------------
527 * 0010 1xxx  1 cyc   EXD x
525 * HEX   BINARY    CYCLES  MNEMONIC
526 * ----------------------------------
527 * 0x28+ 0010 1xxx      1  EXD x
528528 *
529529 * Symbolic equation
530 * -----------------------------
530 * ----------------------------------
531531 * A <-> M
532532 * B(7:5) <- B(7:5) ^ [I(3:1)]
533533 * BL <- BL - 1
r242429r242430
542542 */
543543void pps4_device::iEXD()
544544{
545    const UINT8 i3c = ~m_I & 7;
545    const UINT8 i3c = ~m_I1 & 7;
546546    const UINT8 mem = M();
547547    UINT8 bl = m_B & 15;
548548    W(m_A);
r242429r242430
560560
561561/**
562562 * @brief pps4_device::iLDI Load accumualtor immediate
563 * OPCODE     cycles  mnemonic
564 * -----------------------------
565 * 0111 xxxx  1 cyc   LDI x
563 * HEX   BINARY    CYCLES  MNEMONIC
564 * ----------------------------------
565 * 0x7*  0111 xxxx      1  LDI x
566566 *
567567 * Symbolic equation
568 * -----------------------------
568 * ----------------------------------
569569 * A <- [I(4:1)]
570570 *
571571 * The 4-bit contents, immediate field I(4:1),
r242429r242430
581581{
582582    // previous LDI instruction?
583583    if (0x70 == (m_Ip & 0xf0)) {
584        LOG(("%s: skip prev:%02x op:%02x\n", __FUNCTION__, m_Ip, m_I));
584        LOG(("%s: skip prev:%02x op:%02x\n", __FUNCTION__, m_Ip, m_I1));
585585        return;
586586    }
587    m_A = ~m_I & 15;
587    m_A = ~m_I1 & 15;
588588}
589589
590590/**
591591 * @brief pps4_device::iLAX
592 * OPCODE     cycles  mnemonic
593 * -----------------------------
594 * 0001 0010  1 cyc   LAX
592 * HEX   BINARY    CYCLES  MNEMONIC
593 * ----------------------------------
594 * 0x12  0001 0010      1  LAX
595595 *
596596 * Symbolic equation
597 * -----------------------------
597 * ----------------------------------
598598 * A <- X
599599 *
600600 * The 4-bit contents of the X register are
r242429r242430
607607
608608/**
609609 * @brief pps4_device::iLXA
610 * OPCODE     cycles  mnemonic
611 * -----------------------------
612 * 0001 1011  1 cyc   LXA
610 * HEX   BINARY    CYCLES  MNEMONIC
611 * ----------------------------------
612 * 0x1b  0001 1011      1  LXA
613613 *
614614 * Symbolic equation
615 * -----------------------------
615 * ----------------------------------
616616 * X <- A
617617 *
618618 * The contents of the accumulator are
r242429r242430
625625
626626/**
627627 * @brief pps4_device::iLABL
628 * OPCODE     cycles  mnemonic
629 * -----------------------------
630 * 0001 0001  1 cyc   LABL
628 * HEX   BINARY    CYCLES  MNEMONIC
629 * ----------------------------------
630 * 0x11  0001 0001      1  LABL
631631 *
632632 * Symbolic equation
633 * -----------------------------
633 * ----------------------------------
634634 * A <- BL
635635 *
636636 * The contents of BL register are
r242429r242430
643643
644644/**
645645 * @brief pps4_device::iLBMX
646 * OPCODE     cycles  mnemonic
647 * -----------------------------
648 * 0001 0000  1 cyc   LBMX
646 * HEX   BINARY    CYCLES  MNEMONIC
647 * ----------------------------------
648 * 0x10  0001 0000      1  LBMX
649649 *
650650 * Symbolic equation
651 * -----------------------------
651 * ----------------------------------
652652 * BM <- X
653653 *
654654 * The contents of X register are
r242429r242430
661661
662662/**
663663 * @brief pps4_device::iLBUA
664 * OPCODE     cycles  mnemonic
665 * -----------------------------
666 * 0000 0100  1 cyc   LBUA
664 * HEX   BINARY    CYCLES  MNEMONIC
665 * ----------------------------------
666 * 0x08  0000 0100      1  LBUA
667667 *
668668 * Symbolic equation
669 * -----------------------------
669 * ----------------------------------
670670 * BU <- A
671671 * A <- M
672672 *
r242429r242430
682682
683683/**
684684 * @brief pps4_device::iXABL
685 * OPCODE     cycles  mnemonic
686 * -----------------------------
687 * 0001 1001  1 cyc   XABL
685 * HEX   BINARY    CYCLES  MNEMONIC
686 * ----------------------------------
687 * 0x19  0001 1001      1  XABL
688688 *
689689 * Symbolic equation
690 * -----------------------------
690 * ----------------------------------
691691 * A <-> BL
692692 *
693693 * The contents of accumulator and BL register
r242429r242430
703703
704704/**
705705 * @brief pps4_device::iXMBX
706 * OPCODE     cycles  mnemonic
707 * -----------------------------
708 * 0001 1000  1 cyc   XMBX
706 * HEX   BINARY    CYCLES  MNEMONIC
707 * ----------------------------------
708 * 0x18  0001 1000      1  XMBX
709709 *
710710 * Symbolic equation
711 * -----------------------------
711 * ----------------------------------
712712 * X <-> BM
713713 *
714714 * The contents of accumulator and BL register
r242429r242430
724724
725725/**
726726 * @brief pps4_device::iXAX
727 * OPCODE     cycles  mnemonic
728 * -----------------------------
729 * 0001 1010  1 cyc   XAX
727 * HEX   BINARY    CYCLES  MNEMONIC
728 * ----------------------------------
729 * 0x1a  0001 1010      1  XAX
730730 *
731731 * Symbolic equation
732 * -----------------------------
732 * ----------------------------------
733733 * A <-> X
734734 *
735735 * The contents of accumulator and X register
r242429r242430
745745
746746/**
747747 * @brief pps4_device::iXS
748 * OPCODE     cycles  mnemonic
749 * -----------------------------
750 * 0000 0110  1 cyc   XS
748 * HEX   BINARY    CYCLES  MNEMONIC
749 * ----------------------------------
750 * 0x06  0000 0110      1  XS
751751 *
752752 * Symbolic equation
753 * -----------------------------
753 * ----------------------------------
754754 * SA <-> SB
755755 *
756756 * The 12-bit contents of SA and SB register
r242429r242430
766766
767767/**
768768 * @brief pps4_device::iCYS
769 * OPCODE     cycles  mnemonic
770 * -----------------------------
771 * 0110 1111  1 cyc    CYS
769 * HEX   BINARY    CYCLES  MNEMONIC
770 * ----------------------------------
771 * 0x6f  0110 1111      1   CYS
772772 *
773773 * Symbolic equation
774 * -----------------------------
774 * ----------------------------------
775775 * A <- SA(4:1)
776776 * SA(4:1) <- SA(8:5)
777777 * SA(8:5) <- SA(12:9)
r242429r242430
793793
794794/**
795795 * @brief pps4_device::iLB Load B indirect
796 * OPCODE     cycles  mnemonic
797 * -----------------------------
798 * 1100 xxxx  2 cyc    LB x
796 * HEX   BINARY    CYCLES  MNEMONIC
797 * ----------------------------------
798 * 0xc*  1100 xxxx      2   LB x
799799 *
800800 * Symbolic equation
801 * -----------------------------
801 * ----------------------------------
802802 * SB <- SA, SA <- P
803803 * P(12:5) <- 0000 1100
804804 * P(4:1) <- I(4:1)
r242429r242430
828828{
829829    // previous LB or LBL instruction?
830830    if (0xc0 == (m_Ip & 0xf0) || 0x00 == m_Ip) {
831        LOG(("%s: skip prev:%02x op:%02x\n", __FUNCTION__, m_Ip, m_I));
831        LOG(("%s: skip prev:%02x op:%02x\n", __FUNCTION__, m_Ip, m_I1));
832832        return;
833833    }
834834    m_SB = m_SA;
835835    m_SA = (m_P + 1) & 0xFFF;
836    m_P = (3 << 6) | (m_I & 15);
836    m_P = (3 << 6) | (m_I1 & 15);
837837    m_B = ~ARG() & 255;
838838    m_P = m_SA;
839839    // swap SA and SB
r242429r242430
844844
845845/**
846846 * @brief pps4_device::iLBL Load B long
847 * OPCODE     cycles  mnemonic
848 * -----------------------------
849 * 0000 0000  2 cyc    LBL
847 * HEX   BINARY    CYCLES  MNEMONIC
848 * ----------------------------------
849 * 0x00  0000 0000      2   LBL
850850 *
851851 * Symbolic equation
852 * -----------------------------
852 * ----------------------------------
853853 * BU <- 0000
854854 * B(8:1) <- [I2(8:1)]
855855 *
r242429r242430
870870    m_I2 = ARG();
871871    // previous LB or LBL instruction?
872872    if (0xc0 == (m_Ip & 0xf0) || 0x00 == m_Ip) {
873        LOG(("%s: skip prev:%02x op:%02x\n", __FUNCTION__, m_Ip, m_I));
873        LOG(("%s: skip prev:%02x op:%02x\n", __FUNCTION__, m_Ip, m_I1));
874874        return;
875875    }
876876    m_B = ~m_I2 & 255;  // Note: immediate is 1's complement
r242429r242430
878878
879879/**
880880 * @brief pps4_device::INCB Increment B lower, skip if 0000
881 * OPCODE     cycles  mnemonic
882 * -----------------------------
883 * 0001 0111  1 cyc    INCB
881 * HEX   BINARY    CYCLES  MNEMONIC
882 * ----------------------------------
883 * 0x17  0001 0111      1   INCB
884884 *
885885 * Symbolic equation
886 * -----------------------------
886 * ----------------------------------
887887 * BL <- BL + 1
888888 * Skip on BL = 0000
889889 *
r242429r242430
904904
905905/**
906906 * @brief pps4_device::iDECB Decrement B lower, skip if 1111
907 * OPCODE     cycles  mnemonic
908 * -----------------------------
909 * 0001 1111  1 cyc    DECB
907 * HEX   BINARY    CYCLES  MNEMONIC
908 * ----------------------------------
909 * 0x1f  0001 1111      1   DECB
910910 *
911911 * Symbolic equation
912 * -----------------------------
912 * ----------------------------------
913913 * BL <- BL - 1
914914 * Skip on BL = 1111
915915 *
r242429r242430
930930
931931/**
932932 * @brief pps4_device::iT Transfer
933 * OPCODE     cycles  mnemonic
934 * -----------------------------
935 * 10xx xxxx  1 cyc    T *xx
933 * HEX   BINARY    CYCLES  MNEMONIC
934 * ----------------------------------
935 * 0x80+ 10xx xxxx      1   T *xx
936936 *
937937 * Symbolic equation
938 * -----------------------------
938 * ----------------------------------
939939 * P(6:1) <- I(6:1)
940940 *
941941 * An unconditional transfer to a ROM word on the current
r242429r242430
945945 */
946946void pps4_device::iT()
947947{
948    const UINT16 p = (m_P & ~63) | (m_I & 63);
949    LOG(("%s: P=%03x I=%02x -> P=%03x\n", __FUNCTION__, m_P, m_I, p));
948    const UINT16 p = (m_P & ~63) | (m_I1 & 63);
949    LOG(("%s: P=%03x I=%02x -> P=%03x\n", __FUNCTION__, m_P, m_I1, p));
950950    m_P = p;
951951}
952952
953953/**
954954 * @brief pps4_device::iTM Transfer and mark indirect
955 * OPCODE     cycles  mnemonic
956 * -----------------------------
957 * 11xx xxxx  2 cyc    TM x
958 * yyyy yyyy  from page 3
955 * HEX   BINARY    CYCLES  MNEMONIC
956 * ----------------------------------
957 * 0xc0+ 11xx xxxx      2   TM x
958 *       yyyy yyyy  from page 3
959959 *
960960 * Symbolic equation
961 * -----------------------------
961 * ----------------------------------
962962 * SB <- SA, SA <- P
963963 * P(12:7) <- 000011
964964 * P(6:1) <- I1(6:1)
r242429r242430
979979{
980980    m_SB = m_SA;
981981    m_SA = m_P;
982    m_P = (3 << 6) | (m_I & 63);
982    m_P = (3 << 6) | (m_I1 & 63);
983983    m_I2 = ARG();
984984    m_P = (1 << 8) | m_I2;
985985}
986986
987987/**
988988 * @brief pps4_device::iTL Transfer long
989 * OPCODE     cycles  mnemonic
990 * -----------------------------
991 * 0101 xxxx  2 cyc    TL xyy
992 * yyyy yyyy
989 * HEX   BINARY    CYCLES  MNEMONIC
990 * ----------------------------------
991 * 0x5x  0101 xxxx      2   TL xyy
992 *       yyyy yyyy
993993 *
994994 * Symbolic equation
995 * -----------------------------
995 * ----------------------------------
996996 * P(12:9) <- I1(4:1)
997997 * P(8:1) <- I2(8:1)
998998 *
r242429r242430
10041004void pps4_device::iTL()
10051005{
10061006    m_I2 = ARG();
1007    m_P = ((m_I & 15) << 8) | m_I2;
1007    m_P = ((m_I1 & 15) << 8) | m_I2;
10081008}
10091009
10101010/**
10111011 * @brief pps4_device::iTML Transfer and mark long
1012 * OPCODE     cycles  mnemonic
1013 * -----------------------------
1014 * 0101 xxxx  2 cyc    TML xyy
1015 * yyyy yyyy
1012 * HEX   BINARY    CYCLES  MNEMONIC
1013 * ----------------------------------
1014 * 0x0*  0000 xxxx      2   TML xyy
1015 *       yyyy yyyy
10161016 *
10171017 * Symbolic equation
1018 * -----------------------------
1018 * ----------------------------------
10191019 * SB <- SA, SA <- P
10201020 * P(12:9) <- I1(4:1)
10211021 * P(8:1) <- I2(8:1)
r242429r242430
10311031    m_I2 = ARG();
10321032    m_SB = m_SA;
10331033    m_SA = m_P;
1034    m_P = ((m_I & 15) << 8) | m_I2;
1034    m_P = ((m_I1 & 15) << 8) | m_I2;
10351035}
10361036
10371037/**
10381038 * @brief pps4_device::iSKC Skip on carry flip-flop
1039 * OPCODE     cycles  mnemonic
1040 * -----------------------------
1041 * 0001 0101  1 cyc    SKC
1039 * HEX   BINARY    CYCLES  MNEMONIC
1040 * ----------------------------------
1041 * 0x15  0001 0101      1   SKC
10421042 *
10431043 * Symbolic equation
1044 * -----------------------------
1044 * ----------------------------------
10451045 * Skip if C = 1
10461046 *
10471047 * The next ROM word will be ignored if C flip-flop is 1.
r242429r242430
10531053
10541054/**
10551055 * @brief pps4_device::iSKC Skip on carry flip-flop
1056 * OPCODE     cycles  mnemonic
1057 * -----------------------------
1058 * 0001 1110  1 cyc    SKZ
1056 * HEX   BINARY    CYCLES  MNEMONIC
1057 * ----------------------------------
1058 * 0x1e  0001 1110      1   SKZ
10591059 *
10601060 * Symbolic equation
1061 * -----------------------------
1061 * ----------------------------------
10621062 * Skip if A = 0
10631063 *
10641064 * The next ROM word will be ignored if C flip-flop is 1.
r242429r242430
10701070
10711071/**
10721072 * @brief pps4_device::iSKBI Skip if BL equal to immediate
1073 * OPCODE     cycles  mnemonic
1074 * -----------------------------
1075 * 0100 xxxx  1 cyc    SKBI x
1073 * HEX   BINARY    CYCLES  MNEMONIC
1074 * ----------------------------------
1075 * 0x4*  0100 xxxx      1   SKBI x
10761076 *
10771077 * Symbolic equation
1078 * -----------------------------
1078 * ----------------------------------
10791079 * Skip if BL = I(4:1)
10801080 *
10811081 * The next ROM word will be ignored if the least significant
r242429r242430
10841084 */
10851085void pps4_device::iSKBI()
10861086{
1087    const UINT8 i4 = m_I & 15;
1087    const UINT8 i4 = m_I1 & 15;
10881088    const UINT8 bl = m_B & 15;
10891089    m_Skip = bl == i4 ? 1 : 0;
10901090}
10911091
10921092/**
10931093 * @brief pps4_device::iSKF1 Skip if FF1 equals 1
1094 * OPCODE     cycles  mnemonic
1095 * -----------------------------
1096 * 0001 0110  1 cyc    SKF1
1094 * HEX   BINARY    CYCLES  MNEMONIC
1095 * ----------------------------------
1096 * 0x16  0001 0110      1   SKF1
10971097 *
10981098 * Symbolic equation
1099 * -----------------------------
1099 * ----------------------------------
11001100 * Skip if FF1 = 1
11011101 */
11021102void pps4_device::iSKF1()
r242429r242430
11061106
11071107/**
11081108 * @brief pps4_device::iSKF2 Skip if FF2 equals 1
1109 * OPCODE     cycles  mnemonic
1110 * -----------------------------
1111 * 0001 0100  1 cyc    SKF2
1109 * HEX   BINARY    CYCLES  MNEMONIC
1110 * ----------------------------------
1111 * 0x14  0001 0100      1   SKF2
11121112 *
11131113 * Symbolic equation
1114 * -----------------------------
1114 * ----------------------------------
11151115 * Skip if FF2 = 1
11161116 */
11171117void pps4_device::iSKF2()
r242429r242430
11211121
11221122/**
11231123 * @brief pps4_device::iRTN Return
1124 * OPCODE     cycles  mnemonic
1125 * -----------------------------
1126 * 0000 0101  1 cyc    RTN
1124 * HEX   BINARY    CYCLES  MNEMONIC
1125 * ----------------------------------
1126 * 0x05  0000 0101      1   RTN
11271127 *
11281128 * Symbolic equation
1129 * -----------------------------
1129 * ----------------------------------
11301130 * P <- SA, SA <-> SB
11311131 *
11321132 * This instruction executes a return from subroutine
r242429r242430
11431143}
11441144
11451145/**
1146 * @brief pps4_device::iRTN Return
1147 * OPCODE     cycles  mnemonic
1148 * -----------------------------
1149 * 0000 0111  1 cyc    RTNSK
1146 * @brief pps4_device::iRTNSK Return and skip
1147 * HEX   BINARY    CYCLES  MNEMONIC
1148 * ----------------------------------
1149 * 0x07  0000 0111      1   RTNSK
11501150 *
11511151 * Symbolic equation
1152 * -----------------------------
1152 * ----------------------------------
11531153 * P <- SA, SA <-> SB
11541154 * P <- P + 1
11551155 *
r242429r242430
11671167}
11681168
11691169/**
1170 * @brief pps4_device::IOL
1171 * OPCODE     cycles  mnemonic
1172 * -----------------------------
1173 * 0001 1100  2 cyc    IOL yy
1174 * yyyy yyyy
1170 * @brief pps4_device::IOL Input / Output Long
1171 * HEX   BINARY    CYCLES  MNEMONIC
1172 * ----------------------------------
1173 * 0x1c  0001 1100      2   IOL yy
1174 *       yyyy yyyy
11751175 *
11761176 * Symbolic equation
1177 * -----------------------------
1177 * ----------------------------------
11781178 * ~A -> Data Bus
11791179 * A <- ~Data Bus
11801180 * I2 -> I/O device
r242429r242430
11891189 * device is transferred to the accumulator inverted.
11901190 *
11911191 * FIXME: Is BL on the I/D:8-5 lines during the I/O cycle?
1192 * The ROM, RAM, I/O chips A17xx suggest this, because they
1193 * expect the value of BL to address one of the sixteen
1194 * input/output lines.
11921195 */
11931196void pps4_device::iIOL()
11941197{
r242429r242430
12031206
12041207/**
12051208 * @brief pps4_device::iDIA Discrete input group A
1206 * OPCODE     cycles  mnemonic
1207 * -----------------------------
1208 * 0010 0111  1 cyc    DIA
1209 * HEX   BINARY    CYCLES  MNEMONIC
1210 * ----------------------------------
1211 * 0x27  0010 0111      1   DIA
12091212 *
12101213 * Symbolic equation
1211 * -----------------------------
1214 * ----------------------------------
12121215 * A <- DIA
12131216 *
12141217 * Data at the inputs to discrete group A is
r242429r242430
12211224
12221225/**
12231226 * @brief pps4_device::iDIB Discrete input group B
1224 * OPCODE     cycles  mnemonic
1225 * -----------------------------
1226 * 0010 0011  1 cyc    DIB
1227 * HEX   BINARY    CYCLES  MNEMONIC
1228 * ----------------------------------
1229 * 0x23  0010 0011      1   DIB
12271230 *
12281231 * Symbolic equation
1229 * -----------------------------
1232 * ----------------------------------
12301233 * A <- DIB
12311234 *
12321235 * Data at the inputs to discrete group B is
r242429r242430
12391242
12401243/**
12411244 * @brief pps4_device::iDOA Discrete output
1242 * OPCODE     cycles  mnemonic
1243 * -----------------------------
1244 * 0001 1101  1 cyc    DOA
1245 * HEX   BINARY    CYCLES  MNEMONIC
1246 * ----------------------------------
1247 * 0x1d  0001 1101      1   DOA
12451248 *
12461249 * Symbolic equation
1247 * -----------------------------
1250 * ----------------------------------
12481251 * DOA <- A
12491252 *
12501253 * The contents of the accumulator are transferred
r242429r242430
12571260
12581261/**
12591262 * @brief pps4_device::iSAG Special address generation
1260 * OPCODE     cycles  mnemonic
1261 * -----------------------------
1262 * 0010 1101  1 cyc    SAG
1263 * HEX   BINARY    CYCLES  MNEMONIC
1264 * ----------------------------------
1265 * 0x2d  0001 0011      1   SAG
12631266 *
12641267 * Symbolic equation
1265 * -----------------------------
1268 * ----------------------------------
12661269 * A/B Bus (12:5) <- 0000 0000
12671270 * A/B Bus (4:1) <- BL(4:1)
12681271 * Contents of B remains unchanged
r242429r242430
12831286***************************************************************************/
12841287void pps4_device::execute_one()
12851288{
1286    m_I = ROP();
1289    m_I1 = ROP();
12871290    if (m_Skip) {
12881291        m_Skip = 0;
1289        LOG(("%s: skip op:%02x\n", __FUNCTION__, m_I));
1292        LOG(("%s: skip op:%02x\n", __FUNCTION__, m_I1));
12901293        return;
12911294    }
1292    switch (m_I) {
1295    switch (m_I1) {
12931296    case 0x00:
12941297        iLBL();
12951298        break;
r242429r242430
15281531    save_item(NAME(m_C));
15291532    save_item(NAME(m_FF1));
15301533    save_item(NAME(m_FF2));
1531    save_item(NAME(m_I));
1534    save_item(NAME(m_I1));
15321535    save_item(NAME(m_I2));
15331536    save_item(NAME(m_Ip));
15341537
15351538    state_add( PPS4_PC, "PC", m_P ).mask(0xFFF).formatstr("%03X");
1536    state_add( PPS4_A,  "A",  m_A ).formatstr("%01X");
1537    state_add( PPS4_X,  "X",  m_X ).formatstr("%01X");
1539    state_add( PPS4_A, "A",  m_A ).formatstr("%01X");
1540    state_add( PPS4_X, "X",  m_X ).formatstr("%01X");
15381541    state_add( PPS4_SA, "SA", m_SA ).formatstr("%03X");
15391542    state_add( PPS4_SB, "SB", m_SB ).formatstr("%03X");
1540    state_add( PPS4_Skip,  "Skip",  m_Skip ).formatstr("%01X");
1541    state_add( PPS4_SAG,  "SAG",  m_SAG ).formatstr("%03X");
1542    state_add( PPS4_B,  "B",  m_B ).formatstr("%03X");
1543    state_add( PPS4_I2,  "I",  m_I ).formatstr("%02X").noshow();
1544    state_add( PPS4_I2,  "I2",  m_I2 ).formatstr("%02X").noshow();
1545    state_add( PPS4_Ip,  "Ip",  m_Ip ).formatstr("%02X").noshow();
1546    state_add( STATE_GENPC, "GENPC", m_P ).noshow();
1543    state_add( PPS4_Skip, "Skip",  m_Skip ).formatstr("%01X");
1544    state_add( PPS4_SAG, "SAG",  m_SAG ).formatstr("%03X");
1545    state_add( PPS4_B, "B",  m_B ).formatstr("%03X");
1546    state_add( PPS4_I1, "I1",  m_I1 ).formatstr("%02X").noshow();
1547    state_add( PPS4_I2, "I2",  m_I2 ).formatstr("%02X").noshow();
1548    state_add( PPS4_Ip, "Ip",  m_Ip ).formatstr("%02X").noshow();
1549    state_add( STATE_GENPC,    "GENPC", m_P ).noshow();
15471550    state_add( STATE_GENFLAGS, "GENFLAGS", m_C).formatstr("%3s").noshow();
15481551
15491552    m_icountptr = &m_icount;
r242429r242430
15781581    m_C = 0;        // Carry flip-flop
15791582    m_FF1 = 0;      // Flip-flop 1
15801583    m_FF2 = 0;      // Flip-flop 2
1581    m_I = 0;        // Most recent instruction I(8:1)
1584    m_I1 = 0;        // Most recent instruction I(8:1)
15821585    m_I2 = 0;       // Most recent parameter I2(8:1)
15831586    m_Ip = 0;       // Previous instruction I(8:1)
15841587}
trunk/src/emu/cpu/pps4/pps4.h
r242429r242430
1717    PPS4_B,
1818    PPS4_Skip,
1919    PPS4_SAG,
20    PPS4_I1,
2021    PPS4_I2,
2122    PPS4_Ip,
2223    PPS4_GENPC = STATE_GENPC,
r242429r242430
9091    UINT8   m_C;        //!< Carry flip-flop
9192    UINT8   m_FF1;      //!< Flip-flop 1
9293    UINT8   m_FF2;      //!< Flip-flop 2
93    UINT8   m_I;        //!< Most recent instruction I(8:1)
94    UINT8   m_I1;        //!< Most recent instruction I(8:1)
9495    UINT8   m_I2;       //!< Most recent parameter I2(8:1)
9596    UINT8   m_Ip;       //!< Previous instruction I(8:1)
9697


Previous 199869 Revisions Next


© 1997-2024 The MAME Team