All pastes #955919 Raw Edit

Something

public text v1 · immutable
#955919 ·published 2008-03-24 22:28 UTC
rendered paste body

//Camera Control CPU
//Controls Camera functions
//By:Pseudonym
//Input:
//Port0->ranger value
//Port1->Zoom
//Port2->Start
//Output
//Port0->RangerX
//Port1->RangerY
//Port2->ScreenX
//Port3->ScreenY
//Port4->ScreenValue
//Port5->screenCLK
jmp main;
//DATA
alloc zoom,0.25;
alloc timer,0;
main:
mov eax,port2; //Start button
cmp eax,1; 
jne main; //jump to main if start button isn't pressed
mov #timer,0; //start the timer at 0
mov #zoom,port1; //zoom to be used for whole photo(only loaded at start of picture)
cameraloop: //loop for actual camera action
mov port5,0; //screen clk
mov eax,#timer; //screen X
mov ebx,#timer; //screen Y
mod eax,32;  //X = int(timer % 32)+1
div ebx,32;  //Y = int(timer / 32)+1
fint eax;    //See X 
fint ebx;    //See Y
add eax,1;   //See X
add ebx,1;   //See Y
mov port2,eax; //ScreenX
mov port3,ebx; //ScreenY
div eax,16; //RangerX = (ScreenX/16 -1) * Zoom
div ebx,16; //RangerY = (ScreenY/16 -1) * Zoom
sub eax,1;
sub ebx,1;
mul eax,#zoom;
mul ebx,#zoom;
mov port0,eax; //rangerx
mov port1,ebx; //rangery
mov eax,port0; //ranger value
div eax,10; //contrast
fint eax; 
mov port4,eax; //screen value
mov port5,1; //screen clk
add #timer,0.33; //increment
cmp #timer,1024; //finish check
jl cameraloop;
jmp main;