Commit 43091111 authored by reassembler's avatar reassembler
Browse files

Simple formatting changes

parent ea67c5dd
......@@ -150,7 +150,6 @@ void OInitEngine::update_road()
check_road_split(); // Check/Process road split if necessary
uint32_t addr = road_seg_addr2;
uint16_t d0 = roms.rom0p->read16(&addr);
// Update next road section
if (d0 <= oroad.road_pos >> 16)
{
......
......@@ -217,13 +217,13 @@ void OSprites::sprite_control()
oinitengine.road_seg_addr1 += 4; // Increment to next long
seg_pos = roms.rom0p->read16(&a0); // Position In Level Data [Word]
seg_total_sprites = roms.rom0p->read8(&a0); // Number Of Sprites In Segment [byte]
d0 = roms.rom0p->read8(a0) * 4; // Sprite Data Entry Number From Lookup Table * 4 [Byte]
d0 = roms.rom0p->read8(a0) * 4; // Block of Sprites [Byte]
a0 = roms.rom0p->read32(outrun.adr.sprite_master_table + d0); // Set a0 to new address from master table of addresses
seg_sprite_freq = roms.rom0p->read16(&a0); // Set Sprite Frequency Value
seg_spr_offset2 = roms.rom0p->read16(&a0); // Set Reload value for sprite info offset
seg_spr_addr = a0; // Set ROM address for sprite info lookup (x, y, type)
// NOTE: Sets to value of a0 itself, not memory location
// NOTE: Sets to value of a0 itself, not memory location
seg_spr_offset1 = 0; // And Clear the offset into the above table
}
......@@ -254,7 +254,7 @@ void OSprites::sprite_control()
}
// ------------------------------------------------------------------------
// Sprite 2 - Note: We Attempt To Draw Two Sprites Each Cycle
// Sprite 2 - Second Sprite is slightly set back from the first.
// ------------------------------------------------------------------------
carry = seg_sprite_freq & 0x8000;
seg_sprite_freq = ((seg_sprite_freq << 1) | ((seg_sprite_freq & 0x8000) >> 15)) & 0xFFFF;
......
......@@ -11,6 +11,16 @@
#include "engine/olevelobjs.hpp"
#include "engine/otiles.hpp"
/*
Block End Position is when the block is deemed to end.
This is when the scenery is closest to the camera.
Road pos is close to the block end position.
The block that is displayed is the stuff closest to the camera.
*/
Tracked::Tracked(void)
{
......@@ -42,7 +52,8 @@ void Tracked::tick()
if (cannonball::tick_frame) controls();
tick_track();
video.clear_text_ram();
display_sprite_info();
//display_sprite_info();
display_path_info();
break;
}
}
......@@ -78,17 +89,35 @@ void Tracked::tick_track()
oinitengine.set_granular_position();
}
void Tracked::display_path_info()
{
static const int TX = 16; // Text X Offset
uint32_t addr = oroad.stage_addr + oroad.road_data_offset;
const int16_t x1 = (int16_t) roms.rom1p->read16(addr);
const int16_t x2 = (int16_t) roms.rom1p->read16(addr + 2);
const uint16_t road_pos = oroad.road_pos >> 16;
ohud.blit_text_new(0, 0, "ROAD POS", OHud::GREEN);
ohud.blit_text_new(TX, 0, config.to_string(road_pos).c_str(), OHud::GREEN);
ohud.blit_text_new(0, 3, "X1 ", OHud::GREEN);
ohud.blit_text_new(TX, 3, config.to_string(x1).c_str(), OHud::GREEN);
ohud.blit_text_new(0, 4, "X2 ", OHud::GREEN);
ohud.blit_text_new(TX, 4, config.to_string(x2).c_str(), OHud::GREEN);
}
void Tracked::display_sprite_info()
{
static const int TX = 16;
static const int TX = 16; // Text X Offset
uint16_t road_pos = oroad.road_pos >> 16;
if (road_pos < 8) return;
uint32_t sprite_adr = oinitengine.road_seg_addr1 - 4;
uint16_t block_start = roms.rom0p->read16(&sprite_adr);
uint16_t block_end = roms.rom0p->read16(oinitengine.road_seg_addr1);
uint8_t total_spr = roms.rom0p->read8(&sprite_adr);
uint8_t sprite_id = roms.rom0p->read8(&sprite_adr);
uint16_t block_start = roms.rom0p->read16(&sprite_adr); // Road pos of block start
uint16_t block_end = roms.rom0p->read16(oinitengine.road_seg_addr1); // Road pos of block end
uint8_t total_spr = roms.rom0p->read8(&sprite_adr); // Number of sprites in block
uint8_t sprite_id = roms.rom0p->read8(&sprite_adr); // Sprite Block ID (Used to lookup block)
// Master Sprite Table
//
......
......@@ -24,5 +24,6 @@ private:
void tick_track();
void controls();
void display_sprite_info();
void display_path_info();
std::string dec_to_bin(int nValue, bool bReverse = false);
};
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment