Author Topic: Motherload  (Read 53333 times)

0 Members and 1 Guest are viewing this topic.

Offline DrDnar

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 546
  • Rating: +97/-1
    • View Profile
Re: Motherload
« Reply #285 on: April 07, 2011, 10:37:15 pm »
You can't use files if you swap in a spare RAM page and take control over the whole calculator, which I do.  I can't use very many OS routines this way.
What would you want to keep in an external file? You can always cache the location of archived data, and swap those pages manually, e.g.
Code: [Select]
getExternalData:
; Reads data from an external data file in the archive. The location must be cached.
; Data file must not be larger than 16K.
; Input:
; - HL: Address. If greater than 8000h, will wrap to next page
; - (dataPage): Base page that the external data file resides on
in a, (6)
push af
ld d, (dataPage)
ld a, 080h ; CHANGE FOR APPS!!
cp h
jp nc, dataInArchGoodAddr
ld a, 0C0
add a, h
ld h, a
inc d
dataInArchGoodAddr:
ld a, d
out (6), a ; CHANGE FOR APPS!!
ld d, (hl)
pop af
out (6), a
ld a, d
ret
EDIT: Yes, I know you're writing in Axe, but Axe can embed assembly code. Also, this can be optimized if you save the page of your application in RAM.
« Last Edit: April 07, 2011, 10:44:45 pm by DrDnar »
"No tools will make a man a skilled workman, or master of defense, nor be of any use to him who has not learned how to handle them, and has never bestowed any attention upon them. . . . Yes, [] the tools which would teach men their own use would be beyond price."—Plato's The Republic, circa 380 BC

Offline willrandship

  • Omnimagus of the Multi-Base.
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2953
  • Rating: +98/-13
  • Insert sugar to begin programming subroutine.
    • View Profile
Re: Motherload
« Reply #286 on: April 07, 2011, 10:38:16 pm »
but this is in axe :P I suppose there's always the hex command :P

SirCmpwn

  • Guest
Re: Motherload
« Reply #287 on: April 07, 2011, 10:44:01 pm »
I could use that to read data, but saving data is a concern.

Offline DrDnar

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 546
  • Rating: +97/-1
    • View Profile
Re: Motherload
« Reply #288 on: April 07, 2011, 11:10:01 pm »
Yeah, reading from flash definitely has some major drawbacks that limits its use. There's also flash write and flash copy code, but I'd recommend against doing that for anything other than saving when the user quits. BrandonW has routines for creating variables directly in flash, but in the end, all this extra code might not actually save you any space. It's still something to keep in mind, especially in places where performance matters less.

I'd like to know how exactly you're remapping memory, because I can think of lots of hacks for getting more memory to use. Like, it seems to me that way too many people forget that there are 400 bytes of free RAM at the stack. You just have to be a little careful about your stack usage.
« Last Edit: April 07, 2011, 11:10:58 pm by DrDnar »
"No tools will make a man a skilled workman, or master of defense, nor be of any use to him who has not learned how to handle them, and has never bestowed any attention upon them. . . . Yes, [] the tools which would teach men their own use would be beyond price."—Plato's The Republic, circa 380 BC

SirCmpwn

  • Guest
Re: Motherload
« Reply #289 on: April 07, 2011, 11:12:17 pm »
I think I'll be able to work with as much RAM as I have right now, but for the record, I'm putting page 0x83 into bank 2.

Offline willrandship

  • Omnimagus of the Multi-Base.
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2953
  • Rating: +98/-13
  • Insert sugar to begin programming subroutine.
    • View Profile
Re: Motherload
« Reply #290 on: April 08, 2011, 01:15:34 am »
Hooray! I think  :-\ Well, glad to hear you got around that :) Love the demo.

Do you plan on having variable digging speeds, or is it already there? In the original, the deeper you were the slower everything dug.

SirCmpwn

  • Guest
Re: Motherload
« Reply #291 on: April 08, 2011, 09:05:17 am »
I will try to implement that as best I can.

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Motherload
« Reply #292 on: April 08, 2011, 01:44:52 pm »
I'm curious as to what is taking up the enormous amount of space in this app.  You said previously that you had 13000 bytes of program in the app, and later that you optimized around 1000 bytes?  So what specifically is taking up this 12000 bytes of space?  Like in terms of the tilemapper, physics, and graphics?

SirCmpwn

  • Guest
Re: Motherload
« Reply #293 on: April 08, 2011, 04:21:48 pm »
Well, there is the tilemapper, the physics, the HUD, map generation, a placeholder for the surface map, sprites, and everything needed to tie them together.

Offline willrandship

  • Omnimagus of the Multi-Base.
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2953
  • Rating: +98/-13
  • Insert sugar to begin programming subroutine.
    • View Profile
Re: Motherload
« Reply #294 on: April 08, 2011, 05:52:49 pm »
Placeholder? Is that in case there isn't already a map file? Perhaps you could optimize that away with a generator, or force an error if there isn't one, while including one in the final program's zip file.

SirCmpwn

  • Guest
Re: Motherload
« Reply #295 on: April 08, 2011, 05:54:05 pm »
Placeholder? Is that in case there isn't already a map file? Perhaps you could optimize that away with a generator, or force an error if there isn't one, while including one in the final program's zip file.
I can't automatically generate the surface map, and in any case, there isn't enough RAM.  My optimizations have brought me up to almost 5,000 bytes of space left, so perhaps I can get it smaller.

Offline ztrumpet

  • The Rarely Active One
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5712
  • Rating: +364/-4
  • If you see this, send me a PM. Just for fun.
    • View Profile
Re: Motherload
« Reply #296 on: April 08, 2011, 06:44:09 pm »
Sir, did you see my edit from last night?  Are you going to put a height limit on negative feet and a terminal velocity?
« Last Edit: April 08, 2011, 06:44:36 pm by ztrumpet »

SirCmpwn

  • Guest
Re: Motherload
« Reply #297 on: April 08, 2011, 06:48:17 pm »
Sir, did you see my edit from last night?  Are you going to put a height limit on negative feet and a terminal velocity?
I will eventually put a height limit on negative depth at about -100, and there already is a terminal velocity.

Offline whitevalkery

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 129
  • Rating: +10/-10
  • DCS7 Beta tester
    • View Profile
Re: Motherload
« Reply #298 on: May 17, 2011, 04:56:38 pm »
wow... the demo is awesome!

i found some weird stuff though :/
you can go towards the right infinitly and after you go a certain distance you start getting an extra row of stuff above the original surface, and you can't land on it while you can dig it. If you attempt to land on it you seem to just fall through it and land on the second level and unable to fly out since the layer above you remains intact. if you keep flying or digging in ththat direction even further you get bugs in which there are undiggable blocks that look like what was the intended sprite for the drill? O.o



Used to be Schoolhacker...

SirCmpwn

  • Guest
Re: Motherload
« Reply #299 on: May 17, 2011, 04:57:35 pm »
wow... the demo is awesome!

i found some weird stuff though :/
you can go towards the right infinitly and after you go a certain distance you start getting an extra row of stuff above the original surface, and you can't land on it while you can dig it. If you attempt to land on it you seem to just fall through it and land on the second level and unable to fly out since the layer above you remains intact. if you keep flying or digging in ththat direction even further you get bugs in which there are undiggable blocks that look like what was the intended sprite for the drill? O.o
You got it right.  I'm aware of these issues, and have them fixed in my personal version.