Development Diary: For the sake of quickness

For the sake of quickness
kveroneau(Game Creator)
April 9, 2017, 9:13 p.m.

Creating programs in pure 65c02 can be very time consuming, and result in a lot of debugging. As a result, in order to have a working game done much quicker, I have opted to mix hardcoded Python routines with 65c02 assembly code. Later on the life of Hacker's Edge, these routines will be completely moved over to 65c02. As a test to see how I would do this, I have created a hardcoded monitor program based on the widely popular Woz Monitor. Part of the monitor is coded in 65c02 assembly, and the other part in Python.

You may now be wondering, how am I pulling this feat off? Well, I created a HE hardware interface device that lives in $fff0-$fff4. Through this hardware interface and using the correct control codes, we can execute special non-65c02 code in a separate hardware unit. Currently, the only supported API from this unit is a monitor program. But this means that you can now easily incorporate a Woz Monitor like program in Hacker's Edge with little effort. This can be called for example to launch an easy to use debugger, since it is only a small API interface, you can easily mix 65c02 assembly. Your 65c02 code still have full running control, and is also responsible for reading the TTY input string. Here is how the monitor API currently looks:

$fff0-$fff1 contains a 16-bit address pointer to your command buffer.
$fff2 is set to the HE API control code you wish to use, $30 is for the monitor.
$fff2 after setting it, read it to perform the actual API call, the result is the result of the external API call.
$fff3-$fff4 Used by the monitor to store the last read or store 16-bit address.

You can check out a monitor in action by creating a new character and selecting the new machine type. Then boot your host and you will be presented with an @ prompt. You can view the guide for Woz Monitor in the URL posted below. The monitor code itself is loaded into $f000, so you can use the monitor itself to disassemble the monitor. You can also input machine code, and execute it.