ys2-intro/loader/samples/minexample/minexample.s

136 lines
2.2 KiB
ArmAsm
Raw Normal View History

2025-11-13 11:07:39 -05:00
.feature c_comments
.include "../../build/loadersymbols-c64.inc"
2025-11-15 16:55:16 -05:00
CODE_START_ADDR = $e000
2025-11-13 11:07:39 -05:00
.segment "CODE"
ZP=$e0
offset = ZP+0
ZX0_src = ZP+2
ZX0_dst = ZP+4
bitr = ZP+6
pntr = ZP+7
.org $080d
2025-11-30 06:39:21 -05:00
jsr print_info
2025-11-13 11:07:39 -05:00
2025-11-15 16:55:16 -05:00
copy_start:
2025-11-13 11:07:39 -05:00
sei
lda #$35
sta $01
2025-11-15 16:55:16 -05:00
2025-11-28 22:27:57 -05:00
lda #<code
sta ZX0_src
lda #>code
sta ZX0_src+1
lda #<CODE_START_ADDR
sta ZX0_dst
lda #>CODE_START_ADDR
jsr zx02
2025-11-15 16:55:16 -05:00
2025-11-28 03:15:49 -05:00
inc $01
2025-11-15 16:55:16 -05:00
cli
jsr install
sei
2025-11-28 03:15:49 -05:00
dec $01
2025-11-28 22:27:57 -05:00
jmp CODE_START_ADDR
.include "zx02.asm"
2025-11-28 03:15:49 -05:00
check_return:
; for some reason GETIN enable interrupts back
lda #0
sta $d01a
asl $d019
lda #$36
2025-11-15 16:55:16 -05:00
sta $01
2025-11-28 03:15:49 -05:00
:
jsr $ff9f ; SCNKEY
jsr $ffe4 ; GETIN
cmp #$0d
bne :-
dec $01
2025-11-28 22:27:57 -05:00
jmp CODE_START_ADDR
2025-11-30 06:39:21 -05:00
.assert zx02 = $0832, error, .sprintf("change zx02 address to $%04x", zx02)
.assert check_return = $08b8, error, .sprintf("change check_return address to $%04x", check_return)
2025-11-15 16:55:16 -05:00
.res loadraw - *
.incbin "../../build/loader-c64.prg", 2
.res install - *
.incbin "../../build/install-c64.prg", 2
2025-11-28 22:27:57 -05:00
code: .incbin "main.zx0"
2025-11-30 06:39:21 -05:00
print_info:
lda #$20
ldx #0
:
sta $400,x
sta $500,x
sta $600,x
sta $700,x
inx
bne :-
lda #41
sta ZX0_dst
lda #4
sta ZX0_dst+1
lda #$17
sta $d018
ldy #0
@print_loop:
lda info,x
bne :++
lda ZX0_dst
clc
adc #40
sta ZX0_dst
bcc :+
inc ZX0_dst+1
:
ldy #0
beq :++
:
sta (ZX0_dst),y
iny
:
inx
cpx #info_end-info
bne @print_loop
rts
.macpack cbm
info:
scrcode "Code:"
.byte 0
scrcode " Aart1256 - engine, music driver"
.byte 0
scrcode " Natt - engine, tooling"
.byte 0, 0
scrcode "C64 Graphics:"
.byte 0
scrcode " Grongy"
.byte 0
scrcode " Natt"
.byte 0, 0
scrcode "Music arranges & ported graphics:"
.byte 0
scrcode " Aleksa Odzakovic (spaztron64)"
.byte 0, 0
scrcode "Greetz to:"
.byte 0
scrcode " Gyabo"
.byte 0
scrcode " Yosshin"
.byte 0
scrcode " Hadohado"
.byte 0
scrcode " Kazpulse"
.byte 0
scrcode " Gam"
info_end: