Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 32 additions & 15 deletions GLIM.s
Original file line number Diff line number Diff line change
Expand Up @@ -193,21 +193,21 @@ printString:
sw $ra, -4($fp) # Save $ra
sw $s0, -8($fp) # Save $s0


#terminal automatically regects negative values, not certain why, but not checking for it either
la $t0, TERM_ROWS #check if past boundary
la $t0, TERM_ROWS #check if past boundary
lw $t0, 0($t0)
slt $t0, $t0, $a1 #if TERM_ROWS < print row
bge $a1, $t0, pSend #if TERM_ROWS <= print row

la $t1, TERM_COLS
lw $t1, 0($t1)
slt $t1, $t1, $a2 #or if TERM_COLS < print col
or $t0, $t0, $t1
bne $t0, $zero, pSend #do nothing
bge $a2, $t1, pSend #or if TERM_COLS <= print col

slt $t2, $a1, $zero #or if print row < 0
slt $t3, $a2, $zero #or if print col < 0

#else
or $t2, $t2, $t3
bne $t2, $zero, pSend #then do nothing

#else
move $s0, $a0

move $a0, $a1
Expand Down Expand Up @@ -311,8 +311,8 @@ batchPrint:

#print to match printing code if needed
#if standard print, make sure to have clear color
li $t0, 1 #if pcode == 1
beq $s3, $t0, bPscCend
li $t0, 1 #if pcode != 1
bne $s3, $t0, bPscCend
bPsclearColor:
li $t0, -1 #if lastFG != -1
bne $s6, $t0, bPscCreset
Expand Down Expand Up @@ -884,12 +884,29 @@ printCircle:
addi $t0, $t0, 12
li $t1, 0xFFFF
sh $t1, 0($t0)

# Sterilize the input to GLIR_BatchPrint of the guard value
# 0xFFFF in print row to avoid not printing the remainder of a
# batch if the guard is encountered
addi $t0, $zero, 0 #i = 0
addi $t1, $zero, 8 #loop 8 times
la $t2, pClist
pCguardl:
lhu $t3, 0($t2) #print row
li $t4, 0xFFFF #guard
bne $t3, $t4, pCsterile
sb $zero, 4($t2) #set print code 0
sb $zero, 0($t2) #reset print row
pCsterile:
addi $t2, $t2, 12 #increment by 3 words (1 job)
addi $t0, $t0, 1 #i++
bne $t0, $t1, pCguardl

pCguarde:
la $a0, pClist
jal batchPrint

#li $a0, 1000
#jal sleep


addi $s1, $s1, 1 #y += 1
bgtz $s2, pClmoveRow #if(err <= 0)
add $s2, $s2, $s1 #err += 2y+1
Expand Down Expand Up @@ -923,4 +940,4 @@ printCircle:
jr $ra
##############################################################################
# END OF GLIM
##############################################################################
##############################################################################
6 changes: 6 additions & 0 deletions css_files/bootstrap.min.css

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions css_files/bootstrap.min.js

Large diffs are not rendered by default.

441 changes: 441 additions & 0 deletions css_files/custom.css

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions css_files/font-awesome.min.css

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions css_files/jquery-ui.min.css

Large diffs are not rendered by default.

13 changes: 13 additions & 0 deletions css_files/jquery-ui.min.js

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions css_files/jquery.min.js

Large diffs are not rendered by default.

Binary file added css_files/logo-reverse.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
147 changes: 147 additions & 0 deletions css_files/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
var schools = new Map();
var citiesTowns = new Map();
var campaigns = new Map();

$(document).ready(function() {
// initiate autocomplete feature
readSchools();
attachSchools();
readCitiesTowns();
attachCitiesTowns();

$('div#province-row').find('select').change(function() {
attachSchools();
attachCitiesTowns();
});

$('.singleclick option').mousedown(function(e) {
e.preventDefault();
var originalScrollTop = $(this).parent().scrollTop();
console.log(originalScrollTop);
$(this).prop('selected', $(this).prop('selected') ? false : true);
var self = this;
$(this).parent().focus();
setTimeout(function() {
$(self).parent().scrollTop(originalScrollTop);
}, 0);

return false;
});
});

function attachSchools() {
var province = $('#state').find(':selected').val();
//console.log("province: " + province);

if(schools[province] == null) {
readSchools();
};

$('#current-school-nr-row').find('input').autocomplete({
source: schools[province]
});
//console.log("schools: " + schools[province]);
}

function attachCitiesTowns() {
var province = $('#state').find(':selected').val();
//console.log("province: " + province);

if(citiesTowns[province] == null) {
readCitiesTowns();
};

$('#city-row').find('input').autocomplete({
source: citiesTowns[province]
});
//console.log("citiesTowns: " + schools[province]);
}

function readSchools() {
$.ajax({
url: "data/ps-schools.json",
dataType: "text",
success: function(data) {
var maps = $.parseJSON(data);
for(i = 0; i < maps.length; i++) {
schools[maps[i].province] = maps[i].hs;
//console.log('reading: ' + maps[i].province);
//console.log('reading: ' + maps[i].hs);
}
}
});
}

function readCitiesTowns() {
$.ajax({
url: "data/cities_towns_canada.json",
dataType: "text",
success: function(data) {
var maps = $.parseJSON(data);
for(i = 0; i < maps.length; i++) {
citiesTowns[maps[i].province] = maps[i].citiesTowns;
//console.log('reading: ' + maps[i].province);
//console.log('reading: ' + maps[i].citiesTowns);
}
}
});
}



function careerSelectionChange() {
var career = $('#00Nf100000BlvsS').val();
if (career === 'HS' || career === 'PSE') {
document.getElementById('faculty-interest-uai-row').style.display = 'block';
document.getElementById('hs-curriculum-uai-row').style.display = 'block';
document.getElementById('00Nf100000CZXIr').required = true;
document.getElementById('00Nj000000A6Ii3').required = true;

} else if (career === 'GRAD') {
document.getElementById('faculty-interest-uai-row').style.display = 'block';
document.getElementById('00Nj000000A6Ii3').required = true;

document.getElementById('hs-curriculum-uai-row').style.display = 'none';
document.getElementById('00Nf100000CZXIr').value = '';
document.getElementById('00Nf100000CZXIr').required = false;

document.getElementById('cad-curriculum-uai-row').style.display = 'none';
document.getElementById('00Nf100000CZXIw').value = '';
document.getElementById('00Nf100000CZXIw').required = false;

} else {
document.getElementById('faculty-interest-uai-row').style.display = 'none';
document.getElementById('00Nj000000A6Ii3').value = '';
document.getElementById('00Nj000000A6Ii3').required = false;

document.getElementById('hs-curriculum-uai-row').style.display = 'none';
document.getElementById('00Nf100000CZXIr').value = '';
document.getElementById('00Nf100000CZXIr').required = false;

document.getElementById('cad-curriculum-uai-row').style.display = 'none';
document.getElementById('00Nf100000CZXIw').value = '';
document.getElementById('00Nf100000CZXIw').required = false;
}
}

function curriculumSelectionChange() {
var curriculum = $('#00Nf100000CZXIr').val();
if (curriculum === 'Canada Grade 12 System') {
document.getElementById('cad-curriculum-uai-row').style.display = 'block';
document.getElementById('00Nf100000CZXIw').required = true;
} else {
document.getElementById('cad-curriculum-uai-row').style.display = 'none';
document.getElementById('00Nf100000CZXIw').value = '';
document.getElementById('00Nf100000CZXIw').required = false;

}
}

function validate() {
var filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,})+$/;
if (!filter.test(document.getElementById('email').value)) {
alert('Please provide a valid email address');
email.focus;
return false;
}
}
12 changes: 6 additions & 6 deletions demo.s
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ main:
li $s0, 0 #row
li $s1, 0 #col
li $s2, 0 #fgcolor, valid colors are between 0 and 255
li $s4, 100 #bgcolor, valid colors are between 0 and 255
li $s3, 0x20 #char, printable chars are between 0x20 and 0x7e
li $s3, 100 #bgcolor, valid colors are between 0 and 255
li $s4, 0x20 #char, printable chars are between 0x20 and 0x7e
loop:
beq $s0, 20, lend
la $a0, printList #create a print job by adding to the list
Expand All @@ -54,7 +54,7 @@ main:
sb $s3, 6($a0) # background color
#7th byte is empty
la $t0, char
sb $s3, 0($t0) # update the char string
sb $s4, 0($t0) # update the char string
sw $t0, 8($a0) # then provide it to the job
li $t0, 0xFFFF
sh $t0, 12($a0) #terminate the job list
Expand All @@ -73,10 +73,10 @@ main:
bne $s2, $t0, lchar
li $s2, 0
lchar:
addi $s3, $s3, 1 #goto next char
addi $s4, $s4, 1 #goto next char
li $t0, 0x7e
bne $s3, $t0, lcont
li $s3, 0x20
bne $s4, $t0, lcont
li $s4, 0x20


lcont:
Expand Down
Loading