News About Docs Src Emulation Description Language
(Savoury SnaX) 18 Aug 2011

Handlers

It was always the intention that HANDLERs would react to changing PINs, but in an effort to get the first version of EDL working I dropped the notion of PINs. Now I`m pleased to say that HANDLERs are now implemented as intended, along with the missing PIN declaration support. This means that I had to change an awful lot of sample code and the Space Invaders emulation, in order to support the change.

The clocking of the CPU for the Accurate version of Space Invaders is now correctly pulsed, with the CPU picking up the positive edge trigger and doing its work.

The change also means that HANDLERs are no longer directly accessable from C code, in fact the PINs are no longer accessable either. Accessor methods have been created, and it is these that C code must hook into. In a future update to the language it will automatically call the appropriate HANDLER when a PIN is updated by EDL code, although if the PIN is part of the current module, then it will still access the data directly. At present global variables are still accessable from outside the current file, however this makes little sense (apart from debugging), so I might change globals to private at some point in the future, with similar accessors created for debug purposes.

Documentation as always has been updated to reflect the changes.

Next up, time to give EDL functions, and perhaps add the INTERNAL modifier. INTERNAL will be used to hide global variables and functions from outside of the current file. This will allow better optimisation possibilities.


(Savoury SnaX) 17 Aug 2011

External Functions

I’ve just added support to EDL for calling external C functions. This will allow me to proceed to the next stage of moving the Space Invaders memory and video handling into EDL itself.

In order to test the external calling interface, I’ve implemented a second version of the Intel 8080 in EDL. This one mirrors the standard emulator practice of having a single STEP function, which executes 1 instruction and gives a number of cycles count. This is obviously less accurate from a hardware point of view, however it is a much simpler introduction to EDL, and is obviously significantly quicker. ~750 lines of code in comparison to ~3000 of the pin accurate version.

All seems to be working well, I had to fix up the issue with only having 1 EXECUTE command in the file. EDL now supports as many as you want. But they must still come before the definition of instructions.

The language documentation has been updated to reflect the changes.