gusg21
Level 9 Mixist   
 
 
Points by Class
 
Mixist
531
Criticist
249
OHCist
190
Chipist
162
Grafxicist
79
Taggist
63
Playa
26
Latist
-4
 
total 1296
 
created 2020-04-30
last here 2020-05-24
i like to make tunes, =)

gusg21.github.io

🎵
Tell me why
Aint nothing but alfredo
Tell me why
I want my fettuccino
Mama Mia
Bring me the marinara
I never want to hear you say
I want spa-ghet-ti
🎵

>younger Chinese character idea since done. freie hansestadt :o) it's physical knobs are popping neurobash n diggy wall state penn. ohz noez

hehe

RESET:
Include Wake2.asm ;asm file
end Tracker
; For power on test, WE only clear ram to E9h and use EAh for a
; messenger to the warm boot routine. We always clear ram and initialize
; registers on power up, but if it is a warm boot then read E 'PROM
; and setup ram locations. Location EAH is set or cleared duri. j power
up
; and then the
j Clear RAM to
stack can use
OOH
it during normal run.
LDA «00H 1 data for fill
LDX •E9H ; start at ram location
RAMClear:
STA 00,X ; base 00, offset x
DEX ; next ram location
CPX •7FH ; check for end
BNE RAMClear ; branch, not finished
1 fill done
A-19
Main:
InitIO:
LDA •01 ;turn DAC on
STA DAC_ctrl ;DAC control
LDA *Port_def .-set direction control
STA Ports_dir ;1oad reg
LDA »Con_def .-set configuration
STA Ports_con ;load reg
LDA •00 ;set for bank 0
STA Bank .-set it
LDA •00H .-disable wakeup control
STA Wake_up ;
LDA *00h .-disable sleep control
STA Sleep .-set dor.t care
LDA *Intt_dfIt ;Initialize tleers
STA Interrupts ;lead reg
LDA •00H ;set timer mode
STA TKA_CON ;set reg
LDA #Tizr.eA_lov.‘ ,-get preset timer for interrupts
STA TMA_LS5 ; load
LDA *TimeA_hi ;get hi byte for preset
STA TMA_KSB .-load it
LDA •TimeB_low .-get preset timer for interrupts
STA TMB_LSB .-load
LDA •TimeB_hi .-get hi byte for preset
STA TKB_MSB ,-load it
LDA •COh ;preset status for motors off
STA Stat_3
LDA •00H ; init ports
STA Port_A ;output
LDA •33H ; init ports
STA Port_B_Image ;ram image
STA Port_B ;output
LDA •01H ; init ports
STA Port _C ;output
LDA •DOH .- init ports
STA Port_D_Image ,- ram image
STA Port_D ;output
LDA •FFh .-milisec timer reload value
STA Mili_sec ,-also preset IRC timer
CLI ;Enable IRQ
A-20
JSR Kick_IRQ ;wait for interrupt to restart
JSR TI_reset ;go init TI (uses ’Cycle..timer•)
. Preset motor speed, assuming mid ba?te*V life, we set the pulse width
; so that the motor wont be running at 6 volts and bum out. We then
• predict what the pulse width should be for any voltage.
;preset motor speed
;set motor on pulse timing
;set motor off pulse timing
itlltttttlttttttttttttttltttttttlttl.
:«ttiSi««SiSii«®iii5iSiii5«i imutttmtmtilittMttt
!
Include Diag7.asm ;asm file
LDA •Mpulse_on
LDA • 11
STA Mon_len
LDA •05
STA Mof f_len
****** Only called by diagnostic speech routines
Be sure to set 'MACRG_HI' and all calls are in that 128 byte block.
Diag_macro:
STA Macro_Lc
LDA »0b8h
diag call
CLC
ADC Macro_Lo
STA Macro_Lo
LDA 101
STA Macro_Hi
-JSR Get_macro
JSR Notrdy
RTS
.save lo byte of Macro table entry
;<90h , ex offset to adrs-.400 added
.-add in offset
.•update
,• get hi byte aars 400 = 190h
.-save hi b te of Macro table entry
;go start motor/speech
;Do / get status for speech and motor
;yo !
. Enter with Areg holding how many 30 mili second delay cycles
Half_delayi
STA TEMPI ;save timer
Half d2:
LDA •10 .set 1/2 sec
STA Cycle_timer ;set it
Half_d3:
LDA Cycle_timer ;ck if done
BNE Half_d3 1 loop
DEC TEMPI J
BNE Half_d2 ; loop
RTS ; done
Test_byp: ;We assume diagnostic only runs on coldboot
...
LDA *FFh {initialize word training variable
STA Temp_ID j
LDA »FFh j
STA Hungry_counter ;preset furby's health
STA Sick_counter
.•••••••■■a......
; We sit here and wait for tilt to go away, and just keep incrementing
; counter un-il it does. This becomes the new random generator seed.
Init_md:
INC TEMPI ;random counter
LDA Port_D ;get switches
AND •03 ;check tilt 4 invert sw
BNE Init_md {loop til gone
LDA TEMPI ;get new seed
STA Spcl_seedl ;stuff it
STA Seed_l ,-also load for cold boot
; Use feed sw to generate a better random number
JSF. Get_feed ;go test sensor
LDA Stat_4 ;get system
AND •Do_£eed ;ck sw
BNE Feed_md 1 ;if feed sw then cold boot
JMP End coldinit .-else do warm boot
Feed_md:
INC TEMPI {random counter
LDA Stat_4 ;system
AND •DFh
STA Stat_4 .-update
JSR Get_feed {go test sensor
LDA Stat_4 {get system
AND •Do_feed .•ck sw
BNE Feed_md .-wait for feed to go away
LDA TEMPI ;get new seed
STA Spcl_seedl .•stuff it
STA Seed_l .-also load for cold boot
1; IF this is a cold boot , reset command then clear EEPROM and
j chose a new name and voice.
Do_cold_boot:
LDA *00
STA Warm_cold ,-flag cold boot
A-22
LEA Stat_0 ;system
ORA •Say_new_name ,-make system say new name
STA Stat_0 •
t
;••••••• NOTE :::::
; VOICE AND NAME SLECTION MUST HAPPEN BEFORE EEPROM WRITE OR
; THEY WILL ALWAYS COME UP 00 because ram 'ust got cleared!!!!!!
; Random voice selection here
LDA «80h ;ge- random/sequential split
STA IN_DAT ;save for random routine
LDX •00 ; makei sure only gives random
LDA #10h ;get number of random selections
JSR Ran_seq ;go get random selection
TAX
LDA Voice_table,X ;get new voice
STA Rvoice ;set new voice pitch
; On power up or reset, Furby must go select a new name , ,, ahw how
cute.
JSR Random ;
AND DlFh ;get 32 possible
STA Name .-set new name pointer
JSR Do_EE_write .-write the EEPROM
End_coldinit r
>*flllllflllitllllllfilltllllllllillttlfilltllfllllfllllllllfllliiixil
;• 'Special initialization prior to normal run mode *
; • Jump to Warm, boot when portD wakes us up
jfcllllllllllllilflllllllllillllllllllllllilllllllllllllillllllllllllll
;
Warm_b°ot: ;no nal tart when Port_D wakes ur up.
JSR S_EEK M_READ ;read data to ram
l Epront_read_byp:
; If light osc fails, or too dark and that sends us to sleep, we
; set 'Dark_sl->ep_prev• and save it in EEPROM in 'Seed_2'.
; when the sleep routine executes,(00 01 based on this bit)
; When we wake up we recover this bit and it becomes the previous done
; flag back in 'Stat_0', so that if the osc is
; still dark or failed, Furby wont go back to sleep.
LDA Seed_2 {from EEPROM
BED No_prevsleep {jump if none
LDA Stat_0 ;system
ORA *Dark_sleep_prev ;prev done
STA Stat_0 {update
No_prevsleep:
LDA Spcl_seedl ;recover start up random number
STA Seed_l ;set generator
Pot_timeL2 is save in ram through sleep mode and then reloaded *
Pot_timeL which is the working register for the motor position.
This allows startup routines to clear ram without forgetting the
last motor position.
LDA Pot_timeL2 .get current count
STA Pot_ imeL ;save in motor routine counter
; Get age and make sure it is not greater than 3 (age*!
LDA Age ;get current age
AND »83h .•preserve bit 7 which is 9th age counter bit
/;; f
and insure age not >3
STA Age .set system.
LDA *Bored_reld ;reset timer
STA Bored_time' ;
LDA 103 ;set timer
STA Last_IR ;timer stops IR from hearing own IR xmit
JSR Get_light ;go get light level sample
LDA TEMPI ;get new count
STA Light_reff /update system
LDA Warm^cold {decide if warm or cold boot
CMP »llh ;ck for warm boot
BEQ No_zero {jump if is
A-24
LDA
STA
STA
JSR
JSR
»00
Macro_Lo
Macro_Hi
Get_macro
Notrdy
;point to macro 0 (SENDS TO SLEEP POSITION)
;go start motor/speech
;Do / get status for speech and motor
zeros
LDA
STA
•11
Mon_len
;preset motor speed
;set motor on pulse timing
LuA
STA
•05
Moff_len
.-set motor to 3/4 speed for speed test
,-set motor off pulse timing
LDA
STA
•00
3tat_4
;clear all system sensor requests
;update
; Currently uses 4 tables, one for each age.
LDA Stat_0
ORA •Init_motor :flag
ORA *Init_Mspeea
STA Stat_0
;system
motor to do speed test
;2nd part of test
;update
; Do wake up routine s
Ida *Global_time
STA Sensor_timer
LDA #80h
STA IN_DAT
LDX »00h
LDA *10h
. JSR Ran_seq
' LDA TEMPI
STA IN_DAT
LDA *Wake_ID
(offset)
JSR Start_learn
LDA IN_DAT
JSR Decid_age
LDX TEMPO
LDA Wakeup_Sl,X
STA Macro_Lo
INX
LDA Wakeup_Sl,X
STA Macro_Hi
JMP Start_macro
:reset timer to trigger sensor learning
;get random'sequential split
.-save for random routine
.-make sure only gives random
;get number of random selections
;go get random selection
;g«t decision
,-save decision
;which ram location for leamea word count
;go record training info
;get back word to speak
;do age calculation for table entry
;age offset
;get new sound/word
,-save lo byte of Macro table entry
s
;get new sound/word
,-save hi byte of Macro table entry
;go start speech
;«lillilllllllllllllllllllllllllllillllliilllllllltllllllllllllllilll
'IDLE Routine •
ittlttlittltltlllltltttltlltttllllttttltltttllittttttlltlitttllltlttii
Idle:
; Idle routine is the time slice task master (TSTM) ugh!
; We must call each routine and interle-ve with a call to speech
; to insure we never miss a TI request for data.
JSR Notrdy ;Do / get status for speech and motor
; *"*.......
; THis bit is set when light sensor is darker than -Dark_sleep’
LDA Stat_0 ; system.
AND *REQ_dark_sleep ;ck for
BEQ No_dark_req ;jump if not
LDA Stat_0 ;system
AND tBFh ;kill req
STA Stat_0 ;update
LDA #A6h ;sleep macro
STA Macro_Lo
LDA tOOh ;sleep macro
STA Macro_Hi ;
JMP Start_macro ;go say it
No_dark_req:
; When any sensor or timer calls the start_macro' routine, the
; Macro_Lo & Macr _Hi are saved. Everyone jumps back to Idle and when
I speech/motor routines are finished, this routine will look at the
I macros that were used and execute another function if a match is
found.
I
I Checks for his name first, then any IR to send, and finally, the Bleep
; commands. THe temp macro buffers are cleared before
Spcl_Namel:
LDX
Spcl_Name2:
LDA
CMP
BEQ
CMP
BNE
INX
LDA
CMP
«00 ;offset
Ck_Name_table,X ;ck lo byte
tFFh ;ck for end of table (note 255 cant execute)
Spcl_IRl ;done if is
Req_macro_lo jck against last speech request
Not_Name2 ;jump if not
; to hi byte
Ck_Name_table.X ;ck hi byte
Req_macro_hi ;ck against lasspeech request
A-26
BNE Not_Name3 .•jump if not
JMP Say„Sname ;speak it
Not_Name2:
INX J
Not_Nama3:
INX ;
JMP Spcl_Name2 ; loop til done
Say_Sname:
LDA Stat_0
AND •DFh ,-kill req for startup new name
STA Stat_0 .update
LDA Name ;current setting for table offset
CLC
ROL A ;2's comp
TAX
LDA Name_table. X ; get lo byte
STA Macro_Lo ; save lo byte of Macro table entry
INX ;
LDA Name table.X .-get hi byte
STA Macro_Hi ,-save hi byte of Macro table entry
JSR Oet_macro ;go start motor/speech
JSR Notrdy ;Do / get status for speech and nw3tor
Spcl_IRl:
LDX #00 ;offset
Spcl_IR2:
LDA IRxmit_tabie1,X ;ck lo byte
CMP #FFh ;ck for end of table (note 255 cant execute)
BEQ Spcl_IR_dn .•done if is
CMP Req_macro_lc ;ck against last speech request
BNE Not_IRxmit2 .•jump if not
INX ;to hi byte
LDA IRxmit table ,X ;ck hi byte
CMP Req_niacro_hi ;ck against last speech request
BNE Not IRxmit3 ;jump if not
INX .•point to IR table
LDA IRxmit_table,X
STA TEMP2 ;xmit temp rrm
LDA #FDh ;TI consnand for IR xmit
STA TEMPI J
JSR Xmit_TI ;go send it
LDA •Bored_reld .reset bored timer
STA Bored_timer >
LDA •03 ; set timer
STA Last _IR .•timer stops IR from hearing its own IR
xmit
JMP Spcl_IR_dn . done - ola.
Not IRxmi t2
INX ;lo byte
Not IRxmit3 s
INX jhi byte
INX ;xmit pointer
JMP Spcl_IR2 ;loop til done
Spcl_IR_dn:
.offset
Spcl_macrol:
LDX #00
Spcl_sleepl:
LDA Sleepy_table,X ;ck lo byte
CMP *FFh ;ck for end of table (note 255 cant execute)
BEQ Ck_macro_dn ;dcne if is
CMP Req_macro_lo ;ck against last speech request
BNE Not_sleepy2 ;jump if not
INX ; to hi byte
LDA Sleepy_table,X ;ck hi byte
CMP Req_jnacro_hi jck against last speech request
BNE Not_sleepyj ;jump if not
LDA 100 ;clear macro pointers for wake up
STA Req_macro_lo
STA Req_jnacro_hi


SQUENIS


#kleedercore_is_racist


Slimeboi Holmes
328 profile views
b496.18
18 INF

 
119881
Level 21 Mixist
post #119881 :: 2020.04.30 7:48am
  
  gusg21 liēkd this
Welcome to Botb! : D
 
 
119882
Level 9 Mixist
post #119882 :: 2020.04.30 7:51am
Thanks!
 
 
120237
Level 21 Chipist
YQN
post #120237 :: 2020.05.09 6:03pm
  
  gusg21 liēkd this
beautiful avatar
 
 
120239
Level 9 Mixist
post #120239 :: 2020.05.09 6:47pm
thank you yqn i spent hours toiling over the political message i wanted to convey
 
 
120460
Level 30 Chipist
post #120460 :: 2020.05.11 5:10pm
  
  gusg21 and Jakerson liēkd this
we love u pls come back
 
 

LOGIN or REGISTER to add your own comments!