I'm experimenting sjasm's struct and map commands.
I want to allocate in RAM an array of 24 structs to store enemies data.
I defined a map area starting from 0xc000 for all RAM data with this code:
[...] ; <-- rom code and data here in the 0x4000-0x7FFF range map 0xc000 ; other variables dxmap #1 xmap #2 yship #1 xship #2 aniframe #1 anispeed #1 ram_sat #128 ; struct declared struct enemy_data y db 0 x dw 0 status db 0 ends ; actual enemy data - at least in my idea ;-) enemies: [24] enemy_data endmap
The problem is that, from what I can see, the labels generated for enemies are allocated in ROM, and not in the map area allocated at 0xc000 in the RAM.
I get this in the .lst file:
[...] 00:00006C42 X ms_demo_shapes_95 ; <- last location used in rom 00:0000C000 dxmap ; <- ram variables correctly allocated in 0xc000 00:0000C001 xmap 00:0000C003 yship 00:0000C004 X xship 00:0000C006 aniframe 00:0000C007 anispeed 00:0000C008 ram_sat 00:00000000 X enemy_data.y 00:00000001 X enemy_data.x 00:00000003 X enemy_data.status 00:00000004 X enemy_data 00:00006C62 X enemies ; <- ARRAY of STRUCTS allocated in ROM instead of RAM !!!
How to say to sjasm that these variables defined as struct go in the 0xc000 area ?
Login or register to post comments
