Skip to content

Commit

Permalink
sort of release
Browse files Browse the repository at this point in the history
  • Loading branch information
nebogeo committed Aug 22, 2014
1 parent 2df0e51 commit e929aeb
Showing 1 changed file with 25 additions and 28 deletions.
53 changes: 25 additions & 28 deletions neural.asm
Expand Up @@ -18,9 +18,8 @@
;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

brain_base equ 28600
brain_size equ 32
brain_size equ 48
neuron_size equ 13
brain_mask equ %00011111
input_neuron1 equ brain_base+(neuron_size*7)
input_neuron2 equ brain_base+(neuron_size*31)
weave_end equ 800h
Expand Down Expand Up @@ -62,7 +61,6 @@ clk_end:
ld a, (clock1)
ld (input_neuron2), a

call draw_neurons

call brain_think
ld a, (brain_base)
Expand All @@ -89,15 +87,12 @@ clk_end:
ld (hl), a


ld a, r
rr a
rr a
and %00011000


ld a, (clock1)
and %00001111
jp z, input_stuff
jp loop
input_stuff:
call draw_neurons
call draw_cursor
call do_input
call draw_cursor
Expand Down Expand Up @@ -142,7 +137,8 @@ select_cursor:
ld a, (cursor_y)
sla a
sla a
sla a ; quotient 8
sla a
sla a ; quotient 16
ld b, a
ld a, (cursor_x)
add a, b
Expand Down Expand Up @@ -404,20 +400,20 @@ loop_draw_neurons:

iso_move_tr:
ld a, b
add a, -1
and %00000111
ld b, a
and %00000001
add a, -1 ; take one away from x
and %00001111 ; modulo 8
ld b, a ; set x
and %00000001 ; every other column
ret z
ld a, c
add a, 1
and %00000011
ld c, a
ld a, c ; load y
add a, 1 ; add one
and %00000011 ; modulo 4
ld c, a ; set y
ret
iso_move_bl:
ld a, b
add a, 1
and %00000111
and %00001111
ld b, a
and %00000001
ret nz
Expand All @@ -430,7 +426,7 @@ iso_move_bl:
iso_move_tl:
ld a, b
add a, 1
and %00000111
and %00001111
ld b, a
and %00000001
ret z
Expand All @@ -443,7 +439,7 @@ iso_move_tl:
iso_move_br:
ld a, b
add a, -1
and %00000111
and %00001111
ld b, a
and %00000001
ret nz
Expand Down Expand Up @@ -590,7 +586,7 @@ init_neuron:

;; tl
ld a, b
add a, 9
add a, 17
call index_to_addr
ld (ix+2), l ; connection 1
ld (ix+3), h ; connection 1
Expand All @@ -611,7 +607,7 @@ init_neuron:

;; tr
ld a, b
add a, 7
add a, 15
call index_to_addr
ld (ix+8), l ; connection 4
ld (ix+9), h ; connection 4
Expand All @@ -629,14 +625,14 @@ init_alternate:

;; bl
ld a, b
add a, -7
add a, -15
call index_to_addr
ld (ix+4), l ; connection 2
ld (ix+5), h ; connection 2

;; br
ld a, b
add a, -9
add a, -17
call index_to_addr
ld (ix+6), l ; connection 3
ld (ix+7), h ; connection 3
Expand All @@ -661,24 +657,25 @@ init_end:
;; b should contain loop count
ld a, b
dec a
and %00000111 ; mod 8
and %00001111 ; mod 8

add a, a

add a, 8

ld (ix+10), a ; set x


ld a, b ; reload b
dec a
sra a
sra a
sra a
sra a ; quotient 4

add a, a
add a, a

add a, 8
add a, 10
add a, c
ld (ix+11), a

Expand Down

0 comments on commit e929aeb

Please sign in to comment.