4
4
5
5
Implementation of the Cube Quest AM2901-based CPUs
6
6
7
- TODO:
7
+ TODO:
8
8
9
9
* Tidy up diassembly (split into different files?)
10
10
19
19
***************************************************************************/
20
20
21
21
/* Am2901 Instruction Fields */
22
- static const char * ins [] =
22
+ static const char * ins [] =
23
23
{
24
24
"ADD " ,
25
25
"SUBR " ,
@@ -43,7 +43,7 @@ static const char* src[] =
43
43
"D,0" ,
44
44
};
45
45
46
- static const char * dst [] =
46
+ static const char * dst [] =
47
47
{
48
48
"QREG " ,
49
49
"NOP " ,
@@ -409,7 +409,7 @@ static void cquestrot_init(int index, int clock, const void *_config, int (*irqc
409
409
cquestrot_state_register (index , "cquestrot" );
410
410
411
411
/* Allocate RAM */
412
- cquestrot .dram = malloc (16384 * sizeof (UINT16 )); /* Shared with 68000 */
412
+ cquestrot .dram = malloc (16384 * sizeof (UINT16 )); /* Shared with 68000 */
413
413
cquestrot .sram = malloc (2048 * sizeof (UINT16 )); /* Private */
414
414
}
415
415
@@ -748,7 +748,7 @@ static int cquestsnd_execute(int cycles)
748
748
749
749
static offs_t cquestsnd_dasm (char * buffer , offs_t pc , const UINT8 * oprom , const UINT8 * opram )
750
750
{
751
- static const char * jmps [] =
751
+ static const char * jmps [] =
752
752
{
753
753
"JUMP " ,
754
754
" " ,
@@ -761,7 +761,7 @@ static offs_t cquestsnd_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const
761
761
};
762
762
763
763
764
- static const char * latches [] =
764
+ static const char * latches [] =
765
765
{
766
766
"PLTCH " ,
767
767
"DAC " ,
@@ -880,7 +880,7 @@ static int cquestrot_execute(int cycles)
880
880
881
881
/* Core execution loop */
882
882
do
883
- {
883
+ {
884
884
/* Decode the instruction */
885
885
UINT64 inst = cpu_readop64 (ROT_PC << 3 );
886
886
@@ -1084,7 +1084,7 @@ static int cquestrot_execute(int cycles)
1084
1084
r15 = (cquestrot .vflag ^ BIT (cquestrot .f , 15 )) << 15 ;
1085
1085
break ;
1086
1086
}
1087
-
1087
+
1088
1088
cquestrot .ram [b ] = r15 | (cquestrot .f >> 1 );
1089
1089
cquestrot .y = cquestrot .f ;
1090
1090
break ;
@@ -1201,7 +1201,7 @@ static int cquestrot_execute(int cycles)
1201
1201
1202
1202
static offs_t cquestrot_dasm (char * buffer , offs_t pc , const UINT8 * oprom , const UINT8 * opram )
1203
1203
{
1204
- static const char * jmps [] =
1204
+ static const char * jmps [] =
1205
1205
{
1206
1206
" " ,
1207
1207
"JSEQ " ,
@@ -1234,7 +1234,7 @@ static offs_t cquestrot_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const
1234
1234
"Y2D " ,
1235
1235
};
1236
1236
1237
- static const char * spfs [] =
1237
+ static const char * spfs [] =
1238
1238
{
1239
1239
" " ,
1240
1240
" " ,
@@ -1262,16 +1262,16 @@ static offs_t cquestrot_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const
1262
1262
int t = (inshig >> 20 ) & 0xfff ;
1263
1263
int jmp = (inshig >> 16 ) & 0xf ;
1264
1264
int spf = (inshig >> 12 ) & 0xf ;
1265
- // int rsrc = (inshig >> 11) & 0x1;
1265
+ // int rsrc = (inshig >> 11) & 0x1;
1266
1266
int yout = (inshig >> 8 ) & 0x7 ;
1267
1267
int sel = (inshig >> 6 ) & 0x3 ;
1268
- // int dsrc = (inshig >> 4) & 0x3;
1268
+ // int dsrc = (inshig >> 4) & 0x3;
1269
1269
int b = (inshig >> 0 ) & 0xf ;
1270
1270
int a = (inslow >> 28 ) & 0xf ;
1271
1271
int i8_6 = (inslow >> 24 ) & 0x7 ;
1272
1272
int ci = (inslow >> 23 ) & 0x1 ;
1273
1273
int i5_3 = (inslow >> 20 ) & 0x7 ;
1274
- // int _sex = (inslow >> 19) & 0x1;
1274
+ // int _sex = (inslow >> 19) & 0x1;
1275
1275
int i2_0 = (inslow >> 16 ) & 0x7 ;
1276
1276
1277
1277
sprintf (buffer , "%s %s,%s %x,%x,%c %d %s %s %s %.2x\n" ,
@@ -1613,7 +1613,7 @@ static int cquestlin_execute(int cycles)
1613
1613
cquestlin .pc [prog ] = (cquestlin .pc [prog ] + 1 ) & 0x7f ;
1614
1614
1615
1615
if (prog == BACKGROUND )
1616
- cquestlin .pc [prog ] |= 0x80 ;
1616
+ cquestlin .pc [prog ] |= 0x80 ;
1617
1617
else
1618
1618
{
1619
1619
/* Handle events that happen during FG execution */
@@ -1643,7 +1643,7 @@ static int cquestlin_execute(int cycles)
1643
1643
{
1644
1644
int _ycet ;
1645
1645
int mux_sel = (BIT (cquestlin .sreg , SREG_DX_DY ) << 1 ) | (BIT (cquestlin .sreg , SREG_DX ) ^ BIT (cquestlin .sreg , SREG_DY ));
1646
-
1646
+
1647
1647
if (mux_sel == 0 )
1648
1648
_ycet = !(cquestlin .gt0reg && (spf == LSPF_BRES ));
1649
1649
else if (mux_sel == 1 )
@@ -1712,7 +1712,7 @@ static int cquestlin_execute(int cycles)
1712
1712
{
1713
1713
int _lpwrt = BIT (cquestlin .bglatch , 5 );
1714
1714
1715
- cquestlin .bglatch =
1715
+ cquestlin .bglatch =
1716
1716
(!(spf == LSPF_PWRT ) << 5 )
1717
1717
| (_lpwrt << 4 )
1718
1718
| ((!_lpwrt || (!(spf == LSPF_PWRT ) && (latch == LLATCH_BADLATCH ))) << 2 );
@@ -1759,7 +1759,7 @@ static int cquestlin_execute(int cycles)
1759
1759
1760
1760
static offs_t cquestlin_dasm (char * buffer , offs_t pc , const UINT8 * oprom , const UINT8 * opram )
1761
1761
{
1762
- static const char * jmps [] =
1762
+ static const char * jmps [] =
1763
1763
{
1764
1764
" " ,
1765
1765
"JMSB " ,
@@ -1780,7 +1780,7 @@ static offs_t cquestlin_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const
1780
1780
"?????" ,
1781
1781
};
1782
1782
1783
- static const char * latches [] =
1783
+ static const char * latches [] =
1784
1784
{
1785
1785
" " ,
1786
1786
"SEQLTCH" ,
@@ -1792,7 +1792,7 @@ static offs_t cquestlin_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const
1792
1792
"ZLTCH " ,
1793
1793
};
1794
1794
1795
- static const char * spfs [] =
1795
+ static const char * spfs [] =
1796
1796
{
1797
1797
" " ,
1798
1798
"FSTOP " ,
0 commit comments