1
0
mirror of https://github.com/stid/woz64.git synced 2024-11-25 00:31:29 +00:00

Bit Ops & Makefile

This commit is contained in:
stid 2020-01-25 09:27:50 -08:00
parent 2184c0c95d
commit 5866f3d804
3 changed files with 82 additions and 21 deletions

View File

@ -217,8 +217,9 @@ sendChar: {
jsr Math.multiply
// Add mul result to TempVideoPointer
clc
pha
clc
lda MemMap.MATH.result
adc MemMap.VIDEO.TempVideoPointer+1
sta MemMap.VIDEO.TempVideoPointer+1
@ -232,14 +233,8 @@ sendChar: {
jsr screenNewLine // Yes? Add new line first
bitTest(%00000001, MemMap.VIDEO.StatusBitsA)
//lda #%00000001
//bit MemMap.VIDEO.StatusBitsA
bne noScrollTriggered
// lda #1
// cmp MemMap.VIDEO.ScrollUpTriggered
// bne noScrollTriggered
// Compensate Scroll
sec
lda MemMap.VIDEO.TempVideoPointer
@ -288,24 +283,10 @@ screenNewLine: {
bitSet(%00000001, MemMap.VIDEO.StatusBitsA)
//lda #%00000001
//ora MemMap.VIDEO.StatusBitsA
//sta MemMap.VIDEO.StatusBitsA
// lda #1 // Yes - Scroll up
// sta MemMap.VIDEO.ScrollUpTriggered
jmp done
noScrollUp:
bitClear(%00000001, MemMap.VIDEO.StatusBitsA)
// lda #%11111110
// and MemMap.VIDEO.StatusBitsA
// sta MemMap.VIDEO.StatusBitsA
//lda #0
//sta MemMap.VIDEO.ScrollUpTriggered
done:
inc MemMap.VIDEO.CursorRow
pla

View File

@ -3,6 +3,69 @@
#import "../core/module.asm"
// ========================================================
// ////// MACROS //////////////////////////////////////////
// ========================================================
.macro inc16(addreess) {
inc addreess
bne !+
inc addreess +1
!:
}
.macro dec16(addreess) {
lda addreess
bne !+
dec addreess+1
!: dec addreess
}
.macro asl16(valueA, resultAddress) {
.if (valueA > resultAddress) {
clc
lda valueA
asl
sta resultAddress
lda valueA+1
rol
sta resultAddress+1
} else {
asl valueA+0
rol valueA+1
}
}
.macro add16(valueA, valueB, resultAddress) {
.if (valueA != valueB) {
clc
lda valueA
adc valueB
sta resultAddress
lda valueA+1
adc valueB+1
sta resultAddress+1
}
else {
.break
asl16(valueA, resultAddress)
}
}
.macro sub16(valueA, valueB, resultAddress) {
sec
lda valueA
sbc valueB
sta resultAddress
lda valueA+1
sbc valueB+1
sta resultAddress+1
}
.filenamespace Math
* = * "Math Lib"

17
makefile Normal file
View File

@ -0,0 +1,17 @@
BUILD_PATH = ./bin
KICKASS_BIN = /opt/develop/stid/c64/KickAssembler/KickAss.jar
all: build
build:
java -jar ${KICKASS_BIN} -odir ${BUILD_PATH} -log ${BUILD_PATH}/buildlog.txt -showmem ./main.asm
cartconv -t normal -name "woz" -i ${BUILD_PATH}/main.prg -o ${BUILD_PATH}/woz.crt
eprom:
java -jar ${KICKASS_BIN} -odir ${BUILD_PATH} -log ${BUILD_PATH}/buildlog.txt -showmem ./main.asm
cartconv -t normal -name "woz" -i ${BUILD_PATH}/main.prg -o ${BUILD_PATH}/woz.crt
cartconv -i ${BUILD_PATH}/woz.crt -o ${BUILD_PATH}/woz.bin
clean:
rm -Rf ./bin