44
55 Implementation of the Cube Quest AM2901-based CPUs
66
7- TODO:
7+ TODO:
88
99 * Tidy up diassembly (split into different files?)
1010
1919***************************************************************************/
2020
2121/* Am2901 Instruction Fields */
22- static const char * ins [] =
22+ static const char * ins [] =
2323{
2424 "ADD " ,
2525 "SUBR " ,
@@ -43,7 +43,7 @@ static const char* src[] =
4343 "D,0" ,
4444};
4545
46- static const char * dst [] =
46+ static const char * dst [] =
4747{
4848 "QREG " ,
4949 "NOP " ,
@@ -409,7 +409,7 @@ static void cquestrot_init(int index, int clock, const void *_config, int (*irqc
409409 cquestrot_state_register (index , "cquestrot" );
410410
411411 /* Allocate RAM */
412- cquestrot .dram = malloc (16384 * sizeof (UINT16 )); /* Shared with 68000 */
412+ cquestrot .dram = malloc (16384 * sizeof (UINT16 )); /* Shared with 68000 */
413413 cquestrot .sram = malloc (2048 * sizeof (UINT16 )); /* Private */
414414}
415415
@@ -748,7 +748,7 @@ static int cquestsnd_execute(int cycles)
748748
749749static offs_t cquestsnd_dasm (char * buffer , offs_t pc , const UINT8 * oprom , const UINT8 * opram )
750750{
751- static const char * jmps [] =
751+ static const char * jmps [] =
752752 {
753753 "JUMP " ,
754754 " " ,
@@ -761,7 +761,7 @@ static offs_t cquestsnd_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const
761761 };
762762
763763
764- static const char * latches [] =
764+ static const char * latches [] =
765765 {
766766 "PLTCH " ,
767767 "DAC " ,
@@ -880,7 +880,7 @@ static int cquestrot_execute(int cycles)
880880
881881 /* Core execution loop */
882882 do
883- {
883+ {
884884 /* Decode the instruction */
885885 UINT64 inst = cpu_readop64 (ROT_PC << 3 );
886886
@@ -1084,7 +1084,7 @@ static int cquestrot_execute(int cycles)
10841084 r15 = (cquestrot .vflag ^ BIT (cquestrot .f , 15 )) << 15 ;
10851085 break ;
10861086 }
1087-
1087+
10881088 cquestrot .ram [b ] = r15 | (cquestrot .f >> 1 );
10891089 cquestrot .y = cquestrot .f ;
10901090 break ;
@@ -1201,7 +1201,7 @@ static int cquestrot_execute(int cycles)
12011201
12021202static offs_t cquestrot_dasm (char * buffer , offs_t pc , const UINT8 * oprom , const UINT8 * opram )
12031203{
1204- static const char * jmps [] =
1204+ static const char * jmps [] =
12051205 {
12061206 " " ,
12071207 "JSEQ " ,
@@ -1234,7 +1234,7 @@ static offs_t cquestrot_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const
12341234 "Y2D " ,
12351235 };
12361236
1237- static const char * spfs [] =
1237+ static const char * spfs [] =
12381238 {
12391239 " " ,
12401240 " " ,
@@ -1262,16 +1262,16 @@ static offs_t cquestrot_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const
12621262 int t = (inshig >> 20 ) & 0xfff ;
12631263 int jmp = (inshig >> 16 ) & 0xf ;
12641264 int spf = (inshig >> 12 ) & 0xf ;
1265- // int rsrc = (inshig >> 11) & 0x1;
1265+ // int rsrc = (inshig >> 11) & 0x1;
12661266 int yout = (inshig >> 8 ) & 0x7 ;
12671267 int sel = (inshig >> 6 ) & 0x3 ;
1268- // int dsrc = (inshig >> 4) & 0x3;
1268+ // int dsrc = (inshig >> 4) & 0x3;
12691269 int b = (inshig >> 0 ) & 0xf ;
12701270 int a = (inslow >> 28 ) & 0xf ;
12711271 int i8_6 = (inslow >> 24 ) & 0x7 ;
12721272 int ci = (inslow >> 23 ) & 0x1 ;
12731273 int i5_3 = (inslow >> 20 ) & 0x7 ;
1274- // int _sex = (inslow >> 19) & 0x1;
1274+ // int _sex = (inslow >> 19) & 0x1;
12751275 int i2_0 = (inslow >> 16 ) & 0x7 ;
12761276
12771277 sprintf (buffer , "%s %s,%s %x,%x,%c %d %s %s %s %.2x\n" ,
@@ -1613,7 +1613,7 @@ static int cquestlin_execute(int cycles)
16131613 cquestlin .pc [prog ] = (cquestlin .pc [prog ] + 1 ) & 0x7f ;
16141614
16151615 if (prog == BACKGROUND )
1616- cquestlin .pc [prog ] |= 0x80 ;
1616+ cquestlin .pc [prog ] |= 0x80 ;
16171617 else
16181618 {
16191619 /* Handle events that happen during FG execution */
@@ -1643,7 +1643,7 @@ static int cquestlin_execute(int cycles)
16431643 {
16441644 int _ycet ;
16451645 int mux_sel = (BIT (cquestlin .sreg , SREG_DX_DY ) << 1 ) | (BIT (cquestlin .sreg , SREG_DX ) ^ BIT (cquestlin .sreg , SREG_DY ));
1646-
1646+
16471647 if (mux_sel == 0 )
16481648 _ycet = !(cquestlin .gt0reg && (spf == LSPF_BRES ));
16491649 else if (mux_sel == 1 )
@@ -1712,7 +1712,7 @@ static int cquestlin_execute(int cycles)
17121712 {
17131713 int _lpwrt = BIT (cquestlin .bglatch , 5 );
17141714
1715- cquestlin .bglatch =
1715+ cquestlin .bglatch =
17161716 (!(spf == LSPF_PWRT ) << 5 )
17171717 | (_lpwrt << 4 )
17181718 | ((!_lpwrt || (!(spf == LSPF_PWRT ) && (latch == LLATCH_BADLATCH ))) << 2 );
@@ -1759,7 +1759,7 @@ static int cquestlin_execute(int cycles)
17591759
17601760static offs_t cquestlin_dasm (char * buffer , offs_t pc , const UINT8 * oprom , const UINT8 * opram )
17611761{
1762- static const char * jmps [] =
1762+ static const char * jmps [] =
17631763 {
17641764 " " ,
17651765 "JMSB " ,
@@ -1780,7 +1780,7 @@ static offs_t cquestlin_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const
17801780 "?????" ,
17811781 };
17821782
1783- static const char * latches [] =
1783+ static const char * latches [] =
17841784 {
17851785 " " ,
17861786 "SEQLTCH" ,
@@ -1792,7 +1792,7 @@ static offs_t cquestlin_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const
17921792 "ZLTCH " ,
17931793 };
17941794
1795- static const char * spfs [] =
1795+ static const char * spfs [] =
17961796 {
17971797 " " ,
17981798 "FSTOP " ,
0 commit comments