diff --git a/demos/tapemon/m.bat b/demos/tapemon/m.bat index e73db61..4b75734 100644 --- a/demos/tapemon/m.bat +++ b/demos/tapemon/m.bat @@ -1,4 +1,8 @@ @call ..\..\tools\build tapemon @call node ..\..\tools\prg2bin -i out\tapemon_apple1.prg -o out\tapemon.0280.bin +@call ..\..\tools\build tapetoggle +@call node ..\..\tools\prg2woz -i out\tapetoggle_apple1.prg -o out\tapetoggle.0280.woz + + diff --git a/demos/tapemon/out/tapemon.0280.bin b/demos/tapemon/out/tapemon.0280.bin index 8a4cabf..22628ae 100644 Binary files a/demos/tapemon/out/tapemon.0280.bin and b/demos/tapemon/out/tapemon.0280.bin differ diff --git a/demos/tapemon/out/tapemon_apple1.prg b/demos/tapemon/out/tapemon_apple1.prg index 1988611..6132f7d 100644 Binary files a/demos/tapemon/out/tapemon_apple1.prg and b/demos/tapemon/out/tapemon_apple1.prg differ diff --git a/demos/tapemon/tapetoggle.c b/demos/tapemon/tapetoggle.c new file mode 100644 index 0000000..28465c7 --- /dev/null +++ b/demos/tapemon/tapetoggle.c @@ -0,0 +1,22 @@ +#include +#include + +byte *const LASTSTATE = 0x29; // Last input state +byte *const TAPEIN = 0xC081; // Tape input +byte *const DSP = 0xD012; // display data port + +void main() +{ + asm { +simple_monitor: lda TAPEIN // read tape input + cmp LASTSTATE // compare to previous state + beq no_toggle // if same just skip + sta LASTSTATE // else save new state + ldx #35 // set "toggle detected" flag in X, 35 is also the char to print +no_toggle: bit DSP // check if display is ready to accept a character + bmi simple_monitor // if not, just keep reading tape + stx DSP // else display the "toggle detected" flag character + ldx #45 // resets the "toggle detected" flag to the "-" sign, sets also Z=0 flag + bne simple_monitor // cheap jump because Z is also 0 + } +}