]> Shamusworld >> Repos - rmac/blobdiff - direct.c
Bump version #.
[rmac] / direct.c
index a2eef8867618154b181ec48ba513a4afb1c16387..0cee4b37640c331429b5f0c7c6134dc3ca34d91d 100644 (file)
--- a/direct.c
+++ b/direct.c
@@ -22,7 +22,7 @@
 #include "kwtab.h"
 
 
-TOKEN exprbuf[128];                    // Expression buffer 
+TOKEN exprbuf[128];                    // Expression buffer
 SYM * symbolPtr[1000000];      // Symbol pointers table
 static long unused;                    // For supressing 'write' warnings
 char buffer[256];                      // Scratch buffer for messages
@@ -33,52 +33,52 @@ int (*dirtab[])() = {
        d_org,                          // 0 org
        d_even,                         // 1 even
        d_unimpl,                       // 2 .6502
-       d_68000,                        // 3 .68000 
+       d_68000,                        // 3 .68000
        d_bss,                          // 4 bss
-       d_data,                         // 5 data 
-       d_text,                         // 6 text 
-       d_abs,                          // 7 abs 
-       d_comm,                         // 8 comm 
-       d_init,                         // 9 init 
-       d_cargs,                        // 10 cargs 
-       d_goto,                         // 11 goto 
-       d_dc,                           // 12 dc 
-       d_ds,                           // 13 ds 
-       d_undmac,                       // 14 undefmac 
+       d_data,                         // 5 data
+       d_text,                         // 6 text
+       d_abs,                          // 7 abs
+       d_comm,                         // 8 comm
+       (void *)d_init,         // 9 init
+       d_cargs,                        // 10 cargs
+       (void *)d_goto,         // 11 goto
+       (void *)d_dc,           // 12 dc
+       (void *)d_ds,           // 13 ds
+       d_undmac,                       // 14 undefmac
        d_gpu,                          // 15 .gpu
        d_dsp,                          // 16 .dsp
-       d_dcb,                          // 17 dcb 
-       d_unimpl,                       // 18* set 
-       d_unimpl,                       // 19* reg 
-       d_unimpl,                       // 20 dump 
-       d_incbin,                       // 21 .incbin //load 
-       d_unimpl,                       // 22 disable 
-       d_unimpl,                       // 23 enable 
-       d_globl,                        // 24 globl 
+       (void *)d_dcb,          // 17 dcb
+       d_unimpl,                       // 18* set
+       d_unimpl,                       // 19* reg
+       d_unimpl,                       // 20 dump
+       d_incbin,                       // 21 .incbin //load
+       d_unimpl,                       // 22 disable
+       d_unimpl,                       // 23 enable
+       d_globl,                        // 24 globl
        d_regbank0,                     // 25 .regbank0
        d_regbank1,                     // 26 .regbank1
-       d_unimpl,                       // 27 xdef 
-       d_assert,                       // 28 assert 
-       d_unimpl,                       // 29* if 
-       d_unimpl,                       // 30* endif 
-       d_unimpl,                       // 31* endc 
-       d_unimpl,                       // 32* iif 
-       d_include,                      // 33 include 
-       fpop,                           // 34 end 
-       d_unimpl,                       // 35* macro 
-       ExitMacro,                      // 36* exitm 
-       d_unimpl,                       // 37* endm 
-       d_list,                         // 38 list 
-       d_nlist,                        // 39 nlist 
-       d_long,                         // 40* rept 
-       d_phrase,                       // 41* endr 
-       d_dphrase,                      // 42 struct 
-       d_qphrase,                      // 43 ends 
-       d_title,                        // 44 title 
-       d_subttl,                       // 45 subttl 
-       eject,                          // 46 eject 
-       d_unimpl,                       // 47 error 
-       d_unimpl,                       // 48 warn 
+       d_unimpl,                       // 27 xdef
+       d_assert,                       // 28 assert
+       d_unimpl,                       // 29* if
+       d_unimpl,                       // 30* endif
+       d_unimpl,                       // 31* endc
+       d_unimpl,                       // 32* iif
+       d_include,                      // 33 include
+       fpop,                           // 34 end
+       d_unimpl,                       // 35* macro
+       ExitMacro,                      // 36* exitm
+       d_unimpl,                       // 37* endm
+       d_list,                         // 38 list
+       d_nlist,                        // 39 nlist
+       d_long,                         // 40* rept
+       d_phrase,                       // 41* endr
+       d_dphrase,                      // 42 struct
+       d_qphrase,                      // 43 ends
+       d_title,                        // 44 title
+       d_subttl,                       // 45 subttl
+       eject,                          // 46 eject
+       d_unimpl,                       // 47 error
+       d_unimpl,                       // 48 warn
        d_noclear,                      // 49 .noclear
        d_equrundef,            // 50 .equrundef/.regundef
        d_ccundef,                      // 51 .ccundef
@@ -292,6 +292,7 @@ int d_equrundef(void)
 //
 int d_noclear(void)
 {
+       warn("CLR.L opcode ignored...");
        return 0;
 }
 
@@ -803,9 +804,17 @@ int d_dc(WORD siz)
        if ((scattr & SBSS) != 0)
                return error("illegal initialization of section");
 
+       // Do an auto_even if it's not BYTE sized (hmm, should we be doing this???)
        if ((siz != SIZB) && (sloc & 1))
                auto_even();
 
+       // Check to see if we're trying to set LONGS on a non 32-bit aligned
+       // address in a GPU or DSP section, in their local RAM
+       if ((siz == SIZL) && (orgaddr & 0x03)
+               && ((rgpu && (orgaddr >= 0xF03000) && (orgaddr <= 0xF03FFFF))
+               || (rdsp && (orgaddr >= 0xF1B000) && (orgaddr <= 0xF1CFFFF))))
+               warn("depositing LONGs on a non-long address in local RAM");
+
        for(;; ++tok)
        {
                // dc.b 'string' [,] ...
@@ -856,7 +865,6 @@ int d_dc(WORD siz)
                                if (eval + 0x100 >= 0x200)
                                {
                                        sprintf(buffer, "%s (value = $%X)", range_error, eval);
-//                                     return error(range_error);
                                        return error(buffer);
                                }