mirror of
https://github.com/flowenol/apple1cartridge.git
synced 2024-05-31 18:41:27 +00:00
applesoft cartridge added
This commit is contained in:
parent
ede0e55d18
commit
1c58c2947d
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -1,2 +1,2 @@
|
||||||
*.bin
|
cartridge*.bin
|
||||||
*.label
|
*.label
|
||||||
|
|
1
build.sh
1
build.sh
|
@ -1,3 +1,4 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
xa -W -C -v -O ASCII -c src/cartridge.xa -l cartridge.label -o cartridge.bin
|
xa -W -C -v -O ASCII -c src/cartridge.xa -l cartridge.label -o cartridge.bin
|
||||||
|
xa -W -C -v -O ASCII -c src/cartridge_applesoft.xa -l cartridge_applesoft.label -o cartridge_applesoft.bin
|
||||||
|
|
BIN
inc/a1mt.bin
Normal file
BIN
inc/a1mt.bin
Normal file
Binary file not shown.
BIN
inc/apple30th.bin
Normal file
BIN
inc/apple30th.bin
Normal file
Binary file not shown.
BIN
inc/applesoft.bin
Normal file
BIN
inc/applesoft.bin
Normal file
Binary file not shown.
BIN
inc/basic.bin
Normal file
BIN
inc/basic.bin
Normal file
Binary file not shown.
BIN
inc/disassembler.bin
Normal file
BIN
inc/disassembler.bin
Normal file
Binary file not shown.
|
@ -476,5 +476,4 @@ welcome_str .byt $15,$0D,"AVAILABLE OPTIONS:",$0D,$0D
|
||||||
choose_str .byt $0F,$0D,"CHOOSE OPTION:"
|
choose_str .byt $0F,$0D,"CHOOSE OPTION:"
|
||||||
|
|
||||||
rom_content
|
rom_content
|
||||||
#include "src/rom_content1.xa"
|
#include "src/rom_content.xa"
|
||||||
;#include "src/rom_content2.xa"
|
|
||||||
|
|
135
src/cartridge_applesoft.xa
Normal file
135
src/cartridge_applesoft.xa
Normal file
|
@ -0,0 +1,135 @@
|
||||||
|
; zero page variables
|
||||||
|
|
||||||
|
; content copy variables
|
||||||
|
#define dest_addr $30
|
||||||
|
#define src_addr $32
|
||||||
|
#define src_len $34
|
||||||
|
#define copy_counter $36
|
||||||
|
|
||||||
|
; entries scanning variables
|
||||||
|
#define entries_scan_addr $43
|
||||||
|
|
||||||
|
; jmp addr variable
|
||||||
|
#define jmp_addr $47
|
||||||
|
|
||||||
|
* = $4000
|
||||||
|
|
||||||
|
;;; load-start
|
||||||
|
load_entry
|
||||||
|
|
||||||
|
; init entries scan addr
|
||||||
|
lda #<rom_content
|
||||||
|
sta entries_scan_addr
|
||||||
|
|
||||||
|
lda #>rom_content
|
||||||
|
sta entries_scan_addr+1
|
||||||
|
|
||||||
|
load_segment
|
||||||
|
|
||||||
|
; load segment length
|
||||||
|
ldy #$00
|
||||||
|
lda (entries_scan_addr),Y
|
||||||
|
sta src_len
|
||||||
|
ldx #entries_scan_addr
|
||||||
|
jsr increment_16bit
|
||||||
|
lda (entries_scan_addr),Y
|
||||||
|
sta src_len+1
|
||||||
|
|
||||||
|
; load dest addr
|
||||||
|
ldx #entries_scan_addr
|
||||||
|
jsr increment_16bit
|
||||||
|
lda (entries_scan_addr),Y
|
||||||
|
sta dest_addr
|
||||||
|
ldx #entries_scan_addr
|
||||||
|
jsr increment_16bit
|
||||||
|
lda (entries_scan_addr),Y
|
||||||
|
sta dest_addr+1
|
||||||
|
|
||||||
|
; load source addr
|
||||||
|
ldx #entries_scan_addr
|
||||||
|
jsr increment_16bit
|
||||||
|
lda (entries_scan_addr),Y
|
||||||
|
sta src_addr
|
||||||
|
ldx #entries_scan_addr
|
||||||
|
jsr increment_16bit
|
||||||
|
lda (entries_scan_addr),Y
|
||||||
|
sta src_addr+1
|
||||||
|
|
||||||
|
; copy segment from source to destination
|
||||||
|
jsr init_copy
|
||||||
|
|
||||||
|
load_program
|
||||||
|
|
||||||
|
ldx #entries_scan_addr
|
||||||
|
jsr increment_16bit
|
||||||
|
|
||||||
|
; load entry jump address
|
||||||
|
lda entries_scan_addr
|
||||||
|
sta dest_addr
|
||||||
|
lda entries_scan_addr+1
|
||||||
|
sta dest_addr+1
|
||||||
|
|
||||||
|
ldy #$00
|
||||||
|
lda (dest_addr),Y
|
||||||
|
sta jmp_addr
|
||||||
|
|
||||||
|
iny
|
||||||
|
|
||||||
|
lda (dest_addr),Y
|
||||||
|
sta jmp_addr+1
|
||||||
|
|
||||||
|
jmp (jmp_addr)
|
||||||
|
|
||||||
|
init_copy
|
||||||
|
lda #$00
|
||||||
|
sta copy_counter
|
||||||
|
sta copy_counter+1
|
||||||
|
copy
|
||||||
|
; load byte from rom into ram
|
||||||
|
ldy #$00
|
||||||
|
lda (src_addr),Y
|
||||||
|
sta (dest_addr),Y
|
||||||
|
|
||||||
|
; increment source address
|
||||||
|
ldx #src_addr
|
||||||
|
jsr increment_16bit
|
||||||
|
|
||||||
|
; increment destination address
|
||||||
|
ldx #dest_addr
|
||||||
|
jsr increment_16bit
|
||||||
|
|
||||||
|
; compare counter lower byte with source length lower byte
|
||||||
|
; if not equal increment counter
|
||||||
|
lda src_len
|
||||||
|
cmp copy_counter
|
||||||
|
bne increment_copy_counter
|
||||||
|
|
||||||
|
; compare counter upper byte with content length upper byte
|
||||||
|
; if not equal increment counter
|
||||||
|
lda src_len+1
|
||||||
|
cmp copy_counter+1
|
||||||
|
bne increment_copy_counter
|
||||||
|
|
||||||
|
rts
|
||||||
|
|
||||||
|
increment_copy_counter
|
||||||
|
ldx #copy_counter
|
||||||
|
jsr increment_16bit
|
||||||
|
|
||||||
|
jmp copy
|
||||||
|
|
||||||
|
;;; load-end
|
||||||
|
|
||||||
|
;;; tools
|
||||||
|
increment_16bit
|
||||||
|
inc $00,X
|
||||||
|
bne increment_16bit_done
|
||||||
|
inx
|
||||||
|
inc $00,X
|
||||||
|
increment_16bit_done
|
||||||
|
rts
|
||||||
|
|
||||||
|
;;; tools-end
|
||||||
|
|
||||||
|
rom_content
|
||||||
|
#include "src/rom_applesoft.xa"
|
7
src/rom_applesoft.xa
Normal file
7
src/rom_applesoft.xa
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
applesoft
|
||||||
|
applesoft_len .word $1F65
|
||||||
|
applesoft_addr .word $6000
|
||||||
|
applesoft_cont_start .word applesoft_cont
|
||||||
|
applesoft_jmp_addr .word $6000
|
||||||
|
|
||||||
|
applesoft_cont .bin 0,8037,"inc/applesoft.bin"
|
2
src/rom_content.xa
Normal file
2
src/rom_content.xa
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
;#include "src/rom_content1.xa"
|
||||||
|
#include "src/rom_content2.xa"
|
|
@ -1,6 +1,20 @@
|
||||||
number_of_entries .byt $02
|
number_of_entries .byt $02
|
||||||
|
|
||||||
; 00: <start_low_byte> <start_high_byte> <end_low_byte> <end_high_byte>
|
/* 00: <start_low_byte> <start_high_byte> <end_low_byte> <end_high_byte> */
|
||||||
|
/* test address expected actual */
|
||||||
|
/*
|
||||||
|
0 - All zeros - each byte of memory is verified that a 0x00 value can be written and read
|
||||||
|
1 - All ones - each byte of memory is verified that a 0xff value can be written and read
|
||||||
|
2 - Floating ones - eight passes, starting with 0x01 and moving the 1 bit to left each succeeding pass
|
||||||
|
0x02 0x04 0x08 0x10 0x20 0x40 0x80
|
||||||
|
3 - Floating zeros - eight passes, starting with 0x7f and shifting the 0 bit to the right each succeeding pass
|
||||||
|
0xBF 0xDF 0xEF 0xF7 0xFB 0xFD 0xFE
|
||||||
|
4 - Address in Address 1 - one pass with low eight bits of the locations address is written to that location
|
||||||
|
if this fails, you have a problem with one of the low eight address lines (this is pretty unlikely to fail,
|
||||||
|
since you need these address lines in order to load and run this program)
|
||||||
|
5 - Address in Address 2 - one pass with high eight bits of the locations address written to that location
|
||||||
|
if this fails, you have a problem with one of the eight high address lines
|
||||||
|
*/
|
||||||
memorytest
|
memorytest
|
||||||
memorytest_seg .byt $02
|
memorytest_seg .byt $02
|
||||||
memorytest_1_len .word $0010
|
memorytest_1_len .word $0010
|
||||||
|
@ -12,7 +26,8 @@ memorytest_2_cont_start .word memorytest_cont+16
|
||||||
memorytest_str .byt $10,"MEMORY TEST 280R"
|
memorytest_str .byt $10,"MEMORY TEST 280R"
|
||||||
memorytest_jmp_addr .word $FF1F
|
memorytest_jmp_addr .word $FF1F
|
||||||
|
|
||||||
; 44: <low_byte> <high_byte>
|
/* 44: <low_byte> <high_byte> */
|
||||||
|
|
||||||
disassembler
|
disassembler
|
||||||
disassembler_seg .byt $01
|
disassembler_seg .byt $01
|
||||||
disassembler_1_len .word $0200
|
disassembler_1_len .word $0200
|
||||||
|
|
Loading…
Reference in New Issue
Block a user