From 7c90129e9b4addea53cc173ddf9b1e756a74d0d6 Mon Sep 17 00:00:00 2001 From: Christophe Meneboeuf Date: Fri, 16 Apr 2021 23:50:38 +0200 Subject: [PATCH] auto loader --- escape.dsk | Bin 143360 -> 143360 bytes scripts/add-to-disk.sh | 10 +- src/actors/reactions.asm | 133 +++++++++++++++++ src/builder/actors.asm | 107 +++++++++++++ src/builder/actors.inc | 7 + src/builder/actors_private.inc | 7 + src/common.inc | 17 +++ src/escape.cfg | 6 +- src/main.asm | 22 ++- src/world/level.asm | 265 +++++++++++++++++++++++++++++++++ src/world/level.inc | 27 ++++ src/world/level_private.inc | 42 ++++++ src/world/world.asm | 154 +++++++++++++++++++ src/world/world.inc | 57 +++++++ 14 files changed, 846 insertions(+), 8 deletions(-) create mode 100644 src/actors/reactions.asm create mode 100644 src/builder/actors.asm create mode 100644 src/builder/actors.inc create mode 100644 src/builder/actors_private.inc create mode 100644 src/common.inc create mode 100644 src/world/level.asm create mode 100644 src/world/level.inc create mode 100644 src/world/level_private.inc create mode 100644 src/world/world.asm create mode 100644 src/world/world.inc diff --git a/escape.dsk b/escape.dsk index aaa068e50b5ba031e78bdf887875bf866c629970..19b2a125a50fe3ad9f59bedc7b90d1237dc5b379 100644 GIT binary patch delta 3979 zcmc&$eRNdC6`y%8*^lfdgc4xizTIU42m~reA$TJ4kpx16Suq-{)q<>r6;~oC(PQz@ z=JPE}lD7#vqEK8K7GKOu4F%&z5x3;XhuMH}J+^vIJszoX(+&A(jt2@&NVfOAO)ws{ z{mawYvom+@{mr~P^Sg6r$}Z{3F6oZz*aS8fi?teAPIo_xG{}VKhsDA$9=?HZpogy&E8iy?`dZ=i9-aQD#@(@NB@J$#|VDvdd21cz%42~ts zGX+kz31%4yyzCGx(0&U4Psm1{{C%d|R1-BPM{NiSB@ zV9vZ&hGB3kvuf19yMr;e3;EHWX!vtSAQnU(KdR~oUjxB+uj$T|WEqLLhRDg}eV#NM z$vOS8E!D3%tI4}Y@=g-jn$&{YQisLVH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r~^TS9NuPbQA2?M~=Z+2X+HBwHUgDNzKP z1R9XF-6Q_3fum~4Yg-nBT$etT3{yw|s)nL#AfRg|&j^si2yDMb1WMzfG`^w!8n}1s zmp*H_rT4_re~N+?-ROxm*n2#&HY4l+&e66s9+rQ8>6k4`3|5$ky995G47x;by9*ay ze*l}~ehrG~s%SPen5~7ZJIZsHJ{tv%CcY#&l +; +; 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 . + + +.include "../world/level.inc" +.include "../io/textio.inc" +.include "../common.inc" + +.export Reactions_lsb +.export Reactions_msb +.export ReactionStairUp +.export ReactionStairDown + +.DATA + +STR_REATION_WALL: ASCIIZ "YOU HIT A WALL" +STR_REATION_STAIR_UP: ASCIIZ "YOU GO UPSTAIRS TO THE PREVIOUS LEVEL" +STR_REATION_STAIR_DOWN: ASCIIZ "YOU GO DOWNSTAIRS TO THE NEXT LEVEL" + +.align 256 + +; functions address seperated in LSB / MSB to use the same X/Y offset +Reactions_lsb: +.byte 0, ReactionFloor, >ReactionFloor, >ReactionFloor, >ReactionFloor, >ReactionFloor, >ReactionFloor, >ReactionStairDown +.byte >ReactionStairUp, >ReactionWall, >ReactionWall, >ReactionWall, >ReactionWall, 0, 0, 0 +.byte 0, 0, 0, 0, 0, 0, 0, 0 +.byte 0, 0, 0, 0, 0, 0, 0, 0 +.byte 0, 0, 0, 0, 0, 0, 0, 0 +.byte 0, 0, 0, 0, 0, 0, 0, 0 +.byte 0, 0, 0, 0, 0, 0, 0, 0 +.byte 0, 0, 0, 0, 0, 0, 0, 0 +.byte 0, 0, 0, 0, 0, 0, 0, 0 +.byte 0, 0, 0, 0, 0, 0, 0, 0 +.byte 0, 0, 0, 0, 0, 0, 0, 0 +.byte 0, 0, 0, 0, 0, 0, 0, 0 +.byte 0, 0, 0, 0, 0, 0, 0, 0 +.byte 0, 0, 0, 0, 0, 0, 0, 0 +.byte 0, 0, 0, 0, 0, 0, 0, 0 +.byte 0, 0, 0, 0, 0, 0, 0, 0 +.byte 0, 0, 0, 0, 0, 0, 0, 0 +.byte 0, 0, 0, 0, 0, 0, 0, 0 +.byte 0, 0, 0, 0, 0, 0, 0, 0 +.byte 0, 0, 0, 0, 0, 0, 0, 0 +.byte 0, 0, 0, 0, 0, 0, 0, 0 +.byte 0, 0, 0, 0, 0, 0, 0, 0 +.byte 0, 0, 0, 0, 0, 0, 0, 0 +.byte 0, 0, 0, 0, 0, 0, 0, 0 +.byte 0, 0, 0, 0, 0, 0, 0, 0 +.byte 0, 0, 0, 0, 0, 0, 0, 0 +.byte 0, 0, 0, 0, 0, 0, 0, 0 +.byte 0, 0, 0, 0, 0, 0, 0, 0 +.byte 0, 0, 0, 0, 0, 0, 0, 0 +.byte 0, 0, 0, 0, 0, 0, 0, 0 +.byte 0, 0, 0, 0, 0, 0, 0, 0 +.byte 0, 0, 0, 0, 0, 0, 0, 0 + + +.CODE + +ReactionFloor: + lda TRUE + rts + +ReactionWall: + PRINT STR_REATION_WALL + lda FALSE + rts + +ReactionStairUp: + PRINT STR_REATION_STAIR_UP + lda CurrentLevel + sta NextLevel + inc NextLevel + lda TRUE + sta ExitLevel + lda FALSE + rts + +ReactionStairDown: + PRINT STR_REATION_STAIR_DOWN + lda CurrentLevel + sta NextLevel + dec NextLevel + lda TRUE + sta ExitLevel + lda FALSE + rts diff --git a/src/builder/actors.asm b/src/builder/actors.asm new file mode 100644 index 0000000..804b532 --- /dev/null +++ b/src/builder/actors.asm @@ -0,0 +1,107 @@ +.include "../common.inc" +.include "../random.inc" +.include "../memory.inc" +.include "../math.inc" +.include "../world/world.inc" +.include "actors_private.inc" + +.import Rooms +.import World +.import Compute_Maze_Addr + +; code +.export Place_Actors +; data +.export ActiveActor_Tiles + +.DATA + +ActiveActor_Tiles: .byte ACTORS::STAIR_UP, ACTORS::STAIR_DOWN, ACTORS::FLOOR_1 ; DEBUg: placeholder for future map +.CODE + +.define PTR_ROOM ZERO_2_1 ; 2 bytes +.define PTR_TILE ZERO_2_1 ; 2 bytes +; the two following defines must be the same as in Build_Level +.define ROOM_X ZERO_3 +.define ROOM_Y ZERO_2_4 +.define ROOM_W ZERO_2_5 +.define ROOM_H ZERO_2_6 +.define NB_ROOMS ZERO_9_9 +.define ACTOR ZERO_9_10 +; A : ACTOR +; X : NB_ROOMS +Place_Actors: + + sta ACTOR + stx NB_ROOMS + +loop_find_location: + + jsr Random8 + ldx NB_ROOMS + jsr Modulus + + ; sizeof(room_t) == 4 + asl + asl + clc + adc #Rooms + sta PTR_ROOM+1 + + ldy #0 + lda (PTR_ROOM), Y + sta ROOM_H + iny + lda (PTR_ROOM), Y + sta ROOM_W + iny + lda (PTR_ROOM), Y + sta ROOM_X + iny + lda (PTR_ROOM), Y + sta ROOM_Y + + ; x = room->x + rand() % (room->width - 2) + 1; + sec + lda ROOM_W + sbc #2 + sta ROOM_W + jsr Random8 + ldx ROOM_W + jsr Modulus + clc + adc ROOM_X + adc #1 + sta ROOM_X + + ; y = room->y + rand() % (room->height - 2) + 1; + sec + lda ROOM_H + sbc #2 + sta ROOM_H + jsr Random8 + ldx ROOM_H + jsr Modulus + clc + adc ROOM_Y + adc #1 + sta ROOM_Y + tay + + ldx ROOM_X + jsr Compute_Maze_Addr + stx PTR_TILE + sta PTR_TILE+1 + ldy #0 + lda (PTR_TILE), Y + cmp #ACTORS::FLOOR_2 + bne loop_find_location + + + lda ACTOR + sta (PTR_TILE), Y + + rts \ No newline at end of file diff --git a/src/builder/actors.inc b/src/builder/actors.inc new file mode 100644 index 0000000..2103e95 --- /dev/null +++ b/src/builder/actors.inc @@ -0,0 +1,7 @@ +.include "actors_private.inc" + +; code +.import Place_Actors + +; data +.import ActiveActor_Tiles diff --git a/src/builder/actors_private.inc b/src/builder/actors_private.inc new file mode 100644 index 0000000..d262bf6 --- /dev/null +++ b/src/builder/actors_private.inc @@ -0,0 +1,7 @@ +; @brief All kind of reactive actors that can be in a level +.enum eACTORSREACTIVE + AA_STAIRUP = 0 + AA_STAIRDOWN + AA_MAP + AA_NB +.endenum diff --git a/src/common.inc b/src/common.inc new file mode 100644 index 0000000..0393bbf --- /dev/null +++ b/src/common.inc @@ -0,0 +1,17 @@ +; Copyright (C) 2020 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 . + +.define TRUE #1 +.define FALSE #0 diff --git a/src/escape.cfg b/src/escape.cfg index cac66a7..816d3db 100644 --- a/src/escape.cfg +++ b/src/escape.cfg @@ -2,7 +2,7 @@ # APPLESOFT required # HGR1 & HGR2 segment reserved FEATURES { - STARTADDRESS: default = $0803; + STARTADDRESS: default = $0800; } SYMBOLS { __EXEHDR__: type = import; @@ -12,13 +12,15 @@ MEMORY { HEADER: file = %O, start = %S - 4, size = $0004; MAIN: file = %O, define = yes, start = %S, size = $2000 - %S; HGR: file = "", define = no, start = $2000, size = $4000; - DATA: file = %O, define = yes, start = $6000, size = $3000; + CODE2: file = %O, define = yes, start = $6000, size = $100; + DATA: file = %O, define = yes, start = __CODE2_LAST__,size = $3000; BSSMEM: file = "", define = no, start = __DATA_LAST__, size = $9600 - __DATA_LAST__; } SEGMENTS { ZEROPAGE: load = ZP, type = zp, optional = yes; EXEHDR: load = HEADER, type = ro; CODE: load = MAIN, type = rw; + CODE2: load = CODE2, type = rw, optional = yes; RODATA: load = DATA, type = ro, optional = yes, align = $100; DATA: load = DATA, type = rw, optional = yes, align = $100; BSS: load = BSSMEM, type = bss, optional = yes, define = yes, align = $100; diff --git a/src/main.asm b/src/main.asm index 186cde1..67264ae 100644 --- a/src/main.asm +++ b/src/main.asm @@ -33,19 +33,33 @@ .import __MAIN_LAST__ .import __DATA_START__ .import __DATA_SIZE__ - - +.import __CODE2_START__ +.import __CODE2_LAST__ .CODE _main: - ; Relocate DATA from its freshly loaded location to __DATA_START__ - ; computing DATA actual starting address lda #<__MAIN_LAST__ sta FROM lda #>__MAIN_LAST__ sta FROM+1 + lda #<__CODE2_START__ + sta TO + lda #>__CODE2_START__ + sta TO+1 + lda #<(__CODE2_LAST__ - __CODE2_START__) + sta SIZEL + lda #>(__CODE2_LAST__ - __CODE2_START__) + sta SIZEH + jsr memcpy + + ; Relocate DATA from its freshly loaded location to __DATA_START__ + ; computing DATA actual starting address + lda #<(__MAIN_LAST__ + __CODE2_LAST__ - __CODE2_START__) + sta FROM + lda #>(__MAIN_LAST__ + __CODE2_LAST__ - __CODE2_START__) + sta FROM+1 lda #<__DATA_START__ sta TO lda #>__DATA_START__ diff --git a/src/world/level.asm b/src/world/level.asm new file mode 100644 index 0000000..944fc20 --- /dev/null +++ b/src/world/level.asm @@ -0,0 +1,265 @@ + +; Copyright (C) 2021 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 . + +.include "../common.inc" +.include "../memory.inc" +.include "../random.inc" +.include "../builder/actors.inc" +.include "../builder/builder.inc" +.include "level_private.inc" + +; code +.export levels_init +.export level_enter +.export level_exit +; data +.export Levels +.export CurrentLevel +.export NextLevel +.export ExitLevel + +.import player_init + +.BSS + +CurrentLevel: .res 1 +NextLevel: .res 1 +ExitLevel: .res 1 + +.align 256 ; to be sure it is accessible with an offset +Levels: .res SIZEOF_CONF_LEVEL * NB_LEVELS + + + +.CODE + + +.define NR_ACTORS ZERO_4_1 +.define NR_LEVELS ZERO_4_2 +; TODO Load a configuration file from disk! +levels_init: + + ldx #0 + ldy #0 + lda #NB_LEVELS + sta NR_LEVELS + +level_conf_default: + ; level_nr + tya + iny + sta Levels, X + ; is_built + lda FALSE + sta Levels+1, x + ; seed + lda #0 + sta Levels+2, X + sta Levels+3, X + sta Levels+4, X + sta Levels+5, X + ; size + ; pos_player_enter + lda #$FF + sta Levels+7, X + sta Levels+8, X + ; actors + txa + clc + adc #9 + tax + lda #eACTORSREACTIVE::AA_NB + sta NR_ACTORS + lda #0 + + level_conf_actors: + sta Levels, X + inx + dec NR_ACTORS + bne level_conf_actors + + dec NR_LEVELS + bne level_conf_default + + ; level #0 + ldx #0 + lda #1 + sta Levels + 9 + eACTORSREACTIVE::AA_STAIRUP, X + lda #LEVELSIZE::TINY + sta Levels+6, X ; size + ; level #1 + clc + txa + adc #SIZEOF_CONF_LEVEL + tax + lda #1 + sta Levels + 9 + eACTORSREACTIVE::AA_STAIRUP, X + sta Levels + 9 + eACTORSREACTIVE::AA_STAIRDOWN, X + lda #LEVELSIZE::SMALL + sta Levels+6, X ; size + ; level #2 + clc + txa + adc #SIZEOF_CONF_LEVEL + tax + lda #1 + sta Levels + 9 + eACTORSREACTIVE::AA_STAIRUP, X + sta Levels + 9 + eACTORSREACTIVE::AA_STAIRDOWN, X + lda #LEVELSIZE::NORMAL + sta Levels+6, X ; size + ; level #3 + clc + txa + adc #SIZEOF_CONF_LEVEL + tax + lda #1 + sta Levels + 9 + eACTORSREACTIVE::AA_STAIRUP, X + sta Levels + 9 + eACTORSREACTIVE::AA_STAIRDOWN, X + lda #LEVELSIZE::BIG + sta Levels+6, X ; size + ; level #4 + clc + txa + adc #SIZEOF_CONF_LEVEL + tax + lda #1 + sta Levels + 9 + eACTORSREACTIVE::AA_STAIRDOWN, X + lda #LEVELSIZE::HUGE + sta Levels+6, X ; size + + ; global vars + lda #0 + sta CurrentLevel + lda FALSE + sta ExitLevel + + rts + + + +; @param: Uses NextLevel as level number +.define LEVEL_CONF_OFFSET ZERO_3 +level_enter: + + ; debug: + ; lda NextLevel + ; cmp #0 + ; bne debug_end + ; jsr Random8 + ; debug_end: + + jsr Random8_SaveRandomness + + ; get the level conf + lda #0 + ldx #0 + clc + get_level_conf: + tay + lda Levels, X + cmp NextLevel + beq end_idx_level + tya + adc #SIZEOF_CONF_LEVEL + tax + bcc get_level_conf + end_idx_level: + stx LEVEL_CONF_OFFSET + + ; init seed for the level if not already built + lda Levels+1, X ; is_built + cmp FALSE + bne end_init_seed + + jsr Random8 + ldx LEVEL_CONF_OFFSET + sta Levels+2, X ; seed[0] + jsr Random8 + ldx LEVEL_CONF_OFFSET + sta Levels+3, X ; seed[1] + jsr Random8 + ldx LEVEL_CONF_OFFSET + sta Levels+4, X ; seed[2] + jsr Random8 + ldx LEVEL_CONF_OFFSET + sta Levels+5, X ; seed[3] +end_init_seed: + + ; init the randomness with the values for the level + lda Levels+2, X ; seed[0] + sta SEED0 + lda Levels+3, X ; seed[1] + sta SEED1 + lda Levels+4, X ; seed[2] + sta SEED2 + lda Levels+5, X ; seed[3] + sta SEED3 + jsr Random8_Init + + ; init maze size + ldx LEVEL_CONF_OFFSET + txa + pha ; save LEVEL_CONF_OFFSET as its ZP will be overwritten + lda Levels+6, X ; size + tax + tay + jsr Init_Dimensions_Maze + + ; player position returned in X and Y + jsr Build_Level + jsr player_init ; param: player pos in X and Y + + jsr Random8_RestoreRandomness + + pla ; restore LEVEL_CONF_OFFSET + tax + lda TRUE + sta Levels+1, X; is_built + + lda FALSE + sta ExitLevel + + lda NextLevel + sta CurrentLevel + + rts + + +.import Player_XY +level_exit: + + ; get the level conf + lda #0 + ldx #0 + clc + get_level_conf_2: + tay + lda Levels, X + cmp CurrentLevel + beq end_idx_level_2 + tya + adc #SIZEOF_CONF_LEVEL + tax + bcc get_level_conf_2 + end_idx_level_2: + + ; save player pos in conf + lda Player_XY + sta Levels+7, X + lda Player_XY + 1 + sta Levels+8, X + + rts diff --git a/src/world/level.inc b/src/world/level.inc new file mode 100644 index 0000000..c12a5f5 --- /dev/null +++ b/src/world/level.inc @@ -0,0 +1,27 @@ +; Copyright (C) 2021 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 . + + +.include "level_private.inc" + +.import levels_init +.import level_enter ; param: A = level_nr +.import level_exit + +.import CurrentLevel +.import NextLevel +.import ExitLevel +.import Levels + diff --git a/src/world/level_private.inc b/src/world/level_private.inc new file mode 100644 index 0000000..7642e2e --- /dev/null +++ b/src/world/level_private.inc @@ -0,0 +1,42 @@ +; Copyright (C) 2021 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 . + + + + +; typedef struct +; { +; uint8_t level_nr; +; uint8_t is_built; +; uint8_t seed[4]; //< seed used to build the level +; uint8_t size; //< eLEVELSIZE +; coords_t pos_player_enter; //< position of player when entering the level (x,y) +; uint8_t actors[AA_NB]; //< number of reactive actors of each kind in the level +; } +; level_conf_t; + +; BEWARE: NB_LEVELS * SIZEOF_CONF_LEVEL shall not be > 256 +.define SIZEOF_CONF_LEVEL 12 +.define NB_LEVELS 5 + +.enum LEVELSIZE + TINY = 20 + SMALL = 24 + NORMAL = 32 + BIG = 48 + HUGE = 64 +.endenum + + diff --git a/src/world/world.asm b/src/world/world.asm new file mode 100644 index 0000000..5a6f206 --- /dev/null +++ b/src/world/world.asm @@ -0,0 +1,154 @@ + +; 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 . + + +.include "world.inc" +.include "../tiles.inc" +.include "../random.inc" +.include "../math.inc" +.include "../memory.inc" + + + +.export World + +; initializes the world +; DESTROYS A,X,Y, ZERO_2_1, ZERO_2_2, ZERO_2_3 +.export world_init + +; sets the player's position onto the Maze +; in: X = x coord in the maze +; in: Y = y coord in the maze +; out : X and Y as they where given +; DESTROYS A,X,Y, ZERO_2_1, ZERO_2_2, ZERO_2_4, ZERO_2_5 +.export world_set_player + +; Computes the adress corresponding to the coordinates in the maze +; in: X = x coord in the maze +; in: Y = y coord in the maze +; out: AX = Address corresponding to (x,y) in the World array +; DESTROYS A,X,Y, ZERO_2_1, ZERO_2_2, ZERO_2_3 +.export Compute_Maze_Addr + + +.define TILE_NR ZERO_2_1 +.define COORD_X ZERO_2_1 +.define COORD_Y ZERO_2_2 +.define OFFSET ZERO_2_2 + + +.BSS + +; The tile where the player stands +.struct Tile_player_standing + addr .word ; adress of the location + actor .byte ; actor on the location tile +.endstruct + +.CODE + +; @param X Player's x +; @param Y Player's y +world_init: + ; Saving the first tile on which the player stands + ; FIXME player could be standing anywhere on any type of floor + jsr Compute_Maze_Addr + stx Tile_player_standing::addr + sta Tile_player_standing::addr+1 + stx ZERO_2_1 + sta ZERO_2_1+1 + ldy #0 + lda (ZERO_2_1), Y + sta Tile_player_standing::actor + + rts + + +; sets the player's position onto the World +world_set_player: + + stx ZERO_2_4 + sty ZERO_2_5 + + ; restore the previous tile + ldx Tile_player_standing::addr + lda Tile_player_standing::addr+1 + stx ZERO_2_1 + sta ZERO_2_1+1 + ldy #0 + lda Tile_player_standing::actor + sta (ZERO_2_1), Y + + ; save the next tile + ldx ZERO_2_4 + ldy ZERO_2_5 + jsr Compute_Maze_Addr ; get's player's position address in memory + stx Tile_player_standing::addr + sta Tile_player_standing::addr+1 + stx ZERO_2_1 + sta ZERO_2_1+1 + ldy #0 + lda (ZERO_2_1), y + sta Tile_player_standing::actor + + ; sets the player on the tile + lda #ACTORS::PLAYER + sta (ZERO_2_1), y + + ; restore the given locations + ldx ZERO_2_4 + ldy ZERO_2_5 + + rts + +; Destroys ZERO_2_1, ZERO_2_2, ZERO_2_3 ZERO_7_1 and ZERO_7_2 +Compute_Maze_Addr: + + stx COORD_X + + ; offset due to Y coord + sty FAC1 + lda #WIDTH_WORLD + sta FAC2 + jsr mul8 + tay ; high part of the mul + txa ; low part of the mul + + ; adding offset due to X + clc + adc COORD_X + sta OFFSET + tya + adc #0 + sta OFFSET+1 + + ; adding the offset to the address + lda #World + adc OFFSET+1 ; high part of address to be returned in A + + rts + + + +.DATA + +.align 256 + +World: .res (WIDTH_WORLD) * (HEIGHT_WORLD) diff --git a/src/world/world.inc b/src/world/world.inc new file mode 100644 index 0000000..4ce1f1d --- /dev/null +++ b/src/world/world.inc @@ -0,0 +1,57 @@ +; Copyright (C) 2018-2021 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 . + + + + +; The world contains a Maze, filled with Actors +; Actors can be static, such a a floor or a wall, +; dynamic such as a door +; or alive, such as a monster + + +.define MAXIMUM_WIDTH_MAZE 64 ; must be a power of 2 +.define MAXIMUM_HEIGHT_MAZE 64 ; must be a power of 2 +.define WIDTH_WORLD 64 +.define NEG_WIDTH_WORLD $C0 +.define HEIGHT_WORLD 64 +.define NEG_HEIGHT_WORLD 64 $C0 + + +.enum ACTORS + + PLAYER = 0 + + FLOOR_1 = 1 + FLOOR_2 ; FLOOR BY DEFAULT + FLOOR_3 + FLOOR_4 + FLOOR_5 + FLOOR_6 + STAIR_DOWN + STAIR_UP + WALKABLE = STAIR_UP ; Player won't be allowed to go on anything > WALKABLE + + NOT_TRANSPARENT = STAIR_UP + NOT_WALKABLE + + WALL_1 = NOT_WALKABLE + WALL_2 + + UNKNOWN + + NB_ACTORS + +.endenum