Hallo
Ich fummel gerade an einem Amiga Emulator rum.
Das Problem das ich genau habe ist folgendes:
Der Emuator zeigt, wenn ein HAM Bild oder der HAM Modus aktiviert wird das Bild perfekt an.
Jedoch kehrt er nicht nach dem Anzeigen nicht wieder in den alten Bildschirmmodus zurück, was zu Farbfehlern führt da die passende Farbpalette nicht stimmt.
In Zeile 10 wird ja entschieden, wenn der HAM Modus erkannt wird diesen anzuzeigen, was ja auch funktioniert.
In Zeile 14 ist die Situation so das wenn kein HAM Modus erkannt wird der standart ECS Modus wieder laufen soll.
Dieser ECS Modus funktioniert solange 1a bis irgendetwas mit dem HAM Modus geladen wird. In diesem Augenblick bleibt er in diesem Modus.
Auch ein Reset hilft nicht.
Jetzt mein anliegen. Wie kann oder könnte man den ECS Modus wiederherstellen oder sogar nach dem HAM Modus erzwingen?
Als Beispiel füge ich noch ein paar Screenshots bei.
Da ich nicht so der erfahrene Typ was Coding betrifft wende ich mich an euch.
Beachtet bitte auch das es sich hier um einen Fremdcode handelt.
Gruß Markus
Alles anzeigen
ECS Modus funktioniert perfekt
Simulator Screen Shot 09.07.2016, 06.19.46.png
HAM Bild wird perfekt mit richtigen Farben angezeigt
Simulator Screen Shot 09.07.2016, 06.20.04.png
Danach ein Reset und der Emulator bleibt im HAM Modus was er nicht tun sollte.
Entsprechend passen die Farben nicht mehr.
Simulator Screen Shot 09.07.2016, 06.20.14.png
Ich fummel gerade an einem Amiga Emulator rum.
Das Problem das ich genau habe ist folgendes:
Der Emuator zeigt, wenn ein HAM Bild oder der HAM Modus aktiviert wird das Bild perfekt an.
Jedoch kehrt er nicht nach dem Anzeigen nicht wieder in den alten Bildschirmmodus zurück, was zu Farbfehlern führt da die passende Farbpalette nicht stimmt.
In Zeile 10 wird ja entschieden, wenn der HAM Modus erkannt wird diesen anzuzeigen, was ja auch funktioniert.
In Zeile 14 ist die Situation so das wenn kein HAM Modus erkannt wird der standart ECS Modus wieder laufen soll.
Dieser ECS Modus funktioniert solange 1a bis irgendetwas mit dem HAM Modus geladen wird. In diesem Augenblick bleibt er in diesem Modus.
Auch ein Reset hilft nicht.
Jetzt mein anliegen. Wie kann oder könnte man den ECS Modus wiederherstellen oder sogar nach dem HAM Modus erzwingen?
Als Beispiel füge ich noch ein paar Screenshots bei.
Da ich nicht so der erfahrene Typ was Coding betrifft wende ich mich an euch.
Beachtet bitte auch das es sich hier um einen Fremdcode handelt.
Gruß Markus
C-Quellcode
- static __inline__ int LNAME (int spix, int dpix, int stoppos)
- {
- /* CASO DUAL
- unsigned short *buf = ((unsigned short *)xlinebuffer);
- /* HAM CASE
- if (dp_for_drawing->ham_seen) {
- while (dpix < stoppos) {
- buf[dpix++]= (xcolors[ham_linebuf[spix]]);
- spix += SRC_INC;
- UNROLL_PFIELD;
- }
- } else if (bpldualpfpri) {
- // OCS/ECS Dual playfield
- int *lookup = bpldualpfpri ? dblpf_ind2 : dblpf_ind1;
- #if defined(DREAMCAST)
- register int resto=(((unsigned)&buf[dpix])&0x1f);
- if (resto)
- resto=0x20-resto;
- if (resto>(stoppos-dpix))
- resto=(stoppos-dpix);
- while (resto>0) {
- register unsigned short d = colors_for_drawing.acolors[lookup[pixdata.apixels[spix]]];
- buf[dpix++]= d;
- spix += SRC_INC;
- resto-=2;
- }
- if (dpix >= stoppos)
- return spix;
- unsigned int *d = (unsigned int *)(void *)
- (0xe0000000 | (((unsigned long)&buf[dpix]) & 0x03ffffe0));
- unsigned short *s = (unsigned short *)&colors_for_drawing.acolors[lookup[pixdata.apixels[spix]]];
- unsigned n=((stoppos-dpix)>>4);
- {
- register unsigned tmp=n<<4;
- resto=(stoppos-dpix)-tmp;
- dpix+=tmp;
- }
- QACR0 = ((((unsigned int)&buf[dpix])>>26)<<2)&0x1c;
- QACR1 = ((((unsigned int)&buf[dpix])>>26)<<2)&0x1c;
- while(n--) {
- // asm("pref @%0" : : "r" (s + 8));
- register unsigned dato;
- dato=*s; spix += SRC_INC; s = (unsigned short *)&colors_for_drawing.acolors[lookup[pixdata.apixels[spix]]]; dato|=(((unsigned)*s)<<16);
- d[0] = dato; spix += SRC_INC; s = (unsigned short *)&colors_for_drawing.acolors[lookup[pixdata.apixels[spix]]];
- dato=*s; spix += SRC_INC; s = (unsigned short *)&colors_for_drawing.acolors[lookup[pixdata.apixels[spix]]]; dato|=(((unsigned)*s)<<16);
- d[1] = dato; spix += SRC_INC; s = (unsigned short *)&colors_for_drawing.acolors[lookup[pixdata.apixels[spix]]];
- dato=*s; spix += SRC_INC; s = (unsigned short *)&colors_for_drawing.acolors[lookup[pixdata.apixels[spix]]]; dato|=(((unsigned)*s)<<16);
- d[2] = dato; spix += SRC_INC; s = (unsigned short *)&colors_for_drawing.acolors[lookup[pixdata.apixels[spix]]];
- dato=*s; spix += SRC_INC; s = (unsigned short *)&colors_for_drawing.acolors[lookup[pixdata.apixels[spix]]]; dato|=(((unsigned)*s)<<16);
- d[3] = dato; spix += SRC_INC; s = (unsigned short *)&colors_for_drawing.acolors[lookup[pixdata.apixels[spix]]];
- dato=*s; spix += SRC_INC; s = (unsigned short *)&colors_for_drawing.acolors[lookup[pixdata.apixels[spix]]]; dato|=(((unsigned)*s)<<16);
- d[4] = dato; spix += SRC_INC; s = (unsigned short *)&colors_for_drawing.acolors[lookup[pixdata.apixels[spix]]];
- dato=*s; spix += SRC_INC; s = (unsigned short *)&colors_for_drawing.acolors[lookup[pixdata.apixels[spix]]]; dato|=(((unsigned)*s)<<16);
- d[5] = dato; spix += SRC_INC; s = (unsigned short *)&colors_for_drawing.acolors[lookup[pixdata.apixels[spix]]];
- dato=*s; spix += SRC_INC; s = (unsigned short *)&colors_for_drawing.acolors[lookup[pixdata.apixels[spix]]]; dato|=(((unsigned)*s)<<16);
- d[6] = dato; spix += SRC_INC; s = (unsigned short *)&colors_for_drawing.acolors[lookup[pixdata.apixels[spix]]];
- dato=*s; spix += SRC_INC; s = (unsigned short *)&colors_for_drawing.acolors[lookup[pixdata.apixels[spix]]]; dato|=(((unsigned)*s)<<16);
- d[7] = dato; spix += SRC_INC; s = (unsigned short *)&colors_for_drawing.acolors[lookup[pixdata.apixels[spix]]];
- asm("pref @%0" : : "r" (d));
- d+=8;
- }
- d = (unsigned int *)0xe0000000;
- d[0] = d[8] = 0;
- while (resto>0) {
- register unsigned short d = colors_for_drawing.acolors[lookup[pixdata.apixels[spix]]];
- buf[dpix++]= d;
- spix += SRC_INC;
- resto--;
- }
- #else
- while (dpix < stoppos) {
- register unsigned short d = colors_for_drawing.acolors[lookup[pixdata.apixels[spix]]];
- buf[dpix++] = d;
- spix += SRC_INC;
- }
- #endif
- //HIGH BRIGHT CASE
- } else if (bplehb) {
- #if defined(DREAMCAST)
- #error NOT IMPLEMENTED YET
- #else
- while (dpix < stoppos) {
- uae_u32 spix_val = pixdata.apixels[spix];
- register unsigned short d = pixdata.apixels[spix];
- if (d <= 31)
- buf[dpix++] = colors_for_drawing.acolors[d];
- else
- buf[dpix++] = xcolors[(colors_for_drawing.color_uae_regs_ecs[d - 32] >> 1) & 0x777];
- spix += SRC_INC;
- }
- #endif
- } else {
- // CASO NORMAL
- #if defined(DREAMCAST)
- register int resto=(((unsigned)&buf[dpix])&0x1f);
- if (resto)
- resto=0x20-resto;
- if (resto>(stoppos-dpix))
- resto=(stoppos-dpix);
- while (resto>0) {
- buf[dpix++]= (colors_for_drawing.acolors[pixdata.apixels[spix]]);
- spix += SRC_INC;
- resto-=2;
- }
- if (dpix >= stoppos)
- return spix;
- unsigned int *d = (unsigned int *)(void *)
- (0xe0000000 | (((unsigned long)&buf[dpix]) & 0x03ffffe0));
- unsigned short *s = (unsigned short *)&colors_for_drawing.acolors[pixdata.apixels[spix]];
- unsigned n=((stoppos-dpix)>>4);
- {
- register unsigned tmp=n<<4;
- resto=(stoppos-dpix)-tmp;
- dpix+=tmp;
- }
- QACR0 = ((((unsigned int)&buf[dpix])>>26)<<2)&0x1c;
- QACR1 = ((((unsigned int)&buf[dpix])>>26)<<2)&0x1c;
- while(n--) {
- // asm("pref @%0" : : "r" (s + 8));
- register unsigned dato;
- dato=*s; spix += SRC_INC; s = (unsigned short *)&colors_for_drawing.acolors[pixdata.apixels[spix]]; dato|=(((unsigned)*s)<<16);
- d[0] = dato; spix += SRC_INC; s = (unsigned short *)&colors_for_drawing.acolors[pixdata.apixels[spix]];
- dato=*s; spix += SRC_INC; s = (unsigned short *)&colors_for_drawing.acolors[pixdata.apixels[spix]]; dato|=(((unsigned)*s)<<16);
- d[1] = dato; spix += SRC_INC; s = (unsigned short *)&colors_for_drawing.acolors[pixdata.apixels[spix]];
- dato=*s; spix += SRC_INC; s = (unsigned short *)&colors_for_drawing.acolors[pixdata.apixels[spix]]; dato|=(((unsigned)*s)<<16);
- d[2] = dato; spix += SRC_INC; s = (unsigned short *)&colors_for_drawing.acolors[pixdata.apixels[spix]];
- dato=*s; spix += SRC_INC; s = (unsigned short *)&colors_for_drawing.acolors[pixdata.apixels[spix]]; dato|=(((unsigned)*s)<<16);
- d[3] = dato; spix += SRC_INC; s = (unsigned short *)&colors_for_drawing.acolors[pixdata.apixels[spix]];
- dato=*s; spix += SRC_INC; s = (unsigned short *)&colors_for_drawing.acolors[pixdata.apixels[spix]]; dato|=(((unsigned)*s)<<16);
- d[4] = dato; spix += SRC_INC; s = (unsigned short *)&colors_for_drawing.acolors[pixdata.apixels[spix]];
- dato=*s; spix += SRC_INC; s = (unsigned short *)&colors_for_drawing.acolors[pixdata.apixels[spix]]; dato|=(((unsigned)*s)<<16);
- d[5] = dato; spix += SRC_INC; s = (unsigned short *)&colors_for_drawing.acolors[pixdata.apixels[spix]];
- dato=*s; spix += SRC_INC; s = (unsigned short *)&colors_for_drawing.acolors[pixdata.apixels[spix]]; dato|=(((unsigned)*s)<<16);
- d[6] = dato; spix += SRC_INC; s = (unsigned short *)&colors_for_drawing.acolors[pixdata.apixels[spix]];
- dato=*s; spix += SRC_INC; s = (unsigned short *)&colors_for_drawing.acolors[pixdata.apixels[spix]]; dato|=(((unsigned)*s)<<16);
- d[7] = dato; spix += SRC_INC; s = (unsigned short *)&colors_for_drawing.acolors[pixdata.apixels[spix]];
- asm("pref @%0" : : "r" (d));
- d+=8;
- }
- d = (unsigned int *)0xe0000000;
- d[0] = d[8] = 0;
- while (resto>0) {
- buf[dpix++]= (colors_for_drawing.acolors[pixdata.apixels[spix]]);
- spix += SRC_INC;
- resto--;
- }
- #else
- while (dpix < stoppos) {
- buf[dpix++]= (colors_for_drawing.acolors[pixdata.apixels[spix]]);
- spix += SRC_INC;
- }
- #endif
- }
- return spix;
- }
- #undef LNAME
- #undef HDOUBLE
- #undef SRC_INC
Simulator Screen Shot 09.07.2016, 06.19.46.png
HAM Bild wird perfekt mit richtigen Farben angezeigt
Simulator Screen Shot 09.07.2016, 06.20.04.png
Danach ein Reset und der Emulator bleibt im HAM Modus was er nicht tun sollte.
Entsprechend passen die Farben nicht mehr.
Simulator Screen Shot 09.07.2016, 06.20.14.png