mirror of
https://github.com/nippur72/apple1-videocard-lib.git
synced 2025-01-22 03:30:06 +00:00
add toggle detection tape monitor
This commit is contained in:
parent
5900dc4cb9
commit
4bd06a1f91
@ -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
|
||||
|
||||
|
||||
|
||||
|
Binary file not shown.
Binary file not shown.
22
demos/tapemon/tapetoggle.c
Normal file
22
demos/tapemon/tapetoggle.c
Normal file
@ -0,0 +1,22 @@
|
||||
#include <utils.h>
|
||||
#include <apple1.h>
|
||||
|
||||
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
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user