From de94366b062963fdafdb9f90426abeb6b84b931d Mon Sep 17 00:00:00 2001 From: Byron Lathi Date: Tue, 4 Jun 2019 21:57:14 -0400 Subject: [PATCH] Initial commit --- .gitattributes | 2 + Makefile | 17 +++++ bin/factory.a2 | Bin 0 -> 1217 bytes factory.dsk | Bin 0 -> 143360 bytes factory.list | 38 ++++++++++ factory.map | 83 +++++++++++++++++++++ src/display.asm | 122 +++++++++++++++++++++++++++++++ src/display.inc | 4 + src/display.o | Bin 0 -> 2312 bytes src/factory.cfg | 24 ++++++ src/main.asm | 64 ++++++++++++++++ src/main.o | Bin 0 -> 1109 bytes src/monitor.inc | 190 ++++++++++++++++++++++++++++++++++++++++++++++++ src/tiles.asm | 187 +++++++++++++++++++++++++++++++++++++++++++++++ src/tiles.inc | 1 + src/tiles.o | Bin 0 -> 4830 bytes src/world.asm | 13 ++++ src/world.inc | 1 + src/world.o | Bin 0 -> 857 bytes 19 files changed, 746 insertions(+) create mode 100644 .gitattributes create mode 100644 Makefile create mode 100644 bin/factory.a2 create mode 100644 factory.dsk create mode 100644 factory.list create mode 100644 factory.map create mode 100644 src/display.asm create mode 100644 src/display.inc create mode 100644 src/display.o create mode 100644 src/factory.cfg create mode 100644 src/main.asm create mode 100644 src/main.o create mode 100644 src/monitor.inc create mode 100644 src/tiles.asm create mode 100644 src/tiles.inc create mode 100644 src/tiles.o create mode 100644 src/world.asm create mode 100644 src/world.inc create mode 100644 src/world.o diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..dfe0770 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +# Auto detect text files and perform LF normalization +* text=auto diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..94dc979 --- /dev/null +++ b/Makefile @@ -0,0 +1,17 @@ +APPLE2_CL := C:\Users\bslat\Downloads\cc65-snapshot-win32\bin\cl65 +APPLE2_SRC := src\main.asm src\display.asm src\tiles.asm src\world.asm +APPLE2_MAP := factory.map +APPLE2_LIST := factory.list +APPLE2_CFLAGS := -Oirs -v -t apple2 -vm --cpu 6502 +APPLE2_OUT := bin\factory.a2 + +all: directories apple2 + +directories: + mkdir bin + +apple2: $(APPLE2_SRC) + $(APPLE2_CL) -m $(APPLE2_MAP) -o $(APPLE2_OUT) -l $(APPLE2_LIST) $(APPLE2_CFLAGS) -C apple2-asm.cfg $? + +clean: $(SRC) + del /q/f $(APPLE2_MAP) src\*.o src\*.s gmon.out & rmdir /q/s bin\ diff --git a/bin/factory.a2 b/bin/factory.a2 new file mode 100644 index 0000000000000000000000000000000000000000..f7cadb66b202c5629c1398cc63758bd95b7b7104 GIT binary patch literal 1217 zcmbVKJ!n%=6n=&%H$T)25nkK0oO5r65M#-ZA(S8)G6c!cp`jUC%uu1J9Xho8Yw#_B zI|vrC2%#9MPl{88(gs>|FuG(&Fp~yBDYQbN#)2Bs^O6RuW@x=1-}&DC&iO89c<|{M zz8}L42Dca_S;EHFlv3WIkLK+92;5`EkvqnIW43aT?)YWP(LmXHWG`Pkx^CKsX*FYc zoOdK{vu8b3)|AYZa=Y?lztOHV(@#fBR-4>pa)-%ROul9E1CyVbJY@2im9E<4OD0Q9 zzGm_rlOLJBCzshd!ix3QB3m{%~;rO1O{6~r&8uT=xm3msWrEGay-KN@8_Po7rR~;$Ge9}L4pE#BrPmZ0zPwFS!oT57A zUmm~fUmlwoC(cuc5+iVid+PPC+dr;8+;G=a-tK>9oH`||P?~LYNTAyQ(S6HD^qc@0!y{u;R-n&4a zl2xLv?HVgxX6ZXy?du6f*>1o1&F34<*3S-$wXQZ>=tYHFIpa?5;%=^T4+rk$im(bMoWdpCLKPkX!Yh0bfFOh*3=xPz4C0Ug z9|kapAq-;#qZq?DCeX(NJjg>l%p*L?V?53i+$RDeC_*AEA|fhcA}$hQ0wy5^(~yQ) an1cmage923Nlf81rg0YMZ~+%_2~Pp*S@pmG literal 0 HcmV?d00001 diff --git a/factory.dsk b/factory.dsk new file mode 100644 index 0000000000000000000000000000000000000000..cd14b6e14139c15c4ff92392ad53b9ef64caecbc GIT binary patch literal 143360 zcmeI$&r1|h00;2d{I&fsckNQQiNFwquv5owNqFl}r-(8z5Cox1w+@8_g5ElA9>NYu z(xna?>h9{UrmnlIAoT}$^b$#0HVS(Pf?zw*`c?+x$0neS(q!%X7Jo2LHDFS4Vv z;ibLs)_!<(Z!(>In7kg9a9}t4^r-iwCpy*LF%=EFJI+3656|r`mAA6blRK^9&iC!| zm)F5;s&yj}_wK#H@y8=K-sU$p7vH^K`t*6__J_H0`C}oswz4v}nlDr`xk_QKR>)^+ z#ZonsFIAVvHcQn~E%WQN>BUm5xG_InS{oZHtyT+_Xu|4Rtr%@^xF#CpGv!L5T8(;J zndQP(pb#KHfB*pk1PBlyK!5;&*a;*Ov5Oo`2HDQ!PTS#MjQ*D7oxb}+L&H7c&Eb)u zf%EaxkeC1g0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs z0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZ zfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&U zAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C7 z2oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N z0t5&UAV7cs0RjXF5FkK+009C72oNAZfB=D53#2=mg5bxW2p-iZbS8q}LMn)kL2$4i z)q}?C(H?)XzJBfcy=fZ|NFP1Q1{VG&OVY>wlOPSoNJp=KoJ+bn&gp|7-4gTstufEv z7W4ecnCCwp^ZX}bp8sUb^Ph@&{`Q#XKV8qC2$~n>a<#R}R_6C5=3feRCoKU21PBly zK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF z5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk z1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs z0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZ zfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&U rAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5*Bg91MRF~I#~ literal 0 HcmV?d00001 diff --git a/factory.list b/factory.list new file mode 100644 index 0000000..d0fcb78 --- /dev/null +++ b/factory.list @@ -0,0 +1,38 @@ +ca65 V2.17 - Git 644d623 +Main file : src\world.asm +Current file: src\world.asm + +000000r 1 .export World +000000r 1 +000000r 1 World: +000000r 1 02 00 00 00 .byte 02, 00, 00, 00, 00, 00, 00, 00, 00, 00 +000004r 1 00 00 00 00 +000008r 1 00 00 +00000Ar 1 00 00 00 00 .byte 00, 00, 00, 00, 00, 00, 00, 00, 00, 00 +00000Er 1 00 00 00 00 +000012r 1 00 00 +000014r 1 00 02 02 02 .byte 00, 02, 02, 02, 14, 02, 02, 02, 00, 00 +000018r 1 0E 02 02 02 +00001Cr 1 00 00 +00001Er 1 00 00 00 00 .byte 00, 00, 00, 00, 00, 00, 00, 00, 00, 00 +000022r 1 00 00 00 00 +000026r 1 00 00 +000028r 1 00 00 00 00 .byte 00, 00, 00, 00, 00, 00, 00, 00, 00, 00 +00002Cr 1 00 00 00 00 +000030r 1 00 00 +000032r 1 00 00 00 00 .byte 00, 00, 00, 00, 00, 00, 00, 00, 00, 00 +000036r 1 00 00 00 00 +00003Ar 1 00 00 +00003Cr 1 00 00 00 00 .byte 00, 00, 00, 00, 00, 00, 00, 00, 00, 00 +000040r 1 00 00 00 00 +000044r 1 00 00 +000046r 1 00 00 00 00 .byte 00, 00, 00, 00, 00, 00, 00, 00, 00, 00 +00004Ar 1 00 00 00 00 +00004Er 1 00 00 +000050r 1 00 00 00 00 .byte 00, 00, 00, 00, 00, 00, 00, 00, 00, 00 +000054r 1 00 00 00 00 +000058r 1 00 00 +00005Ar 1 00 00 00 00 .byte 00, 00, 00, 00, 00, 00, 00, 00, 00, 00 +00005Er 1 00 00 00 00 +000062r 1 00 00 +000063r 1 diff --git a/factory.map b/factory.map new file mode 100644 index 0000000..c14c873 --- /dev/null +++ b/factory.map @@ -0,0 +1,83 @@ +Modules list: +------------- +main.o: + CODE Offs=000000 Size=000062 Align=00001 Fill=0000 + RODATA Offs=000000 Size=000000 Align=00001 Fill=0000 + BSS Offs=000000 Size=000000 Align=00001 Fill=0000 + DATA Offs=000000 Size=000000 Align=00001 Fill=0000 + ZEROPAGE Offs=000000 Size=000000 Align=00001 Fill=0000 + NULL Offs=000000 Size=000000 Align=00001 Fill=0000 +display.o: + CODE Offs=000062 Size=00009F Align=00001 Fill=0000 + RODATA Offs=000000 Size=000000 Align=00001 Fill=0000 + BSS Offs=000000 Size=000000 Align=00001 Fill=0000 + DATA Offs=000000 Size=0000C8 Align=00001 Fill=0000 + ZEROPAGE Offs=000000 Size=000000 Align=00001 Fill=0000 + NULL Offs=000000 Size=000000 Align=00001 Fill=0000 +tiles.o: + CODE Offs=000101 Size=000294 Align=00001 Fill=0000 + RODATA Offs=000000 Size=000000 Align=00001 Fill=0000 + BSS Offs=000000 Size=000000 Align=00001 Fill=0000 + DATA Offs=0000C8 Size=000000 Align=00001 Fill=0000 + ZEROPAGE Offs=000000 Size=000000 Align=00001 Fill=0000 + NULL Offs=000000 Size=000000 Align=00001 Fill=0000 +world.o: + CODE Offs=000395 Size=000064 Align=00001 Fill=0000 + RODATA Offs=000000 Size=000000 Align=00001 Fill=0000 + BSS Offs=000000 Size=000000 Align=00001 Fill=0000 + DATA Offs=0000C8 Size=000000 Align=00001 Fill=0000 + ZEROPAGE Offs=000000 Size=000000 Align=00001 Fill=0000 + NULL Offs=000000 Size=000000 Align=00001 Fill=0000 + + +Segment list: +------------- +Name Start End Size Align +---------------------------------------------------- +NULL 000000 000000 000000 00001 +ZEROPAGE 000000 000000 000000 00001 +CODE 000803 000BFB 0003F9 00001 +DATA 000BFC 000CC3 0000C8 00001 +RODATA 000BFC 000BFC 000000 00001 +BSS 000CC4 000CC4 000000 00001 + + +Exports list by name: +--------------------- +TILES 000904 RLA World 000B98 RLA +__BSS_LOAD__ 000CC4 LA __BSS_RUN__ 000CC4 LA +__BSS_SIZE__ 000000 EA __FILETYPE__ 000006 EA +__MAIN_FILEOFFS__ 000000 EA __MAIN_LAST__ 000CC4 RLA +__MAIN_SIZE__ 00B7FD EA __MAIN_START__ 000803 LA +draw 000865 RLA + + +Exports list by value: +---------------------- +__BSS_SIZE__ 000000 EA __MAIN_FILEOFFS__ 000000 EA +__FILETYPE__ 000006 EA __MAIN_START__ 000803 LA +draw 000865 RLA TILES 000904 RLA +World 000B98 RLA __MAIN_LAST__ 000CC4 RLA +__BSS_LOAD__ 000CC4 LA __BSS_RUN__ 000CC4 LA +__MAIN_SIZE__ 00B7FD EA + + +Imports list: +------------- +TILES (tiles.o): + display.o src/tiles.inc(1) +World (world.o): + main.o src/world.inc(1) +__BSS_LOAD__ ([linker generated]): +__BSS_RUN__ ([linker generated]): +__BSS_SIZE__ ([linker generated]): +__FILETYPE__ ([linker generated]): +__MAIN_FILEOFFS__ ([linker generated]): +__MAIN_LAST__ ([linker generated]): + [linker generated] C:\Users\bslat\Downloads\cc65-snapshot-win32\cfg/apple2-asm.cfg(13) + [linker generated] C:\Users\bslat\Downloads\cc65-snapshot-win32\cfg/apple2-asm.cfg(13) +__MAIN_SIZE__ ([linker generated]): +__MAIN_START__ ([linker generated]): +draw (display.o): + main.o src\main.asm(5) + diff --git a/src/display.asm b/src/display.asm new file mode 100644 index 0000000..8ae4699 --- /dev/null +++ b/src/display.asm @@ -0,0 +1,122 @@ +.include "monitor.inc" +.include "display.inc" +.include "tiles.inc" +.include "world.inc" + +.export draw + +.import World + +.CODE + +.define GRID_WIDTH $0A +.define GRID_HEIGHT $0A +.define PLAYER_X GRID_WIDTH/2 +.define PLAYER_Y GRID_HEIGHT/2 + + +.define ADDR_1 $19 +.define ADDR_2 $1B +.define TILE2D $abc + +draw: ldx TILENUM ;num + lda TILES, X + sta patch_1+1 + sta patch_2+1 + sta patch_3+1 + sta patch_4+1 + sta patch_5+1 + sta patch_6+1 + sta patch_7+1 + sta patch_8+1 + + lda TILES+1, X + sta patch_1+2 + sta patch_2+2 + sta patch_3+2 + sta patch_4+2 + sta patch_5+2 + sta patch_6+2 + sta patch_7+2 + sta patch_8+2 + + ldx #00 + ldy TILECD + lda HGR_GRID,Y + sta ADDR_1 + clc + adc #$80 + sta ADDR_2 + lda HGR_GRID+1,Y + sta ADDR_1+1 + sta ADDR_2+1 + .define ITER1 #$20 +lin1t8: ldy #00 +patch_1: + lda TILE2D,X + sta (ADDR_1),Y + inx + iny +patch_2: + lda TILE2D,X + sta (ADDR_1),Y + inx + iny +patch_3: + lda TILE2D,X + sta (ADDR_1),Y + inx + iny +patch_4: + lda TILE2D,X + sta (ADDR_1),Y + inx + iny + lda ADDR_1+1 + adc #$04 + sta ADDR_1+1 + cpx ITER1 + bne lin1t8 + clc + .define ITER2 #$40 +lin916: ldy #00 +patch_5: + lda TILE2D,X + sta (ADDR_2),Y + inx + iny +patch_6: + lda TILE2D,X + sta (ADDR_2),Y + inx + iny +patch_7: + lda TILE2D,X + sta (ADDR_2),Y + inx + iny +patch_8: + lda TILE2D,X + sta (ADDR_2),Y + inx + iny + lda ADDR_2+1 + adc #$04 + sta ADDR_2+1 + cpx ITER2 + bne lin916 + rts + +.DATA + +HGR_GRID: +.word $2000, $2004, $2008, $200C, $2010, $2014, $2018, $201C, $2020, $2024 +.word $2100, $2104, $2108, $210C, $2110, $2114, $2118, $211C, $2120, $2124 +.word $2200, $2204, $2208, $220C, $2210, $2214, $2218, $221C, $2220, $2224 +.word $2300, $2304, $2308, $230C, $2310, $2314, $2318, $231C, $2320, $2324 +.word $2028, $202C, $2030, $2034, $2038, $203C, $2040, $2044, $2048, $204C +.word $2128, $212C, $2130, $2134, $2138, $213C, $2140, $2144, $2148, $214C +.word $2228, $222C, $2230, $2234, $2238, $223C, $2240, $2244, $2248, $224C +.word $2328, $232C, $2330, $2334, $2338, $233C, $2340, $2344, $2348, $234C +.word $2050, $2054, $2058, $205C, $2060, $2064, $2068, $206C, $2070, $2074 +.word $2150, $2154, $2158, $215C, $2160, $2164, $2168, $216C, $2170, $2174 \ No newline at end of file diff --git a/src/display.inc b/src/display.inc new file mode 100644 index 0000000..5c1d314 --- /dev/null +++ b/src/display.inc @@ -0,0 +1,4 @@ +; stuff + +.define TILECD $1D +.define TILENUM $1E \ No newline at end of file diff --git a/src/display.o b/src/display.o new file mode 100644 index 0000000000000000000000000000000000000000..5ff3c646dc9af2238bd27b8921c16a9c93787e0a GIT binary patch literal 2312 zcmX}t&2v*_6bA5fZa$i3%FsfEv`sNB1*-HTO+y+m(v&7N#Xw`fDS{sz;etjjkV)= z(trN=%kMs)^Kalq@#_xnw~zlWei`*W_~vj)N#`X&D24<=BAID=^8qZ1@(TT(-_X`aL;1@cn7ru>5`kWf2K=F zN8ObDGaW^ma#QxtG=;R&P1!%wPNd6j%Kn)yBb|0r_Rn-0=>a!o|4a{v^M&YjaUS>T zjOh335AJ!?FU}`j8Wj!co8nYI)>aF8^aM`G1$EEkek?glyY-kE)>p;(T=a-|p8gQj z9&tYH(k{_IbYAqCo^<0gj1MAiM?B@mml<~>zKS^F#`_uXL!3Z7BF{Z=l~sz=z=&yG)m(%NmDdUGc-r@bg)n7Y%h({I8D+NP16j`(L5dO z*IC<3qcl#FG)2=iLvu7w2ajsf_R=Vg(38;E+Y?8J^opIf(S^tB zCO86$;2p38hCu;@K@?mBcv?vfRSxiP2Gu0!2d{v$;5fKrLw3PiSgwH6U>YPr9?XG+ z4cP`+EZ+uoEU$xiu^b1BU<{~uM5e5eIF_%0Ls;HGbpZ^35pWIkfhy<)@7a)9R26_n zEPo8;bu7RX)6XBU{=zO_@UFk3<8t?ZO<`$l%FcW<<8m+KpwrLo2wYs}+~Io_C0 zHReQPo@mU;KyGHfG&4V&@z<(bWA!Aa(_;zm^js$EpP$Q2ElzpPEi8CZ1lF?ibA_py LtoPDVJ}>eg53e%b literal 0 HcmV?d00001 diff --git a/src/factory.cfg b/src/factory.cfg new file mode 100644 index 0000000..6ca72ab --- /dev/null +++ b/src/factory.cfg @@ -0,0 +1,24 @@ +# Configuration for assembler programs which don't need a special setup + +FEATURES { + STARTADDRESS: default = $0803; +} +SYMBOLS { + __EXEHDR__: type = import; +} +MEMORY { + ZP: file = "", start = $0000, size = $00FF; + HEADER: file = %O, start = %S - 4, size = $0004; + MAIN: file = %O, define = yes, start = %S, size = $C000 - %S; + BSS: file = "", start = __MAIN_LAST__, size = $C000 - __MAIN_LAST__; +} +SEGMENTS { + ZEROPAGE: load = ZP, type = zp, optional = yes; + EXEHDR: load = HEADER, type = ro; + CODE: load = MAIN, type = rw; + RODATA: load = MAIN, type = ro, optional = yes; + DATA: load = MAIN, type = rw, optional = yes, align = $100; + BSS: load = BSS, type = bss, optional = yes, define = yes, align = $100; + # user defined segments + TILES: load = MAIN, type = ro, align = $100; +} diff --git a/src/main.asm b/src/main.asm new file mode 100644 index 0000000..9322aa4 --- /dev/null +++ b/src/main.asm @@ -0,0 +1,64 @@ +.include "monitor.inc" +.include "display.inc" +.include "world.inc" + +.import draw +.import World + +.CODE + +_main: + jsr HGR + jsr BKGND +loop: jsr view + jsr update + jsr _delay; + jmp loop; + +view: ldx #00 +view1: lda World,x + sta TILENUM + txa + asl + sta TILECD + jsr draw + lda TILECD + lsr + tax + inx + cpx #100 + bne view1 + rts + +update: ldx #00 +update1:lda World,x +ckconv: cmp #02 + beq upconv + cmp #04 + beq upconv + cmp #06 + beq upconv2 +ckasmb: + inx + cpx #100 + bne update1 + rts + +upconv: clc + adc #02 + sta World,x + jmp ckasmb + +upconv2:lda #02 + sta World,x + jmp ckasmb +_delay: + lda #00 + ldx #00 +_delay1:adc #01 + cmp #$ff + bne _delay1 + inx + cpx #$ff + bne _delay1 + rts \ No newline at end of file diff --git a/src/main.o b/src/main.o new file mode 100644 index 0000000000000000000000000000000000000000..bfc7e90b53321c8cadd73465a2e69f4fdbf2958a GIT binary patch literal 1109 zcmYL{$xl;J6vofFeeXd_p-hD`6kbJUD72KKqB2NBVj3Y#4rx+KTay=QO8_CV6Ng0q z2R9B2jZ3#CY+0E22e>dUl&A|60wiwmd=G-nJHPvV=e&3B&^y1CPgM}nqJ&ezl4y{4 zEV08x6N(7+c^Sphf{gOeZ9%mpat@;J;%Bv!`mNLV=1#p*j?texUw-JCx@#UKKIz(r z*9VDL{rc1Qhlv4W#CeqP7|*0p4K1-6Cx`iMpB*wB?sGk{$)<}R(Zfoaf=zk2()L~O zmGIrRpMmctjs3-GuCN#BkzUL}S->&-FxMdQUto`$WdX-rf@CrA0kFtzIJ#PyL=lwlOx2yKdQogw z<)+|NRk7?jtcp}kL{m<0K)$1)Iyp&d0;=Fkpn8EupdYY*BT(lcJAtdPZ2+zp=@N7i z3Ri$GK$QVezzc)`Cb@_a5i|^21Gs_nKtO`Zq459G6`)jt2BBO~tx!WywNRr#7tjIp z0AaubGyr`PbP1@3ZGmcs@&U~NPLM7`bpws$N+!pqr{l43GU;AhO($|GD<4d)<$UQ> zbkJM~2SY<5O+AU;dT`C!%4*An!iu(GWjBrcE1A@K)<|Zu(m+QlRCJOH8R>iJLViPD!5~=- tVadw+mWock2x-@*CSu0S)Wq1_m}7i)R)Z+M6PuZu9-EA5H|FDUqJLykq4od( literal 0 HcmV?d00001 diff --git a/src/monitor.inc b/src/monitor.inc new file mode 100644 index 0000000..9e9cb47 --- /dev/null +++ b/src/monitor.inc @@ -0,0 +1,190 @@ +; Copyright (C) 2018 Christophe Meneboeuf +; +; This program is free software: you can redistribute it and/or modify +; it under the terms of the GNU General Public License as published by +; the Free Software Foundation, either version 3 of the License, or +; (at your option) any later version. +; +; This program is distributed in the hope that it will be useful, +; but WITHOUT ANY WARRANTY; without even the implied warranty of +; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +; GNU General Public License for more details. +; +; You should have received a copy of the GNU General Public License +; along with this program. If not, see . + + +; ****************************************************** +; This file contains aliases for Montitor's and Applesoft's routines +; ****************************************************** + +; ++++ ZERO PAGE ++++ + +.define WNDLFT $20 ; $20 Left edge of text window +.define WNDWDTH WNDLFT+1 ; $21 Width of text window +.define WNDTOP WNDWDTH+1 ; $22 Top of text window +.define WNDBTM WNDTOP+1 ; $23 Bottom+1 of text window +.define CH WNDBTM+1 ; $24 Cursor horizontal position +.define CV CH+1 ; $25 Cursor vertical position +.define BASL $28 ; $28 Text base address +.define BASH BASL+1 ; $29 +.define INVFLG $32 ; $32 Normal/Inverse/Flash +.define PROMPT INVFLG+1 ; $33 Prompt character +.define CSWL $36 ; $36 Character output hook +.define CSWH CSWL+1 ; $37 +.define KSWL CSWH+1 ; $38 Character input hook +.define KSWH KSWL+1 ; $39 + + +; ++++ Monitor ++++ + +.define INIT $fb2f ; Initialize text screen +.define SETTXT $fb39 ; Set text mode +.define SETWND $fb4b ; Set text window size +.define SETWND2 $fb51 ; Set text window width and bottom size +.define TABV $fb5b ; Vertical tab +.define BASCALC $fbc1 ; Text base-address calculator +.define STORADV $fbf0 ; Place a printable character on the screen +.define ADVANCE $fbf4 ; Increment the cursor position +.define VIDOUT $fbfd ; Place a character on the screen +.define VTAB $fc22 ; Vertical tab +.define VTABZ $fc24 ; Vertical tab (alternate entry) +.define HOME $fc58 ; Home cursor and clear to end of page +.define RDKEY $fd0c ; Get an input character +.define CROUT $fd8e ; Issue a carriage return +.define PRBYTE $fdda ; Print a hexadecimal byte +.define COUT $fded ; Output a character +.define COUT1 $fdf0 ; Output a character to the screen +.define SETINV $fe80 ; Set inverse text mode +.define SETNORM $fe84 ; Set normal text mode +.define SETKBD $fe89 ; Reset input to keyboard +.define SETVID $fe93 ; Reset output to screen + + +; ++++ HIRES GFX ++++ + +; Colors +; SET #1 +.define BLACK1 $0 +.define GREEN $1 +.define VIOLET $2 +.define WHITE1 $3 +; SET #2 +.define BLACK2 $4 +.define ORANGE $5 +.define BLUE $6 +.define WHITE2 $7 + +.define HGR $F3E2 +; Initializes to hi-res page 1, clears screen. + +.define HGR2 $F3D8 +; Initializes to hi-res page 2, clears screen. + +.define HCLR $F3F2 +; Clears current screen to black1. + +.define BKGND $F3F6 +; Clears current screen to last plotted HCOLOR. + +.define HCOLOR $F6F0 +; Sets HCOLOR to contents of X-Register (0−7). + +.define HPOSN $F411 +; Positions hi-res “cursor” without plotting. Enter with +; X, Y (low, high) = horizontal position, Accumulator = +; vertical position. + +.define HPLOT $F457 +; Identical to HPOSN, but plots current HCOLOR at coordinates +; given. + +.define HFIND $F5CB +; Returns current “cursor” position. Useful after aDRAW +; to find where you’ve been left. Coordinates returned in: +; $E0, $E1 = horizontal (low,high), $E2 = vertical. + +.define HLIN $F53A +; Draws a line from last plot to point given. Accumulator, +; X (low, high) = horizontal, Y = vertical position. + +.define SHNUM $F730 +; Puts address of shape number indicated by X-Register +; into$1A,$1B; returns with X, Y (low, high) also set to +; address of that shape-table entry. + +.define DRAW $F601 +; Draw shape pointed to by X, Y (low, high) in current +; HCOLOR. Note: X, Y point to specific entry,not the +; beginning of the table. Call SHNUM first + +.define XDRAW $F65D +; Erases shape just drawn (if there) by doing anexclusive +; OR with the screen data. Load X, Y (low, high) with +; address of shape toXDRAW or callSHNUM first with XRegister +; = shape numbe + + +; *********** STRINGS ************* + +.define GETSPACE $E452 +; Reduces the start-of-strings +; pointer, FRETOP ($6F), by the +; number specified in the A-register +; (the string length) and sets up +; FRESPC ($71) so that it equals +; FRETOP. After this has been done, +; A remains unaffected and Y (high) +; and X (low) point to the beginning +; of the space. The string can +; then be moved into place in upper +; memory by using MOVESTR. + + +.define GARBAGE $E484 +; Clears out old string definitions +; that are no longer being used and +; adjusts FRETOP {$6F) accordingly. +; (Each time that a string is +; redefined, its old definition is kept +; in memory but is not used.) This +; process is called "garbage collection" +; and is performed automatically +; whenever the start-ofstrings +; address, FRETOP, comes +; close to the end-of-variables address, +; STREND {$6D). + + +.define MOVESTR $E5E2 +; Copies the string that is pointed +; to by Y (high) and X (low) and +; that has a length of A to the location +; pointed to by FRESPC +; ($71). + + +.define FOUT $ED34 +; Converts the FAC into an ASCII +; character string that represents +; the number in decimal form (like +; Applesoft's STR$ function). The +; string is followed by a $00 byte +; and is pointed to by Y (high) and +; A (low) so that STROUT can be +; used to print the string. + + +.define STROUT $DB3A +; Prints the string pointed to by Y +; (high) and A (low). The string must +; be followed immediately by a $00 +; or a $22 byte. All of these conditions +; are set up by FOUT. + + +.define STRPRT $DB3D +; Prints the string whose 3-byte descriptor +; is pointed to by $A0/$A1. +; FRMEVL sets up such a pointer +; when calculating string formulas. diff --git a/src/tiles.asm b/src/tiles.asm new file mode 100644 index 0000000..6ba79c5 --- /dev/null +++ b/src/tiles.asm @@ -0,0 +1,187 @@ +.export TILES + +TILES: +.word GRASS, CONVEYOR1_1, CONVEYOR1_2, CONVEYOR1_3 +.word INSERTER1_1, INSERTER1_2, INSERTER1_3,ASSEMBLER1_1 +.word ASSEMBLER1_2, ASSEMBLER1_3 + + +GRASS: +.byte $6a, $55, $2a, $57 +.byte $6b, $55, $2a, $57 +.byte $2e, $55, $3a, $55 +.byte $2e, $55, $2e, $55 +.byte $2e, $55, $2e, $55 +.byte $2a, $55, $2e, $55 +.byte $2a, $55, $2a, $55 +.byte $2b, $57, $2a, $55 +.byte $2a, $57, $2a, $75 +.byte $3a, $5f, $2a, $75 +.byte $2e, $5d, $3a, $75 +.byte $2e, $5d, $6a, $55 +.byte $2e, $55, $6a, $55 +.byte $2a, $55, $6a, $55 +.byte $2a, $57, $2a, $55 +.byte $6a, $55, $2a, $5d + +CONVEYOR1_1: +.byte $0, $0, $0, $0 +.byte $0, $0, $0, $0 +.byte $0, $0, $0, $0 +.byte $0, $0, $0, $0 +.byte $0, $0, $0, $0 +.byte $0, $0, $0, $0 +.byte $0, $0, $0, $0 +.byte $0, $0, $0, $0 +.byte $0, $0, $0, $0 +.byte $aa, $d5, $aa, $d5 +.byte $a0, $d5, $a0, $d5 +.byte $82, $d5, $82, $d5 +.byte $8a, $d4, $8a, $d4 +.byte $82, $d5, $82, $d5 +.byte $a0, $d5, $a0, $d5 +.byte $aa, $d5, $aa, $d5 + +CONVEYOR1_2: +.byte $0, $0, $0, $0 +.byte $0, $0, $0, $0 +.byte $0, $0, $0, $0 +.byte $0, $0, $0, $0 +.byte $0, $0, $0, $0 +.byte $0, $0, $0, $0 +.byte $0, $0, $0, $0 +.byte $0, $0, $0, $0 +.byte $0, $0, $0, $0 +.byte $aa, $d5, $aa, $d5 +.byte $8a, $d4, $8a, $d4 +.byte $aa, $d0, $aa, $d0 +.byte $aa, $c1, $aa, $c1 +.byte $aa, $d0, $aa, $d0 +.byte $8a, $d4, $8a, $d4 +.byte $aa, $d5, $aa, $d5 + +CONVEYOR1_3: +.byte $0, $0, $0, $0 +.byte $0, $0, $0, $0 +.byte $0, $0, $0, $0 +.byte $0, $0, $0, $0 +.byte $0, $0, $0, $0 +.byte $0, $0, $0, $0 +.byte $0, $0, $0, $0 +.byte $0, $0, $0, $0 +.byte $0, $0, $0, $0 +.byte $aa, $d5, $aa, $d5 +.byte $aa, $c1, $aa, $c1 +.byte $aa, $85, $aa, $85 +.byte $a8, $95, $a8, $95 +.byte $aa, $85, $aa, $85 +.byte $aa, $c1, $aa, $c1 +.byte $aa, $d5, $aa, $d5 + +INSERTER1_1: +.byte $80, $84, $a0, $80 +.byte $80, $84, $a0, $80 +.byte $80, $84, $a0, $80 +.byte $80, $84, $a0, $80 +.byte $80, $94, $a8, $80 +.byte $80, $d0, $8a, $80 +.byte $80, $c0, $82, $80 +.byte $80, $c0, $82, $80 +.byte $80, $c0, $82, $80 +.byte $80, $c0, $82, $80 +.byte $80, $c0, $82, $80 +.byte $80, $c0, $82, $80 +.byte $80, $d0, $8a, $80 +.byte $80, $d0, $8a, $80 +.byte $80, $d0, $8a, $80 +.byte $aa, $d5, $aa, $d5 + +INSERTER1_2: +.byte $80, $80, $80, $80 +.byte $80, $80, $80, $80 +.byte $80, $80, $80, $80 +.byte $80, $80, $80, $80 +.byte $80, $80, $80, $80 +.byte $aa, $80, $80, $80 +.byte $a0, $81, $80, $80 +.byte $80, $d5, $82, $80 +.byte $80, $d5, $82, $80 +.byte $a0, $c1, $82, $80 +.byte $aa, $c0, $82, $80 +.byte $80, $c0, $82, $80 +.byte $80, $d0, $8a, $80 +.byte $80, $d0, $8a, $80 +.byte $80, $d0, $8a, $80 +.byte $aa, $d5, $aa, $d5 + +INSERTER1_3: +.byte $80, $80, $80, $80 +.byte $80, $80, $80, $80 +.byte $80, $80, $80, $80 +.byte $80, $80, $80, $80 +.byte $80, $80, $80, $80 +.byte $80, $80, $80, $d4 +.byte $80, $80, $80, $85 +.byte $80, $c0, $aa, $81 +.byte $80, $c0, $aa, $81 +.byte $80, $c0, $82, $85 +.byte $80, $c0, $82, $d4 +.byte $80, $c0, $82, $80 +.byte $80, $d0, $8a, $80 +.byte $80, $d0, $8a, $80 +.byte $80, $d0, $8a, $80 +.byte $aa, $d5, $aa, $d5 + +ASSEMBLER1_1: +.byte $d5, $aa, $d5, $aa +.byte $d5, $aa, $d5, $aa +.byte $f5, $ff, $ff, $af +.byte $f5, $ff, $ff, $af +.byte $f5, $ff, $ff, $af +.byte $f5, $ff, $ab, $ad +.byte $f5, $fd, $fb, $ad +.byte $f5, $fd, $fb, $ad +.byte $a5, $d5, $fb, $ad +.byte $f5, $fd, $fb, $ad +.byte $f5, $fd, $ab, $ad +.byte $f5, $ff, $ff, $af +.byte $f5, $ff, $ff, $af +.byte $f5, $ff, $ff, $af +.byte $d5, $aa, $d5, $aa +.byte $d5, $aa, $d5, $aa + +ASSEMBLER1_2: +.byte $d5, $aa, $d5, $aa +.byte $d5, $aa, $d5, $aa +.byte $f5, $ff, $ff, $af +.byte $f5, $ff, $ff, $af +.byte $f5, $ff, $ff, $af +.byte $f5, $ff, $ab, $ad +.byte $f5, $f7, $eb, $ad +.byte $a5, $f7, $eb, $ad +.byte $f5, $fd, $eb, $ad +.byte $b5, $d7, $eb, $ad +.byte $b5, $ff, $ab, $ad +.byte $f5, $ff, $ff, $af +.byte $f5, $ff, $ff, $af +.byte $f5, $ff, $ff, $af +.byte $d5, $aa, $d5, $aa +.byte $d5, $aa, $d5, $aa + +ASSEMBLER1_3: +.byte $d5, $aa, $d5, $aa +.byte $d5, $aa, $d5, $aa +.byte $f5, $ff, $ff, $af +.byte $f5, $ff, $ff, $af +.byte $f5, $ff, $ff, $af +.byte $f5, $ff, $ab, $ad +.byte $b5, $ff, $bb, $ad +.byte $b5, $d7, $bb, $ad +.byte $f5, $fd, $bb, $ad +.byte $a5, $f7, $bb, $ad +.byte $f5, $f7, $ab, $ad +.byte $f5, $ff, $ff, $af +.byte $f5, $ff, $ff, $af +.byte $f5, $ff, $ff, $af +.byte $d5, $aa, $d5, $aa +.byte $d5, $aa, $d5, $aa \ No newline at end of file diff --git a/src/tiles.inc b/src/tiles.inc new file mode 100644 index 0000000..562d36b --- /dev/null +++ b/src/tiles.inc @@ -0,0 +1 @@ +.import TILES \ No newline at end of file diff --git a/src/tiles.o b/src/tiles.o new file mode 100644 index 0000000000000000000000000000000000000000..e42c7b7b5a98797988b893cd7db1e4c985d565d2 GIT binary patch literal 4830 zcmZwL*_RaM9metZHw!@)oY#0hK0tf6$I#GZTDB1v>Sa~TG?QuHM zn(n3(MetOxZx|7aExBMjs700**#m4*6ks?_-E^V=$6%$k2OEU~9D|}2g6)Kra14sJ znof+tFcfVwNsL`e1v^3~#xA9T{Y-m2;--1n^BBi;7z(fxf?fT8*h!b8jV{NpR0W&v zkG-GncBbdJi7v-aeEsQ;F!wTII~=S5S*qGCbRtV-dt0kE+}2#N7lNIKES0T`sUk~N zd!9~YDYm-5C${EbTiMSX-&YlEy4OLZX<2_bAr%hxJFxtUIsAxgQA zLnA5>r94I_DiEc-OeZQ3L2S3NFCt5keaC;+>3-Au>F(v-a@ZHVet~D>V zSofUR0ctS;HArkju+QKE)F81N=)?u6!5OW?-rxnd<|a1ITyX(vkl61v>oa%4t+|OU zWcy9(q(tXV%FMdw#FkPwsgoLZJI6}2rq{H7tWzFsYrczGG+-)iB#8!iN^B3?X;LR8 z_EX=d%(^#;-N@V~byA{_8zoM-H8-(U!9ImasKFV1+$eFP=mAfu4aAg zPP#SstbI@YMR&rjxrseX-K0)RY&~6*Iw`Rsx+Zl}!=B)1h}JZhPBdUDoz%8t!-m_; zFHwsIcuMS5w$r3eO6==&P3ok?dgz+eNs0B+i3zB|S$mOAoP!#iwXbrB#5t%zVy|#4 z#W|?K8T}1%-0_@Sa}&FVT1-F<5*uVYP3ojXU-Fchb5&bXTa$b`rO8X}b1O(oLJbV0iU9?}B|`Z5=0--!l8M>ObmwM&n7i5wvayhhPVc zfzHetFM&RI8Yf*H42@yph&m5y=o?8x--#MSumpNR zw|N>%;a->z`(O_I-Cx$Xi^fB682F`zB0L5+1OF}1&Ai49z&{Pb2KcA1yqBoE91WfI zHJ*q2LH`5@K_^y?WiSgK1YOB$oO3&fx55f|!^=_P7eF^f8jr#%(1o7HCMdw|up9pD zujm3%;|ToKqpl}4wt#L%HM&9H5E{CR)Og4Jhx>Vo=iquc>*XHe06YxO!f|-dU%r#L z5{|(u@PWV5MZ5)crKr&kUx5Xn%WaKauo`Xx{@%hMe9K>c*Ii4o9bN>T?lp9Aq45aZ z2Rb!t=oU+38*GI|Fh9&19qrw`xv$hcIy!g!$etZX_aEFhUfex?Xu+P{%a?U+=`Jo= z(Y3g1-TtFp%a<*2M0R{Gq;xp R`ZxEkD|Kud?$h7a{{Z#%-gp22 literal 0 HcmV?d00001 diff --git a/src/world.asm b/src/world.asm new file mode 100644 index 0000000..2f263c7 --- /dev/null +++ b/src/world.asm @@ -0,0 +1,13 @@ +.export World + +World: +.byte 02, 00, 00, 00, 00, 00, 00, 00, 00, 00 +.byte 00, 00, 00, 00, 00, 00, 00, 00, 00, 00 +.byte 00, 02, 02, 02, 14, 02, 02, 02, 00, 00 +.byte 00, 00, 00, 00, 00, 00, 00, 00, 00, 00 +.byte 00, 00, 00, 00, 00, 00, 00, 00, 00, 00 +.byte 00, 00, 00, 00, 00, 00, 00, 00, 00, 00 +.byte 00, 00, 00, 00, 00, 00, 00, 00, 00, 00 +.byte 00, 00, 00, 00, 00, 00, 00, 00, 00, 00 +.byte 00, 00, 00, 00, 00, 00, 00, 00, 00, 00 +.byte 00, 00, 00, 00, 00, 00, 00, 00, 00, 00 \ No newline at end of file diff --git a/src/world.inc b/src/world.inc new file mode 100644 index 0000000..6b8238b --- /dev/null +++ b/src/world.inc @@ -0,0 +1 @@ +.import World diff --git a/src/world.o b/src/world.o new file mode 100644 index 0000000000000000000000000000000000000000..304c74c18e1165e6a76aafa18c22e67e172e9a68 GIT binary patch literal 857 zcmb7?%}T>S6ov0he%hvq;LeSZ7ckIR>(;al-2_uwYefn%G%f=EU?T|K`X>4SqAQm^ zh&vZ9+zNs#&rP%G&KYvQduHa|NywbZ@+#dVqBBGTkt6De8$?SIJs<@1BeISBgp7w? zfG+Yk@*H`pt?HgJ=lYXsE~R$x_4fX02-(~InSE&HFSbp}gv>}tVWC=RFJN^w5-l*Y=Bs@?$ty1t_r7S2> z?l#Lc60bt)_s~sL5II<`1{