mirror of
https://github.com/bman12three4/Factory-Game.git
synced 2024-06-02 06:41:29 +00:00
Initial commit
This commit is contained in:
commit
de94366b06
2
.gitattributes
vendored
Normal file
2
.gitattributes
vendored
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
# Auto detect text files and perform LF normalization
|
||||||
|
* text=auto
|
17
Makefile
Normal file
17
Makefile
Normal file
|
@ -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\
|
BIN
bin/factory.a2
Normal file
BIN
bin/factory.a2
Normal file
Binary file not shown.
BIN
factory.dsk
Normal file
BIN
factory.dsk
Normal file
Binary file not shown.
38
factory.list
Normal file
38
factory.list
Normal file
|
@ -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
|
83
factory.map
Normal file
83
factory.map
Normal file
|
@ -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)
|
||||||
|
|
122
src/display.asm
Normal file
122
src/display.asm
Normal file
|
@ -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
|
4
src/display.inc
Normal file
4
src/display.inc
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
; stuff
|
||||||
|
|
||||||
|
.define TILECD $1D
|
||||||
|
.define TILENUM $1E
|
BIN
src/display.o
Normal file
BIN
src/display.o
Normal file
Binary file not shown.
24
src/factory.cfg
Normal file
24
src/factory.cfg
Normal file
|
@ -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;
|
||||||
|
}
|
64
src/main.asm
Normal file
64
src/main.asm
Normal file
|
@ -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
|
BIN
src/main.o
Normal file
BIN
src/main.o
Normal file
Binary file not shown.
190
src/monitor.inc
Normal file
190
src/monitor.inc
Normal file
|
@ -0,0 +1,190 @@
|
||||||
|
; Copyright (C) 2018 Christophe Meneboeuf <christophe@xtof.info>
|
||||||
|
;
|
||||||
|
; 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 <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
|
||||||
|
; ******************************************************
|
||||||
|
; 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.
|
187
src/tiles.asm
Normal file
187
src/tiles.asm
Normal file
|
@ -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
|
1
src/tiles.inc
Normal file
1
src/tiles.inc
Normal file
|
@ -0,0 +1 @@
|
||||||
|
.import TILES
|
BIN
src/tiles.o
Normal file
BIN
src/tiles.o
Normal file
Binary file not shown.
13
src/world.asm
Normal file
13
src/world.asm
Normal file
|
@ -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
|
1
src/world.inc
Normal file
1
src/world.inc
Normal file
|
@ -0,0 +1 @@
|
||||||
|
.import World
|
BIN
src/world.o
Normal file
BIN
src/world.o
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user