TUTORIAL #20 – SHPADR “Is used as a pointer for the SHAPE/TILE GRAPHICS used on the world map”.
All the graphic-tiles/shapes in Ultima 1 are predefined within a database SHPADR. These values consist of the type of shape used such as TREES, PLAINS, MOUNTAINS, OCEAN, etc… They are structured and referenced exactly as the MAPADR data each shape on the map is defined by a value from 0 to 15. This value is what represent a particular shape such as the fighter or the troll.
I will be going through the subroutine SHPADR line-by-line and explaining what each line of code is doing
and how it affects the outcome of the program.
719 **********************************
This is just a comment line to separate each subroutine and
helps to define the start of the subroutine.
720 * LOAD SHAPE ADDRESSES INTO SHPADR, LOW BYTE
FIRST
This comment line tells the user what type of data will be
referenced.
721 SHPADR DFB >SHAPE1
Line 721 is used to “[D]e[F]ine [B]ype” of SHAPE1
data location from the LOW byte side.
Each SHAPE location is defined by a HIGH and LOW byte, which in this case
is the > character representing the LOW byte location for the map addresses
in MAP1. An example of a memory region
address from the HIGH and LOW byte reference could be HEX $8000 or 32768. The HIGH side would be the 80 and the LOW
side would be the 00 of the HEX value $8000.
Also, line 721 has a header titled SHPADR, which allows it to be
called as a separate subroutine from the main subroutine.
722 DFB <SHAPE1
Line 722 is used to “[D]e[F]ine [B]ype” of MAP1
data location from the HIGH byte side.
Each MAP location is defined by a HIGH and LOW byte, which in this case
is the < character representing the HIGH byte location for the map addresses
in SHAPE1. SHAPE1 will call to a
database that will hold all the graphic tile types for a space on the
horizontal line of the world map. By
using a HIGH and LOW byte reference the map address is location in a memory
region based on the byte reference and can be called to reference the necessary
data of that map line.
723 DFB >SHAPE2
THRU
752 DFB <SHAPE16
Line 723 THRU 752 are all reference the same way with “[D]e[F]ine [B]ype” of SHAPE# data location. Each MAP location is defined by a HIGH and
LOW byte will be referenced the exact same way and hold all the world map data
information to help draw out the entire Ultima World map.
These are the following shape/graphic tile reference values and
their equivalent shape.
SHAPE1 = SHIP
SHAPE2 = RAFT
SHAPE3 = PLAINS
SHAPE4 = TREES
SHAPE5 = CASTLE
SHAPE6 = TOWN
SHAPE7 = SIGNPOST
SHAPE8 = CHARACTER
SHAPE9 = TROLL
SHAPE10 = DUNGEON
SHAPE11 = CART
SHAPE12 = HORSE
SHAPE13 = SPEEDER
SHAPE14 = SPACE SHIP
SHAPE15 = OCEAN
SHAPE16 = MOUNTAIN
Please email me any questions you might have,
Joe “kingspud”
No comments:
Post a Comment