Browse Source

fixing ppu::LTS()

malformed calculation of segment address lead to a 22byte instead of the correct 16byte length being added per segment address offset
master
constantinfuerst 3 years ago
parent
commit
aa4eb85c2e
  1. BIN
      .vs/cpu_design_and_emulator/v16/Solution.VC.db-shm
  2. BIN
      .vs/cpu_design_and_emulator/v16/Solution.VC.db-wal
  3. 2
      cpu_design_and_emulator/main.cpp
  4. 3
      cpu_design_and_emulator/microprocessor/ppu/ppu.cpp
  5. 5
      cpu_design_and_emulator/microprocessor/sdh/sdh.cpp
  6. 2
      custom_asm_macro_compiler/compiler/compiling/wrappers.cpp

BIN
.vs/cpu_design_and_emulator/v16/Solution.VC.db-shm

BIN
.vs/cpu_design_and_emulator/v16/Solution.VC.db-wal

2
cpu_design_and_emulator/main.cpp

@ -75,7 +75,7 @@ void computer::initMembers() {
const uint16_t ramsize = 0x1000;
const uint16_t ramoffset = 0x0010;
const uint16_t romstart = ramsize + ramoffset;
const uint16_t romend = romstart + code->size();
const uint16_t romend = romstart + code->size() - 1;
const uint16_t stackStart = (ramsize / 4) + ramoffset;
const uint16_t true_memsize = ramsize + 1 - ramoffset;

3
cpu_design_and_emulator/microprocessor/ppu/ppu.cpp

@ -61,10 +61,11 @@ void ppu::CCP() {
void ppu::LTS() {
const uint16_t pure_addr = (public_register[3] << 8) + public_register[2];
const uint16_t segment_addr = pure_addr + segment * 7 + segment * 15;
const uint16_t segment_addr = pure_addr + segment * 16;
const uint16_t gmemaddr = 0x0009 + sector * 2;
const uint8_t seg_addr_lo = segment_addr;
const uint8_t seg_addr_hi = segment_addr >> 8;
const uint16_t seg_addr = seg_addr_lo | seg_addr_hi << 8;
graphics_bus->write(gmemaddr + 0, seg_addr_lo);
graphics_bus->write(gmemaddr + 1, seg_addr_hi);
const uint16_t p_addr = floor(sector / 2) + 0x01ff;

5
cpu_design_and_emulator/microprocessor/sdh/sdh.cpp

@ -62,13 +62,10 @@ void sdh::displaySingleColor() {
void sdh::displaySegment(const uint8_t& seg) {
readSegmentPtr(seg);
if (c_segAddr == 0x0000) return;
readPalette(seg);
calcPos(seg);
if (c_segAddr == 0x0000) {
return;
}
for (uint8_t seg_part = 0; seg_part < 16; seg_part++) {
const uint8_t current_segval = rom->read(c_segAddr + seg_part);
uint8_t line = floor(seg_part / 2);

2
custom_asm_macro_compiler/compiler/compiling/wrappers.cpp

@ -142,7 +142,7 @@ void compiler::appendGraphicsData() {
codeVEC[2] = pStart & 0x00ff;
codeVEC[5] = pStart >> 8;
for (auto i = 0; i < scount; i++) {
for (unsigned int i = 0; i < scount; i++) {
auto ident = "segment_" + std::to_string(i);
auto ss = json["segments"][ident].get<std::array<std::string, 16>>();
for (auto& s : ss) {

Loading…
Cancel
Save