mirror of
https://github.com/sehugg/8bitworkshop.git
synced 2024-11-12 10:07:00 +00:00
81 lines
967 B
Plaintext
81 lines
967 B
Plaintext
|
|
|
|
_palette = 0x0040
|
|
|
|
_cellram = 0xe000
|
|
_tileram = 0xe800
|
|
|
|
org $0000
|
|
_start::
|
|
;<stdin>:19:
|
|
LD SP,$E800 ; set up stack pointer
|
|
DI ; disable interrupts
|
|
;<stdin>:20:
|
|
jp _main
|
|
;<stdin>:23:
|
|
; ---------------------------------
|
|
; Function main
|
|
; ---------------------------------
|
|
_main::
|
|
;<stdin>:26:
|
|
ld a,0x01
|
|
out (_palette),a
|
|
;<stdin>:27:
|
|
ld hl,_tileram
|
|
ld (hl), 0xfe
|
|
ld e, l
|
|
ld d, h
|
|
inc de
|
|
ld bc, 0x07ff
|
|
ldir
|
|
;<stdin>:28:
|
|
ld hl,_cellram
|
|
ld (hl), 0x00
|
|
ld e, l
|
|
ld d, h
|
|
inc de
|
|
ld bc, 0x07ff
|
|
ldir
|
|
;<stdin>:29:
|
|
ld c,0x00
|
|
;<stdin>:30:
|
|
00112$:
|
|
ld a,c
|
|
rlca
|
|
rlca
|
|
rlca
|
|
and a,0xf8
|
|
ld e,a
|
|
ld d,0x00
|
|
00106$:
|
|
;<stdin>:31:
|
|
ld l,d
|
|
ld h,0x00
|
|
add hl, hl
|
|
add hl, hl
|
|
add hl, hl
|
|
add hl, hl
|
|
add hl, hl
|
|
ld a,low (_cellram)
|
|
add a, l
|
|
ld l,a
|
|
ld a,high (_cellram)
|
|
adc a, h
|
|
ld h,a
|
|
ld b,0x00
|
|
add hl, bc
|
|
ld (hl),e
|
|
;<stdin>:30:
|
|
inc d
|
|
ld a,d
|
|
sub a, 0x20
|
|
jr C,00106$
|
|
;<stdin>:29:
|
|
inc c
|
|
ld a,c
|
|
sub a, 0x20
|
|
jr C,00112$
|
|
;<stdin>:34:
|
|
00104$:
|
|
jr 00104$
|