358 lines
4.7 KiB
Plaintext
358 lines
4.7 KiB
Plaintext
section .text,"ax",@progbits
|
|
assume adl = 1
|
|
section .text,"ax",@progbits
|
|
public _print
|
|
_print:
|
|
call __frameset0
|
|
ld a, (ix + 9)
|
|
ld l, (ix + 12)
|
|
push hl
|
|
ld l, a
|
|
push hl
|
|
call _os_SetCursorPos
|
|
pop hl
|
|
pop hl
|
|
ld hl, (ix + 6)
|
|
push hl
|
|
call _os_PutStrFull
|
|
pop hl
|
|
or a, a
|
|
sbc hl, hl
|
|
pop ix
|
|
ret
|
|
section .text,"ax",@progbits
|
|
|
|
section .text,"ax",@progbits
|
|
public _clearLine
|
|
_clearLine:
|
|
call __frameset0
|
|
ld a, (ix + 6)
|
|
or a, a
|
|
sbc hl, hl
|
|
push hl
|
|
ld l, a
|
|
push hl
|
|
call _os_SetCursorPos
|
|
pop hl
|
|
pop hl
|
|
ld hl, L_.str
|
|
push hl
|
|
call _os_PutStrFull
|
|
pop hl
|
|
or a, a
|
|
sbc hl, hl
|
|
pop ix
|
|
ret
|
|
section .text,"ax",@progbits
|
|
|
|
section .text,"ax",@progbits
|
|
public _print_ui
|
|
_print_ui:
|
|
ld hl, -33
|
|
call __frameset
|
|
ld de, 0
|
|
lea hl, ix - 24
|
|
ld (ix - 27), hl
|
|
push de
|
|
push de
|
|
call _os_SetCursorPos
|
|
pop hl
|
|
pop hl
|
|
or a, a
|
|
sbc hl, hl
|
|
push hl
|
|
push hl
|
|
ld hl, L_.str.1
|
|
push hl
|
|
call _print
|
|
ld bc, (ix + 6)
|
|
pop hl
|
|
pop hl
|
|
pop hl
|
|
ld hl, L_.str.2
|
|
ld (ix - 24), hl
|
|
ld hl, L_.str.3
|
|
ld (ix - 21), hl
|
|
ld hl, L_.str.4
|
|
ld (ix - 18), hl
|
|
ld de, 3
|
|
push bc
|
|
pop hl
|
|
or a, a
|
|
sbc hl, de
|
|
inc de
|
|
jq nz, BB2_1
|
|
ld de, (ix + 9)
|
|
push de
|
|
pop hl
|
|
add hl, bc
|
|
or a, a
|
|
sbc hl, bc
|
|
ld hl, 2
|
|
jq z, BB2_7
|
|
dec de
|
|
ex de, hl
|
|
jq BB2_7
|
|
BB2_1:
|
|
ld iy, (ix + 9)
|
|
push bc
|
|
pop hl
|
|
or a, a
|
|
sbc hl, de
|
|
jq nz, BB2_2
|
|
ld de, 2
|
|
lea bc, iy
|
|
push bc
|
|
pop hl
|
|
or a, a
|
|
sbc hl, de
|
|
ld hl, 0
|
|
jq z, BB2_7
|
|
inc bc
|
|
push bc
|
|
pop hl
|
|
jq BB2_7
|
|
BB2_2:
|
|
lea hl, iy
|
|
BB2_7:
|
|
ld iy, L_.str.5
|
|
ld de, 1
|
|
ld bc, 3
|
|
ld (ix - 33), hl
|
|
call __imulu
|
|
push de
|
|
pop bc
|
|
push hl
|
|
pop de
|
|
ld hl, (ix - 27)
|
|
add hl, de
|
|
ld (hl), iy
|
|
ld de, 4
|
|
BB2_8:
|
|
push bc
|
|
pop hl
|
|
or a, a
|
|
sbc hl, de
|
|
jq z, BB2_10
|
|
push bc
|
|
ld (ix - 30), bc
|
|
call _clearLine
|
|
pop hl
|
|
ld hl, (ix - 27)
|
|
ld hl, (hl)
|
|
ld de, 2
|
|
push de
|
|
ld de, (ix - 30)
|
|
push de
|
|
push hl
|
|
call _print
|
|
ld bc, (ix - 30)
|
|
ld de, 4
|
|
pop hl
|
|
pop hl
|
|
pop hl
|
|
inc bc
|
|
ld iy, (ix - 27)
|
|
lea iy, iy + 3
|
|
ld (ix - 27), iy
|
|
jq BB2_8
|
|
BB2_10:
|
|
or a, a
|
|
sbc hl, hl
|
|
push hl
|
|
ld hl, 5
|
|
push hl
|
|
ld hl, L_.str.6
|
|
push hl
|
|
call _print
|
|
pop hl
|
|
pop hl
|
|
pop hl
|
|
ld hl, (ix - 33)
|
|
ld sp, ix
|
|
pop ix
|
|
ret
|
|
section .text,"ax",@progbits
|
|
|
|
section .text,"ax",@progbits
|
|
public _get_input
|
|
_get_input:
|
|
ld hl, -43
|
|
call __frameset
|
|
ld iy, -720868
|
|
or a, a
|
|
sbc hl, hl
|
|
lea de, ix - 25
|
|
ld (ix - 43), de
|
|
ld (ix - 37), hl
|
|
ld (ix - 40), hl
|
|
BB3_1:
|
|
ld l, (iy)
|
|
ld h, (iy + 1)
|
|
ld (ix - 31), hl
|
|
ld hl, -720866
|
|
push de
|
|
ld e, (hl)
|
|
inc hl
|
|
ld d, (hl)
|
|
ld l, e
|
|
ld h, d
|
|
pop de
|
|
ld (ix - 28), hl
|
|
call _kb_Scan
|
|
ld iy, -720868
|
|
ld l, (iy)
|
|
ld h, (iy + 1)
|
|
ld (ix - 34), hl
|
|
ld hl, -720866
|
|
ld e, (hl)
|
|
inc hl
|
|
ld d, (hl)
|
|
ld bc, (ix - 31)
|
|
ld a, c
|
|
cp a, 1
|
|
jq z, BB3_4
|
|
ld hl, (ix - 34)
|
|
ld a, l
|
|
cp a, 1
|
|
jq nz, BB3_4
|
|
ld hl, (ix - 37)
|
|
push hl
|
|
ld hl, L_.str.7
|
|
push hl
|
|
ld hl, (ix - 43)
|
|
push hl
|
|
ld (ix - 31), de
|
|
call ___sprintf
|
|
pop hl
|
|
pop hl
|
|
pop hl
|
|
ld hl, 17
|
|
push hl
|
|
ld hl, 5
|
|
push hl
|
|
ld hl, (ix - 43)
|
|
push hl
|
|
call _print
|
|
ld de, (ix - 31)
|
|
ld iy, -720868
|
|
pop hl
|
|
pop hl
|
|
pop hl
|
|
ld hl, (ix - 37)
|
|
inc hl
|
|
ld (ix - 37), hl
|
|
BB3_4:
|
|
ld a, e
|
|
ld hl, (ix - 28)
|
|
xor a, l
|
|
or a, a
|
|
jq z, BB3_10
|
|
ld a, e
|
|
cp a, 1
|
|
ld hl, 4
|
|
jq z, BB3_8
|
|
ld a, e
|
|
cp a, 8
|
|
jq nz, BB3_9
|
|
ld hl, 3
|
|
BB3_8:
|
|
ld de, (ix - 40)
|
|
push de
|
|
push hl
|
|
call _print_ui
|
|
ld (ix - 40), hl
|
|
pop hl
|
|
pop hl
|
|
BB3_9:
|
|
ld iy, -720868
|
|
BB3_10:
|
|
ld l, (iy)
|
|
ld h, (iy + 1)
|
|
ld a, l
|
|
cp a, 64
|
|
jq nz, BB3_1
|
|
ld sp, ix
|
|
pop ix
|
|
ret
|
|
section .text,"ax",@progbits
|
|
|
|
section .text,"ax",@progbits
|
|
public _main
|
|
_main:
|
|
ld iy, -3145600
|
|
call _os_ClrLCD
|
|
call _os_HomeUp
|
|
call _os_DrawStatusBar
|
|
or a, a
|
|
sbc hl, hl
|
|
push hl
|
|
push hl
|
|
call _print_ui
|
|
pop hl
|
|
pop hl
|
|
call _get_input
|
|
BB4_1:
|
|
call _os_GetCSC
|
|
or a, a
|
|
jq z, BB4_1
|
|
or a, a
|
|
sbc hl, hl
|
|
ret
|
|
section .text,"ax",@progbits
|
|
|
|
section .rodata,"a",@progbits
|
|
private L_.str
|
|
L_.str:
|
|
db " ", 0
|
|
|
|
section .rodata,"a",@progbits
|
|
private L_.str.1
|
|
L_.str.1:
|
|
db "Test: ", 0
|
|
|
|
section .rodata,"a",@progbits
|
|
private L_.str.2
|
|
L_.str.2:
|
|
db "[ ] one", 0
|
|
|
|
section .rodata,"a",@progbits
|
|
private L_.str.3
|
|
L_.str.3:
|
|
db "[ ] two", 0
|
|
|
|
section .rodata,"a",@progbits
|
|
private L_.str.4
|
|
L_.str.4:
|
|
db "[ ] three", 0
|
|
|
|
section .rodata,"a",@progbits
|
|
private L_.str.5
|
|
L_.str.5:
|
|
db "[x] three", 0
|
|
|
|
section .rodata,"a",@progbits
|
|
private L_.str.6
|
|
L_.str.6:
|
|
db "<Enter> pressed: ", 0
|
|
|
|
section .rodata,"a",@progbits
|
|
private L_.str.7
|
|
L_.str.7:
|
|
db "%d", 0
|
|
|
|
ident "clang version 14.0.0 (https://github.com/jacobly0/llvm-project a139def90d26173f771eb1eca797633d1fbb2797)"
|
|
extern _os_DrawStatusBar
|
|
extern __Unwind_SjLj_Register
|
|
extern _os_ClrLCD
|
|
extern __Unwind_SjLj_Unregister
|
|
extern __frameset
|
|
extern _os_PutStrFull
|
|
extern __imulu
|
|
extern _kb_Scan
|
|
extern ___sprintf
|
|
extern __frameset0
|
|
extern _os_HomeUp
|
|
extern _os_SetCursorPos
|
|
extern _os_GetCSC
|