> Python IS slower than perl, especially since you are dealing with
> objects. However, I'd suggest go the cPickle route - have a Z80Cpu
> module, and its C equivalent, cZ80, and use that one if available. This
> way, the emulator will be actually usable everywhere.
Thanks for the advice but ...
Santiago Romero wrote:
>> Hey, I got 100% with ASM ZX Spectrum emulator on a low end 386 :-) (I do
>> not remember the CPU freqeuncy anymore, maybe 25MHz).
>
> Yes, in ASM a simple 25 or 33Mhz 386 computer was able to emulate
> the
> Spectrum. At least, under MSDOS, like did Warajevo, Z80, x128 a
On Fri, 13 Nov 2009 08:43:14 -, Ulrich Eckhardt
wrote:
Santiago Romero wrote:
Well, In the above concrete example, that would work, but I was
talking for multiple code lines, like:
#define LD_r_n(reg) (reg) = Z80ReadMem(r_PC++)
#define LD_rr_nn(reg) r_opl = Z80ReadMem(r_PC); r_PC++;
> Hey, I got 100% with ASM ZX Spectrum emulator on a low end 386 :-) (I do
> not remember the CPU freqeuncy anymore, maybe 25MHz).
Yes, in ASM a simple 25 or 33Mhz 386 computer was able to emulate
the
Spectrum. At least, under MSDOS, like did Warajevo, Z80, x128 and
"Spectrum"
from Pedro Gimeno.
Santiago Romero wrote:
>
>> > #define STORE_nn_rr(dreg) \
>> > r_opl = Z80ReadMem(r_PC); r_PC++;\
>> > r_oph = Z80ReadMem(r_PC); r_PC++; \
>> > r_tmp = dreg; \
>> > Z80WriteMem((r_op),r_tmpl, regs); \
Santiago Romero:
>Obviously, I prefer to write well structured code but I had to sacrifize SIZE
>by SPEED<
In C99 you have "inline" (and gcc/gcc-llvm usually inline small
functions anyway) that helps avoid many macros.
> Now I'm porting the emulator to a scripted language, so I need
> even mo
> > #define STORE_nn_rr(dreg) \
> > r_opl = Z80ReadMem(r_PC); r_PC++;\
> > r_oph = Z80ReadMem(r_PC); r_PC++; \
> > r_tmp = dreg; \
> > Z80WriteMem((r_op),r_tmpl, regs); \
> > Z80
Santiago Romero wrote:
> Well, In the above concrete example, that would work, but I was
> talking for multiple code lines, like:
>
>
> #define LD_r_n(reg) (reg) = Z80ReadMem(r_PC++)
>
> #define LD_rr_nn(reg) r_opl = Z80ReadMem(r_PC); r_PC++; \
> r_oph = Z80ReadMem(r_PC
TerryP wrote:
If it's such a big hairy deal, just recompile a copy of the C Pre
Processor to use something other then #, and hook it up to your python
scripts in a pipe line from a shell wrapper.
Or use a different preprocessor, such as m4, that
doesn't clash with the # character.
--
Greg
--
h
If it's such a big hairy deal, just recompile a copy of the C Pre
Processor to use something other then #, and hook it up to your python
scripts in a pipe line from a shell wrapper.
Personally, I'd rather have Lisps lambda or perls sub then Cs
preprocessor, and even in those cases, Python suffices
Santiago Romero, 12.11.2009 18:23:
> #define LD_r_n(reg) (reg) = Z80ReadMem(r_PC++)
>
> #define LD_rr_nn(reg) r_opl = Z80ReadMem(r_PC); r_PC++; \
> r_oph = Z80ReadMem(r_PC); r_PC++; \
> reg = r_op
>
> #define LOAD_r(dreg, saddreg) (dreg)=Z80Read
On 12 nov, 18:16, Stefan Behnel wrote:
> Santiago Romero, 12.11.2009 17:43:
>
> > Is there a Python version of C's language #define statements?
>
> > Example:
>
> > #define ReadMem( (x) ) memory[ (x) ]
>
> Yes:
>
> ReadMem = memory.__getitem__
>
> Stefan
Well, In the above concrete e
Santiago Romero, 12.11.2009 17:43:
> Is there a Python version of C's language #define statements?
>
> Example:
>
> #define ReadMem( (x) )memory[ (x) ]
Yes:
ReadMem = memory.__getitem__
Stefan
--
http://mail.python.org/mailman/listinfo/python-list
On Nov 12, 5:43 pm, Santiago Romero wrote:
> Is there a Python version of C's language #define statements?
>
> Example:
>
> #define ReadMem( (x) ) memory[ (x) ]
>
> Instead of using a function, when you call to ReadMem(), the code is
> INCLUDED, (no function is called, the "compiler" just subs
Santiago Romero schrieb:
Is there a Python version of C's language #define statements?
Example:
#define ReadMem( (x) )memory[ (x) ]
Instead of using a function, when you call to ReadMem(), the code is
INCLUDED, (no function is called, the "compiler" just substitues the
ReadMem( expression
Is there a Python version of C's language #define statements?
Example:
#define ReadMem( (x) )memory[ (x) ]
Instead of using a function, when you call to ReadMem(), the code is
INCLUDED, (no function is called, the "compiler" just substitues the
ReadMem( expression ) with memory[ (expressio
16 matches
Mail list logo