omitted bytes fix
This commit is contained in:
parent
a7c69a9964
commit
dd4c67fa68
1
build.sh
1
build.sh
|
@ -1,4 +1,3 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
xa -W -C -v -O ASCII -S -c src/apple1serial.xa -l apple1serial.label -o apple1serial.bin
|
xa -W -C -v -O ASCII -S -c src/apple1serial.xa -l apple1serial.label -o apple1serial.bin
|
||||||
#xa -W -C -v -O ASCII -S -c src/serialmonitor.xa -l serialmonitor.label -o serialmonitor.bin
|
|
||||||
|
|
|
@ -21,21 +21,21 @@
|
||||||
#define DATA6 PD3
|
#define DATA6 PD3
|
||||||
#define DATA7 PD4
|
#define DATA7 PD4
|
||||||
|
|
||||||
#define BUFFER_SIZE 8
|
#define BUFFER_SIZE 100
|
||||||
|
|
||||||
typedef enum {NONE, READ, WRITE} mode_t;
|
typedef enum {NONE, READ, WRITE} mode_t;
|
||||||
mode_t mode = NONE;
|
volatile mode_t mode = NONE;
|
||||||
|
|
||||||
uint8_t data = 0x00;
|
volatile uint8_t data = 0x00;
|
||||||
uint8_t upper_part = 0x00;
|
volatile uint8_t upper_part = 0x00;
|
||||||
uint8_t lower_part = 0x00;
|
volatile uint8_t lower_part = 0x00;
|
||||||
|
|
||||||
uint8_t data_write_interrupt_count = 0;
|
volatile uint8_t data_write_interrupt_count = 0;
|
||||||
uint8_t data_read_interrupt_count = 0;
|
volatile uint8_t data_read_interrupt_count = 0;
|
||||||
|
|
||||||
// receive buffer
|
// receive buffer
|
||||||
uint8_t receive_buffer[BUFFER_SIZE];
|
volatile uint8_t receive_buffer[BUFFER_SIZE];
|
||||||
int8_t receive_index = -1;
|
volatile int8_t receive_index = -1;
|
||||||
|
|
||||||
// Registers: PCMSK0, PCMSK1, PCMSK2 :registers that enable or disable pin-change interrupts
|
// Registers: PCMSK0, PCMSK1, PCMSK2 :registers that enable or disable pin-change interrupts
|
||||||
// on individual pins
|
// on individual pins
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
;End address of dump block
|
;End address of dump block
|
||||||
#define hex1_l $24
|
#define hex1_l $24
|
||||||
#define hex1_h $25
|
#define hex1_h $25
|
||||||
|
|
||||||
|
@ -147,7 +147,10 @@ read
|
||||||
beq read_ready
|
beq read_ready
|
||||||
lda serial_read ;Enable read mode, this can be done quick, without reset
|
lda serial_read ;Enable read mode, this can be done quick, without reset
|
||||||
read_ready
|
read_ready
|
||||||
|
txa ;Preserve X on stack
|
||||||
|
pha
|
||||||
ldy #$00
|
ldy #$00
|
||||||
|
ldx #hex2_l
|
||||||
|
|
||||||
read_byte
|
read_byte
|
||||||
lda serial_ready
|
lda serial_ready
|
||||||
|
@ -165,15 +168,14 @@ read_byte
|
||||||
|
|
||||||
lda #last_command_read ;Set last command to READ
|
lda #last_command_read ;Set last command to READ
|
||||||
sta last_command
|
sta last_command
|
||||||
|
|
||||||
|
pla ;Restore X from stack
|
||||||
|
tax
|
||||||
|
|
||||||
jmp next_cmd ;Read is completed, proceed to next command
|
jmp next_cmd ;Read is completed, proceed to next command
|
||||||
|
|
||||||
read_next
|
read_next
|
||||||
txa ;Preserve X on stack
|
|
||||||
pha
|
|
||||||
ldx #hex2_l
|
|
||||||
jsr increment_16bit ;Increment destination address
|
jsr increment_16bit ;Increment destination address
|
||||||
pla ;Restore X from stack
|
|
||||||
tax
|
|
||||||
jmp read_byte
|
jmp read_byte
|
||||||
|
|
||||||
;-------------------------------------------------------------------------
|
;-------------------------------------------------------------------------
|
||||||
|
@ -189,6 +191,9 @@ write
|
||||||
;and prevents from polluting the output while setting the write mode
|
;and prevents from polluting the output while setting the write mode
|
||||||
sta serial_write ;Enable write mode
|
sta serial_write ;Enable write mode
|
||||||
write_ready
|
write_ready
|
||||||
|
txa ;Preserve X on stack
|
||||||
|
pha
|
||||||
|
ldx #hex2_l
|
||||||
ldy #$00
|
ldy #$00
|
||||||
|
|
||||||
write_byte
|
write_byte
|
||||||
|
@ -207,15 +212,14 @@ write_byte
|
||||||
|
|
||||||
lda #last_command_write ;Set last command to WRITE
|
lda #last_command_write ;Set last command to WRITE
|
||||||
sta last_command
|
sta last_command
|
||||||
|
|
||||||
|
pla ;Restore X from stack
|
||||||
|
tax
|
||||||
|
|
||||||
jmp next_cmd ;Write is completed, proceed to next command
|
jmp next_cmd ;Write is completed, proceed to next command
|
||||||
|
|
||||||
write_next
|
write_next
|
||||||
txa ;Preserve X on stack
|
|
||||||
pha
|
|
||||||
ldx #hex2_l
|
|
||||||
jsr increment_16bit ;Increment destination address
|
jsr increment_16bit ;Increment destination address
|
||||||
pla ;Restore X from stack
|
|
||||||
tax
|
|
||||||
jmp write_byte
|
jmp write_byte
|
||||||
|
|
||||||
;-------------------------------------------------------------------------
|
;-------------------------------------------------------------------------
|
||||||
|
@ -247,11 +251,13 @@ reset_loop ; ~((2 + 2 + 3) * 255 + 2 + 3) * 255 =
|
||||||
rts
|
rts
|
||||||
|
|
||||||
increment_16bit
|
increment_16bit
|
||||||
|
txa
|
||||||
inc $00,X
|
inc $00,X
|
||||||
bne increment_16bit_done
|
bne increment_16bit_done
|
||||||
inx
|
inx
|
||||||
inc $00,X
|
inc $00,X
|
||||||
increment_16bit_done
|
increment_16bit_done
|
||||||
|
tax
|
||||||
rts
|
rts
|
||||||
|
|
||||||
;-------------------------------------------------------------------------
|
;-------------------------------------------------------------------------
|
||||||
|
|
Loading…
Reference in New Issue