MCPcopy Create free account
hub / github.com/BlitterStudio/amiberry / illg_init

Function illg_init

src/debug.cpp:3900–3966  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3898}
3899
3900static void illg_init (void)
3901{
3902 int i;
3903 uae_u8 c = 3;
3904 uaecptr addr, end;
3905
3906 illgdebug = xcalloc (uae_u8, 0x01000000);
3907 illghdebug = xcalloc (uae_u8, 65536);
3908 if (!illgdebug || !illghdebug) {
3909 illg_free();
3910 return;
3911 }
3912 addr = 0xffffffff;
3913 nextaddr_init(addr);
3914 while ((addr = nextaddr(addr, 0, &end, false, NULL)) != 0xffffffff) {
3915 if (end < 0x01000000) {
3916 memset (illgdebug + addr, c, end - addr);
3917 } else {
3918 uae_u32 s = addr >> 16;
3919 uae_u32 e = end >> 16;
3920 memset (illghdebug + s, c, e - s);
3921 }
3922 addr = end - 1;
3923 }
3924 for (int i = 0; i < MAX_RTG_BOARDS; i++) {
3925 if (currprefs.rtgboards[i].rtgmem_size)
3926 memset (illghdebug + (gfxmem_banks[i]->start >> 16), 3, currprefs.rtgboards[i].rtgmem_size >> 16);
3927 }
3928
3929 i = 0;
3930 while (custd[i].name) {
3931 int rw = (custd[i].special & CD_WO) ? 2 : 1;
3932 illgdebug[custd[i].adr] = rw;
3933 illgdebug[custd[i].adr + 1] = rw;
3934 i++;
3935 }
3936 for (i = 0; i < 16; i++) { /* CIAs */
3937 if (i == 11)
3938 continue;
3939 illgdebug[0xbfe001 + i * 0x100] = c;
3940 illgdebug[0xbfd000 + i * 0x100] = c;
3941 }
3942 memset (illgdebug + 0xf80000, 1, 512 * 1024); /* KS ROM */
3943 memset (illgdebug + 0xdc0000, c, 0x3f); /* clock */
3944#ifdef CDTV
3945 if (currprefs.cs_cdtvram) {
3946 memset (illgdebug + 0xdc8000, c, 4096); /* CDTV batt RAM */
3947 memset (illgdebug + 0xf00000, 1, 256 * 1024); /* CDTV ext ROM */
3948 }
3949#endif
3950#ifdef CD32
3951 if (currprefs.cs_cd32cd) {
3952 memset (illgdebug + AKIKO_BASE, c, AKIKO_BASE_END - AKIKO_BASE);
3953 memset (illgdebug + 0xe00000, 1, 512 * 1024); /* CD32 ext ROM */
3954 }
3955#endif
3956 if (currprefs.cs_ksmirror_e0)
3957 memset (illgdebug + 0xe00000, 1, 512 * 1024);

Callers 1

memwatchFunction · 0.85

Calls 3

illg_freeFunction · 0.85
nextaddr_initFunction · 0.85
nextaddrFunction · 0.85

Tested by

no test coverage detected